SonarQube Has no lines of code

Pproduct: SonarQube developer edition
XCode Version: 13.0
Platform: iOS
Language: Swift


I added empty line for check the line number of sonar analysis report. The line is empty. But I fixed my issue by running only sonar-scanner command with the line of ‘sonar.coverageReportPaths=sonarqube-generic-coverage.xml’ in file.


But I have already struggled with issue to sonar analysis report to sonar side. I added sonar zip file that contains sonarqube-generic-coverage.xml,,, (without login key) and all terminal log with executed sh file and bash command for generic coverage file. (115.1 KB)

Please help.


Thanks for including your analysis log in the OP. It makes the problem pretty clear:

INFO: Project configuration:
INFO:   Included sources: *.swift
INFO:   Excluded sources: **/*.xml, Pods/**/*, *.swift
INFO:   Included tests: *.swift
INFO: 0 files indexed
INFO: 26088 files ignored because of inclusion/exclusion patterns


Hi ,

I don’t understand where is the Excluded sources: *.swift line. Becuase I added inclusion for *.swift file inside sonar-project properties

Thank you for reply.


I don’t understand where it’s coming from either, but inclusions and exclusions are not… exclusive. As you see, you can have both and the same things can appear in both.

I did glance at your properties file, and saw that there’s a lot going on in there, with a lot of properties I don’t recognize (i.e. that have no effect on analysis).

I suggest you strip this down to the bare minimum by removing your properties file and just providing URL, project key and token on the command line. See if that gets you what you want, and build back up from there.



I changed file with this content but analysis is not correct. Could you guide me how to do ?


All log:

adinler@Arda-Dinler-MacBook-Pro-C02WW1Q2HTD6 ugconnecttruckv2mobileios % sonar-scanner

INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/

INFO: Project root configuration file: /Users/adinler/Documents/ugconnecttruckv2mobileios/

INFO: SonarScanner

INFO: Java Homebrew (64-bit)

INFO: Mac OS X 12.4 x86_64

INFO: User cache: /Users/adinler/.sonar/cache

INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/

INFO: Project root configuration file: /Users/adinler/Documents/ugconnecttruckv2mobileios/

INFO: Analyzing on SonarQube server 8.9.7

INFO: Default locale: "en_TR", source code encoding: "UTF-8" (analysis is platform dependent)

INFO: Load global settings

INFO: Load global settings (done) | time=275ms

INFO: Server id: 2C346A59-AX_QsdAGDfT95r9IT9Tm

INFO: User cache: /Users/adinler/.sonar/cache

INFO: Load/download plugins

INFO: Load plugins index

INFO: Load plugins index (done) | time=96ms

INFO: Load/download plugins (done) | time=138ms

INFO: Loaded core extensions: developer-scanner

INFO: Process project properties

INFO: Process project properties (done) | time=9ms

INFO: Project key:

INFO: Base dir: /Users/adinler/Documents/ugconnecttruckv2mobileios

INFO: Working dir: /Users/adinler/Documents/ugconnecttruckv2mobileios/.scannerwork

INFO: Load project settings for component key: ''

INFO: Load project settings for component key: '' (done) | time=105ms

INFO: Load project branches

INFO: Load project branches (done) | time=75ms

INFO: Load project pull requests

INFO: Load project pull requests (done) | time=53ms

INFO: Load branch configuration

INFO: Load branch configuration (done) | time=1ms

INFO: Load quality profiles

INFO: Load quality profiles (done) | time=86ms

INFO: Load active rules

INFO: Load active rules (done) | time=383ms

INFO: Indexing files...

INFO: Project configuration:

INFO: 18 files indexed

INFO: 0 files ignored because of scm ignore settings

INFO: Quality profile for swift: Sonar way

INFO: ------------- Run sensors on module FordTrucksiOS

INFO: Load metrics repository

INFO: Load metrics repository (done) | time=57ms

INFO: ------------- Run sensors on project

INFO: Sensor Zero Coverage Sensor

INFO: Sensor Zero Coverage Sensor (done) | time=0ms

INFO: Load project repositories

INFO: Load project repositories (done) | time=101ms

INFO: SCM Publisher SCM provider for this project is: git

INFO: SCM Publisher 17 source files to be analyzed

INFO: SCM Publisher 17/17 source files have been analyzed (done) | time=383ms

INFO: CPD Executor Calculating CPD for 0 files

INFO: CPD Executor CPD calculation finished (done) | time=0ms

INFO: Load New Code definition

INFO: Load New Code definition (done) | time=63ms

INFO: Analysis report generated in 134ms, dir size=67 KB

INFO: Analysis report compressed in 56ms, zip size=23 KB

INFO: Analysis report uploaded in 97ms


INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report

INFO: More about the report processing at

INFO: Analysis total time: 2.870 s

INFO: ------------------------------------------------------------------------


INFO: ------------------------------------------------------------------------

INFO: Total time: 5.213s

INFO: Final Memory: 7M/30M

INFO: ------------------------------------------------------------------------

adinler@Arda-Dinler-MacBook-Pro-C02WW1Q2HTD6 ugconnecttruckv2mobileios %



First, none of the sonar.swift properties shown in your file are having any effect. That’s one reason I advised you to provide the bare minimum on the command line. As described in the docs parameters provided on the command line override all others. And since neither of us knew where that *.swift exclusion was coming from, that seemed like the best place to try to provide a definitive property set. But oh well.

You’re saying the analysis you got is not correct, but from the fact that you’ve got a project homepage in the UI, it appears that analysis did work.

So what’s not correct about this? Could you provide a screenshot of the Size metrics on your Measures tab? (Or whatever measures you feel are most relevant?) E.G.


Hi Ann,

Code is empty on sonarqube, I know project have a dublication of codes (%9.9 percent) but I haven’t seen any of code duplications and any unit test coverage on sonarqube.

Coverage File:

Dashboard of FordTrucksiOS SonarQube :

Why “The main branch of this project is empty.” :slight_smile:

Terminal Log:

This is my FirebaseInitializationService.swift File: file
sonar.swift.simulator=platform=iOS Simulator,name=iPhone 12,OS=15.0

Thanks for your time


I fixes issue by removing xctestresult file inside DerivedData folder.

After that, clean project, build and test respectively. Then execute bash command for generating generic coverage ( bash ./ DerivedData/Logs/Test*.xcresult/ > sonarqube-generic-coverage.xml).

All problem fixes. Also coverage report has succesfully migrated to sonar platform.

Thanks for your time

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