Skip to content

Commit e9090ce

Browse files
authored
Merge pull request #181 from github/loc-description-improvements
LOC summary query improvements
2 parents 6bd2e4e + 65b0ce2 commit e9090ce

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/**
22
* @id rb/summary/lines-of-code
33
* @name Total lines of Ruby code in the database
4-
* @description The total number of lines of Ruby code across all files,
5-
* including vendored code, tests. This query counts the lines of code,
6-
* excluding whitespace or comments.
4+
* @description The total number of lines of Ruby code from the source code
5+
* directory, including external libraries and auto-generated files. This is a
6+
* useful metric of the size of a database. This query counts the lines of
7+
* code, excluding whitespace or comments.
78
* @kind metric
89
* @tags summary
910
*/
1011

1112
import ruby
1213

13-
select sum(File f | | f.getNumberOfLinesOfCode())
14+
select sum(File f | exists(f.getRelativePath()) | f.getNumberOfLinesOfCode())

ql/src/queries/summary/LinesOfUserCode.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
22
* @id rb/summary/lines-of-user-code
3-
* @name Lines of authored Ruby code in the database
4-
* @description The total number of lines of Ruby code across files, excluding library and generated code.
3+
* @name Total Lines of user written Ruby code in the database
4+
* @description The total number of lines of Ruby code from the source code
5+
* directory, excluding external library and auto-generated files. This
6+
* query counts the lines of code, excluding whitespace or comments.
57
* @kind metric
68
* @tags summary
79
*/

0 commit comments

Comments
 (0)