Skip to content

Commit f690d15

Browse files
authored
Merge pull request github#13373 from igfoo/igfoo/kotlin-loc
Java/Kotlin: Split lines of code by language
2 parents c4bfb21 + e49b278 commit f690d15

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* @id java/summary/lines-of-code
33
* @name Total lines of Java code in the database
4-
* @description The total number of lines of code across all files. This is a useful metric of the size of a database.
5-
* For all files that were seen during the build, this query counts the lines of code, excluding whitespace
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
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() | f.getNumberOfLinesOfCode())
14+
select sum(CompilationUnit f | f.fromSource() and f.isJavaSourceFile() | f.getNumberOfLinesOfCode())
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @id java/summary/lines-of-code-kotlin
3+
* @name Total lines of Kotlin code in the database
4+
* @description The total number of lines of code across all Kotlin files. This is a useful metric of the size of a database.
5+
* For all Kotlin 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+
* lines-of-code
10+
*/
11+
12+
import java
13+
14+
select sum(CompilationUnit f |
15+
f.fromSource() and f.isKotlinSourceFile()
16+
|
17+
f.getNumberOfLinesOfCode()
18+
)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The `java/summary/lines-of-code` query now only counts lines of Java code. The new `java/summary/lines-of-code-kotlin` counts lines of Kotlin code.

0 commit comments

Comments
 (0)