Skip to content

Commit

Permalink
Merge pull request #813 from github/lcartey/scope-performance-fix
Browse files Browse the repository at this point in the history
`IdentifierHiding`: Improve performance, address some false positives/false negatives
  • Loading branch information
knewbury01 authored Dec 10, 2024
2 parents 16bfd28 + 4d31f5f commit 9f106d7
Show file tree
Hide file tree
Showing 9 changed files with 416 additions and 217 deletions.
7 changes: 7 additions & 0 deletions change_notes/2024-12-08-identifier-hiding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- `A2-10-1` - `IdentifierHiding.ql`:
- Improved evaluation performance.
- Addressed false negatives where nested loops used the same variable name.
- 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.
- `RULE-5-3` - `IdentifierHidingC.ql`:
- Improved evaluation performance.
- Addressed false negatives where nested loops used the same variable name.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ from UserVariable v, UserVariable hidden
where
not isExcluded(v, ScopePackage::localConstructorInitializedObjectHidesIdentifierQuery()) and
v.getInitializer().getExpr() instanceof ConstructorCall and
hides(hidden, v)
hidesStrict(hidden, v)
select v, "The declaration declares variable " + v.getName() + " that hides $@", hidden,
hidden.getName()
1 change: 0 additions & 1 deletion cpp/cert/src/rules/DCL53-CPP/LocalFunctionDeclaration.ql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import cpp
import codingstandards.cpp.cert
import codingstandards.cpp.Scope

class LocalUserFunctionDeclarationEntry extends FunctionDeclarationEntry {
DeclStmt ds;
Expand Down
Loading

0 comments on commit 9f106d7

Please sign in to comment.