Skip to content

Commit 2a6f979

Browse files
committed
C# Add line of code metric query
1 parent 7080b25 commit 2a6f979

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @id cs/summary/lines-of-code
3+
* @name Total lines of 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. For all files that were seen during the build, this query counts the lines of code, excluding whitespace or comments.
5+
* @kind metric
6+
* @tags summary
7+
*/
8+
9+
import csharp
10+
11+
select sum(File f | f.fromSource() | f.getNumberOfLinesOfCode())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| 4 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Metrics/Summaries/LinesOfCode.ql
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
class C1
3+
{
4+
/*
5+
int M()
6+
{
7+
return 0;
8+
}
9+
*/
10+
11+
// int M() => 0;
12+
13+
int M() => 0; // Comment
14+
}

0 commit comments

Comments
 (0)