Must-share information (formatted with Markdown):
- which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension):- Enterprise Edition v2025.1 (102418)
- how is SonarQube deployed: zip, Docker, Helm:- Zip
- what are you trying to achieve: Scanning SQL files
- what have you tried so far to achieve this:- Added Quality gate
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
We use SQL stored procedures across multiple projects and have implemented stored procedure scanning. However, we’re facing a challenge with code duplication detection. Several stored procedures contain identical SELECT statements and logic (shared across 3-4 different procedures). Our quality gate is configured to fail builds when duplicate code exceeds 10%, but this is problematic for SQL files since reusing common SELECT statements or logic across multiple stored procedures is a standard practice.
How can we configure the quality gate to detect duplication only within individual files while ignoring duplicated code that appears across different files?
Thanks
Sunil Bindra
