@abaplint/cli 2.105.17 → 2.105.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +4 -4
  2. package/abaplint +2 -2
  3. package/build/cli.js +745 -700
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -7196,7 +7196,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
7196
7196
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
7197
7197
  class RaiseWith extends combi_1.Expression {
7198
7198
  getRunnable() {
7199
- const wit = (0, combi_1.seq)("WITH", _1.SimpleSource3, (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3));
7199
+ const wit = (0, combi_1.seq)("WITH", _1.SimpleSource1, (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1), (0, combi_1.opt)(_1.SimpleSource1));
7200
7200
  return wit;
7201
7201
  }
7202
7202
  }
@@ -21373,11 +21373,11 @@ class CurrentScope {
21373
21373
  }
21374
21374
  this.addNamedIdentifier(identifier.getName(), identifier);
21375
21375
  }
21376
- addDeferred(token) {
21376
+ addDeferred(token, type) {
21377
21377
  if (token === undefined) {
21378
21378
  return;
21379
21379
  }
21380
- this.current.getData().deferred[token.getStr().toUpperCase()] = token;
21380
+ this.current.getData().deferred[token.getStr().toUpperCase()] = { token, ooType: type };
21381
21381
  }
21382
21382
  addListPrefix(identifiers, prefix) {
21383
21383
  for (const id of identifiers) {
@@ -21482,7 +21482,16 @@ class CurrentScope {
21482
21482
  }
21483
21483
  const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);
21484
21484
  if (def !== undefined) {
21485
- return { id: def };
21485
+ let rttiName = prefixRTTI;
21486
+ switch (def.ooType) {
21487
+ case "INTF":
21488
+ rttiName = rttiName + "\\INTERFACE=" + name;
21489
+ break;
21490
+ default:
21491
+ rttiName = rttiName + "\\CLASS=" + name;
21492
+ break;
21493
+ }
21494
+ return { id: def.id, ooType: def.ooType, RTTIName: rttiName };
21486
21495
  }
21487
21496
  return undefined;
21488
21497
  }
@@ -21512,6 +21521,11 @@ class CurrentScope {
21512
21521
  if (typePoolName.length <= 1 || typePoolName.length > 5) {
21513
21522
  return undefined;
21514
21523
  }
21524
+ if (this.parentObj.getType() === "TYPE"
21525
+ && this.parentObj.getName().toUpperCase() === typePoolName.toUpperCase()) {
21526
+ // dont recurse into itself
21527
+ return undefined;
21528
+ }
21515
21529
  const typePool = this.reg.getObject("TYPE", typePoolName);
21516
21530
  if (typePool === undefined) {
21517
21531
  return undefined;
@@ -21529,6 +21543,11 @@ class CurrentScope {
21529
21543
  if (typePoolName.length <= 2 || typePoolName.length > 5) {
21530
21544
  return undefined;
21531
21545
  }
21546
+ if (this.parentObj.getType() === "TYPE"
21547
+ && this.parentObj.getName().toUpperCase() === typePoolName.toUpperCase()) {
21548
+ // dont recurse into itself
21549
+ return undefined;
21550
+ }
21532
21551
  if (new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
21533
21552
  // this is tricky, it should not do recursion when parsing the type pool itself,
21534
21553
  // think about DTEL ABAP_ENCOD vs TYPE ABAP
@@ -26283,7 +26302,7 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
26283
26302
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
26284
26303
  class RaiseWith {
26285
26304
  runSyntax(node, scope, filename) {
26286
- for (const f of node.findDirectExpressions(Expressions.SimpleSource3)) {
26305
+ for (const f of node.findDirectExpressions(Expressions.SimpleSource1)) {
26287
26306
  new source_1.Source().runSyntax(f, scope, filename);
26288
26307
  }
26289
26308
  }
@@ -26743,6 +26762,11 @@ class Source {
26743
26762
  else {
26744
26763
  this.addIfInferred(node, scope, filename, foundType);
26745
26764
  }
26765
+ children.shift();
26766
+ children.shift();
26767
+ children.shift();
26768
+ children.shift();
26769
+ this.traverseRemainingChildren(children, scope, filename);
26746
26770
  return foundType ? foundType : bodyType;
26747
26771
  }
26748
26772
  case "CONV":
@@ -26859,6 +26883,12 @@ class Source {
26859
26883
  return context;
26860
26884
  }
26861
26885
  ////////////////////////////////
26886
+ traverseRemainingChildren(children, scope, filename) {
26887
+ const last = children[children.length - 1];
26888
+ if (last && last.get() instanceof Expressions.Source) {
26889
+ new Source().runSyntax(last, scope, filename);
26890
+ }
26891
+ }
26862
26892
  infer(context, found) {
26863
26893
  if (context instanceof basic_1.FloatType && found instanceof basic_1.IntegerType) {
26864
26894
  return context;
@@ -27880,7 +27910,10 @@ class SpaghettiScopeNode extends ScopeData {
27880
27910
  while (search !== undefined) {
27881
27911
  const found = search.getData().deferred[name.toUpperCase()];
27882
27912
  if (found) {
27883
- return new _identifier_1.Identifier(found, search.identifier.filename);
27913
+ return {
27914
+ id: new _identifier_1.Identifier(found.token, search.identifier.filename),
27915
+ ooType: found.ooType,
27916
+ };
27884
27917
  }
27885
27918
  search = search.getParent();
27886
27919
  }
@@ -28781,7 +28814,7 @@ class ClassDeferred {
28781
28814
  runSyntax(node, scope, _filename) {
28782
28815
  var _a;
28783
28816
  const name = (_a = node.findFirstExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
28784
- scope.addDeferred(name);
28817
+ scope.addDeferred(name, "CLAS");
28785
28818
  }
28786
28819
  }
28787
28820
  exports.ClassDeferred = ClassDeferred;
@@ -30591,7 +30624,7 @@ class InterfaceDeferred {
30591
30624
  runSyntax(node, scope, _filename) {
30592
30625
  var _a;
30593
30626
  const name = (_a = node.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
30594
- scope.addDeferred(name);
30627
+ scope.addDeferred(name, "INTF");
30595
30628
  }
30596
30629
  }
30597
30630
  exports.InterfaceDeferred = InterfaceDeferred;
@@ -34169,13 +34202,13 @@ class FlowGraph {
34169
34202
  this.label = label;
34170
34203
  }
34171
34204
  toDigraph() {
34172
- return `digraph G {
34173
- labelloc="t";
34174
- label="${this.label}";
34175
- graph [fontname = "helvetica"];
34176
- node [fontname = "helvetica", shape="box"];
34177
- edge [fontname = "helvetica"];
34178
- ${this.toTextEdges()}
34205
+ return `digraph G {
34206
+ labelloc="t";
34207
+ label="${this.label}";
34208
+ graph [fontname = "helvetica"];
34209
+ node [fontname = "helvetica", shape="box"];
34210
+ edge [fontname = "helvetica"];
34211
+ ${this.toTextEdges()}
34179
34212
  }`;
34180
34213
  }
34181
34214
  listSources(node) {
@@ -42213,13 +42246,13 @@ class Help {
42213
42246
  /////////////////////////////////////////////////
42214
42247
  static dumpABAP(file, reg, textDocument, position) {
42215
42248
  let content = "";
42216
- content = `
42217
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
42218
- <a href="#_statements" rel="no-refresh">Statements</a> |
42219
- <a href="#_structure" rel="no-refresh">Structure</a> |
42220
- <a href="#_files" rel="no-refresh">Files</a> |
42221
- <a href="#_info" rel="no-refresh">Info Dump</a>
42222
- <hr>
42249
+ content = `
42250
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
42251
+ <a href="#_statements" rel="no-refresh">Statements</a> |
42252
+ <a href="#_structure" rel="no-refresh">Structure</a> |
42253
+ <a href="#_files" rel="no-refresh">Files</a> |
42254
+ <a href="#_info" rel="no-refresh">Info Dump</a>
42255
+ <hr>
42223
42256
  ` +
42224
42257
  "<tt>" + textDocument.uri + " (" +
42225
42258
  (position.line + 1) + ", " +
@@ -51216,7 +51249,7 @@ class Registry {
51216
51249
  }
51217
51250
  static abaplintVersion() {
51218
51251
  // magic, see build script "version.sh"
51219
- return "2.105.17";
51252
+ return "2.105.19";
51220
51253
  }
51221
51254
  getDDICReferences() {
51222
51255
  return this.ddicReferences;
@@ -51532,10 +51565,10 @@ class SevenBitAscii {
51532
51565
  key: "7bit_ascii",
51533
51566
  title: "Check for 7bit ascii",
51534
51567
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
51535
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51536
-
51537
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51538
-
51568
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51569
+
51570
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51571
+
51539
51572
  Checkes files with extensions ".abap" and ".asddls"`,
51540
51573
  tags: [_irule_1.RuleTag.SingleFile],
51541
51574
  };
@@ -51739,10 +51772,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
51739
51772
  key: "abapdoc",
51740
51773
  title: "Check abapdoc",
51741
51774
  shortDescription: `Various checks regarding abapdoc.`,
51742
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51743
-
51744
- Plus class and interface definitions.
51745
-
51775
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51776
+
51777
+ Plus class and interface definitions.
51778
+
51746
51779
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
51747
51780
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
51748
51781
  };
@@ -51880,49 +51913,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
51880
51913
  key: "align_parameters",
51881
51914
  title: "Align Parameters",
51882
51915
  shortDescription: `Checks for vertially aligned parameters`,
51883
- extendedInformation: `Checks:
51884
- * function module calls
51885
- * method calls
51886
- * VALUE constructors
51887
- * NEW constructors
51888
- * RAISE EXCEPTION statements
51889
- * CREATE OBJECT statements
51890
- * RAISE EVENT statements
51891
-
51892
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51893
-
51894
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51895
-
51896
- If parameters are on the same row, no issues are reported, see
51916
+ extendedInformation: `Checks:
51917
+ * function module calls
51918
+ * method calls
51919
+ * VALUE constructors
51920
+ * NEW constructors
51921
+ * RAISE EXCEPTION statements
51922
+ * CREATE OBJECT statements
51923
+ * RAISE EVENT statements
51924
+
51925
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51926
+
51927
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51928
+
51929
+ If parameters are on the same row, no issues are reported, see
51897
51930
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
51898
51931
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
51899
- badExample: `CALL FUNCTION 'FOOBAR'
51900
- EXPORTING
51901
- foo = 2
51902
- parameter = 3.
51903
-
51904
- foobar( moo = 1
51905
- param = 1 ).
51906
-
51907
- foo = VALUE #(
51908
- foo = bar
51932
+ badExample: `CALL FUNCTION 'FOOBAR'
51933
+ EXPORTING
51934
+ foo = 2
51935
+ parameter = 3.
51936
+
51937
+ foobar( moo = 1
51938
+ param = 1 ).
51939
+
51940
+ foo = VALUE #(
51941
+ foo = bar
51909
51942
  moo = 2 ).`,
51910
- goodExample: `CALL FUNCTION 'FOOBAR'
51911
- EXPORTING
51912
- foo = 2
51913
- parameter = 3.
51914
-
51915
- foobar( moo = 1
51916
- param = 1 ).
51917
-
51918
- foo = VALUE #(
51919
- foo = bar
51920
- moo = 2 ).
51921
-
51922
- DATA(sdf) = VALUE type(
51923
- common_val = 2
51924
- another_common = 5
51925
- ( row_value = 4
51943
+ goodExample: `CALL FUNCTION 'FOOBAR'
51944
+ EXPORTING
51945
+ foo = 2
51946
+ parameter = 3.
51947
+
51948
+ foobar( moo = 1
51949
+ param = 1 ).
51950
+
51951
+ foo = VALUE #(
51952
+ foo = bar
51953
+ moo = 2 ).
51954
+
51955
+ DATA(sdf) = VALUE type(
51956
+ common_val = 2
51957
+ another_common = 5
51958
+ ( row_value = 4
51926
51959
  value_foo = 5 ) ).`,
51927
51960
  };
51928
51961
  }
@@ -52398,15 +52431,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
52398
52431
  return {
52399
52432
  key: "ambiguous_statement",
52400
52433
  title: "Check for ambigious statements",
52401
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52402
- Add "TABLE" keyword or "@" for escaping SQL variables
52403
-
52434
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52435
+ Add "TABLE" keyword or "@" for escaping SQL variables
52436
+
52404
52437
  Only works if the target version is 740sp05 or above`,
52405
52438
  tags: [_irule_1.RuleTag.SingleFile],
52406
- badExample: `DELETE foo FROM bar.
52439
+ badExample: `DELETE foo FROM bar.
52407
52440
  MODIFY foo FROM bar.`,
52408
- goodExample: `DELETE foo FROM @bar.
52409
- MODIFY TABLE foo FROM bar.
52441
+ goodExample: `DELETE foo FROM @bar.
52442
+ MODIFY TABLE foo FROM bar.
52410
52443
  MODIFY zfoo FROM @wa.`,
52411
52444
  };
52412
52445
  }
@@ -52511,16 +52544,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
52511
52544
  key: "avoid_use",
52512
52545
  title: "Avoid use of certain statements",
52513
52546
  shortDescription: `Detects usage of certain statements.`,
52514
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52515
-
52516
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52517
-
52518
- STATICS: use CLASS-DATA instead
52519
-
52520
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52521
-
52522
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52523
-
52547
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52548
+
52549
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52550
+
52551
+ STATICS: use CLASS-DATA instead
52552
+
52553
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52554
+
52555
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52556
+
52524
52557
  BREAK points`,
52525
52558
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
52526
52559
  };
@@ -52651,11 +52684,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
52651
52684
  title: "Check BEGIN END names",
52652
52685
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
52653
52686
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
52654
- badExample: `DATA: BEGIN OF stru,
52655
- field TYPE i,
52687
+ badExample: `DATA: BEGIN OF stru,
52688
+ field TYPE i,
52656
52689
  END OF structure_not_the_same.`,
52657
- goodExample: `DATA: BEGIN OF stru,
52658
- field TYPE i,
52690
+ goodExample: `DATA: BEGIN OF stru,
52691
+ field TYPE i,
52659
52692
  END OF stru.`,
52660
52693
  };
52661
52694
  }
@@ -52748,19 +52781,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
52748
52781
  title: "BEGIN contains single INCLUDE",
52749
52782
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
52750
52783
  tags: [_irule_1.RuleTag.SingleFile],
52751
- badExample: `TYPES: BEGIN OF dummy1.
52752
- INCLUDE TYPE dselc.
52753
- TYPES: END OF dummy1.
52754
-
52755
- DATA BEGIN OF foo.
52756
- INCLUDE STRUCTURE syst.
52757
- DATA END OF foo.
52758
-
52759
- STATICS BEGIN OF bar.
52760
- INCLUDE STRUCTURE syst.
52784
+ badExample: `TYPES: BEGIN OF dummy1.
52785
+ INCLUDE TYPE dselc.
52786
+ TYPES: END OF dummy1.
52787
+
52788
+ DATA BEGIN OF foo.
52789
+ INCLUDE STRUCTURE syst.
52790
+ DATA END OF foo.
52791
+
52792
+ STATICS BEGIN OF bar.
52793
+ INCLUDE STRUCTURE syst.
52761
52794
  STATICS END OF bar.`,
52762
- goodExample: `DATA BEGIN OF foo.
52763
- INCLUDE STRUCTURE dselc.
52795
+ goodExample: `DATA BEGIN OF foo.
52796
+ INCLUDE STRUCTURE dselc.
52764
52797
  DATA END OF foo.`,
52765
52798
  };
52766
52799
  }
@@ -52850,9 +52883,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
52850
52883
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
52851
52884
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
52852
52885
  badExample: `CALL TRANSACTION 'FOO'.`,
52853
- goodExample: `TRY.
52854
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52855
- CATCH cx_sy_authorization_error.
52886
+ goodExample: `TRY.
52887
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52888
+ CATCH cx_sy_authorization_error.
52856
52889
  ENDTRY.`,
52857
52890
  };
52858
52891
  }
@@ -52917,10 +52950,10 @@ class CDSCommentStyle {
52917
52950
  key: "cds_comment_style",
52918
52951
  title: "CDS Comment Style",
52919
52952
  shortDescription: `Check for obsolete comment style`,
52920
- extendedInformation: `Check for obsolete comment style
52921
-
52922
- Comments starting with "--" are considered obsolete
52923
-
52953
+ extendedInformation: `Check for obsolete comment style
52954
+
52955
+ Comments starting with "--" are considered obsolete
52956
+
52924
52957
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
52925
52958
  tags: [_irule_1.RuleTag.SingleFile],
52926
52959
  badExample: "-- this is a comment",
@@ -52987,10 +53020,10 @@ class CDSLegacyView {
52987
53020
  title: "CDS Legacy View",
52988
53021
  shortDescription: `Identify CDS Legacy Views`,
52989
53022
  // eslint-disable-next-line max-len
52990
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52991
-
52992
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52993
-
53023
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
53024
+
53025
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
53026
+
52994
53027
  v755 and up`,
52995
53028
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
52996
53029
  };
@@ -53145,10 +53178,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
53145
53178
  key: "chain_mainly_declarations",
53146
53179
  title: "Chain mainly declarations",
53147
53180
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
53148
- extendedInformation: `
53149
- https://docs.abapopenchecks.org/checks/23/
53150
-
53151
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53181
+ extendedInformation: `
53182
+ https://docs.abapopenchecks.org/checks/23/
53183
+
53184
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53152
53185
  `,
53153
53186
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53154
53187
  badExample: `CALL METHOD: bar.`,
@@ -53324,17 +53357,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
53324
53357
  title: "Change IF to CASE",
53325
53358
  shortDescription: `Finds IF constructs that can be changed to CASE`,
53326
53359
  // eslint-disable-next-line max-len
53327
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53328
-
53360
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53361
+
53329
53362
  If the first comparison is a boolean compare, no issue is reported.`,
53330
53363
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53331
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
53332
- ELSEIF l_fcat-fieldname = 'BAR'
53333
- OR l_fcat-fieldname = 'MOO'.
53364
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
53365
+ ELSEIF l_fcat-fieldname = 'BAR'
53366
+ OR l_fcat-fieldname = 'MOO'.
53334
53367
  ENDIF.`,
53335
- goodExample: `CASE l_fcat-fieldname.
53336
- WHEN 'FOO'.
53337
- WHEN 'BAR' OR 'MOO'.
53368
+ goodExample: `CASE l_fcat-fieldname.
53369
+ WHEN 'FOO'.
53370
+ WHEN 'BAR' OR 'MOO'.
53338
53371
  ENDCASE.`,
53339
53372
  };
53340
53373
  }
@@ -53471,8 +53504,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
53471
53504
  return {
53472
53505
  key: "check_abstract",
53473
53506
  title: "Check abstract methods and classes",
53474
- shortDescription: `Checks abstract methods and classes:
53475
- - class defined as abstract and final,
53507
+ shortDescription: `Checks abstract methods and classes:
53508
+ - class defined as abstract and final,
53476
53509
  - non-abstract class contains abstract methods`,
53477
53510
  extendedInformation: `If a class defines only constants, use an interface instead`,
53478
53511
  tags: [_irule_1.RuleTag.SingleFile],
@@ -53553,11 +53586,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
53553
53586
  return {
53554
53587
  key: "check_comments",
53555
53588
  title: "Check Comments",
53556
- shortDescription: `
53589
+ shortDescription: `
53557
53590
  Various checks for comment usage.`,
53558
- extendedInformation: `
53559
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53560
-
53591
+ extendedInformation: `
53592
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53593
+
53561
53594
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
53562
53595
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53563
53596
  badExample: `WRITE 2. " descriptive comment`,
@@ -53719,9 +53752,9 @@ class CheckInclude {
53719
53752
  key: "check_include",
53720
53753
  title: "Check INCLUDEs",
53721
53754
  shortDescription: `Checks INCLUDE statements`,
53722
- extendedInformation: `
53723
- * Reports unused includes
53724
- * Errors if the includes are not found
53755
+ extendedInformation: `
53756
+ * Reports unused includes
53757
+ * Errors if the includes are not found
53725
53758
  * Error if including a main program`,
53726
53759
  tags: [_irule_1.RuleTag.Syntax],
53727
53760
  };
@@ -53796,14 +53829,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
53796
53829
  key: "check_subrc",
53797
53830
  title: "Check sy-subrc",
53798
53831
  shortDescription: `Check sy-subrc`,
53799
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53800
-
53801
- If sy-dbcnt is checked after database statements, it is considered okay.
53802
-
53803
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53804
-
53805
- If IS ASSIGNED is checked after assigning, it is considered okay.
53806
-
53832
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53833
+
53834
+ If sy-dbcnt is checked after database statements, it is considered okay.
53835
+
53836
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53837
+
53838
+ If IS ASSIGNED is checked after assigning, it is considered okay.
53839
+
53807
53840
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
53808
53841
  tags: [_irule_1.RuleTag.SingleFile],
53809
53842
  pseudoComment: "EC CI_SUBRC",
@@ -54356,17 +54389,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
54356
54389
  shortDescription: `Find overlapping classic exceptions`,
54357
54390
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
54358
54391
  tags: [_irule_1.RuleTag.SingleFile],
54359
- badExample: `CALL FUNCTION 'SOMETHING'
54360
- EXCEPTIONS
54361
- system_failure = 1 MESSAGE lv_message
54362
- communication_failure = 1 MESSAGE lv_message
54363
- resource_failure = 1
54392
+ badExample: `CALL FUNCTION 'SOMETHING'
54393
+ EXCEPTIONS
54394
+ system_failure = 1 MESSAGE lv_message
54395
+ communication_failure = 1 MESSAGE lv_message
54396
+ resource_failure = 1
54364
54397
  OTHERS = 1.`,
54365
- goodExample: `CALL FUNCTION 'SOMETHING'
54366
- EXCEPTIONS
54367
- system_failure = 1 MESSAGE lv_message
54368
- communication_failure = 2 MESSAGE lv_message
54369
- resource_failure = 3
54398
+ goodExample: `CALL FUNCTION 'SOMETHING'
54399
+ EXCEPTIONS
54400
+ system_failure = 1 MESSAGE lv_message
54401
+ communication_failure = 2 MESSAGE lv_message
54402
+ resource_failure = 3
54370
54403
  OTHERS = 4.`,
54371
54404
  };
54372
54405
  }
@@ -54612,7 +54645,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
54612
54645
  key: "commented_code",
54613
54646
  title: "Find commented code",
54614
54647
  shortDescription: `Detects usage of commented out code.`,
54615
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54648
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54616
54649
  https://docs.abapopenchecks.org/checks/14/`,
54617
54650
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54618
54651
  };
@@ -54844,10 +54877,10 @@ class ConstructorVisibilityPublic {
54844
54877
  key: "constructor_visibility_public",
54845
54878
  title: "Check constructor visibility is public",
54846
54879
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
54847
- extendedInformation: `
54848
- This only applies to global classes.
54849
-
54850
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54880
+ extendedInformation: `
54881
+ This only applies to global classes.
54882
+
54883
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54851
54884
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
54852
54885
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54853
54886
  };
@@ -54922,8 +54955,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
54922
54955
  key: "contains_tab",
54923
54956
  title: "Code contains tab",
54924
54957
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
54925
- extendedInformation: `
54926
- https://docs.abapopenchecks.org/checks/09/
54958
+ extendedInformation: `
54959
+ https://docs.abapopenchecks.org/checks/09/
54927
54960
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
54928
54961
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54929
54962
  };
@@ -55008,10 +55041,10 @@ class CyclicOO {
55008
55041
  key: "cyclic_oo",
55009
55042
  title: "Cyclic OO",
55010
55043
  shortDescription: `Finds cyclic OO references`,
55011
- extendedInformation: `Runs for global INTF + CLAS objects
55012
-
55013
- Objects must be without syntax errors for this rule to take effect
55014
-
55044
+ extendedInformation: `Runs for global INTF + CLAS objects
55045
+
55046
+ Objects must be without syntax errors for this rule to take effect
55047
+
55015
55048
  References in testclass includes are ignored`,
55016
55049
  };
55017
55050
  }
@@ -55253,7 +55286,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
55253
55286
  key: "dangerous_statement",
55254
55287
  title: "Dangerous statement",
55255
55288
  shortDescription: `Detects potentially dangerous statements`,
55256
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55289
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55257
55290
  dynamic SQL can potentially create SQL injection problems`,
55258
55291
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55259
55292
  };
@@ -55457,13 +55490,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
55457
55490
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
55458
55491
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
55459
55492
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55460
- badExample: `FROM foo.
55461
- WRITE 'hello'.
55462
- DATA int TYPE i.
55493
+ badExample: `FROM foo.
55494
+ WRITE 'hello'.
55495
+ DATA int TYPE i.
55463
55496
  ENDFORM.`,
55464
- goodExample: `FROM foo.
55465
- DATA int TYPE i.
55466
- WRITE 'hello'.
55497
+ goodExample: `FROM foo.
55498
+ DATA int TYPE i.
55499
+ WRITE 'hello'.
55467
55500
  ENDFORM.`,
55468
55501
  };
55469
55502
  }
@@ -55999,39 +56032,39 @@ class Downport {
55999
56032
  key: "downport",
56000
56033
  title: "Downport statement",
56001
56034
  shortDescription: `Downport functionality`,
56002
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56003
- a higher level language version. If successful, various rules are applied to downport the statement.
56004
- Target downport version is always v702, thus rule is only enabled if target version is v702.
56005
-
56006
- Current rules:
56007
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56008
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56009
- * FIELD-SYMBOL() definitions are outlined
56010
- * CONV is outlined
56011
- * COND is outlined
56012
- * REDUCE is outlined
56013
- * SWITCH is outlined
56014
- * FILTER is outlined
56015
- * APPEND expression is outlined
56016
- * INSERT expression is outlined
56017
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56018
- * CAST changed to ?=
56019
- * LOOP AT method_call( ) is outlined
56020
- * VALUE # with structure fields
56021
- * VALUE # with internal table lines
56022
- * Table Expressions are outlined
56023
- * SELECT INTO @DATA definitions are outlined
56024
- * Some occurrences of string template formatting option ALPHA changed to function module call
56025
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56026
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56027
- * RAISE EXCEPTION ... MESSAGE
56028
- * Moving with +=, -=, /=, *=, &&= is expanded
56029
- * line_exists and line_index is downported to READ TABLE
56030
- * ENUMs, but does not nessesarily give the correct type and value
56031
- * MESSAGE with non simple source
56032
-
56033
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56034
-
56035
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56036
+ a higher level language version. If successful, various rules are applied to downport the statement.
56037
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
56038
+
56039
+ Current rules:
56040
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56041
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56042
+ * FIELD-SYMBOL() definitions are outlined
56043
+ * CONV is outlined
56044
+ * COND is outlined
56045
+ * REDUCE is outlined
56046
+ * SWITCH is outlined
56047
+ * FILTER is outlined
56048
+ * APPEND expression is outlined
56049
+ * INSERT expression is outlined
56050
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56051
+ * CAST changed to ?=
56052
+ * LOOP AT method_call( ) is outlined
56053
+ * VALUE # with structure fields
56054
+ * VALUE # with internal table lines
56055
+ * Table Expressions are outlined
56056
+ * SELECT INTO @DATA definitions are outlined
56057
+ * Some occurrences of string template formatting option ALPHA changed to function module call
56058
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56059
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56060
+ * RAISE EXCEPTION ... MESSAGE
56061
+ * Moving with +=, -=, /=, *=, &&= is expanded
56062
+ * line_exists and line_index is downported to READ TABLE
56063
+ * ENUMs, but does not nessesarily give the correct type and value
56064
+ * MESSAGE with non simple source
56065
+
56066
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56067
+
56035
56068
  Make sure to test the downported code, it might not always be completely correct.`,
56036
56069
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
56037
56070
  };
@@ -56605,10 +56638,10 @@ Make sure to test the downported code, it might not always be completely correct
56605
56638
  const fieldName = f.concatTokens();
56606
56639
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
56607
56640
  }
56608
- fieldDefinition = `DATA: BEGIN OF ${name},
56641
+ fieldDefinition = `DATA: BEGIN OF ${name},
56609
56642
  ${fieldDefinition}${indentation} END OF ${name}.`;
56610
56643
  }
56611
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56644
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56612
56645
  ${indentation}`);
56613
56646
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
56614
56647
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56652,12 +56685,12 @@ ${indentation}`);
56652
56685
  }
56653
56686
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56654
56687
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
56655
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56656
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56657
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56688
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56689
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56690
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56658
56691
  ${indentation}`);
56659
56692
  if (fieldDefinitions === "") {
56660
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56693
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56661
56694
  ${indentation}`);
56662
56695
  }
56663
56696
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -56725,7 +56758,7 @@ ${indentation}`);
56725
56758
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56726
56759
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56727
56760
  const firstToken = high.getFirstToken();
56728
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56761
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56729
56762
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56730
56763
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56731
56764
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56763,7 +56796,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56763
56796
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56764
56797
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56765
56798
  const firstToken = high.getFirstToken();
56766
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56799
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56767
56800
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56768
56801
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56769
56802
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56805,14 +56838,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56805
56838
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56806
56839
  const firstToken = high.getFirstToken();
56807
56840
  // note that the tabix restore should be done before throwing the exception
56808
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56809
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56810
- ${indentation}${tabixBackup} = sy-tabix.
56811
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56812
- ${indentation}sy-tabix = ${tabixBackup}.
56813
- ${indentation}IF sy-subrc <> 0.
56814
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56815
- ${indentation}ENDIF.
56841
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56842
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56843
+ ${indentation}${tabixBackup} = sy-tabix.
56844
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56845
+ ${indentation}sy-tabix = ${tabixBackup}.
56846
+ ${indentation}IF sy-subrc <> 0.
56847
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56848
+ ${indentation}ENDIF.
56816
56849
  ${indentation}`);
56817
56850
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
56818
56851
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56869,7 +56902,7 @@ ${indentation}`);
56869
56902
  const className = classNames[0].concatTokens();
56870
56903
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
56871
56904
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56872
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
56905
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
56873
56906
  ${indentation}CATCH ${className} INTO ${targetName}.`;
56874
56907
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
56875
56908
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -57026,21 +57059,21 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
57026
57059
  }
57027
57060
  startToken = node.getFirstToken();
57028
57061
  }
57029
- const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource3)) || [];
57062
+ const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource1)) || [];
57030
57063
  const className = ((_g = node.findDirectExpression(Expressions.ClassName)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "ERROR";
57031
57064
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57032
57065
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57033
57066
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
57034
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57035
- ${indentation}${uniqueName1}-msgid = ${id}.
57067
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57068
+ ${indentation}${uniqueName1}-msgid = ${id}.
57036
57069
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
57037
57070
  if (withs.length > 0) {
57038
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57039
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57040
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57071
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57072
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57073
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57041
57074
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
57042
57075
  }
57043
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57076
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57044
57077
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
57045
57078
  if (withs.length > 0) {
57046
57079
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -57152,10 +57185,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
57152
57185
  let code = "";
57153
57186
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
57154
57187
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57155
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57156
- IF sy-subrc <> 0.
57157
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57158
- ENDIF.
57188
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57189
+ IF sy-subrc <> 0.
57190
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57191
+ ENDIF.
57159
57192
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57160
57193
  }
57161
57194
  else {
@@ -57231,20 +57264,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57231
57264
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57232
57265
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57233
57266
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57234
- code += ` items LIKE ${loopSourceName},
57235
- END OF ${groupTargetName}type.
57236
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57237
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57267
+ code += ` items LIKE ${loopSourceName},
57268
+ END OF ${groupTargetName}type.
57269
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57270
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57238
57271
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
57239
57272
  if (groupIndexName !== undefined) {
57240
57273
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
57241
57274
  }
57242
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57275
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57243
57276
  IF sy-subrc = 0.\n`;
57244
57277
  if (groupCountName !== undefined) {
57245
57278
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
57246
57279
  }
57247
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57280
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57248
57281
  ELSE.\n`;
57249
57282
  code += ` CLEAR ${uniqueName}.\n`;
57250
57283
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -57265,8 +57298,8 @@ ELSE.\n`;
57265
57298
  }
57266
57299
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
57267
57300
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
57268
- code += `ENDIF.
57269
- ENDLOOP.
57301
+ code += `ENDIF.
57302
+ ENDLOOP.
57270
57303
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57271
57304
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
57272
57305
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -57438,7 +57471,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57438
57471
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
57439
57472
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
57440
57473
  // all ENUMS are char like?
57441
- let code = `TYPES ${enumName} TYPE string.
57474
+ let code = `TYPES ${enumName} TYPE string.
57442
57475
  CONSTANTS: BEGIN OF ${structureName},\n`;
57443
57476
  let count = 1;
57444
57477
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -57482,14 +57515,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
57482
57515
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57483
57516
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57484
57517
  // restore tabix before exeption
57485
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57486
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57487
- ${indentation}${tabixBackup} = sy-tabix.
57488
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57489
- ${indentation}sy-tabix = ${tabixBackup}.
57490
- ${indentation}IF sy-subrc <> 0.
57491
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57492
- ${indentation}ENDIF.
57518
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57519
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57520
+ ${indentation}${tabixBackup} = sy-tabix.
57521
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57522
+ ${indentation}sy-tabix = ${tabixBackup}.
57523
+ ${indentation}IF sy-subrc <> 0.
57524
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57525
+ ${indentation}ENDIF.
57493
57526
  ${indentation}${uniqueName}`;
57494
57527
  const start = target.getFirstToken().getStart();
57495
57528
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -57573,11 +57606,11 @@ ${indentation}${uniqueName}`;
57573
57606
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57574
57607
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57575
57608
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57576
- const code = `DATA ${uniqueName} TYPE string.
57577
- ${indentation}CALL FUNCTION '${functionName}'
57578
- ${indentation} EXPORTING
57579
- ${indentation} input = ${source}
57580
- ${indentation} IMPORTING
57609
+ const code = `DATA ${uniqueName} TYPE string.
57610
+ ${indentation}CALL FUNCTION '${functionName}'
57611
+ ${indentation} EXPORTING
57612
+ ${indentation} input = ${source}
57613
+ ${indentation} IMPORTING
57581
57614
  ${indentation} output = ${uniqueName}.\n`;
57582
57615
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
57583
57616
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -58084,7 +58117,7 @@ ${indentation} output = ${uniqueName}.\n`;
58084
58117
  body += data;
58085
58118
  added = true;
58086
58119
  }
58087
- body += indentation + structureName + "-" + b.concatTokens() + ".\n";
58120
+ body += indentation + structureName + "-" + b.concatTokensWithLinebreaks() + ".\n";
58088
58121
  }
58089
58122
  else if (b.get() instanceof Expressions.Source) {
58090
58123
  // note: it wont work with APPEND for Hashed/Sorted Tables, so use INSERT,
@@ -58889,12 +58922,12 @@ class EasyToFindMessages {
58889
58922
  key: "easy_to_find_messages",
58890
58923
  title: "Easy to find messages",
58891
58924
  shortDescription: `Make messages easy to find`,
58892
- extendedInformation: `All messages must be statically referenced exactly once
58893
-
58894
- Only MESSAGE and RAISE statments are counted as static references
58895
-
58896
- Also see rule "message_exists"
58897
-
58925
+ extendedInformation: `All messages must be statically referenced exactly once
58926
+
58927
+ Only MESSAGE and RAISE statments are counted as static references
58928
+
58929
+ Also see rule "message_exists"
58930
+
58898
58931
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
58899
58932
  tags: [_irule_1.RuleTag.Styleguide],
58900
58933
  };
@@ -58979,8 +59012,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
58979
59012
  key: "empty_line_in_statement",
58980
59013
  title: "Find empty lines in statements",
58981
59014
  shortDescription: `Checks that statements do not contain empty lines.`,
58982
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58983
-
59015
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
59016
+
58984
59017
  https://docs.abapopenchecks.org/checks/41/`,
58985
59018
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
58986
59019
  badExample: `WRITE\n\nhello.`,
@@ -59114,6 +59147,7 @@ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ ".
59114
59147
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
59115
59148
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
59116
59149
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
59150
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
59117
59151
  class EmptyStructureConf extends _basic_rule_config_1.BasicRuleConfig {
59118
59152
  constructor() {
59119
59153
  super(...arguments);
@@ -59168,6 +59202,11 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
59168
59202
  if (stru === undefined) {
59169
59203
  return [];
59170
59204
  }
59205
+ for (const statement of file.getStatements()) {
59206
+ if (statement.get() instanceof _statement_1.Unknown) {
59207
+ return []; // contains parser errors
59208
+ }
59209
+ }
59171
59210
  const candidates = [];
59172
59211
  if (this.getConfig().loop === true) {
59173
59212
  candidates.push(...stru.findAllStructuresRecursive(Structures.Loop));
@@ -59272,10 +59311,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
59272
59311
  return {
59273
59312
  key: "exit_or_check",
59274
59313
  title: "Find EXIT or CHECK outside loops",
59275
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59314
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59276
59315
  Use RETURN to leave procesing blocks instead.`,
59277
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59278
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59316
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59317
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59279
59318
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
59280
59319
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
59281
59320
  };
@@ -59358,12 +59397,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
59358
59397
  key: "expand_macros",
59359
59398
  title: "Expand Macros",
59360
59399
  shortDescription: `Allows expanding macro calls with quick fixes`,
59361
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59362
-
59400
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59401
+
59363
59402
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
59364
- badExample: `DEFINE _hello.
59365
- WRITE 'hello'.
59366
- END-OF-DEFINITION.
59403
+ badExample: `DEFINE _hello.
59404
+ WRITE 'hello'.
59405
+ END-OF-DEFINITION.
59367
59406
  _hello.`,
59368
59407
  goodExample: `WRITE 'hello'.`,
59369
59408
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -59450,7 +59489,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
59450
59489
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
59451
59490
  badExample: `call_method( EXPORTING foo = bar ).`,
59452
59491
  goodExample: `call_method( foo = bar ).`,
59453
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59492
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59454
59493
  https://docs.abapopenchecks.org/checks/30/`,
59455
59494
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59456
59495
  };
@@ -59548,7 +59587,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
59548
59587
  key: "forbidden_identifier",
59549
59588
  title: "Forbidden Identifier",
59550
59589
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
59551
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59590
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59552
59591
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
59553
59592
  tags: [_irule_1.RuleTag.SingleFile],
59554
59593
  };
@@ -59790,8 +59829,8 @@ class ForbiddenVoidType {
59790
59829
  key: "forbidden_void_type",
59791
59830
  title: "Forbidden Void Types",
59792
59831
  shortDescription: `Avoid usage of specified void types.`,
59793
- extendedInformation: `Inspiration:
59794
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59832
+ extendedInformation: `Inspiration:
59833
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59795
59834
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
59796
59835
  };
59797
59836
  }
@@ -60034,7 +60073,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
60034
60073
  key: "fully_type_itabs",
60035
60074
  title: "Fully type internal tables",
60036
60075
  shortDescription: `No implict table types or table keys`,
60037
- badExample: `DATA lt_foo TYPE TABLE OF ty.
60076
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
60038
60077
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
60039
60078
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
60040
60079
  tags: [_irule_1.RuleTag.SingleFile],
@@ -60219,26 +60258,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
60219
60258
  key: "functional_writing",
60220
60259
  title: "Use functional writing",
60221
60260
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
60222
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60261
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60223
60262
  https://docs.abapopenchecks.org/checks/07/`,
60224
60263
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
60225
- badExample: `CALL METHOD zcl_class=>method( ).
60226
- CALL METHOD cl_abap_typedescr=>describe_by_name
60227
- EXPORTING
60228
- p_name = 'NAME'
60229
- RECEIVING
60230
- p_descr_ref = lr_typedescr
60231
- EXCEPTIONS
60232
- type_not_found = 1
60264
+ badExample: `CALL METHOD zcl_class=>method( ).
60265
+ CALL METHOD cl_abap_typedescr=>describe_by_name
60266
+ EXPORTING
60267
+ p_name = 'NAME'
60268
+ RECEIVING
60269
+ p_descr_ref = lr_typedescr
60270
+ EXCEPTIONS
60271
+ type_not_found = 1
60233
60272
  OTHERS = 2.`,
60234
- goodExample: `zcl_class=>method( ).
60235
- cl_abap_typedescr=>describe_by_name(
60236
- EXPORTING
60237
- p_name = 'NAME'
60238
- RECEIVING
60239
- p_descr_ref = lr_typedescr
60240
- EXCEPTIONS
60241
- type_not_found = 1
60273
+ goodExample: `zcl_class=>method( ).
60274
+ cl_abap_typedescr=>describe_by_name(
60275
+ EXPORTING
60276
+ p_name = 'NAME'
60277
+ RECEIVING
60278
+ p_descr_ref = lr_typedescr
60279
+ EXCEPTIONS
60280
+ type_not_found = 1
60242
60281
  OTHERS = 2 ).`,
60243
60282
  };
60244
60283
  }
@@ -60349,14 +60388,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
60349
60388
  key: "global_class",
60350
60389
  title: "Global class checks",
60351
60390
  shortDescription: `Checks related to global classes`,
60352
- extendedInformation: `* global classes must be in own files
60353
-
60354
- * file names must match class name
60355
-
60356
- * file names must match interface name
60357
-
60358
- * global classes must be global definitions
60359
-
60391
+ extendedInformation: `* global classes must be in own files
60392
+
60393
+ * file names must match class name
60394
+
60395
+ * file names must match interface name
60396
+
60397
+ * global classes must be global definitions
60398
+
60360
60399
  * global interfaces must be global definitions`,
60361
60400
  tags: [_irule_1.RuleTag.Syntax],
60362
60401
  };
@@ -60455,8 +60494,8 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
60455
60494
  return {
60456
60495
  key: "identical_conditions",
60457
60496
  title: "Identical conditions",
60458
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60459
-
60497
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60498
+
60460
60499
  Prerequsites: code is pretty printed with identical cAsE`,
60461
60500
  tags: [_irule_1.RuleTag.SingleFile],
60462
60501
  };
@@ -60577,6 +60616,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
60577
60616
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
60578
60617
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
60579
60618
  const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
60619
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
60580
60620
  class IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {
60581
60621
  }
60582
60622
  exports.IdenticalContentsConf = IdenticalContentsConf;
@@ -60590,23 +60630,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
60590
60630
  key: "identical_contents",
60591
60631
  title: "Identical contents",
60592
60632
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
60593
- extendedInformation: `
60594
- Prerequsites: code is pretty printed with identical cAsE
60595
-
60633
+ extendedInformation: `
60634
+ Prerequsites: code is pretty printed with identical cAsE
60635
+
60596
60636
  Chained statments are ignored`,
60597
60637
  tags: [_irule_1.RuleTag.SingleFile],
60598
- badExample: `IF foo = bar.
60599
- WRITE 'bar'.
60600
- WRITE 'world'.
60601
- ELSE.
60602
- WRITE 'foo'.
60603
- WRITE 'world'.
60638
+ badExample: `IF foo = bar.
60639
+ WRITE 'bar'.
60640
+ WRITE 'world'.
60641
+ ELSE.
60642
+ WRITE 'foo'.
60643
+ WRITE 'world'.
60604
60644
  ENDIF.`,
60605
- goodExample: `IF foo = bar.
60606
- WRITE 'bar'.
60607
- ELSE.
60608
- WRITE 'foo'.
60609
- ENDIF.
60645
+ goodExample: `IF foo = bar.
60646
+ WRITE 'bar'.
60647
+ ELSE.
60648
+ WRITE 'foo'.
60649
+ ENDIF.
60610
60650
  WRITE 'world'.`,
60611
60651
  };
60612
60652
  }
@@ -60622,6 +60662,11 @@ WRITE 'world'.`,
60622
60662
  if (structure === undefined) {
60623
60663
  return [];
60624
60664
  }
60665
+ for (const statement of file.getStatements()) {
60666
+ if (statement.get() instanceof _statement_1.Unknown) {
60667
+ return []; // contains parser errors
60668
+ }
60669
+ }
60625
60670
  for (const i of structure.findAllStructuresRecursive(Structures.If)) {
60626
60671
  issues = issues.concat(this.analyzeIf(file, i));
60627
60672
  }
@@ -60709,12 +60754,12 @@ class IdenticalDescriptions {
60709
60754
  key: "identical_descriptions",
60710
60755
  title: "Identical descriptions",
60711
60756
  shortDescription: `Searches for objects with the same type and same description`,
60712
- extendedInformation: `Case insensitive
60713
-
60714
- Only checks the master language descriptions
60715
-
60716
- Dependencies are skipped
60717
-
60757
+ extendedInformation: `Case insensitive
60758
+
60759
+ Only checks the master language descriptions
60760
+
60761
+ Dependencies are skipped
60762
+
60718
60763
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
60719
60764
  tags: [],
60720
60765
  };
@@ -60888,43 +60933,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
60888
60933
  key: "if_in_if",
60889
60934
  title: "IF in IF",
60890
60935
  shortDescription: `Detects nested ifs which can be refactored.`,
60891
- extendedInformation: `
60892
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
60893
-
60894
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60895
-
60896
- https://docs.abapopenchecks.org/checks/01/
60936
+ extendedInformation: `
60937
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
60938
+
60939
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60940
+
60941
+ https://docs.abapopenchecks.org/checks/01/
60897
60942
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
60898
- badExample: `IF condition1.
60899
- IF condition2.
60900
- ...
60901
- ENDIF.
60902
- ENDIF.
60903
-
60904
- IF condition1.
60905
- ...
60906
- ELSE.
60907
- IF condition2.
60908
- ...
60909
- ENDIF.
60943
+ badExample: `IF condition1.
60944
+ IF condition2.
60945
+ ...
60946
+ ENDIF.
60947
+ ENDIF.
60948
+
60949
+ IF condition1.
60950
+ ...
60951
+ ELSE.
60952
+ IF condition2.
60953
+ ...
60954
+ ENDIF.
60910
60955
  ENDIF.`,
60911
- goodExample: `IF ( condition1 ) AND ( condition2 ).
60912
- ...
60913
- ENDIF.
60914
-
60915
- IF condition1.
60916
- ...
60917
- ELSEIF condition2.
60918
- ...
60919
- ENDIF.
60920
-
60921
- CASE variable.
60922
- WHEN value1.
60923
- ...
60924
- WHEN value2.
60925
- IF condition2.
60926
- ...
60927
- ENDIF.
60956
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
60957
+ ...
60958
+ ENDIF.
60959
+
60960
+ IF condition1.
60961
+ ...
60962
+ ELSEIF condition2.
60963
+ ...
60964
+ ENDIF.
60965
+
60966
+ CASE variable.
60967
+ WHEN value1.
60968
+ ...
60969
+ WHEN value2.
60970
+ IF condition2.
60971
+ ...
60972
+ ENDIF.
60928
60973
  ENDCASE.`,
60929
60974
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60930
60975
  };
@@ -61109,9 +61154,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
61109
61154
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
61110
61155
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
61111
61156
  if (name === impl.identifier.getName().toUpperCase()) {
61112
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61113
- METHOD ${methodName.toLowerCase()}.
61114
- RETURN. " todo, implement method
61157
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61158
+ METHOD ${methodName.toLowerCase()}.
61159
+ RETURN. " todo, implement method
61115
61160
  ENDMETHOD.`);
