Skip to content

Commit b890887

Browse files
authored
Merge pull request github#14551 from igfoo/igfoo/loc
Java/Kotlin: Reshuffle our LoC queries
2 parents 319b799 + 26634a3 commit b890887

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-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
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* java/summary/lines-of-code now gives the total number of lines of Java and Kotlin code, and is the only query tagged `lines-of-code`. java/summary/lines-of-code-java and java/summary/lines-of-code-kotlin give the per-language counts.

0 commit comments

Comments
 (0)