mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
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.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* @id java/summary/lines-of-code
|
||||
* @name Total lines of Java code in the database
|
||||
* @description The total number of lines of code across all Java files. This is a useful metric of the size of a database.
|
||||
* For all Java files that were seen during the build, this query counts the lines of code, excluding whitespace
|
||||
* @name Total lines of Java+Kotlin code in the database
|
||||
* @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.
|
||||
* For all source files that were seen during the build, this query counts the lines of code, excluding whitespace
|
||||
* or comments.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
@@ -11,4 +11,4 @@
|
||||
|
||||
import java
|
||||
|
||||
select sum(CompilationUnit f | f.fromSource() and f.isJavaSourceFile() | f.getNumberOfLinesOfCode())
|
||||
select sum(CompilationUnit f | f.fromSource() | f.getNumberOfLinesOfCode())
|
||||
|
||||
13
java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql
Normal file
13
java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @id java/summary/lines-of-code-java
|
||||
* @name Total lines of Java code in the database
|
||||
* @description The total number of lines of code across all Java files. This is a useful metric of the size of a database.
|
||||
* For all Java files that were seen during the build, this query counts the lines of code, excluding whitespace
|
||||
* or comments.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import java
|
||||
|
||||
select sum(CompilationUnit f | f.fromSource() and f.isJavaSourceFile() | f.getNumberOfLinesOfCode())
|
||||
@@ -6,7 +6,6 @@
|
||||
* or comments.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
* lines-of-code
|
||||
*/
|
||||
|
||||
import java
|
||||
|
||||
Reference in New Issue
Block a user