Hi,
I’ve already answered your question about rules in the separate thread where you asked it.
Regarding file differentiation, are you saying your test and source files are mingled together without a clear distinction in the file system?
sonar.sources
defaults to .
, which means by default all your test files are being treated as source files. To sort this out, you’ll likely need a combination of source exclusions and test inclusions. Without knowing how your files are named, or organized, this can only be a guess, but something like:
// yes, this is the default, but it avoids future confusion to make it explicit
sonar.sources=.
// there is no default. this sets it to everything
sonar.tests=.
// sonar.sources and sonar.tests now fully overlap,
// which will cause analysis errors if left as-is
sonar.exclusions=**/*test*
sonar.test.inclusions=**/*test*
HTH,
Ann