File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
cpp/common/src/codingstandards/cpp
c/common/test/rules/identifierhidden Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- | test.c:4:7:4:9 | id1 | Variable is hiding variable $@. | test.c:1:5:1:7 | id1 | id1 |
2- | test.c:7:13:7:15 | id1 | Variable is hiding variable $@. | test.c:1:5:1:7 | id1 | id1 |
3- | test.c:10:12:10:14 | id1 | Variable is hiding variable $@. | test.c:1:5:1:7 | id1 | id1 |
4- | test.c:11:14:11:16 | id1 | Variable is hiding variable $@. | test.c:10:12:10:14 | id1 | id1 |
5- | test.c:24:24:24:26 | id2 | Variable is hiding variable $@. | test.c:22:5:22:7 | id2 | id2 |
1+ | test.c:4:7:4:9 | id1 | Declaration is hiding declaration $@. | test.c:1:5:1:7 | id1 | id1 |
2+ | test.c:7:13:7:15 | id1 | Declaration is hiding declaration $@. | test.c:1:5:1:7 | id1 | id1 |
3+ | test.c:10:12:10:14 | id1 | Declaration is hiding declaration $@. | test.c:1:5:1:7 | id1 | id1 |
4+ | test.c:11:14:11:16 | id1 | Declaration is hiding declaration $@. | test.c:10:12:10:14 | id1 | id1 |
5+ | test.c:24:24:24:26 | id2 | Declaration is hiding declaration $@. | test.c:22:5:22:7 | id2 | id2 |
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ class Scope extends Element {
8080
8181 int getNumberOfVariables ( ) { result = count ( getAVariable ( ) ) }
8282
83+ int getNumberOfDeclarations ( ) { result = count ( getADeclaration ( ) ) }
84+
8385 Scope getAnAncestor ( ) { result = this .getStrictParent + ( ) }
8486
8587 Scope getStrictParent ( ) { result = getParentScope ( this ) }
@@ -133,9 +135,9 @@ private UserDeclaration getPotentialScopeOfDeclaration_candidate(UserDeclaration
133135 exists ( Scope s |
134136 result = s .getADeclaration ( ) and
135137 (
136- // Declaration in an ancestor scope, but only if there are less than 100 variables in this scope
138+ // Declaration in an ancestor scope, but only if there are less than 100 declarations in this scope
137139 v = s .getAnAncestor ( ) .getADeclaration ( ) and
138- s .getNumberOfVariables ( ) < 100
140+ s .getNumberOfDeclarations ( ) < 100
139141 or
140142 // In the same scope, but not the same Declaration, and choose just one to report
141143 v = s .getADeclaration ( ) and
@@ -152,7 +154,7 @@ private UserDeclaration getOuterScopesOfDeclaration_candidate(UserDeclaration v)
152154 (
153155 // Declaration in an ancestor scope, but only if there are less than 100 variables in this scope
154156 v = s .getAnAncestor ( ) .getADeclaration ( ) and
155- s .getNumberOfVariables ( ) < 100
157+ s .getNumberOfDeclarations ( ) < 100
156158 )
157159 )
158160}
You can’t perform that action at this time.
0 commit comments