mirror of
https://github.com/github/codeql.git
synced 2026-02-19 16:33:40 +01:00
add FLines.ql, FLinesOfComments.ql
This commit is contained in:
17
ql/src/queries/metrics/FLines.ql
Normal file
17
ql/src/queries/metrics/FLines.ql
Normal 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
|
||||
17
ql/src/queries/metrics/FLinesOfComments.ql
Normal file
17
ql/src/queries/metrics/FLinesOfComments.ql
Normal 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
|
||||
Reference in New Issue
Block a user