forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from microsoft/brodes/open_source_query_trans…
…ition Brodes/open source query transition
- Loading branch information
Showing
87 changed files
with
3,374 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
cpp/ql/src/Likely Bugs/Leap Year/AntiPattern5InvalidLeapYearCheck.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @name Leap Year Invalid Check (AntiPattern 5) | ||
* @description An expression is used to check a year is presumably a leap year, but the conditions used are insufficient. | ||
* @kind problem | ||
* @problem.severity warning | ||
* @id cpp/leap-year/invalid-leap-year-check | ||
* @precision medium | ||
* @tags leap-year | ||
* correctness | ||
*/ | ||
|
||
import cpp | ||
import LeapYear | ||
|
||
from Mod4CheckedExpr exprMod4 | ||
where not exists(ExprCheckLeapYear lyCheck | lyCheck.getAChild*() = exprMod4) | ||
select exprMod4, "Possible Insufficient Leap Year check (AntiPattern 5)" |
Oops, something went wrong.