SonarQube is showing error while scanning .sql files

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
    I am using https://care-sonar.int.tieto.com/projects/favorite?view=leak
  • how is SonarQube deployed: ADO CICD pipeline
  • what are you trying to achieve: Want to scan .sql files inside ADO repository.
  • what have you tried so far to achieve this:
    There are inbuilt sonarqube tasks, which we have configured:
    Task#1: Prepare analysis on SonarQube Server: We are using in build developement project setup with option “Use Standalone SonarScanner CLI”
    Task#2: Run Code Analysis
    In this task, we using Java_Home for analyzing the code

When we are executing the build of repository, so that we can scan the .sql files under that repository, we are getting following error:

“The Data Dictionary is not configured for the PLSQL analyzer, which prevents rule(s) S3641, S3921, S3618, S3651 from raising issues. See PL/SQL | SonarQube Server Documentation

After this error, its showing parser error for our .sql files, even if there are no issues with the written code into those .sql files. These .sql files are written for MS SQL Server databases.

Can you please suggest how to correct this sonarqube scanning configuration for .sql files.
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

Welcome to the community!

It sounds like your files are being “indexed” (i.e. recognized) as PL/SQL files rather than as T-SQL files by analysis. To control that, you’ll edit the file extensions for both languages. This can be done at the project level or, if you don’t do PL/SQL in the company, at the global level at Administration → Languages.

 
HTH,
Ann