C++: Some renaming

This commit is contained in:
Calum Grant
2024-11-12 09:46:50 +00:00
parent 317f43d325
commit 91b1cb8a76
3 changed files with 14 additions and 14 deletions

View File

@@ -130,8 +130,8 @@ module CppMetrics {
override int getValue() { result = count(Call c) }
}
class SucceededCalls extends SuccessMetric {
SucceededCalls() { this = "calls with a target" }
class CallsWithExplicitTarget extends SuccessMetric {
CallsWithExplicitTarget() { this = "calls with an explicit target" }
override int getValue() {
result = count(Call c | not c.getTarget().getADeclarationEntry().isImplicit())
@@ -221,32 +221,32 @@ module CppMetrics {
}
class SucceededIncludeCount extends Metric {
string include_text;
string includeText;
SucceededIncludeCount() {
exists(Include i |
i.getIncludeText() = include_text and
i.getIncludeText() = includeText and
exists(i.getFile().getRelativePath()) // Only report includes from the repo
) and
this = "Successfully included " + include_text
this = "Successfully included " + includeText
}
int getValue() { result = count(Include i | i.getIncludeText() = include_text) }
int getValue() { result = count(Include i | i.getIncludeText() = includeText) }
string getIncludeText() { result = include_text }
string getIncludeText() { result = includeText }
}
class MissingIncludeCount extends Metric {
string include_text;
string includeText;
MissingIncludeCount() {
exists(CannotOpenFileError e | e.getIncludedFile() = include_text) and
this = "Failed to include '" + include_text + "'"
exists(CannotOpenFileError e | e.getIncludedFile() = includeText) and
this = "Failed to include '" + includeText + "'"
}
int getValue() { result = count(CannotOpenFileError e | e.getIncludedFile() = include_text) }
int getValue() { result = count(CannotOpenFileError e | e.getIncludedFile() = includeText) }
string getIncludeText() { result = include_text }
string getIncludeText() { result = includeText }
}
class CompilerErrors extends ExtractionMetric {

View File

@@ -1,4 +1,4 @@
| Percentage of calls with a target | 50.0 |
| Percentage of calls with an explicit target | 50.0 |
| Percentage of compilations without errors | 50.0 |
| Percentage of expressions with a known type | 30.0 |
| Percentage of functions without errors | 75.0 |

View File

@@ -1,6 +1,6 @@
| #include directives | 2 |
| calls | 2 |
| calls with a target | 1 |
| calls with an explicit target | 1 |
| compilations | 2 |
| compilations without errors | 1 |
| compiler errors | 10 |