Apply "analysis scope" settings to quality profile?

It seems the “Analysis scope” settings, e.g., for not checking certain files for certain rules, can either be applied globally:
image

or to one project:
image

I would like to bind such settings to a specific quality profile, rather than a single project or all projects.

For instance: say I have a group of projects where we have decided that Java files that start with foo have a special purpose and can violate certain smell rules, so I’d like to turn off those rules for */foo.java using “Ignore Issues on Multiple Criteria”.

I could apply these exceptions globally, but any project not in this group that happens to have foo.java will also be exempted, which may not be what I want. I could apply them per project, but then have to copy to each new project. Instead, I’d like to make a special version of the general quality profile, using inheritance, where these exceptions get added. Then all I have to do whenever I add a new project in this group is to remember to have the new project use the special profile rather than the regular one.

Hi,

That’s an interesting idea, but not possible. Feel free to move this to the ‘New feature’ category.

 
:woman_shrugging:
Ann

OK, I assume just editing the post and changing the category is the way to do that?

(Anyone who just came on: this was originally posted as a question.)

1 Like

You figured it out!

 
:smiley:
Ann

Hi @MisterPi,

Thanks for this interesting suggestion.
Do you refer mainly to “Issues exclusions” or do you have some other cases in mind?

Chris

Mainly I’m thinking of issue exclusions, though I think any changes you make should be as generic as possible, in case someone else needs a different case.

Essentially, I’d like an easy way to copy settings (such as Ignore Issues on Multiple Criteria, but this could apply to other Analysis Scope settings, or even other areas under General Settings) from one project to another. Perhaps something like have an option on the web portal to copy project settings from another project, on each page in a hierarchical manner. For instance, on this page


have a fill-in field, to “copy settings from another project”, so I type in another project key and click a button, and it populates all the fields with the settings from the Analysis Scope page of the other project. Then I can modify those as needed for the new project.

There could even be a designated group of “default” settings, just like there’s a designated default quality profile, so a new project automatically gets those settings without needing the manual step.