@abaplint/core 2.102.63 → 2.102.65
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.
|
@@ -295,9 +295,10 @@ class TypeUtils {
|
|
|
295
295
|
}
|
|
296
296
|
return true;
|
|
297
297
|
}
|
|
298
|
-
else if (target instanceof basic_1.
|
|
299
|
-
return
|
|
298
|
+
else if (target instanceof basic_1.VoidType || target instanceof basic_1.AnyType) {
|
|
299
|
+
return true;
|
|
300
300
|
}
|
|
301
|
+
return false;
|
|
301
302
|
}
|
|
302
303
|
else if (source instanceof basic_1.Integer8Type) {
|
|
303
304
|
if (target instanceof basic_1.IntegerType || target instanceof basic_1.StringType) {
|
package/build/src/registry.js
CHANGED
|
@@ -20,6 +20,7 @@ class SlowParameterPassing {
|
|
|
20
20
|
key: "slow_parameter_passing",
|
|
21
21
|
title: "Slow Parameter Passing",
|
|
22
22
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
23
|
+
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
23
24
|
tags: [_irule_1.RuleTag.Performance],
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -42,17 +43,22 @@ class SlowParameterPassing {
|
|
|
42
43
|
const methods = this.listMethodNodes(top);
|
|
43
44
|
for (const m of methods) {
|
|
44
45
|
const vars = m.getData().vars;
|
|
46
|
+
if (m.getIdentifier().sname.includes("~")) {
|
|
47
|
+
// skip methods defined in interfaces
|
|
48
|
+
// todo: checking for just "~" is not correct, there might be ALIASES
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
45
51
|
for (const v in vars) {
|
|
46
52
|
const id = vars[v];
|
|
47
53
|
if (id.getMeta().includes("pass_by_value" /* IdentifierMeta.PassByValue */) === false) {
|
|
48
54
|
continue;
|
|
49
55
|
}
|
|
56
|
+
else if (this.reg.isFileDependency(id.getFilename()) === true) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
50
59
|
const writes = this.listWritePositions(m, id);
|
|
51
60
|
if (writes.length === 0) {
|
|
52
61
|
const message = "Parameter " + id.getName() + " passed by VALUE but not changed";
|
|
53
|
-
if (this.reg.isFileDependency(id.getFilename()) === true) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
62
|
issues.push(issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.getConfig().severity));
|
|
57
63
|
}
|
|
58
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.65",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.38.0",
|
|
54
54
|
"@types/chai": "^4.3.9",
|
|
55
55
|
"@types/mocha": "^10.0.3",
|
|
56
|
-
"@types/node": "^20.8.
|
|
56
|
+
"@types/node": "^20.8.9",
|
|
57
57
|
"chai": "^4.3.10",
|
|
58
58
|
"eslint": "^8.52.0",
|
|
59
59
|
"mocha": "^10.2.0",
|