SonarQube always exclude swift files? 2457 files ignored because of inclusion/exclusion patterns

Please see the analysis log. I hope you can understand my issue. We are using macOS and Xcode projects using Swift. I am using the latest community edition latest and scanner version, downloaded using the brew

INFO: Project root configuration file: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 21.0.2 Homebrew (64-bit)
INFO: Mac OS X 14.3.1 x86_64
INFO: User cache: /Users/karthikeyanselvam/.sonar/cache
INFO: Analyzing on SonarQube server 10.4.1.88267
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=72ms
INFO: Server id: 147B411E-AY5ktyRYWvNBOYUFb9Sx
INFO: User cache: /Users/karthikeyanselvam/.sonar/cache
WARN: sonar.plugins.downloadOnlyRequired is false, so ALL available plugins will be downloaded
INFO: Loading all plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=51ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=118ms
INFO: Process project properties
INFO: Process project properties (done) | time=8ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: KuwyV3
INFO: Base dir: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022
INFO: Working dir: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/.scannerwork
INFO: Load project settings for component key: 'xxxxxxxx'
INFO: Load project settings for component key: 'xxxxxxxx' (done) | time=21ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=65ms
INFO: Load active rules
INFO: Load active rules (done) | time=5364ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=6ms
INFO: Preprocessing files...
INFO: 2 languages detected in 1306 preprocessed files
INFO: 2457 files ignored because of inclusion/exclusion patterns
INFO: 54 files ignored because of scm ignore settings
INFO: Load project repositories
INFO: Load project repositories (done) | time=12ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/Pods/**, **/*.swift.generated
INFO: 1306 files indexed
INFO: Quality profile for json: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module KuwyV3
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=16ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=972ms
INFO: Sensor IaC AzureResourceManager Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC AzureResourceManager Sensor [iac] (done) | time=438ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=4ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=2ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=20ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor XML Sensor [xml]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Sensor XML Sensor [xml] (done) | time=242ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 435 source files to be analyzed
INFO: 435/435 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=1139ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=13ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=24ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=9ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 76ms, dir size=212.6 kB
INFO: Analysis report compressed in 24ms, zip size=24.8 kB
INFO: Analysis report uploaded in 27ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://localhost:9000/dashboard?id=KuwyV3
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 http://localhost:9000/api/ce/task?id=14f63eb1-fc80-4376-ae50-39370d154fdf
INFO: Analysis total time: 17.535 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 18.861s
INFO: Final Memory: 23M/88M
INFO: ------------------------------------------------------------------------

Please find my sonar preperty file

sonar.host.url=http://localhost:9000
sonar.token=sqp_27175ecce4ac085e466e6ed6xxxxxxxxxxxxxxxxx
sonar.projectKey=xxxxxxx
sonar.projectName=xxxxxxxxx
sonar.sources=.
sonar.exclusions=**/Pods/**, **/*.swift.generated
sonar.swift.project=Kuwy.xcodeproj
sonar.swift.workspace=Kuwy.xcworkspace

Please see the dashboard SS

Please check my updated ananlysis

karthikeyanselvam@LAPTOP-KACL131 KuwyV3_Oct_2022 % sonar-scanner
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/5.0.1.3006/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 21.0.2 Homebrew (64-bit)
INFO: Mac OS X 14.3.1 x86_64
INFO: User cache: /Users/karthikeyanselvam/.sonar/cache
INFO: Analyzing on SonarQube server 10.4.1.88267
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=66ms
INFO: Server id: 147B411E-AY5u1C1XfyyeYCQRBMNe
INFO: User cache: /Users/karthikeyanselvam/.sonar/cache
WARN: sonar.plugins.downloadOnlyRequired is false, so ALL available plugins will be downloaded
INFO: Loading all plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=45ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=126ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: xxxxxxxx
INFO: Base dir: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022
INFO: Working dir: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/.scannerwork
INFO: Load project settings for component key: 'xxxxxxxx'
INFO: Load project settings for component key: 'xxxxxxxxx' (done) | time=16ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=65ms
INFO: Load active rules
INFO: Load active rules (done) | time=5679ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=7ms
INFO: Preprocessing files...
INFO: 2 languages detected in 1301 preprocessed files
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 40 files ignored because of scm ignore settings
INFO: Load project repositories
INFO: Load project repositories (done) | time=14ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/Pods/**, **/*.swift.generated
INFO: 1301 files indexed
INFO: Quality profile for json: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module KuwyV3
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=14ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=648ms
INFO: Sensor IaC AzureResourceManager Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC AzureResourceManager Sensor [iac] (done) | time=296ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=3ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=18ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=3ms
INFO: Sensor XML Sensor [xml]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Sensor XML Sensor [xml] (done) | time=223ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 435 source files to be analyzed
INFO: 435/435 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=1085ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=14ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=22ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=0ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=8ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 70ms, dir size=212.6 kB
INFO: Analysis report compressed in 32ms, zip size=24.8 kB
INFO: Analysis report uploaded in 25ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://localhost:9000/dashboard?id=KuwyV3
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 http://localhost:9000/api/ce/task?id=79501048-1dd7-44c9-bcfa-fdce532bfac1
INFO: Analysis total time: 13.399 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 14.497s
INFO: Final Memory: 23M/88M
INFO: ------------------------------------------------------------------------

