So guys im using SonarQube version 9.6(newer version doesn’t work for some resaon) and the lattest scanner version
im trying to scan the Open source software JHotdraw 6.0 and get some copuling metrics to work with
but when i scan the .java files it says it needs the .classs files but when i do it doesn’t scan them at all they get detected but there is no reports on them
here is the used CMD (“sonar-scanner.bat -D"sonar.projectKey=please-work” -D"sonar.sources=." -D"sonar.java.binaries=jhotdraw" -D"sonar.host.url=http://localhost:9000" -D"sonar.login=sqp_1a11655c1badf97d4a4bff306d0cb57773127ae8"")
i really need help guys
Hi,
Welcome to the community!
You won’t see explicit analysis results on .class
files; they’re used to enhance the overall analysis.
Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported.
HTH,
Ann
Hello and Thanks
How can i analyse a bunch of .java classes then?
When i add the project folder that contains the .java files it asks me for the compiled version
i need to get some metrics like number of abstract classes and such for each of the java files how can i do that i can’t seem to find the answer
Thanks in advance
Hi,
Ehm… you should feed both your .java
files and your .class
files into analysis. They’ll both be taken into account, although you’ll only see the .java
files reflected in the SonarQube UI.
Sorry, but we don’t count that. Just the overall class total.
HTH,
Ann
Hey,
So i should place both .class and .java into the same folder and run the command ?
Hi,
You should leave the .java
and .class
files where they are after the build process and point sonar.sources
to the .java
files and sonar.java.binaries
to the .class
files.
Or better yet, use the SonarScanner related to your build system (Maven or Gradle) and get most of the configuration for free.
HTH,
Ann