53257

SonarQube: Ignore files during coverage report

Question:

I want to provide a coverage report for a ui project.

The project mainly consists of .ts files which under version control.

The gulp command used to check coverage, generates .js files which are then checked for coverage. (and a coverage report that ... reports <strong>only</strong> on those files)

The .js files are not under version control and, when produced are intermingled with the .ts files (i.e., wherever there is a .ts file, a .js file will be generated next to it).

This creates the following issue:

When sonarqube generates coverage report, to my report above (pointed to by sonar.javascript.lcov.reportPaths), the .ts files are added (which of course have 0.0% coverage) and this breaks the actual cov value.

Is there a way / pattern to instruct sonarqube to:

a) perform code analysis on .ts files

b) ignore <strong>all</strong> .ts files when generating coverage report?

Answer1:

Just found out in the <a href="https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreCodeCoverage" rel="nofollow">project's documentation</a>.

<blockquote>

<strong>Ignore Code Coverage</strong>

You can prevent some files from being taken into account for code coverage by unit tests.

To do so, go to Administration > General Settings > Analysis Scope > Code Coverage and set the Coverage Exclusions property

</blockquote>

There is also the following directive that can be used in the sonar-project.properties file:

sonar.coverage.exclusions

Recommend

  • I am using firebase UI login into my app but when i use Facebook builder it stops the app how to inf
  • VERY slow running regular expression when using large documents
  • Blue flash light (Arc) on Google Maps
  • Setting table level WillCascadeOnDelete not available
  • When and how does m2e use the Maven test scope to include test dependencies in Eclipse Run Configura
  • How do I split a String in CSH?
  • How does the C == operator decide whether or not two floating point values are equal?
  • Client-side HTTP_ACCEPT_LANGUAGE access? JavaScript? I don't see a JQuery wrapper. Static pages
  • How can i rename multiple files on upload
  • Cannot programmatically move mouse cursor in VirtualBox
  • Linq-to-SQL to search only DATE portions of a date
  • Caching of Google Cloud Endpoints?
  • Python 3.7 Docker images
  • Radio button in xamarin.ios
  • GAE python NDB projection query working in development but not in production
  • Tortoise SVN conflict occurs but no edit conflict button is shown
  • Alternative to bcrypt when saving passwords in PHP 5.2
  • Auto Increment / Identity Custom Field Type
  • Angular 6 illegal operation on a directory, open '/Users//.npm-global/lib/node_modules/
  • Making Django.contrib.auth store plain-text password
  • Selenium Webdriver IE could not find element
  • How to create OLE Automation to be used with ClearExplorer
  • Auto send email based on the time and email address in database
  • How can I filter an array of dictionaries in 'updateSearchResultsForSearchController' to s
  • How to display content depending on dropdown menue user selection
  • Fortran function variable length string return
  • Does hibernate load two seprate copies of same instance if they are loaded twice from database?
  • Autocomplete source from project settings
  • How to use AJAX to upload large CSV file? [closed]
  • 'Edit' function for forum posts and such
  • How to create subsets of a single set of elements with XSLT?
  • Create an average of multiple excel chart without the data source
  • VS2010 RDLC C#. How can I set a LocalReport object to a ReportViewer?
  • how to run ejabberd with Erlang on Heroku?
  • How to use Streams api peek() function and make it work?
  • `$http:badreq Bad Request Configuration` - from angular post method, what is wrong here?