mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
CPP: Add basic .qhelp for Adding365daysPerYear.ql.
This commit is contained in:
20
cpp/ql/src/Likely Bugs/Leap Year/Adding365daysPerYear.qhelp
Normal file
20
cpp/ql/src/Likely Bugs/Leap Year/Adding365daysPerYear.qhelp
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE qhelp PUBLIC
|
||||
"-//Semmle//qhelp//EN"
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
<overview>
|
||||
<include src="LeapYear.qhelp" />
|
||||
|
||||
<p>When performing arithmetic operations on a variable that represents a date, leap years must be taken into account.
|
||||
It is not safe to assume that a year is 365 days long.</p>
|
||||
</overview>
|
||||
|
||||
<recommendation>
|
||||
<p>Determine whether the time span in question contains a leap day, then perform the calculation using the correct number
|
||||
of days. Alternatively, use an established library routine that already contains correct leap year logic.</p>
|
||||
</recommendation>
|
||||
|
||||
<references>
|
||||
<include src="LeapYearReferences.qhelp" />
|
||||
</references>
|
||||
</qhelp>
|
||||
Reference in New Issue
Block a user