Skip to content

Commit 37cce23

Browse files
committed
add FLines.ql, FLinesOfComments.ql
1 parent d6c7846 commit 37cce23

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

ql/src/queries/metrics/FLines.ql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @name Number of lines
3+
* @kind treemap
4+
* @description The number of lines in each file.
5+
* @treemap.warnOn highValues
6+
* @metricType file
7+
* @metricAggregate avg sum max
8+
* @precision very-high
9+
* @id rb/lines-per-file
10+
* @tags maintainability
11+
*/
12+
13+
import ruby
14+
15+
from File f, int n
16+
where n = f.getMetrics().getNumberOfLines()
17+
select f, n order by n desc
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @name Lines of comments in files
3+
* @kind treemap
4+
* @description Files with few lines of comment might not have sufficient documentation to make them understandable.
5+
* @treemap.warnOn lowValues
6+
* @metricType file
7+
* @metricAggregate avg sum max
8+
* @precision very-high
9+
* @id rb/lines-of-comments-in-files
10+
* @tags documentation
11+
*/
12+
13+
import ruby
14+
15+
from File f, int n
16+
where n = f.getMetrics().getNumberOfLinesOfComments()
17+
select f, n order by n desc

0 commit comments

Comments
 (0)