sonar.host.url=http://localhost:9000
sonar.token=sqp_45efcab68af2c0f8ed80dxxx
sonar.projectKey=xxxxxxx
sonar.projectName=xxxxxxxxxxx
sonar.sources=Kuwy
sonar.language=swift
# sonar.test.inclusions=**/*Test*/**
# sonar.test.inclusions=*.swift
# sonar.exclusions=**/*.xml,Pods/**/*,Reports/**/*

sonar.exclusions=**/Pods/**, **/*.swift.generated
sonar.swift.project=Kuwy.xcodeproj
sonar.swift.workspace=Kuwy.xcworkspace
#sonar.java.binaries= **/*.java

Please find my updated analysis, but my files are not showing in SonarQube dashboard

What I am missing here? Why does the scanner read only xml file in project directory?

Please check my updated sonar-property file

sonar.host.url=http://localhost:9000
sonar.token=sqp_45efcab68af2c0f8ed80xxxxxxxxx
sonar.projectKey=xxxxx
sonar.projectName=xxxxx
sonar.sources=.
sonar.language=swift
# Inclusion pattern for Swift source files
# sonar.swift.sources=*.swift
# # sonar.test.inclusions=**/*Test*/**
# sonar.test.inclusions=*.swift
# sonar.inclusions=Kuwy/**/*
# # sonar.exclusions=**/*.xml,Pods/**/*,Reports/**/*
# sonar.exclusions=**/Pods/**
sonar.swift.project=Kuwy.xcodeproj
sonar.swift.workspace=Kuwy.xcworkspace
#sonar.java.binaries= **/*.java
# sonar.coverageReportPaths=sonarqube-generic-coverage.xml
sonar.scm.exclusions.disabled = true

 sonar-scanner   
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/5.0.1.3006/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 21.0.2 Homebrew (64-bit)
INFO: Mac OS X 14.3.1 x86_64
INFO: User cache: /Users/karthikeyanselvam/.sonar/cache
INFO: Analyzing on SonarQube server 10.4.1.88267
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=86ms
INFO: Server id: 147B411E-AY5u1C1XfyyeYCQRBMNe
INFO: User cache: /Users/karthikeyanselvam/.sonar/cache
WARN: sonar.plugins.downloadOnlyRequired is false, so ALL available plugins will be downloaded
INFO: Loading all plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=46ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=177ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: xxxxx
INFO: Base dir: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022
INFO: Working dir: /Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/.scannerwork
INFO: Load project settings for component key: 'xxxxx'
INFO: Load project settings for component key: 'xxxxx' (done) | time=44ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=108ms
INFO: Exclusions based on SCM info is disabled by configuration
INFO: Load active rules
INFO: Load active rules (done) | time=9732ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=24ms
INFO: Preprocessing files...
WARN: File '/Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework/GoogleMapsCore' is bigger than 20MB and as consequence is removed from the analysis scope.
WARN: File '/Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/GoogleMaps' is bigger than 20MB and as consequence is removed from the analysis scope.
WARN: File '/Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase' is bigger than 20MB and as consequence is removed from the analysis scope.
WARN: File '/Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/Pods/SwiftLint/swiftlint' is bigger than 20MB and as consequence is removed from the analysis scope.
INFO: 2 languages detected in 3815 preprocessed files
INFO: Load project repositories
INFO: Load project repositories (done) | time=28ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 3815 files indexed
INFO: Quality profile for json: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module xxxxxxx
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=15ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=1333ms
INFO: Sensor IaC AzureResourceManager Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC AzureResourceManager Sensor [iac] (done) | time=552ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=7ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=3ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=14ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=11ms
INFO: Sensor XML Sensor [xml]
INFO: 3 source files to be analyzed
WARN: Unable to analyse file file:///Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/Kuwy/sonarqube-generic-coverage.xml;
WARN: Unable to analyse file file:///Users/karthikeyanselvam/Documents/Kuwy_Pro/KuwyV3_Oct_2022/sonarqube-generic-coverage.xml;
INFO: 3/3 source files have been analyzed
INFO: Sensor XML Sensor [xml] (done) | time=284ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 472 source files to be analyzed
INFO: 472/472 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=4050ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=3ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=16ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=38ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=26ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 1 source file to be analyzed
INFO: SCM Publisher 1/1 source file have been analyzed (done) | time=653ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 107ms, dir size=212.8 kB
INFO: Analysis report compressed in 87ms, zip size=25.6 kB
INFO: Analysis report uploaded in 43ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://localhost:9000/dashboard?id=KuwyV3
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 http://localhost:9000/api/ce/task?id=33d6b9ef-4349-4a7b-a50c-2486ea04682e
INFO: Analysis total time: 28.458 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 29.871s
INFO: Final Memory: 24M/94M
INFO: ------------------------------------------------------------------------

Hi,

The community edition doesn’t support Swift files. Swift analysis is available starting in Developer Edition ($).

Source: Swift

Thanks for your reply​:smiling_face::smiling_face::smiling_face:

Is your latest version not supported by Swift or is there any specific supported version available?

Please let me know as soon as possible

Hi Karthi,

It is not about the version (latest or not) it is about edition. There are four editions of SonarQube available. Community which you seem to be using, Developer, Enterprise and Data Center. To benefit from analysis of Swift files you need to be using at least Developer edition :slight_smile:

@Lukasz_Jarocki Thank you so much​:smiling_face::smiling_face::smiling_face::smiling_face::heart:. Let me check with my team about pricing and get back to you soon.

1 Like

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