@abaplint/cli 2.113.81 → 2.113.83

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 +968 -871
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -15090,7 +15090,8 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
15090
15090
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
15091
15091
  class Module {
15092
15092
  getMatcher() {
15093
- const ret = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("INPUT", "OUTPUT", "ON CHAIN-REQUEST")));
15093
+ const sw = (0, combi_1.seq)("SWITCH", expressions_1.NamespaceSimpleName);
15094
+ const ret = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("INPUT", "OUTPUT", "ON CHAIN-REQUEST", "ON CHAIN-INPUT", sw)));
15094
15095
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
15095
15096
  }
15096
15097
  }
@@ -27364,10 +27365,55 @@ class Select {
27364
27365
  for (const s of node.findDirectExpressions(Expressions.SQLOrderBy)) {
27365
27366
  new sql_order_by_1.SQLOrderBy().runSyntax(s, input);
27366
27367
  }
27368
+ if (this.isStrictMode(node)) {
27369
+ this.strictModeChecks(node, input);
27370
+ }
27367
27371
  if (input.scope.getType() === _scope_type_1.ScopeType.OpenSQL) {
27368
27372
  input.scope.pop(node.getLastToken().getEnd());
27369
27373
  }
27370
27374
  }
27375
+ // there are multiple rules, but gotta start somewhere
27376
+ isStrictMode(node) {
27377
+ const into = node.findDirectExpressionsMulti([Expressions.SQLIntoList, Expressions.SQLIntoStructure, Expressions.SQLIntoTable])[0];
27378
+ const where = node.findDirectExpression(Expressions.SQLCond);
27379
+ // INTO is after WHERE
27380
+ if (into && where && into.getFirstToken().getStart().isAfter(where.getFirstToken().getStart())) {
27381
+ return true;
27382
+ }
27383
+ // FIELDS is used
27384
+ if (node.findFirstExpression(Expressions.SQLFields)) {
27385
+ return true;
27386
+ }
27387
+ // any field is escaped with @
27388
+ for (const source of node.findAllExpressions(Expressions.SQLSource)) {
27389
+ if (source.getFirstToken().getStr() === "@") {
27390
+ return true;
27391
+ }
27392
+ }
27393
+ // comma used in FROM
27394
+ const fieldList = node.findFirstExpression(Expressions.SQLFieldList);
27395
+ if (fieldList && fieldList.findDirectTokenByText(",")) {
27396
+ return true;
27397
+ }
27398
+ return false;
27399
+ }
27400
+ strictModeChecks(node, input) {
27401
+ const sources = node.findAllExpressions(Expressions.SQLSource);
27402
+ for (const source of sources) {
27403
+ const first = source.getFirstChild();
27404
+ if ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SQLAliasField) {
27405
+ continue;
27406
+ }
27407
+ else if ((first === null || first === void 0 ? void 0 : first.getFirstToken().getStr()) === "@") {
27408
+ continue;
27409
+ }
27410
+ else if ((first === null || first === void 0 ? void 0 : first.getChildren()[0].get()) instanceof Expressions.Constant) {
27411
+ continue;
27412
+ }
27413
+ const message = `SELECT: "${source.concatTokens()}" must be escaped with @ in strict mode`;
27414
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
27415
+ }
27416
+ }
27371
27417
  handleInto(node, input, fields, dbSources) {
27372
27418
  const intoTable = node.findDirectExpression(Expressions.SQLIntoTable);
27373
27419
  if (intoTable) {
@@ -33195,6 +33241,7 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
33195
33241
  const select_1 = __webpack_require__(/*! ../expressions/select */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/select.js");
33196
33242
  class Select {
33197
33243
  runSyntax(node, input) {
33244
+ // for UNION statements there are multiple select parts
33198
33245
  const selects = node.findDirectExpressions(Expressions.Select);
33199
33246
  for (let i = 0; i < selects.length; i++) {
33200
33247
  const last = i === selects.length - 1;
@@ -35673,13 +35720,13 @@ class FlowGraph {
35673
35720
  this.label = label;
35674
35721
  }
35675
35722
  toDigraph() {
35676
- return `digraph G {
35677
- labelloc="t";
35678
- label="${this.label}";
35679
- graph [fontname = "helvetica"];
35680
- node [fontname = "helvetica", shape="box"];
35681
- edge [fontname = "helvetica"];
35682
- ${this.toTextEdges()}
35723
+ return `digraph G {
35724
+ labelloc="t";
35725
+ label="${this.label}";
35726
+ graph [fontname = "helvetica"];
35727
+ node [fontname = "helvetica", shape="box"];
35728
+ edge [fontname = "helvetica"];
35729
+ ${this.toTextEdges()}
35683
35730
  }`;
35684
35731
  }
35685
35732
  listSources(node) {
@@ -44102,13 +44149,13 @@ class Help {
44102
44149
  /////////////////////////////////////////////////
44103
44150
  static dumpABAP(file, reg, textDocument, position) {
44104
44151
  let content = "";
44105
- content = `
44106
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
44107
- <a href="#_statements" rel="no-refresh">Statements</a> |
44108
- <a href="#_structure" rel="no-refresh">Structure</a> |
44109
- <a href="#_files" rel="no-refresh">Files</a> |
44110
- <a href="#_info" rel="no-refresh">Info Dump</a>
44111
- <hr>
44152
+ content = `
44153
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
44154
+ <a href="#_statements" rel="no-refresh">Statements</a> |
44155
+ <a href="#_structure" rel="no-refresh">Structure</a> |
44156
+ <a href="#_files" rel="no-refresh">Files</a> |
44157
+ <a href="#_info" rel="no-refresh">Info Dump</a>
44158
+ <hr>
44112
44159
  ` +
44113
44160
  "<tt>" + textDocument.uri + " (" +
44114
44161
  (position.line + 1) + ", " +
@@ -44263,9 +44310,9 @@ class Help {
44263
44310
  return ret + "</ul>";
44264
44311
  }
44265
44312
  static tokens(file) {
44266
- let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
44267
- <td><b>Row</b></td><td><b>Column</b></td>
44268
- <td><b>vRow</b></td><td><b>vColumn</b></td>
44313
+ let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
44314
+ <td><b>Row</b></td><td><b>Column</b></td>
44315
+ <td><b>vRow</b></td><td><b>vColumn</b></td>
44269
44316
  </tr>`;
44270
44317
  for (const token of file.getTokens()) {
44271
44318
  const tStart = token.getStart();
@@ -53581,7 +53628,7 @@ class Registry {
53581
53628
  }
53582
53629
  static abaplintVersion() {
53583
53630
  // magic, see build script "version.sh"
53584
- return "2.113.81";
53631
+ return "2.113.83";
53585
53632
  }
53586
53633
  getDDICReferences() {
53587
53634
  return this.ddicReferences;
@@ -53900,10 +53947,10 @@ class SevenBitAscii {
53900
53947
  key: "7bit_ascii",
53901
53948
  title: "Check for 7bit ascii",
53902
53949
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53903
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53904
-
53905
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53906
-
53950
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53951
+
53952
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53953
+
53907
53954
  Checkes files with extensions ".abap" and ".asddls"`,
53908
53955
  tags: [_irule_1.RuleTag.SingleFile],
53909
53956
  badExample: `WRITE '뽑'.`,
@@ -54109,10 +54156,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
54109
54156
  key: "abapdoc",
54110
54157
  title: "Check abapdoc",
54111
54158
  shortDescription: `Various checks regarding abapdoc.`,
54112
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
54113
-
54114
- Plus class and interface definitions.
54115
-
54159
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
54160
+
54161
+ Plus class and interface definitions.
54162
+
54116
54163
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
54117
54164
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
54118
54165
  };
@@ -54249,27 +54296,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
54249
54296
  title: "Add test attributes for tests classes with test methods",
54250
54297
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
54251
54298
  tags: [_irule_1.RuleTag.SingleFile],
54252
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
54253
- PUBLIC SECTION.
54254
- PROTECTED SECTION.
54255
- PRIVATE SECTION.
54256
- METHODS test FOR TESTING RAISING cx_static_check.
54257
- ENDCLASS.
54258
-
54259
- CLASS ltcl_test1 IMPLEMENTATION.
54260
- METHOD test.
54261
- ENDMETHOD.
54299
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
54300
+ PUBLIC SECTION.
54301
+ PROTECTED SECTION.
54302
+ PRIVATE SECTION.
54303
+ METHODS test FOR TESTING RAISING cx_static_check.
54304
+ ENDCLASS.
54305
+
54306
+ CLASS ltcl_test1 IMPLEMENTATION.
54307
+ METHOD test.
54308
+ ENDMETHOD.
54262
54309
  ENDCLASS.`,
54263
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
54264
- PUBLIC SECTION.
54265
- PROTECTED SECTION.
54266
- PRIVATE SECTION.
54267
- METHODS test FOR TESTING RAISING cx_static_check.
54268
- ENDCLASS.
54269
-
54270
- CLASS ltcl_test2 IMPLEMENTATION.
54271
- METHOD test.
54272
- ENDMETHOD.
54310
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
54311
+ PUBLIC SECTION.
54312
+ PROTECTED SECTION.
54313
+ PRIVATE SECTION.
54314
+ METHODS test FOR TESTING RAISING cx_static_check.
54315
+ ENDCLASS.
54316
+
54317
+ CLASS ltcl_test2 IMPLEMENTATION.
54318
+ METHOD test.
54319
+ ENDMETHOD.
54273
54320
  ENDCLASS.`,
54274
54321
  };
54275
54322
  }
@@ -54355,49 +54402,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
54355
54402
  key: "align_parameters",
54356
54403
  title: "Align Parameters",
54357
54404
  shortDescription: `Checks for vertially aligned parameters`,
54358
- extendedInformation: `Checks:
54359
- * function module calls
54360
- * method calls
54361
- * VALUE constructors
54362
- * NEW constructors
54363
- * RAISE EXCEPTION statements
54364
- * CREATE OBJECT statements
54365
- * RAISE EVENT statements
54366
-
54367
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
54368
-
54369
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
54370
-
54371
- If parameters are on the same row, no issues are reported, see
54405
+ extendedInformation: `Checks:
54406
+ * function module calls
54407
+ * method calls
54408
+ * VALUE constructors
54409
+ * NEW constructors
54410
+ * RAISE EXCEPTION statements
54411
+ * CREATE OBJECT statements
54412
+ * RAISE EVENT statements
54413
+
54414
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
54415
+
54416
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
54417
+
54418
+ If parameters are on the same row, no issues are reported, see
54372
54419
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
54373
54420
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
54374
- badExample: `CALL FUNCTION 'FOOBAR'
54375
- EXPORTING
54376
- foo = 2
54377
- parameter = 3.
54378
-
54379
- foobar( moo = 1
54380
- param = 1 ).
54381
-
54382
- foo = VALUE #(
54383
- foo = bar
54421
+ badExample: `CALL FUNCTION 'FOOBAR'
54422
+ EXPORTING
54423
+ foo = 2
54424
+ parameter = 3.
54425
+
54426
+ foobar( moo = 1
54427
+ param = 1 ).
54428
+
54429
+ foo = VALUE #(
54430
+ foo = bar
54384
54431
  moo = 2 ).`,
54385
- goodExample: `CALL FUNCTION 'FOOBAR'
54386
- EXPORTING
54387
- foo = 2
54388
- parameter = 3.
54389
-
54390
- foobar( moo = 1
54391
- param = 1 ).
54392
-
54393
- foo = VALUE #(
54394
- foo = bar
54395
- moo = 2 ).
54396
-
54397
- DATA(sdf) = VALUE type(
54398
- common_val = 2
54399
- another_common = 5
54400
- ( row_value = 4
54432
+ goodExample: `CALL FUNCTION 'FOOBAR'
54433
+ EXPORTING
54434
+ foo = 2
54435
+ parameter = 3.
54436
+
54437
+ foobar( moo = 1
54438
+ param = 1 ).
54439
+
54440
+ foo = VALUE #(
54441
+ foo = bar
54442
+ moo = 2 ).
54443
+
54444
+ DATA(sdf) = VALUE type(
54445
+ common_val = 2
54446
+ another_common = 5
54447
+ ( row_value = 4
54401
54448
  value_foo = 5 ) ).`,
54402
54449
  };
54403
54450
  }
@@ -54831,37 +54878,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
54831
54878
  key: "align_type_expressions",
54832
54879
  title: "Align TYPE expressions",
54833
54880
  shortDescription: `Align TYPE expressions in statements`,
54834
- extendedInformation: `
54835
- Currently works for METHODS + BEGIN OF
54836
-
54837
- If BEGIN OF has an INCLUDE TYPE its ignored
54838
-
54839
- Also note that clean ABAP does not recommend aligning TYPE clauses:
54881
+ extendedInformation: `
54882
+ Currently works for METHODS + BEGIN OF
54883
+
54884
+ If BEGIN OF has an INCLUDE TYPE its ignored
54885
+
54886
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54840
54887
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54841
54888
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
54842
- badExample: `
54843
- TYPES: BEGIN OF foo,
54844
- bar TYPE i,
54845
- foobar TYPE i,
54846
- END OF foo.
54847
-
54848
- INTERFACE lif.
54849
- METHODS bar
54850
- IMPORTING
54851
- foo TYPE i
54852
- foobar TYPE i.
54889
+ badExample: `
54890
+ TYPES: BEGIN OF foo,
54891
+ bar TYPE i,
54892
+ foobar TYPE i,
54893
+ END OF foo.
54894
+
54895
+ INTERFACE lif.
54896
+ METHODS bar
54897
+ IMPORTING
54898
+ foo TYPE i
54899
+ foobar TYPE i.
54853
54900
  ENDINTERFACE.`,
54854
- goodExample: `
54855
- TYPES: BEGIN OF foo,
54856
- bar TYPE i,
54857
- foobar TYPE i,
54858
- END OF foo.
54859
-
54860
- INTERFACE lif.
54861
- METHODS bar
54862
- IMPORTING
54863
- foo TYPE i
54864
- foobar TYPE i.
54901
+ goodExample: `
54902
+ TYPES: BEGIN OF foo,
54903
+ bar TYPE i,
54904
+ foobar TYPE i,
54905
+ END OF foo.
54906
+
54907
+ INTERFACE lif.
54908
+ METHODS bar
54909
+ IMPORTING
54910
+ foo TYPE i
54911
+ foobar TYPE i.
54865
54912
  ENDINTERFACE.`,
54866
54913
  };
54867
54914
  }
@@ -55140,16 +55187,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
55140
55187
  return {
55141
55188
  key: "ambiguous_statement",
55142
55189
  title: "Check for ambigious statements",
55143
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
55144
- Add "TABLE" keyword or "@" for escaping SQL variables
55145
-
55190
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
55191
+ Add "TABLE" keyword or "@" for escaping SQL variables
55192
+
55146
55193
  Only works if the target version is 740sp05 or above`,
55147
55194
  tags: [_irule_1.RuleTag.SingleFile],
55148
- badExample: `DELETE foo FROM bar.
55195
+ badExample: `DELETE foo FROM bar.
55149
55196
  MODIFY foo FROM bar.`,
55150
- goodExample: `DELETE foo FROM @bar.
55151
- DELETE TABLE itab FROM 2.
55152
- MODIFY zfoo FROM @wa.
55197
+ goodExample: `DELETE foo FROM @bar.
55198
+ DELETE TABLE itab FROM 2.
55199
+ MODIFY zfoo FROM @wa.
55153
55200
  MODIFY TABLE foo FROM bar.`,
55154
55201
  };
55155
55202
  }
@@ -55254,16 +55301,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
55254
55301
  key: "avoid_use",
55255
55302
  title: "Avoid use of certain statements",
55256
55303
  shortDescription: `Detects usage of certain statements.`,
55257
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
55258
-
55259
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
55260
-
55261
- STATICS: use CLASS-DATA instead
55262
-
55263
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
55264
-
55265
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
55266
-
55304
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
55305
+
55306
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
55307
+
55308
+ STATICS: use CLASS-DATA instead
55309
+
55310
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
55311
+
55312
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
55313
+
55267
55314
  BREAK points`,
55268
55315
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55269
55316
  };
@@ -55395,11 +55442,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
55395
55442
  title: "Check BEGIN END names",
55396
55443
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
55397
55444
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
55398
- badExample: `DATA: BEGIN OF stru,
55399
- field TYPE i,
55445
+ badExample: `DATA: BEGIN OF stru,
55446
+ field TYPE i,
55400
55447
  END OF structure_not_the_same.`,
55401
- goodExample: `DATA: BEGIN OF stru,
55402
- field TYPE i,
55448
+ goodExample: `DATA: BEGIN OF stru,
55449
+ field TYPE i,
55403
55450
  END OF stru.`,
55404
55451
  };
