-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Japanese Era and Leap Year checks (Likely Bugs) #1345
C#: Japanese Era and Leap Year checks (Likely Bugs) #1345
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this. The query itself looks great, but I have added some style/typo comments.
|
||
from Expr expr, string message | ||
where | ||
isDateFromJapaneseCalendarToDateTime(expr) and message = "DateTime created from Japanese calendar with explicit or current era and hard-coded year" or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single quotes around DateTime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full stop at end of message.
from Expr expr, string message | ||
where | ||
isDateFromJapaneseCalendarToDateTime(expr) and message = "DateTime created from Japanese calendar with explicit or current era and hard-coded year" or | ||
isDateFromJapaneseCalendarCreation(expr) and message = "DateTime constructed from Japanese calendar with explicit or current era and hard-coded year" or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single quotes and full stop.
where | ||
isDateFromJapaneseCalendarToDateTime(expr) and message = "DateTime created from Japanese calendar with explicit or current era and hard-coded year" or | ||
isDateFromJapaneseCalendarCreation(expr) and message = "DateTime constructed from Japanese calendar with explicit or current era and hard-coded year" or | ||
isEraCollectionCreation(expr) and message = "Hard-coded collection with Japanese era years" or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full stop.
isDateFromJapaneseCalendarToDateTime(expr) and message = "DateTime created from Japanese calendar with explicit or current era and hard-coded year" or | ||
isDateFromJapaneseCalendarCreation(expr) and message = "DateTime constructed from Japanese calendar with explicit or current era and hard-coded year" or | ||
isEraCollectionCreation(expr) and message = "Hard-coded collection with Japanese era years" or | ||
inEraArrayCreation (expr) and message = "Hard-coded array with Japanese era years" or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full stop.
isDateFromJapaneseCalendarCreation(expr) and message = "DateTime constructed from Japanese calendar with explicit or current era and hard-coded year" or | ||
isEraCollectionCreation(expr) and message = "Hard-coded collection with Japanese era years" or | ||
inEraArrayCreation (expr) and message = "Hard-coded array with Japanese era years" or | ||
isExactEraStartDateCreation(expr) and message = "Hard-coded the beginning of the Japanese Heisei era" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full stop.
csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.qhelp
Outdated
Show resolved
Hide resolved
csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.qhelp
Outdated
Show resolved
Hide resolved
csharp/ql/test/query-tests/Likely Bugs/LeapYear/AntiPattern1/options
Outdated
Show resolved
Hide resolved
csharp/ql/test/query-tests/Likely Bugs/LeapYear/AntiPattern1/Program.cs
Outdated
Show resolved
Hide resolved
csharp/ql/test/query-tests/Likely Bugs/LeapYear/AntiPattern1/MishandlingJapaneseEra.qlref
Outdated
Show resolved
Hide resolved
csharp/ql/test/query-tests/Likely Bugs/LeapYear/AntiPattern1/MishandlingJapaneseEra.expected
Outdated
Show resolved
Hide resolved
csharp/ql/test/query-tests/Likely Bugs/LeapYear/AntiPattern1/Program.cs
Outdated
Show resolved
Hide resolved
csharp/ql/src/Likely Bugs/LeapYear/UnsafeYearConstruction.qhelp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments. I just have one more small request.
@@ -0,0 +1,42 @@ | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this file, and others, from csharp/ql/test/query-tests/Likely Bugs/LeapYear/UnsafeYearConstruction/
to csharp/ql/test/query-tests/Likely Bugs/UnsafeYearConstruction/
(i.e., remove the nested LeapYear
folder).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small things then it's good to go. Many thanks!
CSharp checks for mishandling Japanese date and leap year calculations