1 year ago
#388396
TomFree
Sonarqube not analyze directory with TS files
For some reason sonarqube does not analyse my directory named backend wehre there area quite some nice TS files to be investigated.... (e.g. backend/src/main.ts)
backend/sonar-project.properties file:
sonar.projectKey = m3d-backend
sonar.projectName = m3d-backend
sonar.projectVersion = 1.0
sonar.sources = ./src
sonar.tests = ./tests
sonar.typescript.tsconfigPath = ./tsconfig.json
sonar.sourceEncoding = UTF-8
sonar.exclusions = **node_modules**
sonar.working.directory = ./analysis/sonar
sonar.javascript.lcov.reportPaths=./analysis/coverage/lcov.info
task in backend/package.json is
"sonar": "sonar-scanner.bat -D\"sonar.projectKey=m3d-backend\" -D\"project.settings=./sonar-project.properties\" -D\"sonar.host.url=http://localhost:9000\" -D\"sonar.login=myKey\""
Pretty much the same configuration works smoothly for the frontned folder also located in same repo. Two noteable differences of backend and frontend are that backend has two tsconfigs and thus i specified the one to use in the sonar-project.properties file and the other is that backend tsconfig uses references whereas frontend does not.
Log of sonar scanner is:
> m3d-backend@0.0.1 sonar
> sonar-scanner.bat -D"sonar.projectKey=m3d-backend" -D"project.settings=./sonar-project.properties" -D"sonar.host.url=http://localhost:9000" -D"sonar.login=06ca35465a501e349d65625aadd398eb5da90b24"
INFO: Scanner configuration file: C:\Program Files\sonar-scanner-4.7.0.2747-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Users\Thorsten\data\3dm\configurator\backend\.\sonar-project.properties
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\Thorsten\.sonar\cache
INFO: Scanner configuration file: C:\Program Files\sonar-scanner-4.7.0.2747-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Users\Thorsten\data\3dm\configurator\backend\.\sonar-project.properties
INFO: Analyzing on SonarQube server 9.3.0
INFO: Default locale: "de_DE", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=130ms
INFO: Server id: 0D27FB64-AX-dGGk3pYHuqjxnwiRF
INFO: User cache: C:\Users\Thorsten\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=77ms
INFO: Load/download plugins (done) | time=214ms
INFO: Process project properties
INFO: Process project properties (done) | time=11ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=9ms
INFO: Project key: m3d-backend
INFO: Base dir: C:\Users\Thorsten\data\3dm\configurator\backend
INFO: Working dir: C:\Users\Thorsten\data\3dm\configurator\backend\analysis\sonar
INFO: Load project settings for component key: 'm3d-backend'
INFO: Load project settings for component key: 'm3d-backend' (done) | time=29ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=97ms
INFO: Load active rules
INFO: Load active rules (done) | time=971ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **node_modules**
INFO: 0 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 31 files ignored because of scm ignore settings
INFO: ------------- Run sensors on module m3d-backend
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=80ms
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=8ms
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=7ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=31ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor Text Sensor [text]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=13ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=5ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=64ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=3ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=1ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 236ms, dir size=110.1 kB
INFO: Analysis report compressed in 31ms, zip size=13.0 kB
INFO: Analysis report uploaded in 38ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=m3d-backend
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=AYAE9M_8fMV8FDXfFfIW
INFO: Analysis total time: 5.123 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.103s
INFO: Final Memory: 13M/50M
INFO: ------------------------------------------------------------------------
Terminal will be reused by tasks, press any key to close it.
sonarqube
0 Answers
Your Answer