Files
codeql/cpp/ql/src/Metrics/Files/FLinesOfDuplicatedCode.ql
Cornelius Riemenschneider 47530d7526 C++: Fix query metadata warnings.
2021-03-24 18:01:21 +01:00

28 lines
703 B
Plaintext

/**
* @deprecated
* @name Duplicated lines in files
* @description The number of lines in a file, including code, comment
* and whitespace lines, which are duplicated in at least
* one other place.
* @kind treemap
* @treemap.warnOn highValues
* @metricType file
* @metricAggregate avg sum max
* @id cpp/duplicated-lines-in-files
* @tags testability
* modularity
*/
import external.CodeDuplication
from File f, int n
where
n =
count(int line |
exists(DuplicateBlock d | d.sourceFile() = f |
line in [d.sourceStartLine() .. d.sourceEndLine()]
) and
not whitelistedLineForDuplication(f, line)
)
select f, n order by n desc