T\SQL file is analyzed but found no issue

Hi, I have successfully run the analysis on sonarcloud (free).

2022-08-31T15:26:03.8636532Z 15:26:03.863 DEBUG: 'example.sql' generated metadata with charset 'UTF-8'
2022-08-31T15:26:03.8714135Z 15:26:03.871 INFO: 2 source files to be analyzed
2022-08-31T15:26:03.8717125Z 15:26:03.871 INFO: 2/2 source files have been analyzed
2022-08-31T15:26:03.8719797Z 15:26:03.871 INFO: Sensor Text Sensor [text] (done) | time=14ms

I intentionally choose some rules (bug, code smell) and put non-compliant code into my file, but my file on the sonarcloud UI does not show any bug or code smell.
Can you please help?

Regards,
Balint

Hi Balint,

Welcome to the community!

I want to start with the basics. If you go to your Main Branch
Selection_423

And then Measures → Size → Lines of Code, do you see the lines in the file (well, in the project overall) counted as T-SQL? I’m asking because it’s possible your files were analyzed as PL/SQL, which would explain why no T-SQL issues were found.

 
Ann

Thank you very much for your reply. I agree let’s start with the basics, since I have lot to learn about SonarCloud.
I have the code (example.sql - interpreted as T-SQL) on a branch and PR. Hence, I cannot find the Measures → Size menu on the Main Branch. Although, I can find this menu on the Pull Request menu (see attached screenshot) and the new lines (144) is there.

Hi,

You’re in a pull request, which is why you only have New Code as an option. Can you follow the same path for the main branch?

 
Ann

Thank you, Ann! You helped me a lot. Although, I had no Size link under Measure on the main branch, as soon as I merged the code, and opened another PR with additional buggy sql code to test, I could see the issues. Now, I have Measure > Size and could see the code with the bugs and issues. Even if I open another PR it works as expected.


1 Like