Configure sonar project PLSQL scanner

plsql

(Greg N) #1

Hello,

Please, could you help writing the project configuration file for PLSQL analyzing, or explain how I can see what is wrong ? The output of sonar-scanner.bat is always “EXECUTION SUCCESS” but the report remains empty…

I try to configure a project in order to analyze an oracle database (11g)

Configuration:
I’m using SonarQube-7.3 (Developer Edition) + Sonar-Scanner-3.2 + SonarPLSQL 3.2 + Java jdk 1.8
It is installed on my personal computer Windows x64 (Trial version)
The file ojdbc6.jar (oracle thin driver) is installed in the folder .\sonarqube-7.3\extensions\jdbc-driver\oracle\

The file sonar-project.properties contains the following:
sonar.projectKey=FACXIT
sonar.projectName=Facxit
sonar.projectVersion=1.0
sonar.sources=.
sonar.host.url=http://localhost:9000
sonar.login=7edc1504dfd5a137bf2225ce2361b8f4e2612e3f
sonar.plsql.jdbc.url=jdbc:oracle:thin:@ora4:1538/gapdev
sonar.plsql.jdbc.user=facxit_usr
sonar.plsql.jdbc.password=*****
#sonar.plsql.jdbc.driver.path=lib/ojdbc8-12.2.0.1.0.jar
sonar.plsql.jdbc.driver.class=oracle.jdbc.OracleDriver

Problem :
the output of the command “sonar-scanner.bat” is always “EXECUTION SUCCESS”
sonar-scanner output (21.3 KB)
But the project report is empty. I tried to set wrong values in the config file for sonar.
plsql.xxx and it is always “EXECUTION SUCCESS”

Questions:
Is a parameter missing ?
What can I do to check what is missing ? (the debug or -X option for sonar-scanner doesn’t help…)
Could you send a sample config file for a such project ?

Thks for the help.
Grégoire


(Pierre-Yves Nicolas) #2

Hi,

It seems that there’s no SQL file in your project: the PLSQL analyser does not run in such a case.
I think there’s a misunderstanding.
The properties named “sonar.plsql.jdbc.*” are used by the PLSQL analyser to get information from a data dictionary: some of the rules require this kind of information.
However, these properties are not used to retrieve SQL code.
SonarQube needs to analyse files (java files, C# files,…): usually these files are extracted from an SCM tool.
If your code is only available in your database server, you need to extract it into files before it can be analysed.

I hope this helps.

Pierre-Yves