I have some generated code (JavaScript from TypeScript) that I don't want analysing by sonar (for bugs etc), but I do want the test coverage including.
Currently by using the Sonar inclusion/exclusion we have the coverage and the bugs.
Sonar v6.2
This is possible to ignore all rules on all files using the "Analysis Scope > Ignore Issues on Multiple Criteria" settings on your project.
Please read "Narrowing the focus" on the official documentation.