mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C++: Update summary queries.
This commit is contained in:
committed by
GitHub
parent
16a3dfa30a
commit
97ab842010
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* @id cpp/summary/files
|
||||
* @name Total source files
|
||||
* @description The total number of source files.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
select count(File f | f.fromSource())
|
||||
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* @id cpp/summary/lines
|
||||
* @name Total lines of text
|
||||
* @description The total number of lines of text across all source files.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
select sum(File f | f.fromSource() | f.getMetrics().getNumberOfLines())
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @id cpp/summary/lines-of-code
|
||||
* @name Total lines of code
|
||||
* @description The total number of lines of code across all source files.
|
||||
* @name Total lines of C/C++ code
|
||||
* @description The total number of lines of C/C++ code across all files, including system headers and libraries.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
select sum(File f | f.fromSource() | f.getMetrics().getNumberOfLinesOfCode())
|
||||
select sum(File f | f.fromSource() | f.getMetrics().getNumberOfLines())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @id cpp/summary/lines-of-code-per-file
|
||||
* @name Lines of code per source file
|
||||
* @description The number of lines of code for each source file.
|
||||
* @name Lines of C/C++ code per source file
|
||||
* @description The number of lines of C/C++ code for each file in the database, including system headers and libraries.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
@@ -10,4 +10,4 @@ import cpp
|
||||
|
||||
from File f
|
||||
where f.fromSource()
|
||||
select f, f.getMetrics().getNumberOfLinesOfCode()
|
||||
select f, f.getMetrics().getNumberOfLines()
|
||||
|
||||
11
cpp/ql/src/Summary/LinesOfUserCode.ql
Normal file
11
cpp/ql/src/Summary/LinesOfUserCode.ql
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @id cpp/summary/lines-of-user-code
|
||||
* @name Total lines of C/C++ source code
|
||||
* @description The total number of lines of C/C++ code across all files, excluding system headers and libraries.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
select sum(File f | exists(f.getRelativePath()) | f.getMetrics().getNumberOfLines())
|
||||
13
cpp/ql/src/Summary/LinesOfUserCodePerFile.ql
Normal file
13
cpp/ql/src/Summary/LinesOfUserCodePerFile.ql
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @id cpp/summary/lines-of-user-code-per-file
|
||||
* @name Lines of C/C++ code per source file
|
||||
* @description The number of lines of C/C++ code for each file in the source directory.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
from File f
|
||||
where exists(f.getRelativePath())
|
||||
select f, f.getMetrics().getNumberOfLines()
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* @id cpp/summary/lines-per-file
|
||||
* @name Lines of text per source file
|
||||
* @description The number of lines of text for each source file.
|
||||
* @kind metric
|
||||
* @tags summary
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
from File f
|
||||
where f.fromSource()
|
||||
select f, f.getMetrics().getNumberOfLines()
|
||||
@@ -1 +0,0 @@
|
||||
| 3 |
|
||||
@@ -1 +0,0 @@
|
||||
Summary/Files.ql
|
||||
@@ -1 +0,0 @@
|
||||
Summary/Lines.ql
|
||||
@@ -1 +1 @@
|
||||
| 93 |
|
||||
| 122 |
|
||||
|
||||
@@ -1 +1 @@
|
||||
Summary/LinesOfCode.ql
|
||||
Summary/LinesOfCode.ql
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
| empty-file.cpp:0:0:0:0 | empty-file.cpp | 0 |
|
||||
| large-file.cpp:0:0:0:0 | large-file.cpp | 90 |
|
||||
| large-file.cpp:0:0:0:0 | large-file.cpp | 119 |
|
||||
| short-file.cpp:0:0:0:0 | short-file.cpp | 3 |
|
||||
|
||||
@@ -1 +1 @@
|
||||
Summary/LinesOfCodePerFile.ql
|
||||
Summary/LinesOfCodePerFile.ql
|
||||
|
||||
1
cpp/ql/test/query-tests/Summary/LinesOfUserCode.qlref
Normal file
1
cpp/ql/test/query-tests/Summary/LinesOfUserCode.qlref
Normal file
@@ -0,0 +1 @@
|
||||
Summary/LinesOfUserCode.ql
|
||||
@@ -0,0 +1 @@
|
||||
Summary/LinesOfUserCodePerFile.ql
|
||||
@@ -1 +0,0 @@
|
||||
Summary/LinesPerFile.ql
|
||||
Reference in New Issue
Block a user