Only 1 random file gets analyzed

Must-share information:

  • which versions are you using: SonarQube Developer edition 9.8.0 and sonnar-scanner 4.8.0
  • how is SonarQube deployed: zip
  • what are you trying to achieve: I want to analyze swift code
  • what have you tried so far to achieve this: selecting the correct main branch, deleting and recreating the project

I’m fairly new to sonarqube, so my question might be stupid or I might be doing something completely wrong…

THE PROBLEM:

I analyze the project and then I navigate to the link that the analysis outputs. I get to the sonarqube dashboard where it says: “Passed All conditions passed.”

Now when I click on Code I see that only 1 source file and only 7 lines of code were analyzed. Is this normal behavior? My project contains many source files, but only 1 random file is being analyzed and shown under “Code”. How can I tell sonarqube to also include other files?

Hi,

Welcome to the community!

Can you 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.

This guide will help you find them.

 
Ann

Hi, I’ve pasted the log here: pastebin

By the way… my project contains 177 swift source fiiles.

Hi,

Could you add -Dsonar.verbose=true to your analysis command line & provide those logs? Just copy/pasting here into your post would be best.

Also, could you provide the SonarScanner context (Project Settings → Background Tasks → [analysis row cog menu])?

 
Thx,
Ann

I resolved the issue by modifying -Dsonar.sources parameter. It was missing some directories.

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