Hi all,
I’m evaluating SonarCloud for my company since we are looking for a solution to analize our COBOL code.
We use Azure DevOps as CI for our .NET solutions and COBOL ones.
To compile COBOL, we launch the compiler trough a .NET app of ours who takes the code from Microsoft TFS.
As for .Net solutions, we have no problem with SonarCloud: code is compiled and correctly analized and we see results on SonarCloud.
With COBOL, I’m not able to load code into SonarCloud.
I integrated the “Prepare analysis on SonarCloud” step in our Azure Pipeline, set it to “Use standalone scanner” and added these additional properties:
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.projectKey=UAS_Main
sonar.projectName=UAS_Main
sonar.exclusions=**/*.sql,**/*.SQL
sonar.projectBaseDir=$(build.sourcesDirectory)\UAS\Main
sonar.sources=$(build.sourcesDirectory)\UAS\Main\Batch\Source\PGM
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
sonar.nodejs.executable=C:\Program Files\nodejs\node.exe
With these settings, Code Analysis step runs correctly but I find no code into SC project page since no code has been analyzed.
Here’s the step output:
##[section]Starting: Run Code Analysis
==============================================================================
Task : Run Code Analysis
Description : Run scanner and upload the results to the SonarCloud server.
Version : 1.9.0
Author : sonarsource
Help : 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)
==============================================================================
[command]C:\Windows\system32\cmd.exe /D /S /C "F:\Agent\_work\_tasks\SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1\1.9.0\sonar-scanner\bin\sonar-scanner.bat"
INFO: Scanner configuration file: F:\Agent\_work\_tasks\SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1\1.9.0\sonar-scanner\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 4.1.0.1829
INFO: Java 1.8.0_221 Oracle Corporation (64-bit)
INFO: Windows Server 2016 10.0 amd64
INFO: User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
INFO: SonarQube server 8.0.0
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=189ms
INFO: Server id: 74E9293D-AWHW8ct9-T_TB3XqouNu
INFO: User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=94ms
INFO: Load/download plugins (done) | time=234ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=0ms
INFO: Project key: UAS_Main
INFO: Base dir: F:\Agent\_work\22\s\UAS\Main
INFO: Working dir: F:\Agent\_work\22\s\UAS\Main\.scannerwork
INFO: Load project settings for component key: 'UAS_Main'
INFO: Load project settings for component key: 'UAS_Main' (done) | time=47ms
INFO: Load project branches
INFO: Load project branches (done) | time=31ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=15ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=0ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=78ms
INFO: Detected Azure DevOps
INFO: Load active rules
INFO: Load active rules (done) | time=1096ms
WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
INFO: Organization key: k16v6eabfza0f81yh0gls1x36sp20w47
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/*.sql, **/*.SQL
INFO: 852 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: ------------- Run sensors on module UAS_Main
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=15ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=16ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=16ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: F:\Agent\_work\22\s\UAS\Main\.scannerwork\ucfg2\java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: F:\Agent\_work\22\s\UAS\Main\.scannerwork\ucfg2\java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=15ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: F:\Agent\_work\22\s\UAS\Main\ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: F:\Agent\_work\22\s\UAS\Main\ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=0ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: F:\Agent\_work\22\s\UAS\Main\.scannerwork\ucfg2\php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: F:\Agent\_work\22\s\UAS\Main\.scannerwork\ucfg2\php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=15ms
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 110ms, dir size=135 KB
INFO: Analysis report compressed in 15ms, zip size=26 KB
INFO: Analysis report uploaded in 32ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/dashboard?id=UAS_Main
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 https://sonarcloud.io/api/ce/task?id=AW1JQecymwTm6taVnawZ
INFO: Analysis total time: 6.799 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 8.706s
INFO: Final Memory: 36M/300M
INFO: ------------------------------------------------------------------------
##[section]Finishing: Run Code Analysis
Could you please help me understanding what I am (surely) missing?
Thank you