Search code examples
javascriptjavasonarqubetechnical-debt

How do I ignore files/folders in SonarQube 4.4's Technical Debt calulation?


I have a project that I am using SonarQube 4.4 to track code quality on. The Technical Debt section (no longer a plug-in as they have merged it into the main project I believe) picks up several open source libraries in my project that I would like to ignore. Other sections in SonarQube allow for exclusions (i.e. Jacoco and/or Cobertura honor the exclusions in the exclusions tab) but the Technical Debt calculator does not seem to honor them.

Is it possible to exclude files from Technical Debt analysis? If so, how?


Solution

  • If these are open source libraries that you don't want analyzed at all, you can exclude them from analysis altogether using sonar.exclusions. Else, you can add an exclusion pattern to avoid the creation of issues on those files, so that their technical debt will effectively be 0, while other metrics will be computed (lines of code, duplications etc.) - see sonar.issue.ignore.multicriteria.