Pay attention to these importants facts regarding Sonar inclusions/exclusions:
- SonarQube, an opensource product, calculates coverage using percentage of lines-of-code (LOC) covered by tests.
- SonarCloud calculates cost based on lines-of-code (LOC). This only applies to private repositories.
- Adjust relative paths in
sonar.sources
andsonar.exclusions
config properties to match your requirements. - Only scan the files you've written. DO NOT scan external libraries.
- If you must scan large amounts of code, use an ephemeral SonarQube instance to reduce cost.