Skip to content

Commit 8069e7b

Browse files
committed
C++: Downgrade two queries to recommendation
The `cpp/local-variable-hides-global-variable` doesn't seem right as a warning without some additional context. For example, is the local variable and the global variable used in the same function body, and do they have similar enough types that it would be possible to confuse them. The `cpp/missing-header-guard` query enforces good style and helps with compilation speed, but AFAIK it has never flagged a correctness issue. Therefore I think it should be a recommendation.
1 parent c751c51 commit 8069e7b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* The queries `cpp/local-variable-hides-global-variable` and `cpp/missing-header-guard` now have severity `recommendation` instead of `warning`.

cpp/ql/src/Best Practices/Hiding/LocalVariableHidesGlobalVariable.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name Local variable hides global variable
33
* @description A local variable or parameter that hides a global variable of the same name. This may be confusing. Consider renaming one of the variables.
44
* @kind problem
5-
* @problem.severity warning
5+
* @problem.severity recommendation
66
* @precision very-high
77
* @id cpp/local-variable-hides-global-variable
88
* @tags maintainability

cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* the file from being included twice). This prevents errors and
55
* inefficiencies caused by repeated inclusion.
66
* @kind problem
7-
* @problem.severity warning
7+
* @problem.severity recommendation
88
* @precision high
99
* @id cpp/missing-header-guard
1010
* @tags efficiency

0 commit comments

Comments
 (0)