Closed jiechic closed 7 months ago
it's report sonar result on gitlab PR
Hi @jiechic,
Could you try using your_module.sonar.sources
and your_module.sonar.tests
instead of your_module.sonar.projectBaseDir
?
I suspect files are not indexed properly during the analysis.
it's use the same setting with main project setting, in the pr code , i can see new code
i test info for setting your_module.sonar.tests
it's also no effect
This issue is stale because it has been open for 90 days with no activity.
have any update?
Hi @jiechic,
Could you show the content of your manually generated analysis-results.txt ?
Hello @jiechic,
beware, there is 2 differents things you need to understand. Result on sonar-scanner and result on Sonarqube.
Unlike all other languages managed by sonar, this plugin does not display your customized results.
You need to configure your own custom rules on analysis_options.yaml
for sonar-scanner to find your MANUAL report.
But you also need to configure the same rules on your custom Quality Rules on Sonarqube, so that it can analyze the report send by sonar-scanner and process the results.
At least that's how I understood it.
Personally, I have configured my 72 custom rules in Sonarqube.
But I agree, on one of my PHP project, sonnar-scanner analyzes my project and I can specify a custom report in addition which is well present on Sonarqube.
Hi @jiechic,
Could you show the content of your manually generated analysis-results.txt ?
I'm upload a new analysis-results.txt for issue
Hello @jiechic,
beware, there is 2 differents things you need to understand. Result on sonar-scanner and result on Sonarqube.
Unlike all other languages managed by sonar, this plugin does not display your customized results. You need to configure your own custom rules on
analysis_options.yaml
for sonar-scanner to find your MANUAL report. But you also need to configure the same rules on your custom Quality Rules on Sonarqube, so that it can analyze the report send by sonar-scanner and process the results.At least that's how I understood it.
Personally, I have configured my 72 custom rules in Sonarqube.
But I agree, on one of my PHP project, sonnar-scanner analyzes my project and I can specify a custom report in addition which is well present on Sonarqube.
ths for answer i have a project is android it has custom rules use android lints but sonar havn't these lint ,then it also show lint result on pr result page。
Okay, well, I don't know if that helps.
In my case, I don't you MACHINE report mode, I using the LEGACY mode.
And I run the Analyzer with the following command: dart analyze > analyzer_report.txt
I do not analyze with flutter
because the order of the message in the line result is not the same than dart. And this plugin can only read the dart order in LEGACY mode and not flutter. (Of course you need to have your own analysis_options.yaml
, with flutter rules).
# Project identification
sonar.projectName=program
sonar.projectKey=program
sonar.projectVersion=1.0
sonar.qualitygate.wait=true
sonar.language=dart
# Encoding of the source code. Default is default system encoding.
sonar.sourceEncoding=UTF-8
# Source code location.
# Path is relative to the sonar-project.properties file. Defaults to .
# Use commas to specify more than one file/folder.
# It is good practice to add pubspec.yaml to the sources as the analyzer
# may produce warnings for this file as well.
sonar.modules=app,package1,package2,package3,package4
## app
app.sonar.projectBaseDir=app/program
app.sonar.sources=lib,pubspec.yaml,pubspec_overrides.yaml,analysis_options.yaml
app.sonar.exclusions=**/*.g.dart
app.sonar.tests=test
app.sonar.flutter.tests.reportPath=test-results/app-flutter-test-results.json
app.sonar.flutter.coverage.reportPath=coverage/lcov.info
app.sonar.dart.analyzer.mode=MANUAL
app.sonar.dart.analyzer.report.mode=LEGACY
app.sonar.dart.analyzer.report.path=analyzer_report.txt
# package1
package1.sonar.projectBaseDir=packages/package1
package1.sonar.sources=lib,pubspec.yaml,pubspec_overrides.yaml,analysis_options.yaml
package1.sonar.exclusions=**/*.g.dart
package1.sonar.tests=test
package1.sonar.flutter.tests.reportPath=test-results/package1-dart-test-results.json
package1.sonar.flutter.coverage.reportPath=coverage/lcov.info
package1.sonar.dart.analyzer.options.override=false
package1.sonar.dart.analyzer.mode=MANUAL
package1.sonar.dart.analyzer.report.mode=LEGACY
package1.sonar.dart.analyzer.report.path=analyzer_report.txt
# package2
package2.sonar.projectBaseDir=packages/package2
package2.sonar.sources=lib,pubspec.yaml,pubspec_overrides.yaml,analysis_options.yaml
package2.sonar.exclusions=**/*.g.dart
package2.sonar.tests=test
package2.sonar.flutter.tests.reportPath=test-results/package2-flutter-test-results.json
package2.sonar.flutter.coverage.reportPath=coverage/lcov.info
package2.sonar.dart.analyzer.options.override=false
package2.sonar.dart.analyzer.mode=MANUAL
package2.sonar.dart.analyzer.report.mode=LEGACY
package2.sonar.dart.analyzer.report.path=analyzer_report.txt
# package3
package3.sonar.projectBaseDir=packages/package3
package3.sonar.sources=lib,pubspec.yaml,pubspec_overrides.yaml,analysis_options.yaml
package3.sonar.exclusions=**/*.g.dart
package3.sonar.dart.analyzer.options.override=false
package3.sonar.dart.analyzer.mode=MANUAL
package3.sonar.dart.analyzer.report.mode=LEGACY
package3.sonar.dart.analyzer.report.path=analyzer_report.txt
# package4
package4.sonar.projectBaseDir=packages/package4
package4.sonar.sources=lib,pubspec.yaml,pubspec_overrides.yaml,analysis_options.yaml
package4.sonar.exclusions=**/*.g.dart
package4.sonar.tests=test
package4.sonar.flutter.tests.reportPath=test-results/package4-flutter-test-results.json
package4.sonar.dart.analyzer.options.override=false
package4.sonar.flutter.coverage.reportPath=coverage/lcov.info
package4.sonar.dart.analyzer.mode=MANUAL
package4.sonar.dart.analyzer.report.mode=LEGACY
package4.sonar.dart.analyzer.report.path=analyzer_report.txt
#sonar.dart.analyzer.options.override=false
# Analyzer mode
# Can be:
# - DETECT (attempt to detect automatically) - default
# - MANUAL (an existing report needs to be provided)
# - FLUTTER (flutter analyze)
# - DART (dart analyze)
# - DARTANALYZER (dartanalyzer)
#sonar.dart.analyzer.mode=MANUAL
# Allows reuse of an existing analyzer report when mode is MANUAL
# sonar.dart.analyzer.report.path=
# Analyzer report output mode
# Can be:
# - DETECT (attempt to detect automatically, requires Dart SDK on the PATH) - default
# - MACHINE (a new machine readable output that is available for Dart 2.12+)
# - LEGACY (attempts to parse human readable output from dart/flutter) - default
# sonar.dart.analyzer.report.mode=
This is my sonar configuration, the main application and 4 packages (everything is managed with melos).
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
sonar-project.properties
log
Questions
1、okki-flutter/lib/okki_flutter.dart was indexed with language 'dart' but Analysing result show 'File not included in SonarQube' 2、In addition to the file does not exist, there are 3 issues, but can not be found on sonar