Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclusion and lcov #210

Open
sk92129 opened this issue Feb 12, 2024 · 2 comments
Open

Exclusion and lcov #210

sk92129 opened this issue Feb 12, 2024 · 2 comments

Comments

@sk92129
Copy link

sk92129 commented Feb 12, 2024

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.

Copy link

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

@github-actions github-actions bot added the stale label May 13, 2024
@zippy1978
Copy link
Contributor

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 zippy1978 removed the stale label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants