No results showing in sonarqube ui stating No code files were found for analysis

Hi Team,

I am not able to get the scan results in sonarqube ui.Please see the details below.

sonarqube version - 10.4.1
CI- Github actions
source code - java apache ant

so below is the configuration i have in my source code for enabling sonarqube scan.
I am using sonarscanner cli for code scanning.my source code is in java and using apache ant as a build tool.
my project structure looks like this

-.github/workflow file
-.3d
-build-tools
-doc
-keygen
-lib
  |
   -3dlib
   -bin
   -lib
   -*.jar (jar files)
-lib1
   |
   -*.jar (jar files)
-test
  (empty folder)
-src
-.gitignore
-build.xml

As part of sonar configuration in by source code i added sonarscan step as below in my workflow file

      - name: SonarQube Scan
        uses: devops/sonarqube-scan-action@master
        with:
          projectBaseDir: ./
          # debug: true
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
          SONAR_HOST_URL: ${{ secrets.SONAR_ENDPOINT }}

and created sonar-project.properties as below

sonar.projectKey=project key 
sonar.projectName=project name 
sonar.projectVersion= not provided 
sonar.sources=src 
sonar.tests=./test
sonar.java.binaries=./
sonar.dynamicAnalysis=reuseReports
sonar.java.coveragePlugin=jacoco
sonar.sourceEncoding=UTF-8
sonar.verbose=true

sonar.core.codeCoveragePlugin=jacoco
sonar.coverage.jacoco.xmlReportPaths=./**/jacoco.xml

sonar.java.libraries=**/*.jar
sonar.dependencyCheck.htmlReportPath=target/dependency-check-report.html
sonar.dependencyCheck.jsonReportPath=target/dependency-check-report.json
sonar.dependencyCheck.reportPath=target/dependency-check-report.xml

when i run my pipeline it created a same project in sonarqube but still seeing no results under the project in sonarqube ui.


github action log.txt (17.6 KB)
above is the log of my github action workflow for sonarqube scan step.

Please help me to make this scan work and assist me how can i scan java apache ant project using sonarscanner cli, i dont find any detailed steps in sonarqube documentation.

@Colin Could you please help me with this one

Have you checked the project analysis task in SonarQube to see if there were any errors? You can find that by going to Administration → Projects → Background Tasks. Then you can filter by the “Project Analysis” type and search for your project.

Are there any other branches of this project that show a successful analysis?

1 Like

No I can see the branch analysis failed. We are testing the sonarscan in a seperate branch so only this branch has been integrated for sonar analysis.And its shows the error details as below.
“The last analysis failed because it would have caused your server-wide lines of code total to exceed your 1000000 limit.”

So for your analysis of this project (and future ones) to be successful, you’ll either need to clean up unneeded projects to free up lines of code, or consider increasing the lines of code that you’re licensed for.

2 Likes

Thank you.The issue is seems to be exceeded number of lines of code to scan.Currently license supports upto 1000000 line of code per project.Adding on to that , My project code base is in java apache ant, so for code coverage and dependency check do i need to add jacoco,surefie jar files into my lib folder and make any config changes to my build.xml file.Can anyone please clarify on this please.

Typically posts should be kept to one topic for clarity. For your project config, I’d recommend consulting SonarQube’s documentation and then if you’re still encountering issues, create a new post regarding that topic.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.