Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9f106d7

Browse filesBrowse files
authored
Merge pull request #813 from github/lcartey/scope-performance-fix
`IdentifierHiding`: Improve performance, address some false positives/false negatives
2 parents 16bfd28 + 4d31f5f commit 9f106d7
Copy full SHA for 9f106d7

File tree

Expand file treeCollapse file tree

9 files changed

+416
-217
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+416
-217
lines changed
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- `A2-10-1` - `IdentifierHiding.ql`:
2+
- Improved evaluation performance.
3+
- Addressed false negatives where nested loops used the same variable name.
4+
- Exclude cases where a variable declared in a lambda expression shadowed a global or namespace variable that did not appear in the same translation unit.
5+
- `RULE-5-3` - `IdentifierHidingC.ql`:
6+
- Improved evaluation performance.
7+
- Addressed false negatives where nested loops used the same variable name.

‎cpp/cert/src/rules/DCL53-CPP/LocalConstructorInitializedObjectHidesIdentifier.ql

Copy file name to clipboardExpand all lines: cpp/cert/src/rules/DCL53-CPP/LocalConstructorInitializedObjectHidesIdentifier.ql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ from UserVariable v, UserVariable hidden
2020
where
2121
not isExcluded(v, ScopePackage::localConstructorInitializedObjectHidesIdentifierQuery()) and
2222
v.getInitializer().getExpr() instanceof ConstructorCall and
23-
hides(hidden, v)
23+
hidesStrict(hidden, v)
2424
select v, "The declaration declares variable " + v.getName() + " that hides $@", hidden,
2525
hidden.getName()

‎cpp/cert/src/rules/DCL53-CPP/LocalFunctionDeclaration.ql

Copy file name to clipboardExpand all lines: cpp/cert/src/rules/DCL53-CPP/LocalFunctionDeclaration.ql
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import cpp
1515
import codingstandards.cpp.cert
16-
import codingstandards.cpp.Scope
1716

1817
class LocalUserFunctionDeclarationEntry extends FunctionDeclarationEntry {
1918
DeclStmt ds;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.