S1451 Track lack of copyright and license headers rule doesn't trigger on Pull Requests

  • SonarQube version: Developer Edition
  • 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:
  1. Create repository and project on Sonar (with configured Pull Request Decoration settings)
  2. Add S1451 rule to Quality Profile (with proper parameters)
  3. Create Pull Request with new file that doesn’t contain copyright at the top
  4. 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.

1 Like

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.

1 Like

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.


1 Like