55405
55452
  }
@@ -55496,20 +55543,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
55496
55543
  title: "BEGIN contains single INCLUDE",
55497
55544
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
55498
55545
  tags: [_irule_1.RuleTag.SingleFile],
55499
- badExample: `TYPES: BEGIN OF dummy1.
55500
- INCLUDE TYPE dselc.
55501
- TYPES: END OF dummy1.
55502
-
55503
- DATA BEGIN OF foo.
55504
- INCLUDE STRUCTURE syst.
55505
- DATA END OF foo.
55506
-
55507
- STATICS BEGIN OF bar.
55508
- INCLUDE STRUCTURE syst.
55546
+ badExample: `TYPES: BEGIN OF dummy1.
55547
+ INCLUDE TYPE dselc.
55548
+ TYPES: END OF dummy1.
55549
+
55550
+ DATA BEGIN OF foo.
55551
+ INCLUDE STRUCTURE syst.
55552
+ DATA END OF foo.
55553
+
55554
+ STATICS BEGIN OF bar.
55555
+ INCLUDE STRUCTURE syst.
55509
55556
  STATICS END OF bar.`,
55510
- goodExample: `DATA BEGIN OF foo.
55511
- DATA field TYPE i.
55512
- INCLUDE STRUCTURE dselc.
55557
+ goodExample: `DATA BEGIN OF foo.
55558
+ DATA field TYPE i.
55559
+ INCLUDE STRUCTURE dselc.
55513
55560
  DATA END OF foo.`,
55514
55561
  };
55515
55562
  }
@@ -55599,9 +55646,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
55599
55646
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
55600
55647
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55601
55648
  badExample: `CALL TRANSACTION 'FOO'.`,
55602
- goodExample: `TRY.
55603
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55604
- CATCH cx_sy_authorization_error.
55649
+ goodExample: `TRY.
55650
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55651
+ CATCH cx_sy_authorization_error.
55605
55652
  ENDTRY.`,
55606
55653
  };
55607
55654
  }
@@ -55666,10 +55713,10 @@ class CDSCommentStyle {
55666
55713
  key: "cds_comment_style",
55667
55714
  title: "CDS Comment Style",
55668
55715
  shortDescription: `Check for obsolete comment style`,
55669
- extendedInformation: `Check for obsolete comment style
55670
-
55671
- Comments starting with "--" are considered obsolete
55672
-
55716
+ extendedInformation: `Check for obsolete comment style
55717
+
55718
+ Comments starting with "--" are considered obsolete
55719
+
55673
55720
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
55674
55721
  tags: [_irule_1.RuleTag.SingleFile],
55675
55722
  badExample: "-- this is a comment",
@@ -55735,10 +55782,10 @@ class CDSLegacyView {
55735
55782
  key: "cds_legacy_view",
55736
55783
  title: "CDS Legacy View",
55737
55784
  shortDescription: `Identify CDS Legacy Views`,
55738
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55739
-
55740
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55741
-
55785
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55786
+
55787
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55788
+
55742
55789
  v755 and up`,
55743
55790
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
55744
55791
  };
@@ -55893,10 +55940,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55893
55940
  key: "chain_mainly_declarations",
55894
55941
  title: "Chain mainly declarations",
55895
55942
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55896
- extendedInformation: `
55897
- https://docs.abapopenchecks.org/checks/23/
55898
-
55899
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55943
+ extendedInformation: `
55944
+ https://docs.abapopenchecks.org/checks/23/
55945
+
55946
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55900
55947
  `,
55901
55948
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55902
55949
  badExample: `CALL METHOD: bar.`,
@@ -56072,17 +56119,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
56072
56119
  title: "Change IF to CASE",
56073
56120
  shortDescription: `Finds IF constructs that can be changed to CASE`,
56074
56121
  // eslint-disable-next-line max-len
56075
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
56076
-
56122
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
56123
+
56077
56124
  If the first comparison is a boolean compare, no issue is reported.`,
56078
56125
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
56079
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
56080
- ELSEIF l_fcat-fieldname = 'BAR'
56081
- OR l_fcat-fieldname = 'MOO'.
56126
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
56127
+ ELSEIF l_fcat-fieldname = 'BAR'
56128
+ OR l_fcat-fieldname = 'MOO'.
56082
56129
  ENDIF.`,
56083
- goodExample: `CASE l_fcat-fieldname.
56084
- WHEN 'FOO'.
56085
- WHEN 'BAR' OR 'MOO'.
56130
+ goodExample: `CASE l_fcat-fieldname.
56131
+ WHEN 'FOO'.
56132
+ WHEN 'BAR' OR 'MOO'.
56086
56133
  ENDCASE.`,
56087
56134
  };
56088
56135
  }
@@ -56219,8 +56266,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
56219
56266
  return {
56220
56267
  key: "check_abstract",
56221
56268
  title: "Check abstract methods and classes",
56222
- shortDescription: `Checks abstract methods and classes:
56223
- - class defined as abstract and final,
56269
+ shortDescription: `Checks abstract methods and classes:
56270
+ - class defined as abstract and final,
56224
56271
  - non-abstract class contains abstract methods`,
56225
56272
  extendedInformation: `If a class defines only constants, use an interface instead`,
56226
56273
  tags: [_irule_1.RuleTag.SingleFile],
@@ -56301,11 +56348,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
56301
56348
  return {
56302
56349
  key: "check_comments",
56303
56350
  title: "Check Comments",
56304
- shortDescription: `
56351
+ shortDescription: `
56305
56352
  Various checks for comment usage.`,
56306
- extendedInformation: `
56307
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
56308
-
56353
+ extendedInformation: `
56354
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
56355
+
56309
56356
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
56310
56357
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56311
56358
  badExample: `WRITE 2. " descriptive comment`,
@@ -56467,9 +56514,9 @@ class CheckInclude {
56467
56514
  key: "check_include",
56468
56515
  title: "Check INCLUDEs",
56469
56516
  shortDescription: `Checks INCLUDE statements`,
56470
- extendedInformation: `
56471
- * Reports unused includes
56472
- * Errors if the includes are not found
56517
+ extendedInformation: `
56518
+ * Reports unused includes
56519
+ * Errors if the includes are not found
56473
56520
  * Error if including a main program`,
56474
56521
  tags: [_irule_1.RuleTag.Syntax],
56475
56522
  };
@@ -56545,14 +56592,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
56545
56592
  key: "check_subrc",
56546
56593
  title: "Check sy-subrc",
56547
56594
  shortDescription: `Check sy-subrc`,
56548
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56549
-
56550
- If sy-dbcnt is checked after database statements, it is considered okay.
56551
-
56552
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56553
-
56554
- If IS ASSIGNED is checked after assigning, it is considered okay.
56555
-
56595
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56596
+
56597
+ If sy-dbcnt is checked after database statements, it is considered okay.
56598
+
56599
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56600
+
56601
+ If IS ASSIGNED is checked after assigning, it is considered okay.
56602
+
56556
56603
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
56557
56604
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56558
56605
  pseudoComment: "EC CI_SUBRC",
@@ -57122,17 +57169,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
57122
57169
  shortDescription: `Find overlapping classic exceptions`,
57123
57170
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
57124
57171
  tags: [_irule_1.RuleTag.SingleFile],
57125
- badExample: `CALL FUNCTION 'SOMETHING'
57126
- EXCEPTIONS
57127
- system_failure = 1 MESSAGE lv_message
57128
- communication_failure = 1 MESSAGE lv_message
57129
- resource_failure = 1
57172
+ badExample: `CALL FUNCTION 'SOMETHING'
57173
+ EXCEPTIONS
57174
+ system_failure = 1 MESSAGE lv_message
57175
+ communication_failure = 1 MESSAGE lv_message
57176
+ resource_failure = 1
57130
57177
  OTHERS = 1.`,
57131
- goodExample: `CALL FUNCTION 'SOMETHING'
57132
- EXCEPTIONS
57133
- system_failure = 1 MESSAGE lv_message
57134
- communication_failure = 2 MESSAGE lv_message
57135
- resource_failure = 3
57178
+ goodExample: `CALL FUNCTION 'SOMETHING'
57179
+ EXCEPTIONS
57180
+ system_failure = 1 MESSAGE lv_message
57181
+ communication_failure = 2 MESSAGE lv_message
57182
+ resource_failure = 3
57136
57183
  OTHERS = 4.`,
57137
57184
  };
57138
57185
  }
@@ -57390,7 +57437,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
57390
57437
  key: "commented_code",
57391
57438
  title: "Find commented code",
57392
57439
  shortDescription: `Detects usage of commented out code.`,
57393
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
57440
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
57394
57441
  https://docs.abapopenchecks.org/checks/14/`,
57395
57442
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
57396
57443
  badExample: `* WRITE 'hello world'.`,
@@ -57623,10 +57670,10 @@ class ConstructorVisibilityPublic {
57623
57670
  key: "constructor_visibility_public",
57624
57671
  title: "Check constructor visibility is public",
57625
57672
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
57626
- extendedInformation: `
57627
- This only applies to global classes.
57628
-
57629
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57673
+ extendedInformation: `
57674
+ This only applies to global classes.
57675
+
57676
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57630
57677
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
57631
57678
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57632
57679
  };
@@ -57701,8 +57748,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
57701
57748
  key: "contains_tab",
57702
57749
  title: "Code contains tab",
57703
57750
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
57704
- extendedInformation: `
57705
- https://docs.abapopenchecks.org/checks/09/
57751
+ extendedInformation: `
57752
+ https://docs.abapopenchecks.org/checks/09/
57706
57753
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
57707
57754
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57708
57755
  badExample: `\tWRITE 'hello world'.`,
@@ -57789,10 +57836,10 @@ class CyclicOO {
57789
57836
  key: "cyclic_oo",
57790
57837
  title: "Cyclic OO",
57791
57838
  shortDescription: `Finds cyclic/circular OO references`,
57792
- extendedInformation: `Runs for global INTF + CLAS objects
57793
-
57794
- Objects must be without syntax errors for this rule to take effect
57795
-
57839
+ extendedInformation: `Runs for global INTF + CLAS objects
57840
+
57841
+ Objects must be without syntax errors for this rule to take effect
57842
+
57796
57843
  References in testclass includes are ignored`,
57797
57844
  };
57798
57845
  }
@@ -58035,7 +58082,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
58035
58082
  key: "dangerous_statement",
58036
58083
  title: "Dangerous statement",
58037
58084
  shortDescription: `Detects potentially dangerous statements`,
58038
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
58085
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
58039
58086
  dynamic SQL can potentially create SQL injection problems`,
58040
58087
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
58041
58088
  };
@@ -58242,13 +58289,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
58242
58289
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
58243
58290
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
58244
58291
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
58245
- badExample: `FROM foo.
58246
- WRITE 'hello'.
58247
- DATA int TYPE i.
58292
+ badExample: `FROM foo.
58293
+ WRITE 'hello'.
58294
+ DATA int TYPE i.
58248
58295
  ENDFORM.`,
58249
- goodExample: `FROM foo.
58250
- DATA int TYPE i.
58251
- WRITE 'hello'.
58296
+ goodExample: `FROM foo.
58297
+ DATA int TYPE i.
58298
+ WRITE 'hello'.
58252
58299
  ENDFORM.`,
58253
58300
  };
58254
58301
  }