61116
61161
  }
61117
61162
  }
@@ -61299,19 +61344,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
61299
61344
  key: "in_statement_indentation",
61300
61345
  title: "In-statement indentation",
61301
61346
  shortDescription: "Checks alignment within statements which span multiple lines.",
61302
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
61303
-
61304
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61347
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
61348
+
61349
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61305
61350
  to distinguish them better from code within the block.`,
61306
- badExample: `IF 1 = 1
61307
- AND 2 = 2.
61308
- WRITE 'hello' &&
61309
- 'world'.
61351
+ badExample: `IF 1 = 1
61352
+ AND 2 = 2.
61353
+ WRITE 'hello' &&
61354
+ 'world'.
61310
61355
  ENDIF.`,
61311
- goodExample: `IF 1 = 1
61312
- AND 2 = 2.
61313
- WRITE 'hello' &&
61314
- 'world'.
61356
+ goodExample: `IF 1 = 1
61357
+ AND 2 = 2.
61358
+ WRITE 'hello' &&
61359
+ 'world'.
61315
61360
  ENDIF.`,
61316
61361
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61317
61362
  };
@@ -61816,9 +61861,9 @@ class IntfReferencingClas {
61816
61861
  key: "intf_referencing_clas",
61817
61862
  title: "INTF referencing CLAS",
61818
61863
  shortDescription: `Interface contains references to class`,
61819
- extendedInformation: `Only global interfaces are checked.
61820
- Only first level references are checked.
61821
- Exception class references are ignored.
61864
+ extendedInformation: `Only global interfaces are checked.
61865
+ Only first level references are checked.
61866
+ Exception class references are ignored.
61822
61867
  Void references are ignored.`,
