Skip to content

Commit 61c33be

Browse files
committed
Exclude queries with effective category disapplied.
1 parent c33952e commit 61c33be

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: cpp/common/src/codingstandards/cpp/Exclusions.qll

+5
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@ predicate isExcluded(Element e, Query query, string reason) {
5959
reason =
6060
"Query has an associated deviation record with a code identifier that is applied to the element."
6161
)
62+
or
63+
// The effective category of the query is 'Disapplied'.
64+
// This can occur when a Guideline Recategorization Plan is applied.
65+
query.getEffectiveCategory().isDisapplied() and
66+
reason = "The query is disapplied."
6267
}

Diff for: cpp/common/src/codingstandards/cpp/exclusions/RuleMetadata.qll

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class EffectiveCategory extends TEffectiveCategory {
4040

4141
/** Holds if the effective category permits a deviation */
4242
predicate permitsDeviation() { not this instanceof TMandatory and not this instanceof TInvalid }
43+
44+
/** Holds if the effective category is 'Disapplied'. */
45+
predicate isDisapplied() { this instanceof TDisapplied }
4346
}
4447

4548
class Query extends TQuery {

0 commit comments

Comments
 (0)