When I used the Azure pipelines tasks to scan my codes, no results were shown up in SonarQube:
My tasks:
- task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare@5
condition: and(succeeded(), eq(variables['enableSonarqube'], 'true'))
displayName: 'Prepare analysis on SonarQube'
inputs:
SonarQube: SonarQube
scannerMode: CLI
configMode: manual
cliProjectKey: '$(serviceName)'
cliProjectName: '$(appNumber)-$(serviceName)'
cliSources: '$(serviceName)/source'
extraProperties: |
sonar.typescript.exclusions=**/node_modules/**
sonar.exclusions=**/node_modules/**
continueOnError: true
- task: NodeTool@0
condition: and(succeeded(), eq(variables['enableSonarqube'], 'true'))
displayName: 'Use Node'
inputs:
versionSpec: 16.x
- task: Npm@1
condition: and(succeeded(), eq(variables['enableSonarqube'], 'true'))
displayName: 'Npm install'
inputs:
workingDir: '$(serviceName)/source'
verbose: false
- task: Npm@1
condition: and(succeeded(), eq(variables['enableSonarqube'], 'true'))
displayName: 'ES lint'
inputs:
command: custom
workingDir: '$(serviceName)/source'
verbose: false
customCommand: 'run lint'
continueOnError: true
- task: Npm@1
condition: and(succeeded(), eq(variables['enableSonarqube'], 'true'))
displayName: 'Build code'
inputs:
command: custom
workingDir: '$(serviceName)/source'
verbose: false
customCommand: 'run buildRelease'
- task: SonarSource.sonarqube.6D01813A-9589-4B15-8491-8164AEB38055.SonarQubeAnalyze@5
condition: and(succeeded(), eq(variables['enableSonarqube'], 'true'))
displayName: 'Run Code Analysis'
continueOnError: true
The results:
2023-03-23T06:49:57.8431611Z ##[section]Starting: Run Code Analysis
2023-03-23T06:49:57.8561743Z ==============================================================================
2023-03-23T06:49:57.8562109Z Task : Run Code Analysis
2023-03-23T06:49:57.8562268Z Description : Run scanner and upload the results to the SonarQube server.
2023-03-23T06:49:57.8562700Z Version : 5.12.0
2023-03-23T06:49:57.8562845Z Author : sonarsource
2023-03-23T06:49:57.8563051Z Help : Version: 5.12.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2023-03-23T06:49:57.8563547Z ==============================================================================
2023-03-23T06:49:58.1894765Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\a\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\5.12.0\sonar-scanner\bin\sonar-scanner.bat"
2023-03-23T06:50:07.6488068Z INFO: Scanner configuration file: D:\a\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\5.12.0\sonar-scanner\bin\..\conf\sonar-scanner.properties
2023-03-23T06:50:07.7175801Z INFO: Project root configuration file: NONE
2023-03-23T06:50:08.7629310Z INFO: SonarScanner 4.8.0.2856
2023-03-23T06:50:08.7630340Z INFO: Java 11.0.18 Eclipse Adoptium (64-bit)
2023-03-23T06:50:08.7630908Z INFO: Windows Server 2022 10.0 amd64
2023-03-23T06:50:14.9422788Z INFO: User cache: C:\Users\VssAdministrator\.sonar\cache
2023-03-23T06:50:18.9523091Z INFO: Analyzing on SonarQube server 8.9.9
2023-03-23T06:50:18.9560214Z INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
2023-03-23T06:50:22.2863768Z INFO: Load global settings
2023-03-23T06:50:22.6711046Z INFO: Load global settings (done) | time=379ms
2023-03-23T06:50:22.6764994Z INFO: Server id: B8494D55-AXiI3ZQjBoHSn4HD0LIQ
2023-03-23T06:50:22.6797313Z INFO: User cache: C:\Users\VssAdministrator\.sonar\cache
2023-03-23T06:50:22.6835606Z INFO: Load/download plugins
2023-03-23T06:50:22.6836369Z INFO: Load plugins index
2023-03-23T06:50:23.0654018Z INFO: Load plugins index (done) | time=393ms
2023-03-23T06:50:27.3927279Z INFO: Load/download plugins (done) | time=4710ms
2023-03-23T06:50:28.2441585Z INFO: Process project properties
2023-03-23T06:50:28.2530457Z INFO: Process project properties (done) | time=0ms
2023-03-23T06:50:28.2532216Z INFO: Execute project builders
2023-03-23T06:50:28.2561917Z INFO: Execute project builders (done) | time=16ms
2023-03-23T06:50:28.2590745Z INFO: Project key: svc-envreporting-web
2023-03-23T06:50:28.2591380Z INFO: Base dir: D:\a\1\s
2023-03-23T06:50:28.2591862Z INFO: Working dir: D:\a\1\s\.scannerwork
2023-03-23T06:50:28.4109267Z INFO: Load project settings for component key: 'svc-envreporting-web'
2023-03-23T06:50:28.4794727Z INFO: Load project settings for component key: 'svc-envreporting-web' (done) | time=78ms
2023-03-23T06:50:28.5130926Z INFO: Load project branches
2023-03-23T06:50:28.7043446Z INFO: Load project branches (done) | time=188ms
2023-03-23T06:50:28.7069221Z INFO: Load project pull requests
2023-03-23T06:50:28.7567499Z INFO: Load project pull requests (done) | time=47ms
2023-03-23T06:50:28.7569380Z INFO: Load branch configuration
2023-03-23T06:50:28.7570007Z INFO: Load branch configuration (done) | time=0ms
2023-03-23T06:50:28.7928662Z INFO: Auto-configuring with CI 'Azure DevOps'
2023-03-23T06:50:28.7929596Z INFO: Load quality profiles
2023-03-23T06:50:29.0516376Z INFO: Load quality profiles (done) | time=253ms
2023-03-23T06:50:29.0543063Z INFO: Auto-configuring with CI 'Azure DevOps'
2023-03-23T06:50:29.0581338Z INFO: Load active rules
2023-03-23T06:50:30.5895775Z INFO: Load active rules (done) | time=1509ms
2023-03-23T06:50:30.7029881Z INFO: Branch name: updatetest
2023-03-23T06:50:31.0538949Z INFO: Indexing files...
2023-03-23T06:50:31.0540783Z INFO: Project configuration:
2023-03-23T06:50:31.0542814Z INFO: Excluded sources: **/node_modules/*
2023-03-23T06:50:41.0572561Z INFO:
2023-03-23T06:50:51.0619966Z INFO:
2023-03-23T06:51:01.0692197Z INFO:
2023-03-23T06:51:10.8217379Z INFO: 0 files indexed
2023-03-23T06:51:10.8218476Z INFO: 3 files ignored because of inclusion/exclusion patterns
2023-03-23T06:51:10.8219320Z INFO: 87373 files ignored because of scm ignore settings
2023-03-23T06:51:10.8223706Z INFO: ------------- Run sensors on module apm0003143-svc-envreporting-web
2023-03-23T06:51:10.9729616Z INFO: Load metrics repository
2023-03-23T06:51:11.0435050Z INFO: Load metrics repository (done) | time=63ms
2023-03-23T06:51:12.4718800Z INFO: Sensor CSS Rules [cssfamily]
2023-03-23T06:51:12.4720204Z INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2023-03-23T06:51:12.4720913Z INFO: Sensor CSS Rules [cssfamily] (done) | time=0ms
2023-03-23T06:51:12.4721450Z INFO: Sensor JaCoCo XML Report Importer [jacoco]
2023-03-23T06:51:12.4722234Z 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
2023-03-23T06:51:12.4723093Z INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2023-03-23T06:51:12.4723832Z INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
2023-03-23T06:51:12.4724367Z INFO: Sensor C# Project Type Information [csharp]
2023-03-23T06:51:12.4724893Z INFO: Sensor C# Project Type Information [csharp] (done) | time=0ms
2023-03-23T06:51:12.4725387Z INFO: Sensor C# Properties [csharp]
2023-03-23T06:51:12.4725878Z INFO: Sensor C# Properties [csharp] (done) | time=0ms
2023-03-23T06:51:12.4726342Z INFO: Sensor JavaXmlSensor [java]
2023-03-23T06:51:12.4726819Z INFO: Sensor JavaXmlSensor [java] (done) | time=16ms
2023-03-23T06:51:12.4727328Z INFO: Sensor VB.NET Project Type Information [vbnet]
2023-03-23T06:51:12.4727863Z INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
2023-03-23T06:51:12.4728372Z INFO: Sensor VB.NET Properties [vbnet]
2023-03-23T06:51:12.4728857Z INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
2023-03-23T06:51:12.4729463Z INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor
2023-03-23T06:51:12.4730162Z INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor (done) | time=0ms
2023-03-23T06:51:12.5074621Z INFO: ------------- Run sensors on project
2023-03-23T06:51:12.5101027Z INFO: Sensor Zero Coverage Sensor
2023-03-23T06:51:12.5118645Z INFO: Sensor Zero Coverage Sensor (done) | time=0ms
2023-03-23T06:51:12.5120231Z INFO: CPD Executor Calculating CPD for 0 files
2023-03-23T06:51:12.5127929Z INFO: CPD Executor CPD calculation finished (done) | time=0ms
2023-03-23T06:51:12.5461183Z INFO: Load New Code definition
2023-03-23T06:51:12.7453428Z INFO: Load New Code definition (done) | time=156ms
2023-03-23T06:51:12.7857164Z INFO: Analysis report generated in 265ms, dir size=94 KB
2023-03-23T06:51:12.8180710Z INFO: Analysis report compressed in 32ms, zip size=11 KB
2023-03-23T06:51:13.0227106Z INFO: Analysis report uploaded in 203ms
2023-03-23T06:51:13.0287060Z INFO: ANALYSIS SUCCESSFUL, you can browse http://sonarqube.intranet.dow.com/dashboard?id=svc-envreporting-web&branch=updatetest
2023-03-23T06:51:13.0288333Z INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2023-03-23T06:51:13.0290294Z INFO: More about the report processing at http://sonarqube.intranet.dow.com/api/ce/task?id=AYcNPF6FCbsacXZAD-pe
2023-03-23T06:51:13.0291140Z INFO: Analysis total time: 45.381 s
2023-03-23T06:51:13.0317801Z INFO: ------------------------------------------------------------------------
2023-03-23T06:51:13.0382070Z INFO: EXECUTION SUCCESS
2023-03-23T06:51:13.0383094Z INFO: ------------------------------------------------------------------------
2023-03-23T06:51:13.0383672Z INFO: Total time: 1:05.473s
2023-03-23T06:51:13.0809629Z INFO: Final Memory: 9M/34M
2023-03-23T06:51:13.0811411Z INFO: ------------------------------------------------------------------------
2023-03-23T06:51:13.1401869Z ##[section]Finishing: Run Code Analysis
Here is the reports, noting was shown up:
I don’t know how to troubleshoot.