61823
61868
  };
61824
61869
  }
@@ -62413,8 +62458,8 @@ class LineBreakStyle {
62413
62458
  return {
62414
62459
  key: "line_break_style",
62415
62460
  title: "Makes sure line breaks are consistent in the ABAP code",
62416
- shortDescription: `Enforces LF as newlines in ABAP files
62417
-
62461
+ shortDescription: `Enforces LF as newlines in ABAP files
62462
+
62418
62463
  abapGit does not work with CRLF`,
62419
62464
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
62420
62465
  };
@@ -62483,7 +62528,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
62483
62528
  key: "line_length",
62484
62529
  title: "Line length",
62485
62530
  shortDescription: `Detects lines exceeding the provided maximum length.`,
62486
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62531
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62487
62532
  https://docs.abapopenchecks.org/checks/04/`,
62488
62533
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
62489
62534
  };
@@ -62554,7 +62599,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
62554
62599
  key: "line_only_punc",
62555
62600
  title: "Line containing only punctuation",
62556
62601
  shortDescription: `Detects lines containing only punctuation.`,
62557
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62602
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62558
62603
  https://docs.abapopenchecks.org/checks/16/`,
62559
62604
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62560
62605
  badExample: "zcl_class=>method(\n).",
@@ -62814,8 +62859,8 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
62814
62859
  return {
62815
62860
  key: "local_variable_names",
62816
62861
  title: "Local variable naming conventions",
62817
- shortDescription: `
62818
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62862
+ shortDescription: `
62863
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62819
62864
  Regexes are case-insensitive.`,
62820
62865
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
62821
62866
  };
@@ -62962,10 +63007,10 @@ class MainFileContents {
62962
63007
  key: "main_file_contents",
62963
63008
  title: "Main file contents",
62964
63009
  shortDescription: `Checks related to report declarations.`,
62965
- extendedInformation: `Does not run if the target version is Cloud
62966
-
62967
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62968
- * TYPEs must begin with "TYPE-POOL <name>."
63010
+ extendedInformation: `Does not run if the target version is Cloud
63011
+
63012
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
63013
+ * TYPEs must begin with "TYPE-POOL <name>."
62969
63014
  `,
62970
63015
  };
62971
63016
  }