@@ -58667,32 +58714,32 @@ exports.DoubleSpace = DoubleSpace;
58667
58714
  Object.defineProperty(exports, "__esModule", ({ value: true }));
58668
58715
  exports.Downport = exports.DownportConf = void 0;
58669
58716
  /* eslint-disable max-len */
58670
- const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
58717
+ const crypto = __webpack_require__(/*! crypto */ "crypto");
58718
+ const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
58671
58719
  const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
58672
- const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
58673
- const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
58674
- const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
58675
- const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
58720
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
58721
+ const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
58676
58722
  const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
58677
- const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
58678
- const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
58679
- const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
58680
- const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
58681
- const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
58682
- const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
58683
- const registry_1 = __webpack_require__(/*! ../registry */ "./node_modules/@abaplint/core/build/src/registry.js");
58684
- const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
58723
+ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
58724
+ const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
58685
58725
  const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
58726
+ const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
58727
+ const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
58728
+ const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
58686
58729
  const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
58687
58730
  const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
58688
58731
  const config_1 = __webpack_require__(/*! ../config */ "./node_modules/@abaplint/core/build/src/config.js");
58689
- const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
58690
- const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
58732
+ const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
58733
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
58691
58734
  const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
58692
- const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
58693
- const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
58694
- const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
58695
- const crypto = __webpack_require__(/*! crypto */ "crypto");
58735
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
58736
+ const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
58737
+ const registry_1 = __webpack_require__(/*! ../registry */ "./node_modules/@abaplint/core/build/src/registry.js");
58738
+ const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
58739
+ const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
58740
+ const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
58741
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
58742
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
58696
58743
  // todo: refactor each sub-rule to new classes?
58697
58744
  // todo: add configuration
58698
58745
  class DownportConf extends _basic_rule_config_1.BasicRuleConfig {
@@ -58790,39 +58837,39 @@ class Downport {
58790
58837
  key: "downport",
58791
58838
  title: "Downport statement",
58792
58839
  shortDescription: `Downport functionality`,
58793
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58794
- a higher level language version. If successful, various rules are applied to downport the statement.
58795
- Target downport version is always v702, thus rule is only enabled if target version is v702.
58796
-
58797
- Current rules:
58798
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58799
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58800
- * FIELD-SYMBOL() definitions are outlined
58801
- * CONV is outlined
58802
- * COND is outlined
58803
- * REDUCE is outlined
58804
- * SWITCH is outlined
58805
- * FILTER is outlined
58806
- * APPEND expression is outlined
58807
- * INSERT expression is outlined
58808
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58809
- * CAST changed to ?=
58810
- * LOOP AT method_call( ) is outlined
58811
- * VALUE # with structure fields
58812
- * VALUE # with internal table lines
58813
- * Table Expressions are outlined
58814
- * SELECT INTO @DATA definitions are outlined
58815
- * Some occurrences of string template formatting option ALPHA changed to function module call
58816
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58817
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58818
- * RAISE EXCEPTION ... MESSAGE
58819
- * Moving with +=, -=, /=, *=, &&= is expanded
58820
- * line_exists and line_index is downported to READ TABLE
58821
- * ENUMs, but does not nessesarily give the correct type and value
58822
- * MESSAGE with non simple source
58823
-
58824
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58825
-
58840
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58841
+ a higher level language version. If successful, various rules are applied to downport the statement.
58842
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
58843
+
58844
+ Current rules:
58845
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58846
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58847
+ * FIELD-SYMBOL() definitions are outlined
58848
+ * CONV is outlined
58849
+ * COND is outlined
58850
+ * REDUCE is outlined
58851
+ * SWITCH is outlined
58852
+ * FILTER is outlined
58853
+ * APPEND expression is outlined
58854
+ * INSERT expression is outlined
58855
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58856
+ * CAST changed to ?=
58857
+ * LOOP AT method_call( ) is outlined
58858
+ * VALUE # with structure fields
58859
+ * VALUE # with internal table lines
58860
+ * Table Expressions are outlined
58861
+ * SELECT INTO @DATA definitions are outlined
58862
+ * Some occurrences of string template formatting option ALPHA changed to function module call
58863
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58864
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58865
+ * RAISE EXCEPTION ... MESSAGE
58866
+ * Moving with +=, -=, /=, *=, &&= is expanded
58867
+ * line_exists and line_index is downported to READ TABLE
58868
+ * ENUMs, but does not nessesarily give the correct type and value
58869
+ * MESSAGE with non simple source
58870
+
58871
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58872
+
58826
58873
  Make sure to test the downported code, it might not always be completely correct.`,
58827
58874
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
58828
58875
  };
@@ -59068,6 +59115,10 @@ Make sure to test the downported code, it might not always be completely correct
59068
59115
  if (found) {
59069
59116
  return found;
59070
59117
  }
59118
+ found = this.downportSQLMoveInto(low, high, lowFile, highSyntax);
59119
+ if (found) {
59120
+ return found;
59121
+ }
59071
59122
  found = this.downportSQLExtras(low, high, lowFile, highSyntax);
59072
59123
  if (found) {
59073
59124
  return found;
@@ -59201,6 +59252,37 @@ Make sure to test the downported code, it might not always be completely correct
59201
59252
  return undefined;
59202
59253
  }
59203
59254
  //////////////////////////////////////////
59255
+ /** move INTO from after WHERE to after FROM */
59256
+ downportSQLMoveInto(low, high, lowFile, _highSyntax) {
59257
+ if (!(low.get() instanceof _statement_1.Unknown)) {
59258
+ return undefined;
59259
+ }
59260
+ const where = high.findFirstExpression(Expressions.SQLCond);
59261
+ if (where === undefined) {
59262
+ return undefined;
59263
+ }
59264
+ let into = high.findFirstExpression(Expressions.SQLIntoList);
59265
+ if (into === undefined) {
59266
+ into = high.findFirstExpression(Expressions.SQLIntoStructure);
59267
+ }
59268
+ if (into === undefined) {
59269
+ into = high.findFirstExpression(Expressions.SQLIntoTable);
59270
+ }
59271
+ if (into === undefined) {
59272
+ return undefined;
59273
+ }
59274
+ if (where.getLastToken().getEnd().isBefore(into.getFirstToken().getStart()) === false) {
59275
+ return undefined;
59276
+ }
59277
+ const from = high.findFirstExpression(Expressions.SQLFrom);
59278
+ if (from === undefined) {
59279
+ return undefined;
59280
+ }
59281
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, from.getLastToken().getEnd(), ` ` + into.concatTokens());
59282
+ const fix2 = edit_helper_1.EditHelper.deleteRange(lowFile, into.getFirstToken().getStart(), into.getLastToken().getEnd());
59283
+ const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
59284
+ return issue_1.Issue.atToken(lowFile, low.getFirstToken(), "SQL, move INTO", this.getMetadata().key, this.conf.severity, fix);
59285
+ }
59204
59286
  /** removes @'s and commas */
59205
59287
  downportSQLExtras(low, high, lowFile, highSyntax) {
59206
59288
  if (!(low.get() instanceof _statement_1.Unknown)) {
@@ -59400,10 +59482,10 @@ Make sure to test the downported code, it might not always be completely correct
59400
59482
  const fieldName = f.concatTokens();
59401
59483
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
59402
59484
  }
59403
- fieldDefinition = `DATA: BEGIN OF ${name},
59485
+ fieldDefinition = `DATA: BEGIN OF ${name},
59404
59486
  ${fieldDefinition}${indentation} END OF ${name}.`;
59405
59487
  }
59406
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
59488
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
59407
59489
  ${indentation}`);
59408
59490
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
59409
59491
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59462,12 +59544,12 @@ ${indentation}`);
59462
59544
  }
59463
59545
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59464
59546
  const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
59465
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
59466
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
59467
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
59547
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
59548
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
59549
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
59468
59550
  ${indentation}`);
59469
59551
  if (fieldDefinitions === "") {
59470
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
59552
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
59471
59553
  ${indentation}`);
59472
59554
  }
59473
59555
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -59535,7 +59617,7 @@ ${indentation}`);
59535
59617
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59536
59618
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59537
59619
  const firstToken = high.getFirstToken();
59538
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59620
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59539
59621
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59540
59622
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59541
59623
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59589,7 +59671,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59589
59671
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59590
59672
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59591
59673
  const firstToken = high.getFirstToken();
59592
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59674
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59593
59675
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59594
59676
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59595
59677
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59631,14 +59713,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59631
59713
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59632
59714
  const firstToken = high.getFirstToken();
59633
59715
  // note that the tabix restore should be done before throwing the exception
59634
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59635
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59636
- ${indentation}${tabixBackup} = sy-tabix.
59637
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59638
- ${indentation}sy-tabix = ${tabixBackup}.
59639
- ${indentation}IF sy-subrc <> 0.
59640
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59641
- ${indentation}ENDIF.
59716
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59717
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59718
+ ${indentation}${tabixBackup} = sy-tabix.
59719
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59720
+ ${indentation}sy-tabix = ${tabixBackup}.
59721
+ ${indentation}IF sy-subrc <> 0.
59722
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59723
+ ${indentation}ENDIF.
59642
59724
  ${indentation}`);
59643
59725
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
59644
59726
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59695,7 +59777,7 @@ ${indentation}`);
59695
59777
  const className = classNames[0].concatTokens();
59696
59778
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59697
59779
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59698
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
59780
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
59699
59781
  ${indentation}CATCH ${className} INTO ${targetName}.`;
59700
59782
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
59701
59783
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -59857,16 +59939,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
59857
59939
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59858
59940
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59859
59941
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59860
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59861
- ${indentation}${uniqueName1}-msgid = ${id}.
59942
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59943
+ ${indentation}${uniqueName1}-msgid = ${id}.
59862
59944
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59863
59945
  if (withs.length > 0) {
59864
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59865
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59866
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59946
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59947
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59948
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59867
59949
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59868
59950
  }
59869
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59951
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59870
59952
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59871
59953
  if (withs.length > 0) {
59872
59954
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59978,10 +60060,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59978
60060
  let code = "";
59979
60061
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59980
60062
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59981
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59982
- IF sy-subrc <> 0.
59983
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59984
- ENDIF.
60063
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
60064
+ IF sy-subrc <> 0.
60065
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
60066
+ ENDIF.
59985
60067
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59986
60068
  }
