Sonar is not reading .PRC, .TRG,.VIW source of SQL type exetensions

Hi All,

I have SQL code base. This folders contains mix of files with extension .sql,.prc, .viw, .fnc, .trg etc. Sonar is able to read file with extension .sql, but unable to read extension .prc, .viw, .fnc, .trg.
Currently I’m using PLSQl plugin with enterprise version.

In my directory I have 5000 store procedures but only 40 are getting read for scanning.
The File name starting with dbo.sp_ Only this files are getting read.

Could anyone help me on this how to read the Store procedures, Triggers, functions all. I don’t see any warnings or errors in Jenkins console.

Hi,

Assuming all these files really are PL/SQL, then all you have to do is edit the list of file extensions that PL/SQL analysis claims / recognizes. You can do that at either the project or global level. You’ll find it under ‘Languages’, then just pick PL/SQL in the language dropdown.

 
HTH,
Ann

Hi,

I have added the extensions in language settings and still Not reading all files here is the output of the Jenkins console.
To scan all files I have converted .PRC, .TRG to .SQL and I have tried with PL\SQL didn’t worked.

INFO: 8755 files indexed...  (last one was Database/Procedures/usp_MoveIntervalFiles_SQLV2K.sql)
INFO: 9303 files indexed
INFO: Quality profile for tsql: Sonar way
INFO: ------------- Run sensors on module Phar_Sql
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=106ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/windows/system32/config/systemprofile/.sonar/cache/a89f1943fc75b65becd9fb4ecab8d913/sonar-tsql-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
 WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
 All illegal access operations will be denied in a future release
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=50ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=31ms
INFO: Sensor cs-vf Checks [codescanlang]
INFO: Running CodeScanLang
INFO: Sensor cs-vf Checks [codescanlang] (done) | time=23ms
INFO: Sensor cs-js Checks [codescanlang]
INFO: Running CodeScanLang
INFO: Sensor cs-js Checks [codescanlang] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=30ms
INFO: Sensor T-SQL Sensor [tsql]
INFO: 335 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=158ms

The total 9303 files is indexed but only 335 files are analyzed and Is something went wrong? Could anyone help me on this.

Hi,

It’s not clear to me what you’ve done and there’s not enough of the analysis log above to show me what’s going on. It seems that you renamed the files in question? Here’s what I had in mind:

 
Ann

Hi Ann,

In My repository total 9303 files are source file scripts and need to be analysed but sonar scanner it is not getting read only 355 files are getting analysed. Just want to know is anything missing from my end. The all files are .sql files and they are supposed to be scanned.

Hi,

Maybe provide your code-formatted (``` on the line before and on the line after) analysis log?

 
Ann

Hi Ann,

I got solution from Jeff.
I have configured the suffixes as below.

-Dsonar.tsql.file.suffixes=**/*.sql,**/*.prc,**/*.trg**/*.tsql
Tried in below format to pass the parameter and now able to scan all files.
-Dsonar.tsql.file.suffixes=.sql,.prc,.trg,.tsql

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