@@ -63081,17 +63126,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
63081
63126
  title: "Too many parentheses",
63082
63127
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
63083
63128
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63084
- badExample: `
63085
- IF ( destination IS INITIAL ).
63086
- ENDIF.
63087
- IF foo = boo AND ( bar = lar AND moo = loo ).
63088
- ENDIF.
63129
+ badExample: `
63130
+ IF ( destination IS INITIAL ).
63131
+ ENDIF.
63132
+ IF foo = boo AND ( bar = lar AND moo = loo ).
63133
+ ENDIF.
63089
63134
  `,
63090
- goodExample: `
63091
- IF destination IS INITIAL.
63092
- ENDIF.
63093
- IF foo = boo AND bar = lar AND moo = loo.
63094
- ENDIF.
63135
+ goodExample: `
63136
+ IF destination IS INITIAL.
63137
+ ENDIF.
63138
+ IF foo = boo AND bar = lar AND moo = loo.
63139
+ ENDIF.
63095
63140
  `,
63096
63141
  };
63097
63142
  }
@@ -63265,14 +63310,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
63265
63310
  title: "Max one method parameter definition per line",
63266
63311
  shortDescription: `Keep max one method parameter description per line`,
63267
63312
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
63268
- badExample: `
63269
- METHODS apps_scope_token
63270
- IMPORTING
63313
+ badExample: `
63314
+ METHODS apps_scope_token
63315
+ IMPORTING
63271
63316
  body TYPE bodyapps_scope_token client_id TYPE str.`,
63272
- goodExample: `
63273
- METHODS apps_scope_token
63274
- IMPORTING
63275
- body TYPE bodyapps_scope_token
63317
+ goodExample: `
63318
+ METHODS apps_scope_token
63319
+ IMPORTING
63320
+ body TYPE bodyapps_scope_token
63276
63321
  client_id TYPE str.`,
