Skip to content

Commit 6437440

Browse files
authored
Merge pull request #93 from knewbury01/knewbury01/fix-RULE-5-1
Declarations 1and2: patch shared query alert format
2 parents 970ca32 + 3779da9 commit 6437440

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | External identifer iltiqzxgfqsgigwfuyntzghvzltueeeB is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeeA |
2-
| test.c:5:5:5:35 | iltiqzxgfqsgigwfuyntzghvzltueea | test.c:4:5:4:36 | iltiqzxgfqsgigwfuyntzghvzltueeaZ | External identifer iltiqzxgfqsgigwfuyntzghvzltueea is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeaZ |
3-
| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeeA |
4-
| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to iltiqzxgfqsgigwfuyntzghvzltueeeB |
1+
| test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | External identifer iltiqzxgfqsgigwfuyntzghvzltueeeB is nondistinct in characters at or over 31 limit, compared to $@ | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | iltiqzxgfqsgigwfuyntzghvzltueeeA |
2+
| test.c:5:5:5:35 | iltiqzxgfqsgigwfuyntzghvzltueea | External identifer iltiqzxgfqsgigwfuyntzghvzltueea is nondistinct in characters at or over 31 limit, compared to $@ | test.c:4:5:4:36 | iltiqzxgfqsgigwfuyntzghvzltueeaZ | iltiqzxgfqsgigwfuyntzghvzltueeaZ |
3+
| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to $@ | test.c:1:5:1:36 | iltiqzxgfqsgigwfuyntzghvzltueeeA | iltiqzxgfqsgigwfuyntzghvzltueeeA |
4+
| test.c:8:5:8:35 | iltiqzxgfqsgigwfuyntzghvzltueee | External identifer iltiqzxgfqsgigwfuyntzghvzltueee is nondistinct in characters at or over 31 limit, compared to $@ | test.c:2:5:2:36 | iltiqzxgfqsgigwfuyntzghvzltueeeB | iltiqzxgfqsgigwfuyntzghvzltueeeB |

cpp/common/src/codingstandards/cpp/rules/notdistinctidentifier/NotDistinctIdentifier.qll

+6-3
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ abstract class NotDistinctIdentifierSharedQuery extends Query { }
3232

3333
Query getQuery() { result instanceof NotDistinctIdentifierSharedQuery }
3434

35-
query predicate problems(ExternalIdentifiers d, ExternalIdentifiers d2, string message) {
36-
not isExcluded(d, getQuery()) and
35+
query predicate problems(
36+
ExternalIdentifiers d, string message, ExternalIdentifiers d2, string nameplaceholder
37+
) {
3738
not isExcluded(d, getQuery()) and
39+
not isExcluded(d2, getQuery()) and
3840
not d = d2 and
3941
d.getLocation().getStartLine() >= d2.getLocation().getStartLine() and
4042
d.getSignificantName() = d2.getSignificantName() and
4143
not d.getName() = d2.getName() and
44+
nameplaceholder = d2.getName() and
4245
message =
4346
"External identifer " + d.getName() +
44-
" is nondistinct in characters at or over 31 limit, compared to " + d2.getName()
47+
" is nondistinct in characters at or over 31 limit, compared to $@"
4548
}

0 commit comments

Comments
 (0)