Merge pull request #5744 from tamasvajk/feature/java-loc

Java: Introduce LoC summary metric query
This commit is contained in:
Tamás Vajk
2021-04-23 11:39:42 +02:00
committed by GitHub
4 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
/**
* @id java/summary/lines-of-code
* @name Total lines of code in the database
* @description The total number of lines of code across all files. This is a useful metric of the size of a database.
* For all 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() | f.getNumberOfLinesOfCode())

View File

@@ -0,0 +1,9 @@
public class A {
public void M() {
//some comment
}
/* public void M() {
//some comment
} */
}

View File

@@ -0,0 +1 @@
| 4 |

View File

@@ -0,0 +1 @@
Metrics/Summaries/LinesOfCode.ql