Skip to content

Commit 13a9e83

Browse files
committed
Java/Kotlin: Reshuffle our LoC queries
There's now a single lines-of-code query that gives the total number of lines of code over both languages. Per-language LoC queries are now just summaries.
1 parent 0ab159f commit 13a9e83

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @id java/summary/lines-of-code
3-
* @name Total lines of Java code in the database
4-
* @description The total number of lines of code across all Java files. This is a useful metric of the size of a database.
5-
* For all Java files that were seen during the build, this query counts the lines of code, excluding whitespace
3+
* @name Total lines of Java+Kotlin code in the database
4+
* @description The total number of lines of code across all Java and Kotlin files. This is a useful metric of the size of a database.
5+
* For all source files that were seen during the build, this query counts the lines of code, excluding whitespace
66
* or comments.
77
* @kind metric
88
* @tags summary
@@ -11,4 +11,4 @@
1111

1212
import java
1313

14-
select sum(CompilationUnit f | f.fromSource() and f.isJavaSourceFile() | f.getNumberOfLinesOfCode())
14+
select sum(CompilationUnit f | f.fromSource() | f.getNumberOfLinesOfCode())
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @id java/summary/lines-of-code-java
3+
* @name Total lines of Java code in the database
4+
* @description The total number of lines of code across all Java files. This is a useful metric of the size of a database.
5+
* For all Java files that were seen during the build, this query counts the lines of code, excluding whitespace
6+
* or comments.
7+
* @kind metric
8+
* @tags summary
9+
*/
10+
11+
import java
12+
13+
select sum(CompilationUnit f | f.fromSource() and f.isJavaSourceFile() | f.getNumberOfLinesOfCode())

java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* or comments.
77
* @kind metric
88
* @tags summary
9-
* lines-of-code
109
*/
1110

1211
import java

0 commit comments

Comments
 (0)