@abaplint/core 2.93.13 → 2.93.14
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/src/registry.js
CHANGED
|
@@ -30,7 +30,9 @@ class CyclicOO {
|
|
|
30
30
|
key: "cyclic_oo",
|
|
31
31
|
title: "Cyclic OO",
|
|
32
32
|
shortDescription: `Finds cyclic OO references`,
|
|
33
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
33
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
34
|
+
|
|
35
|
+
Objects must be without syntax errors for this rule to take effect`,
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
getConfig() {
|
|
@@ -47,6 +49,9 @@ class CyclicOO {
|
|
|
47
49
|
this.reg = reg;
|
|
48
50
|
this.edges = {};
|
|
49
51
|
for (const obj of this.reg.getObjectsByType("CLAS")) {
|
|
52
|
+
if (this.reg.isDependency(obj)) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
50
55
|
const name = obj.getName().toUpperCase();
|
|
51
56
|
if (!(obj instanceof objects_1.Class)) {
|
|
52
57
|
continue;
|
|
@@ -57,9 +62,16 @@ class CyclicOO {
|
|
|
57
62
|
else if (this.conf.skipSharedMemory === true && ((_a = obj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.isSharedMemory) === true) {
|
|
58
63
|
continue;
|
|
59
64
|
}
|
|
60
|
-
|
|
65
|
+
const run = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
66
|
+
if (run.issues.length > 0) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
this.buildEdges(name, run.spaghetti.getTop());
|
|
61
70
|
}
|
|
62
71
|
for (const obj of this.reg.getObjectsByType("INTF")) {
|
|
72
|
+
if (this.reg.isDependency(obj)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
63
75
|
const name = obj.getName().toUpperCase();
|
|
64
76
|
if (!(obj instanceof _abap_object_1.ABAPObject)) {
|
|
65
77
|
continue;
|
|
@@ -67,7 +79,11 @@ class CyclicOO {
|
|
|
67
79
|
else if (this.conf.skip.indexOf(name) >= 0) {
|
|
68
80
|
continue;
|
|
69
81
|
}
|
|
70
|
-
|
|
82
|
+
const run = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
83
|
+
if (run.issues.length > 0) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
this.buildEdges(name, run.spaghetti.getTop());
|
|
71
87
|
}
|
|
72
88
|
return this;
|
|
73
89
|
}
|
|
@@ -79,7 +95,9 @@ class CyclicOO {
|
|
|
79
95
|
if (id === undefined) {
|
|
80
96
|
return [];
|
|
81
97
|
}
|
|
82
|
-
const
|
|
98
|
+
const previous = {};
|
|
99
|
+
previous[obj.getName()] = true;
|
|
100
|
+
const path = this.findCycle(obj.getName(), obj.getName(), previous);
|
|
83
101
|
if (path) {
|
|
84
102
|
const message = "Cyclic definition/usage: " + path;
|
|
85
103
|
return [issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.conf.severity)];
|
|
@@ -93,10 +111,11 @@ class CyclicOO {
|
|
|
93
111
|
}
|
|
94
112
|
for (const e of this.edges[current]) {
|
|
95
113
|
if (e === source) {
|
|
96
|
-
return previous.join(" -> ") + " -> " + source;
|
|
114
|
+
return Object.keys(previous).join(" -> ") + " -> " + source;
|
|
97
115
|
}
|
|
98
|
-
if (previous
|
|
99
|
-
|
|
116
|
+
if (previous[e] === undefined) { // dont revisit vertices
|
|
117
|
+
previous[e] = true;
|
|
118
|
+
const found = this.findCycle(source, e, previous);
|
|
100
119
|
if (found) {
|
|
101
120
|
return found;
|
|
102
121
|
}
|
|
@@ -103,12 +103,17 @@ Consider using ABAP Doc for documentation.`,
|
|
|
103
103
|
if (desc === undefined) {
|
|
104
104
|
return [];
|
|
105
105
|
}
|
|
106
|
+
const reported = {}; // there might be multiple translations
|
|
106
107
|
const ret = [];
|
|
107
108
|
for (const d of (0, xml_utils_1.xmlToArray)(desc.SEOCOMPOTX)) {
|
|
108
109
|
const message = "Remove description for " + d.CMPNAME;
|
|
110
|
+
if (reported[d.CMPNAME] !== undefined) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
109
113
|
const position = new position_1.Position(1, 1);
|
|
110
114
|
const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity);
|
|
111
115
|
ret.push(issue);
|
|
116
|
+
reported[d.CMPNAME] = true;
|
|
112
117
|
}
|
|
113
118
|
return ret;
|
|
114
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.93.
|
|
3
|
+
"version": "2.93.14",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://abaplint.org",
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@microsoft/api-extractor": "^7.
|
|
49
|
+
"@microsoft/api-extractor": "^7.31.0",
|
|
50
50
|
"@types/chai": "^4.3.3",
|
|
51
51
|
"@types/mocha": "^9.1.1",
|
|
52
|
-
"@types/node": "^18.7.
|
|
52
|
+
"@types/node": "^18.7.17",
|
|
53
53
|
"chai": "^4.3.6",
|
|
54
54
|
"eslint": "^8.23.1",
|
|
55
55
|
"mocha": "^10.0.0",
|