Skip to content

Commit fd9df2b

Browse files
committed
CTR57-CPP: simplify alert message
A2-3-1: remove compiler checked NON_COMPLIANT tests
1 parent d099122 commit fd9df2b

File tree

2 files changed

+30
-36
lines changed

2 files changed

+30
-36
lines changed

cpp/common/src/codingstandards/cpp/rules/orderingpredicatemustbestrictlyweak/OrderingPredicateMustBeStrictlyWeak.qll

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,7 @@ class ContainerComparatorUsage extends ComparatorUsage {
173173
query predicate problems(ComparatorUsage cu, string message) {
174174
not cu.isStrictlyWeakOrdering() and
175175
not isExcluded(cu, getQuery()) and
176-
exists(string s |
177-
if exists(cu.getComparator().getQualifiedName())
178-
then s = cu.getComparator().getQualifiedName()
179-
else s = cu.getComparator().getName()
180-
|
181-
message =
182-
"Comparator '" + s +
183-
"' used on container or sorting algorithm that is not strictly weakly ordered"
184-
)
176+
message =
177+
"Comparator '" + cu.getComparator().getName() +
178+
"' used on container or sorting algorithm that is not strictly weakly ordered"
185179
}

cpp/common/test/rules/orderingpredicatemustbestrictlyweak/OrderingPredicateMustBeStrictlyWeak.expected

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
| test.cpp:27:39:27:41 | definition of s1a | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
2-
| test.cpp:28:42:28:44 | definition of s1b | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
3-
| test.cpp:36:39:36:41 | definition of s1a | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
4-
| test.cpp:37:42:37:44 | definition of s1b | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
5-
| test.cpp:41:44:41:46 | definition of s2a | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
6-
| test.cpp:42:47:42:49 | definition of s2b | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
7-
| test.cpp:46:44:46:46 | definition of m1a | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
8-
| test.cpp:47:47:47:49 | definition of m1b | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
9-
| test.cpp:51:49:51:51 | definition of m2a | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
10-
| test.cpp:52:52:52:54 | definition of m2b | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
11-
| test.cpp:58:15:58:16 | definition of s1 | Comparator 'std::less<A>' used on container or sorting algorithm that is not strictly weakly ordered |
12-
| test.cpp:60:7:60:8 | definition of s2 | Comparator 'std::less_equal<A>' used on container or sorting algorithm that is not strictly weakly ordered |
13-
| test.cpp:62:7:62:8 | definition of s3 | Comparator 'std::greater_equal<A>' used on container or sorting algorithm that is not strictly weakly ordered |
14-
| test.cpp:64:7:64:8 | definition of s4 | Comparator 'std::greater<A>' used on container or sorting algorithm that is not strictly weakly ordered |
15-
| test.cpp:66:7:66:8 | definition of s5 | Comparator 'std::less<A>' used on container or sorting algorithm that is not strictly weakly ordered |
16-
| test.cpp:81:3:81:11 | call to sort | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
17-
| test.cpp:84:3:84:11 | call to sort | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
18-
| test.cpp:105:3:105:11 | call to sort | Comparator 'std::less_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
19-
| test.cpp:108:3:108:11 | call to sort | Comparator 'std::greater_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
20-
| test.cpp:120:3:120:18 | call to stable_sort | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
21-
| test.cpp:123:3:123:18 | call to stable_sort | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
22-
| test.cpp:135:3:135:18 | call to stable_sort | Comparator 'std::less_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
23-
| test.cpp:138:3:138:18 | call to stable_sort | Comparator 'std::greater_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
24-
| test.cpp:153:3:153:19 | call to partial_sort | Comparator 'std::less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
25-
| test.cpp:156:3:156:19 | call to partial_sort | Comparator 'std::greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
26-
| test.cpp:168:3:168:19 | call to partial_sort | Comparator 'std::less_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
27-
| test.cpp:171:3:171:19 | call to partial_sort | Comparator 'std::greater_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
1+
| test.cpp:27:39:27:41 | definition of s1a | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
2+
| test.cpp:28:42:28:44 | definition of s1b | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
3+
| test.cpp:36:39:36:41 | definition of s1a | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
4+
| test.cpp:37:42:37:44 | definition of s1b | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
5+
| test.cpp:41:44:41:46 | definition of s2a | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
6+
| test.cpp:42:47:42:49 | definition of s2b | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
7+
| test.cpp:46:44:46:46 | definition of m1a | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
8+
| test.cpp:47:47:47:49 | definition of m1b | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
9+
| test.cpp:51:49:51:51 | definition of m2a | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
10+
| test.cpp:52:52:52:54 | definition of m2b | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
11+
| test.cpp:58:15:58:16 | definition of s1 | Comparator 'less<A>' used on container or sorting algorithm that is not strictly weakly ordered |
12+
| test.cpp:60:7:60:8 | definition of s2 | Comparator 'less_equal<A>' used on container or sorting algorithm that is not strictly weakly ordered |
13+
| test.cpp:62:7:62:8 | definition of s3 | Comparator 'greater_equal<A>' used on container or sorting algorithm that is not strictly weakly ordered |
14+
| test.cpp:64:7:64:8 | definition of s4 | Comparator 'greater<A>' used on container or sorting algorithm that is not strictly weakly ordered |
15+
| test.cpp:66:7:66:8 | definition of s5 | Comparator 'less<A>' used on container or sorting algorithm that is not strictly weakly ordered |
16+
| test.cpp:81:3:81:11 | call to sort | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
17+
| test.cpp:84:3:84:11 | call to sort | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
18+
| test.cpp:105:3:105:11 | call to sort | Comparator 'less_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
19+
| test.cpp:108:3:108:11 | call to sort | Comparator 'greater_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
20+
| test.cpp:120:3:120:18 | call to stable_sort | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
21+
| test.cpp:123:3:123:18 | call to stable_sort | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
22+
| test.cpp:135:3:135:18 | call to stable_sort | Comparator 'less_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
23+
| test.cpp:138:3:138:18 | call to stable_sort | Comparator 'greater_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
24+
| test.cpp:153:3:153:19 | call to partial_sort | Comparator 'less_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
25+
| test.cpp:156:3:156:19 | call to partial_sort | Comparator 'greater_equal<int>' used on container or sorting algorithm that is not strictly weakly ordered |
26+
| test.cpp:168:3:168:19 | call to partial_sort | Comparator 'less_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
27+
| test.cpp:171:3:171:19 | call to partial_sort | Comparator 'greater_equal<B>' used on container or sorting algorithm that is not strictly weakly ordered |
2828
| test.cpp:194:7:194:8 | definition of s1 | Comparator 'UnknownUserDefinedComparator<int>' used on container or sorting algorithm that is not strictly weakly ordered |
2929
| test.cpp:196:7:196:8 | definition of s2 | Comparator 'UnknownUserDefinedComparator<A>' used on container or sorting algorithm that is not strictly weakly ordered |
3030
| test.cpp:197:3:197:11 | call to sort | Comparator 'UnknownUserDefinedComparator<int>' used on container or sorting algorithm that is not strictly weakly ordered |

0 commit comments

Comments
 (0)