63277
63322
  };
63278
63323
  }
@@ -63337,11 +63382,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
63337
63382
  key: "max_one_statement",
63338
63383
  title: "Max one statement per line",
63339
63384
  shortDescription: `Checks that each line contains only a single statement.`,
63340
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63341
-
63342
- Does not report anything for chained statements.
63343
-
63344
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63385
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63386
+
63387
+ Does not report anything for chained statements.
63388
+
63389
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63345
63390
  https://docs.abapopenchecks.org/checks/11/`,
63346
63391
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63347
63392
  badExample: `WRITE foo. WRITE bar.`,
@@ -63679,8 +63724,8 @@ class MethodLength {
63679
63724
  key: "method_length",
63680
63725
  title: "Method/Form Length",
63681
63726
  shortDescription: `Checks relating to method/form length.`,
63682
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63683
-
63727
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63728
+
63684
63729
  Abstract methods without statements are considered okay.`,
63685
63730
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63686
63731
  };
@@ -63785,10 +63830,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
63785
63830
  key: "method_overwrites_builtin",
63786
63831
  title: "Method name overwrites builtin function",
63787
63832
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
63788
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63789
-
63790
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63791
-
63833
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63834
+
63835
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63836
+
63792
63837
  Interface method names are ignored`,
63793
63838
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
63794
63839
  };
