add FLines.ql, FLinesOfComments.ql

This commit is contained in:
Alex Ford
2021-04-20 17:12:56 +01:00
parent d6c7846089
commit 37cce23c26
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/**
* @name Number of lines
* @kind treemap
* @description The number of lines in each file.
* @treemap.warnOn highValues
* @metricType file
* @metricAggregate avg sum max
* @precision very-high
* @id rb/lines-per-file
* @tags maintainability
*/
import ruby
from File f, int n
where n = f.getMetrics().getNumberOfLines()
select f, n order by n desc

View File

@@ -0,0 +1,17 @@
/**
* @name Lines of comments in files
* @kind treemap
* @description Files with few lines of comment might not have sufficient documentation to make them understandable.
* @treemap.warnOn lowValues
* @metricType file
* @metricAggregate avg sum max
* @precision very-high
* @id rb/lines-of-comments-in-files
* @tags documentation
*/
import ruby
from File f, int n
where n = f.getMetrics().getNumberOfLinesOfComments()
select f, n order by n desc