sonar-flutter icon indicating copy to clipboard operation
sonar-flutter copied to clipboard

Exclusion and lcov

Open sk92129 opened this issue 1 year ago • 2 comments

The exclusion and lcov processing by the sonar scanner seems to have some contradiction messages.

1.) I indicate in the sonar-project.properties to NOT exclude any files.

But during the run of the sonar scanner via azure, I see this WARN messages.

WARN: Duplication reported for 'test/core/location/repository/countries_list_test.dart' will be ignored because it's a test file.

I did not indicate to sonar to exclude the tests -- does sonar exclude them anyway since they are in the test directory?

or

WARN: File not included in SonarQube D:\BuildAgentMobileWeb_work\1\s\lib\config\localization\models\errors\errors_lang_model.g.dart

This is one of many generated files that are being excluded. I did not indicate to sonarqube to exclude the generated files. The generated file contains this in the header.

// GENERATED CODE - DO NOT MODIFY BY HAND

Does Sonar automatically detect this in the source file content and ignore them?

2.) The processing of the lcov file from a previous flutter test step encounters warnings

INFO: Analysing [D:\BuildAgentMobileWeb_work\1\s\coverage\lcov.info] WARN: Could not resolve 4 file paths in [D:\BuildAgentMobileWeb_work\1\s\coverage\lcov.info] WARN: First unresolved path: lib\core\authentication\login\models\member_info.g.dart (Run in DEBUG mode to get full list of unresolved paths)

I wonder why these files cannot be found by sonarqube scanner.

And if I were to specify to run as DEBUG mode, the sonar azure plugin does not seem to have a way to specify the -X debug mode.

- task: SonarQubeAnalyze@5
  displayName: Run analyze

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/sonar-qube-analyze-v5?view=azure-pipelines#inputs

From the above plugin, how do I run the sonarqube scanner in DEBUG mode?

Any help would be appreciated.

sk92129 avatar Feb 12 '24 22:02 sk92129

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar May 13 '24 02:05 github-actions[bot]

Hi @sk92129,

Yes duplications from test code are not taken in account by SonarQube. This is the normal behavior.

For your issues about file inclusion. I need you to share your sonar-project.properties please.

zippy1978 avatar May 16 '24 16:05 zippy1978

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Aug 15 '24 02:08 github-actions[bot]