@abaplint/core 2.83.0 → 2.83.1
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
|
@@ -41,7 +41,7 @@ If the target is a sorted/hashed table, no issue is reported`,
|
|
|
41
41
|
this.conf = conf;
|
|
42
42
|
}
|
|
43
43
|
run(obj) {
|
|
44
|
-
var _a
|
|
44
|
+
var _a;
|
|
45
45
|
const issues = [];
|
|
46
46
|
if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === "INTF") {
|
|
47
47
|
return [];
|
|
@@ -67,21 +67,36 @@ If the target is a sorted/hashed table, no issue is reported`,
|
|
|
67
67
|
else if (s.findFirstExpression(Expressions.SQLOrderBy)) {
|
|
68
68
|
continue;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const start = target.getFirstToken().getStart();
|
|
73
|
-
const scope = spaghetti.lookupPosition(start, file.getFilename());
|
|
74
|
-
const type = (_c = scope === null || scope === void 0 ? void 0 : scope.findWriteReference(start)) === null || _c === void 0 ? void 0 : _c.getType();
|
|
75
|
-
if (type instanceof basic_1.TableType
|
|
76
|
-
&& ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted || (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
70
|
+
if (this.isTargetSortedOrHashed(s, spaghetti, file)) {
|
|
71
|
+
continue;
|
|
79
72
|
}
|
|
80
73
|
issues.push(issue_1.Issue.atStatement(file, s, "Add ORDER BY", this.getMetadata().key, this.conf.severity));
|
|
81
74
|
}
|
|
82
75
|
}
|
|
83
76
|
return issues;
|
|
84
77
|
}
|
|
78
|
+
isTargetSortedOrHashed(s, spaghetti, file) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const target = (_a = s.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.Target);
|
|
81
|
+
if (target) {
|
|
82
|
+
const start = target.getFirstToken().getStart();
|
|
83
|
+
const scope = spaghetti.lookupPosition(start, file.getFilename());
|
|
84
|
+
let type = (_b = scope === null || scope === void 0 ? void 0 : scope.findWriteReference(start)) === null || _b === void 0 ? void 0 : _b.getType();
|
|
85
|
+
const children = target.getChildren();
|
|
86
|
+
if (type instanceof basic_1.StructureType && children.length >= 3 && children[1].concatTokens() === "-") {
|
|
87
|
+
const found = type.getComponentByName(children[2].concatTokens());
|
|
88
|
+
if (found === undefined) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
type = found;
|
|
92
|
+
}
|
|
93
|
+
if (type instanceof basic_1.TableType
|
|
94
|
+
&& ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted || (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
85
100
|
}
|
|
86
101
|
exports.SelectAddOrderBy = SelectAddOrderBy;
|
|
87
102
|
//# sourceMappingURL=select_add_order_by.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.83.
|
|
3
|
+
"version": "2.83.1",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@microsoft/api-extractor": "^7.19.2",
|
|
49
49
|
"@types/chai": "^4.3.0",
|
|
50
50
|
"@types/mocha": "^9.0.0",
|
|
51
|
-
"@types/node": "^
|
|
51
|
+
"@types/node": "^17.0.1",
|
|
52
52
|
"chai": "^4.3.4",
|
|
53
|
-
"eslint": "^8.
|
|
53
|
+
"eslint": "^8.5.0",
|
|
54
54
|
"mocha": "^9.1.3",
|
|
55
55
|
"c8": "^7.10.0",
|
|
56
56
|
"source-map-support": "^0.5.21",
|