Files
codeql/ql/src/queries/summary/LinesOfUserCode.ql

20 lines
544 B
Plaintext

/**
* @id rb/summary/lines-of-user-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
*/
import ruby
select sum(File f |
f.fromSource() and
exists(f.getRelativePath()) and
not f.getAbsolutePath().matches("%/vendor/%")
|
f.getNumberOfLinesOfCode()
)