From f6c8b07f4f92c8d3b5fcb6cef37223a9a313b71d Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Tue, 4 May 2021 21:03:31 +0100 Subject: [PATCH] rb/summary/lines-of-code --- ql/src/queries/summary/LinesOfCode.ql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ql/src/queries/summary/LinesOfCode.ql diff --git a/ql/src/queries/summary/LinesOfCode.ql b/ql/src/queries/summary/LinesOfCode.ql new file mode 100644 index 00000000000..958a931a16d --- /dev/null +++ b/ql/src/queries/summary/LinesOfCode.ql @@ -0,0 +1,13 @@ +/** + * @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. + * @kind metric + * @tags summary + */ + +import ruby + +select sum(File f | | f.getNumberOfLinesOfCode())