@abaplint/cli 2.112.16 → 2.112.18

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.
Files changed (4) hide show
  1. package/README.md +4 -4
  2. package/abaplint +2 -2
  3. package/build/cli.js +937 -895
  4. 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
  }
@@ -20102,7 +20125,6 @@ var Visibility;
20102
20125
 
20103
20126
  Object.defineProperty(exports, "__esModule", ({ value: true }));
20104
20127
  exports.BuiltIn = exports.BuiltInMethod = void 0;
20105
- /* eslint-disable max-len */
20106
20128
  const _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
20107
20129
  const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
20108
20130
  const tokens_1 = __webpack_require__(/*! ../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
@@ -22951,7 +22973,6 @@ exports.AssertError = AssertError;
22951
22973
 
22952
22974
  Object.defineProperty(exports, "__esModule", ({ value: true }));
22953
22975
  exports.BasicTypes = void 0;
22954
- /* eslint-disable default-case */
22955
22976
  const _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
22956
22977
  const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
22957
22978
  const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
@@ -35011,7 +35032,13 @@ exports.ArtifactsABAP = ArtifactsABAP;
35011
35032
  "use strict";
35012
35033
 
35013
35034
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35014
- 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 = {}));
35015
35042
  class FlowGraph {
35016
35043
  constructor(counter) {
35017
35044
  this.edges = {};
@@ -35028,11 +35055,11 @@ class FlowGraph {
35028
35055
  getEnd() {
35029
35056
  return this.endNode;
35030
35057
  }
35031
- addEdge(from, to) {
35058
+ addEdge(from, to, type) {
35032
35059
  if (this.edges[from] === undefined) {
35033
35060
  this.edges[from] = {};
35034
35061
  }
35035
- this.edges[from][to] = true;
35062
+ this.edges[from][to] = type;
35036
35063
  }
35037
35064
  removeEdge(from, to) {
35038
35065
  if (this.edges[from] === undefined) {
@@ -35047,7 +35074,7 @@ class FlowGraph {
35047
35074
  const list = [];
35048
35075
  for (const from of Object.keys(this.edges)) {
35049
35076
  for (const to of Object.keys(this.edges[from])) {
35050
- list.push({ from, to });
35077
+ list.push({ from, to, type: this.edges[from][to] });
35051
35078
  }
35052
35079
  }
35053
35080
  return list;
@@ -35076,12 +35103,12 @@ class FlowGraph {
35076
35103
  return Object.keys(this.edges).length > 0;
35077
35104
  }
35078
35105
  /** return value: end node of to graph */
35079
- addGraph(from, to) {
35106
+ addGraph(from, to, type) {
35080
35107
  if (to.hasEdges() === false) {
35081
35108
  return from;
35082
35109
  }
35083
- this.addEdge(from, to.getStart());
35084
- 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));
35085
35112
  return to.getEnd();
35086
35113
  }
35087
35114
  toJSON() {
@@ -35090,7 +35117,8 @@ class FlowGraph {
35090
35117
  toTextEdges() {
35091
35118
  let graph = "";
35092
35119
  for (const l of this.listEdges()) {
35093
- graph += `"${l.from}" -> "${l.to}";\n`;
35120
+ const label = l.type === FLOW_EDGE_TYPE.undefined ? "" : ` [label="${l.type}"]`;
35121
+ graph += `"${l.from}" -> "${l.to}"${label};\n`;
35094
35122
  }
35095
35123
  return graph.trim();
35096
35124
  }
@@ -35098,32 +35126,32 @@ class FlowGraph {
35098
35126
  this.label = label;
35099
35127
  }
35100
35128
  toDigraph() {
35101
- return `digraph G {
35102
- labelloc="t";
35103
- label="${this.label}";
35104
- graph [fontname = "helvetica"];
35105
- node [fontname = "helvetica", shape="box"];
35106
- edge [fontname = "helvetica"];
35107
- ${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()}
35108
35136
  }`;
35109
35137
  }
35110
35138
  listSources(node) {
35111
- const set = new Set();
35139
+ const set = [];
35112
35140
  for (const l of this.listEdges()) {
35113
35141
  if (node === l.to) {
35114
- set.add(l.from);
35142
+ set.push({ name: l.from, type: l.type });
35115
35143
  }
35116
35144
  }
35117
- return Array.from(set.values());
35145
+ return set;
35118
35146
  }
35119
35147
  listTargets(node) {
35120
- const set = new Set();
35148
+ const set = [];
35121
35149
  for (const l of this.listEdges()) {
35122
35150
  if (node === l.from) {
35123
- set.add(l.to);
35151
+ set.push({ name: l.to, type: l.type });
35124
35152
  }
35125
35153
  }
35126
- return Array.from(set.values());
35154
+ return set;
35127
35155
  }
35128
35156
  /** removes all nodes containing "#" that have one in-going and one out-going edge */
35129
35157
  reduce() {
@@ -35136,20 +35164,30 @@ ${this.toTextEdges()}
35136
35164
  if (sources.length > 0 && targets.length > 0) {
35137
35165
  // hash node in the middle of the graph
35138
35166
  for (const s of sources) {
35139
- this.removeEdge(s, node);
35167
+ this.removeEdge(s.name, node);
35140
35168
  }
35141
35169
  for (const t of targets) {
35142
- this.removeEdge(node, t);
35170
+ this.removeEdge(node, t.name);
35143
35171
  }
35144
35172
  for (const s of sources) {
35145
35173
  for (const t of targets) {
35146
- this.addEdge(s, t);
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);
35147
35185
  }
35148
35186
  }
35149
35187
  }
35150
35188
  if (node.startsWith("end#") && sources.length === 0) {
35151
35189
  for (const t of targets) {
35152
- this.removeEdge(node, t);
35190
+ this.removeEdge(node, t.name);
35153
35191
  }
35154
35192
  }
35155
35193
  }
@@ -35181,22 +35219,26 @@ class StatementFlow {
35181
35219
  this.counter = 0;
35182
35220
  }
35183
35221
  build(stru) {
35184
- var _a, _b;
35222
+ var _a, _b, _c;
35185
35223
  const ret = [];
35186
- const forms = stru.findAllStructures(Structures.Form);
35187
- for (const f of forms) {
35188
- const formName = "FORM " + ((_a = f.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
35189
- this.counter = 1;
35190
- const graph = this.traverseBody(this.findBody(f), { procedureEnd: "end#1" });
35191
- graph.setLabel(formName);
35192
- ret.push(graph);
35193
- }
35194
- const methods = stru.findAllStructures(Structures.Method);
35195
- for (const f of methods) {
35196
- const methodName = "METHOD " + ((_b = f.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens());
35224
+ const structures = stru.findAllStructuresMulti([Structures.Form, Structures.Method, Structures.FunctionModule]);
35225
+ for (const s of structures) {
35226
+ let name = "";
35227
+ if (s.get() instanceof Structures.Form) {
35228
+ name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
35229
+ }
35230
+ else if (s.get() instanceof Structures.Method) {
35231
+ name = "METHOD " + ((_b = s.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens());
35232
+ }
35233
+ else if (s.get() instanceof Structures.FunctionModule) {
35234
+ name = "FUNCTION " + ((_c = s.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens());
35235
+ }
35236
+ else {
35237
+ throw new Error("StatementFlow, unknown structure");
35238
+ }
35197
35239
  this.counter = 1;
35198
- const graph = this.traverseBody(this.findBody(f), { procedureEnd: "end#1" });
35199
- graph.setLabel(methodName);
35240
+ const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
35241
+ graph.setLabel(name);
35200
35242
  ret.push(graph);
35201
35243
  }
35202
35244
  return ret.map(f => f.reduce());
@@ -35230,7 +35272,7 @@ class StatementFlow {
35230
35272
  traverseBody(children, context) {
35231
35273
  const graph = new flow_graph_1.FlowGraph(this.counter++);
35232
35274
  if (children.length === 0) {
35233
- graph.addEdge(graph.getStart(), graph.getEnd());
35275
+ graph.addEdge(graph.getStart(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35234
35276
  return graph;
35235
35277
  }
35236
35278
  let current = graph.getStart();
@@ -35239,44 +35281,44 @@ class StatementFlow {
35239
35281
  const firstChild = c.getFirstChild(); // "Normal" only has one child
35240
35282
  if (firstChild instanceof nodes_1.StatementNode) {
35241
35283
  const name = this.buildName(firstChild);
35242
- graph.addEdge(current, name);
35284
+ graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35243
35285
  current = name;
35244
35286
  if (firstChild.get() instanceof Statements.Check) {
35245
35287
  if (context.loopStart) {
35246
- graph.addEdge(name, context.loopStart);
35288
+ graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.false);
35247
35289
  }
35248
35290
  else {
35249
- graph.addEdge(name, context.procedureEnd);
35291
+ graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
35250
35292
  }
35251
35293
  }
35252
35294
  else if (firstChild.get() instanceof Statements.Assert) {
35253
- graph.addEdge(name, context.procedureEnd);
35295
+ graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.false);
35254
35296
  }
35255
35297
  else if (firstChild.get() instanceof Statements.Continue && context.loopStart) {
35256
- graph.addEdge(name, context.loopStart);
35298
+ graph.addEdge(name, context.loopStart, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35257
35299
  return graph;
35258
35300
  }
35259
35301
  else if (firstChild.get() instanceof Statements.Exit) {
35260
35302
  if (context.loopEnd) {
35261
- graph.addEdge(name, context.loopEnd);
35303
+ graph.addEdge(name, context.loopEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35262
35304
  }
35263
35305
  else {
35264
- graph.addEdge(name, context.procedureEnd);
35306
+ graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35265
35307
  }
35266
35308
  return graph;
35267
35309
  }
35268
35310
  else if (firstChild.get() instanceof Statements.Return) {
35269
- graph.addEdge(name, context.procedureEnd);
35311
+ graph.addEdge(name, context.procedureEnd, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35270
35312
  return graph;
35271
35313
  }
35272
35314
  }
35273
35315
  else if (firstChild instanceof nodes_1.StructureNode) {
35274
35316
  const sub = this.traverseStructure(firstChild, context);
35275
- current = graph.addGraph(current, sub);
35317
+ current = graph.addGraph(current, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35276
35318
  }
35277
35319
  }
35278
35320
  }
35279
- graph.addEdge(current, graph.getEnd());
35321
+ graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35280
35322
  return graph;
35281
35323
  }
35282
35324
  traverseStructure(n, context) {
@@ -35289,9 +35331,9 @@ class StatementFlow {
35289
35331
  if (type instanceof Structures.If) {
35290
35332
  const ifName = this.buildName(n.findDirectStatement(Statements.If));
35291
35333
  const sub = this.traverseBody(this.findBody(n), context);
35292
- graph.addEdge(current, ifName);
35293
- graph.addGraph(ifName, sub);
35294
- graph.addEdge(sub.getEnd(), graph.getEnd());
35334
+ graph.addEdge(current, ifName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35335
+ graph.addGraph(ifName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
35336
+ graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35295
35337
  current = ifName;
35296
35338
  for (const e of n.findDirectStructures(Structures.ElseIf)) {
35297
35339
  const elseifst = e.findDirectStatement(Statements.ElseIf);
@@ -35300,9 +35342,9 @@ class StatementFlow {
35300
35342
  }
35301
35343
  const elseIfName = this.buildName(elseifst);
35302
35344
  const sub = this.traverseBody(this.findBody(e), context);
35303
- graph.addEdge(current, elseIfName);
35304
- graph.addGraph(elseIfName, sub);
35305
- graph.addEdge(sub.getEnd(), graph.getEnd());
35345
+ graph.addEdge(current, elseIfName, flow_graph_1.FLOW_EDGE_TYPE.false);
35346
+ graph.addGraph(elseIfName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
35347
+ graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35306
35348
  current = elseIfName;
35307
35349
  }
35308
35350
  const els = n.findDirectStructure(Structures.Else);
@@ -35310,12 +35352,12 @@ class StatementFlow {
35310
35352
  if (els && elsest) {
35311
35353
  const elseName = this.buildName(elsest);
35312
35354
  const sub = this.traverseBody(this.findBody(els), context);
35313
- graph.addEdge(current, elseName);
35314
- graph.addGraph(elseName, sub);
35315
- graph.addEdge(sub.getEnd(), graph.getEnd());
35355
+ graph.addEdge(current, elseName, flow_graph_1.FLOW_EDGE_TYPE.false);
35356
+ graph.addGraph(elseName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35357
+ graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35316
35358
  }
35317
35359
  else {
35318
- graph.addEdge(ifName, graph.getEnd());
35360
+ graph.addEdge(ifName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
35319
35361
  }
35320
35362
  }
35321
35363
  else if (type instanceof Structures.Loop
@@ -35327,18 +35369,18 @@ class StatementFlow {
35327
35369
  || type instanceof Structures.Do) {
35328
35370
  const loopName = this.buildName(n.getFirstStatement());
35329
35371
  const sub = this.traverseBody(this.findBody(n), Object.assign(Object.assign({}, context), { loopStart: loopName, loopEnd: graph.getEnd() }));
35330
- graph.addEdge(current, loopName);
35331
- graph.addGraph(loopName, sub);
35332
- graph.addEdge(sub.getEnd(), loopName);
35333
- graph.addEdge(loopName, graph.getEnd());
35372
+ graph.addEdge(current, loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35373
+ graph.addGraph(loopName, sub, flow_graph_1.FLOW_EDGE_TYPE.true);
35374
+ graph.addEdge(sub.getEnd(), loopName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35375
+ graph.addEdge(loopName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
35334
35376
  }
35335
35377
  else if (type instanceof Structures.Data
35336
35378
  || type instanceof Structures.Types) {
35337
35379
  // these doesnt affect control flow, so just take the first statement
35338
35380
  const statement = n.getFirstStatement();
35339
35381
  const name = this.buildName(statement);
35340
- graph.addEdge(current, name);
35341
- graph.addEdge(name, graph.getEnd());
35382
+ graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35383
+ graph.addEdge(name, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35342
35384
  }
35343
35385
  else if (type instanceof Structures.AtFirst
35344
35386
  || type instanceof Structures.AtLast
@@ -35346,30 +35388,30 @@ class StatementFlow {
35346
35388
  || type instanceof Structures.OnChange) {
35347
35389
  const name = this.buildName(n.getFirstStatement());
35348
35390
  const body = this.traverseBody(this.findBody(n), context);
35349
- graph.addEdge(current, name);
35350
- graph.addGraph(name, body);
35351
- graph.addEdge(body.getEnd(), graph.getEnd());
35352
- graph.addEdge(current, graph.getEnd());
35391
+ graph.addEdge(current, name, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35392
+ graph.addGraph(name, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35393
+ graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35394
+ graph.addEdge(current, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35353
35395
  }
35354
35396
  else if (type instanceof Structures.Try) {
35355
35397
  const tryName = this.buildName(n.getFirstStatement());
35356
35398
  const body = this.traverseBody(this.findBody(n), context);
35357
- graph.addEdge(current, tryName);
35358
- graph.addGraph(tryName, body);
35359
- graph.addEdge(body.getEnd(), graph.getEnd());
35399
+ graph.addEdge(current, tryName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35400
+ graph.addGraph(tryName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35401
+ graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35360
35402
  for (const c of n.findDirectStructures(Structures.Catch)) {
35361
35403
  const catchName = this.buildName(c.getFirstStatement());
35362
35404
  const catchBody = this.traverseBody(this.findBody(c), context);
35363
35405
  // TODO: this does not take exceptions into account
35364
- graph.addEdge(body.getEnd(), catchName);
35365
- graph.addGraph(catchName, catchBody);
35366
- graph.addEdge(catchBody.getEnd(), graph.getEnd());
35406
+ graph.addEdge(body.getEnd(), catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35407
+ graph.addGraph(catchName, catchBody, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35408
+ graph.addEdge(catchBody.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35367
35409
  }
35368
35410
  // TODO, handle CLEANUP
35369
35411
  }
35370
35412
  else if (type instanceof Structures.Case) {
35371
35413
  const caseName = this.buildName(n.getFirstStatement());
35372
- graph.addEdge(current, caseName);
35414
+ graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35373
35415
  let othersFound = false;
35374
35416
  for (const w of n.findDirectStructures(Structures.When)) {
35375
35417
  const first = w.getFirstStatement();
@@ -35381,17 +35423,17 @@ class StatementFlow {
35381
35423
  }
35382
35424
  const firstName = this.buildName(first);
35383
35425
  const sub = this.traverseBody(this.findBody(w), context);
35384
- graph.addEdge(caseName, firstName);
35385
- graph.addGraph(firstName, sub);
35386
- graph.addEdge(sub.getEnd(), graph.getEnd());
35426
+ graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35427
+ graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35428
+ graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35387
35429
  }
35388
35430
  if (othersFound === false) {
35389
- graph.addEdge(caseName, graph.getEnd());
35431
+ graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35390
35432
  }
35391
35433
  }
35392
35434
  else if (type instanceof Structures.CaseType) {
35393
35435
  const caseName = this.buildName(n.getFirstStatement());
35394
- graph.addEdge(current, caseName);
35436
+ graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35395
35437
  let othersFound = false;
35396
35438
  for (const w of n.findDirectStructures(Structures.WhenType)) {
35397
35439
  const first = w.getFirstStatement();
@@ -35403,12 +35445,12 @@ class StatementFlow {
35403
35445
  }
35404
35446
  const firstName = this.buildName(first);
35405
35447
  const sub = this.traverseBody(this.findBody(w), context);
35406
- graph.addEdge(caseName, firstName);
35407
- graph.addGraph(firstName, sub);
35408
- graph.addEdge(sub.getEnd(), graph.getEnd());
35448
+ graph.addEdge(caseName, firstName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35449
+ graph.addGraph(firstName, sub, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35450
+ graph.addEdge(sub.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35409
35451
  }
35410
35452
  if (othersFound === false) {
35411
- graph.addEdge(caseName, graph.getEnd());
35453
+ graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35412
35454
  }
35413
35455
  }
35414
35456
  else {
@@ -36647,7 +36689,7 @@ class CharacterType extends _abstract_type_1.AbstractType {
36647
36689
  this.length = length;
36648
36690
  }
36649
36691
  cloneType(input) {
36650
- const clone = Object.assign({}, this.getAbstractTypeData()) || {};
36692
+ const clone = Object.assign({}, this.getAbstractTypeData());
36651
36693
  if (input.qualifiedName) {
36652
36694
  clone.qualifiedName = input.qualifiedName;
36653
36695
  }
@@ -41995,8 +42037,8 @@ exports.MemoryFile = MemoryFile;
41995
42037
  "use strict";
41996
42038
 
41997
42039
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41998
- exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = 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;
41999
- exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = void 0;
42040
+ 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;
42041
+ exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = void 0;
42000
42042
  const issue_1 = __webpack_require__(/*! ./issue */ "./node_modules/@abaplint/core/build/src/issue.js");
42001
42043
  Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
42002
42044
  const config_1 = __webpack_require__(/*! ./config */ "./node_modules/@abaplint/core/build/src/config.js");
@@ -42108,6 +42150,7 @@ const statement_flow_1 = __webpack_require__(/*! ./abap/flow/statement_flow */ "
42108
42150
  Object.defineProperty(exports, "StatementFlow", ({ enumerable: true, get: function () { return statement_flow_1.StatementFlow; } }));
42109
42151
  const flow_graph_1 = __webpack_require__(/*! ./abap/flow/flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
42110
42152
  Object.defineProperty(exports, "FlowGraph", ({ enumerable: true, get: function () { return flow_graph_1.FlowGraph; } }));
42153
+ Object.defineProperty(exports, "FLOW_EDGE_TYPE", ({ enumerable: true, get: function () { return flow_graph_1.FLOW_EDGE_TYPE; } }));
42111
42154
  //# sourceMappingURL=index.js.map
42112
42155
 
42113
42156
  /***/ }),
@@ -43235,13 +43278,13 @@ class Help {
43235
43278
  /////////////////////////////////////////////////
43236
43279
  static dumpABAP(file, reg, textDocument, position) {
43237
43280
  let content = "";
43238
- content = `
43239
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43240
- <a href="#_statements" rel="no-refresh">Statements</a> |
43241
- <a href="#_structure" rel="no-refresh">Structure</a> |
43242
- <a href="#_files" rel="no-refresh">Files</a> |
43243
- <a href="#_info" rel="no-refresh">Info Dump</a>
43244
- <hr>
43281
+ content = `
43282
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43283
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43284
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43285
+ <a href="#_files" rel="no-refresh">Files</a> |
43286
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43287
+ <hr>
43245
43288
  ` +
43246
43289
  "<tt>" + textDocument.uri + " (" +
43247
43290
  (position.line + 1) + ", " +
@@ -52511,7 +52554,7 @@ class Registry {
52511
52554
  }
52512
52555
  static abaplintVersion() {
52513
52556
  // magic, see build script "version.sh"
52514
- return "2.112.16";
52557
+ return "2.112.18";
52515
52558
  }
52516
52559
  getDDICReferences() {
52517
52560
  return this.ddicReferences;
@@ -52830,10 +52873,10 @@ class SevenBitAscii {
52830
52873
  key: "7bit_ascii",
52831
52874
  title: "Check for 7bit ascii",
52832
52875
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
52833
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
52834
-
52835
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
52836
-
52876
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
52877
+
52878
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
52879
+
52837
52880
  Checkes files with extensions ".abap" and ".asddls"`,
52838
52881
  tags: [_irule_1.RuleTag.SingleFile],
52839
52882
  badExample: `WRITE '뽑'.`,
@@ -53039,10 +53082,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53039
53082
  key: "abapdoc",
53040
53083
  title: "Check abapdoc",
53041
53084
  shortDescription: `Various checks regarding abapdoc.`,
53042
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53043
-
53044
- Plus class and interface definitions.
53045
-
53085
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53086
+
53087
+ Plus class and interface definitions.
53088
+
53046
53089
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53047
53090
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53048
53091
  };
@@ -53180,49 +53223,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53180
53223
  key: "align_parameters",
53181
53224
  title: "Align Parameters",
53182
53225
  shortDescription: `Checks for vertially aligned parameters`,
53183
- extendedInformation: `Checks:
53184
- * function module calls
53185
- * method calls
53186
- * VALUE constructors
53187
- * NEW constructors
53188
- * RAISE EXCEPTION statements
53189
- * CREATE OBJECT statements
53190
- * RAISE EVENT statements
53191
-
53192
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53193
-
53194
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53195
-
53196
- If parameters are on the same row, no issues are reported, see
53226
+ extendedInformation: `Checks:
53227
+ * function module calls
53228
+ * method calls
53229
+ * VALUE constructors
53230
+ * NEW constructors
53231
+ * RAISE EXCEPTION statements
53232
+ * CREATE OBJECT statements
53233
+ * RAISE EVENT statements
53234
+
53235
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53236
+
53237
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53238
+
53239
+ If parameters are on the same row, no issues are reported, see
53197
53240
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53198
53241
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53199
- badExample: `CALL FUNCTION 'FOOBAR'
53200
- EXPORTING
53201
- foo = 2
53202
- parameter = 3.
53203
-
53204
- foobar( moo = 1
53205
- param = 1 ).
53206
-
53207
- foo = VALUE #(
53208
- foo = bar
53242
+ badExample: `CALL FUNCTION 'FOOBAR'
53243
+ EXPORTING
53244
+ foo = 2
53245
+ parameter = 3.
53246
+
53247
+ foobar( moo = 1
53248
+ param = 1 ).
53249
+
53250
+ foo = VALUE #(
53251
+ foo = bar
53209
53252
  moo = 2 ).`,
53210
- goodExample: `CALL FUNCTION 'FOOBAR'
53211
- EXPORTING
53212
- foo = 2
53213
- parameter = 3.
53214
-
53215
- foobar( moo = 1
53216
- param = 1 ).
53217
-
53218
- foo = VALUE #(
53219
- foo = bar
53220
- moo = 2 ).
53221
-
53222
- DATA(sdf) = VALUE type(
53223
- common_val = 2
53224
- another_common = 5
53225
- ( row_value = 4
53253
+ goodExample: `CALL FUNCTION 'FOOBAR'
53254
+ EXPORTING
53255
+ foo = 2
53256
+ parameter = 3.
53257
+
53258
+ foobar( moo = 1
53259
+ param = 1 ).
53260
+
53261
+ foo = VALUE #(
53262
+ foo = bar
53263
+ moo = 2 ).
53264
+
53265
+ DATA(sdf) = VALUE type(
53266
+ common_val = 2
53267
+ another_common = 5
53268
+ ( row_value = 4
53226
53269
  value_foo = 5 ) ).`,
53227
53270
  };
53228
53271
  }
@@ -53656,37 +53699,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
53656
53699
  key: "align_type_expressions",
53657
53700
  title: "Align TYPE expressions",
53658
53701
  shortDescription: `Align TYPE expressions in statements`,
53659
- extendedInformation: `
53660
- Currently works for METHODS + BEGIN OF
53661
-
53662
- If BEGIN OF has an INCLUDE TYPE its ignored
53663
-
53664
- Also note that clean ABAP does not recommend aligning TYPE clauses:
53702
+ extendedInformation: `
53703
+ Currently works for METHODS + BEGIN OF
53704
+
53705
+ If BEGIN OF has an INCLUDE TYPE its ignored
53706
+
53707
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
53665
53708
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
53666
53709
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
53667
- badExample: `
53668
- TYPES: BEGIN OF foo,
53669
- bar TYPE i,
53670
- foobar TYPE i,
53671
- END OF foo.
53672
-
53673
- INTERFACE lif.
53674
- METHODS bar
53675
- IMPORTING
53676
- foo TYPE i
53677
- foobar TYPE i.
53710
+ badExample: `
53711
+ TYPES: BEGIN OF foo,
53712
+ bar TYPE i,
53713
+ foobar TYPE i,
53714
+ END OF foo.
53715
+
53716
+ INTERFACE lif.
53717
+ METHODS bar
53718
+ IMPORTING
53719
+ foo TYPE i
53720
+ foobar TYPE i.
53678
53721
  ENDINTERFACE.`,
53679
- goodExample: `
53680
- TYPES: BEGIN OF foo,
53681
- bar TYPE i,
53682
- foobar TYPE i,
53683
- END OF foo.
53684
-
53685
- INTERFACE lif.
53686
- METHODS bar
53687
- IMPORTING
53688
- foo TYPE i
53689
- foobar TYPE i.
53722
+ goodExample: `
53723
+ TYPES: BEGIN OF foo,
53724
+ bar TYPE i,
53725
+ foobar TYPE i,
53726
+ END OF foo.
53727
+
53728
+ INTERFACE lif.
53729
+ METHODS bar
53730
+ IMPORTING
53731
+ foo TYPE i
53732
+ foobar TYPE i.
53690
53733
  ENDINTERFACE.`,
53691
53734
  };
53692
53735
  }
@@ -53965,15 +54008,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
53965
54008
  return {
53966
54009
  key: "ambiguous_statement",
53967
54010
  title: "Check for ambigious statements",
53968
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
53969
- Add "TABLE" keyword or "@" for escaping SQL variables
53970
-
54011
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54012
+ Add "TABLE" keyword or "@" for escaping SQL variables
54013
+
53971
54014
  Only works if the target version is 740sp05 or above`,
53972
54015
  tags: [_irule_1.RuleTag.SingleFile],
53973
- badExample: `DELETE foo FROM bar.
54016
+ badExample: `DELETE foo FROM bar.
53974
54017
  MODIFY foo FROM bar.`,
53975
- goodExample: `DELETE foo FROM @bar.
53976
- MODIFY TABLE foo FROM bar.
54018
+ goodExample: `DELETE foo FROM @bar.
54019
+ MODIFY TABLE foo FROM bar.
53977
54020
  MODIFY zfoo FROM @wa.`,
53978
54021
  };
53979
54022
  }
@@ -54078,16 +54121,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54078
54121
  key: "avoid_use",
54079
54122
  title: "Avoid use of certain statements",
54080
54123
  shortDescription: `Detects usage of certain statements.`,
54081
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54082
-
54083
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54084
-
54085
- STATICS: use CLASS-DATA instead
54086
-
54087
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54088
-
54089
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54090
-
54124
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54125
+
54126
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54127
+
54128
+ STATICS: use CLASS-DATA instead
54129
+
54130
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54131
+
54132
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54133
+
54091
54134
  BREAK points`,
54092
54135
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54093
54136
  };
@@ -54219,11 +54262,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54219
54262
  title: "Check BEGIN END names",
54220
54263
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54221
54264
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54222
- badExample: `DATA: BEGIN OF stru,
54223
- field TYPE i,
54265
+ badExample: `DATA: BEGIN OF stru,
54266
+ field TYPE i,
54224
54267
  END OF structure_not_the_same.`,
54225
- goodExample: `DATA: BEGIN OF stru,
54226
- field TYPE i,
54268
+ goodExample: `DATA: BEGIN OF stru,
54269
+ field TYPE i,
54227
54270
  END OF stru.`,
54228
54271
  };
54229
54272
  }
@@ -54320,20 +54363,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54320
54363
  title: "BEGIN contains single INCLUDE",
54321
54364
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54322
54365
  tags: [_irule_1.RuleTag.SingleFile],
54323
- badExample: `TYPES: BEGIN OF dummy1.
54324
- INCLUDE TYPE dselc.
54325
- TYPES: END OF dummy1.
54326
-
54327
- DATA BEGIN OF foo.
54328
- INCLUDE STRUCTURE syst.
54329
- DATA END OF foo.
54330
-
54331
- STATICS BEGIN OF bar.
54332
- INCLUDE STRUCTURE syst.
54366
+ badExample: `TYPES: BEGIN OF dummy1.
54367
+ INCLUDE TYPE dselc.
54368
+ TYPES: END OF dummy1.
54369
+
54370
+ DATA BEGIN OF foo.
54371
+ INCLUDE STRUCTURE syst.
54372
+ DATA END OF foo.
54373
+
54374
+ STATICS BEGIN OF bar.
54375
+ INCLUDE STRUCTURE syst.
54333
54376
  STATICS END OF bar.`,
54334
- goodExample: `DATA BEGIN OF foo.
54335
- DATA field TYPE i.
54336
- INCLUDE STRUCTURE dselc.
54377
+ goodExample: `DATA BEGIN OF foo.
54378
+ DATA field TYPE i.
54379
+ INCLUDE STRUCTURE dselc.
54337
54380
  DATA END OF foo.`,
54338
54381
  };
54339
54382
  }
@@ -54423,9 +54466,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54423
54466
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54424
54467
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54425
54468
  badExample: `CALL TRANSACTION 'FOO'.`,
54426
- goodExample: `TRY.
54427
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54428
- CATCH cx_sy_authorization_error.
54469
+ goodExample: `TRY.
54470
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54471
+ CATCH cx_sy_authorization_error.
54429
54472
  ENDTRY.`,
54430
54473
  };
54431
54474
  }
@@ -54490,10 +54533,10 @@ class CDSCommentStyle {
54490
54533
  key: "cds_comment_style",
54491
54534
  title: "CDS Comment Style",
54492
54535
  shortDescription: `Check for obsolete comment style`,
54493
- extendedInformation: `Check for obsolete comment style
54494
-
54495
- Comments starting with "--" are considered obsolete
54496
-
54536
+ extendedInformation: `Check for obsolete comment style
54537
+
54538
+ Comments starting with "--" are considered obsolete
54539
+
54497
54540
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54498
54541
  tags: [_irule_1.RuleTag.SingleFile],
54499
54542
  badExample: "-- this is a comment",
@@ -54559,11 +54602,10 @@ class CDSLegacyView {
54559
54602
  key: "cds_legacy_view",
54560
54603
  title: "CDS Legacy View",
54561
54604
  shortDescription: `Identify CDS Legacy Views`,
54562
- // eslint-disable-next-line max-len
54563
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54564
-
54565
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54566
-
54605
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54606
+
54607
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54608
+
54567
54609
  v755 and up`,
54568
54610
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54569
54611
  };
@@ -54718,10 +54760,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
54718
54760
  key: "chain_mainly_declarations",
54719
54761
  title: "Chain mainly declarations",
54720
54762
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
54721
- extendedInformation: `
54722
- https://docs.abapopenchecks.org/checks/23/
54723
-
54724
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
54763
+ extendedInformation: `
54764
+ https://docs.abapopenchecks.org/checks/23/
54765
+
54766
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
54725
54767
  `,
54726
54768
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
54727
54769
  badExample: `CALL METHOD: bar.`,
@@ -54897,17 +54939,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
54897
54939
  title: "Change IF to CASE",
54898
54940
  shortDescription: `Finds IF constructs that can be changed to CASE`,
54899
54941
  // eslint-disable-next-line max-len
54900
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
54901
-
54942
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
54943
+
54902
54944
  If the first comparison is a boolean compare, no issue is reported.`,
54903
54945
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
54904
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
54905
- ELSEIF l_fcat-fieldname = 'BAR'
54906
- OR l_fcat-fieldname = 'MOO'.
54946
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
54947
+ ELSEIF l_fcat-fieldname = 'BAR'
54948
+ OR l_fcat-fieldname = 'MOO'.
54907
54949
  ENDIF.`,
54908
- goodExample: `CASE l_fcat-fieldname.
54909
- WHEN 'FOO'.
54910
- WHEN 'BAR' OR 'MOO'.
54950
+ goodExample: `CASE l_fcat-fieldname.
54951
+ WHEN 'FOO'.
54952
+ WHEN 'BAR' OR 'MOO'.
54911
54953
  ENDCASE.`,
54912
54954
  };
54913
54955
  }
@@ -55044,8 +55086,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55044
55086
  return {
55045
55087
  key: "check_abstract",
55046
55088
  title: "Check abstract methods and classes",
55047
- shortDescription: `Checks abstract methods and classes:
55048
- - class defined as abstract and final,
55089
+ shortDescription: `Checks abstract methods and classes:
55090
+ - class defined as abstract and final,
55049
55091
  - non-abstract class contains abstract methods`,
55050
55092
  extendedInformation: `If a class defines only constants, use an interface instead`,
55051
55093
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55126,11 +55168,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55126
55168
  return {
55127
55169
  key: "check_comments",
55128
55170
  title: "Check Comments",
55129
- shortDescription: `
55171
+ shortDescription: `
55130
55172
  Various checks for comment usage.`,
55131
- extendedInformation: `
55132
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55133
-
55173
+ extendedInformation: `
55174
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55175
+
55134
55176
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55135
55177
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55136
55178
  badExample: `WRITE 2. " descriptive comment`,
@@ -55292,9 +55334,9 @@ class CheckInclude {
55292
55334
  key: "check_include",
55293
55335
  title: "Check INCLUDEs",
55294
55336
  shortDescription: `Checks INCLUDE statements`,
55295
- extendedInformation: `
55296
- * Reports unused includes
55297
- * Errors if the includes are not found
55337
+ extendedInformation: `
55338
+ * Reports unused includes
55339
+ * Errors if the includes are not found
55298
55340
  * Error if including a main program`,
55299
55341
  tags: [_irule_1.RuleTag.Syntax],
55300
55342
  };
@@ -55370,14 +55412,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55370
55412
  key: "check_subrc",
55371
55413
  title: "Check sy-subrc",
55372
55414
  shortDescription: `Check sy-subrc`,
55373
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55374
-
55375
- If sy-dbcnt is checked after database statements, it is considered okay.
55376
-
55377
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55378
-
55379
- If IS ASSIGNED is checked after assigning, it is considered okay.
55380
-
55415
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55416
+
55417
+ If sy-dbcnt is checked after database statements, it is considered okay.
55418
+
55419
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55420
+
55421
+ If IS ASSIGNED is checked after assigning, it is considered okay.
55422
+
55381
55423
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55382
55424
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55383
55425
  pseudoComment: "EC CI_SUBRC",
@@ -55947,17 +55989,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
55947
55989
  shortDescription: `Find overlapping classic exceptions`,
55948
55990
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
55949
55991
  tags: [_irule_1.RuleTag.SingleFile],
55950
- badExample: `CALL FUNCTION 'SOMETHING'
55951
- EXCEPTIONS
55952
- system_failure = 1 MESSAGE lv_message
55953
- communication_failure = 1 MESSAGE lv_message
55954
- resource_failure = 1
55992
+ badExample: `CALL FUNCTION 'SOMETHING'
55993
+ EXCEPTIONS
55994
+ system_failure = 1 MESSAGE lv_message
55995
+ communication_failure = 1 MESSAGE lv_message
55996
+ resource_failure = 1
55955
55997
  OTHERS = 1.`,
55956
- goodExample: `CALL FUNCTION 'SOMETHING'
55957
- EXCEPTIONS
55958
- system_failure = 1 MESSAGE lv_message
55959
- communication_failure = 2 MESSAGE lv_message
55960
- resource_failure = 3
55998
+ goodExample: `CALL FUNCTION 'SOMETHING'
55999
+ EXCEPTIONS
56000
+ system_failure = 1 MESSAGE lv_message
56001
+ communication_failure = 2 MESSAGE lv_message
56002
+ resource_failure = 3
55961
56003
  OTHERS = 4.`,
55962
56004
  };
55963
56005
  }
@@ -56203,7 +56245,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56203
56245
  key: "commented_code",
56204
56246
  title: "Find commented code",
56205
56247
  shortDescription: `Detects usage of commented out code.`,
56206
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56248
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56207
56249
  https://docs.abapopenchecks.org/checks/14/`,
56208
56250
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56209
56251
  badExample: `* WRITE 'hello world'.`,
@@ -56436,10 +56478,10 @@ class ConstructorVisibilityPublic {
56436
56478
  key: "constructor_visibility_public",
56437
56479
  title: "Check constructor visibility is public",
56438
56480
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
56439
- extendedInformation: `
56440
- This only applies to global classes.
56441
-
56442
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56481
+ extendedInformation: `
56482
+ This only applies to global classes.
56483
+
56484
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56443
56485
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56444
56486
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56445
56487
  };
@@ -56514,8 +56556,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56514
56556
  key: "contains_tab",
56515
56557
  title: "Code contains tab",
56516
56558
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56517
- extendedInformation: `
56518
- https://docs.abapopenchecks.org/checks/09/
56559
+ extendedInformation: `
56560
+ https://docs.abapopenchecks.org/checks/09/
56519
56561
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56520
56562
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56521
56563
  badExample: `\tWRITE 'hello world'.`,
@@ -56602,10 +56644,10 @@ class CyclicOO {
56602
56644
  key: "cyclic_oo",
56603
56645
  title: "Cyclic OO",
56604
56646
  shortDescription: `Finds cyclic/circular OO references`,
56605
- extendedInformation: `Runs for global INTF + CLAS objects
56606
-
56607
- Objects must be without syntax errors for this rule to take effect
56608
-
56647
+ extendedInformation: `Runs for global INTF + CLAS objects
56648
+
56649
+ Objects must be without syntax errors for this rule to take effect
56650
+
56609
56651
  References in testclass includes are ignored`,
56610
56652
  };
56611
56653
  }
@@ -56847,7 +56889,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
56847
56889
  key: "dangerous_statement",
56848
56890
  title: "Dangerous statement",
56849
56891
  shortDescription: `Detects potentially dangerous statements`,
56850
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
56892
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
56851
56893
  dynamic SQL can potentially create SQL injection problems`,
56852
56894
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
56853
56895
  };
@@ -57051,13 +57093,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57051
57093
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57052
57094
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57053
57095
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57054
- badExample: `FROM foo.
57055
- WRITE 'hello'.
57056
- DATA int TYPE i.
57096
+ badExample: `FROM foo.
57097
+ WRITE 'hello'.
57098
+ DATA int TYPE i.
57057
57099
  ENDFORM.`,
57058
- goodExample: `FROM foo.
57059
- DATA int TYPE i.
57060
- WRITE 'hello'.
57100
+ goodExample: `FROM foo.
57101
+ DATA int TYPE i.
57102
+ WRITE 'hello'.
57061
57103
  ENDFORM.`,
57062
57104
  };
57063
57105
  }
@@ -57596,39 +57638,39 @@ class Downport {
57596
57638
  key: "downport",
57597
57639
  title: "Downport statement",
57598
57640
  shortDescription: `Downport functionality`,
57599
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57600
- a higher level language version. If successful, various rules are applied to downport the statement.
57601
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57602
-
57603
- Current rules:
57604
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57605
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57606
- * FIELD-SYMBOL() definitions are outlined
57607
- * CONV is outlined
57608
- * COND is outlined
57609
- * REDUCE is outlined
57610
- * SWITCH is outlined
57611
- * FILTER is outlined
57612
- * APPEND expression is outlined
57613
- * INSERT expression is outlined
57614
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57615
- * CAST changed to ?=
57616
- * LOOP AT method_call( ) is outlined
57617
- * VALUE # with structure fields
57618
- * VALUE # with internal table lines
57619
- * Table Expressions are outlined
57620
- * SELECT INTO @DATA definitions are outlined
57621
- * Some occurrences of string template formatting option ALPHA changed to function module call
57622
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57623
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57624
- * RAISE EXCEPTION ... MESSAGE
57625
- * Moving with +=, -=, /=, *=, &&= is expanded
57626
- * line_exists and line_index is downported to READ TABLE
57627
- * ENUMs, but does not nessesarily give the correct type and value
57628
- * MESSAGE with non simple source
57629
-
57630
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57631
-
57641
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57642
+ a higher level language version. If successful, various rules are applied to downport the statement.
57643
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
57644
+
57645
+ Current rules:
57646
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57647
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57648
+ * FIELD-SYMBOL() definitions are outlined
57649
+ * CONV is outlined
57650
+ * COND is outlined
57651
+ * REDUCE is outlined
57652
+ * SWITCH is outlined
57653
+ * FILTER is outlined
57654
+ * APPEND expression is outlined
57655
+ * INSERT expression is outlined
57656
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57657
+ * CAST changed to ?=
57658
+ * LOOP AT method_call( ) is outlined
57659
+ * VALUE # with structure fields
57660
+ * VALUE # with internal table lines
57661
+ * Table Expressions are outlined
57662
+ * SELECT INTO @DATA definitions are outlined
57663
+ * Some occurrences of string template formatting option ALPHA changed to function module call
57664
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57665
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57666
+ * RAISE EXCEPTION ... MESSAGE
57667
+ * Moving with +=, -=, /=, *=, &&= is expanded
57668
+ * line_exists and line_index is downported to READ TABLE
57669
+ * ENUMs, but does not nessesarily give the correct type and value
57670
+ * MESSAGE with non simple source
57671
+
57672
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57673
+
57632
57674
  Make sure to test the downported code, it might not always be completely correct.`,
57633
57675
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57634
57676
  };
@@ -58206,10 +58248,10 @@ Make sure to test the downported code, it might not always be completely correct
58206
58248
  const fieldName = f.concatTokens();
58207
58249
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58208
58250
  }
58209
- fieldDefinition = `DATA: BEGIN OF ${name},
58251
+ fieldDefinition = `DATA: BEGIN OF ${name},
58210
58252
  ${fieldDefinition}${indentation} END OF ${name}.`;
58211
58253
  }
58212
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58254
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58213
58255
  ${indentation}`);
58214
58256
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58215
58257
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58253,12 +58295,12 @@ ${indentation}`);
58253
58295
  }
58254
58296
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58255
58297
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
58256
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58257
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58258
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58298
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58299
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58300
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58259
58301
  ${indentation}`);
58260
58302
  if (fieldDefinitions === "") {
58261
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58303
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58262
58304
  ${indentation}`);
58263
58305
  }
58264
58306
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58326,7 +58368,7 @@ ${indentation}`);
58326
58368
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58327
58369
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58328
58370
  const firstToken = high.getFirstToken();
58329
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58371
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58330
58372
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58331
58373
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58332
58374
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58380,7 +58422,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58380
58422
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58381
58423
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58382
58424
  const firstToken = high.getFirstToken();
58383
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58425
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58384
58426
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58385
58427
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58386
58428
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58422,14 +58464,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58422
58464
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58423
58465
  const firstToken = high.getFirstToken();
58424
58466
  // note that the tabix restore should be done before throwing the exception
58425
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58426
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58427
- ${indentation}${tabixBackup} = sy-tabix.
58428
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58429
- ${indentation}sy-tabix = ${tabixBackup}.
58430
- ${indentation}IF sy-subrc <> 0.
58431
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58432
- ${indentation}ENDIF.
58467
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58468
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58469
+ ${indentation}${tabixBackup} = sy-tabix.
58470
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58471
+ ${indentation}sy-tabix = ${tabixBackup}.
58472
+ ${indentation}IF sy-subrc <> 0.
58473
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58474
+ ${indentation}ENDIF.
58433
58475
  ${indentation}`);
58434
58476
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58435
58477
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58486,7 +58528,7 @@ ${indentation}`);
58486
58528
  const className = classNames[0].concatTokens();
58487
58529
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58488
58530
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58489
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58531
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58490
58532
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58491
58533
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58492
58534
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -58648,16 +58690,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
58648
58690
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58649
58691
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58650
58692
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58651
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58652
- ${indentation}${uniqueName1}-msgid = ${id}.
58693
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58694
+ ${indentation}${uniqueName1}-msgid = ${id}.
58653
58695
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
58654
58696
  if (withs.length > 0) {
58655
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58656
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58657
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58697
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58698
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58699
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58658
58700
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
58659
58701
  }
58660
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58702
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58661
58703
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
58662
58704
  if (withs.length > 0) {
58663
58705
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -58769,10 +58811,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
58769
58811
  let code = "";
58770
58812
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
58771
58813
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58772
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
58773
- IF sy-subrc <> 0.
58774
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58775
- ENDIF.
58814
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
58815
+ IF sy-subrc <> 0.
58816
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58817
+ ENDIF.
58776
58818
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
58777
58819
  }
58778
58820
  else {
@@ -58861,20 +58903,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
58861
58903
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58862
58904
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58863
58905
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58864
- code += ` items LIKE ${loopSourceName},
58865
- END OF ${groupTargetName}type.
58866
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
58867
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
58906
+ code += ` items LIKE ${loopSourceName},
58907
+ END OF ${groupTargetName}type.
58908
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
58909
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
58868
58910
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
58869
58911
  if (groupIndexName !== undefined) {
58870
58912
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
58871
58913
  }
58872
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
58914
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
58873
58915
  IF sy-subrc = 0.\n`;
58874
58916
  if (groupCountName !== undefined) {
58875
58917
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
58876
58918
  }
58877
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
58919
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
58878
58920
  ELSE.\n`;
58879
58921
  code += ` CLEAR ${uniqueName}.\n`;
58880
58922
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -58895,8 +58937,8 @@ ELSE.\n`;
58895
58937
  }
58896
58938
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
58897
58939
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
58898
- code += `ENDIF.
58899
- ENDLOOP.
58940
+ code += `ENDIF.
58941
+ ENDLOOP.
58900
58942
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
58901
58943
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
58902
58944
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59068,7 +59110,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59068
59110
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59069
59111
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59070
59112
  // all ENUMS are char like?
59071
- let code = `TYPES ${enumName} TYPE string.
59113
+ let code = `TYPES ${enumName} TYPE string.
59072
59114
  CONSTANTS: BEGIN OF ${structureName},\n`;
59073
59115
  let count = 1;
59074
59116
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59112,14 +59154,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59112
59154
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59113
59155
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59114
59156
  // restore tabix before exeption
59115
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59116
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59117
- ${indentation}${tabixBackup} = sy-tabix.
59118
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59119
- ${indentation}sy-tabix = ${tabixBackup}.
59120
- ${indentation}IF sy-subrc <> 0.
59121
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59122
- ${indentation}ENDIF.
59157
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59158
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59159
+ ${indentation}${tabixBackup} = sy-tabix.
59160
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59161
+ ${indentation}sy-tabix = ${tabixBackup}.
59162
+ ${indentation}IF sy-subrc <> 0.
59163
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59164
+ ${indentation}ENDIF.
59123
59165
  ${indentation}${uniqueName}`;
59124
59166
  const start = target.getFirstToken().getStart();
59125
59167
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59203,11 +59245,11 @@ ${indentation}${uniqueName}`;
59203
59245
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59204
59246
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59205
59247
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59206
- const code = `DATA ${uniqueName} TYPE string.
59207
- ${indentation}CALL FUNCTION '${functionName}'
59208
- ${indentation} EXPORTING
59209
- ${indentation} input = ${source}
59210
- ${indentation} IMPORTING
59248
+ const code = `DATA ${uniqueName} TYPE string.
59249
+ ${indentation}CALL FUNCTION '${functionName}'
59250
+ ${indentation} EXPORTING
59251
+ ${indentation} input = ${source}
59252
+ ${indentation} IMPORTING
59211
59253
  ${indentation} output = ${uniqueName}.\n`;
59212
59254
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59213
59255
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60519,12 +60561,12 @@ class EasyToFindMessages {
60519
60561
  key: "easy_to_find_messages",
60520
60562
  title: "Easy to find messages",
60521
60563
  shortDescription: `Make messages easy to find`,
60522
- extendedInformation: `All messages must be statically referenced exactly once
60523
-
60524
- Only MESSAGE and RAISE statments are counted as static references
60525
-
60526
- Also see rule "message_exists"
60527
-
60564
+ extendedInformation: `All messages must be statically referenced exactly once
60565
+
60566
+ Only MESSAGE and RAISE statments are counted as static references
60567
+
60568
+ Also see rule "message_exists"
60569
+
60528
60570
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60529
60571
  tags: [_irule_1.RuleTag.Styleguide],
60530
60572
  };
@@ -60609,8 +60651,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
60609
60651
  key: "empty_line_in_statement",
60610
60652
  title: "Find empty lines in statements",
60611
60653
  shortDescription: `Checks that statements do not contain empty lines.`,
60612
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
60613
-
60654
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
60655
+
60614
60656
  https://docs.abapopenchecks.org/checks/41/`,
60615
60657
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
60616
60658
  badExample: `WRITE\n\nhello.`,
@@ -60786,13 +60828,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
60786
60828
  shortDescription: `Checks that the code does not contain empty blocks.`,
60787
60829
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
60788
60830
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
60789
- badExample: `IF foo = bar.
60790
- ENDIF.
60791
-
60792
- DO 2 TIMES.
60831
+ badExample: `IF foo = bar.
60832
+ ENDIF.
60833
+
60834
+ DO 2 TIMES.
60793
60835
  ENDDO.`,
60794
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
60795
- ENDLOOP.
60836
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
60837
+ ENDLOOP.
60796
60838
  result = xsdbool( sy-subrc = 0 ).`,
60797
60839
  };
60798
60840
  }
@@ -60934,10 +60976,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
60934
60976
  return {
60935
60977
  key: "exit_or_check",
60936
60978
  title: "Find EXIT or CHECK outside loops",
60937
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
60979
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
60938
60980
  Use RETURN to leave procesing blocks instead.`,
60939
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
60940
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
60981
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
60982
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
60941
60983
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
60942
60984
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60943
60985
  };
@@ -61020,12 +61062,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61020
61062
  key: "expand_macros",
61021
61063
  title: "Expand Macros",
61022
61064
  shortDescription: `Allows expanding macro calls with quick fixes`,
61023
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61024
-
61065
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61066
+
61025
61067
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61026
- badExample: `DEFINE _hello.
61027
- WRITE 'hello'.
61028
- END-OF-DEFINITION.
61068
+ badExample: `DEFINE _hello.
61069
+ WRITE 'hello'.
61070
+ END-OF-DEFINITION.
61029
61071
  _hello.`,
61030
61072
  goodExample: `WRITE 'hello'.`,
61031
61073
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61112,7 +61154,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61112
61154
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61113
61155
  badExample: `call_method( EXPORTING foo = bar ).`,
61114
61156
  goodExample: `call_method( foo = bar ).`,
61115
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61157
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61116
61158
  https://docs.abapopenchecks.org/checks/30/`,
61117
61159
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61118
61160
  };
@@ -61210,7 +61252,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61210
61252
  key: "forbidden_identifier",
61211
61253
  title: "Forbidden Identifier",
61212
61254
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61213
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61255
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61214
61256
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61215
61257
  tags: [_irule_1.RuleTag.SingleFile],
61216
61258
  };
@@ -61452,8 +61494,8 @@ class ForbiddenVoidType {
61452
61494
  key: "forbidden_void_type",
61453
61495
  title: "Forbidden Void Types",
61454
61496
  shortDescription: `Avoid usage of specified void types.`,
61455
- extendedInformation: `Inspiration:
61456
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61497
+ extendedInformation: `Inspiration:
61498
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61457
61499
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61458
61500
  };
61459
61501
  }
@@ -61696,7 +61738,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
61696
61738
  key: "fully_type_itabs",
61697
61739
  title: "Fully type internal tables",
61698
61740
  shortDescription: `No implict table types or table keys`,
61699
- badExample: `DATA lt_foo TYPE TABLE OF ty.
61741
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
61700
61742
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
61701
61743
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
61702
61744
  tags: [_irule_1.RuleTag.SingleFile],
@@ -61881,26 +61923,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
61881
61923
  key: "functional_writing",
61882
61924
  title: "Use functional writing",
61883
61925
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
61884
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
61926
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
61885
61927
  https://docs.abapopenchecks.org/checks/07/`,
61886
61928
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61887
- badExample: `CALL METHOD zcl_class=>method( ).
61888
- CALL METHOD cl_abap_typedescr=>describe_by_name
61889
- EXPORTING
61890
- p_name = 'NAME'
61891
- RECEIVING
61892
- p_descr_ref = lr_typedescr
61893
- EXCEPTIONS
61894
- type_not_found = 1
61929
+ badExample: `CALL METHOD zcl_class=>method( ).
61930
+ CALL METHOD cl_abap_typedescr=>describe_by_name
61931
+ EXPORTING
61932
+ p_name = 'NAME'
61933
+ RECEIVING
61934
+ p_descr_ref = lr_typedescr
61935
+ EXCEPTIONS
61936
+ type_not_found = 1
61895
61937
  OTHERS = 2.`,
61896
- goodExample: `zcl_class=>method( ).
61897
- cl_abap_typedescr=>describe_by_name(
61898
- EXPORTING
61899
- p_name = 'NAME'
61900
- RECEIVING
61901
- p_descr_ref = lr_typedescr
61902
- EXCEPTIONS
61903
- type_not_found = 1
61938
+ goodExample: `zcl_class=>method( ).
61939
+ 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
61904
61946
  OTHERS = 2 ).`,
61905
61947
  };
61906
61948
  }
@@ -62011,14 +62053,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62011
62053
  key: "global_class",
62012
62054
  title: "Global class checks",
62013
62055
  shortDescription: `Checks related to global classes`,
62014
- extendedInformation: `* global classes must be in own files
62015
-
62016
- * file names must match class name
62017
-
62018
- * file names must match interface name
62019
-
62020
- * global classes must be global definitions
62021
-
62056
+ extendedInformation: `* global classes must be in own files
62057
+
62058
+ * file names must match class name
62059
+
62060
+ * file names must match interface name
62061
+
62062
+ * global classes must be global definitions
62063
+
62022
62064
  * global interfaces must be global definitions`,
62023
62065
  tags: [_irule_1.RuleTag.Syntax],
62024
62066
  };
@@ -62117,21 +62159,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62117
62159
  return {
62118
62160
  key: "identical_conditions",
62119
62161
  title: "Identical conditions",
62120
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62121
-
62162
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62163
+
62122
62164
  Prerequsites: code is pretty printed with identical cAsE`,
62123
62165
  tags: [_irule_1.RuleTag.SingleFile],
62124
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62125
- ENDIF.
62126
- CASE bar.
62127
- WHEN '1'.
62128
- WHEN 'A' OR '1'.
62166
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62167
+ ENDIF.
62168
+ CASE bar.
62169
+ WHEN '1'.
62170
+ WHEN 'A' OR '1'.
62129
62171
  ENDCASE.`,
62130
- goodExample: `IF foo = bar OR 1 = a.
62131
- ENDIF.
62132
- CASE bar.
62133
- WHEN '1'.
62134
- WHEN 'A'.
62172
+ goodExample: `IF foo = bar OR 1 = a.
62173
+ ENDIF.
62174
+ CASE bar.
62175
+ WHEN '1'.
62176
+ WHEN 'A'.
62135
62177
  ENDCASE.`,
62136
62178
  };
62137
62179
  }
@@ -62265,23 +62307,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62265
62307
  key: "identical_contents",
62266
62308
  title: "Identical contents",
62267
62309
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62268
- extendedInformation: `
62269
- Prerequsites: code is pretty printed with identical cAsE
62270
-
62310
+ extendedInformation: `
62311
+ Prerequsites: code is pretty printed with identical cAsE
62312
+
62271
62313
  Chained statments are ignored`,
62272
62314
  tags: [_irule_1.RuleTag.SingleFile],
62273
- badExample: `IF foo = bar.
62274
- WRITE 'bar'.
62275
- WRITE 'world'.
62276
- ELSE.
62277
- WRITE 'foo'.
62278
- WRITE 'world'.
62315
+ badExample: `IF foo = bar.
62316
+ WRITE 'bar'.
62317
+ WRITE 'world'.
62318
+ ELSE.
62319
+ WRITE 'foo'.
62320
+ WRITE 'world'.
62279
62321
  ENDIF.`,
62280
- goodExample: `IF foo = bar.
62281
- WRITE 'bar'.
62282
- ELSE.
62283
- WRITE 'foo'.
62284
- ENDIF.
62322
+ goodExample: `IF foo = bar.
62323
+ WRITE 'bar'.
62324
+ ELSE.
62325
+ WRITE 'foo'.
62326
+ ENDIF.
62285
62327
  WRITE 'world'.`,
62286
62328
  };
62287
62329
  }
@@ -62389,12 +62431,12 @@ class IdenticalDescriptions {
62389
62431
  key: "identical_descriptions",
62390
62432
  title: "Identical descriptions",
62391
62433
  shortDescription: `Searches for objects with the same type and same description`,
62392
- extendedInformation: `Case insensitive
62393
-
62394
- Only checks the master language descriptions
62395
-
62396
- Dependencies are skipped
62397
-
62434
+ extendedInformation: `Case insensitive
62435
+
62436
+ Only checks the master language descriptions
62437
+
62438
+ Dependencies are skipped
62439
+
62398
62440
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62399
62441
  tags: [],
62400
62442
  };
@@ -62568,43 +62610,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
62568
62610
  key: "if_in_if",
62569
62611
  title: "IF in IF",
62570
62612
  shortDescription: `Detects nested ifs which can be refactored.`,
62571
- extendedInformation: `
62572
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
62573
-
62574
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62575
-
62576
- https://docs.abapopenchecks.org/checks/01/
62613
+ extendedInformation: `
62614
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
62615
+
62616
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62617
+
62618
+ https://docs.abapopenchecks.org/checks/01/
62577
62619
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
62578
- badExample: `IF condition1.
62579
- IF condition2.
62580
- ...
62581
- ENDIF.
62582
- ENDIF.
62583
-
62584
- IF condition1.
62585
- ...
62586
- ELSE.
62587
- IF condition2.
62588
- ...
62589
- ENDIF.
62620
+ badExample: `IF condition1.
62621
+ IF condition2.
62622
+ ...
62623
+ ENDIF.
62624
+ ENDIF.
62625
+
62626
+ IF condition1.
62627
+ ...
62628
+ ELSE.
62629
+ IF condition2.
62630
+ ...
62631
+ ENDIF.
62590
62632
  ENDIF.`,
62591
- goodExample: `IF ( condition1 ) AND ( condition2 ).
62592
- ...
62593
- ENDIF.
62594
-
62595
- IF condition1.
62596
- ...
62597
- ELSEIF condition2.
62598
- ...
62599
- ENDIF.
62600
-
62601
- CASE variable.
62602
- WHEN value1.
62603
- ...
62604
- WHEN value2.
62605
- IF condition2.
62606
- ...
62607
- ENDIF.
62633
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
62634
+ ...
62635
+ ENDIF.
62636
+
62637
+ IF condition1.
62638
+ ...
62639
+ ELSEIF condition2.
62640
+ ...
62641
+ ENDIF.
62642
+
62643
+ CASE variable.
62644
+ WHEN value1.
62645
+ ...
62646
+ WHEN value2.
62647
+ IF condition2.
62648
+ ...
62649
+ ENDIF.
62608
62650
  ENDCASE.`,
62609
62651
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62610
62652
  };
@@ -62789,9 +62831,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
62789
62831
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
62790
62832
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
62791
62833
  if (name === impl.identifier.getName().toUpperCase()) {
62792
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
62793
- METHOD ${methodName.toLowerCase()}.
62794
- RETURN. " todo, implement method
62834
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
62835
+ METHOD ${methodName.toLowerCase()}.
62836
+ RETURN. " todo, implement method
62795
62837
  ENDMETHOD.`);
62796
62838
  }
62797
62839
  }
@@ -62979,19 +63021,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
62979
63021
  key: "in_statement_indentation",
62980
63022
  title: "In-statement indentation",
62981
63023
  shortDescription: "Checks alignment within statements which span multiple lines.",
62982
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
62983
-
62984
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63024
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63025
+
63026
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
62985
63027
  to distinguish them better from code within the block.`,
62986
- badExample: `IF 1 = 1
62987
- AND 2 = 2.
62988
- WRITE 'hello' &&
62989
- 'world'.
63028
+ badExample: `IF 1 = 1
63029
+ AND 2 = 2.
63030
+ WRITE 'hello' &&
63031
+ 'world'.
62990
63032
  ENDIF.`,
62991
- goodExample: `IF 1 = 1
62992
- AND 2 = 2.
62993
- WRITE 'hello' &&
62994
- 'world'.
63033
+ goodExample: `IF 1 = 1
63034
+ AND 2 = 2.
63035
+ WRITE 'hello' &&
63036
+ 'world'.
62995
63037
  ENDIF.`,
62996
63038
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62997
63039
  };
@@ -63114,23 +63156,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63114
63156
  title: "Indentation",
63115
63157
  shortDescription: `Checks indentation`,
63116
63158
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63117
- badExample: `CLASS lcl DEFINITION.
63118
- PRIVATE SECTION.
63119
- METHODS constructor.
63120
- ENDCLASS.
63121
-
63122
- CLASS lcl IMPLEMENTATION.
63123
- METHOD constructor.
63124
- ENDMETHOD.
63159
+ badExample: `CLASS lcl DEFINITION.
63160
+ PRIVATE SECTION.
63161
+ METHODS constructor.
63162
+ ENDCLASS.
63163
+
63164
+ CLASS lcl IMPLEMENTATION.
63165
+ METHOD constructor.
63166
+ ENDMETHOD.
63125
63167
  ENDCLASS.`,
63126
- goodExample: `CLASS lcl DEFINITION.
63127
- PRIVATE SECTION.
63128
- METHODS constructor.
63129
- ENDCLASS.
63130
-
63131
- CLASS lcl IMPLEMENTATION.
63132
- METHOD constructor.
63133
- ENDMETHOD.
63168
+ goodExample: `CLASS lcl DEFINITION.
63169
+ PRIVATE SECTION.
63170
+ METHODS constructor.
63171
+ ENDCLASS.
63172
+
63173
+ CLASS lcl IMPLEMENTATION.
63174
+ METHOD constructor.
63175
+ ENDMETHOD.
63134
63176
  ENDCLASS.`,
63135
63177
  };
63136
63178
  }
@@ -63520,9 +63562,9 @@ class IntfReferencingClas {
63520
63562
  key: "intf_referencing_clas",
63521
63563
  title: "INTF referencing CLAS",
63522
63564
  shortDescription: `Interface contains references to class`,
63523
- extendedInformation: `Only global interfaces are checked.
63524
- Only first level references are checked.
63525
- Exception class references are ignored.
63565
+ extendedInformation: `Only global interfaces are checked.
63566
+ Only first level references are checked.
63567
+ Exception class references are ignored.
63526
63568
  Void references are ignored.`,
63527
63569
  };
63528
63570
  }
@@ -63607,9 +63649,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
63607
63649
  title: "Invalid Table Index",
63608
63650
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
63609
63651
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63610
- badExample: `DATA(first) = table[ 0 ].
63652
+ badExample: `DATA(first) = table[ 0 ].
63611
63653
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
63612
- goodExample: `DATA(first) = table[ 1 ].
63654
+ goodExample: `DATA(first) = table[ 1 ].
63613
63655
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
63614
63656
  };
63615
63657
  }
@@ -64210,8 +64252,8 @@ class LineBreakStyle {
64210
64252
  return {
64211
64253
  key: "line_break_style",
64212
64254
  title: "Makes sure line breaks are consistent in the ABAP code",
64213
- shortDescription: `Enforces LF as newlines in ABAP files
64214
-
64255
+ shortDescription: `Enforces LF as newlines in ABAP files
64256
+
64215
64257
  abapGit does not work with CRLF`,
64216
64258
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64217
64259
  };
@@ -64280,7 +64322,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64280
64322
  key: "line_length",
64281
64323
  title: "Line length",
64282
64324
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64283
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64325
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64284
64326
  https://docs.abapopenchecks.org/checks/04/`,
64285
64327
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64286
64328
  };
@@ -64351,7 +64393,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64351
64393
  key: "line_only_punc",
64352
64394
  title: "Line containing only punctuation",
64353
64395
  shortDescription: `Detects lines containing only punctuation.`,
64354
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64396
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64355
64397
  https://docs.abapopenchecks.org/checks/16/`,
64356
64398
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64357
64399
  badExample: "zcl_class=>method(\n).",
@@ -64611,15 +64653,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
64611
64653
  return {
64612
64654
  key: "local_variable_names",
64613
64655
  title: "Local variable naming conventions",
64614
- shortDescription: `
64615
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
64656
+ shortDescription: `
64657
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
64616
64658
  Regexes are case-insensitive.`,
64617
64659
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
64618
- badExample: `FORM bar.
64619
- DATA foo.
64660
+ badExample: `FORM bar.
64661
+ DATA foo.
64620
64662
  ENDFORM.`,
64621
- goodExample: `FORM bar.
64622
- DATA lv_foo.
64663
+ goodExample: `FORM bar.
64664
+ DATA lv_foo.
64623
64665
  ENDFORM.`,
64624
64666
  };
64625
64667
  }
@@ -64771,9 +64813,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
64771
64813
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
64772
64814
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
64773
64815
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
64774
- badExample: `DEFINE something.
64816
+ badExample: `DEFINE something.
64775
64817
  END-OF-DEFINITION.`,
64776
- goodExample: `DEFINE _something.
64818
+ goodExample: `DEFINE _something.
64777
64819
  END-OF-DEFINITION.`,
64778
64820
  };
64779
64821
  }
@@ -64846,10 +64888,10 @@ class MainFileContents {
64846
64888
  key: "main_file_contents",
64847
64889
  title: "Main file contents",
64848
64890
  shortDescription: `Checks related to report declarations.`,
64849
- extendedInformation: `Does not run if the target version is Cloud
64850
-
64851
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
64852
- * TYPEs must begin with "TYPE-POOL <name>."
64891
+ extendedInformation: `Does not run if the target version is Cloud
64892
+
64893
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
64894
+ * TYPEs must begin with "TYPE-POOL <name>."
64853
64895
  `,
64854
64896
  };
64855
64897
  }
@@ -64965,17 +65007,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
64965
65007
  title: "Too many parentheses",
64966
65008
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
64967
65009
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64968
- badExample: `
64969
- IF ( destination IS INITIAL ).
64970
- ENDIF.
64971
- IF foo = boo AND ( bar = lar AND moo = loo ).
64972
- ENDIF.
65010
+ badExample: `
65011
+ IF ( destination IS INITIAL ).
65012
+ ENDIF.
65013
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65014
+ ENDIF.
64973
65015
  `,
64974
- goodExample: `
64975
- IF destination IS INITIAL.
64976
- ENDIF.
64977
- IF foo = boo AND bar = lar AND moo = loo.
64978
- ENDIF.
65016
+ goodExample: `
65017
+ IF destination IS INITIAL.
65018
+ ENDIF.
65019
+ IF foo = boo AND bar = lar AND moo = loo.
65020
+ ENDIF.
64979
65021
  `,
64980
65022
  };
64981
65023
  }
@@ -65149,14 +65191,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65149
65191
  title: "Max one method parameter definition per line",
65150
65192
  shortDescription: `Keep max one method parameter description per line`,
65151
65193
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65152
- badExample: `
65153
- METHODS apps_scope_token
65154
- IMPORTING
65194
+ badExample: `
65195
+ METHODS apps_scope_token
65196
+ IMPORTING
65155
65197
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65156
- goodExample: `
65157
- METHODS apps_scope_token
65158
- IMPORTING
65159
- body TYPE bodyapps_scope_token
65198
+ goodExample: `
65199
+ METHODS apps_scope_token
65200
+ IMPORTING
65201
+ body TYPE bodyapps_scope_token
65160
65202
  client_id TYPE str.`,
65161
65203
  };
65162
65204
  }
@@ -65221,11 +65263,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65221
65263
  key: "max_one_statement",
65222
65264
  title: "Max one statement per line",
65223
65265
  shortDescription: `Checks that each line contains only a single statement.`,
65224
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65225
-
65226
- Does not report anything for chained statements.
65227
-
65228
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65266
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65267
+
65268
+ Does not report anything for chained statements.
65269
+
65270
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65229
65271
  https://docs.abapopenchecks.org/checks/11/`,
65230
65272
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65231
65273
  badExample: `WRITE foo. WRITE bar.`,
@@ -65563,8 +65605,8 @@ class MethodLength {
65563
65605
  key: "method_length",
65564
65606
  title: "Method/Form Length",
65565
65607
  shortDescription: `Checks relating to method/form length.`,
65566
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
65567
-
65608
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
65609
+
65568
65610
  Abstract methods without statements are considered okay.`,
65569
65611
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65570
65612
  };
@@ -65669,20 +65711,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
65669
65711
  key: "method_overwrites_builtin",
65670
65712
  title: "Method name overwrites builtin function",
65671
65713
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
65672
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
65673
-
65674
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
65675
-
65714
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
65715
+
65716
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
65717
+
65676
65718
  Interface method names are ignored`,
65677
65719
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
65678
- badExample: `CLASS lcl DEFINITION.
65679
- PUBLIC SECTION.
65680
- METHODS matches.
65681
- ENDCLASS.
65682
-
65683
- CLASS lcl IMPLEMENTATION.
65684
- METHOD matches.
65685
- ENDMETHOD.
65720
+ badExample: `CLASS lcl DEFINITION.
65721
+ PUBLIC SECTION.
65722
+ METHODS matches.
65723
+ ENDCLASS.
65724
+
65725
+ CLASS lcl IMPLEMENTATION.
65726
+ METHOD matches.
65727
+ ENDMETHOD.
65686
65728
  ENDCLASS.`,
65687
65729
  };
65688
65730
  }
@@ -65873,12 +65915,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
65873
65915
  // eslint-disable-next-line max-len
65874
65916
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
65875
65917
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65876
- badExample: `CLASS lcl DEFINITION.
65877
- PUBLIC SECTION.
65878
- METHODS
65879
- foobar
65880
- EXPORTING foo TYPE i
65881
- RETURNING VALUE(rv_string) TYPE string.
65918
+ badExample: `CLASS lcl DEFINITION.
65919
+ PUBLIC SECTION.
65920
+ METHODS
65921
+ foobar
65922
+ EXPORTING foo TYPE i
65923
+ RETURNING VALUE(rv_string) TYPE string.
65882
65924
  ENDCLASS.`,
65883
65925
  };
65884
65926
  }
@@ -66258,7 +66300,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66258
66300
  key: "nesting",
66259
66301
  title: "Check nesting depth",
66260
66302
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66261
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66303
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66262
66304
  https://docs.abapopenchecks.org/checks/74/`,
66263
66305
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66264
66306
  };
@@ -66501,7 +66543,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
66501
66543
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
66502
66544
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66503
66545
  badExample: `var1 = var2 = var3.`,
66504
- goodExample: `var2 = var3.
66546
+ goodExample: `var2 = var3.
66505
66547
  var1 = var2.`,
66506
66548
  };
66507
66549
  }
@@ -66560,8 +66602,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
66560
66602
  key: "no_external_form_calls",
66561
66603
  title: "No external FORM calls",
66562
66604
  shortDescription: `Detect external form calls`,
66563
- badExample: `PERFORM foo IN PROGRAM bar.
66564
-
66605
+ badExample: `PERFORM foo IN PROGRAM bar.
66606
+
66565
66607
  PERFORM foo(bar).`,
66566
66608
  tags: [_irule_1.RuleTag.SingleFile],
66567
66609
  };
@@ -66622,17 +66664,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
66622
66664
  key: "no_inline_in_optional_branches",
66623
66665
  title: "Don't declare inline in optional branches",
66624
66666
  shortDescription: `Don't declare inline in optional branches`,
66625
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
66626
-
66627
- Considered optional branches:
66628
- * inside IF/ELSEIF/ELSE
66629
- * inside LOOP
66630
- * inside WHILE
66631
- * inside CASE/WHEN, CASE TYPE OF
66632
- * inside DO
66633
- * inside SELECT loops
66634
-
66635
- Not considered optional branches:
66667
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
66668
+
66669
+ Considered optional branches:
66670
+ * inside IF/ELSEIF/ELSE
66671
+ * inside LOOP
66672
+ * inside WHILE
66673
+ * inside CASE/WHEN, CASE TYPE OF
66674
+ * inside DO
66675
+ * inside SELECT loops
66676
+
66677
+ Not considered optional branches:
66636
66678
  * TRY/CATCH/CLEANUP`,
66637
66679
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66638
66680
  };
@@ -66732,12 +66774,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
66732
66774
  key: "no_prefixes",
66733
66775
  title: "No Prefixes",
66734
66776
  shortDescription: `Dont use hungarian notation`,
66735
- extendedInformation: `
66736
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
66737
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
66738
-
66739
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
66740
-
66777
+ extendedInformation: `
66778
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
66779
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
66780
+
66781
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
66782
+
66741
66783
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
66742
66784
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66743
66785
  badExample: `DATA lv_foo TYPE i.`,
@@ -66916,7 +66958,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
66916
66958
  return {
66917
66959
  key: "no_public_attributes",
66918
66960
  title: "No public attributes",
66919
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
66961
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
66920
66962
  Exceptions are excluded from this rule.`,
66921
66963
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
66922
66964
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67017,13 +67059,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67017
67059
  key: "no_yoda_conditions",
67018
67060
  title: "No Yoda conditions",
67019
67061
  shortDescription: `Finds Yoda conditions and reports issues`,
67020
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67021
-
67062
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67063
+
67022
67064
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67023
67065
  tags: [_irule_1.RuleTag.SingleFile],
67024
- badExample: `IF 0 <> sy-subrc.
67066
+ badExample: `IF 0 <> sy-subrc.
67025
67067
  ENDIF.`,
67026
- goodExample: `IF sy-subrc <> 0.
67068
+ goodExample: `IF sy-subrc <> 0.
67027
67069
  ENDIF.`,
67028
67070
  };
67029
67071
  }
@@ -67124,8 +67166,8 @@ class NROBConsistency {
67124
67166
  key: "nrob_consistency",
67125
67167
  title: "Number range consistency",
67126
67168
  shortDescription: `Consistency checks for number ranges`,
67127
- extendedInformation: `Issue reported if percentage warning is over 50%
67128
-
67169
+ extendedInformation: `Issue reported if percentage warning is over 50%
67170
+
67129
67171
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67130
67172
  tags: [_irule_1.RuleTag.SingleFile],
67131
67173
  };
@@ -67402,58 +67444,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67402
67444
  title: "Obsolete statements",
67403
67445
  shortDescription: `Checks for usages of certain obsolete statements`,
67404
67446
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67405
- extendedInformation: `
67406
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67407
-
67408
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67409
-
67410
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67411
-
67412
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67413
-
67414
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67415
-
67416
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67417
-
67418
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67419
-
67420
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67421
-
67422
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67423
-
67424
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67425
-
67426
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67427
-
67428
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67429
-
67430
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67431
-
67432
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67433
-
67434
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67435
- SELECT COUNT(*) is considered okay
67436
-
67437
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67438
-
67439
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67440
-
67441
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67442
-
67443
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67444
-
67445
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
67446
-
67447
+ extendedInformation: `
67448
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67449
+
67450
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67451
+
67452
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67453
+
67454
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67455
+
67456
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67457
+
67458
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67459
+
67460
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67461
+
67462
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67463
+
67464
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67465
+
67466
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67467
+
67468
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67469
+
67470
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67471
+
67472
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67473
+
67474
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67475
+
67476
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67477
+ SELECT COUNT(*) is considered okay
67478
+
67479
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67480
+
67481
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67482
+
67483
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67484
+
67485
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67486
+
67487
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
67488
+
67447
67489
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
67448
- badExample: `REFRESH itab.
67449
-
67450
- COMPUTE foo = 2 + 2.
67451
-
67452
- MULTIPLY lv_foo BY 2.
67453
-
67454
- INTERFACE intf LOAD.
67455
-
67456
- IF foo IS SUPPLIED.
67490
+ badExample: `REFRESH itab.
67491
+
67492
+ COMPUTE foo = 2 + 2.
67493
+
67494
+ MULTIPLY lv_foo BY 2.
67495
+
67496
+ INTERFACE intf LOAD.
67497
+
67498
+ IF foo IS SUPPLIED.
67457
67499
  ENDIF.`,
67458
67500
  };
67459
67501
  }
@@ -67793,9 +67835,9 @@ class OmitParameterName {
67793
67835
  key: "omit_parameter_name",
67794
67836
  title: "Omit parameter name",
67795
67837
  shortDescription: `Omit the parameter name in single parameter calls`,
67796
- extendedInformation: `
67797
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
67798
-
67838
+ extendedInformation: `
67839
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
67840
+
67799
67841
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
67800
67842
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67801
67843
  badExample: `method( param = 2 ).`,
@@ -68001,20 +68043,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68001
68043
  shortDescription: `Omit RECEIVING`,
68002
68044
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68003
68045
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68004
- badExample: `
68005
- upload_pack(
68006
- EXPORTING
68007
- io_client = lo_client
68008
- iv_url = iv_url
68009
- iv_deepen_level = iv_deepen_level
68010
- it_hashes = lt_hashes
68011
- RECEIVING
68046
+ badExample: `
68047
+ upload_pack(
68048
+ EXPORTING
68049
+ io_client = lo_client
68050
+ iv_url = iv_url
68051
+ iv_deepen_level = iv_deepen_level
68052
+ it_hashes = lt_hashes
68053
+ RECEIVING
68012
68054
  rt_objects = et_objects ).`,
68013
- goodExample: `
68014
- et_objects = upload_pack(
68015
- io_client = lo_client
68016
- iv_url = iv_url
68017
- iv_deepen_level = iv_deepen_level
68055
+ goodExample: `
68056
+ et_objects = upload_pack(
68057
+ io_client = lo_client
68058
+ iv_url = iv_url
68059
+ iv_deepen_level = iv_deepen_level
68018
68060
  it_hashes = lt_hashes ).`,
68019
68061
  };
68020
68062
  }
@@ -68078,8 +68120,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68078
68120
  return {
68079
68121
  key: "parser_702_chaining",
68080
68122
  title: "Parser Error, bad chanining on 702",
68081
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68082
- this rule finds these and reports errors.
68123
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68124
+ this rule finds these and reports errors.
68083
68125
  Only active on target version 702 and below.`,
68084
68126
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68085
68127
  };
@@ -68159,8 +68201,8 @@ class ParserError {
68159
68201
  return {
68160
68202
  key: "parser_error",
68161
68203
  title: "Parser error",
68162
- shortDescription: `Checks for syntax not recognized by abaplint.
68163
-
68204
+ shortDescription: `Checks for syntax not recognized by abaplint.
68205
+
68164
68206
  See recognized syntax at https://syntax.abaplint.org`,
68165
68207
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68166
68208
  };
@@ -68245,7 +68287,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68245
68287
  return {
68246
68288
  key: "parser_missing_space",
68247
68289
  title: "Parser Error, missing space",
68248
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68290
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68249
68291
  This rule makes sure the spaces are consistently required across the language.`,
68250
68292
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68251
68293
  badExample: `IF ( foo = 'bar').`,
@@ -68657,25 +68699,25 @@ class PreferInline {
68657
68699
  key: "prefer_inline",
68658
68700
  title: "Prefer Inline Declarations",
68659
68701
  shortDescription: `Prefer inline to up-front declarations.`,
68660
- extendedInformation: `EXPERIMENTAL
68661
-
68662
- Activates if language version is v740sp02 or above.
68663
-
68664
- Variables must be local(METHOD or FORM).
68665
-
68666
- No generic or void typed variables. No syntax errors.
68667
-
68668
- First position used must be a full/pure write.
68669
-
68670
- Move statment is not a cast(?=)
68671
-
68702
+ extendedInformation: `EXPERIMENTAL
68703
+
68704
+ Activates if language version is v740sp02 or above.
68705
+
68706
+ Variables must be local(METHOD or FORM).
68707
+
68708
+ No generic or void typed variables. No syntax errors.
68709
+
68710
+ First position used must be a full/pure write.
68711
+
68712
+ Move statment is not a cast(?=)
68713
+
68672
68714
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
68673
68715
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
68674
- badExample: `DATA foo TYPE i.
68675
- foo = 2.
68676
- DATA percentage TYPE decfloat34.
68716
+ badExample: `DATA foo TYPE i.
68717
+ foo = 2.
68718
+ DATA percentage TYPE decfloat34.
68677
68719
  percentage = ( comment_number / abs_statement_number ) * 100.`,
68678
- goodExample: `DATA(foo) = 2.
68720
+ goodExample: `DATA(foo) = 2.
68679
68721
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
68680
68722
  };
68681
68723
  }
@@ -68889,18 +68931,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
68889
68931
  key: "prefer_is_not",
68890
68932
  title: "Prefer IS NOT to NOT IS",
68891
68933
  shortDescription: `Prefer IS NOT to NOT IS`,
68892
- extendedInformation: `
68893
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
68894
-
68934
+ extendedInformation: `
68935
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
68936
+
68895
68937
  "if not is_valid( )." examples are skipped`,
68896
68938
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
68897
- goodExample: `IF variable IS NOT INITIAL.
68898
- IF variable NP 'TODO*'.
68899
- IF variable <> 42.
68939
+ goodExample: `IF variable IS NOT INITIAL.
68940
+ IF variable NP 'TODO*'.
68941
+ IF variable <> 42.
68900
68942
  IF variable CO 'hello'.`,
68901
- badExample: `IF NOT variable IS INITIAL.
68902
- IF NOT variable CP 'TODO*'.
68903
- IF NOT variable = 42.
68943
+ badExample: `IF NOT variable IS INITIAL.
68944
+ IF NOT variable CP 'TODO*'.
68945
+ IF NOT variable = 42.
68904
68946
  IF NOT variable CA 'hello'.`,
68905
68947
  };
68906
68948
  }
@@ -69088,14 +69130,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69088
69130
  key: "prefer_raise_exception_new",
69089
69131
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69090
69132
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69091
- extendedInformation: `
69092
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69093
-
69133
+ extendedInformation: `
69134
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69135
+
69094
69136
  From 752 and up`,
69095
69137
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69096
69138
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69097
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69098
- EXPORTING
69139
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69140
+ EXPORTING
69099
69141
  previous = exception.`,
69100
69142
  };
69101
69143
  }
@@ -69173,12 +69215,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69173
69215
  key: "prefer_returning_to_exporting",
69174
69216
  title: "Prefer RETURNING to EXPORTING",
69175
69217
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69176
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69218
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69177
69219
  https://docs.abapopenchecks.org/checks/44/`,
69178
69220
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69179
- badExample: `CLASS lcl DEFINITION.
69180
- PUBLIC SECTION.
69181
- METHODS test EXPORTING ev_foo TYPE i.
69221
+ badExample: `CLASS lcl DEFINITION.
69222
+ PUBLIC SECTION.
69223
+ METHODS test EXPORTING ev_foo TYPE i.
69182
69224
  ENDCLASS.`,
69183
69225
  };
69184
69226
  }
@@ -69274,8 +69316,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69274
69316
  key: "prefer_xsdbool",
69275
69317
  title: "Prefer xsdbool over boolc",
69276
69318
  shortDescription: `Prefer xsdbool over boolc`,
69277
- extendedInformation: `Activates if language version is v740sp08 or above.
69278
-
69319
+ extendedInformation: `Activates if language version is v740sp08 or above.
69320
+
69279
69321
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69280
69322
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69281
69323
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69347,9 +69389,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69347
69389
  title: "Preferred compare operator",
69348
69390
  shortDescription: `Configure undesired operator variants`,
69349
69391
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69350
- badExample: `IF foo EQ bar.
69392
+ badExample: `IF foo EQ bar.
69351
69393
  ENDIF.`,
69352
- goodExample: `IF foo = bar.
69394
+ goodExample: `IF foo = bar.
69353
69395
  ENDIF.`,
69354
69396
  };
69355
69397
  }
@@ -69573,26 +69615,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
69573
69615
  key: "reduce_procedural_code",
69574
69616
  title: "Reduce procedural code",
69575
69617
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
69576
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
69577
-
69578
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
69579
-
69618
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
69619
+
69620
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
69621
+
69580
69622
  Comments are not counted as statements.`,
69581
69623
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
69582
- badExample: `FORM foo.
69583
- DATA lv_bar TYPE i.
69584
- lv_bar = 2 + 2.
69585
- IF lv_bar = 4.
69586
- WRITE 'hello world'.
69587
- ENDIF.
69588
- DATA lv_bar TYPE i.
69589
- lv_bar = 2 + 2.
69590
- IF lv_bar = 4.
69591
- WRITE 'hello world'.
69592
- ENDIF.
69624
+ badExample: `FORM foo.
69625
+ DATA lv_bar TYPE i.
69626
+ lv_bar = 2 + 2.
69627
+ IF lv_bar = 4.
69628
+ WRITE 'hello world'.
69629
+ ENDIF.
69630
+ DATA lv_bar TYPE i.
69631
+ lv_bar = 2 + 2.
69632
+ IF lv_bar = 4.
69633
+ WRITE 'hello world'.
69634
+ ENDIF.
69593
69635
  ENDFORM.`,
69594
- goodExample: `FORM foo.
69595
- NEW zcl_global_class( )->run_logic( ).
69636
+ goodExample: `FORM foo.
69637
+ NEW zcl_global_class( )->run_logic( ).
69596
69638
  ENDFORM.`,
69597
69639
  };
69598
69640
  }
@@ -69836,10 +69878,10 @@ class RemoveDescriptions {
69836
69878
  return {
69837
69879
  key: "remove_descriptions",
69838
69880
  title: "Remove descriptions",
69839
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
69840
-
69841
- Class descriptions are required, see rule description_empty.
69842
-
69881
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
69882
+
69883
+ Class descriptions are required, see rule description_empty.
69884
+
69843
69885
  Consider using ABAP Doc for documentation.`,
69844
69886
  tags: [],
69845
69887
  };
@@ -69964,14 +70006,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
69964
70006
  tags: [_irule_1.RuleTag.SingleFile],
69965
70007
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
69966
70008
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
69967
- badExample: `CALL FUNCTION 'ZRFC'
70009
+ badExample: `CALL FUNCTION 'ZRFC'
69968
70010
  DESTINATION lv_rfc.`,
69969
- goodExample: `CALL FUNCTION 'ZRFC'
69970
- DESTINATION lv_rfc
69971
- EXCEPTIONS
69972
- system_failure = 1 MESSAGE msg
69973
- communication_failure = 2 MESSAGE msg
69974
- resource_failure = 3
70011
+ goodExample: `CALL FUNCTION 'ZRFC'
70012
+ DESTINATION lv_rfc
70013
+ EXCEPTIONS
70014
+ system_failure = 1 MESSAGE msg
70015
+ communication_failure = 2 MESSAGE msg
70016
+ resource_failure = 3
69975
70017
  OTHERS = 4.`,
69976
70018
  };
69977
70019
  }
@@ -70055,11 +70097,11 @@ class SelectAddOrderBy {
70055
70097
  key: "select_add_order_by",
70056
70098
  title: "SELECT add ORDER BY",
70057
70099
  shortDescription: `SELECTs add ORDER BY clause`,
70058
- extendedInformation: `
70059
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70060
-
70061
- add ORDER BY PRIMARY KEY if in doubt
70062
-
70100
+ extendedInformation: `
70101
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70102
+
70103
+ add ORDER BY PRIMARY KEY if in doubt
70104
+
70063
70105
  If the target is a sorted/hashed table, no issue is reported`,
70064
70106
  tags: [_irule_1.RuleTag.SingleFile],
70065
70107
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70190,14 +70232,14 @@ class SelectPerformance {
70190
70232
  key: "select_performance",
70191
70233
  title: "SELECT performance",
70192
70234
  shortDescription: `Various checks regarding SELECT performance.`,
70193
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70194
-
70235
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70236
+
70195
70237
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70196
70238
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70197
- badExample: `SELECT field1, field2 FROM table
70198
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70239
+ badExample: `SELECT field1, field2 FROM table
70240
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70199
70241
  ENDSELECT.`,
70200
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70242
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70201
70243
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70202
70244
  };
70203
70245
  }
@@ -70311,8 +70353,8 @@ class SelectSingleFullKey {
70311
70353
  key: "select_single_full_key",
70312
70354
  title: "Detect SELECT SINGLE which are possibily not unique",
70313
70355
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70314
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70315
-
70356
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70357
+
70316
70358
  If the statement contains a JOIN it is not checked`,
70317
70359
  pseudoComment: "EC CI_NOORDER",
70318
70360
  tags: [_irule_1.RuleTag.Quickfix],
@@ -70736,8 +70778,8 @@ class SICFConsistency {
70736
70778
  key: "sicf_consistency",
70737
70779
  title: "SICF consistency",
70738
70780
  shortDescription: `Checks the validity of ICF services`,
70739
- extendedInformation: `* Class defined in handler must exist
70740
- * Class must not have any syntax errors
70781
+ extendedInformation: `* Class defined in handler must exist
70782
+ * Class must not have any syntax errors
70741
70783
  * Class must implement interface IF_HTTP_EXTENSION`,
70742
70784
  };
70743
70785
  }
@@ -70849,23 +70891,23 @@ class SlowParameterPassing {
70849
70891
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
70850
70892
  extendedInformation: `Method parameters defined in interfaces is not checked`,
70851
70893
  tags: [_irule_1.RuleTag.Performance],
70852
- badExample: `CLASS lcl DEFINITION.
70853
- PUBLIC SECTION.
70854
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
70855
- ENDCLASS.
70856
- CLASS lcl IMPLEMENTATION.
70857
- METHOD bar.
70858
- WRITE sdf.
70859
- ENDMETHOD.
70894
+ badExample: `CLASS lcl DEFINITION.
70895
+ PUBLIC SECTION.
70896
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
70897
+ ENDCLASS.
70898
+ CLASS lcl IMPLEMENTATION.
70899
+ METHOD bar.
70900
+ WRITE sdf.
70901
+ ENDMETHOD.
70860
70902
  ENDCLASS.`,
70861
- goodExample: `CLASS lcl DEFINITION.
70862
- PUBLIC SECTION.
70863
- METHODS bar IMPORTING sdf TYPE string.
70864
- ENDCLASS.
70865
- CLASS lcl IMPLEMENTATION.
70866
- METHOD bar.
70867
- WRITE sdf.
70868
- ENDMETHOD.
70903
+ goodExample: `CLASS lcl DEFINITION.
70904
+ PUBLIC SECTION.
70905
+ METHODS bar IMPORTING sdf TYPE string.
70906
+ ENDCLASS.
70907
+ CLASS lcl IMPLEMENTATION.
70908
+ METHOD bar.
70909
+ WRITE sdf.
70910
+ ENDMETHOD.
70869
70911
  ENDCLASS.`,
70870
70912
  };
70871
70913
  }
@@ -71122,8 +71164,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71122
71164
  key: "space_before_dot",
71123
71165
  title: "Space before dot",
71124
71166
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71125
- extendedInformation: `
71126
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71167
+ extendedInformation: `
71168
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71127
71169
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71128
71170
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71129
71171
  badExample: `WRITE bar .`,
@@ -71309,12 +71351,12 @@ class SQLValueConversion {
71309
71351
  key: "sql_value_conversion",
71310
71352
  title: "Implicit SQL Value Conversion",
71311
71353
  shortDescription: `Ensure types match when selecting from database`,
71312
- extendedInformation: `
71313
- * Integer to CHAR conversion
71314
- * Integer to NUMC conversion
71315
- * NUMC to Integer conversion
71316
- * CHAR to Integer conversion
71317
- * Source field longer than database field, CHAR -> CHAR
71354
+ extendedInformation: `
71355
+ * Integer to CHAR conversion
71356
+ * Integer to NUMC conversion
71357
+ * NUMC to Integer conversion
71358
+ * CHAR to Integer conversion
71359
+ * Source field longer than database field, CHAR -> CHAR
71318
71360
  * Source field longer than database field, NUMC -> NUMC`,
71319
71361
  tags: [],
71320
71362
  };
@@ -71386,7 +71428,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71386
71428
  key: "start_at_tab",
71387
71429
  title: "Start at tab",
71388
71430
  shortDescription: `Checks that statements start at tabstops.`,
71389
- extendedInformation: `Reports max 100 issues per file
71431
+ extendedInformation: `Reports max 100 issues per file
71390
71432
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71391
71433
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71392
71434
  badExample: ` WRITE a.`,
@@ -71563,12 +71605,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
71563
71605
  key: "strict_sql",
71564
71606
  title: "Strict SQL",
71565
71607
  shortDescription: `Strict SQL`,
71566
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
71567
-
71568
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
71569
-
71570
- Also see separate rule sql_escape_host_variables
71571
-
71608
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
71609
+
71610
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
71611
+
71612
+ Also see separate rule sql_escape_host_variables
71613
+
71572
71614
  Activates from v750 and up`,
71573
71615
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
71574
71616
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -71822,11 +71864,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
71822
71864
  key: "sy_modification",
71823
71865
  title: "Modification of SY fields",
71824
71866
  shortDescription: `Finds modification of sy fields`,
71825
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
71826
-
71867
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
71868
+
71827
71869
  Changes to SY-TVAR* fields are not reported`,
71828
71870
  tags: [_irule_1.RuleTag.SingleFile],
71829
- badExample: `sy-uname = 2.
71871
+ badExample: `sy-uname = 2.
71830
71872
  sy = sy.`,
71831
71873
  };
71832
71874
  }
@@ -71888,8 +71930,8 @@ class TABLEnhancementCategory {
71888
71930
  key: "tabl_enhancement_category",
71889
71931
  title: "TABL enhancement category must be set",
71890
71932
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
71891
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
71892
-
71933
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
71934
+
71893
71935
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
71894
71936
  tags: [],
71895
71937
  };
@@ -71954,8 +71996,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
71954
71996
  shortDescription: `TABLES are always global, so declare them globally`,
71955
71997
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
71956
71998
  tags: [_irule_1.RuleTag.SingleFile],
71957
- badExample: `FORM foo.
71958
- TABLES t100.
71999
+ badExample: `FORM foo.
72000
+ TABLES t100.
71959
72001
  ENDFORM.`,
71960
72002
  goodExample: `TABLES t000.`,
71961
72003
  };
@@ -72083,9 +72125,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72083
72125
  title: "Type FORM parameters",
72084
72126
  shortDescription: `Checks for untyped FORM parameters`,
72085
72127
  tags: [_irule_1.RuleTag.SingleFile],
72086
- badExample: `FORM foo USING bar.
72128
+ badExample: `FORM foo USING bar.
72087
72129
  ENDFORM.`,
72088
- goodExample: `FORM foo USING bar TYPE string.
72130
+ goodExample: `FORM foo USING bar TYPE string.
72089
72131
  ENDFORM.`,
72090
72132
  };
72091
72133
  }
@@ -72758,38 +72800,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
72758
72800
  key: "unnecessary_pragma",
72759
72801
  title: "Unnecessary Pragma",
72760
72802
  shortDescription: `Finds pragmas which can be removed`,
72761
- extendedInformation: `* NO_HANDLER with handler
72762
-
72763
- * NEEDED without definition
72764
-
72765
- * NO_TEXT without texts
72766
-
72767
- * SUBRC_OK where sy-subrc is checked
72768
-
72803
+ extendedInformation: `* NO_HANDLER with handler
72804
+
72805
+ * NEEDED without definition
72806
+
72807
+ * NO_TEXT without texts
72808
+
72809
+ * SUBRC_OK where sy-subrc is checked
72810
+
72769
72811
  NO_HANDLER inside macros are not checked`,
72770
72812
  tags: [_irule_1.RuleTag.SingleFile],
72771
- badExample: `TRY.
72772
- ...
72773
- CATCH zcx_abapgit_exception ##NO_HANDLER.
72774
- RETURN. " it has a handler
72775
- ENDTRY.
72776
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
72777
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
72778
- IF sy-subrc <> 0.
72813
+ badExample: `TRY.
72814
+ ...
72815
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
72816
+ RETURN. " it has a handler
72817
+ ENDTRY.
72818
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
72819
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
72820
+ IF sy-subrc <> 0.
72779
72821
  ENDIF.`,
72780
- goodExample: `TRY.
72781
- ...
72782
- CATCH zcx_abapgit_exception.
72783
- RETURN.
72784
- ENDTRY.
72785
- MESSAGE w125(zbar) WITH c_foo INTO message.
72786
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
72787
- IF sy-subrc <> 0.
72788
- ENDIF.
72789
-
72790
- DATA: BEGIN OF blah ##NEEDED,
72791
- test1 TYPE string,
72792
- test2 TYPE string,
72822
+ goodExample: `TRY.
72823
+ ...
72824
+ CATCH zcx_abapgit_exception.
72825
+ RETURN.
72826
+ ENDTRY.
72827
+ MESSAGE w125(zbar) WITH c_foo INTO message.
72828
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
72829
+ IF sy-subrc <> 0.
72830
+ ENDIF.
72831
+
72832
+ DATA: BEGIN OF blah ##NEEDED,
72833
+ test1 TYPE string,
72834
+ test2 TYPE string,
72793
72835
  END OF blah.`,
72794
72836
  };
72795
72837
  }
@@ -72956,18 +72998,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
72956
72998
  shortDescription: `Finds unnecessary RETURN statements`,
72957
72999
  extendedInformation: `Finds unnecessary RETURN statements`,
72958
73000
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
72959
- badExample: `FORM hello1.
72960
- WRITE 'world'.
72961
- RETURN.
72962
- ENDFORM.
72963
-
72964
- FORM foo.
72965
- IF 1 = 2.
72966
- RETURN.
72967
- ENDIF.
73001
+ badExample: `FORM hello1.
73002
+ WRITE 'world'.
73003
+ RETURN.
73004
+ ENDFORM.
73005
+
73006
+ FORM foo.
73007
+ IF 1 = 2.
73008
+ RETURN.
73009
+ ENDIF.
72968
73010
  ENDFORM.`,
72969
- goodExample: `FORM hello2.
72970
- WRITE 'world'.
73011
+ goodExample: `FORM hello2.
73012
+ WRITE 'world'.
72971
73013
  ENDFORM.`,
72972
73014
  };
72973
73015
  }
@@ -73318,13 +73360,13 @@ class UnusedMacros {
73318
73360
  title: "Unused macros",
73319
73361
  shortDescription: `Checks for unused macro definitions definitions`,
73320
73362
  tags: [_irule_1.RuleTag.Quickfix],
73321
- badExample: `DEFINE foobar1.
73322
- WRITE 'hello'.
73363
+ badExample: `DEFINE foobar1.
73364
+ WRITE 'hello'.
73323
73365
  END-OF-DEFINITION.`,
73324
- goodExample: `DEFINE foobar2.
73325
- WRITE 'hello'.
73326
- END-OF-DEFINITION.
73327
-
73366
+ goodExample: `DEFINE foobar2.
73367
+ WRITE 'hello'.
73368
+ END-OF-DEFINITION.
73369
+
73328
73370
  foobar2.`,
73329
73371
  };
73330
73372
  }
@@ -73432,17 +73474,17 @@ class UnusedMethods {
73432
73474
  key: "unused_methods",
73433
73475
  title: "Unused methods",
73434
73476
  shortDescription: `Checks for unused methods`,
73435
- extendedInformation: `Checks private and protected methods.
73436
-
73437
- Unused methods are not reported if the object contains parser or syntax errors.
73438
-
73439
- Skips:
73440
- * methods FOR TESTING
73441
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73442
- * class_constructor + constructor methods
73443
- * event handlers
73444
- * methods that are redefined
73445
- * INCLUDEs
73477
+ extendedInformation: `Checks private and protected methods.
73478
+
73479
+ Unused methods are not reported if the object contains parser or syntax errors.
73480
+
73481
+ Skips:
73482
+ * methods FOR TESTING
73483
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73484
+ * class_constructor + constructor methods
73485
+ * event handlers
73486
+ * methods that are redefined
73487
+ * INCLUDEs
73446
73488
  `,
73447
73489
  tags: [],
73448
73490
  pragma: "##CALLED",
@@ -73876,23 +73918,23 @@ class UnusedVariables {
73876
73918
  key: "unused_variables",
73877
73919
  title: "Unused variables",
73878
73920
  shortDescription: `Checks for unused variables and constants`,
73879
- extendedInformation: `Skips event parameters.
73880
-
73881
- Note that this currently does not work if the source code uses macros.
73882
-
73883
- Unused variables are not reported if the object contains parser or syntax errors.
73884
-
73921
+ extendedInformation: `Skips event parameters.
73922
+
73923
+ Note that this currently does not work if the source code uses macros.
73924
+
73925
+ Unused variables are not reported if the object contains parser or syntax errors.
73926
+
73885
73927
  Errors found in INCLUDES are reported for the main program.`,
73886
73928
  tags: [_irule_1.RuleTag.Quickfix],
73887
73929
  pragma: "##NEEDED",
73888
73930
  pseudoComment: "EC NEEDED",
73889
- badExample: `DATA: BEGIN OF blah1,
73890
- test TYPE string,
73891
- test2 TYPE string,
73931
+ badExample: `DATA: BEGIN OF blah1,
73932
+ test TYPE string,
73933
+ test2 TYPE string,
73892
73934
  END OF blah1.`,
73893
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
73894
- test TYPE string,
73895
- test2 TYPE string,
73935
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
73936
+ test TYPE string,
73937
+ test2 TYPE string,
73896
73938
  END OF blah2.`,
73897
73939
  };
73898
73940
  }
@@ -74111,15 +74153,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74111
74153
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74112
74154
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74113
74155
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74114
- badExample: `IF line IS INITIAL.
74115
- has_entries = abap_false.
74116
- ELSE.
74117
- has_entries = abap_true.
74118
- ENDIF.
74119
-
74156
+ badExample: `IF line IS INITIAL.
74157
+ has_entries = abap_false.
74158
+ ELSE.
74159
+ has_entries = abap_true.
74160
+ ENDIF.
74161
+
74120
74162
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74121
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74122
-
74163
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74164
+
74123
74165
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74124
74166
  };
74125
74167
  }
@@ -74237,15 +74279,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74237
74279
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74238
74280
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74239
74281
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74240
- badExample: `INTERFACE lif.
74241
- METHODS load_data
74242
- EXCEPTIONS
74243
- invalid_parameter.
74282
+ badExample: `INTERFACE lif.
74283
+ METHODS load_data
74284
+ EXCEPTIONS
74285
+ invalid_parameter.
74244
74286
  ENDINTERFACE.`,
74245
- goodExample: `INTERFACE lif.
74246
- METHODS load_data
74247
- RAISING
74248
- cx_something.
74287
+ goodExample: `INTERFACE lif.
74288
+ METHODS load_data
74289
+ RAISING
74290
+ cx_something.
74249
74291
  ENDINTERFACE.`,
74250
74292
  };
74251
74293
  }
@@ -74305,15 +74347,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74305
74347
  key: "use_line_exists",
74306
74348
  title: "Use line_exists",
74307
74349
  shortDescription: `Use line_exists, from 740sp02 and up`,
74308
- extendedInformation: `
74309
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74310
-
74350
+ extendedInformation: `
74351
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74352
+
74311
74353
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74312
74354
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74313
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74314
- IF sy-subrc = 0.
74355
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74356
+ IF sy-subrc = 0.
74315
74357
  ENDIF.`,
74316
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74358
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74317
74359
  ENDIF.`,
74318
74360
  };
74319
74361
  }
@@ -74423,10 +74465,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
74423
74465
  key: "use_new",
74424
74466
  title: "Use NEW",
74425
74467
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
74426
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74427
-
74428
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74429
-
74468
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74469
+
74470
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74471
+
74430
74472
  Applicable from v740sp02 and up`,
74431
74473
  badExample: `CREATE OBJECT ref.`,
74432
74474
  goodExample: `ref = NEW #( ).`,
@@ -74524,13 +74566,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
74524
74566
  title: "WHEN OTHERS last",
74525
74567
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
74526
74568
  tags: [_irule_1.RuleTag.SingleFile],
74527
- badExample: `CASE bar.
74528
- WHEN OTHERS.
74529
- WHEN 2.
74569
+ badExample: `CASE bar.
74570
+ WHEN OTHERS.
74571
+ WHEN 2.
74530
74572
  ENDCASE.`,
74531
- goodExample: `CASE bar.
74532
- WHEN 2.
74533
- WHEN OTHERS.
74573
+ goodExample: `CASE bar.
74574
+ WHEN 2.
74575
+ WHEN OTHERS.
74534
74576
  ENDCASE.`,
74535
74577
  };
74536
74578
  }