@abaplint/cli 2.113.11 → 2.113.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +26 -6
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -52746,7 +52746,7 @@ class Registry {
|
|
|
52746
52746
|
}
|
|
52747
52747
|
static abaplintVersion() {
|
|
52748
52748
|
// magic, see build script "version.sh"
|
|
52749
|
-
return "2.113.
|
|
52749
|
+
return "2.113.13";
|
|
52750
52750
|
}
|
|
52751
52751
|
getDDICReferences() {
|
|
52752
52752
|
return this.ddicReferences;
|
|
@@ -73986,6 +73986,7 @@ class UnusedMethods {
|
|
|
73986
73986
|
extendedInformation: `Checks private and protected methods.
|
|
73987
73987
|
|
|
73988
73988
|
Unused methods are not reported if the object contains parser or syntax errors.
|
|
73989
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
73989
73990
|
|
|
73990
73991
|
Skips:
|
|
73991
73992
|
* methods FOR TESTING
|
|
@@ -74077,18 +74078,37 @@ Skips:
|
|
|
74077
74078
|
else if (this.suppressedbyPseudo(statement, file)) {
|
|
74078
74079
|
continue;
|
|
74079
74080
|
}
|
|
74080
|
-
const implementation = this.findMethodImplementation(i, file);
|
|
74081
74081
|
let fix = undefined;
|
|
74082
|
-
if (
|
|
74083
|
-
|
|
74084
|
-
const
|
|
74085
|
-
|
|
74082
|
+
if (i.visibility === visibility_1.Visibility.Private
|
|
74083
|
+
|| (i.visibility === visibility_1.Visibility.Protected && this.hasSubClass(obj) === false)) {
|
|
74084
|
+
const implementation = this.findMethodImplementation(i, file);
|
|
74085
|
+
if (implementation !== undefined) {
|
|
74086
|
+
const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);
|
|
74087
|
+
const fix2 = edit_helper_1.EditHelper.deleteRange(file, implementation.getFirstToken().getStart(), implementation.getLastToken().getEnd());
|
|
74088
|
+
fix = edit_helper_1.EditHelper.merge(fix1, fix2);
|
|
74089
|
+
}
|
|
74086
74090
|
}
|
|
74087
74091
|
const message = "Method \"" + i.identifier.getName() + "\" not used";
|
|
74088
74092
|
issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity, fix));
|
|
74089
74093
|
}
|
|
74090
74094
|
return issues;
|
|
74091
74095
|
}
|
|
74096
|
+
hasSubClass(obj) {
|
|
74097
|
+
var _a, _b, _c;
|
|
74098
|
+
if (!(obj instanceof objects_1.Class)) {
|
|
74099
|
+
return false;
|
|
74100
|
+
}
|
|
74101
|
+
if (((_a = obj.getDefinition()) === null || _a === void 0 ? void 0 : _a.isFinal()) === true) {
|
|
74102
|
+
return false;
|
|
74103
|
+
}
|
|
74104
|
+
for (const r of this.reg.getObjects()) {
|
|
74105
|
+
if (r instanceof objects_1.Class
|
|
74106
|
+
&& ((_c = (_b = r.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass()) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === obj.getName().toUpperCase()) {
|
|
74107
|
+
return true;
|
|
74108
|
+
}
|
|
74109
|
+
}
|
|
74110
|
+
return false;
|
|
74111
|
+
}
|
|
74092
74112
|
findMethodImplementation(method, file) {
|
|
74093
74113
|
var _a, _b;
|
|
74094
74114
|
for (const classImplementation of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStructures(Structures.ClassImplementation)) || []) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.13",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.113.
|
|
41
|
+
"@abaplint/core": "^2.113.13",
|
|
42
42
|
"@types/chai": "^4.3.19",
|
|
43
43
|
"@types/glob": "^8.1.0",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|