C++: Minor edits

This commit is contained in:
Calum Grant
2024-11-01 16:55:48 +00:00
parent f6776a4249
commit a53e1dec20
11 changed files with 14 additions and 29 deletions

View File

@@ -215,7 +215,7 @@ module CppMetrics {
SucceededIncludeCount() {
exists(Include i |
i.getIncludeText() = include_text and
exists(i.getFile().getRelativePath()) // Only report includes from the repo
exists(i.getFile().getRelativePath()) // Only report includes from the repo
) and
this = "Successfully included " + include_text
}

View File

@@ -10,7 +10,7 @@
| functions without errors | 6.0 |
| lines of code | 19.0 |
| lines of code without errors | 12.0 |
| lines of text | 26.0 |
| lines of text | 24.0 |
| non-error expressions | 3.0 |
| source files | 3.0 |
| source files without errors | 2.0 |

View File

@@ -69,11 +69,11 @@ test.cpp:
#-----| ValueCategory = prvalue
# 17| getStmt(2): [ReturnStmt] return ...
test.h:
# 4| [TopLevelFunction] int f(int)
# 4| <params>:
# 4| getParameter(0): [Parameter] (unnamed parameter 0)
# 4| Type = [IntType] int
# 4| [TopLevelFunction] int f(int)
# 4| <params>:
# 4| getParameter(0): [Parameter] (unnamed parameter 0)
# 4| Type = [IntType] int
# 2| [TopLevelFunction] int f(int)
# 2| <params>:
# 2| getParameter(0): [Parameter] (unnamed parameter 0)
# 2| Type = [IntType] int
# 2| [TopLevelFunction] int f(int)
# 2| <params>:
# 2| getParameter(0): [Parameter] (unnamed parameter 0)
# 2| Type = [IntType] int

View File

@@ -1,4 +1,4 @@
import cpp
from Diagnostic d
select d
select d

View File

@@ -1 +0,0 @@
| test.cpp:14:10:14:12 | fn2 |

View File

@@ -1,5 +0,0 @@
import cpp
from Function fn
where fn.getType() instanceof ErroneousType or not exists(fn.getType())
select fn

View File

@@ -1 +0,0 @@
| test.cpp:6:13:6:31 | <error expr> |

View File

@@ -1,6 +0,0 @@
import cpp
from Expr e
where e.getType() instanceof ErroneousType
and e.fromSource()
select e

View File

@@ -2,5 +2,5 @@
| test.c:4:13:4:13 | no_such_function |
| test.cpp:5:6:5:25 | function_with_errors |
| test.cpp:14:10:14:12 | fn2 |
| test.h:4:5:4:5 | f |
| test.h:4:5:4:5 | f |
| test.h:2:5:2:5 | f |
| test.h:2:5:2:5 | f |

View File

@@ -2,4 +2,4 @@ import cpp
from Function fn
where fn.fromSource()
select fn
select fn

View File

@@ -1,4 +1,2 @@
#define ADD(A,B) ((A)+(B))
int f(int);