# Can I filter issues by quality profile?

**URL:** <https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984>\
**Category:** SonarQube Server / Community Build\
**Tags:** quality-profiles, rules\
**Created:** [March 18, 2025, 8:20am UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984 "2025-03-18T08:20:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![arielman](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/arielman/32/8135_2.png) [@arielman](https://community.sonarsource.com/u/arielman)\
**Post date:** [March 18, 2025, 8:20am UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/1 "2025-03-18T08:20:56Z")

</div>

I have one big project in sonar server (Enterprise Edition v2025.1), and I want to duplicate java sonarway quality profile, and choose from there some rules for specific path, as described here:

> [@Is it possible to apply profile only for specific paths in big project?](https://community.sonarsource.com/t/is-it-possible-to-apply-profile-only-for-specific-paths-in-big-project/133345/4):
>
> Your rule key will have a very specific pattern, without spaces. You can see it when you browse the rule in SonarQube. You probably defined it yourself when you developed the rule! So in this examle, the rule key pattern is the rule key itself, cpp:S3805. If you want to have this rule only apply on rules in ariel1/src/poc, you should define ariel1/src/poc/\*\*/\* as the file path pattern.

Now the current status is that I have 2 java qualify profiles which I want to apply on this project, and I can’t find an easy way to filter per my new quality profile. The only filter I can use is the path, and then choose one by one my rules.  
In case I have 50 rules it’s very frustrating… is there other way to filter per my needs?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 19, 2025, 11:49am UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/2 "2025-03-19T11:49:15Z")

</div>

Hi,

> [@arielman](#):
>
> Now the current status is that I have 2 java qualify profiles applied on this project,

No. You don’t.

Only one profile for any given language runs during analysis.

It’s not clear to me what you’re trying to achieve, but only one profile is being used. You can see what it is on the Project Information tab.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![arielman](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/arielman/32/8135_2.png) [@arielman](https://community.sonarsource.com/u/arielman)\
**Post date:** [March 19, 2025, 1:33pm UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/3 "2025-03-19T13:33:05Z")

</div>

so if I understand correctly, the only way which can work for me is to use sonarway java quality profile, and in the project analysis scope configuration, create multiple issues under ‘Ignore Issues on Multiple Criteria’ (where each one represent rule from the java quality profile which I don’t want to be applied on my path). Is that correct?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 19, 2025, 3:25pm UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/4 "2025-03-19T15:25:04Z")

</div>

Hi,

> [@arielman](#):
>
> so if I understand correctly, the only way which can work for me is to use sonarway java quality profile

You can use any profile you like.

> [@arielman](#):
>
> create multiple issues under ‘Ignore Issues on Multiple Criteria’ (where each one represent rule from the java quality profile which I don’t want to be applied on my path). Is that correct?

Okay, so if you want specific rules applied to parts of your project but not to all of it, then yes, multi-criteria exclusions are your best bet.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![arielman](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/arielman/32/8135_2.png) [@arielman](https://community.sonarsource.com/u/arielman)\
**Post date:** [March 20, 2025, 4:38am UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/5 "2025-03-20T04:38:54Z")

</div>

So just to clarify, if my project is using sonarway java profile, which currently has 548 active rules, and I want to keep only 100 rules for certain path, my only option is to create manually 448 entries? there is no shorter way? (assuming I can’t use other java quality profile for now, as other paths need the whole set of rules)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 20, 2025, 11:39am UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/6 "2025-03-20T11:39:20Z")

</div>

Hi,

The shorter way would be to split the analysis: analyze “certainPath” as a separate project with a different profile and make sure it’s excluded from the analysis of the main project.

However, given that we’re talking about Java here, I fear that might impact the quality of the results because Java analysis reads not just the source of each class, but also the interactions within your project. Cut one package off from the rest and you may miss some important issues.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![arielman](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/arielman/32/8135_2.png) [@arielman](https://community.sonarsource.com/u/arielman)\
**Post date:** [March 20, 2025, 11:54am UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/7 "2025-03-20T11:54:18Z")

</div>

How technically I can analyze “certainPath” as a separate project with a different profile?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 20, 2025, 12:31pm UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/8 "2025-03-20T12:31:09Z")

</div>

Hi,

You’ll set up a second analysis and narrow `sonar.sources` for that analysis to just `certainPath`. You can probably leave `sonar.java.binaries` pointed to all the classes (that may help with accuracy).

And in the original/main project, you’ll add an [exclusion](https://docs.sonarsource.com/sonarqube-server/latest/project-administration/analysis-scope/#project-level) for `certainPath`.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![arielman](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/arielman/32/8135_2.png) [@arielman](https://community.sonarsource.com/u/arielman)\
**Post date:** [March 20, 2025, 12:38pm UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/9 "2025-03-20T12:38:19Z")

</div>

It’s too complicated… I think it’s a gap you need to find some solution for it. Maybe option to apply one quality profile at project level and apply another quality profile at path level (with exclude of this path in project analysis level)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [March 27, 2025, 12:38pm UTC](https://community.sonarsource.com/t/can-i-filter-issues-by-quality-profile/136984/10 "2025-03-27T12:38:38Z")

</div>

Closed on March 27, 2025, 12:38pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
