Sonarqube allows for individual files to be excluded from code coverage by adding patterns in the sonar.coverage.exclusions key. This can be done on a project level by
This is an old question, but a more accurate answer is posted here: https://stackoverflow.com/a/49904805/987191
Essentially, the code tab allows drilling down to settings for a project and we can use ** in administration (for the project) -> General Settings -> Analysis Scope -> Coverage exclusions