59987
60069
  else {
@@ -60070,20 +60152,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
60070
60152
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60071
60153
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60072
60154
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60073
- code += ` items LIKE ${loopSourceName},
60074
- END OF ${groupTargetName}type.
60075
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
60076
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
60155
+ code += ` items LIKE ${loopSourceName},
60156
+ END OF ${groupTargetName}type.
60157
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
60158
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
60077
60159
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
60078
60160
  if (groupIndexName !== undefined) {
60079
60161
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
60080
60162
  }
60081
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
60163
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
60082
60164
  IF sy-subrc = 0.\n`;
60083
60165
  if (groupCountName !== undefined) {
60084
60166
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
60085
60167
  }
60086
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
60168
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
60087
60169
  ELSE.\n`;
60088
60170
  code += ` CLEAR ${uniqueName}.\n`;
60089
60171
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -60104,8 +60186,8 @@ ELSE.\n`;
60104
60186
  }
60105
60187
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
60106
60188
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
60107
- code += `ENDIF.
60108
- ENDLOOP.
60189
+ code += `ENDIF.
60190
+ ENDLOOP.
60109
60191
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
60110
60192
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
60111
60193
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -60277,7 +60359,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
60277
60359
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
60278
60360
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
60279
60361
  // all ENUMS are char like?
60280
- let code = `TYPES ${enumName} TYPE string.
60362
+ let code = `TYPES ${enumName} TYPE string.
60281
60363
  CONSTANTS: BEGIN OF ${structureName},\n`;
60282
60364
  let count = 1;
60283
60365
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -60321,14 +60403,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
60321
60403
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60322
60404
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
60323
60405
  // restore tabix before exeption
60324
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
60325
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
60326
- ${indentation}${tabixBackup} = sy-tabix.
60327
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
60328
- ${indentation}sy-tabix = ${tabixBackup}.
60329
- ${indentation}IF sy-subrc <> 0.
60330
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
60331
- ${indentation}ENDIF.
60406
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
60407
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
60408
+ ${indentation}${tabixBackup} = sy-tabix.
60409
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
60410
+ ${indentation}sy-tabix = ${tabixBackup}.
60411
+ ${indentation}IF sy-subrc <> 0.
60412
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
60413
+ ${indentation}ENDIF.
60332
60414
  ${indentation}${uniqueName}`;
60333
60415
  const start = target.getFirstToken().getStart();
60334
60416
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -60408,11 +60490,11 @@ ${indentation}${uniqueName}`;
60408
60490
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
60409
60491
  const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
60410
60492
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60411
- const code = `DATA ${uniqueName} TYPE string.
60412
- ${indentation}CALL FUNCTION '${functionName}'
60413
- ${indentation} EXPORTING
60414
- ${indentation} input = ${source}
60415
- ${indentation} IMPORTING
60493
+ const code = `DATA ${uniqueName} TYPE string.
60494
+ ${indentation}CALL FUNCTION '${functionName}'
60495
+ ${indentation} EXPORTING
60496
+ ${indentation} input = ${source}
60497
+ ${indentation} IMPORTING
60416
60498
  ${indentation} output = ${uniqueName}.\n`;
60417
60499
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
60418
60500
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60445,24 +60527,33 @@ ${indentation} output = ${uniqueName}.\n`;
60445
60527
  return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline LOOP input", this.getMetadata().key, this.conf.severity, fix);
60446
60528
  }
60447
60529
  outlineLoopTarget(node, lowFile, highSyntax) {
60448
- var _a, _b, _c, _d, _e, _f, _g;
60530
+ var _a, _b, _c, _d, _e, _f;
60449
60531
  // also allows outlining of voided types
60450
60532
  if (!(node.get() instanceof Statements.Loop)) {
60451
60533
  return undefined;
60452
60534
  }
60453
- const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();
60535
+ const source = node.findDirectExpression(Expressions.SimpleSource2);
60536
+ if (source === undefined) {
60537
+ return undefined;
60538
+ }
60539
+ const sourceName = source === null || source === void 0 ? void 0 : source.concatTokens();
60454
60540
  if (sourceName === undefined) {
60455
60541
  return undefined;
60456
60542
  }
60543
+ let foundType = undefined;
60544
+ const spag = highSyntax.spaghetti.lookupPosition(source.getFirstToken().getStart(), lowFile.getFilename());
60545
+ if (spag) {
60546
+ foundType = spag.findVariable(source.concatTokens());
60547
+ }
60457
60548
  const concat = node.concatTokens().toUpperCase();
60458
60549
  if (concat.includes(" GROUP BY ") || concat.startsWith("LOOP AT GROUP ")) {
60459
60550
  return undefined;
60460
60551
  }
60461
60552
  const isReference = concat.includes(" REFERENCE INTO ");
60462
60553
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
60463
- const dataTarget = (_c = (_b = node.findDirectExpression(Expressions.LoopTarget)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.findDirectExpression(Expressions.InlineData);
60554
+ const dataTarget = (_b = (_a = node.findDirectExpression(Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);
60464
60555
  if (dataTarget) {
60465
- const targetName = ((_d = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || "DOWNPORT_ERROR";
60556
+ const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "DOWNPORT_ERROR";
60466
60557
  let code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\n${indentation}`;
60467
60558
  if (isReference) {
60468
60559
  const likeName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
@@ -60473,10 +60564,15 @@ ${indentation} output = ${uniqueName}.\n`;
60473
60564
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
60474
60565
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline LOOP data target", this.getMetadata().key, this.conf.severity, fix);
60475
60566
  }
60476
- const fsTarget = (_f = (_e = node.findDirectExpression(Expressions.LoopTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.FSTarget)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(Expressions.InlineFS);
60567
+ const fsTarget = (_e = (_d = node.findDirectExpression(Expressions.LoopTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.FSTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.InlineFS);
60477
60568
  if (fsTarget) {
60478
- const targetName = ((_g = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "DOWNPORT_ERROR";
60479
- const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\n${indentation}`;
60569
+ const targetName = ((_f = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens()) || "DOWNPORT_ERROR";
60570
+ let type = `LIKE LINE OF ${sourceName}`;
60571
+ const f = foundType === null || foundType === void 0 ? void 0 : foundType.getType();
60572
+ if (f instanceof basic_1.TableType && f.getRowType() instanceof basic_1.AnyType) {
60573
+ type = "TYPE ANY";
60574
+ }
60575
+ const code = `FIELD-SYMBOLS ${targetName} ${type}.\n${indentation}`;
60480
60576
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);
60481
60577
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);
60482
60578
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -61724,12 +61820,12 @@ class EasyToFindMessages {
61724
61820
  key: "easy_to_find_messages",
61725
61821
  title: "Easy to find messages",
61726
61822
  shortDescription: `Make messages easy to find`,
61727
- extendedInformation: `All messages must be statically referenced exactly once
61728
-
61729
- Only MESSAGE and RAISE statments are counted as static references
61730
-
61731
- Also see rule "message_exists"
61732
-
61823
+ extendedInformation: `All messages must be statically referenced exactly once
61824
+
61825
+ Only MESSAGE and RAISE statments are counted as static references
61826
+
61827
+ Also see rule "message_exists"
61828
+
61733
61829
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
61734
61830
  tags: [_irule_1.RuleTag.Styleguide],
61735
61831
  };
@@ -61810,13 +61906,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
61810
61906
  shortDescription: `Empty selection screen or list processing event block`,
61811
61907
  extendedInformation: ``,
61812
61908
  tags: [_irule_1.RuleTag.SingleFile],
61813
- badExample: `
61814
- INITIALIZATION.
61815
- WRITE 'hello'.
61909
+ badExample: `
61910
+ INITIALIZATION.
61911
+ WRITE 'hello'.
61816
61912
  END-OF-SELECTION.`,
61817
- goodExample: `
61818
- START-OF-SELECTION.
61819
- PERFORM sdf.
61913
+ goodExample: `
61914
+ START-OF-SELECTION.
61915
+ PERFORM sdf.
61820
61916
  COMMIT WORK.`,
61821
61917
  };
61822
61918
  }
@@ -61908,8 +62004,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61908
62004
  key: "empty_line_in_statement",
61909
62005
  title: "Find empty lines in statements",
61910
62006
  shortDescription: `Checks that statements do not contain empty lines.`,
61911
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61912
-
62007
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
62008
+
61913
62009
  https://docs.abapopenchecks.org/checks/41/`,
61914
62010
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61915
62011
  badExample: `WRITE\n\nhello.`,
@@ -62085,13 +62181,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
62085
62181
  shortDescription: `Checks that the code does not contain empty blocks.`,
62086
62182
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
62087
62183
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
62088
- badExample: `IF foo = bar.
62089
- ENDIF.
62090
-
62091
- DO 2 TIMES.
62184
+ badExample: `IF foo = bar.
62185
+ ENDIF.
62186
+
62187
+ DO 2 TIMES.
62092
62188
  ENDDO.`,
62093
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
62094
- ENDLOOP.
62189
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
62190
+ ENDLOOP.
62095
62191
  result = xsdbool( sy-subrc = 0 ).`,
62096
62192
  };
62097
62193
  }
@@ -62233,10 +62329,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
62233
62329
  return {
62234
62330
  key: "exit_or_check",
62235
62331
  title: "Find EXIT or CHECK outside loops",
62236
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
62332
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
62237
62333
  Use RETURN to leave procesing blocks instead.`,
62238
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
62239
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
62334
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
62335
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
62240
62336
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
62241
62337
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62242
62338
  };
@@ -62319,12 +62415,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
62319
62415
  key: "expand_macros",
62320
62416
  title: "Expand Macros",
62321
62417
  shortDescription: `Allows expanding macro calls with quick fixes`,
62322
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
62323
-
62418
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
62419
+
62324
62420
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
62325
- badExample: `DEFINE _hello.
62326
- WRITE 'hello'.
62327
- END-OF-DEFINITION.
62421
+ badExample: `DEFINE _hello.
62422
+ WRITE 'hello'.
62423
+ END-OF-DEFINITION.
62328
62424
  _hello.`,
62329
62425
  goodExample: `WRITE 'hello'.`,
62330
62426
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -62411,7 +62507,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
62411
62507
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
62412
62508
  badExample: `call_method( EXPORTING foo = bar ).`,
62413
62509
  goodExample: `call_method( foo = bar ).`,
62414
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
62510
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
62415
62511
  https://docs.abapopenchecks.org/checks/30/`,
62416
62512
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62417
62513
  };
@@ -62509,7 +62605,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
62509
62605
  key: "forbidden_identifier",
62510
62606
  title: "Forbidden Identifier",
62511
62607
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
62512
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
62608
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
62513
62609
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
62514
62610
  tags: [_irule_1.RuleTag.SingleFile],
62515
62611
  };
@@ -62751,8 +62847,8 @@ class ForbiddenVoidType {
62751
62847
  key: "forbidden_void_type",
62752
62848
  title: "Forbidden Void Types",
62753
62849
  shortDescription: `Avoid usage of specified void types.`,
62754
- extendedInformation: `Inspiration:
62755
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62850
+ extendedInformation: `Inspiration:
62851
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62756
62852
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
62757
62853
  };
62758
62854
  }
@@ -62995,9 +63091,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62995
63091
  key: "fully_type_itabs",
62996
63092
  title: "Fully type internal tables",
62997
63093
  shortDescription: `No implict table types or table keys`,
62998
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
63094
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62999
63095
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
63000
- badExample: `DATA lt_foo TYPE TABLE OF ty.
63096
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
63001
63097
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
63002
63098
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
63003
63099
  tags: [_irule_1.RuleTag.SingleFile],
@@ -63182,26 +63278,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
63182
63278
  key: "functional_writing",
63183
63279
  title: "Use functional writing",
63184
63280
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
63185
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
63281
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
63186
63282
  https://docs.abapopenchecks.org/checks/07/`,
63187
63283
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63188
- badExample: `CALL METHOD zcl_class=>method( ).
63189
- CALL METHOD cl_abap_typedescr=>describe_by_name
63190
- EXPORTING
63191
- p_name = 'NAME'
63192
- RECEIVING
63193
- p_descr_ref = lr_typedescr
63194
- EXCEPTIONS
63195
- type_not_found = 1
63284
+ badExample: `CALL METHOD zcl_class=>method( ).
63285
+ CALL METHOD cl_abap_typedescr=>describe_by_name
63286
+ EXPORTING
63287
+ p_name = 'NAME'
63288
+ RECEIVING
63289
+ p_descr_ref = lr_typedescr
63290
+ EXCEPTIONS
63291
+ type_not_found = 1
63196
63292
  OTHERS = 2.`,
63197
- goodExample: `zcl_class=>method( ).
63198
- cl_abap_typedescr=>describe_by_name(
63199
- EXPORTING
63200
- p_name = 'NAME'
63201
- RECEIVING
63202
- p_descr_ref = lr_typedescr
63203
- EXCEPTIONS
63204
- type_not_found = 1
63293
+ goodExample: `zcl_class=>method( ).
63294
+ cl_abap_typedescr=>describe_by_name(
63295
+ EXPORTING
63296
+ p_name = 'NAME'
63297
+ RECEIVING
63298
+ p_descr_ref = lr_typedescr
63299
+ EXCEPTIONS
63300
+ type_not_found = 1
63205
63301
  OTHERS = 2 ).`,
63206
63302
  };
63207
63303
  }
@@ -63312,14 +63408,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
63312
63408
  key: "global_class",
63313
63409
  title: "Global class checks",
63314
63410
  shortDescription: `Checks related to global classes`,
63315
- extendedInformation: `* global classes must be in own files
63316
-
63317
- * file names must match class name
63318
-
63319
- * file names must match interface name
63320
-
63321
- * global classes must be global definitions
63322
-
63411
+ extendedInformation: `* global classes must be in own files
63412
+
63413
+ * file names must match class name
63414
+
63415
+ * file names must match interface name
63416
+
63417
+ * global classes must be global definitions
63418
+
63323
63419
  * global interfaces must be global definitions`,
63324
63420
  tags: [_irule_1.RuleTag.Syntax],
63325
63421
  };
@@ -63418,21 +63514,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
63418
63514
  return {
63419
63515
  key: "identical_conditions",
63420
63516
  title: "Identical conditions",
63421
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
63422
-
63517
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
63518
+
63423
63519
  Prerequsites: code is pretty printed with identical cAsE`,
63424
63520
  tags: [_irule_1.RuleTag.SingleFile],
63425
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
63426
- ENDIF.
63427
- CASE bar.
63428
- WHEN '1'.
63429
- WHEN 'A' OR '1'.
63521
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
63522
+ ENDIF.
63523
+ CASE bar.
63524
+ WHEN '1'.
63525
+ WHEN 'A' OR '1'.
63430
63526
  ENDCASE.`,
63431
- goodExample: `IF foo = bar OR 1 = a.
63432
- ENDIF.
63433
- CASE bar.
63434
- WHEN '1'.
63435
- WHEN 'A'.
63527
+ goodExample: `IF foo = bar OR 1 = a.
63528
+ ENDIF.
63529
+ CASE bar.
63530
+ WHEN '1'.
63531
+ WHEN 'A'.
63436
63532
  ENDCASE.`,
63437
63533
  };
63438
63534
  }
@@ -63566,23 +63662,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
63566
63662
  key: "identical_contents",
63567
63663
  title: "Identical contents",
63568
63664
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
63569
- extendedInformation: `
63570
- Prerequsites: code is pretty printed with identical cAsE
63571
-
63665
+ extendedInformation: `
63666
+ Prerequsites: code is pretty printed with identical cAsE
63667
+
63572
63668
  Chained statments are ignored`,
63573
63669
  tags: [_irule_1.RuleTag.SingleFile],
63574
- badExample: `IF foo = bar.
63575
- WRITE 'bar'.
63576
- WRITE 'world'.
63577
- ELSE.
63578
- WRITE 'foo'.
63579
- WRITE 'world'.
63670
+ badExample: `IF foo = bar.
63671
+ WRITE 'bar'.
63672
+ WRITE 'world'.
63673
+ ELSE.
63674
+ WRITE 'foo'.
63675
+ WRITE 'world'.
63580
63676
  ENDIF.`,
63581
- goodExample: `IF foo = bar.
63582
- WRITE 'bar'.
63583
- ELSE.
63584
- WRITE 'foo'.
63585
- ENDIF.
63677
+ goodExample: `IF foo = bar.
63678
+ WRITE 'bar'.
63679
+ ELSE.
63680
+ WRITE 'foo'.
63681
+ ENDIF.
63586
63682
  WRITE 'world'.`,
63587
63683
  };
63588
63684
  }
@@ -63690,12 +63786,12 @@ class IdenticalDescriptions {
63690
63786
  key: "identical_descriptions",
63691
63787
  title: "Identical descriptions",
63692
63788
  shortDescription: `Searches for objects with the same type and same description`,
63693
- extendedInformation: `Case insensitive
63694
-
63695
- Only checks the master language descriptions
63696
-
63697
- Dependencies are skipped
63698
-
63789
+ extendedInformation: `Case insensitive
63790
+
63791
+ Only checks the master language descriptions
63792
+
63793
+ Dependencies are skipped
63794
+
63699
63795
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
63700
63796
  tags: [],
63701
63797
  };
@@ -63869,43 +63965,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63869
63965
  key: "if_in_if",
63870
63966
  title: "IF in IF",
63871
63967
  shortDescription: `Detects nested ifs which can be refactored.`,
63872
- extendedInformation: `
63873
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
63874
-
63875
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63876
-
63877
- https://docs.abapopenchecks.org/checks/01/
63968
+ extendedInformation: `
63969
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63970
+
63971
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63972
+
63973
+ https://docs.abapopenchecks.org/checks/01/
63878
63974
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
63879
- badExample: `IF condition1.
63880
- IF condition2.
63881
- ...
63882
- ENDIF.
63883
- ENDIF.
63884
-
63885
- IF condition1.
63886
- ...
63887
- ELSE.
63888
- IF condition2.
63889
- ...
63890
- ENDIF.
63975
+ badExample: `IF condition1.
63976
+ IF condition2.
63977
+ ...
63978
+ ENDIF.
63979
+ ENDIF.
63980
+
63981
+ IF condition1.
63982
+ ...
63983
+ ELSE.
63984
+ IF condition2.
63985
+ ...
63986
+ ENDIF.
63891
63987
  ENDIF.`,
63892
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63893
- ...
63894
- ENDIF.
63895
-
63896
- IF condition1.
63897
- ...
63898
- ELSEIF condition2.
63899
- ...
63900
- ENDIF.
63901
-
63902
- CASE variable.
63903
- WHEN value1.
63904
- ...
63905
- WHEN value2.
63906
- IF condition2.
63907
- ...
63908
- ENDIF.
63988
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63989
+ ...
63990
+ ENDIF.
63991
+
63992
+ IF condition1.
63993
+ ...
63994
+ ELSEIF condition2.
63995
+ ...
63996
+ ENDIF.
63997
+
63998
+ CASE variable.
63999
+ WHEN value1.
64000
+ ...
64001
+ WHEN value2.
64002
+ IF condition2.
64003
+ ...
64004
+ ENDIF.
63909
64005
  ENDCASE.`,
63910
64006
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63911
64007
  };
@@ -64090,9 +64186,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
64090
64186
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
64091
64187
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
64092
64188
  if (name === impl.identifier.getName().toUpperCase()) {
64093
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
64094
- METHOD ${methodName.toLowerCase()}.
64095
- RETURN. " todo, implement method
64189
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
64190
+ METHOD ${methodName.toLowerCase()}.
64191
+ RETURN. " todo, implement method
64096
64192
  ENDMETHOD.`);
64097
64193
  }
64098
64194
  }
@@ -64271,14 +64367,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
64271
64367
  key: "implicit_start_of_selection",
64272
64368
  title: "Implicit START-OF-SELECTION",
64273
64369
  shortDescription: `Add explicit selection screen event handling`,
64274
- extendedInformation: `Only runs for executable programs
64275
-
64370
+ extendedInformation: `Only runs for executable programs
64371
+
64276
64372
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
64277
64373
  tags: [_irule_1.RuleTag.SingleFile],
64278
- badExample: `REPORT zfoo.
64374
+ badExample: `REPORT zfoo.
64279
64375
  WRITE 'hello'.`,
64280
- goodExample: `
64281
- START-OF-SELECTION.
64376
+ goodExample: `
64377
+ START-OF-SELECTION.
64282
64378
  WRITE 'hello'.`,
64283
64379
  };
64284
64380
  }
@@ -64383,19 +64479,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
64383
64479
  key: "in_statement_indentation",
64384
64480
  title: "In-statement indentation",
64385
64481
  shortDescription: "Checks alignment within statements which span multiple lines.",
64386
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
64387
-
64388
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
64482
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
64483
+
64484
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
64389
64485
  to distinguish them better from code within the block.`,
64390
- badExample: `IF 1 = 1
64391
- AND 2 = 2.
64392
- WRITE 'hello' &&
64393
- 'world'.
64486
+ badExample: `IF 1 = 1
64487
+ AND 2 = 2.
64488
+ WRITE 'hello' &&
64489
+ 'world'.
64394
64490
  ENDIF.`,
64395
- goodExample: `IF 1 = 1
64396
- AND 2 = 2.
64397
- WRITE 'hello' &&
64398
- 'world'.
64491
+ goodExample: `IF 1 = 1
64492
+ AND 2 = 2.
64493
+ WRITE 'hello' &&
64494
+ 'world'.
64399
64495
  ENDIF.`,
64400
64496
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64401
64497
  };
@@ -64521,23 +64617,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
64521
64617
  title: "Indentation",
64522
64618
  shortDescription: `Checks indentation`,
64523
64619
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64524
- badExample: `CLASS lcl DEFINITION.
64525
- PRIVATE SECTION.
64526
- METHODS constructor.
64527
- ENDCLASS.
64528
-
64529
- CLASS lcl IMPLEMENTATION.
64530
- METHOD constructor.
64531
- ENDMETHOD.
64620
+ badExample: `CLASS lcl DEFINITION.
64621
+ PRIVATE SECTION.
64622
+ METHODS constructor.
64623
+ ENDCLASS.
64624
+
64625
+ CLASS lcl IMPLEMENTATION.
64626
+ METHOD constructor.
64627
+ ENDMETHOD.
64532
64628
  ENDCLASS.`,
64533
- goodExample: `CLASS lcl DEFINITION.
64534
- PRIVATE SECTION.
64535
- METHODS constructor.
64536
- ENDCLASS.
64537
-
64538
- CLASS lcl IMPLEMENTATION.
64539
- METHOD constructor.
64540
- ENDMETHOD.
64629
+ goodExample: `CLASS lcl DEFINITION.
64630
+ PRIVATE SECTION.
64631
+ METHODS constructor.
64632
+ ENDCLASS.
64633
+
64634
+ CLASS lcl IMPLEMENTATION.
64635
+ METHOD constructor.
64636
+ ENDMETHOD.
64541
64637
  ENDCLASS.`,
64542
64638
  };
64543
64639
  }
@@ -64941,9 +65037,9 @@ class IntfReferencingClas {
64941
65037
  key: "intf_referencing_clas",
64942
65038
  title: "INTF referencing CLAS",
64943
65039
  shortDescription: `Interface contains references to class`,
64944
- extendedInformation: `Only global interfaces are checked.
64945
- Only first level references are checked.
64946
- Exception class references are ignored.
65040
+ extendedInformation: `Only global interfaces are checked.
65041
+ Only first level references are checked.
65042
+ Exception class references are ignored.
64947
65043
  Void references are ignored.`,
64948
65044
  };
64949
65045
  }
