Tips on using SonarQube to analyze a project with the sources and tests stored in combined directories

I am currently working on a project that involves analyzing Angular framework files, with both the source and test files located in the same directories organized by different features.

Here is an illustration of my directory structure:

+- client
|   +- features
|   |   +- home
|   |   |   +- home.js          [source code]
    |   |   +- home.spec.js     [test code]
        |   +- home.html
        |   +- home.less
        +- admin
        |   +- admin.js         [source code]
        |   +- admin.spec.js    [test code]
        |   +- admin.html
        |   +- admin.less
        ...

In my sonar-project.properties, I am facing challenges setting a pattern instead of a path (for example, sonar.tests=client/**/*.spec.js).

Is there any method to conduct an analysis with this specific directory structure?

Thank you.

Answer №1

Big shoutout to the SonarQube forum for providing the answer - simply adjust these properties:

sonar.sources=client
sonar.tests=client

sonar.exclusions=**/*.spec.js
sonar.test.inclusions=**/*.spec.js

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Warning: Potential critical dependency detected while utilizing react-pdf package

When attempting to showcase a PDF on my react application, I encountered the following warning: /node_modules/react-pdf/node_modules/pdfjs-dist/build/pdf.js Critical dependency: require function is used in a way in which dependencies cannot be static ...

How to create an array of objects using an object

I have a specific object structure: { name: 'ABC', age: 12, timing: '2021-12-30T11:12:34.033Z' } My goal is to create an array of objects for each key in the above object, formatted like this: [ { fieldName: 'nam ...

Implementing various onclick button interactions using Vanilla Javascript

I'm looking to update the value of an input when a user clicks on one of my "li" tags, but I want to do it without relying on jQuery. The HTML below shows two sample list tags and I need help with determining how to differentiate between them in the i ...

Creating a personalized HTTP status message within the 2xx range using jQuery ajax

I am currently working on a mechanism to handle custom HTTP status messages and retrieve them in the client-side using jQuery Ajax. So far, I have successfully implemented this for error messages (HTTP 4xx, 5xx), but I'm facing challenges with handli ...

Preventing MongoDB Size Growth in SaaS Product for Cost Efficiency

As someone who is just starting out with MongoDB and web application database storage, I'm a little overwhelmed. I've noticed that as clients continue to add data to their online dashboards on a SaaS platform, the size of the database keeps grow ...

jQuery scroll to id is a function that allows you to smoothly

I have been creating onepage websites for quite some time now, and one issue that always bothers me is the repetitive navigation functions I need to write for each button and id. Here's what it typically looks like: $('#homeB').click(funct ...

Determining the elapsed time using Momentjs

I need assistance with a NodeJS project where I am trying to determine if a specific amount of time (like 1 hour) has passed since creating an object. My project involves the use of MomentJS. For example, if moment(book.createdAt).fromNow() shows 2 hours ...

Is there a way to retrieve data from the host URL within the getStaticPaths function in Next.js?

In my Next.js application, there is a serverless function responsible for fetching data from the host. The host URL is configured in a .env file where it is set to http://localhost:3000/api/data during development and https://productionurl.com/api/data in ...

Identifying Mistakes during Promise Initialization

Looking for a more efficient way to work with Bluebird promises Promise.resolve() .then(function() {return new MyObject(data)}) .then.....etc .catch(function (e){ //handle it}) I am dealing with MyObject and data coming from an external sourc ...

Is there a way to completely remove all navigation options from a webpage?

Currently, I am organizing an online quiz competition for an upcoming event. In order to maintain a fair playing field, I have disabled the ability for users to select text, images, and other elements during the quiz. However, one crucial feature I still ...

ReactJs allows for fluid scroll animations that persist as long as the mouse is clicked or a button

Just some background information: I'm aiming to replicate the scrolling effect seen in Etsy's product image thumbnails carousel. Essentially, when you hover over the top part of the div, it automatically scrolls down until the last image is reve ...

Tips for accessing jQuery elements following declaration

Using jQuery, I have created a Tr element like this: var elemTr = $("<tr>", { }); var elemEmpName = $("<div>", { }).data('otherDtls', { recordId: 10 });; Next, I appended elemEmpName to elemTr like so: elemTr.append(jQue ...

"Experience random updates in the priv/static/js/app.js file whenever changes are made to Vue files in the Phoenix/Elixir/V

I have a vue.js/Phoenix application and I am currently facing a challenge with configuring the frontend assets properly. I have noticed that my priv/static/js/app.js file keeps updating whenever I make changes in other files, and I am unable to understand ...

What methods can be used to search within one array in order to filter another array contained in a list?

Looking for suggestions on creating a filter in one list based on another list How can I handle filtering an array within a list by searching in another array? For example... myArray = [ { "name": "Item-A", "tags": ["Facebook" ...

Is it possible to transfer a specific feature from jQuery to Prototype?

I find myself in a situation where I have to use Prototype instead of jQuery, even though I'm not as familiar with it. Can anyone assist me in transforming the following script: var output={}; $$('ul li').each(function(item){ var firstL ...

Trigger an action when the input text is changed, specifically when the input is populated from a different source

Is there a way to trigger an action on an input when the text is changed from another input, like a datepicker? I attempted to trigger the action when I click the date on the datepicker, but it does not seem to be working. Any suggestions? See below for my ...

What is the best way to showcase a Firestore timestamp in a React application?

Struggling to showcase a Firestore timestamp in a React app. A Firestore document holds a field called createdAt. Attempting to present it within an output list (filtering out irrelevant details). componentDidMount() { this.setState({ loading: true ...

Having trouble with *ngif not functioning properly after initial click in Angular 6

How do I create a Select field in Angular 6 that will hide or display another div based on the selected value? Below is the code snippet: <div class="form-group"> <label for="servicePriviledges">Managed</label> < ...

List of nested objects converted into a flat array of objects

Looking to transform a data structure from an array of objects containing objects to an objects in array setup using JavaScript/Typescript. Input: [ { "a": "Content A", "b": { "1": "Content ...

Jquery's intermittent firing of .ajax within if statement

So, I've inherited a rather messy codebase that I need to modernize. The task involves upgrading from an old version of prototype to the latest jQuery 3.2.1 within a dated website built on php and smarty templates (not exactly my favorite). When a lo ...