Rule S1451 “Track lack of copyright and license headers” triggers on full project analysis, but potential issues are not shown in Pull Request decoration (and related Pull Request dashboard on SonarQube UI)
Steps to reproduce:
Create repository and project on Sonar (with configured Pull Request Decoration settings)
Add S1451 rule to Quality Profile (with proper parameters)
Create Pull Request with new file that doesn’t contain copyright at the top
Run sonar scanner with parameters set to that Pull Request.
Sonarqube will say that everything is fine, and code does not violate this rule.
I think, that rule S1451 doesn’t work in every language in pull requests. I’ve tested it for golang, java, ruby, kotlin.
Hi,
What you describe is a limitation we currently have in Pull Requests.
Since the issue doesn’t involve a line of code that was changed in the pull request, it’s no shown in the context of the pull request analysis.
Hi,
Thanks for answer. Do you plan to change this behavior in near future? We have many blockers in our projects because of this, and we have to write to developers to fix that, and that’s what exactly Pull Request validation and quality gates should do.
Do you have some list with rules, that are not triggering in pull requests? That would be very helpful.
Hi,
We are facing the similar kind of issue with below rule and couple other rules on Developer Edition 8.5 for iOS.
swift:S1996:Types should be defined in separate source files
…
As [Wojciech Buczek] asked already, Could you please let us know the list of rules that won’t be trigged in pull requests but on main branch once merged.