@@ -65028,9 +65124,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
65028
65124
  title: "Invalid Table Index",
65029
65125
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
65030
65126
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65031
- badExample: `DATA(first) = table[ 0 ].
65127
+ badExample: `DATA(first) = table[ 0 ].
65032
65128
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
65033
- goodExample: `DATA(first) = table[ 1 ].
65129
+ goodExample: `DATA(first) = table[ 1 ].
65034
65130
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
65035
65131
  };
65036
65132
  }
@@ -65632,8 +65728,8 @@ class LineBreakStyle {
65632
65728
  return {
65633
65729
  key: "line_break_style",
65634
65730
  title: "Makes sure line breaks are consistent in the ABAP code",
65635
- shortDescription: `Enforces LF as newlines in ABAP files
65636
-
65731
+ shortDescription: `Enforces LF as newlines in ABAP files
65732
+
65637
65733
  abapGit does not work with CRLF`,
65638
65734
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
65639
65735
  };
@@ -65702,7 +65798,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
65702
65798
  key: "line_length",
65703
65799
  title: "Line length",
65704
65800
  shortDescription: `Detects lines exceeding the provided maximum length.`,
65705
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65801
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65706
65802
  https://docs.abapopenchecks.org/checks/04/`,
65707
65803
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65708
65804
  };
@@ -65773,7 +65869,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
65773
65869
  key: "line_only_punc",
65774
65870
  title: "Line containing only punctuation",
65775
65871
  shortDescription: `Detects lines containing only punctuation.`,
65776
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65872
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65777
65873
  https://docs.abapopenchecks.org/checks/16/`,
65778
65874
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65779
65875
  badExample: "zcl_class=>method(\n).",
@@ -66036,15 +66132,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
66036
66132
  return {
66037
66133
  key: "local_variable_names",
66038
66134
  title: "Local variable naming conventions",
66039
- shortDescription: `
66040
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
66135
+ shortDescription: `
66136
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
66041
66137
  Regexes are case-insensitive.`,
66042
66138
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
66043
- badExample: `FORM bar.
66044
- DATA foo.
66139
+ badExample: `FORM bar.
66140
+ DATA foo.
66045
66141
  ENDFORM.`,
66046
- goodExample: `FORM bar.
66047
- DATA lv_foo.
66142
+ goodExample: `FORM bar.
66143
+ DATA lv_foo.
66048
66144
  ENDFORM.`,
66049
66145
  };
66050
66146
  }
@@ -66196,9 +66292,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
66196
66292
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
66197
66293
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
66198
66294
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
66199
- badExample: `DEFINE something.
66295
+ badExample: `DEFINE something.
66200
66296
  END-OF-DEFINITION.`,
66201
- goodExample: `DEFINE _something.
66297
+ goodExample: `DEFINE _something.
66202
66298
  END-OF-DEFINITION.`,
66203
66299
  };
66204
66300
  }
@@ -66271,10 +66367,10 @@ class MainFileContents {
66271
66367
  key: "main_file_contents",
66272
66368
  title: "Main file contents",
66273
66369
  shortDescription: `Checks related to report declarations.`,
66274
- extendedInformation: `Does not run if the target version is Cloud
66275
-
66276
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
66277
- * TYPEs must begin with "TYPE-POOL <name>."
66370
+ extendedInformation: `Does not run if the target version is Cloud
66371
+
66372
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
66373
+ * TYPEs must begin with "TYPE-POOL <name>."
66278
66374
  `,
66279
66375
  };
66280
66376
  }
@@ -66390,17 +66486,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
66390
66486
  title: "Too many parentheses",
