diff --git a/ql/src/queries/summary/LinesOfCode.ql b/ql/src/queries/summary/LinesOfCode.ql index 958a931a16d..2b2980d8e17 100644 --- a/ql/src/queries/summary/LinesOfCode.ql +++ b/ql/src/queries/summary/LinesOfCode.ql @@ -1,13 +1,14 @@ /** * @id rb/summary/lines-of-code * @name Total lines of Ruby code in the database - * @description The total number of lines of Ruby code across all files, - * including vendored code, tests. This query counts the lines of code, - * excluding whitespace or comments. + * @description The total number of lines of Ruby code from the source code + * directory, including external libraries and auto-generated files. This is a + * useful metric of the size of a database. This query counts the lines of + * code, excluding whitespace or comments. * @kind metric * @tags summary */ import ruby -select sum(File f | | f.getNumberOfLinesOfCode()) +select sum(File f | exists(f.getRelativePath()) | f.getNumberOfLinesOfCode()) diff --git a/ql/src/queries/summary/LinesOfUserCode.ql b/ql/src/queries/summary/LinesOfUserCode.ql index c7dbb7ee5ba..7f12e3e5a5b 100644 --- a/ql/src/queries/summary/LinesOfUserCode.ql +++ b/ql/src/queries/summary/LinesOfUserCode.ql @@ -1,7 +1,9 @@ /** * @id rb/summary/lines-of-user-code - * @name Lines of authored Ruby code in the database - * @description The total number of lines of Ruby code across files, excluding library and generated code. + * @name Total Lines of user written Ruby code in the database + * @description The total number of lines of Ruby code from the source code + * directory, excluding external library and auto-generated files. This + * query counts the lines of code, excluding whitespace or comments. * @kind metric * @tags summary */