Skip to content

Report metrics/duplications/coverage correctly on MAIN vs TEST input files#442

Open
cirras wants to merge 4 commits into
masterfrom
metrics-and-cpd-should-not-apply-to-test-files-apparently
Open

Report metrics/duplications/coverage correctly on MAIN vs TEST input files#442
cirras wants to merge 4 commits into
masterfrom
metrics-and-cpd-should-not-apply-to-test-files-apparently

Conversation

@cirras
Copy link
Copy Markdown
Collaborator

@cirras cirras commented May 22, 2026

This PR corrects some little problems with how we handle MAIN vs TEST sources.

  • It looks like the "lines" metric is forced off on TEST sources, and the official analyzers don't report metrics for test sources.
  • The sonar scanner emits warnings when duplications are reported on TEST sources.
  • Coverage should only be reported on MAIN sources.

cirras added 4 commits May 22, 2026 13:59
We already use the official mechanism for this via `onlyOnLanguage` in
the sensor `describe`, so `shouldExecuteOnProject` was redundant.
Previously we would unconditionally report coverage on any file
specified in a coverage report.
The sonar scanner emits warnings when duplications are reported on
`TEST` source files.
This matches the behavior of the official analyzers.
@cirras cirras requested a review from fourls May 22, 2026 05:44
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

Successfully merging this pull request may close these issues.

1 participant