66391
66487
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
66392
66488
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
66393
- badExample: `
66394
- IF ( destination IS INITIAL ).
66395
- ENDIF.
66396
- IF foo = boo AND ( bar = lar AND moo = loo ).
66397
- ENDIF.
66489
+ badExample: `
66490
+ IF ( destination IS INITIAL ).
66491
+ ENDIF.
66492
+ IF foo = boo AND ( bar = lar AND moo = loo ).
66493
+ ENDIF.
66398
66494
  `,
66399
- goodExample: `
66400
- IF destination IS INITIAL.
66401
- ENDIF.
66402
- IF foo = boo AND bar = lar AND moo = loo.
66403
- ENDIF.
66495
+ goodExample: `
66496
+ IF destination IS INITIAL.
66497
+ ENDIF.
66498
+ IF foo = boo AND bar = lar AND moo = loo.
66499
+ ENDIF.
66404
66500
  `,
66405
66501
  };
66406
66502
  }
@@ -66574,14 +66670,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
66574
66670
  title: "Max one method parameter definition per line",
66575
66671
  shortDescription: `Keep max one method parameter description per line`,
66576
66672
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
66577
- badExample: `
66578
- METHODS apps_scope_token
66579
- IMPORTING
66673
+ badExample: `
66674
+ METHODS apps_scope_token
66675
+ IMPORTING
66580
66676
  body TYPE bodyapps_scope_token client_id TYPE str.`,
66581
- goodExample: `
66582
- METHODS apps_scope_token
66583
- IMPORTING
66584
- body TYPE bodyapps_scope_token
66677
+ goodExample: `
66678
+ METHODS apps_scope_token
66679
+ IMPORTING
66680
+ body TYPE bodyapps_scope_token
66585
66681
  client_id TYPE str.`,
66586
66682
  };
66587
66683
  }
@@ -66646,11 +66742,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
66646
66742
  key: "max_one_statement",
66647
66743
  title: "Max one statement per line",
66648
66744
  shortDescription: `Checks that each line contains only a single statement.`,
66649
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66650
-
66651
- Does not report anything for chained statements.
66652
-
66653
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66745
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66746
+
66747
+ Does not report anything for chained statements.
66748
+
66749
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66654
66750
  https://docs.abapopenchecks.org/checks/11/`,
66655
66751
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66656
66752
  badExample: `WRITE foo. WRITE bar.`,
@@ -66988,8 +67084,8 @@ class MethodLength {
66988
67084
  key: "method_length",
66989
67085
  title: "Method/Form Length",
66990
67086
  shortDescription: `Checks relating to method/form length.`,
66991
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66992
-
67087
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
67088
+
66993
67089
  Abstract methods without statements are considered okay.`,
66994
67090
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66995
67091
  };
@@ -67094,20 +67190,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
67094
67190
  key: "method_overwrites_builtin",
67095
67191
  title: "Method name overwrites builtin function",
67096
67192
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
67097
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
67098
-
67099
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
67100
-
67193
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
67194
+
67195
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
67196
+
67101
67197
  Interface method names are ignored`,
67102
67198
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67103
- badExample: `CLASS lcl DEFINITION.
67104
- PUBLIC SECTION.
67105
- METHODS matches.
67106
- ENDCLASS.
67107
-
67108
- CLASS lcl IMPLEMENTATION.
67109
- METHOD matches.
67110
- ENDMETHOD.
67199
+ badExample: `CLASS lcl DEFINITION.
67200
+ PUBLIC SECTION.
67201
+ METHODS matches.
67202
+ ENDCLASS.
67203
+
67204
+ CLASS lcl IMPLEMENTATION.
67205
+ METHOD matches.
67206
+ ENDMETHOD.
67111
67207
  ENDCLASS.`,
67112
67208
  };
67113
67209
  }
@@ -67298,12 +67394,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
67298
67394
  // eslint-disable-next-line max-len
67299
67395
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
67300
67396
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67301
- badExample: `CLASS lcl DEFINITION.
67302
- PUBLIC SECTION.
67303
- METHODS
67304
- foobar
67305
- EXPORTING foo TYPE i
67306
- RETURNING VALUE(rv_string) TYPE string.
67397
+ badExample: `CLASS lcl DEFINITION.
67398
+ PUBLIC SECTION.
67399
+ METHODS
67400
+ foobar
67401
+ EXPORTING foo TYPE i
67402
+ RETURNING VALUE(rv_string) TYPE string.
67307
67403
  ENDCLASS.`,
67308
67404
  };
67309
67405
  }
@@ -67683,7 +67779,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
67683
67779
  key: "nesting",
67684
67780
  title: "Check nesting depth",
67685
67781
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
67686
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67782
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67687
67783
  https://docs.abapopenchecks.org/checks/74/`,
67688
67784
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67689
67785
  };
@@ -67926,7 +68022,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67926
68022
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67927
68023
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67928
68024
  badExample: `var1 = var2 = var3.`,
67929
- goodExample: `var2 = var3.
68025
+ goodExample: `var2 = var3.
67930
68026
  var1 = var2.`,
67931
68027
  };
67932
68028
  }
@@ -67985,8 +68081,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67985
68081
  key: "no_external_form_calls",
67986
68082
  title: "No external FORM calls",
67987
68083
  shortDescription: `Detect external form calls`,
67988
- badExample: `PERFORM foo IN PROGRAM bar.
67989
-
68084
+ badExample: `PERFORM foo IN PROGRAM bar.
68085
+
67990
68086
  PERFORM foo(bar).`,
67991
68087
  tags: [_irule_1.RuleTag.SingleFile],
67992
68088
  };
@@ -68047,17 +68143,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
68047
68143
  key: "no_inline_in_optional_branches",
68048
68144
  title: "Don't declare inline in optional branches",
68049
68145
  shortDescription: `Don't declare inline in optional branches`,
68050
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
68051
-
68052
- Considered optional branches:
68053
- * inside IF/ELSEIF/ELSE
68054
- * inside LOOP
68055
- * inside WHILE
68056
- * inside CASE/WHEN, CASE TYPE OF
68057
- * inside DO
68058
- * inside SELECT loops
68059
-
68060
- Not considered optional branches:
68146
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
68147
+
68148
+ Considered optional branches:
68149
+ * inside IF/ELSEIF/ELSE
68150
+ * inside LOOP
68151
+ * inside WHILE
68152
+ * inside CASE/WHEN, CASE TYPE OF
68153
+ * inside DO
68154
+ * inside SELECT loops
68155
+
68156
+ Not considered optional branches:
68061
68157
  * TRY/CATCH/CLEANUP`,
68062
68158
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68063
68159
  };
@@ -68157,12 +68253,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
68157
68253
  key: "no_prefixes",
68158
68254
  title: "No Prefixes",
68159
68255
  shortDescription: `Dont use hungarian notation`,
68160
- extendedInformation: `
68161
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
68162
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
68163
-
68164
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
68165
-
68256
+ extendedInformation: `
68257
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
68258
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
68259
+
68260
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
68261
+
68166
68262
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
68167
68263
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
68168
68264
  badExample: `DATA lv_foo TYPE i.`,
@@ -68341,7 +68437,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
68341
68437
  return {
68342
68438
  key: "no_public_attributes",
68343
68439
  title: "No public attributes",
68344
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
68440
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
68345
68441
  Exceptions are excluded from this rule.`,
68346
68442
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
68347
68443
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -68442,13 +68538,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
68442
68538
  key: "no_yoda_conditions",
68443
68539
  title: "No Yoda conditions",
68444
68540
  shortDescription: `Finds Yoda conditions and reports issues`,
68445
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
68446
-
68541
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
68542
+
68447
68543
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
68448
68544
  tags: [_irule_1.RuleTag.SingleFile],
68449
- badExample: `IF 0 <> sy-subrc.
68545
+ badExample: `IF 0 <> sy-subrc.
68450
68546
  ENDIF.`,
68451
- goodExample: `IF sy-subrc <> 0.
68547
+ goodExample: `IF sy-subrc <> 0.
68452
68548
  ENDIF.`,
68453
68549
  };
68454
68550
  }
@@ -68549,8 +68645,8 @@ class NROBConsistency {
68549
68645
  key: "nrob_consistency",
68550
68646
  title: "Number range consistency",
68551
68647
  shortDescription: `Consistency checks for number ranges`,
68552
- extendedInformation: `Issue reported if percentage warning is over 50%
68553
-
68648
+ extendedInformation: `Issue reported if percentage warning is over 50%
68649
+
68554
68650
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
68555
68651
  tags: [_irule_1.RuleTag.SingleFile],
68556
68652
  };
@@ -68827,58 +68923,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
68827
68923
  title: "Obsolete statements",
68828
68924
  shortDescription: `Checks for usages of certain obsolete statements`,
68829
68925
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68830
- extendedInformation: `
68831
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68832
-
68833
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68834
-
68835
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68836
-
68837
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68838
-
68839
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68840
-
68841
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68842
-
68843
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68844
-
68845
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68846
-
68847
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68848
-
68849
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68850
-
68851
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68852
-
68853
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68854
-
68855
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68856
-
68857
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68858
-
68859
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68860
- SELECT COUNT(*) is considered okay
68861
-
68862
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68863
-
68864
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68865
-
68866
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68867
-
68868
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68869
-
68870
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
68871
-
68926
+ extendedInformation: `
68927
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68928
+
68929
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68930
+
68931
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68932
+
68933
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68934
+
68935
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68936
+
68937
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68938
+
68939
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68940
+
68941
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68942
+
68943
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68944
+
68945
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68946
+
68947
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68948
+
68949
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68950
+
68951
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68952
+
68953
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68954
+
68955
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68956
+ SELECT COUNT(*) is considered okay
68957
+
68958
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68959
+
68960
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68961
+
68962
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68963
+
68964
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68965
+
68966
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68967
+
68872
68968
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
68873
- badExample: `REFRESH itab.
68874
-
68875
- COMPUTE foo = 2 + 2.
68876
-
68877
- MULTIPLY lv_foo BY 2.
68878
-
68879
- INTERFACE intf LOAD.
68880
-
68881
- IF foo IS SUPPLIED.
68969
+ badExample: `REFRESH itab.
68970
+
68971
+ COMPUTE foo = 2 + 2.
68972
+
68973
+ MULTIPLY lv_foo BY 2.
68974
+
68975
+ INTERFACE intf LOAD.
68976
+
68977
+ IF foo IS SUPPLIED.
68882
68978
  ENDIF.`,
68883
68979
  };
68884
68980
  }
@@ -69218,9 +69314,9 @@ class OmitParameterName {
69218
69314
  key: "omit_parameter_name",
69219
69315
  title: "Omit parameter name",
69220
69316
  shortDescription: `Omit the parameter name in single parameter calls`,
69221
- extendedInformation: `
69222
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
69223
-
69317
+ extendedInformation: `
69318
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
69319
+
69224
69320
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
69225
69321
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
69226
69322
  badExample: `method( param = 2 ).`,
@@ -69426,20 +69522,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
69426
69522
  shortDescription: `Omit RECEIVING`,
69427
69523
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
69428
69524
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69429
- badExample: `
69430
- upload_pack(
69431
- EXPORTING
69432
- io_client = lo_client
69433
- iv_url = iv_url
69434
- iv_deepen_level = iv_deepen_level
69435
- it_hashes = lt_hashes
69436
- RECEIVING
69525
+ badExample: `
69526
+ upload_pack(
69527
+ EXPORTING
69528
+ io_client = lo_client
69529
+ iv_url = iv_url
69530
+ iv_deepen_level = iv_deepen_level
69531
+ it_hashes = lt_hashes
69532
+ RECEIVING
69437
69533
  rt_objects = et_objects ).`,
69438
- goodExample: `
69439
- et_objects = upload_pack(
69440
- io_client = lo_client
69441
- iv_url = iv_url
69442
- iv_deepen_level = iv_deepen_level
69534
+ goodExample: `
69535
+ et_objects = upload_pack(
69536
+ io_client = lo_client
69537
+ iv_url = iv_url
69538
+ iv_deepen_level = iv_deepen_level
69443
69539
  it_hashes = lt_hashes ).`,
69444
69540
  };
69445
69541
  }
@@ -69503,8 +69599,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
69503
69599
  return {
69504
69600
  key: "parser_702_chaining",
69505
69601
  title: "Parser Error, bad chanining on 702",
69506
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
69507
- this rule finds these and reports errors.
69602
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
69603
+ this rule finds these and reports errors.
69508
69604
  Only active on target version 702 and below.`,
69509
69605
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69510
69606
  };
