We are struggling to understand the new way the duplicate code is working.
The latest scan is giving very high results and making the quality gate to fail.
Example: 22,4% - 6,012 duplicates
We don’t think this is correct and would like to know if there are options to fine tune the scan or another way to fix it.
we are seeing similar issue on our repos as well . all those were passing in the past and its failing or detecting recently only .It is showing coverage and coveragetest folder in our repos for duplicate code. do we need to exclude them ?
Try excluding multi-language analysis that was introduced in 8.0.0 of the sonar-msbuild scanner if applicable.
/d:sonar.scanner.scanAll=false
Multi-language scan is in a flux and kind of crap right now for us. Rapidly changing detections and disabling/enabing sonar.sources, sonar.tests & sonar.exclusions. It made our c# repos grow past our license limit due to scanning .nuget for xml…
We had the same issues. We started getting tons of errors on directories that were explicitly excluded from analysis in the project admin. Looks like the settings are completely ignored.
We added /d:sonar.scanner.scanAll=false after noticing the warning, and stats went back to what they were before.
What does your CI pipeline look like?
Especially the part that installs the Sonar Scanner for .NET? If you can copy paste it in here we can figure that out (please remove any tokens, secrets etc before posting, of course).
If you are on AZDO and using the SonarCloud extension then you are still using v6, as the extension has not been updated yet.
If not, would you mind showing us (can be in a private message) on which files the duplication appeared (c#?, others?)
Can you trace back when the metric changed drastically? (the date of the first analysis where it goes up)
This might help us pinpoint the origin of this problem.
It is not related to v8 changes, as the AZDO extension does not use it yet. We just need to figure out what caused it.
Is it not a public project.
Happy to provide all the information request in a private message - what is the best way to do it?
Will start working on collecting the data you asked.