@@ -64358,7 +64403,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
64358
64403
  key: "nesting",
64359
64404
  title: "Check nesting depth",
64360
64405
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
64361
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64406
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64362
64407
  https://docs.abapopenchecks.org/checks/74/`,
64363
64408
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64364
64409
  };
@@ -64601,7 +64646,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
64601
64646
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
64602
64647
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64603
64648
  badExample: `var1 = var2 = var3.`,
64604
- goodExample: `var2 = var3.
64649
+ goodExample: `var2 = var3.
64605
64650
  var1 = var2.`,
64606
64651
  };
64607
64652
  }
@@ -64660,8 +64705,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
64660
64705
  key: "no_external_form_calls",
64661
64706
  title: "No external FORM calls",
64662
64707
  shortDescription: `Detect external form calls`,
64663
- badExample: `PERFORM foo IN PROGRAM bar.
64664
-
64708
+ badExample: `PERFORM foo IN PROGRAM bar.
64709
+
64665
64710
  PERFORM foo(bar).`,
64666
64711
  tags: [_irule_1.RuleTag.SingleFile],
64667
64712
  };
@@ -64722,17 +64767,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
64722
64767
  key: "no_inline_in_optional_branches",
64723
64768
  title: "Don't declare inline in optional branches",
64724
64769
  shortDescription: `Don't declare inline in optional branches`,
64725
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64726
-
64727
- Considered optional branches:
64728
- * inside IF/ELSEIF/ELSE
64729
- * inside LOOP
64730
- * inside WHILE
64731
- * inside CASE/WHEN, CASE TYPE OF
64732
- * inside DO
64733
- * inside SELECT loops
64734
-
64735
- Not considered optional branches:
64770
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64771
+
64772
+ Considered optional branches:
64773
+ * inside IF/ELSEIF/ELSE
64774
+ * inside LOOP
64775
+ * inside WHILE
64776
+ * inside CASE/WHEN, CASE TYPE OF
64777
+ * inside DO
64778
+ * inside SELECT loops
64779
+
64780
+ Not considered optional branches:
64736
64781
  * TRY/CATCH/CLEANUP`,
64737
64782
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64738
64783
  };
@@ -64831,12 +64876,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
64831
64876
  key: "no_prefixes",
64832
64877
  title: "No Prefixes",
64833
64878
  shortDescription: `Dont use hungarian notation`,
64834
- extendedInformation: `
64835
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64836
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
64837
-
64838
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64839
-
64879
+ extendedInformation: `
64880
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64881
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
64882
+
64883
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64884
+
64840
64885
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
64841
64886
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64842
64887
  badExample: `DATA lv_foo TYPE i.`,
@@ -65009,7 +65054,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
65009
65054
  return {
65010
65055
  key: "no_public_attributes",
65011
65056
  title: "No public attributes",
65012
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
65057
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
65013
65058
  Exceptions are excluded from this rule.`,
65014
65059
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
65015
65060
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -65110,13 +65155,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
65110
65155
  key: "no_yoda_conditions",
65111
65156
  title: "No Yoda conditions",
65112
65157
  shortDescription: `Finds Yoda conditions and reports issues`,
65113
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65114
-
65158
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65159
+
65115
65160
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
65116
65161
  tags: [_irule_1.RuleTag.SingleFile],
65117
- badExample: `IF 0 <> sy-subrc.
65162
+ badExample: `IF 0 <> sy-subrc.
65118
65163
  ENDIF.`,
65119
- goodExample: `IF sy-subrc <> 0.
65164
+ goodExample: `IF sy-subrc <> 0.
65120
65165
  ENDIF.`,
65121
65166
  };
65122
65167
  }
@@ -65217,8 +65262,8 @@ class NROBConsistency {
65217
65262
  key: "nrob_consistency",
65218
65263
  title: "Number range consistency",
65219
65264
  shortDescription: `Consistency checks for number ranges`,
65220
- extendedInformation: `Issue reported if percentage warning is over 50%
65221
-
65265
+ extendedInformation: `Issue reported if percentage warning is over 50%
65266
+
65222
65267
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
65223
65268
  tags: [_irule_1.RuleTag.SingleFile],
65224
65269
  };
@@ -65495,58 +65540,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
65495
65540
  title: "Obsolete statements",
65496
65541
  shortDescription: `Checks for usages of certain obsolete statements`,
65497
65542
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65498
- extendedInformation: `
65499
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65500
-
65501
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65502
-
65503
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65504
-
65505
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65506
-
65507
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65508
-
65509
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65510
-
65511
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65512
-
65513
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65514
-
65515
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65516
-
65517
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65518
-
65519
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65520
-
65521
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65522
-
65523
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65524
-
65525
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65526
-
65527
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65528
- SELECT COUNT(*) is considered okay
65529
-
65530
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65531
-
65532
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65533
-
65534
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65535
-
65536
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65537
-
65538
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
65539
-
65543
+ extendedInformation: `
65544
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65545
+
65546
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65547
+
65548
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65549
+
65550
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65551
+
65552
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65553
+
65554
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65555
+
65556
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65557
+
65558
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65559
+
65560
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65561
+
65562
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65563
+
65564
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65565
+
65566
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65567
+
65568
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65569
+
65570
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65571
+
65572
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65573
+ SELECT COUNT(*) is considered okay
65574
+
65575
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65576
+
65577
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65578
+
65579
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65580
+
65581
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65582
+
65583
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
65584
+
65540
65585
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
65541
- badExample: `REFRESH itab.
65542
-
65543
- COMPUTE foo = 2 + 2.
65544
-
65545
- MULTIPLY lv_foo BY 2.
65546
-
65547
- INTERFACE intf LOAD.
65548
-
65549
- IF foo IS SUPPLIED.
65586
+ badExample: `REFRESH itab.
65587
+
65588
+ COMPUTE foo = 2 + 2.
65589
+
65590
+ MULTIPLY lv_foo BY 2.
65591
+
65592
+ INTERFACE intf LOAD.
65593
+
65594
+ IF foo IS SUPPLIED.
65550
65595
  ENDIF.`,
65551
65596
  };
65552
65597
  }
@@ -65886,9 +65931,9 @@ class OmitParameterName {
65886
65931
  key: "omit_parameter_name",
65887
65932
  title: "Omit parameter name",
65888
65933
  shortDescription: `Omit the parameter name in single parameter calls`,
65889
- extendedInformation: `
65890
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65891
-
65934
+ extendedInformation: `
65935
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65936
+
65892
65937
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
65893
65938
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65894
65939
  badExample: `method( param = 2 ).`,
@@ -66094,20 +66139,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
66094
66139
  shortDescription: `Omit RECEIVING`,
66095
66140
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
66096
66141
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66097
- badExample: `
66098
- upload_pack(
66099
- EXPORTING
66100
- io_client = lo_client
66101
- iv_url = iv_url
66102
- iv_deepen_level = iv_deepen_level
66103
- it_hashes = lt_hashes
66104
- RECEIVING
66142
+ badExample: `
66143
+ upload_pack(
66144
+ EXPORTING
66145
+ io_client = lo_client
66146
+ iv_url = iv_url
66147
+ iv_deepen_level = iv_deepen_level
66148
+ it_hashes = lt_hashes
66149
+ RECEIVING
66105
66150
  rt_objects = et_objects ).`,
66106
- goodExample: `
66107
- et_objects = upload_pack(
66108
- io_client = lo_client
66109
- iv_url = iv_url
66110
- iv_deepen_level = iv_deepen_level
66151
+ goodExample: `
66152
+ et_objects = upload_pack(
66153
+ io_client = lo_client
66154
+ iv_url = iv_url
66155
+ iv_deepen_level = iv_deepen_level
66111
66156
  it_hashes = lt_hashes ).`,
66112
66157
  };
66113
66158
  }
@@ -66171,8 +66216,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
66171
66216
  return {
66172
66217
  key: "parser_702_chaining",
66173
66218
  title: "Parser Error, bad chanining on 702",
66174
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66175
- this rule finds these and reports errors.
66219
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66220
+ this rule finds these and reports errors.
66176
66221
  Only active on target version 702 and below.`,
66177
66222
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66178
66223
  };
@@ -66252,8 +66297,8 @@ class ParserError {
66252
66297
  return {
66253
66298
  key: "parser_error",
66254
66299
  title: "Parser error",
66255
- shortDescription: `Checks for syntax not recognized by abaplint.
66256
-
66300
+ shortDescription: `Checks for syntax not recognized by abaplint.
66301
+
66257
66302
  See recognized syntax at https://syntax.abaplint.org`,
66258
66303
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66259
66304
  };
@@ -66338,7 +66383,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
66338
66383
  return {
66339
66384
  key: "parser_missing_space",
66340
66385
  title: "Parser Error, missing space",
66341
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66386
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66342
66387
  This rule makes sure the spaces are consistently required across the language.`,
66343
66388
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
66344
66389
  badExample: `IF ( foo = 'bar').`,
@@ -66750,25 +66795,25 @@ class PreferInline {
66750
66795
  key: "prefer_inline",
66751
66796
  title: "Prefer Inline Declarations",
66752
66797
  shortDescription: `Prefer inline to up-front declarations.`,
66753
- extendedInformation: `EXPERIMENTAL
66754
-
66755
- Activates if language version is v740sp02 or above.
66756
-
66757
- Variables must be local(METHOD or FORM).
66758
-
66759
- No generic or void typed variables. No syntax errors.
66760
-
66761
- First position used must be a full/pure write.
66762
-
66763
- Move statment is not a cast(?=)
66764
-
66798
+ extendedInformation: `EXPERIMENTAL
66799
+
66800
+ Activates if language version is v740sp02 or above.
66801
+
66802
+ Variables must be local(METHOD or FORM).
66803
+
66804
+ No generic or void typed variables. No syntax errors.
66805
+
66806
+ First position used must be a full/pure write.
66807
+
66808
+ Move statment is not a cast(?=)
66809
+
66765
66810
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
66766
66811
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
66767
- badExample: `DATA foo TYPE i.
66768
- foo = 2.
66769
- DATA percentage TYPE decfloat34.
66812
+ badExample: `DATA foo TYPE i.
66813
+ foo = 2.
66814
+ DATA percentage TYPE decfloat34.
66770
66815
  percentage = ( comment_number / abs_statement_number ) * 100.`,
66771
- goodExample: `DATA(foo) = 2.
66816
+ goodExample: `DATA(foo) = 2.
66772
66817
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
66773
66818
  };
66774
66819
  }
