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 {
80
80
81
81
int getNumberOfVariables ( ) { result = count ( getAVariable ( ) ) }
82
82
83
+ int getNumberOfDeclarations ( ) { result = count ( getADeclaration ( ) ) }
84
+
83
85
Scope getAnAncestor ( ) { result = this .getStrictParent + ( ) }
84
86
85
87
Scope getStrictParent ( ) { result = getParentScope ( this ) }
@@ -133,9 +135,9 @@ private UserDeclaration getPotentialScopeOfDeclaration_candidate(UserDeclaration
133
135
exists ( Scope s |
134
136
result = s .getADeclaration ( ) and
135
137
(
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
137
139
v = s .getAnAncestor ( ) .getADeclaration ( ) and
138
- s .getNumberOfVariables ( ) < 100
140
+ s .getNumberOfDeclarations ( ) < 100
139
141
or
140
142
// In the same scope, but not the same Declaration, and choose just one to report
141
143
v = s .getADeclaration ( ) and
@@ -152,7 +154,7 @@ private UserDeclaration getOuterScopesOfDeclaration_candidate(UserDeclaration v)
152
154
(
153
155
// Declaration in an ancestor scope, but only if there are less than 100 variables in this scope
154
156
v = s .getAnAncestor ( ) .getADeclaration ( ) and
155
- s .getNumberOfVariables ( ) < 100
157
+ s .getNumberOfDeclarations ( ) < 100
156
158
)
157
159
)
158
160
}
You can’t perform that action at this time.
0 commit comments