@abaplint/cli 2.112.17 → 2.112.19
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/README.md +4 -4
- package/abaplint +2 -2
- package/build/cli.js +936 -886
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -5840,6 +5840,7 @@ __exportStar(__webpack_require__(/*! ./kernel_id */ "./node_modules/@abaplint/co
|
|
|
5840
5840
|
__exportStar(__webpack_require__(/*! ./language */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/language.js"), exports);
|
|
5841
5841
|
__exportStar(__webpack_require__(/*! ./length */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/length.js"), exports);
|
|
5842
5842
|
__exportStar(__webpack_require__(/*! ./let */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/let.js"), exports);
|
|
5843
|
+
__exportStar(__webpack_require__(/*! ./lob_handle */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/lob_handle.js"), exports);
|
|
5843
5844
|
__exportStar(__webpack_require__(/*! ./loop_group_by_component */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by_component.js"), exports);
|
|
5844
5845
|
__exportStar(__webpack_require__(/*! ./loop_group_by_target */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by_target.js"), exports);
|
|
5845
5846
|
__exportStar(__webpack_require__(/*! ./loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by.js"), exports);
|
|
@@ -5933,16 +5934,15 @@ __exportStar(__webpack_require__(/*! ./sql_into_table */ "./node_modules/@abapli
|
|
|
5933
5934
|
__exportStar(__webpack_require__(/*! ./sql_join */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_join.js"), exports);
|
|
5934
5935
|
__exportStar(__webpack_require__(/*! ./sql_order_by */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_order_by.js"), exports);
|
|
5935
5936
|
__exportStar(__webpack_require__(/*! ./sql_path */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_path.js"), exports);
|
|
5937
|
+
__exportStar(__webpack_require__(/*! ./sql_source_no_space */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source_no_space.js"), exports);
|
|
5936
5938
|
__exportStar(__webpack_require__(/*! ./sql_source_simple */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source_simple.js"), exports);
|
|
5937
5939
|
__exportStar(__webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source.js"), exports);
|
|
5938
|
-
__exportStar(__webpack_require__(/*! ./sql_source_no_space */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source_no_space.js"), exports);
|
|
5939
5940
|
__exportStar(__webpack_require__(/*! ./sql_target */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_target.js"), exports);
|
|
5940
5941
|
__exportStar(__webpack_require__(/*! ./sql_up_to */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_up_to.js"), exports);
|
|
5941
5942
|
__exportStar(__webpack_require__(/*! ./string_template_formatting */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/string_template_formatting.js"), exports);
|
|
5942
5943
|
__exportStar(__webpack_require__(/*! ./string_template_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/string_template_source.js"), exports);
|
|
5943
5944
|
__exportStar(__webpack_require__(/*! ./string_template */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/string_template.js"), exports);
|
|
5944
5945
|
__exportStar(__webpack_require__(/*! ./super_class_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/super_class_name.js"), exports);
|
|
5945
|
-
__exportStar(__webpack_require__(/*! ./type_structure */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_structure.js"), exports);
|
|
5946
5946
|
__exportStar(__webpack_require__(/*! ./switch_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/switch_body.js"), exports);
|
|
5947
5947
|
__exportStar(__webpack_require__(/*! ./table_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/table_body.js"), exports);
|
|
5948
5948
|
__exportStar(__webpack_require__(/*! ./table_expression */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/table_expression.js"), exports);
|
|
@@ -5958,6 +5958,7 @@ __exportStar(__webpack_require__(/*! ./transporting_fields */ "./node_modules/@a
|
|
|
5958
5958
|
__exportStar(__webpack_require__(/*! ./type_name_or_infer */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_name_or_infer.js"), exports);
|
|
5959
5959
|
__exportStar(__webpack_require__(/*! ./type_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_name.js"), exports);
|
|
5960
5960
|
__exportStar(__webpack_require__(/*! ./type_param */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_param.js"), exports);
|
|
5961
|
+
__exportStar(__webpack_require__(/*! ./type_structure */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_structure.js"), exports);
|
|
5961
5962
|
__exportStar(__webpack_require__(/*! ./type_table_key */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table_key.js"), exports);
|
|
5962
5963
|
__exportStar(__webpack_require__(/*! ./type_table */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table.js"), exports);
|
|
5963
5964
|
__exportStar(__webpack_require__(/*! ./type */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type.js"), exports);
|
|
@@ -6226,6 +6227,28 @@ exports.Let = Let;
|
|
|
6226
6227
|
|
|
6227
6228
|
/***/ }),
|
|
6228
6229
|
|
|
6230
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/lob_handle.js":
|
|
6231
|
+
/*!*******************************************************************************************!*\
|
|
6232
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/lob_handle.js ***!
|
|
6233
|
+
\*******************************************************************************************/
|
|
6234
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6235
|
+
|
|
6236
|
+
"use strict";
|
|
6237
|
+
|
|
6238
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6239
|
+
exports.LOBHandle = void 0;
|
|
6240
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
6241
|
+
const Expressions = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
6242
|
+
class LOBHandle extends combi_1.Expression {
|
|
6243
|
+
getRunnable() {
|
|
6244
|
+
return (0, combi_1.seq)("WRITER FOR COLUMNS", Expressions.Field);
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
exports.LOBHandle = LOBHandle;
|
|
6248
|
+
//# sourceMappingURL=lob_handle.js.map
|
|
6249
|
+
|
|
6250
|
+
/***/ }),
|
|
6251
|
+
|
|
6229
6252
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by.js":
|
|
6230
6253
|
/*!**********************************************************************************************!*\
|
|
6231
6254
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by.js ***!
|
|
@@ -9148,7 +9171,7 @@ class Type extends combi_1.Expression {
|
|
|
9148
9171
|
getRunnable() {
|
|
9149
9172
|
const typeType = (0, combi_1.seq)(_1.TypeName, (0, combi_1.optPrio)(_1.Default));
|
|
9150
9173
|
const like = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", _1.FieldChain), (0, combi_1.seq)("REF TO", _1.FieldChain), _1.FieldChain);
|
|
9151
|
-
const type = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", typeType), (0, combi_1.seq)("REF TO", typeType), typeType);
|
|
9174
|
+
const type = (0, combi_1.altPrio)((0, combi_1.seq)("LINE OF", typeType), (0, combi_1.seq)("REF TO", typeType), (0, combi_1.seq)(typeType, (0, combi_1.optPrio)(_1.LOBHandle)));
|
|
9152
9175
|
const ret = (0, combi_1.altPrio)((0, combi_1.seq)("LIKE", like), (0, combi_1.seq)("TYPE", type));
|
|
9153
9176
|
return ret;
|
|
9154
9177
|
}
|
|
@@ -35009,7 +35032,13 @@ exports.ArtifactsABAP = ArtifactsABAP;
|
|
|
35009
35032
|
"use strict";
|
|
35010
35033
|
|
|
35011
35034
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35012
|
-
exports.FlowGraph = void 0;
|
|
35035
|
+
exports.FlowGraph = exports.FLOW_EDGE_TYPE = void 0;
|
|
35036
|
+
var FLOW_EDGE_TYPE;
|
|
35037
|
+
(function (FLOW_EDGE_TYPE) {
|
|
35038
|
+
FLOW_EDGE_TYPE["true"] = "true";
|
|
35039
|
+
FLOW_EDGE_TYPE["false"] = "false";
|
|
35040
|
+
FLOW_EDGE_TYPE["undefined"] = "undefined";
|
|
35041
|
+
})(FLOW_EDGE_TYPE || (exports.FLOW_EDGE_TYPE = FLOW_EDGE_TYPE = {}));
|
|
35013
35042
|
class FlowGraph {
|
|
35014
35043
|
constructor(counter) {
|
|
35015
35044
|
this.edges = {};
|
|
@@ -35026,11 +35055,11 @@ class FlowGraph {
|
|
|
35026
35055
|
getEnd() {
|
|
35027
35056
|
return this.endNode;
|
|
35028
35057
|
}
|
|
35029
|
-
addEdge(from, to) {
|
|
35058
|
+
addEdge(from, to, type) {
|
|
35030
35059
|
if (this.edges[from] === undefined) {
|
|
35031
35060
|
this.edges[from] = {};
|
|
35032
35061
|
}
|
|
35033
|
-
this.edges[from][to] =
|
|
35062
|
+
this.edges[from][to] = type;
|
|
35034
35063
|
}
|
|
35035
35064
|
removeEdge(from, to) {
|
|
35036
35065
|
if (this.edges[from] === undefined) {
|
|
@@ -35045,7 +35074,7 @@ class FlowGraph {
|
|
|
35045
35074
|
const list = [];
|
|
35046
35075
|
for (const from of Object.keys(this.edges)) {
|
|
35047
35076
|
for (const to of Object.keys(this.edges[from])) {
|
|
35048
|
-
list.push({ from, to });
|
|
35077
|
+
list.push({ from, to, type: this.edges[from][to] });
|
|
35049
35078
|
}
|
|
35050
35079
|
}
|
|
35051
35080
|
return list;
|
|
@@ -35074,12 +35103,12 @@ class FlowGraph {
|
|
|
35074
35103
|
return Object.keys(this.edges).length > 0;
|
|
35075
35104
|
}
|
|
35076
35105
|
/** return value: end node of to graph */
|
|
35077
|
-
addGraph(from, to) {
|
|
35106
|
+
addGraph(from, to, type) {
|
|
35078
35107
|
if (to.hasEdges() === false) {
|
|
35079
35108
|
return from;
|
|
35080
35109
|
}
|
|
35081
|
-
this.addEdge(from, to.getStart());
|
|
35082
|
-
to.listEdges().forEach(e => this.addEdge(e.from, e.to));
|
|
35110
|
+
this.addEdge(from, to.getStart(), type);
|
|
35111
|
+
to.listEdges().forEach(e => this.addEdge(e.from, e.to, e.type));
|
|
35083
35112
|
return to.getEnd();
|
|
35084
35113
|
}
|
|
35085
35114
|
toJSON() {
|
|
@@ -35088,7 +35117,8 @@ class FlowGraph {
|
|
|
35088
35117
|
toTextEdges() {
|
|
35089
35118
|
let graph = "";
|
|
35090
35119
|
for (const l of this.listEdges()) {
|
|
35091
|
-
|
|
35120
|
+
const label = l.type === FLOW_EDGE_TYPE.undefined ? "" : ` [label="${l.type}"]`;
|
|
35121
|
+
graph += `"${l.from}" -> "${l.to}"${label};\n`;
|
|
35092
35122
|
}
|
|
35093
35123
|
return graph.trim();
|
|
35094
35124
|
}
|
|
@@ -35096,32 +35126,32 @@ class FlowGraph {
|
|
|
35096
35126
|
this.label = label;
|
|
35097
35127
|
}
|
|
35098
35128
|
toDigraph() {
|
|
35099
|
-
return `digraph G {
|
|
35100
|
-
labelloc="t";
|
|
35101
|
-
label="${this.label}";
|
|
35102
|
-
graph [fontname = "helvetica"];
|
|
35103
|
-
node [fontname = "helvetica", shape="box"];
|
|
35104
|
-
edge [fontname = "helvetica"];
|
|
35105
|
-
${this.toTextEdges()}
|
|
35129
|
+
return `digraph G {
|
|
35130
|
+
labelloc="t";
|
|
35131
|
+
label="${this.label}";
|
|
35132
|
+
graph [fontname = "helvetica"];
|
|
35133
|
+
node [fontname = "helvetica", shape="box"];
|
|
35134
|
+
edge [fontname = "helvetica"];
|
|
35135
|
+
${this.toTextEdges()}
|
|
35106
35136
|
}`;
|
|
35107
35137
|
}
|
|
35108
35138
|
listSources(node) {
|
|
35109
|
-
const set =
|
|
35139
|
+
const set = [];
|
|
35110
35140
|
for (const l of this.listEdges()) {
|
|
35111
35141
|
if (node === l.to) {
|
|
35112
|
-
set.
|
|
35142
|
+
set.push({ name: l.from, type: l.type });
|
|
35113
35143
|
}
|
|
35114
35144
|
}
|
|
35115
|
-
return
|
|
35145
|
+
return set;
|
|
35116
35146
|
}
|
|
35117
35147
|
listTargets(node) {
|
|
35118
|
-
const set =
|
|
35148
|
+
const set = [];
|
|
35119
35149
|
for (const l of this.listEdges()) {
|
|
35120
35150
|
if (node === l.from) {
|
|
35121
|
-
set.
|
|
35151
|
+
set.push({ name: l.to, type: l.type });
|
|
35122
35152
|
}
|
|
35123
35153
|
}
|
|
35124
|
-
return
|
|
35154
|
+
return set;
|
|
35125
35155
|
}
|
|
35126
35156
|
/** removes all nodes containing "#" that have one in-going and one out-going edge */
|
|
35127
35157
|
reduce() {
|
|
@@ -35134,20 +35164,30 @@ ${this.toTextEdges()}
|
|
|
35134
35164
|
if (sources.length > 0 && targets.length > 0) {
|
|
35135
35165
|
// hash node in the middle of the graph
|
|
35136
35166
|
for (const s of sources) {
|
|
35137
|
-
this.removeEdge(s, node);
|
|
35167
|
+
this.removeEdge(s.name, node);
|
|
35138
35168
|
}
|
|
35139
35169
|
for (const t of targets) {
|
|
35140
|
-
this.removeEdge(node, t);
|
|
35170
|
+
this.removeEdge(node, t.name);
|
|
35141
35171
|
}
|
|
35142
35172
|
for (const s of sources) {
|
|
35143
35173
|
for (const t of targets) {
|
|
35144
|
-
|
|
35174
|
+
let type = FLOW_EDGE_TYPE.undefined;
|
|
35175
|
+
if (s.type !== FLOW_EDGE_TYPE.undefined) {
|
|
35176
|
+
type = s.type;
|
|
35177
|
+
}
|
|
35178
|
+
if (t.type !== FLOW_EDGE_TYPE.undefined) {
|
|
35179
|
+
if (type !== FLOW_EDGE_TYPE.undefined) {
|
|
35180
|
+
throw new Error("reduce: cannot merge, different edge types");
|
|
35181
|
+
}
|
|
35182
|
+
type = t.type;
|
|
35183
|
+
}
|
|
35184
|
+
this.addEdge(s.name, t.name, type);
|
|
35145
35185
|
}
|
|
35146
35186
|
}
|
|
35147
35187
|
}
|
|
35148
35188
|
if (node.startsWith("end#") && sources.length === 0) {
|
|
35149
35189
|
for (const t of targets) {
|
|
35150
|
-
this.removeEdge(node, t);
|
|
35190
|
+
this.removeEdge(node, t.name);
|
|
35151
35191
|
}
|
|
35152
35192
|
}
|
|
35153
35193
|
}
|
|
@@ -35179,31 +35219,40 @@ class StatementFlow {
|
|
|
35179
35219
|
this.counter = 0;
|
|
35180
35220
|
}
|
|
35181
35221
|
build(stru) {
|
|
35182
|
-
var _a, _b, _c;
|
|
35222
|
+
var _a, _b, _c, _d;
|
|
35183
35223
|
const ret = [];
|
|
35184
|
-
const structures = stru.findAllStructuresMulti([Structures.Form, Structures.
|
|
35224
|
+
const structures = stru.findAllStructuresMulti([Structures.Form, Structures.ClassImplementation, Structures.FunctionModule]);
|
|
35185
35225
|
for (const s of structures) {
|
|
35186
35226
|
let name = "";
|
|
35187
35227
|
if (s.get() instanceof Structures.Form) {
|
|
35188
35228
|
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
35229
|
+
ret.push(this.run(s, name));
|
|
35189
35230
|
}
|
|
35190
|
-
else if (s.get() instanceof Structures.
|
|
35191
|
-
|
|
35231
|
+
else if (s.get() instanceof Structures.ClassImplementation) {
|
|
35232
|
+
const className = (_b = s.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
35233
|
+
for (const method of s.findDirectStructures(Structures.Method)) {
|
|
35234
|
+
const methodName = (_c = method.findFirstExpression(Expressions.MethodName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
35235
|
+
name = "METHOD " + methodName + ", CLASS " + className;
|
|
35236
|
+
ret.push(this.run(method, name));
|
|
35237
|
+
}
|
|
35192
35238
|
}
|
|
35193
35239
|
else if (s.get() instanceof Structures.FunctionModule) {
|
|
35194
|
-
name = "FUNCTION " + ((
|
|
35240
|
+
name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
|
|
35241
|
+
ret.push(this.run(s, name));
|
|
35195
35242
|
}
|
|
35196
35243
|
else {
|
|
35197
35244
|
throw new Error("StatementFlow, unknown structure");
|
|
35198
35245
|
}
|
|
35199
|
-
this.counter = 1;
|
|
35200
|
-
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
35201
|
-
graph.setLabel(name);
|
|
35202
|
-
ret.push(graph);
|
|
35203
35246
|
}
|
|
35204
35247
|
return ret.map(f => f.reduce());
|
|
35205
35248
|
}
|
|
35206
35249
|
////////////////////
|
|
35250
|
+
run(s, name) {
|
|
35251
|
+
this.counter = 1;
|
|
35252
|
+
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
35253
|
+
graph.setLabel(name);
|
|
35254
|
+
return graph;
|
|
35255
|
+
}
|
|
35207
35256
|
findBody(f) {
|
|
35208
35257
|
var _a;
|
|
35209
35258
|
return ((_a = f.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.getChildren()) || [];
|
|
@@ -35232,7 +35281,7 @@ class StatementFlow {
|
|
|
35232
35281
|
traverseBody(children, context) {
|
|
35233
35282
|
const graph = new flow_graph_1.FlowGraph(this.counter++);
|
|
35234
35283
|
if (children.length === 0) {
|
|
35235
|
-
graph.addEdge(graph.getStart(), graph.getEnd());
|
|
35284
|
+
graph.addEdge(graph.getStart(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35236
35285
|
return graph;
|
|
35237
35286
|
}
|
|
35238
35287
|
let current = graph.getStart();
|
|
@@ -35241,44 +35290,44 @@ class StatementFlow {
|
|
|
35241
35290
|
const firstChild = c.getFirstChild(); // "Normal" only has one child
|
|
35242
35291
|
if (firstChild instanceof nodes_1.StatementNode) {
|
|
35243
35292
|
const name = this.buildName(firstChild);
|
|
35244
|
-
graph.addEdge(current, name);
|
|
35293
|
+
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35245
35294
|
current = name;
|
|
35246
35295
|
if (firstChild.get() instanceof Statements.Check) {
|
|
35247
35296
|
if (context.loopStart) {
|
|
35248
|
-
graph.addEdge(name, context.loopStart);
|
|
35297
|
+
graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35249
35298
|
}
|
|
35250
35299
|
else {
|
|
35251
|
-
graph.addEdge(name, context.procedureEnd);
|
|
35300
|
+
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35252
35301
|
}
|
|
35253
35302
|
}
|
|
35254
35303
|
else if (firstChild.get() instanceof Statements.Assert) {
|
|
35255
|
-
graph.addEdge(name, context.procedureEnd);
|
|
35304
|
+
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35256
35305
|
}
|
|
35257
35306
|
else if (firstChild.get() instanceof Statements.Continue && context.loopStart) {
|
|
35258
|
-
graph.addEdge(name, context.loopStart);
|
|
35307
|
+
graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35259
35308
|
return graph;
|
|
35260
35309
|
}
|
|
35261
35310
|
else if (firstChild.get() instanceof Statements.Exit) {
|
|
35262
35311
|
if (context.loopEnd) {
|
|
35263
|
-
graph.addEdge(name, context.loopEnd);
|
|
35312
|
+
graph.addEdge(name, context.loopEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35264
35313
|
}
|
|
35265
35314
|
else {
|
|
35266
|
-
graph.addEdge(name, context.procedureEnd);
|
|
35315
|
+
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35267
35316
|
}
|
|
35268
35317
|
return graph;
|
|
35269
35318
|
}
|
|
35270
35319
|
else if (firstChild.get() instanceof Statements.Return) {
|
|
35271
|
-
graph.addEdge(name, context.procedureEnd);
|
|
35320
|
+
graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35272
35321
|
return graph;
|
|
35273
35322
|
}
|
|
35274
35323
|
}
|
|
35275
35324
|
else if (firstChild instanceof nodes_1.StructureNode) {
|
|
35276
35325
|
const sub = this.traverseStructure(firstChild, context);
|
|
35277
|
-
current = graph.addGraph(current, sub);
|
|
35326
|
+
current = graph.addGraph(current, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35278
35327
|
}
|
|
35279
35328
|
}
|
|
35280
35329
|
}
|
|
35281
|
-
graph.addEdge(current, graph.getEnd());
|
|
35330
|
+
graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35282
35331
|
return graph;
|
|
35283
35332
|
}
|
|
35284
35333
|
traverseStructure(n, context) {
|
|
@@ -35291,9 +35340,9 @@ class StatementFlow {
|
|
|
35291
35340
|
if (type instanceof Structures.If) {
|
|
35292
35341
|
const ifName = this.buildName(n.findDirectStatement(Statements.If));
|
|
35293
35342
|
const sub = this.traverseBody(this.findBody(n), context);
|
|
35294
|
-
graph.addEdge(current, ifName);
|
|
35295
|
-
graph.addGraph(ifName, sub);
|
|
35296
|
-
graph.addEdge(sub.getEnd(), graph.getEnd());
|
|
35343
|
+
graph.addEdge(current, ifName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35344
|
+
graph.addGraph(ifName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
35345
|
+
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35297
35346
|
current = ifName;
|
|
35298
35347
|
for (const e of n.findDirectStructures(Structures.ElseIf)) {
|
|
35299
35348
|
const elseifst = e.findDirectStatement(Statements.ElseIf);
|
|
@@ -35302,9 +35351,9 @@ class StatementFlow {
|
|
|
35302
35351
|
}
|
|
35303
35352
|
const elseIfName = this.buildName(elseifst);
|
|
35304
35353
|
const sub = this.traverseBody(this.findBody(e), context);
|
|
35305
|
-
graph.addEdge(current, elseIfName);
|
|
35306
|
-
graph.addGraph(elseIfName, sub);
|
|
35307
|
-
graph.addEdge(sub.getEnd(), graph.getEnd());
|
|
35354
|
+
graph.addEdge(current, elseIfName, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35355
|
+
graph.addGraph(elseIfName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
35356
|
+
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35308
35357
|
current = elseIfName;
|
|
35309
35358
|
}
|
|
35310
35359
|
const els = n.findDirectStructure(Structures.Else);
|
|
@@ -35312,12 +35361,12 @@ class StatementFlow {
|
|
|
35312
35361
|
if (els && elsest) {
|
|
35313
35362
|
const elseName = this.buildName(elsest);
|
|
35314
35363
|
const sub = this.traverseBody(this.findBody(els), context);
|
|
35315
|
-
graph.addEdge(current, elseName);
|
|
35316
|
-
graph.addGraph(elseName, sub);
|
|
35317
|
-
graph.addEdge(sub.getEnd(), graph.getEnd());
|
|
35364
|
+
graph.addEdge(current, elseName, flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35365
|
+
graph.addGraph(elseName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35366
|
+
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35318
35367
|
}
|
|
35319
35368
|
else {
|
|
35320
|
-
graph.addEdge(ifName, graph.getEnd());
|
|
35369
|
+
graph.addEdge(ifName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35321
35370
|
}
|
|
35322
35371
|
}
|
|
35323
35372
|
else if (type instanceof Structures.Loop
|
|
@@ -35329,18 +35378,18 @@ class StatementFlow {
|
|
|
35329
35378
|
|| type instanceof Structures.Do) {
|
|
35330
35379
|
const loopName = this.buildName(n.getFirstStatement());
|
|
35331
35380
|
const sub = this.traverseBody(this.findBody(n), Object.assign(Object.assign({}, context), { loopStart: loopName, loopEnd: graph.getEnd() }));
|
|
35332
|
-
graph.addEdge(current, loopName);
|
|
35333
|
-
graph.addGraph(loopName, sub);
|
|
35334
|
-
graph.addEdge(sub.getEnd(), loopName);
|
|
35335
|
-
graph.addEdge(loopName, graph.getEnd());
|
|
35381
|
+
graph.addEdge(current, loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35382
|
+
graph.addGraph(loopName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
|
|
35383
|
+
graph.addEdge(sub.getEnd(), loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35384
|
+
graph.addEdge(loopName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
35336
35385
|
}
|
|
35337
35386
|
else if (type instanceof Structures.Data
|
|
35338
35387
|
|| type instanceof Structures.Types) {
|
|
35339
35388
|
// these doesnt affect control flow, so just take the first statement
|
|
35340
35389
|
const statement = n.getFirstStatement();
|
|
35341
35390
|
const name = this.buildName(statement);
|
|
35342
|
-
graph.addEdge(current, name);
|
|
35343
|
-
graph.addEdge(name, graph.getEnd());
|
|
35391
|
+
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35392
|
+
graph.addEdge(name, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35344
35393
|
}
|
|
35345
35394
|
else if (type instanceof Structures.AtFirst
|
|
35346
35395
|
|| type instanceof Structures.AtLast
|
|
@@ -35348,30 +35397,30 @@ class StatementFlow {
|
|
|
35348
35397
|
|| type instanceof Structures.OnChange) {
|
|
35349
35398
|
const name = this.buildName(n.getFirstStatement());
|
|
35350
35399
|
const body = this.traverseBody(this.findBody(n), context);
|
|
35351
|
-
graph.addEdge(current, name);
|
|
35352
|
-
graph.addGraph(name, body);
|
|
35353
|
-
graph.addEdge(body.getEnd(), graph.getEnd());
|
|
35354
|
-
graph.addEdge(current, graph.getEnd());
|
|
35400
|
+
graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35401
|
+
graph.addGraph(name, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35402
|
+
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35403
|
+
graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35355
35404
|
}
|
|
35356
35405
|
else if (type instanceof Structures.Try) {
|
|
35357
35406
|
const tryName = this.buildName(n.getFirstStatement());
|
|
35358
35407
|
const body = this.traverseBody(this.findBody(n), context);
|
|
35359
|
-
graph.addEdge(current, tryName);
|
|
35360
|
-
graph.addGraph(tryName, body);
|
|
35361
|
-
graph.addEdge(body.getEnd(), graph.getEnd());
|
|
35408
|
+
graph.addEdge(current, tryName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35409
|
+
graph.addGraph(tryName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35410
|
+
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35362
35411
|
for (const c of n.findDirectStructures(Structures.Catch)) {
|
|
35363
35412
|
const catchName = this.buildName(c.getFirstStatement());
|
|
35364
35413
|
const catchBody = this.traverseBody(this.findBody(c), context);
|
|
35365
35414
|
// TODO: this does not take exceptions into account
|
|
35366
|
-
graph.addEdge(body.getEnd(), catchName);
|
|
35367
|
-
graph.addGraph(catchName, catchBody);
|
|
35368
|
-
graph.addEdge(catchBody.getEnd(), graph.getEnd());
|
|
35415
|
+
graph.addEdge(body.getEnd(), catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35416
|
+
graph.addGraph(catchName, catchBody, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35417
|
+
graph.addEdge(catchBody.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35369
35418
|
}
|
|
35370
35419
|
// TODO, handle CLEANUP
|
|
35371
35420
|
}
|
|
35372
35421
|
else if (type instanceof Structures.Case) {
|
|
35373
35422
|
const caseName = this.buildName(n.getFirstStatement());
|
|
35374
|
-
graph.addEdge(current, caseName);
|
|
35423
|
+
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35375
35424
|
let othersFound = false;
|
|
35376
35425
|
for (const w of n.findDirectStructures(Structures.When)) {
|
|
35377
35426
|
const first = w.getFirstStatement();
|
|
@@ -35383,17 +35432,17 @@ class StatementFlow {
|
|
|
35383
35432
|
}
|
|
35384
35433
|
const firstName = this.buildName(first);
|
|
35385
35434
|
const sub = this.traverseBody(this.findBody(w), context);
|
|
35386
|
-
graph.addEdge(caseName, firstName);
|
|
35387
|
-
graph.addGraph(firstName, sub);
|
|
35388
|
-
graph.addEdge(sub.getEnd(), graph.getEnd());
|
|
35435
|
+
graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35436
|
+
graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35437
|
+
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35389
35438
|
}
|
|
35390
35439
|
if (othersFound === false) {
|
|
35391
|
-
graph.addEdge(caseName, graph.getEnd());
|
|
35440
|
+
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35392
35441
|
}
|
|
35393
35442
|
}
|
|
35394
35443
|
else if (type instanceof Structures.CaseType) {
|
|
35395
35444
|
const caseName = this.buildName(n.getFirstStatement());
|
|
35396
|
-
graph.addEdge(current, caseName);
|
|
35445
|
+
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35397
35446
|
let othersFound = false;
|
|
35398
35447
|
for (const w of n.findDirectStructures(Structures.WhenType)) {
|
|
35399
35448
|
const first = w.getFirstStatement();
|
|
@@ -35405,12 +35454,12 @@ class StatementFlow {
|
|
|
35405
35454
|
}
|
|
35406
35455
|
const firstName = this.buildName(first);
|
|
35407
35456
|
const sub = this.traverseBody(this.findBody(w), context);
|
|
35408
|
-
graph.addEdge(caseName, firstName);
|
|
35409
|
-
graph.addGraph(firstName, sub);
|
|
35410
|
-
graph.addEdge(sub.getEnd(), graph.getEnd());
|
|
35457
|
+
graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35458
|
+
graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35459
|
+
graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35411
35460
|
}
|
|
35412
35461
|
if (othersFound === false) {
|
|
35413
|
-
graph.addEdge(caseName, graph.getEnd());
|
|
35462
|
+
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35414
35463
|
}
|
|
35415
35464
|
}
|
|
35416
35465
|
else {
|
|
@@ -41997,8 +42046,8 @@ exports.MemoryFile = MemoryFile;
|
|
|
41997
42046
|
"use strict";
|
|
41998
42047
|
|
|
41999
42048
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
42000
|
-
exports.
|
|
42001
|
-
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = void 0;
|
|
42049
|
+
exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.FLOW_EDGE_TYPE = exports.FlowGraph = exports.StatementFlow = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
|
|
42050
|
+
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = void 0;
|
|
42002
42051
|
const issue_1 = __webpack_require__(/*! ./issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
42003
42052
|
Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
|
|
42004
42053
|
const config_1 = __webpack_require__(/*! ./config */ "./node_modules/@abaplint/core/build/src/config.js");
|
|
@@ -42110,6 +42159,7 @@ const statement_flow_1 = __webpack_require__(/*! ./abap/flow/statement_flow */ "
|
|
|
42110
42159
|
Object.defineProperty(exports, "StatementFlow", ({ enumerable: true, get: function () { return statement_flow_1.StatementFlow; } }));
|
|
42111
42160
|
const flow_graph_1 = __webpack_require__(/*! ./abap/flow/flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
42112
42161
|
Object.defineProperty(exports, "FlowGraph", ({ enumerable: true, get: function () { return flow_graph_1.FlowGraph; } }));
|
|
42162
|
+
Object.defineProperty(exports, "FLOW_EDGE_TYPE", ({ enumerable: true, get: function () { return flow_graph_1.FLOW_EDGE_TYPE; } }));
|
|
42113
42163
|
//# sourceMappingURL=index.js.map
|
|
42114
42164
|
|
|
42115
42165
|
/***/ }),
|
|
@@ -43237,13 +43287,13 @@ class Help {
|
|
|
43237
43287
|
/////////////////////////////////////////////////
|
|
43238
43288
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43239
43289
|
let content = "";
|
|
43240
|
-
content = `
|
|
43241
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43242
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43243
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43244
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43245
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43246
|
-
<hr>
|
|
43290
|
+
content = `
|
|
43291
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43292
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43293
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43294
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43295
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43296
|
+
<hr>
|
|
43247
43297
|
` +
|
|
43248
43298
|
"<tt>" + textDocument.uri + " (" +
|
|
43249
43299
|
(position.line + 1) + ", " +
|
|
@@ -52513,7 +52563,7 @@ class Registry {
|
|
|
52513
52563
|
}
|
|
52514
52564
|
static abaplintVersion() {
|
|
52515
52565
|
// magic, see build script "version.sh"
|
|
52516
|
-
return "2.112.
|
|
52566
|
+
return "2.112.19";
|
|
52517
52567
|
}
|
|
52518
52568
|
getDDICReferences() {
|
|
52519
52569
|
return this.ddicReferences;
|
|
@@ -52832,10 +52882,10 @@ class SevenBitAscii {
|
|
|
52832
52882
|
key: "7bit_ascii",
|
|
52833
52883
|
title: "Check for 7bit ascii",
|
|
52834
52884
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
52835
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52836
|
-
|
|
52837
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52838
|
-
|
|
52885
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52886
|
+
|
|
52887
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52888
|
+
|
|
52839
52889
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
52840
52890
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52841
52891
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53041,10 +53091,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53041
53091
|
key: "abapdoc",
|
|
53042
53092
|
title: "Check abapdoc",
|
|
53043
53093
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53044
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53045
|
-
|
|
53046
|
-
Plus class and interface definitions.
|
|
53047
|
-
|
|
53094
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53095
|
+
|
|
53096
|
+
Plus class and interface definitions.
|
|
53097
|
+
|
|
53048
53098
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53049
53099
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53050
53100
|
};
|
|
@@ -53182,49 +53232,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53182
53232
|
key: "align_parameters",
|
|
53183
53233
|
title: "Align Parameters",
|
|
53184
53234
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53185
|
-
extendedInformation: `Checks:
|
|
53186
|
-
* function module calls
|
|
53187
|
-
* method calls
|
|
53188
|
-
* VALUE constructors
|
|
53189
|
-
* NEW constructors
|
|
53190
|
-
* RAISE EXCEPTION statements
|
|
53191
|
-
* CREATE OBJECT statements
|
|
53192
|
-
* RAISE EVENT statements
|
|
53193
|
-
|
|
53194
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53195
|
-
|
|
53196
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53197
|
-
|
|
53198
|
-
If parameters are on the same row, no issues are reported, see
|
|
53235
|
+
extendedInformation: `Checks:
|
|
53236
|
+
* function module calls
|
|
53237
|
+
* method calls
|
|
53238
|
+
* VALUE constructors
|
|
53239
|
+
* NEW constructors
|
|
53240
|
+
* RAISE EXCEPTION statements
|
|
53241
|
+
* CREATE OBJECT statements
|
|
53242
|
+
* RAISE EVENT statements
|
|
53243
|
+
|
|
53244
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53245
|
+
|
|
53246
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53247
|
+
|
|
53248
|
+
If parameters are on the same row, no issues are reported, see
|
|
53199
53249
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53200
53250
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53201
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53202
|
-
EXPORTING
|
|
53203
|
-
foo = 2
|
|
53204
|
-
parameter = 3.
|
|
53205
|
-
|
|
53206
|
-
foobar( moo = 1
|
|
53207
|
-
param = 1 ).
|
|
53208
|
-
|
|
53209
|
-
foo = VALUE #(
|
|
53210
|
-
foo = bar
|
|
53251
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53252
|
+
EXPORTING
|
|
53253
|
+
foo = 2
|
|
53254
|
+
parameter = 3.
|
|
53255
|
+
|
|
53256
|
+
foobar( moo = 1
|
|
53257
|
+
param = 1 ).
|
|
53258
|
+
|
|
53259
|
+
foo = VALUE #(
|
|
53260
|
+
foo = bar
|
|
53211
53261
|
moo = 2 ).`,
|
|
53212
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53213
|
-
EXPORTING
|
|
53214
|
-
foo = 2
|
|
53215
|
-
parameter = 3.
|
|
53216
|
-
|
|
53217
|
-
foobar( moo = 1
|
|
53218
|
-
param = 1 ).
|
|
53219
|
-
|
|
53220
|
-
foo = VALUE #(
|
|
53221
|
-
foo = bar
|
|
53222
|
-
moo = 2 ).
|
|
53223
|
-
|
|
53224
|
-
DATA(sdf) = VALUE type(
|
|
53225
|
-
common_val = 2
|
|
53226
|
-
another_common = 5
|
|
53227
|
-
( row_value = 4
|
|
53262
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53263
|
+
EXPORTING
|
|
53264
|
+
foo = 2
|
|
53265
|
+
parameter = 3.
|
|
53266
|
+
|
|
53267
|
+
foobar( moo = 1
|
|
53268
|
+
param = 1 ).
|
|
53269
|
+
|
|
53270
|
+
foo = VALUE #(
|
|
53271
|
+
foo = bar
|
|
53272
|
+
moo = 2 ).
|
|
53273
|
+
|
|
53274
|
+
DATA(sdf) = VALUE type(
|
|
53275
|
+
common_val = 2
|
|
53276
|
+
another_common = 5
|
|
53277
|
+
( row_value = 4
|
|
53228
53278
|
value_foo = 5 ) ).`,
|
|
53229
53279
|
};
|
|
53230
53280
|
}
|
|
@@ -53658,37 +53708,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
53658
53708
|
key: "align_type_expressions",
|
|
53659
53709
|
title: "Align TYPE expressions",
|
|
53660
53710
|
shortDescription: `Align TYPE expressions in statements`,
|
|
53661
|
-
extendedInformation: `
|
|
53662
|
-
Currently works for METHODS + BEGIN OF
|
|
53663
|
-
|
|
53664
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
53665
|
-
|
|
53666
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
53711
|
+
extendedInformation: `
|
|
53712
|
+
Currently works for METHODS + BEGIN OF
|
|
53713
|
+
|
|
53714
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
53715
|
+
|
|
53716
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
53667
53717
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
53668
53718
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
53669
|
-
badExample: `
|
|
53670
|
-
TYPES: BEGIN OF foo,
|
|
53671
|
-
bar TYPE i,
|
|
53672
|
-
foobar TYPE i,
|
|
53673
|
-
END OF foo.
|
|
53674
|
-
|
|
53675
|
-
INTERFACE lif.
|
|
53676
|
-
METHODS bar
|
|
53677
|
-
IMPORTING
|
|
53678
|
-
foo TYPE i
|
|
53679
|
-
foobar TYPE i.
|
|
53719
|
+
badExample: `
|
|
53720
|
+
TYPES: BEGIN OF foo,
|
|
53721
|
+
bar TYPE i,
|
|
53722
|
+
foobar TYPE i,
|
|
53723
|
+
END OF foo.
|
|
53724
|
+
|
|
53725
|
+
INTERFACE lif.
|
|
53726
|
+
METHODS bar
|
|
53727
|
+
IMPORTING
|
|
53728
|
+
foo TYPE i
|
|
53729
|
+
foobar TYPE i.
|
|
53680
53730
|
ENDINTERFACE.`,
|
|
53681
|
-
goodExample: `
|
|
53682
|
-
TYPES: BEGIN OF foo,
|
|
53683
|
-
bar TYPE i,
|
|
53684
|
-
foobar TYPE i,
|
|
53685
|
-
END OF foo.
|
|
53686
|
-
|
|
53687
|
-
INTERFACE lif.
|
|
53688
|
-
METHODS bar
|
|
53689
|
-
IMPORTING
|
|
53690
|
-
foo TYPE i
|
|
53691
|
-
foobar TYPE i.
|
|
53731
|
+
goodExample: `
|
|
53732
|
+
TYPES: BEGIN OF foo,
|
|
53733
|
+
bar TYPE i,
|
|
53734
|
+
foobar TYPE i,
|
|
53735
|
+
END OF foo.
|
|
53736
|
+
|
|
53737
|
+
INTERFACE lif.
|
|
53738
|
+
METHODS bar
|
|
53739
|
+
IMPORTING
|
|
53740
|
+
foo TYPE i
|
|
53741
|
+
foobar TYPE i.
|
|
53692
53742
|
ENDINTERFACE.`,
|
|
53693
53743
|
};
|
|
53694
53744
|
}
|
|
@@ -53967,15 +54017,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
53967
54017
|
return {
|
|
53968
54018
|
key: "ambiguous_statement",
|
|
53969
54019
|
title: "Check for ambigious statements",
|
|
53970
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53971
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53972
|
-
|
|
54020
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54021
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54022
|
+
|
|
53973
54023
|
Only works if the target version is 740sp05 or above`,
|
|
53974
54024
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53975
|
-
badExample: `DELETE foo FROM bar.
|
|
54025
|
+
badExample: `DELETE foo FROM bar.
|
|
53976
54026
|
MODIFY foo FROM bar.`,
|
|
53977
|
-
goodExample: `DELETE foo FROM @bar.
|
|
53978
|
-
MODIFY TABLE foo FROM bar.
|
|
54027
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54028
|
+
MODIFY TABLE foo FROM bar.
|
|
53979
54029
|
MODIFY zfoo FROM @wa.`,
|
|
53980
54030
|
};
|
|
53981
54031
|
}
|
|
@@ -54080,16 +54130,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54080
54130
|
key: "avoid_use",
|
|
54081
54131
|
title: "Avoid use of certain statements",
|
|
54082
54132
|
shortDescription: `Detects usage of certain statements.`,
|
|
54083
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54084
|
-
|
|
54085
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54086
|
-
|
|
54087
|
-
STATICS: use CLASS-DATA instead
|
|
54088
|
-
|
|
54089
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54090
|
-
|
|
54091
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54092
|
-
|
|
54133
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54134
|
+
|
|
54135
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54136
|
+
|
|
54137
|
+
STATICS: use CLASS-DATA instead
|
|
54138
|
+
|
|
54139
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54140
|
+
|
|
54141
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54142
|
+
|
|
54093
54143
|
BREAK points`,
|
|
54094
54144
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54095
54145
|
};
|
|
@@ -54221,11 +54271,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54221
54271
|
title: "Check BEGIN END names",
|
|
54222
54272
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54223
54273
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54224
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54225
|
-
field TYPE i,
|
|
54274
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54275
|
+
field TYPE i,
|
|
54226
54276
|
END OF structure_not_the_same.`,
|
|
54227
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54228
|
-
field TYPE i,
|
|
54277
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54278
|
+
field TYPE i,
|
|
54229
54279
|
END OF stru.`,
|
|
54230
54280
|
};
|
|
54231
54281
|
}
|
|
@@ -54322,20 +54372,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54322
54372
|
title: "BEGIN contains single INCLUDE",
|
|
54323
54373
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54324
54374
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54325
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54326
|
-
INCLUDE TYPE dselc.
|
|
54327
|
-
TYPES: END OF dummy1.
|
|
54328
|
-
|
|
54329
|
-
DATA BEGIN OF foo.
|
|
54330
|
-
INCLUDE STRUCTURE syst.
|
|
54331
|
-
DATA END OF foo.
|
|
54332
|
-
|
|
54333
|
-
STATICS BEGIN OF bar.
|
|
54334
|
-
INCLUDE STRUCTURE syst.
|
|
54375
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54376
|
+
INCLUDE TYPE dselc.
|
|
54377
|
+
TYPES: END OF dummy1.
|
|
54378
|
+
|
|
54379
|
+
DATA BEGIN OF foo.
|
|
54380
|
+
INCLUDE STRUCTURE syst.
|
|
54381
|
+
DATA END OF foo.
|
|
54382
|
+
|
|
54383
|
+
STATICS BEGIN OF bar.
|
|
54384
|
+
INCLUDE STRUCTURE syst.
|
|
54335
54385
|
STATICS END OF bar.`,
|
|
54336
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54337
|
-
DATA field TYPE i.
|
|
54338
|
-
INCLUDE STRUCTURE dselc.
|
|
54386
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54387
|
+
DATA field TYPE i.
|
|
54388
|
+
INCLUDE STRUCTURE dselc.
|
|
54339
54389
|
DATA END OF foo.`,
|
|
54340
54390
|
};
|
|
54341
54391
|
}
|
|
@@ -54425,9 +54475,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54425
54475
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54426
54476
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54427
54477
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54428
|
-
goodExample: `TRY.
|
|
54429
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54430
|
-
CATCH cx_sy_authorization_error.
|
|
54478
|
+
goodExample: `TRY.
|
|
54479
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54480
|
+
CATCH cx_sy_authorization_error.
|
|
54431
54481
|
ENDTRY.`,
|
|
54432
54482
|
};
|
|
54433
54483
|
}
|
|
@@ -54492,10 +54542,10 @@ class CDSCommentStyle {
|
|
|
54492
54542
|
key: "cds_comment_style",
|
|
54493
54543
|
title: "CDS Comment Style",
|
|
54494
54544
|
shortDescription: `Check for obsolete comment style`,
|
|
54495
|
-
extendedInformation: `Check for obsolete comment style
|
|
54496
|
-
|
|
54497
|
-
Comments starting with "--" are considered obsolete
|
|
54498
|
-
|
|
54545
|
+
extendedInformation: `Check for obsolete comment style
|
|
54546
|
+
|
|
54547
|
+
Comments starting with "--" are considered obsolete
|
|
54548
|
+
|
|
54499
54549
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54500
54550
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54501
54551
|
badExample: "-- this is a comment",
|
|
@@ -54561,10 +54611,10 @@ class CDSLegacyView {
|
|
|
54561
54611
|
key: "cds_legacy_view",
|
|
54562
54612
|
title: "CDS Legacy View",
|
|
54563
54613
|
shortDescription: `Identify CDS Legacy Views`,
|
|
54564
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54565
|
-
|
|
54566
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54567
|
-
|
|
54614
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54615
|
+
|
|
54616
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54617
|
+
|
|
54568
54618
|
v755 and up`,
|
|
54569
54619
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54570
54620
|
};
|
|
@@ -54719,10 +54769,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
54719
54769
|
key: "chain_mainly_declarations",
|
|
54720
54770
|
title: "Chain mainly declarations",
|
|
54721
54771
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
54722
|
-
extendedInformation: `
|
|
54723
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
54724
|
-
|
|
54725
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
54772
|
+
extendedInformation: `
|
|
54773
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
54774
|
+
|
|
54775
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
54726
54776
|
`,
|
|
54727
54777
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54728
54778
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -54898,17 +54948,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
54898
54948
|
title: "Change IF to CASE",
|
|
54899
54949
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
54900
54950
|
// eslint-disable-next-line max-len
|
|
54901
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54902
|
-
|
|
54951
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54952
|
+
|
|
54903
54953
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
54904
54954
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54905
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54906
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54907
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
54955
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54956
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54957
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
54908
54958
|
ENDIF.`,
|
|
54909
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
54910
|
-
WHEN 'FOO'.
|
|
54911
|
-
WHEN 'BAR' OR 'MOO'.
|
|
54959
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
54960
|
+
WHEN 'FOO'.
|
|
54961
|
+
WHEN 'BAR' OR 'MOO'.
|
|
54912
54962
|
ENDCASE.`,
|
|
54913
54963
|
};
|
|
54914
54964
|
}
|
|
@@ -55045,8 +55095,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55045
55095
|
return {
|
|
55046
55096
|
key: "check_abstract",
|
|
55047
55097
|
title: "Check abstract methods and classes",
|
|
55048
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55049
|
-
- class defined as abstract and final,
|
|
55098
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55099
|
+
- class defined as abstract and final,
|
|
55050
55100
|
- non-abstract class contains abstract methods`,
|
|
55051
55101
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55052
55102
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55127,11 +55177,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55127
55177
|
return {
|
|
55128
55178
|
key: "check_comments",
|
|
55129
55179
|
title: "Check Comments",
|
|
55130
|
-
shortDescription: `
|
|
55180
|
+
shortDescription: `
|
|
55131
55181
|
Various checks for comment usage.`,
|
|
55132
|
-
extendedInformation: `
|
|
55133
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55134
|
-
|
|
55182
|
+
extendedInformation: `
|
|
55183
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55184
|
+
|
|
55135
55185
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55136
55186
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55137
55187
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55293,9 +55343,9 @@ class CheckInclude {
|
|
|
55293
55343
|
key: "check_include",
|
|
55294
55344
|
title: "Check INCLUDEs",
|
|
55295
55345
|
shortDescription: `Checks INCLUDE statements`,
|
|
55296
|
-
extendedInformation: `
|
|
55297
|
-
* Reports unused includes
|
|
55298
|
-
* Errors if the includes are not found
|
|
55346
|
+
extendedInformation: `
|
|
55347
|
+
* Reports unused includes
|
|
55348
|
+
* Errors if the includes are not found
|
|
55299
55349
|
* Error if including a main program`,
|
|
55300
55350
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55301
55351
|
};
|
|
@@ -55371,14 +55421,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55371
55421
|
key: "check_subrc",
|
|
55372
55422
|
title: "Check sy-subrc",
|
|
55373
55423
|
shortDescription: `Check sy-subrc`,
|
|
55374
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55375
|
-
|
|
55376
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55377
|
-
|
|
55378
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55379
|
-
|
|
55380
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55381
|
-
|
|
55424
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55425
|
+
|
|
55426
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55427
|
+
|
|
55428
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55429
|
+
|
|
55430
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55431
|
+
|
|
55382
55432
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55383
55433
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55384
55434
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -55948,17 +55998,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
55948
55998
|
shortDescription: `Find overlapping classic exceptions`,
|
|
55949
55999
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
55950
56000
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55951
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55952
|
-
EXCEPTIONS
|
|
55953
|
-
system_failure = 1 MESSAGE lv_message
|
|
55954
|
-
communication_failure = 1 MESSAGE lv_message
|
|
55955
|
-
resource_failure = 1
|
|
56001
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56002
|
+
EXCEPTIONS
|
|
56003
|
+
system_failure = 1 MESSAGE lv_message
|
|
56004
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56005
|
+
resource_failure = 1
|
|
55956
56006
|
OTHERS = 1.`,
|
|
55957
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55958
|
-
EXCEPTIONS
|
|
55959
|
-
system_failure = 1 MESSAGE lv_message
|
|
55960
|
-
communication_failure = 2 MESSAGE lv_message
|
|
55961
|
-
resource_failure = 3
|
|
56007
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56008
|
+
EXCEPTIONS
|
|
56009
|
+
system_failure = 1 MESSAGE lv_message
|
|
56010
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56011
|
+
resource_failure = 3
|
|
55962
56012
|
OTHERS = 4.`,
|
|
55963
56013
|
};
|
|
55964
56014
|
}
|
|
@@ -56204,7 +56254,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56204
56254
|
key: "commented_code",
|
|
56205
56255
|
title: "Find commented code",
|
|
56206
56256
|
shortDescription: `Detects usage of commented out code.`,
|
|
56207
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56257
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56208
56258
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56209
56259
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56210
56260
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56437,10 +56487,10 @@ class ConstructorVisibilityPublic {
|
|
|
56437
56487
|
key: "constructor_visibility_public",
|
|
56438
56488
|
title: "Check constructor visibility is public",
|
|
56439
56489
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56440
|
-
extendedInformation: `
|
|
56441
|
-
This only applies to global classes.
|
|
56442
|
-
|
|
56443
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56490
|
+
extendedInformation: `
|
|
56491
|
+
This only applies to global classes.
|
|
56492
|
+
|
|
56493
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56444
56494
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56445
56495
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56446
56496
|
};
|
|
@@ -56515,8 +56565,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56515
56565
|
key: "contains_tab",
|
|
56516
56566
|
title: "Code contains tab",
|
|
56517
56567
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56518
|
-
extendedInformation: `
|
|
56519
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56568
|
+
extendedInformation: `
|
|
56569
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56520
56570
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56521
56571
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56522
56572
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -56603,10 +56653,10 @@ class CyclicOO {
|
|
|
56603
56653
|
key: "cyclic_oo",
|
|
56604
56654
|
title: "Cyclic OO",
|
|
56605
56655
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
56606
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56607
|
-
|
|
56608
|
-
Objects must be without syntax errors for this rule to take effect
|
|
56609
|
-
|
|
56656
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56657
|
+
|
|
56658
|
+
Objects must be without syntax errors for this rule to take effect
|
|
56659
|
+
|
|
56610
56660
|
References in testclass includes are ignored`,
|
|
56611
56661
|
};
|
|
56612
56662
|
}
|
|
@@ -56848,7 +56898,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
56848
56898
|
key: "dangerous_statement",
|
|
56849
56899
|
title: "Dangerous statement",
|
|
56850
56900
|
shortDescription: `Detects potentially dangerous statements`,
|
|
56851
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56901
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56852
56902
|
dynamic SQL can potentially create SQL injection problems`,
|
|
56853
56903
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
56854
56904
|
};
|
|
@@ -57052,13 +57102,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57052
57102
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57053
57103
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57054
57104
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57055
|
-
badExample: `FROM foo.
|
|
57056
|
-
WRITE 'hello'.
|
|
57057
|
-
DATA int TYPE i.
|
|
57105
|
+
badExample: `FROM foo.
|
|
57106
|
+
WRITE 'hello'.
|
|
57107
|
+
DATA int TYPE i.
|
|
57058
57108
|
ENDFORM.`,
|
|
57059
|
-
goodExample: `FROM foo.
|
|
57060
|
-
DATA int TYPE i.
|
|
57061
|
-
WRITE 'hello'.
|
|
57109
|
+
goodExample: `FROM foo.
|
|
57110
|
+
DATA int TYPE i.
|
|
57111
|
+
WRITE 'hello'.
|
|
57062
57112
|
ENDFORM.`,
|
|
57063
57113
|
};
|
|
57064
57114
|
}
|
|
@@ -57597,39 +57647,39 @@ class Downport {
|
|
|
57597
57647
|
key: "downport",
|
|
57598
57648
|
title: "Downport statement",
|
|
57599
57649
|
shortDescription: `Downport functionality`,
|
|
57600
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57601
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57602
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57603
|
-
|
|
57604
|
-
Current rules:
|
|
57605
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57606
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57607
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
57608
|
-
* CONV is outlined
|
|
57609
|
-
* COND is outlined
|
|
57610
|
-
* REDUCE is outlined
|
|
57611
|
-
* SWITCH is outlined
|
|
57612
|
-
* FILTER is outlined
|
|
57613
|
-
* APPEND expression is outlined
|
|
57614
|
-
* INSERT expression is outlined
|
|
57615
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57616
|
-
* CAST changed to ?=
|
|
57617
|
-
* LOOP AT method_call( ) is outlined
|
|
57618
|
-
* VALUE # with structure fields
|
|
57619
|
-
* VALUE # with internal table lines
|
|
57620
|
-
* Table Expressions are outlined
|
|
57621
|
-
* SELECT INTO @DATA definitions are outlined
|
|
57622
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57623
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57624
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57625
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
57626
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57627
|
-
* line_exists and line_index is downported to READ TABLE
|
|
57628
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
57629
|
-
* MESSAGE with non simple source
|
|
57630
|
-
|
|
57631
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57632
|
-
|
|
57650
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57651
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57652
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57653
|
+
|
|
57654
|
+
Current rules:
|
|
57655
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57656
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57657
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
57658
|
+
* CONV is outlined
|
|
57659
|
+
* COND is outlined
|
|
57660
|
+
* REDUCE is outlined
|
|
57661
|
+
* SWITCH is outlined
|
|
57662
|
+
* FILTER is outlined
|
|
57663
|
+
* APPEND expression is outlined
|
|
57664
|
+
* INSERT expression is outlined
|
|
57665
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57666
|
+
* CAST changed to ?=
|
|
57667
|
+
* LOOP AT method_call( ) is outlined
|
|
57668
|
+
* VALUE # with structure fields
|
|
57669
|
+
* VALUE # with internal table lines
|
|
57670
|
+
* Table Expressions are outlined
|
|
57671
|
+
* SELECT INTO @DATA definitions are outlined
|
|
57672
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57673
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57674
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57675
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
57676
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57677
|
+
* line_exists and line_index is downported to READ TABLE
|
|
57678
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
57679
|
+
* MESSAGE with non simple source
|
|
57680
|
+
|
|
57681
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57682
|
+
|
|
57633
57683
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
57634
57684
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
57635
57685
|
};
|
|
@@ -58207,10 +58257,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58207
58257
|
const fieldName = f.concatTokens();
|
|
58208
58258
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58209
58259
|
}
|
|
58210
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58260
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58211
58261
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58212
58262
|
}
|
|
58213
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58263
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58214
58264
|
${indentation}`);
|
|
58215
58265
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58216
58266
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58254,12 +58304,12 @@ ${indentation}`);
|
|
|
58254
58304
|
}
|
|
58255
58305
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58256
58306
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
58257
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58258
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58259
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58307
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58308
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58309
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58260
58310
|
${indentation}`);
|
|
58261
58311
|
if (fieldDefinitions === "") {
|
|
58262
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58312
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58263
58313
|
${indentation}`);
|
|
58264
58314
|
}
|
|
58265
58315
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58327,7 +58377,7 @@ ${indentation}`);
|
|
|
58327
58377
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58328
58378
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58329
58379
|
const firstToken = high.getFirstToken();
|
|
58330
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58380
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58331
58381
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58332
58382
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58333
58383
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58381,7 +58431,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58381
58431
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58382
58432
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58383
58433
|
const firstToken = high.getFirstToken();
|
|
58384
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58434
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58385
58435
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58386
58436
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58387
58437
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58423,14 +58473,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58423
58473
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58424
58474
|
const firstToken = high.getFirstToken();
|
|
58425
58475
|
// note that the tabix restore should be done before throwing the exception
|
|
58426
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58427
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58428
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58429
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58430
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58431
|
-
${indentation}IF sy-subrc <> 0.
|
|
58432
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58433
|
-
${indentation}ENDIF.
|
|
58476
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58477
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58478
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58479
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58480
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58481
|
+
${indentation}IF sy-subrc <> 0.
|
|
58482
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58483
|
+
${indentation}ENDIF.
|
|
58434
58484
|
${indentation}`);
|
|
58435
58485
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58436
58486
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58487,7 +58537,7 @@ ${indentation}`);
|
|
|
58487
58537
|
const className = classNames[0].concatTokens();
|
|
58488
58538
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58489
58539
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58490
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58540
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58491
58541
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58492
58542
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58493
58543
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -58649,16 +58699,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
58649
58699
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58650
58700
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58651
58701
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58652
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
58653
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
58702
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
58703
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
58654
58704
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
58655
58705
|
if (withs.length > 0) {
|
|
58656
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
58657
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
58658
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
58706
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
58707
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
58708
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
58659
58709
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
58660
58710
|
}
|
|
58661
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
58711
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
58662
58712
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
58663
58713
|
if (withs.length > 0) {
|
|
58664
58714
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -58770,10 +58820,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
58770
58820
|
let code = "";
|
|
58771
58821
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
58772
58822
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58773
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58774
|
-
IF sy-subrc <> 0.
|
|
58775
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58776
|
-
ENDIF.
|
|
58823
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58824
|
+
IF sy-subrc <> 0.
|
|
58825
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58826
|
+
ENDIF.
|
|
58777
58827
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
58778
58828
|
}
|
|
58779
58829
|
else {
|
|
@@ -58862,20 +58912,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
58862
58912
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58863
58913
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58864
58914
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58865
|
-
code += ` items LIKE ${loopSourceName},
|
|
58866
|
-
END OF ${groupTargetName}type.
|
|
58867
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58868
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58915
|
+
code += ` items LIKE ${loopSourceName},
|
|
58916
|
+
END OF ${groupTargetName}type.
|
|
58917
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58918
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58869
58919
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
58870
58920
|
if (groupIndexName !== undefined) {
|
|
58871
58921
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
58872
58922
|
}
|
|
58873
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58923
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58874
58924
|
IF sy-subrc = 0.\n`;
|
|
58875
58925
|
if (groupCountName !== undefined) {
|
|
58876
58926
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
58877
58927
|
}
|
|
58878
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58928
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58879
58929
|
ELSE.\n`;
|
|
58880
58930
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
58881
58931
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -58896,8 +58946,8 @@ ELSE.\n`;
|
|
|
58896
58946
|
}
|
|
58897
58947
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
58898
58948
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
58899
|
-
code += `ENDIF.
|
|
58900
|
-
ENDLOOP.
|
|
58949
|
+
code += `ENDIF.
|
|
58950
|
+
ENDLOOP.
|
|
58901
58951
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
58902
58952
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
58903
58953
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59069,7 +59119,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59069
59119
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59070
59120
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59071
59121
|
// all ENUMS are char like?
|
|
59072
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59122
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59073
59123
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59074
59124
|
let count = 1;
|
|
59075
59125
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59113,14 +59163,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59113
59163
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59114
59164
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59115
59165
|
// restore tabix before exeption
|
|
59116
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59117
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59118
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59119
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59120
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59121
|
-
${indentation}IF sy-subrc <> 0.
|
|
59122
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59123
|
-
${indentation}ENDIF.
|
|
59166
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59167
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59168
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59169
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59170
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59171
|
+
${indentation}IF sy-subrc <> 0.
|
|
59172
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59173
|
+
${indentation}ENDIF.
|
|
59124
59174
|
${indentation}${uniqueName}`;
|
|
59125
59175
|
const start = target.getFirstToken().getStart();
|
|
59126
59176
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59204,11 +59254,11 @@ ${indentation}${uniqueName}`;
|
|
|
59204
59254
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59205
59255
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59206
59256
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59207
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59208
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59209
|
-
${indentation} EXPORTING
|
|
59210
|
-
${indentation} input = ${source}
|
|
59211
|
-
${indentation} IMPORTING
|
|
59257
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59258
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59259
|
+
${indentation} EXPORTING
|
|
59260
|
+
${indentation} input = ${source}
|
|
59261
|
+
${indentation} IMPORTING
|
|
59212
59262
|
${indentation} output = ${uniqueName}.\n`;
|
|
59213
59263
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59214
59264
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60520,12 +60570,12 @@ class EasyToFindMessages {
|
|
|
60520
60570
|
key: "easy_to_find_messages",
|
|
60521
60571
|
title: "Easy to find messages",
|
|
60522
60572
|
shortDescription: `Make messages easy to find`,
|
|
60523
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60524
|
-
|
|
60525
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60526
|
-
|
|
60527
|
-
Also see rule "message_exists"
|
|
60528
|
-
|
|
60573
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60574
|
+
|
|
60575
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60576
|
+
|
|
60577
|
+
Also see rule "message_exists"
|
|
60578
|
+
|
|
60529
60579
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60530
60580
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60531
60581
|
};
|
|
@@ -60610,8 +60660,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
60610
60660
|
key: "empty_line_in_statement",
|
|
60611
60661
|
title: "Find empty lines in statements",
|
|
60612
60662
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
60613
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
60614
|
-
|
|
60663
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
60664
|
+
|
|
60615
60665
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
60616
60666
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
60617
60667
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -60787,13 +60837,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60787
60837
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
60788
60838
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
60789
60839
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60790
|
-
badExample: `IF foo = bar.
|
|
60791
|
-
ENDIF.
|
|
60792
|
-
|
|
60793
|
-
DO 2 TIMES.
|
|
60840
|
+
badExample: `IF foo = bar.
|
|
60841
|
+
ENDIF.
|
|
60842
|
+
|
|
60843
|
+
DO 2 TIMES.
|
|
60794
60844
|
ENDDO.`,
|
|
60795
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60796
|
-
ENDLOOP.
|
|
60845
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60846
|
+
ENDLOOP.
|
|
60797
60847
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
60798
60848
|
};
|
|
60799
60849
|
}
|
|
@@ -60935,10 +60985,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
60935
60985
|
return {
|
|
60936
60986
|
key: "exit_or_check",
|
|
60937
60987
|
title: "Find EXIT or CHECK outside loops",
|
|
60938
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60988
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60939
60989
|
Use RETURN to leave procesing blocks instead.`,
|
|
60940
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60941
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60990
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60991
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60942
60992
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
60943
60993
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60944
60994
|
};
|
|
@@ -61021,12 +61071,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61021
61071
|
key: "expand_macros",
|
|
61022
61072
|
title: "Expand Macros",
|
|
61023
61073
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61024
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61025
|
-
|
|
61074
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61075
|
+
|
|
61026
61076
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61027
|
-
badExample: `DEFINE _hello.
|
|
61028
|
-
WRITE 'hello'.
|
|
61029
|
-
END-OF-DEFINITION.
|
|
61077
|
+
badExample: `DEFINE _hello.
|
|
61078
|
+
WRITE 'hello'.
|
|
61079
|
+
END-OF-DEFINITION.
|
|
61030
61080
|
_hello.`,
|
|
61031
61081
|
goodExample: `WRITE 'hello'.`,
|
|
61032
61082
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61113,7 +61163,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61113
61163
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61114
61164
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61115
61165
|
goodExample: `call_method( foo = bar ).`,
|
|
61116
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61166
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61117
61167
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61118
61168
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61119
61169
|
};
|
|
@@ -61211,7 +61261,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61211
61261
|
key: "forbidden_identifier",
|
|
61212
61262
|
title: "Forbidden Identifier",
|
|
61213
61263
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61214
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61264
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61215
61265
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61216
61266
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61217
61267
|
};
|
|
@@ -61453,8 +61503,8 @@ class ForbiddenVoidType {
|
|
|
61453
61503
|
key: "forbidden_void_type",
|
|
61454
61504
|
title: "Forbidden Void Types",
|
|
61455
61505
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61456
|
-
extendedInformation: `Inspiration:
|
|
61457
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61506
|
+
extendedInformation: `Inspiration:
|
|
61507
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61458
61508
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61459
61509
|
};
|
|
61460
61510
|
}
|
|
@@ -61697,7 +61747,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
61697
61747
|
key: "fully_type_itabs",
|
|
61698
61748
|
title: "Fully type internal tables",
|
|
61699
61749
|
shortDescription: `No implict table types or table keys`,
|
|
61700
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
61750
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
61701
61751
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
61702
61752
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
61703
61753
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -61882,26 +61932,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
61882
61932
|
key: "functional_writing",
|
|
61883
61933
|
title: "Use functional writing",
|
|
61884
61934
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
61885
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61935
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61886
61936
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
61887
61937
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61888
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61889
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61890
|
-
EXPORTING
|
|
61891
|
-
p_name = 'NAME'
|
|
61892
|
-
RECEIVING
|
|
61893
|
-
p_descr_ref = lr_typedescr
|
|
61894
|
-
EXCEPTIONS
|
|
61895
|
-
type_not_found = 1
|
|
61938
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61939
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61940
|
+
EXPORTING
|
|
61941
|
+
p_name = 'NAME'
|
|
61942
|
+
RECEIVING
|
|
61943
|
+
p_descr_ref = lr_typedescr
|
|
61944
|
+
EXCEPTIONS
|
|
61945
|
+
type_not_found = 1
|
|
61896
61946
|
OTHERS = 2.`,
|
|
61897
|
-
goodExample: `zcl_class=>method( ).
|
|
61898
|
-
cl_abap_typedescr=>describe_by_name(
|
|
61899
|
-
EXPORTING
|
|
61900
|
-
p_name = 'NAME'
|
|
61901
|
-
RECEIVING
|
|
61902
|
-
p_descr_ref = lr_typedescr
|
|
61903
|
-
EXCEPTIONS
|
|
61904
|
-
type_not_found = 1
|
|
61947
|
+
goodExample: `zcl_class=>method( ).
|
|
61948
|
+
cl_abap_typedescr=>describe_by_name(
|
|
61949
|
+
EXPORTING
|
|
61950
|
+
p_name = 'NAME'
|
|
61951
|
+
RECEIVING
|
|
61952
|
+
p_descr_ref = lr_typedescr
|
|
61953
|
+
EXCEPTIONS
|
|
61954
|
+
type_not_found = 1
|
|
61905
61955
|
OTHERS = 2 ).`,
|
|
61906
61956
|
};
|
|
61907
61957
|
}
|
|
@@ -62012,14 +62062,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62012
62062
|
key: "global_class",
|
|
62013
62063
|
title: "Global class checks",
|
|
62014
62064
|
shortDescription: `Checks related to global classes`,
|
|
62015
|
-
extendedInformation: `* global classes must be in own files
|
|
62016
|
-
|
|
62017
|
-
* file names must match class name
|
|
62018
|
-
|
|
62019
|
-
* file names must match interface name
|
|
62020
|
-
|
|
62021
|
-
* global classes must be global definitions
|
|
62022
|
-
|
|
62065
|
+
extendedInformation: `* global classes must be in own files
|
|
62066
|
+
|
|
62067
|
+
* file names must match class name
|
|
62068
|
+
|
|
62069
|
+
* file names must match interface name
|
|
62070
|
+
|
|
62071
|
+
* global classes must be global definitions
|
|
62072
|
+
|
|
62023
62073
|
* global interfaces must be global definitions`,
|
|
62024
62074
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62025
62075
|
};
|
|
@@ -62118,21 +62168,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62118
62168
|
return {
|
|
62119
62169
|
key: "identical_conditions",
|
|
62120
62170
|
title: "Identical conditions",
|
|
62121
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62122
|
-
|
|
62171
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62172
|
+
|
|
62123
62173
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62124
62174
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62125
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62126
|
-
ENDIF.
|
|
62127
|
-
CASE bar.
|
|
62128
|
-
WHEN '1'.
|
|
62129
|
-
WHEN 'A' OR '1'.
|
|
62175
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62176
|
+
ENDIF.
|
|
62177
|
+
CASE bar.
|
|
62178
|
+
WHEN '1'.
|
|
62179
|
+
WHEN 'A' OR '1'.
|
|
62130
62180
|
ENDCASE.`,
|
|
62131
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62132
|
-
ENDIF.
|
|
62133
|
-
CASE bar.
|
|
62134
|
-
WHEN '1'.
|
|
62135
|
-
WHEN 'A'.
|
|
62181
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62182
|
+
ENDIF.
|
|
62183
|
+
CASE bar.
|
|
62184
|
+
WHEN '1'.
|
|
62185
|
+
WHEN 'A'.
|
|
62136
62186
|
ENDCASE.`,
|
|
62137
62187
|
};
|
|
62138
62188
|
}
|
|
@@ -62266,23 +62316,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62266
62316
|
key: "identical_contents",
|
|
62267
62317
|
title: "Identical contents",
|
|
62268
62318
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62269
|
-
extendedInformation: `
|
|
62270
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62271
|
-
|
|
62319
|
+
extendedInformation: `
|
|
62320
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62321
|
+
|
|
62272
62322
|
Chained statments are ignored`,
|
|
62273
62323
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62274
|
-
badExample: `IF foo = bar.
|
|
62275
|
-
WRITE 'bar'.
|
|
62276
|
-
WRITE 'world'.
|
|
62277
|
-
ELSE.
|
|
62278
|
-
WRITE 'foo'.
|
|
62279
|
-
WRITE 'world'.
|
|
62324
|
+
badExample: `IF foo = bar.
|
|
62325
|
+
WRITE 'bar'.
|
|
62326
|
+
WRITE 'world'.
|
|
62327
|
+
ELSE.
|
|
62328
|
+
WRITE 'foo'.
|
|
62329
|
+
WRITE 'world'.
|
|
62280
62330
|
ENDIF.`,
|
|
62281
|
-
goodExample: `IF foo = bar.
|
|
62282
|
-
WRITE 'bar'.
|
|
62283
|
-
ELSE.
|
|
62284
|
-
WRITE 'foo'.
|
|
62285
|
-
ENDIF.
|
|
62331
|
+
goodExample: `IF foo = bar.
|
|
62332
|
+
WRITE 'bar'.
|
|
62333
|
+
ELSE.
|
|
62334
|
+
WRITE 'foo'.
|
|
62335
|
+
ENDIF.
|
|
62286
62336
|
WRITE 'world'.`,
|
|
62287
62337
|
};
|
|
62288
62338
|
}
|
|
@@ -62390,12 +62440,12 @@ class IdenticalDescriptions {
|
|
|
62390
62440
|
key: "identical_descriptions",
|
|
62391
62441
|
title: "Identical descriptions",
|
|
62392
62442
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62393
|
-
extendedInformation: `Case insensitive
|
|
62394
|
-
|
|
62395
|
-
Only checks the master language descriptions
|
|
62396
|
-
|
|
62397
|
-
Dependencies are skipped
|
|
62398
|
-
|
|
62443
|
+
extendedInformation: `Case insensitive
|
|
62444
|
+
|
|
62445
|
+
Only checks the master language descriptions
|
|
62446
|
+
|
|
62447
|
+
Dependencies are skipped
|
|
62448
|
+
|
|
62399
62449
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62400
62450
|
tags: [],
|
|
62401
62451
|
};
|
|
@@ -62569,43 +62619,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
62569
62619
|
key: "if_in_if",
|
|
62570
62620
|
title: "IF in IF",
|
|
62571
62621
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
62572
|
-
extendedInformation: `
|
|
62573
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
62574
|
-
|
|
62575
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
62576
|
-
|
|
62577
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
62622
|
+
extendedInformation: `
|
|
62623
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
62624
|
+
|
|
62625
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
62626
|
+
|
|
62627
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
62578
62628
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
62579
|
-
badExample: `IF condition1.
|
|
62580
|
-
IF condition2.
|
|
62581
|
-
...
|
|
62582
|
-
ENDIF.
|
|
62583
|
-
ENDIF.
|
|
62584
|
-
|
|
62585
|
-
IF condition1.
|
|
62586
|
-
...
|
|
62587
|
-
ELSE.
|
|
62588
|
-
IF condition2.
|
|
62589
|
-
...
|
|
62590
|
-
ENDIF.
|
|
62629
|
+
badExample: `IF condition1.
|
|
62630
|
+
IF condition2.
|
|
62631
|
+
...
|
|
62632
|
+
ENDIF.
|
|
62633
|
+
ENDIF.
|
|
62634
|
+
|
|
62635
|
+
IF condition1.
|
|
62636
|
+
...
|
|
62637
|
+
ELSE.
|
|
62638
|
+
IF condition2.
|
|
62639
|
+
...
|
|
62640
|
+
ENDIF.
|
|
62591
62641
|
ENDIF.`,
|
|
62592
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
62593
|
-
...
|
|
62594
|
-
ENDIF.
|
|
62595
|
-
|
|
62596
|
-
IF condition1.
|
|
62597
|
-
...
|
|
62598
|
-
ELSEIF condition2.
|
|
62599
|
-
...
|
|
62600
|
-
ENDIF.
|
|
62601
|
-
|
|
62602
|
-
CASE variable.
|
|
62603
|
-
WHEN value1.
|
|
62604
|
-
...
|
|
62605
|
-
WHEN value2.
|
|
62606
|
-
IF condition2.
|
|
62607
|
-
...
|
|
62608
|
-
ENDIF.
|
|
62642
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
62643
|
+
...
|
|
62644
|
+
ENDIF.
|
|
62645
|
+
|
|
62646
|
+
IF condition1.
|
|
62647
|
+
...
|
|
62648
|
+
ELSEIF condition2.
|
|
62649
|
+
...
|
|
62650
|
+
ENDIF.
|
|
62651
|
+
|
|
62652
|
+
CASE variable.
|
|
62653
|
+
WHEN value1.
|
|
62654
|
+
...
|
|
62655
|
+
WHEN value2.
|
|
62656
|
+
IF condition2.
|
|
62657
|
+
...
|
|
62658
|
+
ENDIF.
|
|
62609
62659
|
ENDCASE.`,
|
|
62610
62660
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62611
62661
|
};
|
|
@@ -62790,9 +62840,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
62790
62840
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
62791
62841
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
62792
62842
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
62793
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62794
|
-
METHOD ${methodName.toLowerCase()}.
|
|
62795
|
-
RETURN. " todo, implement method
|
|
62843
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62844
|
+
METHOD ${methodName.toLowerCase()}.
|
|
62845
|
+
RETURN. " todo, implement method
|
|
62796
62846
|
ENDMETHOD.`);
|
|
62797
62847
|
}
|
|
62798
62848
|
}
|
|
@@ -62980,19 +63030,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
62980
63030
|
key: "in_statement_indentation",
|
|
62981
63031
|
title: "In-statement indentation",
|
|
62982
63032
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
62983
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62984
|
-
|
|
62985
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63033
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63034
|
+
|
|
63035
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62986
63036
|
to distinguish them better from code within the block.`,
|
|
62987
|
-
badExample: `IF 1 = 1
|
|
62988
|
-
AND 2 = 2.
|
|
62989
|
-
WRITE 'hello' &&
|
|
62990
|
-
'world'.
|
|
63037
|
+
badExample: `IF 1 = 1
|
|
63038
|
+
AND 2 = 2.
|
|
63039
|
+
WRITE 'hello' &&
|
|
63040
|
+
'world'.
|
|
62991
63041
|
ENDIF.`,
|
|
62992
|
-
goodExample: `IF 1 = 1
|
|
62993
|
-
AND 2 = 2.
|
|
62994
|
-
WRITE 'hello' &&
|
|
62995
|
-
'world'.
|
|
63042
|
+
goodExample: `IF 1 = 1
|
|
63043
|
+
AND 2 = 2.
|
|
63044
|
+
WRITE 'hello' &&
|
|
63045
|
+
'world'.
|
|
62996
63046
|
ENDIF.`,
|
|
62997
63047
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62998
63048
|
};
|
|
@@ -63115,23 +63165,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63115
63165
|
title: "Indentation",
|
|
63116
63166
|
shortDescription: `Checks indentation`,
|
|
63117
63167
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63118
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63119
|
-
PRIVATE SECTION.
|
|
63120
|
-
METHODS constructor.
|
|
63121
|
-
ENDCLASS.
|
|
63122
|
-
|
|
63123
|
-
CLASS lcl IMPLEMENTATION.
|
|
63124
|
-
METHOD constructor.
|
|
63125
|
-
ENDMETHOD.
|
|
63168
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63169
|
+
PRIVATE SECTION.
|
|
63170
|
+
METHODS constructor.
|
|
63171
|
+
ENDCLASS.
|
|
63172
|
+
|
|
63173
|
+
CLASS lcl IMPLEMENTATION.
|
|
63174
|
+
METHOD constructor.
|
|
63175
|
+
ENDMETHOD.
|
|
63126
63176
|
ENDCLASS.`,
|
|
63127
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63128
|
-
PRIVATE SECTION.
|
|
63129
|
-
METHODS constructor.
|
|
63130
|
-
ENDCLASS.
|
|
63131
|
-
|
|
63132
|
-
CLASS lcl IMPLEMENTATION.
|
|
63133
|
-
METHOD constructor.
|
|
63134
|
-
ENDMETHOD.
|
|
63177
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63178
|
+
PRIVATE SECTION.
|
|
63179
|
+
METHODS constructor.
|
|
63180
|
+
ENDCLASS.
|
|
63181
|
+
|
|
63182
|
+
CLASS lcl IMPLEMENTATION.
|
|
63183
|
+
METHOD constructor.
|
|
63184
|
+
ENDMETHOD.
|
|
63135
63185
|
ENDCLASS.`,
|
|
63136
63186
|
};
|
|
63137
63187
|
}
|
|
@@ -63521,9 +63571,9 @@ class IntfReferencingClas {
|
|
|
63521
63571
|
key: "intf_referencing_clas",
|
|
63522
63572
|
title: "INTF referencing CLAS",
|
|
63523
63573
|
shortDescription: `Interface contains references to class`,
|
|
63524
|
-
extendedInformation: `Only global interfaces are checked.
|
|
63525
|
-
Only first level references are checked.
|
|
63526
|
-
Exception class references are ignored.
|
|
63574
|
+
extendedInformation: `Only global interfaces are checked.
|
|
63575
|
+
Only first level references are checked.
|
|
63576
|
+
Exception class references are ignored.
|
|
63527
63577
|
Void references are ignored.`,
|
|
63528
63578
|
};
|
|
63529
63579
|
}
|
|
@@ -63608,9 +63658,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
63608
63658
|
title: "Invalid Table Index",
|
|
63609
63659
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
63610
63660
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63611
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
63661
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
63612
63662
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
63613
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
63663
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
63614
63664
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
63615
63665
|
};
|
|
63616
63666
|
}
|
|
@@ -64211,8 +64261,8 @@ class LineBreakStyle {
|
|
|
64211
64261
|
return {
|
|
64212
64262
|
key: "line_break_style",
|
|
64213
64263
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64214
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64215
|
-
|
|
64264
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64265
|
+
|
|
64216
64266
|
abapGit does not work with CRLF`,
|
|
64217
64267
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64218
64268
|
};
|
|
@@ -64281,7 +64331,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64281
64331
|
key: "line_length",
|
|
64282
64332
|
title: "Line length",
|
|
64283
64333
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64284
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64334
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64285
64335
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64286
64336
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64287
64337
|
};
|
|
@@ -64352,7 +64402,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64352
64402
|
key: "line_only_punc",
|
|
64353
64403
|
title: "Line containing only punctuation",
|
|
64354
64404
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64355
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64405
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64356
64406
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
64357
64407
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64358
64408
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -64612,15 +64662,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
64612
64662
|
return {
|
|
64613
64663
|
key: "local_variable_names",
|
|
64614
64664
|
title: "Local variable naming conventions",
|
|
64615
|
-
shortDescription: `
|
|
64616
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
64665
|
+
shortDescription: `
|
|
64666
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
64617
64667
|
Regexes are case-insensitive.`,
|
|
64618
64668
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64619
|
-
badExample: `FORM bar.
|
|
64620
|
-
DATA foo.
|
|
64669
|
+
badExample: `FORM bar.
|
|
64670
|
+
DATA foo.
|
|
64621
64671
|
ENDFORM.`,
|
|
64622
|
-
goodExample: `FORM bar.
|
|
64623
|
-
DATA lv_foo.
|
|
64672
|
+
goodExample: `FORM bar.
|
|
64673
|
+
DATA lv_foo.
|
|
64624
64674
|
ENDFORM.`,
|
|
64625
64675
|
};
|
|
64626
64676
|
}
|
|
@@ -64772,9 +64822,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
64772
64822
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
64773
64823
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
64774
64824
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64775
|
-
badExample: `DEFINE something.
|
|
64825
|
+
badExample: `DEFINE something.
|
|
64776
64826
|
END-OF-DEFINITION.`,
|
|
64777
|
-
goodExample: `DEFINE _something.
|
|
64827
|
+
goodExample: `DEFINE _something.
|
|
64778
64828
|
END-OF-DEFINITION.`,
|
|
64779
64829
|
};
|
|
64780
64830
|
}
|
|
@@ -64847,10 +64897,10 @@ class MainFileContents {
|
|
|
64847
64897
|
key: "main_file_contents",
|
|
64848
64898
|
title: "Main file contents",
|
|
64849
64899
|
shortDescription: `Checks related to report declarations.`,
|
|
64850
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
64851
|
-
|
|
64852
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64853
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64900
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
64901
|
+
|
|
64902
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64903
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64854
64904
|
`,
|
|
64855
64905
|
};
|
|
64856
64906
|
}
|
|
@@ -64966,17 +65016,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
64966
65016
|
title: "Too many parentheses",
|
|
64967
65017
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
64968
65018
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64969
|
-
badExample: `
|
|
64970
|
-
IF ( destination IS INITIAL ).
|
|
64971
|
-
ENDIF.
|
|
64972
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64973
|
-
ENDIF.
|
|
65019
|
+
badExample: `
|
|
65020
|
+
IF ( destination IS INITIAL ).
|
|
65021
|
+
ENDIF.
|
|
65022
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65023
|
+
ENDIF.
|
|
64974
65024
|
`,
|
|
64975
|
-
goodExample: `
|
|
64976
|
-
IF destination IS INITIAL.
|
|
64977
|
-
ENDIF.
|
|
64978
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
64979
|
-
ENDIF.
|
|
65025
|
+
goodExample: `
|
|
65026
|
+
IF destination IS INITIAL.
|
|
65027
|
+
ENDIF.
|
|
65028
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65029
|
+
ENDIF.
|
|
64980
65030
|
`,
|
|
64981
65031
|
};
|
|
64982
65032
|
}
|
|
@@ -65150,14 +65200,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65150
65200
|
title: "Max one method parameter definition per line",
|
|
65151
65201
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65152
65202
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65153
|
-
badExample: `
|
|
65154
|
-
METHODS apps_scope_token
|
|
65155
|
-
IMPORTING
|
|
65203
|
+
badExample: `
|
|
65204
|
+
METHODS apps_scope_token
|
|
65205
|
+
IMPORTING
|
|
65156
65206
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65157
|
-
goodExample: `
|
|
65158
|
-
METHODS apps_scope_token
|
|
65159
|
-
IMPORTING
|
|
65160
|
-
body TYPE bodyapps_scope_token
|
|
65207
|
+
goodExample: `
|
|
65208
|
+
METHODS apps_scope_token
|
|
65209
|
+
IMPORTING
|
|
65210
|
+
body TYPE bodyapps_scope_token
|
|
65161
65211
|
client_id TYPE str.`,
|
|
65162
65212
|
};
|
|
65163
65213
|
}
|
|
@@ -65222,11 +65272,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65222
65272
|
key: "max_one_statement",
|
|
65223
65273
|
title: "Max one statement per line",
|
|
65224
65274
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65225
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65226
|
-
|
|
65227
|
-
Does not report anything for chained statements.
|
|
65228
|
-
|
|
65229
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65275
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65276
|
+
|
|
65277
|
+
Does not report anything for chained statements.
|
|
65278
|
+
|
|
65279
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65230
65280
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65231
65281
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65232
65282
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -65564,8 +65614,8 @@ class MethodLength {
|
|
|
65564
65614
|
key: "method_length",
|
|
65565
65615
|
title: "Method/Form Length",
|
|
65566
65616
|
shortDescription: `Checks relating to method/form length.`,
|
|
65567
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
65568
|
-
|
|
65617
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
65618
|
+
|
|
65569
65619
|
Abstract methods without statements are considered okay.`,
|
|
65570
65620
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65571
65621
|
};
|
|
@@ -65670,20 +65720,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
65670
65720
|
key: "method_overwrites_builtin",
|
|
65671
65721
|
title: "Method name overwrites builtin function",
|
|
65672
65722
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
65673
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
65674
|
-
|
|
65675
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
65676
|
-
|
|
65723
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
65724
|
+
|
|
65725
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
65726
|
+
|
|
65677
65727
|
Interface method names are ignored`,
|
|
65678
65728
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65679
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65680
|
-
PUBLIC SECTION.
|
|
65681
|
-
METHODS matches.
|
|
65682
|
-
ENDCLASS.
|
|
65683
|
-
|
|
65684
|
-
CLASS lcl IMPLEMENTATION.
|
|
65685
|
-
METHOD matches.
|
|
65686
|
-
ENDMETHOD.
|
|
65729
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65730
|
+
PUBLIC SECTION.
|
|
65731
|
+
METHODS matches.
|
|
65732
|
+
ENDCLASS.
|
|
65733
|
+
|
|
65734
|
+
CLASS lcl IMPLEMENTATION.
|
|
65735
|
+
METHOD matches.
|
|
65736
|
+
ENDMETHOD.
|
|
65687
65737
|
ENDCLASS.`,
|
|
65688
65738
|
};
|
|
65689
65739
|
}
|
|
@@ -65874,12 +65924,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
65874
65924
|
// eslint-disable-next-line max-len
|
|
65875
65925
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
65876
65926
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65877
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65878
|
-
PUBLIC SECTION.
|
|
65879
|
-
METHODS
|
|
65880
|
-
foobar
|
|
65881
|
-
EXPORTING foo TYPE i
|
|
65882
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
65927
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65928
|
+
PUBLIC SECTION.
|
|
65929
|
+
METHODS
|
|
65930
|
+
foobar
|
|
65931
|
+
EXPORTING foo TYPE i
|
|
65932
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
65883
65933
|
ENDCLASS.`,
|
|
65884
65934
|
};
|
|
65885
65935
|
}
|
|
@@ -66259,7 +66309,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66259
66309
|
key: "nesting",
|
|
66260
66310
|
title: "Check nesting depth",
|
|
66261
66311
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66262
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66312
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66263
66313
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66264
66314
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66265
66315
|
};
|
|
@@ -66502,7 +66552,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
66502
66552
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
66503
66553
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66504
66554
|
badExample: `var1 = var2 = var3.`,
|
|
66505
|
-
goodExample: `var2 = var3.
|
|
66555
|
+
goodExample: `var2 = var3.
|
|
66506
66556
|
var1 = var2.`,
|
|
66507
66557
|
};
|
|
66508
66558
|
}
|
|
@@ -66561,8 +66611,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
66561
66611
|
key: "no_external_form_calls",
|
|
66562
66612
|
title: "No external FORM calls",
|
|
66563
66613
|
shortDescription: `Detect external form calls`,
|
|
66564
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
66565
|
-
|
|
66614
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
66615
|
+
|
|
66566
66616
|
PERFORM foo(bar).`,
|
|
66567
66617
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66568
66618
|
};
|
|
@@ -66623,17 +66673,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
66623
66673
|
key: "no_inline_in_optional_branches",
|
|
66624
66674
|
title: "Don't declare inline in optional branches",
|
|
66625
66675
|
shortDescription: `Don't declare inline in optional branches`,
|
|
66626
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
66627
|
-
|
|
66628
|
-
Considered optional branches:
|
|
66629
|
-
* inside IF/ELSEIF/ELSE
|
|
66630
|
-
* inside LOOP
|
|
66631
|
-
* inside WHILE
|
|
66632
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
66633
|
-
* inside DO
|
|
66634
|
-
* inside SELECT loops
|
|
66635
|
-
|
|
66636
|
-
Not considered optional branches:
|
|
66676
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
66677
|
+
|
|
66678
|
+
Considered optional branches:
|
|
66679
|
+
* inside IF/ELSEIF/ELSE
|
|
66680
|
+
* inside LOOP
|
|
66681
|
+
* inside WHILE
|
|
66682
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
66683
|
+
* inside DO
|
|
66684
|
+
* inside SELECT loops
|
|
66685
|
+
|
|
66686
|
+
Not considered optional branches:
|
|
66637
66687
|
* TRY/CATCH/CLEANUP`,
|
|
66638
66688
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66639
66689
|
};
|
|
@@ -66733,12 +66783,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
66733
66783
|
key: "no_prefixes",
|
|
66734
66784
|
title: "No Prefixes",
|
|
66735
66785
|
shortDescription: `Dont use hungarian notation`,
|
|
66736
|
-
extendedInformation: `
|
|
66737
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
66738
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
66739
|
-
|
|
66740
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66741
|
-
|
|
66786
|
+
extendedInformation: `
|
|
66787
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
66788
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
66789
|
+
|
|
66790
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66791
|
+
|
|
66742
66792
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
66743
66793
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66744
66794
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -66917,7 +66967,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
66917
66967
|
return {
|
|
66918
66968
|
key: "no_public_attributes",
|
|
66919
66969
|
title: "No public attributes",
|
|
66920
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66970
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66921
66971
|
Exceptions are excluded from this rule.`,
|
|
66922
66972
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
66923
66973
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67018,13 +67068,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67018
67068
|
key: "no_yoda_conditions",
|
|
67019
67069
|
title: "No Yoda conditions",
|
|
67020
67070
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67021
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67022
|
-
|
|
67071
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67072
|
+
|
|
67023
67073
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67024
67074
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67025
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67075
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67026
67076
|
ENDIF.`,
|
|
67027
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67077
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67028
67078
|
ENDIF.`,
|
|
67029
67079
|
};
|
|
67030
67080
|
}
|
|
@@ -67125,8 +67175,8 @@ class NROBConsistency {
|
|
|
67125
67175
|
key: "nrob_consistency",
|
|
67126
67176
|
title: "Number range consistency",
|
|
67127
67177
|
shortDescription: `Consistency checks for number ranges`,
|
|
67128
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67129
|
-
|
|
67178
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67179
|
+
|
|
67130
67180
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67131
67181
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67132
67182
|
};
|
|
@@ -67403,58 +67453,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
67403
67453
|
title: "Obsolete statements",
|
|
67404
67454
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
67405
67455
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67406
|
-
extendedInformation: `
|
|
67407
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67408
|
-
|
|
67409
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67410
|
-
|
|
67411
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67412
|
-
|
|
67413
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67414
|
-
|
|
67415
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67416
|
-
|
|
67417
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67418
|
-
|
|
67419
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67420
|
-
|
|
67421
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67422
|
-
|
|
67423
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
67424
|
-
|
|
67425
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
67426
|
-
|
|
67427
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
67428
|
-
|
|
67429
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
67430
|
-
|
|
67431
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
67432
|
-
|
|
67433
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
67434
|
-
|
|
67435
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
67436
|
-
SELECT COUNT(*) is considered okay
|
|
67437
|
-
|
|
67438
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
67439
|
-
|
|
67440
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
67441
|
-
|
|
67442
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
67443
|
-
|
|
67444
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
67445
|
-
|
|
67446
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
67447
|
-
|
|
67456
|
+
extendedInformation: `
|
|
67457
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67458
|
+
|
|
67459
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67460
|
+
|
|
67461
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67462
|
+
|
|
67463
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67464
|
+
|
|
67465
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67466
|
+
|
|
67467
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67468
|
+
|
|
67469
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67470
|
+
|
|
67471
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67472
|
+
|
|
67473
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
67474
|
+
|
|
67475
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
67476
|
+
|
|
67477
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
67478
|
+
|
|
67479
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
67480
|
+
|
|
67481
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
67482
|
+
|
|
67483
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
67484
|
+
|
|
67485
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
67486
|
+
SELECT COUNT(*) is considered okay
|
|
67487
|
+
|
|
67488
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
67489
|
+
|
|
67490
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
67491
|
+
|
|
67492
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
67493
|
+
|
|
67494
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
67495
|
+
|
|
67496
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
67497
|
+
|
|
67448
67498
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
67449
|
-
badExample: `REFRESH itab.
|
|
67450
|
-
|
|
67451
|
-
COMPUTE foo = 2 + 2.
|
|
67452
|
-
|
|
67453
|
-
MULTIPLY lv_foo BY 2.
|
|
67454
|
-
|
|
67455
|
-
INTERFACE intf LOAD.
|
|
67456
|
-
|
|
67457
|
-
IF foo IS SUPPLIED.
|
|
67499
|
+
badExample: `REFRESH itab.
|
|
67500
|
+
|
|
67501
|
+
COMPUTE foo = 2 + 2.
|
|
67502
|
+
|
|
67503
|
+
MULTIPLY lv_foo BY 2.
|
|
67504
|
+
|
|
67505
|
+
INTERFACE intf LOAD.
|
|
67506
|
+
|
|
67507
|
+
IF foo IS SUPPLIED.
|
|
67458
67508
|
ENDIF.`,
|
|
67459
67509
|
};
|
|
67460
67510
|
}
|
|
@@ -67794,9 +67844,9 @@ class OmitParameterName {
|
|
|
67794
67844
|
key: "omit_parameter_name",
|
|
67795
67845
|
title: "Omit parameter name",
|
|
67796
67846
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
67797
|
-
extendedInformation: `
|
|
67798
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67799
|
-
|
|
67847
|
+
extendedInformation: `
|
|
67848
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67849
|
+
|
|
67800
67850
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
67801
67851
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67802
67852
|
badExample: `method( param = 2 ).`,
|
|
@@ -68002,20 +68052,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68002
68052
|
shortDescription: `Omit RECEIVING`,
|
|
68003
68053
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68004
68054
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68005
|
-
badExample: `
|
|
68006
|
-
upload_pack(
|
|
68007
|
-
EXPORTING
|
|
68008
|
-
io_client = lo_client
|
|
68009
|
-
iv_url = iv_url
|
|
68010
|
-
iv_deepen_level = iv_deepen_level
|
|
68011
|
-
it_hashes = lt_hashes
|
|
68012
|
-
RECEIVING
|
|
68055
|
+
badExample: `
|
|
68056
|
+
upload_pack(
|
|
68057
|
+
EXPORTING
|
|
68058
|
+
io_client = lo_client
|
|
68059
|
+
iv_url = iv_url
|
|
68060
|
+
iv_deepen_level = iv_deepen_level
|
|
68061
|
+
it_hashes = lt_hashes
|
|
68062
|
+
RECEIVING
|
|
68013
68063
|
rt_objects = et_objects ).`,
|
|
68014
|
-
goodExample: `
|
|
68015
|
-
et_objects = upload_pack(
|
|
68016
|
-
io_client = lo_client
|
|
68017
|
-
iv_url = iv_url
|
|
68018
|
-
iv_deepen_level = iv_deepen_level
|
|
68064
|
+
goodExample: `
|
|
68065
|
+
et_objects = upload_pack(
|
|
68066
|
+
io_client = lo_client
|
|
68067
|
+
iv_url = iv_url
|
|
68068
|
+
iv_deepen_level = iv_deepen_level
|
|
68019
68069
|
it_hashes = lt_hashes ).`,
|
|
68020
68070
|
};
|
|
68021
68071
|
}
|
|
@@ -68079,8 +68129,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68079
68129
|
return {
|
|
68080
68130
|
key: "parser_702_chaining",
|
|
68081
68131
|
title: "Parser Error, bad chanining on 702",
|
|
68082
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68083
|
-
this rule finds these and reports errors.
|
|
68132
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68133
|
+
this rule finds these and reports errors.
|
|
68084
68134
|
Only active on target version 702 and below.`,
|
|
68085
68135
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68086
68136
|
};
|
|
@@ -68160,8 +68210,8 @@ class ParserError {
|
|
|
68160
68210
|
return {
|
|
68161
68211
|
key: "parser_error",
|
|
68162
68212
|
title: "Parser error",
|
|
68163
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68164
|
-
|
|
68213
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68214
|
+
|
|
68165
68215
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68166
68216
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68167
68217
|
};
|
|
@@ -68246,7 +68296,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68246
68296
|
return {
|
|
68247
68297
|
key: "parser_missing_space",
|
|
68248
68298
|
title: "Parser Error, missing space",
|
|
68249
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68299
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68250
68300
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68251
68301
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68252
68302
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -68658,25 +68708,25 @@ class PreferInline {
|
|
|
68658
68708
|
key: "prefer_inline",
|
|
68659
68709
|
title: "Prefer Inline Declarations",
|
|
68660
68710
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
68661
|
-
extendedInformation: `EXPERIMENTAL
|
|
68662
|
-
|
|
68663
|
-
Activates if language version is v740sp02 or above.
|
|
68664
|
-
|
|
68665
|
-
Variables must be local(METHOD or FORM).
|
|
68666
|
-
|
|
68667
|
-
No generic or void typed variables. No syntax errors.
|
|
68668
|
-
|
|
68669
|
-
First position used must be a full/pure write.
|
|
68670
|
-
|
|
68671
|
-
Move statment is not a cast(?=)
|
|
68672
|
-
|
|
68711
|
+
extendedInformation: `EXPERIMENTAL
|
|
68712
|
+
|
|
68713
|
+
Activates if language version is v740sp02 or above.
|
|
68714
|
+
|
|
68715
|
+
Variables must be local(METHOD or FORM).
|
|
68716
|
+
|
|
68717
|
+
No generic or void typed variables. No syntax errors.
|
|
68718
|
+
|
|
68719
|
+
First position used must be a full/pure write.
|
|
68720
|
+
|
|
68721
|
+
Move statment is not a cast(?=)
|
|
68722
|
+
|
|
68673
68723
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
68674
68724
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
68675
|
-
badExample: `DATA foo TYPE i.
|
|
68676
|
-
foo = 2.
|
|
68677
|
-
DATA percentage TYPE decfloat34.
|
|
68725
|
+
badExample: `DATA foo TYPE i.
|
|
68726
|
+
foo = 2.
|
|
68727
|
+
DATA percentage TYPE decfloat34.
|
|
68678
68728
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
68679
|
-
goodExample: `DATA(foo) = 2.
|
|
68729
|
+
goodExample: `DATA(foo) = 2.
|
|
68680
68730
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
68681
68731
|
};
|
|
68682
68732
|
}
|
|
@@ -68890,18 +68940,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
68890
68940
|
key: "prefer_is_not",
|
|
68891
68941
|
title: "Prefer IS NOT to NOT IS",
|
|
68892
68942
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
68893
|
-
extendedInformation: `
|
|
68894
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68895
|
-
|
|
68943
|
+
extendedInformation: `
|
|
68944
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68945
|
+
|
|
68896
68946
|
"if not is_valid( )." examples are skipped`,
|
|
68897
68947
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68898
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
68899
|
-
IF variable NP 'TODO*'.
|
|
68900
|
-
IF variable <> 42.
|
|
68948
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
68949
|
+
IF variable NP 'TODO*'.
|
|
68950
|
+
IF variable <> 42.
|
|
68901
68951
|
IF variable CO 'hello'.`,
|
|
68902
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
68903
|
-
IF NOT variable CP 'TODO*'.
|
|
68904
|
-
IF NOT variable = 42.
|
|
68952
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
68953
|
+
IF NOT variable CP 'TODO*'.
|
|
68954
|
+
IF NOT variable = 42.
|
|
68905
68955
|
IF NOT variable CA 'hello'.`,
|
|
68906
68956
|
};
|
|
68907
68957
|
}
|
|
@@ -69089,14 +69139,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69089
69139
|
key: "prefer_raise_exception_new",
|
|
69090
69140
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69091
69141
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69092
|
-
extendedInformation: `
|
|
69093
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69094
|
-
|
|
69142
|
+
extendedInformation: `
|
|
69143
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69144
|
+
|
|
69095
69145
|
From 752 and up`,
|
|
69096
69146
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69097
69147
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69098
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69099
|
-
EXPORTING
|
|
69148
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69149
|
+
EXPORTING
|
|
69100
69150
|
previous = exception.`,
|
|
69101
69151
|
};
|
|
69102
69152
|
}
|
|
@@ -69174,12 +69224,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69174
69224
|
key: "prefer_returning_to_exporting",
|
|
69175
69225
|
title: "Prefer RETURNING to EXPORTING",
|
|
69176
69226
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69177
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69227
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69178
69228
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69179
69229
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69180
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69181
|
-
PUBLIC SECTION.
|
|
69182
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69230
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69231
|
+
PUBLIC SECTION.
|
|
69232
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69183
69233
|
ENDCLASS.`,
|
|
69184
69234
|
};
|
|
69185
69235
|
}
|
|
@@ -69275,8 +69325,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69275
69325
|
key: "prefer_xsdbool",
|
|
69276
69326
|
title: "Prefer xsdbool over boolc",
|
|
69277
69327
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69278
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69279
|
-
|
|
69328
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69329
|
+
|
|
69280
69330
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69281
69331
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69282
69332
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69348,9 +69398,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69348
69398
|
title: "Preferred compare operator",
|
|
69349
69399
|
shortDescription: `Configure undesired operator variants`,
|
|
69350
69400
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69351
|
-
badExample: `IF foo EQ bar.
|
|
69401
|
+
badExample: `IF foo EQ bar.
|
|
69352
69402
|
ENDIF.`,
|
|
69353
|
-
goodExample: `IF foo = bar.
|
|
69403
|
+
goodExample: `IF foo = bar.
|
|
69354
69404
|
ENDIF.`,
|
|
69355
69405
|
};
|
|
69356
69406
|
}
|
|
@@ -69574,26 +69624,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
69574
69624
|
key: "reduce_procedural_code",
|
|
69575
69625
|
title: "Reduce procedural code",
|
|
69576
69626
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
69577
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
69578
|
-
|
|
69579
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
69580
|
-
|
|
69627
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
69628
|
+
|
|
69629
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
69630
|
+
|
|
69581
69631
|
Comments are not counted as statements.`,
|
|
69582
69632
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
69583
|
-
badExample: `FORM foo.
|
|
69584
|
-
DATA lv_bar TYPE i.
|
|
69585
|
-
lv_bar = 2 + 2.
|
|
69586
|
-
IF lv_bar = 4.
|
|
69587
|
-
WRITE 'hello world'.
|
|
69588
|
-
ENDIF.
|
|
69589
|
-
DATA lv_bar TYPE i.
|
|
69590
|
-
lv_bar = 2 + 2.
|
|
69591
|
-
IF lv_bar = 4.
|
|
69592
|
-
WRITE 'hello world'.
|
|
69593
|
-
ENDIF.
|
|
69633
|
+
badExample: `FORM foo.
|
|
69634
|
+
DATA lv_bar TYPE i.
|
|
69635
|
+
lv_bar = 2 + 2.
|
|
69636
|
+
IF lv_bar = 4.
|
|
69637
|
+
WRITE 'hello world'.
|
|
69638
|
+
ENDIF.
|
|
69639
|
+
DATA lv_bar TYPE i.
|
|
69640
|
+
lv_bar = 2 + 2.
|
|
69641
|
+
IF lv_bar = 4.
|
|
69642
|
+
WRITE 'hello world'.
|
|
69643
|
+
ENDIF.
|
|
69594
69644
|
ENDFORM.`,
|
|
69595
|
-
goodExample: `FORM foo.
|
|
69596
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
69645
|
+
goodExample: `FORM foo.
|
|
69646
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
69597
69647
|
ENDFORM.`,
|
|
69598
69648
|
};
|
|
69599
69649
|
}
|
|
@@ -69837,10 +69887,10 @@ class RemoveDescriptions {
|
|
|
69837
69887
|
return {
|
|
69838
69888
|
key: "remove_descriptions",
|
|
69839
69889
|
title: "Remove descriptions",
|
|
69840
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69841
|
-
|
|
69842
|
-
Class descriptions are required, see rule description_empty.
|
|
69843
|
-
|
|
69890
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69891
|
+
|
|
69892
|
+
Class descriptions are required, see rule description_empty.
|
|
69893
|
+
|
|
69844
69894
|
Consider using ABAP Doc for documentation.`,
|
|
69845
69895
|
tags: [],
|
|
69846
69896
|
};
|
|
@@ -69965,14 +70015,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
69965
70015
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69966
70016
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
69967
70017
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
69968
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70018
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
69969
70019
|
DESTINATION lv_rfc.`,
|
|
69970
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69971
|
-
DESTINATION lv_rfc
|
|
69972
|
-
EXCEPTIONS
|
|
69973
|
-
system_failure = 1 MESSAGE msg
|
|
69974
|
-
communication_failure = 2 MESSAGE msg
|
|
69975
|
-
resource_failure = 3
|
|
70020
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70021
|
+
DESTINATION lv_rfc
|
|
70022
|
+
EXCEPTIONS
|
|
70023
|
+
system_failure = 1 MESSAGE msg
|
|
70024
|
+
communication_failure = 2 MESSAGE msg
|
|
70025
|
+
resource_failure = 3
|
|
69976
70026
|
OTHERS = 4.`,
|
|
69977
70027
|
};
|
|
69978
70028
|
}
|
|
@@ -70056,11 +70106,11 @@ class SelectAddOrderBy {
|
|
|
70056
70106
|
key: "select_add_order_by",
|
|
70057
70107
|
title: "SELECT add ORDER BY",
|
|
70058
70108
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70059
|
-
extendedInformation: `
|
|
70060
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70061
|
-
|
|
70062
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70063
|
-
|
|
70109
|
+
extendedInformation: `
|
|
70110
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70111
|
+
|
|
70112
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70113
|
+
|
|
70064
70114
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70065
70115
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70066
70116
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70191,14 +70241,14 @@ class SelectPerformance {
|
|
|
70191
70241
|
key: "select_performance",
|
|
70192
70242
|
title: "SELECT performance",
|
|
70193
70243
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70194
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70195
|
-
|
|
70244
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70245
|
+
|
|
70196
70246
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70197
70247
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70198
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70199
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70248
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70249
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70200
70250
|
ENDSELECT.`,
|
|
70201
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70251
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70202
70252
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70203
70253
|
};
|
|
70204
70254
|
}
|
|
@@ -70312,8 +70362,8 @@ class SelectSingleFullKey {
|
|
|
70312
70362
|
key: "select_single_full_key",
|
|
70313
70363
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70314
70364
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70315
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70316
|
-
|
|
70365
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70366
|
+
|
|
70317
70367
|
If the statement contains a JOIN it is not checked`,
|
|
70318
70368
|
pseudoComment: "EC CI_NOORDER",
|
|
70319
70369
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -70737,8 +70787,8 @@ class SICFConsistency {
|
|
|
70737
70787
|
key: "sicf_consistency",
|
|
70738
70788
|
title: "SICF consistency",
|
|
70739
70789
|
shortDescription: `Checks the validity of ICF services`,
|
|
70740
|
-
extendedInformation: `* Class defined in handler must exist
|
|
70741
|
-
* Class must not have any syntax errors
|
|
70790
|
+
extendedInformation: `* Class defined in handler must exist
|
|
70791
|
+
* Class must not have any syntax errors
|
|
70742
70792
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
70743
70793
|
};
|
|
70744
70794
|
}
|
|
@@ -70850,23 +70900,23 @@ class SlowParameterPassing {
|
|
|
70850
70900
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
70851
70901
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
70852
70902
|
tags: [_irule_1.RuleTag.Performance],
|
|
70853
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70854
|
-
PUBLIC SECTION.
|
|
70855
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70856
|
-
ENDCLASS.
|
|
70857
|
-
CLASS lcl IMPLEMENTATION.
|
|
70858
|
-
METHOD bar.
|
|
70859
|
-
WRITE sdf.
|
|
70860
|
-
ENDMETHOD.
|
|
70903
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70904
|
+
PUBLIC SECTION.
|
|
70905
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70906
|
+
ENDCLASS.
|
|
70907
|
+
CLASS lcl IMPLEMENTATION.
|
|
70908
|
+
METHOD bar.
|
|
70909
|
+
WRITE sdf.
|
|
70910
|
+
ENDMETHOD.
|
|
70861
70911
|
ENDCLASS.`,
|
|
70862
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
70863
|
-
PUBLIC SECTION.
|
|
70864
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
70865
|
-
ENDCLASS.
|
|
70866
|
-
CLASS lcl IMPLEMENTATION.
|
|
70867
|
-
METHOD bar.
|
|
70868
|
-
WRITE sdf.
|
|
70869
|
-
ENDMETHOD.
|
|
70912
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
70913
|
+
PUBLIC SECTION.
|
|
70914
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
70915
|
+
ENDCLASS.
|
|
70916
|
+
CLASS lcl IMPLEMENTATION.
|
|
70917
|
+
METHOD bar.
|
|
70918
|
+
WRITE sdf.
|
|
70919
|
+
ENDMETHOD.
|
|
70870
70920
|
ENDCLASS.`,
|
|
70871
70921
|
};
|
|
70872
70922
|
}
|
|
@@ -71123,8 +71173,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71123
71173
|
key: "space_before_dot",
|
|
71124
71174
|
title: "Space before dot",
|
|
71125
71175
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71126
|
-
extendedInformation: `
|
|
71127
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71176
|
+
extendedInformation: `
|
|
71177
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71128
71178
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71129
71179
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71130
71180
|
badExample: `WRITE bar .`,
|
|
@@ -71310,12 +71360,12 @@ class SQLValueConversion {
|
|
|
71310
71360
|
key: "sql_value_conversion",
|
|
71311
71361
|
title: "Implicit SQL Value Conversion",
|
|
71312
71362
|
shortDescription: `Ensure types match when selecting from database`,
|
|
71313
|
-
extendedInformation: `
|
|
71314
|
-
* Integer to CHAR conversion
|
|
71315
|
-
* Integer to NUMC conversion
|
|
71316
|
-
* NUMC to Integer conversion
|
|
71317
|
-
* CHAR to Integer conversion
|
|
71318
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
71363
|
+
extendedInformation: `
|
|
71364
|
+
* Integer to CHAR conversion
|
|
71365
|
+
* Integer to NUMC conversion
|
|
71366
|
+
* NUMC to Integer conversion
|
|
71367
|
+
* CHAR to Integer conversion
|
|
71368
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71319
71369
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71320
71370
|
tags: [],
|
|
71321
71371
|
};
|
|
@@ -71387,7 +71437,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
71387
71437
|
key: "start_at_tab",
|
|
71388
71438
|
title: "Start at tab",
|
|
71389
71439
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
71390
|
-
extendedInformation: `Reports max 100 issues per file
|
|
71440
|
+
extendedInformation: `Reports max 100 issues per file
|
|
71391
71441
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
71392
71442
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71393
71443
|
badExample: ` WRITE a.`,
|
|
@@ -71564,12 +71614,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
71564
71614
|
key: "strict_sql",
|
|
71565
71615
|
title: "Strict SQL",
|
|
71566
71616
|
shortDescription: `Strict SQL`,
|
|
71567
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
71568
|
-
|
|
71569
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
71570
|
-
|
|
71571
|
-
Also see separate rule sql_escape_host_variables
|
|
71572
|
-
|
|
71617
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
71618
|
+
|
|
71619
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
71620
|
+
|
|
71621
|
+
Also see separate rule sql_escape_host_variables
|
|
71622
|
+
|
|
71573
71623
|
Activates from v750 and up`,
|
|
71574
71624
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
71575
71625
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -71823,11 +71873,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
71823
71873
|
key: "sy_modification",
|
|
71824
71874
|
title: "Modification of SY fields",
|
|
71825
71875
|
shortDescription: `Finds modification of sy fields`,
|
|
71826
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71827
|
-
|
|
71876
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71877
|
+
|
|
71828
71878
|
Changes to SY-TVAR* fields are not reported`,
|
|
71829
71879
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71830
|
-
badExample: `sy-uname = 2.
|
|
71880
|
+
badExample: `sy-uname = 2.
|
|
71831
71881
|
sy = sy.`,
|
|
71832
71882
|
};
|
|
71833
71883
|
}
|
|
@@ -71889,8 +71939,8 @@ class TABLEnhancementCategory {
|
|
|
71889
71939
|
key: "tabl_enhancement_category",
|
|
71890
71940
|
title: "TABL enhancement category must be set",
|
|
71891
71941
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
71892
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71893
|
-
|
|
71942
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71943
|
+
|
|
71894
71944
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
71895
71945
|
tags: [],
|
|
71896
71946
|
};
|
|
@@ -71955,8 +72005,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
71955
72005
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
71956
72006
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
71957
72007
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71958
|
-
badExample: `FORM foo.
|
|
71959
|
-
TABLES t100.
|
|
72008
|
+
badExample: `FORM foo.
|
|
72009
|
+
TABLES t100.
|
|
71960
72010
|
ENDFORM.`,
|
|
71961
72011
|
goodExample: `TABLES t000.`,
|
|
71962
72012
|
};
|
|
@@ -72084,9 +72134,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72084
72134
|
title: "Type FORM parameters",
|
|
72085
72135
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72086
72136
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72087
|
-
badExample: `FORM foo USING bar.
|
|
72137
|
+
badExample: `FORM foo USING bar.
|
|
72088
72138
|
ENDFORM.`,
|
|
72089
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72139
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72090
72140
|
ENDFORM.`,
|
|
72091
72141
|
};
|
|
72092
72142
|
}
|
|
@@ -72759,38 +72809,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
72759
72809
|
key: "unnecessary_pragma",
|
|
72760
72810
|
title: "Unnecessary Pragma",
|
|
72761
72811
|
shortDescription: `Finds pragmas which can be removed`,
|
|
72762
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
72763
|
-
|
|
72764
|
-
* NEEDED without definition
|
|
72765
|
-
|
|
72766
|
-
* NO_TEXT without texts
|
|
72767
|
-
|
|
72768
|
-
* SUBRC_OK where sy-subrc is checked
|
|
72769
|
-
|
|
72812
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
72813
|
+
|
|
72814
|
+
* NEEDED without definition
|
|
72815
|
+
|
|
72816
|
+
* NO_TEXT without texts
|
|
72817
|
+
|
|
72818
|
+
* SUBRC_OK where sy-subrc is checked
|
|
72819
|
+
|
|
72770
72820
|
NO_HANDLER inside macros are not checked`,
|
|
72771
72821
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72772
|
-
badExample: `TRY.
|
|
72773
|
-
...
|
|
72774
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
72775
|
-
RETURN. " it has a handler
|
|
72776
|
-
ENDTRY.
|
|
72777
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
72778
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
72779
|
-
IF sy-subrc <> 0.
|
|
72822
|
+
badExample: `TRY.
|
|
72823
|
+
...
|
|
72824
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
72825
|
+
RETURN. " it has a handler
|
|
72826
|
+
ENDTRY.
|
|
72827
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
72828
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
72829
|
+
IF sy-subrc <> 0.
|
|
72780
72830
|
ENDIF.`,
|
|
72781
|
-
goodExample: `TRY.
|
|
72782
|
-
...
|
|
72783
|
-
CATCH zcx_abapgit_exception.
|
|
72784
|
-
RETURN.
|
|
72785
|
-
ENDTRY.
|
|
72786
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
72787
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
72788
|
-
IF sy-subrc <> 0.
|
|
72789
|
-
ENDIF.
|
|
72790
|
-
|
|
72791
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
72792
|
-
test1 TYPE string,
|
|
72793
|
-
test2 TYPE string,
|
|
72831
|
+
goodExample: `TRY.
|
|
72832
|
+
...
|
|
72833
|
+
CATCH zcx_abapgit_exception.
|
|
72834
|
+
RETURN.
|
|
72835
|
+
ENDTRY.
|
|
72836
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
72837
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
72838
|
+
IF sy-subrc <> 0.
|
|
72839
|
+
ENDIF.
|
|
72840
|
+
|
|
72841
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
72842
|
+
test1 TYPE string,
|
|
72843
|
+
test2 TYPE string,
|
|
72794
72844
|
END OF blah.`,
|
|
72795
72845
|
};
|
|
72796
72846
|
}
|
|
@@ -72957,18 +73007,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
72957
73007
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
72958
73008
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
72959
73009
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
72960
|
-
badExample: `FORM hello1.
|
|
72961
|
-
WRITE 'world'.
|
|
72962
|
-
RETURN.
|
|
72963
|
-
ENDFORM.
|
|
72964
|
-
|
|
72965
|
-
FORM foo.
|
|
72966
|
-
IF 1 = 2.
|
|
72967
|
-
RETURN.
|
|
72968
|
-
ENDIF.
|
|
73010
|
+
badExample: `FORM hello1.
|
|
73011
|
+
WRITE 'world'.
|
|
73012
|
+
RETURN.
|
|
73013
|
+
ENDFORM.
|
|
73014
|
+
|
|
73015
|
+
FORM foo.
|
|
73016
|
+
IF 1 = 2.
|
|
73017
|
+
RETURN.
|
|
73018
|
+
ENDIF.
|
|
72969
73019
|
ENDFORM.`,
|
|
72970
|
-
goodExample: `FORM hello2.
|
|
72971
|
-
WRITE 'world'.
|
|
73020
|
+
goodExample: `FORM hello2.
|
|
73021
|
+
WRITE 'world'.
|
|
72972
73022
|
ENDFORM.`,
|
|
72973
73023
|
};
|
|
72974
73024
|
}
|
|
@@ -73319,13 +73369,13 @@ class UnusedMacros {
|
|
|
73319
73369
|
title: "Unused macros",
|
|
73320
73370
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73321
73371
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73322
|
-
badExample: `DEFINE foobar1.
|
|
73323
|
-
WRITE 'hello'.
|
|
73372
|
+
badExample: `DEFINE foobar1.
|
|
73373
|
+
WRITE 'hello'.
|
|
73324
73374
|
END-OF-DEFINITION.`,
|
|
73325
|
-
goodExample: `DEFINE foobar2.
|
|
73326
|
-
WRITE 'hello'.
|
|
73327
|
-
END-OF-DEFINITION.
|
|
73328
|
-
|
|
73375
|
+
goodExample: `DEFINE foobar2.
|
|
73376
|
+
WRITE 'hello'.
|
|
73377
|
+
END-OF-DEFINITION.
|
|
73378
|
+
|
|
73329
73379
|
foobar2.`,
|
|
73330
73380
|
};
|
|
73331
73381
|
}
|
|
@@ -73433,17 +73483,17 @@ class UnusedMethods {
|
|
|
73433
73483
|
key: "unused_methods",
|
|
73434
73484
|
title: "Unused methods",
|
|
73435
73485
|
shortDescription: `Checks for unused methods`,
|
|
73436
|
-
extendedInformation: `Checks private and protected methods.
|
|
73437
|
-
|
|
73438
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
73439
|
-
|
|
73440
|
-
Skips:
|
|
73441
|
-
* methods FOR TESTING
|
|
73442
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
73443
|
-
* class_constructor + constructor methods
|
|
73444
|
-
* event handlers
|
|
73445
|
-
* methods that are redefined
|
|
73446
|
-
* INCLUDEs
|
|
73486
|
+
extendedInformation: `Checks private and protected methods.
|
|
73487
|
+
|
|
73488
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
73489
|
+
|
|
73490
|
+
Skips:
|
|
73491
|
+
* methods FOR TESTING
|
|
73492
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
73493
|
+
* class_constructor + constructor methods
|
|
73494
|
+
* event handlers
|
|
73495
|
+
* methods that are redefined
|
|
73496
|
+
* INCLUDEs
|
|
73447
73497
|
`,
|
|
73448
73498
|
tags: [],
|
|
73449
73499
|
pragma: "##CALLED",
|
|
@@ -73877,23 +73927,23 @@ class UnusedVariables {
|
|
|
73877
73927
|
key: "unused_variables",
|
|
73878
73928
|
title: "Unused variables",
|
|
73879
73929
|
shortDescription: `Checks for unused variables and constants`,
|
|
73880
|
-
extendedInformation: `Skips event parameters.
|
|
73881
|
-
|
|
73882
|
-
Note that this currently does not work if the source code uses macros.
|
|
73883
|
-
|
|
73884
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73885
|
-
|
|
73930
|
+
extendedInformation: `Skips event parameters.
|
|
73931
|
+
|
|
73932
|
+
Note that this currently does not work if the source code uses macros.
|
|
73933
|
+
|
|
73934
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73935
|
+
|
|
73886
73936
|
Errors found in INCLUDES are reported for the main program.`,
|
|
73887
73937
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73888
73938
|
pragma: "##NEEDED",
|
|
73889
73939
|
pseudoComment: "EC NEEDED",
|
|
73890
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
73891
|
-
test TYPE string,
|
|
73892
|
-
test2 TYPE string,
|
|
73940
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
73941
|
+
test TYPE string,
|
|
73942
|
+
test2 TYPE string,
|
|
73893
73943
|
END OF blah1.`,
|
|
73894
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73895
|
-
test TYPE string,
|
|
73896
|
-
test2 TYPE string,
|
|
73944
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73945
|
+
test TYPE string,
|
|
73946
|
+
test2 TYPE string,
|
|
73897
73947
|
END OF blah2.`,
|
|
73898
73948
|
};
|
|
73899
73949
|
}
|
|
@@ -74112,15 +74162,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74112
74162
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74113
74163
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74114
74164
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74115
|
-
badExample: `IF line IS INITIAL.
|
|
74116
|
-
has_entries = abap_false.
|
|
74117
|
-
ELSE.
|
|
74118
|
-
has_entries = abap_true.
|
|
74119
|
-
ENDIF.
|
|
74120
|
-
|
|
74165
|
+
badExample: `IF line IS INITIAL.
|
|
74166
|
+
has_entries = abap_false.
|
|
74167
|
+
ELSE.
|
|
74168
|
+
has_entries = abap_true.
|
|
74169
|
+
ENDIF.
|
|
74170
|
+
|
|
74121
74171
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74122
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74123
|
-
|
|
74172
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74173
|
+
|
|
74124
74174
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74125
74175
|
};
|
|
74126
74176
|
}
|
|
@@ -74238,15 +74288,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74238
74288
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74239
74289
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74240
74290
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74241
|
-
badExample: `INTERFACE lif.
|
|
74242
|
-
METHODS load_data
|
|
74243
|
-
EXCEPTIONS
|
|
74244
|
-
invalid_parameter.
|
|
74291
|
+
badExample: `INTERFACE lif.
|
|
74292
|
+
METHODS load_data
|
|
74293
|
+
EXCEPTIONS
|
|
74294
|
+
invalid_parameter.
|
|
74245
74295
|
ENDINTERFACE.`,
|
|
74246
|
-
goodExample: `INTERFACE lif.
|
|
74247
|
-
METHODS load_data
|
|
74248
|
-
RAISING
|
|
74249
|
-
cx_something.
|
|
74296
|
+
goodExample: `INTERFACE lif.
|
|
74297
|
+
METHODS load_data
|
|
74298
|
+
RAISING
|
|
74299
|
+
cx_something.
|
|
74250
74300
|
ENDINTERFACE.`,
|
|
74251
74301
|
};
|
|
74252
74302
|
}
|
|
@@ -74306,15 +74356,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74306
74356
|
key: "use_line_exists",
|
|
74307
74357
|
title: "Use line_exists",
|
|
74308
74358
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
74309
|
-
extendedInformation: `
|
|
74310
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74311
|
-
|
|
74359
|
+
extendedInformation: `
|
|
74360
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74361
|
+
|
|
74312
74362
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
74313
74363
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74314
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74315
|
-
IF sy-subrc = 0.
|
|
74364
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74365
|
+
IF sy-subrc = 0.
|
|
74316
74366
|
ENDIF.`,
|
|
74317
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74367
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74318
74368
|
ENDIF.`,
|
|
74319
74369
|
};
|
|
74320
74370
|
}
|
|
@@ -74424,10 +74474,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
74424
74474
|
key: "use_new",
|
|
74425
74475
|
title: "Use NEW",
|
|
74426
74476
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
74427
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
74428
|
-
|
|
74429
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
74430
|
-
|
|
74477
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
74478
|
+
|
|
74479
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
74480
|
+
|
|
74431
74481
|
Applicable from v740sp02 and up`,
|
|
74432
74482
|
badExample: `CREATE OBJECT ref.`,
|
|
74433
74483
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -74525,13 +74575,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
74525
74575
|
title: "WHEN OTHERS last",
|
|
74526
74576
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
74527
74577
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
74528
|
-
badExample: `CASE bar.
|
|
74529
|
-
WHEN OTHERS.
|
|
74530
|
-
WHEN 2.
|
|
74578
|
+
badExample: `CASE bar.
|
|
74579
|
+
WHEN OTHERS.
|
|
74580
|
+
WHEN 2.
|
|
74531
74581
|
ENDCASE.`,
|
|
74532
|
-
goodExample: `CASE bar.
|
|
74533
|
-
WHEN 2.
|
|
74534
|
-
WHEN OTHERS.
|
|
74582
|
+
goodExample: `CASE bar.
|
|
74583
|
+
WHEN 2.
|
|
74584
|
+
WHEN OTHERS.
|
|
74535
74585
|
ENDCASE.`,
|
|
74536
74586
|
};
|
|
74537
74587
|
}
|