@@ -66982,18 +67027,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
66982
67027
  key: "prefer_is_not",
66983
67028
  title: "Prefer IS NOT to NOT IS",
66984
67029
  shortDescription: `Prefer IS NOT to NOT IS`,
66985
- extendedInformation: `
66986
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66987
-
67030
+ extendedInformation: `
67031
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
67032
+
66988
67033
  "if not is_valid( )." examples are skipped`,
66989
67034
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66990
- goodExample: `IF variable IS NOT INITIAL.
66991
- IF variable NP 'TODO*'.
66992
- IF variable <> 42.
67035
+ goodExample: `IF variable IS NOT INITIAL.
67036
+ IF variable NP 'TODO*'.
67037
+ IF variable <> 42.
66993
67038
  IF variable CO 'hello'.`,
66994
- badExample: `IF NOT variable IS INITIAL.
66995
- IF NOT variable CP 'TODO*'.
66996
- IF NOT variable = 42.
67039
+ badExample: `IF NOT variable IS INITIAL.
67040
+ IF NOT variable CP 'TODO*'.
67041
+ IF NOT variable = 42.
66997
67042
  IF NOT variable CA 'hello'.`,
66998
67043
  };
66999
67044
  }
@@ -67181,14 +67226,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
67181
67226
  key: "prefer_raise_exception_new",
67182
67227
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
67183
67228
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
67184
- extendedInformation: `
67185
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67186
-
67229
+ extendedInformation: `
67230
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67231
+
67187
67232
  From 752 and up`,
67188
67233
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
67189
67234
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
67190
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
67191
- EXPORTING
67235
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
67236
+ EXPORTING
67192
67237
  previous = exception.`,
67193
67238
  };
67194
67239
  }
@@ -67266,7 +67311,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
67266
67311
  key: "prefer_returning_to_exporting",
67267
67312
  title: "Prefer RETURNING to EXPORTING",
67268
67313
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
67269
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67314
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67270
67315
  https://docs.abapopenchecks.org/checks/44/`,
67271
67316
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67272
67317
  };
@@ -67363,8 +67408,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
67363
67408
  key: "prefer_xsdbool",
67364
67409
  title: "Prefer xsdbool over boolc",
67365
67410
  shortDescription: `Prefer xsdbool over boolc`,
67366
- extendedInformation: `Activates if language version is v740sp08 or above.
67367
-
67411
+ extendedInformation: `Activates if language version is v740sp08 or above.
67412
+
67368
67413
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
67369
67414
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
67370
67415
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -67658,26 +67703,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
67658
67703
  key: "reduce_procedural_code",
67659
67704
  title: "Reduce procedural code",
67660
67705
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
67661
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67662
-
67663
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67664
-
67706
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67707
+
67708
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67709
+
67665
67710
  Comments are not counted as statements.`,
67666
67711
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67667
- badExample: `FORM foo.
67668
- DATA lv_bar TYPE i.
67669
- lv_bar = 2 + 2.
67670
- IF lv_bar = 4.
67671
- WRITE 'hello world'.
67672
- ENDIF.
67673
- DATA lv_bar TYPE i.
67674
- lv_bar = 2 + 2.
67675
- IF lv_bar = 4.
67676
- WRITE 'hello world'.
67677
- ENDIF.
67712
+ badExample: `FORM foo.
67713
+ DATA lv_bar TYPE i.
67714
+ lv_bar = 2 + 2.
67715
+ IF lv_bar = 4.
67716
+ WRITE 'hello world'.
67717
+ ENDIF.
67718
+ DATA lv_bar TYPE i.
67719
+ lv_bar = 2 + 2.
67720
+ IF lv_bar = 4.
67721
+ WRITE 'hello world'.
67722
+ ENDIF.
67678
67723
  ENDFORM.`,
67679
- goodExample: `FORM foo.
67680
- NEW zcl_global_class( )->run_logic( ).
67724
+ goodExample: `FORM foo.
67725
+ NEW zcl_global_class( )->run_logic( ).
67681
67726
  ENDFORM.`,
67682
67727
  };
67683
67728
  }
@@ -67921,10 +67966,10 @@ class RemoveDescriptions {
67921
67966
  return {
67922
67967
  key: "remove_descriptions",
67923
67968
  title: "Remove descriptions",
67924
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67925
-
67926
- Class descriptions are required, see rule description_empty.
67927
-
67969
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67970
+
67971
+ Class descriptions are required, see rule description_empty.
67972
+
67928
67973
  Consider using ABAP Doc for documentation.`,
67929
67974
  tags: [],
67930
67975
  };
@@ -68049,16 +68094,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
68049
68094
  tags: [_irule_1.RuleTag.SingleFile],
68050
68095
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
68051
68096
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
68052
- badExample: `
68053
- CALL FUNCTION 'ZRFC'
68097
+ badExample: `
68098
+ CALL FUNCTION 'ZRFC'
68054
68099
  DESTINATION lv_rfc.`,
68055
- goodExample: `
68056
- CALL FUNCTION 'ZRFC'
68057
- DESTINATION lv_rfc
68058
- EXCEPTIONS
68059
- system_failure = 1 MESSAGE msg
68060
- communication_failure = 2 MESSAGE msg
68061
- resource_failure = 3
68100
+ goodExample: `
68101
+ CALL FUNCTION 'ZRFC'
68102
+ DESTINATION lv_rfc
68103
+ EXCEPTIONS
68104
+ system_failure = 1 MESSAGE msg
68105
+ communication_failure = 2 MESSAGE msg
68106
+ resource_failure = 3
68062
68107
  OTHERS = 4.`,
68063
68108
  };
68064
68109
  }
@@ -68142,11 +68187,11 @@ class SelectAddOrderBy {
68142
68187
  key: "select_add_order_by",
68143
68188
  title: "SELECT add ORDER BY",
68144
68189
  shortDescription: `SELECTs add ORDER BY clause`,
68145
- extendedInformation: `
68146
- This will make sure that the SELECT statement returns results in the same sequence on different databases
68147
-
68148
- add ORDER BY PRIMARY KEY if in doubt
68149
-
68190
+ extendedInformation: `
68191
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
68192
+
68193
+ add ORDER BY PRIMARY KEY if in doubt
68194
+
68150
68195
  If the target is a sorted/hashed table, no issue is reported`,
68151
68196
  tags: [_irule_1.RuleTag.SingleFile],
68152
68197
  };
@@ -68275,14 +68320,14 @@ class SelectPerformance {
68275
68320
  key: "select_performance",
68276
68321
  title: "SELECT performance",
68277
68322
  shortDescription: `Various checks regarding SELECT performance.`,
68278
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68279
-
68323
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68324
+
68280
68325
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
68281
68326
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
68282
- badExample: `SELECT field1, field2 FROM table
68283
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68327
+ badExample: `SELECT field1, field2 FROM table
68328
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68284
68329
  ENDSELECT.`,
68285
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68330
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68286
68331
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
68287
68332
  };
68288
68333
  }
@@ -68394,8 +68439,8 @@ class SelectSingleFullKey {
68394
68439
  key: "select_single_full_key",
68395
68440
  title: "Detect SELECT SINGLE which are possibily not unique",
68396
68441
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
68397
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68398
-
68442
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68443
+
68399
68444
  If the statement contains a JOIN it is not checked`,
68400
68445
  pseudoComment: "EC CI_NOORDER",
68401
68446
  tags: [],
@@ -68812,8 +68857,8 @@ class SICFConsistency {
68812
68857
  key: "sicf_consistency",
68813
68858
  title: "SICF consistency",
68814
68859
  shortDescription: `Checks the validity of ICF services`,
68815
- extendedInformation: `* Class defined in handler must exist
68816
- * Class must not have any syntax errors
68860
+ extendedInformation: `* Class defined in handler must exist
68861
+ * Class must not have any syntax errors
68817
68862
  * Class must implement interface IF_HTTP_EXTENSION`,
68818
68863
  };
68819
68864
  }
@@ -69180,8 +69225,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
69180
69225
  key: "space_before_dot",
69181
69226
  title: "Space before dot",
69182
69227
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
69183
- extendedInformation: `
69184
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69228
+ extendedInformation: `
69229
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69185
69230
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
69186
69231
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69187
69232
  badExample: `WRITE bar .`,
@@ -69367,12 +69412,12 @@ class SQLValueConversion {
69367
69412
  key: "sql_value_conversion",
69368
69413
  title: "Implicit SQL Value Conversion",
69369
69414
  shortDescription: `Ensure types match when selecting from database`,
69370
- extendedInformation: `
69371
- * Integer to CHAR conversion
69372
- * Integer to NUMC conversion
69373
- * NUMC to Integer conversion
69374
- * CHAR to Integer conversion
69375
- * Source field longer than database field, CHAR -> CHAR
69415
+ extendedInformation: `
69416
+ * Integer to CHAR conversion
69417
+ * Integer to NUMC conversion
69418
+ * NUMC to Integer conversion
69419
+ * CHAR to Integer conversion
69420
+ * Source field longer than database field, CHAR -> CHAR
69376
69421
  * Source field longer than database field, NUMC -> NUMC`,
69377
69422
  tags: [],
69378
69423
  };
@@ -69444,7 +69489,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
69444
69489
  key: "start_at_tab",
69445
69490
  title: "Start at tab",
69446
69491
  shortDescription: `Checks that statements start at tabstops.`,
69447
- extendedInformation: `Reports max 100 issues per file
69492
+ extendedInformation: `Reports max 100 issues per file
69448
69493
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
69449
69494
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69450
69495
  badExample: ` WRITE a.`,
@@ -69621,12 +69666,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
69621
69666
  key: "strict_sql",
69622
69667
  title: "Strict SQL",
69623
69668
  shortDescription: `Strict SQL`,
69624
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69625
-
69626
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69627
-
69628
- Also see separate rule sql_escape_host_variables
69629
-
69669
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69670
+
69671
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69672
+
69673
+ Also see separate rule sql_escape_host_variables
69674
+
69630
69675
  Activates from v750 and up`,
69631
69676
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
69632
69677
  };