@@ -69584,8 +69680,8 @@ class ParserError {
69584
69680
  return {
69585
69681
  key: "parser_error",
69586
69682
  title: "Parser error",
69587
- shortDescription: `Checks for syntax not recognized by abaplint.
69588
-
69683
+ shortDescription: `Checks for syntax not recognized by abaplint.
69684
+
69589
69685
  See recognized syntax at https://syntax.abaplint.org`,
69590
69686
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69591
69687
  };
@@ -69670,7 +69766,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
69670
69766
  return {
69671
69767
  key: "parser_missing_space",
69672
69768
  title: "Parser Error, missing space",
69673
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69769
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69674
69770
  This rule makes sure the spaces are consistently required across the language.`,
69675
69771
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
69676
69772
  badExample: `IF ( foo = 'bar').`,
@@ -70093,25 +70189,25 @@ class PreferInline {
70093
70189
  key: "prefer_inline",
70094
70190
  title: "Prefer Inline Declarations",
70095
70191
  shortDescription: `Prefer inline to up-front declarations.`,
70096
- extendedInformation: `EXPERIMENTAL
70097
-
70098
- Activates if language version is v740sp02 or above.
70099
-
70100
- Variables must be local(METHOD or FORM).
70101
-
70102
- No generic or void typed variables. No syntax errors.
70103
-
70104
- First position used must be a full/pure write.
70105
-
70106
- Move statment is not a cast(?=)
70107
-
70192
+ extendedInformation: `EXPERIMENTAL
70193
+
70194
+ Activates if language version is v740sp02 or above.
70195
+
70196
+ Variables must be local(METHOD or FORM).
70197
+
70198
+ No generic or void typed variables. No syntax errors.
70199
+
70200
+ First position used must be a full/pure write.
70201
+
70202
+ Move statment is not a cast(?=)
70203
+
70108
70204
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
70109
70205
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
70110
- badExample: `DATA foo TYPE i.
70111
- foo = 2.
70112
- DATA percentage TYPE decfloat34.
70206
+ badExample: `DATA foo TYPE i.
70207
+ foo = 2.
70208
+ DATA percentage TYPE decfloat34.
70113
70209
  percentage = ( comment_number / abs_statement_number ) * 100.`,
70114
- goodExample: `DATA(foo) = 2.
70210
+ goodExample: `DATA(foo) = 2.
70115
70211
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
70116
70212
  };
70117
70213
  }
@@ -70325,18 +70421,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
70325
70421
  key: "prefer_is_not",
70326
70422
  title: "Prefer IS NOT to NOT IS",
70327
70423
  shortDescription: `Prefer IS NOT to NOT IS`,
70328
- extendedInformation: `
70329
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
70330
-
70424
+ extendedInformation: `
70425
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
70426
+
70331
70427
  "if not is_valid( )." examples are skipped`,
70332
70428
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70333
- goodExample: `IF variable IS NOT INITIAL.
70334
- IF variable NP 'TODO*'.
70335
- IF variable <> 42.
70429
+ goodExample: `IF variable IS NOT INITIAL.
70430
+ IF variable NP 'TODO*'.
70431
+ IF variable <> 42.
70336
70432
  IF variable CO 'hello'.`,
70337
- badExample: `IF NOT variable IS INITIAL.
70338
- IF NOT variable CP 'TODO*'.
70339
- IF NOT variable = 42.
70433
+ badExample: `IF NOT variable IS INITIAL.
70434
+ IF NOT variable CP 'TODO*'.
70435
+ IF NOT variable = 42.
70340
70436
  IF NOT variable CA 'hello'.`,
70341
70437
  };
70342
70438
  }
@@ -70524,14 +70620,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
70524
70620
  key: "prefer_raise_exception_new",
70525
70621
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
70526
70622
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
70527
- extendedInformation: `
70528
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70529
-
70623
+ extendedInformation: `
70624
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70625
+
70530
70626
  From 752 and up`,
70531
70627
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
70532
70628
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
70533
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
70534
- EXPORTING
70629
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
70630
+ EXPORTING
70535
70631
  previous = exception.`,
70536
70632
  };
70537
70633
  }
@@ -70609,12 +70705,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
70609
70705
  key: "prefer_returning_to_exporting",
70610
70706
  title: "Prefer RETURNING to EXPORTING",
70611
70707
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
70612
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70708
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70613
70709
  https://docs.abapopenchecks.org/checks/44/`,
70614
70710
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70615
- badExample: `CLASS lcl DEFINITION.
70616
- PUBLIC SECTION.
70617
- METHODS test EXPORTING ev_foo TYPE i.
70711
+ badExample: `CLASS lcl DEFINITION.
70712
+ PUBLIC SECTION.
70713
+ METHODS test EXPORTING ev_foo TYPE i.
70618
70714
  ENDCLASS.`,
70619
70715
  };
70620
70716
  }
@@ -70710,8 +70806,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
70710
70806
  key: "prefer_xsdbool",
70711
70807
  title: "Prefer xsdbool over boolc",
70712
70808
  shortDescription: `Prefer xsdbool over boolc`,
70713
- extendedInformation: `Activates if language version is v740sp08 or above.
70714
-
70809
+ extendedInformation: `Activates if language version is v740sp08 or above.
70810
+
70715
70811
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
70716
70812
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70717
70813
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -70783,9 +70879,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
70783
70879
  title: "Preferred compare operator",
70784
70880
  shortDescription: `Configure undesired operator variants`,
70785
70881
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70786
- badExample: `IF foo EQ bar.
70882
+ badExample: `IF foo EQ bar.
70787
70883
  ENDIF.`,
70788
- goodExample: `IF foo = bar.
70884
+ goodExample: `IF foo = bar.
70789
70885
  ENDIF.`,
70790
70886
  };
70791
70887
  }
@@ -71009,26 +71105,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
71009
71105
  key: "reduce_procedural_code",
71010
71106
  title: "Reduce procedural code",
71011
71107
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
71012
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
71013
-
71014
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
71015
-
71108
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
71109
+
71110
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
71111
+
71016
71112
  Comments are not counted as statements.`,
71017
71113
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
71018
- badExample: `FORM foo.
71019
- DATA lv_bar TYPE i.
71020
- lv_bar = 2 + 2.
71021
- IF lv_bar = 4.
71022
- WRITE 'hello world'.
71023
- ENDIF.
71024
- DATA lv_bar TYPE i.
71025
- lv_bar = 2 + 2.
71026
- IF lv_bar = 4.
71027
- WRITE 'hello world'.
71028
- ENDIF.
71114
+ badExample: `FORM foo.
71115
+ DATA lv_bar TYPE i.
71116
+ lv_bar = 2 + 2.
71117
+ IF lv_bar = 4.
71118
+ WRITE 'hello world'.
71119
+ ENDIF.
71120
+ DATA lv_bar TYPE i.
71121
+ lv_bar = 2 + 2.
71122
+ IF lv_bar = 4.
71123
+ WRITE 'hello world'.
71124
+ ENDIF.
71029
71125
  ENDFORM.`,
71030
- goodExample: `FORM foo.
71031
- NEW zcl_global_class( )->run_logic( ).
71126
+ goodExample: `FORM foo.
71127
+ NEW zcl_global_class( )->run_logic( ).
71032
71128
  ENDFORM.`,
71033
71129
  };
71034
71130
  }
@@ -71272,10 +71368,10 @@ class RemoveDescriptions {
71272
71368
  return {
71273
71369
  key: "remove_descriptions",
71274
71370
  title: "Remove descriptions",
71275
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
71276
-
71277
- Class descriptions are required, see rule description_empty.
71278
-
71371
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
71372
+
71373
+ Class descriptions are required, see rule description_empty.
71374
+
71279
71375
  Consider using ABAP Doc for documentation.`,
71280
71376
  tags: [],
71281
71377
  };
@@ -71400,14 +71496,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
71400
71496
  tags: [_irule_1.RuleTag.SingleFile],
71401
71497
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
71402
71498
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
71403
- badExample: `CALL FUNCTION 'ZRFC'
71499
+ badExample: `CALL FUNCTION 'ZRFC'
71404
71500
  DESTINATION lv_rfc.`,
71405
- goodExample: `CALL FUNCTION 'ZRFC'
71406
- DESTINATION lv_rfc
71407
- EXCEPTIONS
71408
- system_failure = 1 MESSAGE msg
71409
- communication_failure = 2 MESSAGE msg
71410
- resource_failure = 3
71501
+ goodExample: `CALL FUNCTION 'ZRFC'
71502
+ DESTINATION lv_rfc
71503
+ EXCEPTIONS
71504
+ system_failure = 1 MESSAGE msg
71505
+ communication_failure = 2 MESSAGE msg
71506
+ resource_failure = 3
71411
71507
  OTHERS = 4.`,
71412
71508
  };
71413
71509
  }
@@ -71491,11 +71587,11 @@ class SelectAddOrderBy {
71491
71587
  key: "select_add_order_by",
71492
71588
  title: "SELECT add ORDER BY",
71493
71589
  shortDescription: `SELECTs add ORDER BY clause`,
71494
- extendedInformation: `
71495
- This will make sure that the SELECT statement returns results in the same sequence on different databases
71496
-
71497
- add ORDER BY PRIMARY KEY if in doubt
71498
-
71590
+ extendedInformation: `
71591
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
71592
+
71593
+ add ORDER BY PRIMARY KEY if in doubt
71594
+
71499
71595
  If the target is a sorted/hashed table, no issue is reported`,
71500
71596
  tags: [_irule_1.RuleTag.SingleFile],
71501
71597
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -71626,14 +71722,14 @@ class SelectPerformance {
71626
71722
  key: "select_performance",
71627
71723
  title: "SELECT performance",
71628
71724
  shortDescription: `Various checks regarding SELECT performance.`,
71629
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71630
-
71725
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71726
+
71631
71727
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
71632
71728
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
71633
- badExample: `SELECT field1, field2 FROM table
71634
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71729
+ badExample: `SELECT field1, field2 FROM table
71730
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71635
71731
  ENDSELECT.`,
71636
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71732
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71637
71733
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
71638
71734
  };
71639
71735
  }
@@ -71747,8 +71843,8 @@ class SelectSingleFullKey {
71747
71843
  key: "select_single_full_key",
71748
71844
  title: "Detect SELECT SINGLE which are possibily not unique",
71749
71845
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
71750
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71751
-
71846
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71847
+
71752
71848
  If the statement contains a JOIN it is not checked`,
71753
71849
  pseudoComment: "EC CI_NOORDER",
71754
71850
  tags: [_irule_1.RuleTag.Quickfix],
@@ -72176,8 +72272,8 @@ class SICFConsistency {
72176
72272
  key: "sicf_consistency",
72177
72273
  title: "SICF consistency",
72178
72274
  shortDescription: `Checks the validity of ICF services`,
72179
- extendedInformation: `* Class defined in handler must exist
72180
- * Class must not have any syntax errors
72275
+ extendedInformation: `* Class defined in handler must exist
72276
+ * Class must not have any syntax errors
72181
72277
  * Class must implement interface IF_HTTP_EXTENSION`,
72182
72278
  };
72183
72279
  }
@@ -72289,23 +72385,23 @@ class SlowParameterPassing {
72289
72385
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
72290
72386
  extendedInformation: `Method parameters defined in interfaces is not checked`,
72291
72387
  tags: [_irule_1.RuleTag.Performance],
72292
- badExample: `CLASS lcl DEFINITION.
72293
- PUBLIC SECTION.
72294
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
72295
- ENDCLASS.
72296
- CLASS lcl IMPLEMENTATION.
72297
- METHOD bar.
72298
- WRITE sdf.
72299
- ENDMETHOD.
72388
+ badExample: `CLASS lcl DEFINITION.
72389
+ PUBLIC SECTION.
72390
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
72391
+ ENDCLASS.
72392
+ CLASS lcl IMPLEMENTATION.
72393
+ METHOD bar.
72394
+ WRITE sdf.
72395
+ ENDMETHOD.
72300
72396
  ENDCLASS.`,
72301
- goodExample: `CLASS lcl DEFINITION.
72302
- PUBLIC SECTION.
72303
- METHODS bar IMPORTING sdf TYPE string.
72304
- ENDCLASS.
72305
- CLASS lcl IMPLEMENTATION.
72306
- METHOD bar.
72307
- WRITE sdf.
72308
- ENDMETHOD.
72397
+ goodExample: `CLASS lcl DEFINITION.
72398
+ PUBLIC SECTION.
72399
+ METHODS bar IMPORTING sdf TYPE string.
72400
+ ENDCLASS.
72401
+ CLASS lcl IMPLEMENTATION.
72402
+ METHOD bar.
72403
+ WRITE sdf.
72404
+ ENDMETHOD.
72309
72405
  ENDCLASS.`,
72310
72406
  };
72311
72407
  }
@@ -72576,8 +72672,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
72576
72672
  key: "space_before_dot",
72577
72673
  title: "Space before dot",
72578
72674
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
72579
- extendedInformation: `
72580
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72675
+ extendedInformation: `
72676
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72581
72677
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
72582
72678
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72583
72679
  badExample: `WRITE bar .`,
@@ -72763,12 +72859,12 @@ class SQLValueConversion {
72763
72859
  key: "sql_value_conversion",
72764
72860
  title: "Implicit SQL Value Conversion",
72765
72861
  shortDescription: `Ensure types match when selecting from database`,
72766
- extendedInformation: `
72767
- * Integer to CHAR conversion
72768
- * Integer to NUMC conversion
72769
- * NUMC to Integer conversion
72770
- * CHAR to Integer conversion
72771
- * Source field longer than database field, CHAR -> CHAR
72862
+ extendedInformation: `
72863
+ * Integer to CHAR conversion
72864
+ * Integer to NUMC conversion
72865
+ * NUMC to Integer conversion
72866
+ * CHAR to Integer conversion
72867
+ * Source field longer than database field, CHAR -> CHAR
72772
72868
  * Source field longer than database field, NUMC -> NUMC`,
72773
72869
  tags: [],
72774
72870
  };
@@ -72840,7 +72936,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
72840
72936
  key: "start_at_tab",
72841
72937
  title: "Start at tab",
72842
72938
  shortDescription: `Checks that statements start at tabstops.`,
72843
- extendedInformation: `Reports max 100 issues per file
72939
+ extendedInformation: `Reports max 100 issues per file
72844
72940
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
72845
72941
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72846
72942
  badExample: ` WRITE a.`,
@@ -73017,12 +73113,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
73017
73113
  key: "strict_sql",
73018
73114
  title: "Strict SQL",
73019
73115
  shortDescription: `Strict SQL`,
73020
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
73021
-
73022
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
73023
-
73024
- Also see separate rule sql_escape_host_variables
73025
-
73116
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
73117
+
73118
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
73119
+
73120
+ Also see separate rule sql_escape_host_variables
73121
+
73026
73122
  Activates from v750 and up`,
73027
73123
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
73028
73124
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -73276,11 +73372,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
73276
73372
  key: "sy_modification",
73277
73373
  title: "Modification of SY fields",
73278
73374
  shortDescription: `Finds modification of sy fields`,
73279
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
73280
-
73375
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
73376
+
73281
73377
  Changes to SY-TVAR* fields are not reported`,
73282
73378
  tags: [_irule_1.RuleTag.SingleFile],
73283
- badExample: `sy-uname = 2.
73379
+ badExample: `sy-uname = 2.
73284
73380
  sy = sy.`,
73285
73381
  };
73286
73382
  }
@@ -73342,8 +73438,8 @@ class TABLEnhancementCategory {
73342
73438
  key: "tabl_enhancement_category",
73343
73439
  title: "TABL enhancement category must be set",
73344
73440
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
73345
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
73346
-
73441
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
73442
+
73347
73443
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
73348
73444
  tags: [],
73349
73445
  };
@@ -73408,8 +73504,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
73408
73504
  shortDescription: `TABLES are always global, so declare them globally`,
73409
73505
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
73410
73506
  tags: [_irule_1.RuleTag.SingleFile],
73411
- badExample: `FORM foo.
73412
- TABLES t100.
73507
+ badExample: `FORM foo.
73508
+ TABLES t100.
73413
73509
  ENDFORM.`,
73414
73510
  goodExample: `TABLES t000.`,
73415
73511
  };
@@ -73537,9 +73633,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
73537
73633
  title: "Type FORM parameters",
73538
73634
  shortDescription: `Checks for untyped FORM parameters`,
73539
73635
  tags: [_irule_1.RuleTag.SingleFile],
73540
- badExample: `FORM foo USING bar.
73636
+ badExample: `FORM foo USING bar.
73541
73637
  ENDFORM.`,
73542
- goodExample: `FORM foo USING bar TYPE string.
73638
+ goodExample: `FORM foo USING bar TYPE string.
73543
73639
  ENDFORM.`,
73544
73640
  };
73545
73641
  }
