C++: Improve the JSF 3.02 rule 1 message, and add a test

This commit is contained in:
Ian Lynagh
2018-08-15 15:26:18 +01:00
parent 031964e853
commit d2b4265b73
4 changed files with 617 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
*/
import cpp
from Function f
where f.getMetrics().getNumberOfLinesOfCode() > 200
select f, "AV Rule 1: any one function (or method) will contain no more than 200 logical source lines of code."
from Function f, int n
where n = f.getMetrics().getNumberOfLinesOfCode()
and n > 200
select f, "AV Rule 1: any one function (or method) will contain no more than 200 logical source lines of code. Function '" + f.toString() + "' contains " + n.toString() + " lines of code."