@@ -69878,11 +69923,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
69878
69923
  key: "sy_modification",
69879
69924
  title: "Modification of SY fields",
69880
69925
  shortDescription: `Finds modification of sy fields`,
69881
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69882
-
69926
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69927
+
69883
69928
  Changes to SY-TVAR* fields are not reported`,
69884
69929
  tags: [_irule_1.RuleTag.SingleFile],
69885
- badExample: `sy-uname = 2.
69930
+ badExample: `sy-uname = 2.
69886
69931
  sy = sy.`,
69887
69932
  };
69888
69933
  }
@@ -69944,8 +69989,8 @@ class TABLEnhancementCategory {
69944
69989
  key: "tabl_enhancement_category",
69945
69990
  title: "TABL enhancement category must be set",
69946
69991
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
69947
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69948
-
69992
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69993
+
69949
69994
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
69950
69995
  tags: [],
69951
69996
  };
@@ -70073,9 +70118,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
70073
70118
  title: "Type FORM parameters",
70074
70119
  shortDescription: `Checks for untyped FORM parameters`,
70075
70120
  tags: [_irule_1.RuleTag.SingleFile],
70076
- badExample: `FORM foo USING bar.
70121
+ badExample: `FORM foo USING bar.
70077
70122
  ENDFORM.`,
70078
- goodExample: `FORM foo USING bar TYPE string.
70123
+ goodExample: `FORM foo USING bar TYPE string.
70079
70124
  ENDFORM.`,
70080
70125
  };
70081
70126
  }
@@ -70685,7 +70730,7 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
70685
70730
  j = 1;
70686
70731
  let prevStatement = statements[i - j];
70687
70732
  while ((prevStatement === null || prevStatement === void 0 ? void 0 : prevStatement.get()) instanceof _statement_1.Comment) {
70688
- j--;
70733
+ j++;
70689
70734
  prevStatement = statements[i - j];
70690
70735
  }
70691
70736
  const next = nextStatement === null || nextStatement === void 0 ? void 0 : nextStatement.getColon();
@@ -70745,38 +70790,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
70745
70790
  key: "unnecessary_pragma",
70746
70791
  title: "Unnecessary Pragma",
70747
70792
  shortDescription: `Finds pragmas which can be removed`,
70748
- extendedInformation: `* NO_HANDLER with handler
70749
-
70750
- * NEEDED without definition
70751
-
70752
- * NO_TEXT without texts
70753
-
70754
- * SUBRC_OK where sy-subrc is checked
70755
-
70793
+ extendedInformation: `* NO_HANDLER with handler
70794
+
70795
+ * NEEDED without definition
70796
+
70797
+ * NO_TEXT without texts
70798
+
70799
+ * SUBRC_OK where sy-subrc is checked
70800
+
70756
70801
  NO_HANDLER inside macros are not checked`,
70757
70802
  tags: [_irule_1.RuleTag.SingleFile],
70758
- badExample: `TRY.
70759
- ...
70760
- CATCH zcx_abapgit_exception ##NO_HANDLER.
70761
- RETURN. " it has a handler
70762
- ENDTRY.
70763
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70764
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70765
- IF sy-subrc <> 0.
70803
+ badExample: `TRY.
70804
+ ...
70805
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
70806
+ RETURN. " it has a handler
70807
+ ENDTRY.
70808
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70809
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70810
+ IF sy-subrc <> 0.
70766
70811
  ENDIF.`,
70767
- goodExample: `TRY.
70768
- ...
70769
- CATCH zcx_abapgit_exception.
70770
- RETURN.
70771
- ENDTRY.
70772
- MESSAGE w125(zbar) WITH c_foo INTO message.
70773
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70774
- IF sy-subrc <> 0.
70775
- ENDIF.
70776
-
70777
- DATA: BEGIN OF blah ##NEEDED,
70778
- test1 TYPE string,
70779
- test2 TYPE string,
70812
+ goodExample: `TRY.
70813
+ ...
70814
+ CATCH zcx_abapgit_exception.
70815
+ RETURN.
70816
+ ENDTRY.
70817
+ MESSAGE w125(zbar) WITH c_foo INTO message.
70818
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70819
+ IF sy-subrc <> 0.
70820
+ ENDIF.
70821
+
70822
+ DATA: BEGIN OF blah ##NEEDED,
70823
+ test1 TYPE string,
70824
+ test2 TYPE string,
70780
70825
  END OF blah.`,
70781
70826
  };
70782
70827
  }
@@ -70934,18 +70979,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
70934
70979
  shortDescription: `Finds unnecessary RETURN statements`,
70935
70980
  extendedInformation: `Finds unnecessary RETURN statements`,
70936
70981
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70937
- badExample: `FORM hello1.
70938
- WRITE 'world'.
70939
- RETURN.
70940
- ENDFORM.
70941
-
70942
- FORM foo.
70943
- IF 1 = 2.
70944
- RETURN.
70945
- ENDIF.
70982
+ badExample: `FORM hello1.
70983
+ WRITE 'world'.
70984
+ RETURN.
70985
+ ENDFORM.
70986
+
70987
+ FORM foo.
70988
+ IF 1 = 2.
70989
+ RETURN.
70990
+ ENDIF.
70946
70991
  ENDFORM.`,
70947
- goodExample: `FORM hello2.
70948
- WRITE 'world'.
70992
+ goodExample: `FORM hello2.
70993
+ WRITE 'world'.
70949
70994
  ENDFORM.`,
70950
70995
  };
70951
70996
  }
@@ -71312,17 +71357,17 @@ class UnusedMethods {
71312
71357
  key: "unused_methods",
71313
71358
  title: "Unused methods",
71314
71359
  shortDescription: `Checks for unused methods`,
71315
- extendedInformation: `Checks private and protected methods.
71316
-
71317
- Unused methods are not reported if the object contains parser or syntax errors.
71318
-
71319
- Skips:
71320
- * methods FOR TESTING
71321
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71322
- * class_constructor + constructor methods
71323
- * event handlers
71324
- * methods that are redefined
71325
- * INCLUDEs
71360
+ extendedInformation: `Checks private and protected methods.
71361
+
71362
+ Unused methods are not reported if the object contains parser or syntax errors.
71363
+
71364
+ Skips:
71365
+ * methods FOR TESTING
71366
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71367
+ * class_constructor + constructor methods
71368
+ * event handlers
71369
+ * methods that are redefined
71370
+ * INCLUDEs
71326
71371
  `,
71327
71372
  tags: [],
71328
71373
  pragma: "##CALLED",
@@ -71712,23 +71757,23 @@ class UnusedVariables {
71712
71757
  key: "unused_variables",
71713
71758
  title: "Unused variables",
71714
71759
  shortDescription: `Checks for unused variables and constants`,
71715
- extendedInformation: `Skips event parameters.
71716
-
71717
- Note that this currently does not work if the source code uses macros.
71718
-
71719
- Unused variables are not reported if the object contains parser or syntax errors.
71720
-
71760
+ extendedInformation: `Skips event parameters.
71761
+
71762
+ Note that this currently does not work if the source code uses macros.
71763
+
71764
+ Unused variables are not reported if the object contains parser or syntax errors.
71765
+
71721
71766
  Errors found in INCLUDES are reported for the main program.`,
71722
71767
  tags: [_irule_1.RuleTag.Quickfix],
71723
71768
  pragma: "##NEEDED",
71724
71769
  pseudoComment: "EC NEEDED",
71725
- badExample: `DATA: BEGIN OF blah1,
71726
- test TYPE string,
71727
- test2 TYPE string,
71770
+ badExample: `DATA: BEGIN OF blah1,
71771
+ test TYPE string,
71772
+ test2 TYPE string,
71728
71773
  END OF blah1.`,
71729
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71730
- test TYPE string,
71731
- test2 TYPE string,
71774
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71775
+ test TYPE string,
71776
+ test2 TYPE string,
71732
71777
  END OF blah2.`,
71733
71778
  };
71734
71779
  }
@@ -71947,15 +71992,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
71947
71992
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
71948
71993
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
71949
71994
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
71950
- badExample: `IF line IS INITIAL.
71951
- has_entries = abap_false.
71952
- ELSE.
71953
- has_entries = abap_true.
71954
- ENDIF.
71955
-
71995
+ badExample: `IF line IS INITIAL.
71996
+ has_entries = abap_false.
71997
+ ELSE.
71998
+ has_entries = abap_true.
71999
+ ENDIF.
72000
+
71956
72001
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
71957
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71958
-
72002
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
72003
+
71959
72004
  DATA(fsdf) = xsdbool( foo <> bar ).`,
71960
72005
  };
71961
72006
  }
@@ -72131,15 +72176,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
72131
72176
  key: "use_line_exists",
72132
72177
  title: "Use line_exists",
72133
72178
  shortDescription: `Use line_exists, from 740sp02 and up`,
72134
- extendedInformation: `
72135
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72136
-
72179
+ extendedInformation: `
72180
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72181
+
72137
72182
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
72138
72183
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72139
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72140
- IF sy-subrc = 0.
72184
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72185
+ IF sy-subrc = 0.
72141
72186
  ENDIF.`,
72142
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72187
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72143
72188
  ENDIF.`,
72144
72189
  };
72145
72190
  }
@@ -72249,10 +72294,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
72249
72294
  key: "use_new",
72250
72295
  title: "Use NEW",
72251
72296
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
72252
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72253
-
72254
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72255
-
72297
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72298
+
72299
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72300
+
72256
72301
  Applicable from v740sp02 and up`,
72257
72302
  badExample: `CREATE OBJECT ref.`,
72258
72303
  goodExample: `ref = NEW #( ).`,
@@ -72350,13 +72395,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
72350
72395
  title: "WHEN OTHERS last",
72351
72396
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
72352
72397
  tags: [_irule_1.RuleTag.SingleFile],
72353
- badExample: `CASE bar.
72354
- WHEN OTHERS.
72355
- WHEN 2.
72398
+ badExample: `CASE bar.
72399
+ WHEN OTHERS.
72400
+ WHEN 2.
72356
72401
  ENDCASE.`,
72357
- goodExample: `CASE bar.
72358
- WHEN 2.
72359
- WHEN OTHERS.
72402
+ goodExample: `CASE bar.
72403
+ WHEN 2.
72404
+ WHEN OTHERS.
72360
72405
  ENDCASE.`,
72361
72406
  };
72362
72407
  }