@@ -74212,38 +74308,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
74212
74308
  key: "unnecessary_pragma",
74213
74309
  title: "Unnecessary Pragma",
74214
74310
  shortDescription: `Finds pragmas which can be removed`,
74215
- extendedInformation: `* NO_HANDLER with handler
74216
-
74217
- * NEEDED without definition
74218
-
74219
- * NO_TEXT without texts
74220
-
74221
- * SUBRC_OK where sy-subrc is checked
74222
-
74311
+ extendedInformation: `* NO_HANDLER with handler
74312
+
74313
+ * NEEDED without definition
74314
+
74315
+ * NO_TEXT without texts
74316
+
74317
+ * SUBRC_OK where sy-subrc is checked
74318
+
74223
74319
  NO_HANDLER inside macros are not checked`,
74224
74320
  tags: [_irule_1.RuleTag.SingleFile],
74225
- badExample: `TRY.
74226
- ...
74227
- CATCH zcx_abapgit_exception ##NO_HANDLER.
74228
- RETURN. " it has a handler
74229
- ENDTRY.
74230
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
74231
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
74232
- IF sy-subrc <> 0.
74321
+ badExample: `TRY.
74322
+ ...
74323
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
74324
+ RETURN. " it has a handler
74325
+ ENDTRY.
74326
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
74327
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
74328
+ IF sy-subrc <> 0.
74233
74329
  ENDIF.`,
74234
- goodExample: `TRY.
74235
- ...
74236
- CATCH zcx_abapgit_exception.
74237
- RETURN.
74238
- ENDTRY.
74239
- MESSAGE w125(zbar) WITH c_foo INTO message.
74240
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
74241
- IF sy-subrc <> 0.
74242
- ENDIF.
74243
-
74244
- DATA: BEGIN OF blah ##NEEDED,
74245
- test1 TYPE string,
74246
- test2 TYPE string,
74330
+ goodExample: `TRY.
74331
+ ...
74332
+ CATCH zcx_abapgit_exception.
74333
+ RETURN.
74334
+ ENDTRY.
74335
+ MESSAGE w125(zbar) WITH c_foo INTO message.
74336
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
74337
+ IF sy-subrc <> 0.
74338
+ ENDIF.
74339
+
74340
+ DATA: BEGIN OF blah ##NEEDED,
74341
+ test1 TYPE string,
74342
+ test2 TYPE string,
74247
74343
  END OF blah.`,
74248
74344
  };
74249
74345
  }
@@ -74410,18 +74506,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
74410
74506
  shortDescription: `Finds unnecessary RETURN statements`,
74411
74507
  extendedInformation: `Finds unnecessary RETURN statements`,
74412
74508
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
74413
- badExample: `FORM hello1.
74414
- WRITE 'world'.
74415
- RETURN.
74416
- ENDFORM.
74417
-
74418
- FORM foo.
74419
- IF 1 = 2.
74420
- RETURN.
74421
- ENDIF.
74509
+ badExample: `FORM hello1.
74510
+ WRITE 'world'.
74511
+ RETURN.
74512
+ ENDFORM.
74513
+
74514
+ FORM foo.
74515
+ IF 1 = 2.
74516
+ RETURN.
74517
+ ENDIF.
74422
74518
  ENDFORM.`,
74423
- goodExample: `FORM hello2.
74424
- WRITE 'world'.
74519
+ goodExample: `FORM hello2.
74520
+ WRITE 'world'.
74425
74521
  ENDFORM.`,
74426
74522
  };
74427
74523
  }
@@ -74772,13 +74868,13 @@ class UnusedMacros {
74772
74868
  title: "Unused macros",
74773
74869
  shortDescription: `Checks for unused macro definitions definitions`,
74774
74870
  tags: [_irule_1.RuleTag.Quickfix],
74775
- badExample: `DEFINE foobar1.
74776
- WRITE 'hello'.
74871
+ badExample: `DEFINE foobar1.
74872
+ WRITE 'hello'.
74777
74873
  END-OF-DEFINITION.`,
74778
- goodExample: `DEFINE foobar2.
74779
- WRITE 'hello'.
74780
- END-OF-DEFINITION.
74781
-
74874
+ goodExample: `DEFINE foobar2.
74875
+ WRITE 'hello'.
74876
+ END-OF-DEFINITION.
74877
+
74782
74878
  foobar2.`,
74783
74879
  };
74784
74880
  }
@@ -74890,18 +74986,18 @@ class UnusedMethods {
74890
74986
  key: "unused_methods",
74891
74987
  title: "Unused methods",
74892
74988
  shortDescription: `Checks for unused methods`,
74893
- extendedInformation: `Checks private and protected methods.
74894
-
74895
- Unused methods are not reported if the object contains parser or syntax errors.
74896
- Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74897
-
74898
- Skips:
74899
- * methods FOR TESTING
74900
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74901
- * class_constructor + constructor methods
74902
- * event handlers
74903
- * methods that are redefined
74904
- * INCLUDEs
74989
+ extendedInformation: `Checks private and protected methods.
74990
+
74991
+ Unused methods are not reported if the object contains parser or syntax errors.
74992
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74993
+
74994
+ Skips:
74995
+ * methods FOR TESTING
74996
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74997
+ * class_constructor + constructor methods
74998
+ * event handlers
74999
+ * methods that are redefined
75000
+ * INCLUDEs
74905
75001
  `,
74906
75002
  tags: [_irule_1.RuleTag.Quickfix],
74907
75003
  pragma: "##CALLED",
@@ -75377,23 +75473,23 @@ class UnusedVariables {
75377
75473
  key: "unused_variables",
75378
75474
  title: "Unused variables",
75379
75475
  shortDescription: `Checks for unused variables and constants`,
75380
- extendedInformation: `Skips event parameters.
75381
-
75382
- Note that this currently does not work if the source code uses macros.
75383
-
75384
- Unused variables are not reported if the object contains parser or syntax errors.
75385
-
75476
+ extendedInformation: `Skips event parameters.
75477
+
75478
+ Note that this currently does not work if the source code uses macros.
75479
+
75480
+ Unused variables are not reported if the object contains parser or syntax errors.
75481
+
75386
75482
  Errors found in INCLUDES are reported for the main program.`,
75387
75483
  tags: [_irule_1.RuleTag.Quickfix],
75388
75484
  pragma: "##NEEDED",
75389
75485
  pseudoComment: "EC NEEDED",
75390
- badExample: `DATA: BEGIN OF blah1,
75391
- test TYPE string,
75392
- test2 TYPE string,
75486
+ badExample: `DATA: BEGIN OF blah1,
75487
+ test TYPE string,
75488
+ test2 TYPE string,
75393
75489
  END OF blah1.`,
75394
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
75395
- test TYPE string,
75396
- test2 TYPE string,
75490
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
75491
+ test TYPE string,
75492
+ test2 TYPE string,
75397
75493
  END OF blah2.`,
75398
75494
  };
75399
75495
  }
@@ -75612,15 +75708,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
75612
75708
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
75613
75709
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
75614
75710
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
75615
- badExample: `IF line IS INITIAL.
75616
- has_entries = abap_false.
75617
- ELSE.
75618
- has_entries = abap_true.
75619
- ENDIF.
75620
-
75711
+ badExample: `IF line IS INITIAL.
75712
+ has_entries = abap_false.
75713
+ ELSE.
75714
+ has_entries = abap_true.
75715
+ ENDIF.
75716
+
75621
75717
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
75622
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75623
-
75718
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75719
+
75624
75720
  DATA(fsdf) = xsdbool( foo <> bar ).`,
75625
75721
  };
75626
75722
  }
@@ -75738,15 +75834,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
75738
75834
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
75739
75835
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
75740
75836
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75741
- badExample: `INTERFACE lif.
75742
- METHODS load_data
75743
- EXCEPTIONS
75744
- invalid_parameter.
75837
+ badExample: `INTERFACE lif.
75838
+ METHODS load_data
75839
+ EXCEPTIONS
75840
+ invalid_parameter.
75745
75841
  ENDINTERFACE.`,
75746
- goodExample: `INTERFACE lif.
75747
- METHODS load_data
75748
- RAISING
75749
- cx_something.
75842
+ goodExample: `INTERFACE lif.
75843
+ METHODS load_data
75844
+ RAISING
75845
+ cx_something.
75750
75846
  ENDINTERFACE.`,
75751
75847
  };
75752
75848
  }
@@ -75806,15 +75902,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
75806
75902
  key: "use_line_exists",
75807
75903
  title: "Use line_exists",
75808
75904
  shortDescription: `Use line_exists, from 740sp02 and up`,
75809
- extendedInformation: `
75810
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75811
-
75905
+ extendedInformation: `
75906
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75907
+
75812
75908
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
75813
75909
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75814
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75815
- IF sy-subrc = 0.
75910
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75911
+ IF sy-subrc = 0.
75816
75912
  ENDIF.`,
75817
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75913
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75818
75914
  ENDIF.`,
75819
75915
  };
75820
75916
  }
@@ -75924,10 +76020,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75924
76020
  key: "use_new",
75925
76021
  title: "Use NEW",
75926
76022
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
75927
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75928
-
75929
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75930
-
76023
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
76024
+
76025
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
76026
+
75931
76027
  Applicable from v740sp02 and up`,
75932
76028
  badExample: `CREATE OBJECT ref.`,
75933
76029
  goodExample: `ref = NEW #( ).`,
@@ -76025,13 +76121,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
76025
76121
  title: "WHEN OTHERS last",
76026
76122
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
76027
76123
  tags: [_irule_1.RuleTag.SingleFile],
76028
- badExample: `CASE bar.
76029
- WHEN OTHERS.
76030
- WHEN 2.
76124
+ badExample: `CASE bar.
76125
+ WHEN OTHERS.
76126
+ WHEN 2.
76031
76127
  ENDCASE.`,
76032
- goodExample: `CASE bar.
76033
- WHEN 2.
76034
- WHEN OTHERS.
76128
+ goodExample: `CASE bar.
76129
+ WHEN 2.
76130
+ WHEN OTHERS.
76035
76131
  ENDCASE.`,
76036
76132
  };
76037
76133
  }
@@ -78453,6 +78549,7 @@ function readDocType(xmlData, i){
78453
78549
  if (xmlData[i] === '<' && !comment) { //Determine the tag type
78454
78550
  if( hasBody && isEntity(xmlData, i)){
78455
78551
  i += 7;
78552
+ let entityName, val;
78456
78553
  [entityName, val,i] = readEntityExp(xmlData,i+1);
78457
78554
  if(val.indexOf("&") === -1) //Parameter entities are not supported
78458
78555
  entities[ validateEntityName(entityName) ] = {