Open h-ngo opened 4 years ago
Thanks for opening your first issue here! :smiley: Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.
Since SpotBugs acts on bytecode, I'm not sure that there's any way for it to reliably distinguish Java code from Scala.
If the Scala code is in specific packages, you could exclude those packages from all scanning, or from selected rules.
@ThrawnCA I guess, spotbugs can detect the source language type by source file name. ref. https://github.com/tokuhirom/classfileops-sample
How can we config Spotbugs to not scanning Scala codes?
We encountered false-positive violations in Scala codes due to findbugs in our java profile being applied to Scala.
Line of code violated: val spokenLanguage = abcSpokenLanguage.map { language => // <-- violated
Rule: "Nullcheck of Language at line xxx of value previously dereferenced in ...."
Spotbugs version: 3.11.1 SonarJava: 5.14