SonarQube Not Scanning All JavaScript Files in .NET Project

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
    v2025.1.1
  • how is SonarQube deployed: zip, Docker, Helm
    zip
  • what are you trying to achieve
    SonarQube Not Scanning All JavaScript Files in .NET Project
  • what have you tried so far to achieve this

Hi Team,

I have a question regarding our SonarQube code quality analysis for JavaScript files. Our project uses .NET for the backend and JavaScript for the frontend. During our scanning process, we follow these steps:

  • Clone the repository

  • Restore dependencies

  • Run unit tests

  • Start SonarQube analysis using the MSBuild SonarQube Scanner

  • Build all projects (*.sln & *.csproj)

  • End SonarQube analysis

However, we have observed that SonarQube scans only certain JavaScript files and folders, while some .js files and folders are being ignored.

Could you help us identify the possible reasons for this issue? I have attached a screenshot of the folder hierarchy for your reference. Please let me know if additional information is needed.

Hi,

Please share your analysis log.

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

Share the Scanner for .NET verbose logs

Add /d:"sonar.verbose=true" to the Scanner BEGIN step. Examples:

dotnet sonarscanner begin /k:"MyProject" /d:"sonar.verbose=true"
SonarScanner.MSBuild.exe begin /k:"MyProject" /d:"sonar.verbose=true"
- task: SonarCloudPrepare@3 # or SonarQubePrepare@3
    inputs:
      SonarCloud: 'sonarcloud'
      organization: 'foo'
      scannerMode: 'dotnet'
      projectKey: 'foo_sonar-scanning-someconsoleapp'
      projectName: 'sonar-scanning-someconsoleapp'
      extraProperties: |
        sonar.verbose=true

Please note that most of the relevant logging will happen during the END step, i.e. in SonarCloudAnalyze, SonarQubeAnalyze or Run Code Analysis.

 
Thx,
Ann