We want to exclude generated Code from all Rules concerning Maintanability in Sonarqube.
Currently you can restrict the analysis-scope by rule-id or rule name (or part of it)
It would be amazing, if it was possible to add a restriction like:
Rule key pattern: java:*Maintainability*
File path pattern: **/generated/**
best regards
Marc Stockhammer
Hi @mstockhammer ,
Thank you for sharing this use case.
Can you help me understand more:
- Why do you not want to apply maintainability rules on generated code?
- In your repository, are some files completely AI generated while the rest are completely human written?
hi @vivek.reghunath
its not about AI generated code but per plugins generated code, for example DAOs for Webservices (rest, soap) or reverse engineered database-access classes.
such generated classes have a system-intherent weakness for maintainabilitiy-issues, which are in our opinion not valid as it is generated and not maintained code, as we generate it again every time it is needed.
Reliablity issues, sure, security issues, absolutely, but it would be great to ignore all maintainability issues for select folders within one project.
i hope i was able to make the usecase a bit more clear?