@abaplint/cli 2.113.8 → 2.113.10

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 +897 -848
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -32045,6 +32045,7 @@ const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifie
32045
32045
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
32046
32046
  const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
32047
32047
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32048
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
32048
32049
  class Parameter {
32049
32050
  runSyntax(node, input) {
32050
32051
  var _a;
@@ -32054,19 +32055,24 @@ class Parameter {
32054
32055
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32055
32056
  return;
32056
32057
  }
32058
+ else if (nameToken === undefined) {
32059
+ return;
32060
+ }
32057
32061
  if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
32058
32062
  const message = "RADIOBUTTON and LENGTH not possible together";
32059
32063
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32060
32064
  return;
32061
32065
  }
32062
32066
  const bfound = new basic_types_1.BasicTypes(input).parseType(node);
32063
- if (nameToken && bfound) {
32067
+ if (bfound) {
32064
32068
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound));
32065
- return;
32066
32069
  }
32067
- if (nameToken) {
32070
+ else {
32068
32071
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.UnknownType("Parameter, fallback")));
32069
32072
  }
32073
+ const magicName = "%_" + nameToken.getStr() + "_%_app_%";
32074
+ const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
32075
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, new basic_1.VoidType("PARAMETER magic")));
32070
32076
  }
32071
32077
  }
32072
32078
  exports.Parameter = Parameter;
@@ -32727,12 +32733,18 @@ exports.SelectionScreen = void 0;
32727
32733
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
32728
32734
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
32729
32735
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
32736
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32730
32737
  class SelectionScreen {
32731
32738
  runSyntax(node, input) {
32732
32739
  const field = node.findFirstExpression(Expressions.InlineField);
32733
32740
  if (field === undefined) {
32734
32741
  return;
32735
32742
  }
32743
+ if (field.getFirstToken().getStr().length > 8) {
32744
+ const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
32745
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
32746
+ return;
32747
+ }
32736
32748
  const name = field.getFirstToken();
32737
32749
  const concat = node.concatTokens().toUpperCase();
32738
32750
  if (concat.includes("BEGIN OF TABBED BLOCK")) {
@@ -32772,6 +32784,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
32772
32784
  const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
32773
32785
  const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
32774
32786
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32787
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
32775
32788
  class SelectOption {
32776
32789
  runSyntax(node, input) {
32777
32790
  var _a;
@@ -32781,12 +32794,15 @@ class SelectOption {
32781
32794
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
32782
32795
  return;
32783
32796
  }
32797
+ else if (nameToken === undefined) {
32798
+ return;
32799
+ }
32784
32800
  for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
32785
32801
  new dynamic_1.Dynamic().runSyntax(d, input);
32786
32802
  }
32787
32803
  const nameExpression = node.findFirstExpression(Expressions.FieldChain);
32788
32804
  let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameExpression);
32789
- if (found && nameToken) {
32805
+ if (found) {
32790
32806
  if (found instanceof basic_1.StructureType) {
32791
32807
  let length = 0;
32792
32808
  for (const c of found.getComponents()) {
@@ -32808,11 +32824,13 @@ class SelectOption {
32808
32824
  { name: "HIGH", type: found },
32809
32825
  ]);
32810
32826
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.TableType(stru, { withHeader: true, keyType: basic_1.TableKeyType.default })));
32811
- return;
32812
32827
  }
32813
- if (nameToken) {
32828
+ else {
32814
32829
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.UnknownType("Select option, fallback")));
32815
32830
  }
32831
+ const magicName = "%_" + nameToken.getStr() + "_%_app_%";
32832
+ const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
32833
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, new basic_1.VoidType("SELECT-OPTION magic")));
32816
32834
  }
32817
32835
  }
32818
32836
  exports.SelectOption = SelectOption;
@@ -35132,13 +35150,13 @@ class FlowGraph {
35132
35150
  this.label = label;
35133
35151
  }
35134
35152
  toDigraph() {
35135
- return `digraph G {
35136
- labelloc="t";
35137
- label="${this.label}";
35138
- graph [fontname = "helvetica"];
35139
- node [fontname = "helvetica", shape="box"];
35140
- edge [fontname = "helvetica"];
35141
- ${this.toTextEdges()}
35153
+ return `digraph G {
35154
+ labelloc="t";
35155
+ label="${this.label}";
35156
+ graph [fontname = "helvetica"];
35157
+ node [fontname = "helvetica", shape="box"];
35158
+ edge [fontname = "helvetica"];
35159
+ ${this.toTextEdges()}
35142
35160
  }`;
35143
35161
  }
35144
35162
  listSources(node) {
@@ -43388,13 +43406,13 @@ class Help {
43388
43406
  /////////////////////////////////////////////////
43389
43407
  static dumpABAP(file, reg, textDocument, position) {
43390
43408
  let content = "";
43391
- content = `
43392
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43393
- <a href="#_statements" rel="no-refresh">Statements</a> |
43394
- <a href="#_structure" rel="no-refresh">Structure</a> |
43395
- <a href="#_files" rel="no-refresh">Files</a> |
43396
- <a href="#_info" rel="no-refresh">Info Dump</a>
43397
- <hr>
43409
+ content = `
43410
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43411
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43412
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43413
+ <a href="#_files" rel="no-refresh">Files</a> |
43414
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43415
+ <hr>
43398
43416
  ` +
43399
43417
  "<tt>" + textDocument.uri + " (" +
43400
43418
  (position.line + 1) + ", " +
@@ -50142,7 +50160,7 @@ class RenameGlobalClass {
50142
50160
  }
50143
50161
  const main = obj.getMainABAPFile();
50144
50162
  if (main === undefined) {
50145
- throw new Error("Main file not found");
50163
+ throw new Error(`Main file not found, ${obj.getType()} ${obj.getName()}`);
50146
50164
  }
50147
50165
  let changes = [];
50148
50166
  // todo, this is actually the same as "id" ?
@@ -52714,7 +52732,7 @@ class Registry {
52714
52732
  }
52715
52733
  static abaplintVersion() {
52716
52734
  // magic, see build script "version.sh"
52717
- return "2.113.8";
52735
+ return "2.113.10";
52718
52736
  }
52719
52737
  getDDICReferences() {
52720
52738
  return this.ddicReferences;
@@ -53033,10 +53051,10 @@ class SevenBitAscii {
53033
53051
  key: "7bit_ascii",
53034
53052
  title: "Check for 7bit ascii",
53035
53053
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53036
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53037
-
53038
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53039
-
53054
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53055
+
53056
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53057
+
53040
53058
  Checkes files with extensions ".abap" and ".asddls"`,
53041
53059
  tags: [_irule_1.RuleTag.SingleFile],
53042
53060
  badExample: `WRITE '뽑'.`,
@@ -53242,10 +53260,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53242
53260
  key: "abapdoc",
53243
53261
  title: "Check abapdoc",
53244
53262
  shortDescription: `Various checks regarding abapdoc.`,
53245
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53246
-
53247
- Plus class and interface definitions.
53248
-
53263
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53264
+
53265
+ Plus class and interface definitions.
53266
+
53249
53267
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53250
53268
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53251
53269
  };
@@ -53382,27 +53400,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53382
53400
  title: "Add test attributes for tests classes with test methods",
53383
53401
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53384
53402
  tags: [_irule_1.RuleTag.SingleFile],
53385
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53386
- PUBLIC SECTION.
53387
- PROTECTED SECTION.
53388
- PRIVATE SECTION.
53389
- METHODS test FOR TESTING RAISING cx_static_check.
53390
- ENDCLASS.
53391
-
53392
- CLASS ltcl_test1 IMPLEMENTATION.
53393
- METHOD test.
53394
- ENDMETHOD.
53403
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53404
+ PUBLIC SECTION.
53405
+ PROTECTED SECTION.
53406
+ PRIVATE SECTION.
53407
+ METHODS test FOR TESTING RAISING cx_static_check.
53408
+ ENDCLASS.
53409
+
53410
+ CLASS ltcl_test1 IMPLEMENTATION.
53411
+ METHOD test.
53412
+ ENDMETHOD.
53395
53413
  ENDCLASS.`,
53396
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53397
- PUBLIC SECTION.
53398
- PROTECTED SECTION.
53399
- PRIVATE SECTION.
53400
- METHODS test FOR TESTING RAISING cx_static_check.
53401
- ENDCLASS.
53402
-
53403
- CLASS ltcl_test2 IMPLEMENTATION.
53404
- METHOD test.
53405
- ENDMETHOD.
53414
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53415
+ PUBLIC SECTION.
53416
+ PROTECTED SECTION.
53417
+ PRIVATE SECTION.
53418
+ METHODS test FOR TESTING RAISING cx_static_check.
53419
+ ENDCLASS.
53420
+
53421
+ CLASS ltcl_test2 IMPLEMENTATION.
53422
+ METHOD test.
53423
+ ENDMETHOD.
53406
53424
  ENDCLASS.`,
53407
53425
  };
53408
53426
  }
@@ -53488,49 +53506,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53488
53506
  key: "align_parameters",
53489
53507
  title: "Align Parameters",
53490
53508
  shortDescription: `Checks for vertially aligned parameters`,
53491
- extendedInformation: `Checks:
53492
- * function module calls
53493
- * method calls
53494
- * VALUE constructors
53495
- * NEW constructors
53496
- * RAISE EXCEPTION statements
53497
- * CREATE OBJECT statements
53498
- * RAISE EVENT statements
53499
-
53500
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53501
-
53502
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53503
-
53504
- If parameters are on the same row, no issues are reported, see
53509
+ extendedInformation: `Checks:
53510
+ * function module calls
53511
+ * method calls
53512
+ * VALUE constructors
53513
+ * NEW constructors
53514
+ * RAISE EXCEPTION statements
53515
+ * CREATE OBJECT statements
53516
+ * RAISE EVENT statements
53517
+
53518
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53519
+
53520
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53521
+
53522
+ If parameters are on the same row, no issues are reported, see
53505
53523
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53506
53524
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53507
- badExample: `CALL FUNCTION 'FOOBAR'
53508
- EXPORTING
53509
- foo = 2
53510
- parameter = 3.
53511
-
53512
- foobar( moo = 1
53513
- param = 1 ).
53514
-
53515
- foo = VALUE #(
53516
- foo = bar
53525
+ badExample: `CALL FUNCTION 'FOOBAR'
53526
+ EXPORTING
53527
+ foo = 2
53528
+ parameter = 3.
53529
+
53530
+ foobar( moo = 1
53531
+ param = 1 ).
53532
+
53533
+ foo = VALUE #(
53534
+ foo = bar
53517
53535
  moo = 2 ).`,
53518
- goodExample: `CALL FUNCTION 'FOOBAR'
53519
- EXPORTING
53520
- foo = 2
53521
- parameter = 3.
53522
-
53523
- foobar( moo = 1
53524
- param = 1 ).
53525
-
53526
- foo = VALUE #(
53527
- foo = bar
53528
- moo = 2 ).
53529
-
53530
- DATA(sdf) = VALUE type(
53531
- common_val = 2
53532
- another_common = 5
53533
- ( row_value = 4
53536
+ goodExample: `CALL FUNCTION 'FOOBAR'
53537
+ EXPORTING
53538
+ foo = 2
53539
+ parameter = 3.
53540
+
53541
+ foobar( moo = 1
53542
+ param = 1 ).
53543
+
53544
+ foo = VALUE #(
53545
+ foo = bar
53546
+ moo = 2 ).
53547
+
53548
+ DATA(sdf) = VALUE type(
53549
+ common_val = 2
53550
+ another_common = 5
53551
+ ( row_value = 4
53534
53552
  value_foo = 5 ) ).`,
53535
53553
  };
53536
53554
  }
@@ -53964,37 +53982,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
53964
53982
  key: "align_type_expressions",
53965
53983
  title: "Align TYPE expressions",
53966
53984
  shortDescription: `Align TYPE expressions in statements`,
53967
- extendedInformation: `
53968
- Currently works for METHODS + BEGIN OF
53969
-
53970
- If BEGIN OF has an INCLUDE TYPE its ignored
53971
-
53972
- Also note that clean ABAP does not recommend aligning TYPE clauses:
53985
+ extendedInformation: `
53986
+ Currently works for METHODS + BEGIN OF
53987
+
53988
+ If BEGIN OF has an INCLUDE TYPE its ignored
53989
+
53990
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
53973
53991
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
53974
53992
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
53975
- badExample: `
53976
- TYPES: BEGIN OF foo,
53977
- bar TYPE i,
53978
- foobar TYPE i,
53979
- END OF foo.
53980
-
53981
- INTERFACE lif.
53982
- METHODS bar
53983
- IMPORTING
53984
- foo TYPE i
53985
- foobar TYPE i.
53993
+ badExample: `
53994
+ TYPES: BEGIN OF foo,
53995
+ bar TYPE i,
53996
+ foobar TYPE i,
53997
+ END OF foo.
53998
+
53999
+ INTERFACE lif.
54000
+ METHODS bar
54001
+ IMPORTING
54002
+ foo TYPE i
54003
+ foobar TYPE i.
53986
54004
  ENDINTERFACE.`,
53987
- goodExample: `
53988
- TYPES: BEGIN OF foo,
53989
- bar TYPE i,
53990
- foobar TYPE i,
53991
- END OF foo.
53992
-
53993
- INTERFACE lif.
53994
- METHODS bar
53995
- IMPORTING
53996
- foo TYPE i
53997
- foobar TYPE i.
54005
+ goodExample: `
54006
+ TYPES: BEGIN OF foo,
54007
+ bar TYPE i,
54008
+ foobar TYPE i,
54009
+ END OF foo.
54010
+
54011
+ INTERFACE lif.
54012
+ METHODS bar
54013
+ IMPORTING
54014
+ foo TYPE i
54015
+ foobar TYPE i.
53998
54016
  ENDINTERFACE.`,
53999
54017
  };
54000
54018
  }
@@ -54273,16 +54291,17 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54273
54291
  return {
54274
54292
  key: "ambiguous_statement",
54275
54293
  title: "Check for ambigious statements",
54276
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54277
- Add "TABLE" keyword or "@" for escaping SQL variables
54278
-
54294
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54295
+ Add "TABLE" keyword or "@" for escaping SQL variables
54296
+
54279
54297
  Only works if the target version is 740sp05 or above`,
54280
54298
  tags: [_irule_1.RuleTag.SingleFile],
54281
- badExample: `DELETE foo FROM bar.
54299
+ badExample: `DELETE foo FROM bar.
54282
54300
  MODIFY foo FROM bar.`,
54283
- goodExample: `DELETE foo FROM @bar.
54284
- MODIFY TABLE foo FROM bar.
54285
- MODIFY zfoo FROM @wa.`,
54301
+ goodExample: `DELETE foo FROM @bar.
54302
+ DELETE TABLE itab FROM 2.
54303
+ MODIFY zfoo FROM @wa.
54304
+ MODIFY TABLE foo FROM bar.`,
54286
54305
  };
54287
54306
  }
54288
54307
  getMessage() {
@@ -54386,16 +54405,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54386
54405
  key: "avoid_use",
54387
54406
  title: "Avoid use of certain statements",
54388
54407
  shortDescription: `Detects usage of certain statements.`,
54389
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54390
-
54391
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54392
-
54393
- STATICS: use CLASS-DATA instead
54394
-
54395
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54396
-
54397
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54398
-
54408
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54409
+
54410
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54411
+
54412
+ STATICS: use CLASS-DATA instead
54413
+
54414
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54415
+
54416
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54417
+
54399
54418
  BREAK points`,
54400
54419
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54401
54420
  };
@@ -54527,11 +54546,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54527
54546
  title: "Check BEGIN END names",
54528
54547
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54529
54548
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54530
- badExample: `DATA: BEGIN OF stru,
54531
- field TYPE i,
54549
+ badExample: `DATA: BEGIN OF stru,
54550
+ field TYPE i,
54532
54551
  END OF structure_not_the_same.`,
54533
- goodExample: `DATA: BEGIN OF stru,
54534
- field TYPE i,
54552
+ goodExample: `DATA: BEGIN OF stru,
54553
+ field TYPE i,
54535
54554
  END OF stru.`,
54536
54555
  };
54537
54556
  }
@@ -54628,20 +54647,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54628
54647
  title: "BEGIN contains single INCLUDE",
54629
54648
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54630
54649
  tags: [_irule_1.RuleTag.SingleFile],
54631
- badExample: `TYPES: BEGIN OF dummy1.
54632
- INCLUDE TYPE dselc.
54633
- TYPES: END OF dummy1.
54634
-
54635
- DATA BEGIN OF foo.
54636
- INCLUDE STRUCTURE syst.
54637
- DATA END OF foo.
54638
-
54639
- STATICS BEGIN OF bar.
54640
- INCLUDE STRUCTURE syst.
54650
+ badExample: `TYPES: BEGIN OF dummy1.
54651
+ INCLUDE TYPE dselc.
54652
+ TYPES: END OF dummy1.
54653
+
54654
+ DATA BEGIN OF foo.
54655
+ INCLUDE STRUCTURE syst.
54656
+ DATA END OF foo.
54657
+
54658
+ STATICS BEGIN OF bar.
54659
+ INCLUDE STRUCTURE syst.
54641
54660
  STATICS END OF bar.`,
54642
- goodExample: `DATA BEGIN OF foo.
54643
- DATA field TYPE i.
54644
- INCLUDE STRUCTURE dselc.
54661
+ goodExample: `DATA BEGIN OF foo.
54662
+ DATA field TYPE i.
54663
+ INCLUDE STRUCTURE dselc.
54645
54664
  DATA END OF foo.`,
54646
54665
  };
54647
54666
  }
@@ -54731,9 +54750,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54731
54750
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54732
54751
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54733
54752
  badExample: `CALL TRANSACTION 'FOO'.`,
54734
- goodExample: `TRY.
54735
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54736
- CATCH cx_sy_authorization_error.
54753
+ goodExample: `TRY.
54754
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54755
+ CATCH cx_sy_authorization_error.
54737
54756
  ENDTRY.`,
54738
54757
  };
54739
54758
  }
@@ -54798,10 +54817,10 @@ class CDSCommentStyle {
54798
54817
  key: "cds_comment_style",
54799
54818
  title: "CDS Comment Style",
54800
54819
  shortDescription: `Check for obsolete comment style`,
54801
- extendedInformation: `Check for obsolete comment style
54802
-
54803
- Comments starting with "--" are considered obsolete
54804
-
54820
+ extendedInformation: `Check for obsolete comment style
54821
+
54822
+ Comments starting with "--" are considered obsolete
54823
+
54805
54824
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54806
54825
  tags: [_irule_1.RuleTag.SingleFile],
54807
54826
  badExample: "-- this is a comment",
@@ -54867,10 +54886,10 @@ class CDSLegacyView {
54867
54886
  key: "cds_legacy_view",
54868
54887
  title: "CDS Legacy View",
54869
54888
  shortDescription: `Identify CDS Legacy Views`,
54870
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54871
-
54872
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54873
-
54889
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54890
+
54891
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54892
+
54874
54893
  v755 and up`,
54875
54894
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54876
54895
  };
@@ -55025,10 +55044,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55025
55044
  key: "chain_mainly_declarations",
55026
55045
  title: "Chain mainly declarations",
55027
55046
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55028
- extendedInformation: `
55029
- https://docs.abapopenchecks.org/checks/23/
55030
-
55031
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55047
+ extendedInformation: `
55048
+ https://docs.abapopenchecks.org/checks/23/
55049
+
55050
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55032
55051
  `,
55033
55052
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55034
55053
  badExample: `CALL METHOD: bar.`,
@@ -55204,17 +55223,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55204
55223
  title: "Change IF to CASE",
55205
55224
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55206
55225
  // eslint-disable-next-line max-len
55207
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55208
-
55226
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55227
+
55209
55228
  If the first comparison is a boolean compare, no issue is reported.`,
55210
55229
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55211
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55212
- ELSEIF l_fcat-fieldname = 'BAR'
55213
- OR l_fcat-fieldname = 'MOO'.
55230
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55231
+ ELSEIF l_fcat-fieldname = 'BAR'
55232
+ OR l_fcat-fieldname = 'MOO'.
55214
55233
  ENDIF.`,
55215
- goodExample: `CASE l_fcat-fieldname.
55216
- WHEN 'FOO'.
55217
- WHEN 'BAR' OR 'MOO'.
55234
+ goodExample: `CASE l_fcat-fieldname.
55235
+ WHEN 'FOO'.
55236
+ WHEN 'BAR' OR 'MOO'.
55218
55237
  ENDCASE.`,
55219
55238
  };
55220
55239
  }
@@ -55351,8 +55370,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55351
55370
  return {
55352
55371
  key: "check_abstract",
55353
55372
  title: "Check abstract methods and classes",
55354
- shortDescription: `Checks abstract methods and classes:
55355
- - class defined as abstract and final,
55373
+ shortDescription: `Checks abstract methods and classes:
55374
+ - class defined as abstract and final,
55356
55375
  - non-abstract class contains abstract methods`,
55357
55376
  extendedInformation: `If a class defines only constants, use an interface instead`,
55358
55377
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55433,11 +55452,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55433
55452
  return {
55434
55453
  key: "check_comments",
55435
55454
  title: "Check Comments",
55436
- shortDescription: `
55455
+ shortDescription: `
55437
55456
  Various checks for comment usage.`,
55438
- extendedInformation: `
55439
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55440
-
55457
+ extendedInformation: `
55458
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55459
+
55441
55460
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55442
55461
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55443
55462
  badExample: `WRITE 2. " descriptive comment`,
@@ -55599,9 +55618,9 @@ class CheckInclude {
55599
55618
  key: "check_include",
55600
55619
  title: "Check INCLUDEs",
55601
55620
  shortDescription: `Checks INCLUDE statements`,
55602
- extendedInformation: `
55603
- * Reports unused includes
55604
- * Errors if the includes are not found
55621
+ extendedInformation: `
55622
+ * Reports unused includes
55623
+ * Errors if the includes are not found
55605
55624
  * Error if including a main program`,
55606
55625
  tags: [_irule_1.RuleTag.Syntax],
55607
55626
  };
@@ -55677,14 +55696,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55677
55696
  key: "check_subrc",
55678
55697
  title: "Check sy-subrc",
55679
55698
  shortDescription: `Check sy-subrc`,
55680
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55681
-
55682
- If sy-dbcnt is checked after database statements, it is considered okay.
55683
-
55684
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55685
-
55686
- If IS ASSIGNED is checked after assigning, it is considered okay.
55687
-
55699
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55700
+
55701
+ If sy-dbcnt is checked after database statements, it is considered okay.
55702
+
55703
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55704
+
55705
+ If IS ASSIGNED is checked after assigning, it is considered okay.
55706
+
55688
55707
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55689
55708
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55690
55709
  pseudoComment: "EC CI_SUBRC",
@@ -56254,17 +56273,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56254
56273
  shortDescription: `Find overlapping classic exceptions`,
56255
56274
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56256
56275
  tags: [_irule_1.RuleTag.SingleFile],
56257
- badExample: `CALL FUNCTION 'SOMETHING'
56258
- EXCEPTIONS
56259
- system_failure = 1 MESSAGE lv_message
56260
- communication_failure = 1 MESSAGE lv_message
56261
- resource_failure = 1
56276
+ badExample: `CALL FUNCTION 'SOMETHING'
56277
+ EXCEPTIONS
56278
+ system_failure = 1 MESSAGE lv_message
56279
+ communication_failure = 1 MESSAGE lv_message
56280
+ resource_failure = 1
56262
56281
  OTHERS = 1.`,
56263
- goodExample: `CALL FUNCTION 'SOMETHING'
56264
- EXCEPTIONS
56265
- system_failure = 1 MESSAGE lv_message
56266
- communication_failure = 2 MESSAGE lv_message
56267
- resource_failure = 3
56282
+ goodExample: `CALL FUNCTION 'SOMETHING'
56283
+ EXCEPTIONS
56284
+ system_failure = 1 MESSAGE lv_message
56285
+ communication_failure = 2 MESSAGE lv_message
56286
+ resource_failure = 3
56268
56287
  OTHERS = 4.`,
56269
56288
  };
56270
56289
  }
@@ -56510,7 +56529,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56510
56529
  key: "commented_code",
56511
56530
  title: "Find commented code",
56512
56531
  shortDescription: `Detects usage of commented out code.`,
56513
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56532
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56514
56533
  https://docs.abapopenchecks.org/checks/14/`,
56515
56534
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56516
56535
  badExample: `* WRITE 'hello world'.`,
@@ -56743,10 +56762,10 @@ class ConstructorVisibilityPublic {
56743
56762
  key: "constructor_visibility_public",
56744
56763
  title: "Check constructor visibility is public",
56745
56764
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
56746
- extendedInformation: `
56747
- This only applies to global classes.
56748
-
56749
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56765
+ extendedInformation: `
56766
+ This only applies to global classes.
56767
+
56768
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56750
56769
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56751
56770
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56752
56771
  };
@@ -56821,8 +56840,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56821
56840
  key: "contains_tab",
56822
56841
  title: "Code contains tab",
56823
56842
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56824
- extendedInformation: `
56825
- https://docs.abapopenchecks.org/checks/09/
56843
+ extendedInformation: `
56844
+ https://docs.abapopenchecks.org/checks/09/
56826
56845
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56827
56846
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56828
56847
  badExample: `\tWRITE 'hello world'.`,
@@ -56909,10 +56928,10 @@ class CyclicOO {
56909
56928
  key: "cyclic_oo",
56910
56929
  title: "Cyclic OO",
56911
56930
  shortDescription: `Finds cyclic/circular OO references`,
56912
- extendedInformation: `Runs for global INTF + CLAS objects
56913
-
56914
- Objects must be without syntax errors for this rule to take effect
56915
-
56931
+ extendedInformation: `Runs for global INTF + CLAS objects
56932
+
56933
+ Objects must be without syntax errors for this rule to take effect
56934
+
56916
56935
  References in testclass includes are ignored`,
56917
56936
  };
56918
56937
  }
@@ -57137,6 +57156,7 @@ class DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {
57137
57156
  this.generateSubroutine = true;
57138
57157
  this.deleteReport = true;
57139
57158
  this.deleteTextpool = true;
57159
+ this.insertTextpool = true;
57140
57160
  this.deleteDynpro = true;
57141
57161
  this.exportDynpro = true;
57142
57162
  /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */
@@ -57154,7 +57174,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57154
57174
  key: "dangerous_statement",
57155
57175
  title: "Dangerous statement",
57156
57176
  shortDescription: `Detects potentially dangerous statements`,
57157
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57177
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57158
57178
  dynamic SQL can potentially create SQL injection problems`,
57159
57179
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57160
57180
  };
@@ -57200,6 +57220,9 @@ dynamic SQL can potentially create SQL injection problems`,
57200
57220
  else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {
57201
57221
  message = "DELETE TEXTPOOL";
57202
57222
  }
57223
+ else if (this.conf.insertTextpool && statement instanceof Statements.InsertTextpool) {
57224
+ message = "INSERT TEXTPOOL";
57225
+ }
57203
57226
  else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {
57204
57227
  message = "DELETE DYNPRO";
57205
57228
  }
@@ -57358,13 +57381,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57358
57381
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57359
57382
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57360
57383
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57361
- badExample: `FROM foo.
57362
- WRITE 'hello'.
57363
- DATA int TYPE i.
57384
+ badExample: `FROM foo.
57385
+ WRITE 'hello'.
57386
+ DATA int TYPE i.
57364
57387
  ENDFORM.`,
57365
- goodExample: `FROM foo.
57366
- DATA int TYPE i.
57367
- WRITE 'hello'.
57388
+ goodExample: `FROM foo.
57389
+ DATA int TYPE i.
57390
+ WRITE 'hello'.
57368
57391
  ENDFORM.`,
57369
57392
  };
57370
57393
  }
@@ -57903,39 +57926,39 @@ class Downport {
57903
57926
  key: "downport",
57904
57927
  title: "Downport statement",
57905
57928
  shortDescription: `Downport functionality`,
57906
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57907
- a higher level language version. If successful, various rules are applied to downport the statement.
57908
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57909
-
57910
- Current rules:
57911
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57912
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57913
- * FIELD-SYMBOL() definitions are outlined
57914
- * CONV is outlined
57915
- * COND is outlined
57916
- * REDUCE is outlined
57917
- * SWITCH is outlined
57918
- * FILTER is outlined
57919
- * APPEND expression is outlined
57920
- * INSERT expression is outlined
57921
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57922
- * CAST changed to ?=
57923
- * LOOP AT method_call( ) is outlined
57924
- * VALUE # with structure fields
57925
- * VALUE # with internal table lines
57926
- * Table Expressions are outlined
57927
- * SELECT INTO @DATA definitions are outlined
57928
- * Some occurrences of string template formatting option ALPHA changed to function module call
57929
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57930
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57931
- * RAISE EXCEPTION ... MESSAGE
57932
- * Moving with +=, -=, /=, *=, &&= is expanded
57933
- * line_exists and line_index is downported to READ TABLE
57934
- * ENUMs, but does not nessesarily give the correct type and value
57935
- * MESSAGE with non simple source
57936
-
57937
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57938
-
57929
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57930
+ a higher level language version. If successful, various rules are applied to downport the statement.
57931
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
57932
+
57933
+ Current rules:
57934
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57935
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57936
+ * FIELD-SYMBOL() definitions are outlined
57937
+ * CONV is outlined
57938
+ * COND is outlined
57939
+ * REDUCE is outlined
57940
+ * SWITCH is outlined
57941
+ * FILTER is outlined
57942
+ * APPEND expression is outlined
57943
+ * INSERT expression is outlined
57944
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57945
+ * CAST changed to ?=
57946
+ * LOOP AT method_call( ) is outlined
57947
+ * VALUE # with structure fields
57948
+ * VALUE # with internal table lines
57949
+ * Table Expressions are outlined
57950
+ * SELECT INTO @DATA definitions are outlined
57951
+ * Some occurrences of string template formatting option ALPHA changed to function module call
57952
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57953
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57954
+ * RAISE EXCEPTION ... MESSAGE
57955
+ * Moving with +=, -=, /=, *=, &&= is expanded
57956
+ * line_exists and line_index is downported to READ TABLE
57957
+ * ENUMs, but does not nessesarily give the correct type and value
57958
+ * MESSAGE with non simple source
57959
+
57960
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57961
+
57939
57962
  Make sure to test the downported code, it might not always be completely correct.`,
57940
57963
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57941
57964
  };
@@ -58513,10 +58536,10 @@ Make sure to test the downported code, it might not always be completely correct
58513
58536
  const fieldName = f.concatTokens();
58514
58537
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58515
58538
  }
58516
- fieldDefinition = `DATA: BEGIN OF ${name},
58539
+ fieldDefinition = `DATA: BEGIN OF ${name},
58517
58540
  ${fieldDefinition}${indentation} END OF ${name}.`;
58518
58541
  }
58519
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58542
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58520
58543
  ${indentation}`);
58521
58544
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58522
58545
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58560,12 +58583,12 @@ ${indentation}`);
58560
58583
  }
58561
58584
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58562
58585
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
58563
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58564
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58565
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58586
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58587
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58588
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58566
58589
  ${indentation}`);
58567
58590
  if (fieldDefinitions === "") {
58568
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58591
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58569
58592
  ${indentation}`);
58570
58593
  }
58571
58594
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58633,7 +58656,7 @@ ${indentation}`);
58633
58656
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58634
58657
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58635
58658
  const firstToken = high.getFirstToken();
58636
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58659
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58637
58660
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58638
58661
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58639
58662
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58687,7 +58710,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58687
58710
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58688
58711
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58689
58712
  const firstToken = high.getFirstToken();
58690
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58713
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58691
58714
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58692
58715
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58693
58716
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58729,14 +58752,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58729
58752
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58730
58753
  const firstToken = high.getFirstToken();
58731
58754
  // note that the tabix restore should be done before throwing the exception
58732
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58733
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58734
- ${indentation}${tabixBackup} = sy-tabix.
58735
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58736
- ${indentation}sy-tabix = ${tabixBackup}.
58737
- ${indentation}IF sy-subrc <> 0.
58738
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58739
- ${indentation}ENDIF.
58755
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58756
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58757
+ ${indentation}${tabixBackup} = sy-tabix.
58758
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58759
+ ${indentation}sy-tabix = ${tabixBackup}.
58760
+ ${indentation}IF sy-subrc <> 0.
58761
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58762
+ ${indentation}ENDIF.
58740
58763
  ${indentation}`);
58741
58764
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58742
58765
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58793,7 +58816,7 @@ ${indentation}`);
58793
58816
  const className = classNames[0].concatTokens();
58794
58817
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58795
58818
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58796
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58819
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58797
58820
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58798
58821
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58799
58822
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -58955,16 +58978,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
58955
58978
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58956
58979
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58957
58980
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58958
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58959
- ${indentation}${uniqueName1}-msgid = ${id}.
58981
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58982
+ ${indentation}${uniqueName1}-msgid = ${id}.
58960
58983
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
58961
58984
  if (withs.length > 0) {
58962
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58963
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58964
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58985
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58986
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58987
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58965
58988
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
58966
58989
  }
58967
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58990
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58968
58991
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
58969
58992
  if (withs.length > 0) {
58970
58993
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59076,10 +59099,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59076
59099
  let code = "";
59077
59100
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59078
59101
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59079
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59080
- IF sy-subrc <> 0.
59081
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59082
- ENDIF.
59102
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59103
+ IF sy-subrc <> 0.
59104
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59105
+ ENDIF.
59083
59106
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59084
59107
  }
59085
59108
  else {
@@ -59168,20 +59191,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59168
59191
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59169
59192
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59170
59193
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59171
- code += ` items LIKE ${loopSourceName},
59172
- END OF ${groupTargetName}type.
59173
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59174
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59194
+ code += ` items LIKE ${loopSourceName},
59195
+ END OF ${groupTargetName}type.
59196
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59197
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59175
59198
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59176
59199
  if (groupIndexName !== undefined) {
59177
59200
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59178
59201
  }
59179
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59202
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59180
59203
  IF sy-subrc = 0.\n`;
59181
59204
  if (groupCountName !== undefined) {
59182
59205
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59183
59206
  }
59184
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59207
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59185
59208
  ELSE.\n`;
59186
59209
  code += ` CLEAR ${uniqueName}.\n`;
59187
59210
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59202,8 +59225,8 @@ ELSE.\n`;
59202
59225
  }
59203
59226
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59204
59227
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59205
- code += `ENDIF.
59206
- ENDLOOP.
59228
+ code += `ENDIF.
59229
+ ENDLOOP.
59207
59230
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59208
59231
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59209
59232
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59375,7 +59398,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59375
59398
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59376
59399
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59377
59400
  // all ENUMS are char like?
59378
- let code = `TYPES ${enumName} TYPE string.
59401
+ let code = `TYPES ${enumName} TYPE string.
59379
59402
  CONSTANTS: BEGIN OF ${structureName},\n`;
59380
59403
  let count = 1;
59381
59404
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59419,14 +59442,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59419
59442
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59420
59443
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59421
59444
  // restore tabix before exeption
59422
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59423
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59424
- ${indentation}${tabixBackup} = sy-tabix.
59425
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59426
- ${indentation}sy-tabix = ${tabixBackup}.
59427
- ${indentation}IF sy-subrc <> 0.
59428
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59429
- ${indentation}ENDIF.
59445
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59446
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59447
+ ${indentation}${tabixBackup} = sy-tabix.
59448
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59449
+ ${indentation}sy-tabix = ${tabixBackup}.
59450
+ ${indentation}IF sy-subrc <> 0.
59451
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59452
+ ${indentation}ENDIF.
59430
59453
  ${indentation}${uniqueName}`;
59431
59454
  const start = target.getFirstToken().getStart();
59432
59455
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59510,11 +59533,11 @@ ${indentation}${uniqueName}`;
59510
59533
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59511
59534
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59512
59535
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59513
- const code = `DATA ${uniqueName} TYPE string.
59514
- ${indentation}CALL FUNCTION '${functionName}'
59515
- ${indentation} EXPORTING
59516
- ${indentation} input = ${source}
59517
- ${indentation} IMPORTING
59536
+ const code = `DATA ${uniqueName} TYPE string.
59537
+ ${indentation}CALL FUNCTION '${functionName}'
59538
+ ${indentation} EXPORTING
59539
+ ${indentation} input = ${source}
59540
+ ${indentation} IMPORTING
59518
59541
  ${indentation} output = ${uniqueName}.\n`;
59519
59542
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59520
59543
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60826,12 +60849,12 @@ class EasyToFindMessages {
60826
60849
  key: "easy_to_find_messages",
60827
60850
  title: "Easy to find messages",
60828
60851
  shortDescription: `Make messages easy to find`,
60829
- extendedInformation: `All messages must be statically referenced exactly once
60830
-
60831
- Only MESSAGE and RAISE statments are counted as static references
60832
-
60833
- Also see rule "message_exists"
60834
-
60852
+ extendedInformation: `All messages must be statically referenced exactly once
60853
+
60854
+ Only MESSAGE and RAISE statments are counted as static references
60855
+
60856
+ Also see rule "message_exists"
60857
+
60835
60858
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60836
60859
  tags: [_irule_1.RuleTag.Styleguide],
60837
60860
  };
@@ -60912,13 +60935,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
60912
60935
  shortDescription: `Empty selection screen or list processing event block`,
60913
60936
  extendedInformation: ``,
60914
60937
  tags: [_irule_1.RuleTag.SingleFile],
60915
- badExample: `
60916
- INITIALIZATION.
60917
- WRITE 'hello'.
60938
+ badExample: `
60939
+ INITIALIZATION.
60940
+ WRITE 'hello'.
60918
60941
  END-OF-SELECTION.`,
60919
- goodExample: `
60920
- START-OF-SELECTION.
60921
- PERFORM sdf.
60942
+ goodExample: `
60943
+ START-OF-SELECTION.
60944
+ PERFORM sdf.
60922
60945
  COMMIT WORK.`,
60923
60946
  };
60924
60947
  }
@@ -61010,8 +61033,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61010
61033
  key: "empty_line_in_statement",
61011
61034
  title: "Find empty lines in statements",
61012
61035
  shortDescription: `Checks that statements do not contain empty lines.`,
61013
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61014
-
61036
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61037
+
61015
61038
  https://docs.abapopenchecks.org/checks/41/`,
61016
61039
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61017
61040
  badExample: `WRITE\n\nhello.`,
@@ -61187,13 +61210,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61187
61210
  shortDescription: `Checks that the code does not contain empty blocks.`,
61188
61211
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61189
61212
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61190
- badExample: `IF foo = bar.
61191
- ENDIF.
61192
-
61193
- DO 2 TIMES.
61213
+ badExample: `IF foo = bar.
61214
+ ENDIF.
61215
+
61216
+ DO 2 TIMES.
61194
61217
  ENDDO.`,
61195
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61196
- ENDLOOP.
61218
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61219
+ ENDLOOP.
61197
61220
  result = xsdbool( sy-subrc = 0 ).`,
61198
61221
  };
61199
61222
  }
@@ -61335,10 +61358,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61335
61358
  return {
61336
61359
  key: "exit_or_check",
61337
61360
  title: "Find EXIT or CHECK outside loops",
61338
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61361
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61339
61362
  Use RETURN to leave procesing blocks instead.`,
61340
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61341
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61363
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61364
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61342
61365
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61343
61366
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61344
61367
  };
@@ -61421,12 +61444,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61421
61444
  key: "expand_macros",
61422
61445
  title: "Expand Macros",
61423
61446
  shortDescription: `Allows expanding macro calls with quick fixes`,
61424
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61425
-
61447
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61448
+
61426
61449
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61427
- badExample: `DEFINE _hello.
61428
- WRITE 'hello'.
61429
- END-OF-DEFINITION.
61450
+ badExample: `DEFINE _hello.
61451
+ WRITE 'hello'.
61452
+ END-OF-DEFINITION.
61430
61453
  _hello.`,
61431
61454
  goodExample: `WRITE 'hello'.`,
61432
61455
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61513,7 +61536,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61513
61536
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61514
61537
  badExample: `call_method( EXPORTING foo = bar ).`,
61515
61538
  goodExample: `call_method( foo = bar ).`,
61516
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61539
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61517
61540
  https://docs.abapopenchecks.org/checks/30/`,
61518
61541
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61519
61542
  };
@@ -61611,7 +61634,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61611
61634
  key: "forbidden_identifier",
61612
61635
  title: "Forbidden Identifier",
61613
61636
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61614
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61637
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61615
61638
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61616
61639
  tags: [_irule_1.RuleTag.SingleFile],
61617
61640
  };
@@ -61853,8 +61876,8 @@ class ForbiddenVoidType {
61853
61876
  key: "forbidden_void_type",
61854
61877
  title: "Forbidden Void Types",
61855
61878
  shortDescription: `Avoid usage of specified void types.`,
61856
- extendedInformation: `Inspiration:
61857
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61879
+ extendedInformation: `Inspiration:
61880
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61858
61881
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61859
61882
  };
61860
61883
  }
@@ -62097,7 +62120,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62097
62120
  key: "fully_type_itabs",
62098
62121
  title: "Fully type internal tables",
62099
62122
  shortDescription: `No implict table types or table keys`,
62100
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62123
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62101
62124
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62102
62125
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62103
62126
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62282,26 +62305,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62282
62305
  key: "functional_writing",
62283
62306
  title: "Use functional writing",
62284
62307
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62285
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62308
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62286
62309
  https://docs.abapopenchecks.org/checks/07/`,
62287
62310
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62288
- badExample: `CALL METHOD zcl_class=>method( ).
62289
- CALL METHOD cl_abap_typedescr=>describe_by_name
62290
- EXPORTING
62291
- p_name = 'NAME'
62292
- RECEIVING
62293
- p_descr_ref = lr_typedescr
62294
- EXCEPTIONS
62295
- type_not_found = 1
62311
+ badExample: `CALL METHOD zcl_class=>method( ).
62312
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62313
+ EXPORTING
62314
+ p_name = 'NAME'
62315
+ RECEIVING
62316
+ p_descr_ref = lr_typedescr
62317
+ EXCEPTIONS
62318
+ type_not_found = 1
62296
62319
  OTHERS = 2.`,
62297
- goodExample: `zcl_class=>method( ).
62298
- cl_abap_typedescr=>describe_by_name(
62299
- EXPORTING
62300
- p_name = 'NAME'
62301
- RECEIVING
62302
- p_descr_ref = lr_typedescr
62303
- EXCEPTIONS
62304
- type_not_found = 1
62320
+ goodExample: `zcl_class=>method( ).
62321
+ cl_abap_typedescr=>describe_by_name(
62322
+ EXPORTING
62323
+ p_name = 'NAME'
62324
+ RECEIVING
62325
+ p_descr_ref = lr_typedescr
62326
+ EXCEPTIONS
62327
+ type_not_found = 1
62305
62328
  OTHERS = 2 ).`,
62306
62329
  };
62307
62330
  }
@@ -62412,14 +62435,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62412
62435
  key: "global_class",
62413
62436
  title: "Global class checks",
62414
62437
  shortDescription: `Checks related to global classes`,
62415
- extendedInformation: `* global classes must be in own files
62416
-
62417
- * file names must match class name
62418
-
62419
- * file names must match interface name
62420
-
62421
- * global classes must be global definitions
62422
-
62438
+ extendedInformation: `* global classes must be in own files
62439
+
62440
+ * file names must match class name
62441
+
62442
+ * file names must match interface name
62443
+
62444
+ * global classes must be global definitions
62445
+
62423
62446
  * global interfaces must be global definitions`,
62424
62447
  tags: [_irule_1.RuleTag.Syntax],
62425
62448
  };
@@ -62518,21 +62541,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62518
62541
  return {
62519
62542
  key: "identical_conditions",
62520
62543
  title: "Identical conditions",
62521
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62522
-
62544
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62545
+
62523
62546
  Prerequsites: code is pretty printed with identical cAsE`,
62524
62547
  tags: [_irule_1.RuleTag.SingleFile],
62525
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62526
- ENDIF.
62527
- CASE bar.
62528
- WHEN '1'.
62529
- WHEN 'A' OR '1'.
62548
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62549
+ ENDIF.
62550
+ CASE bar.
62551
+ WHEN '1'.
62552
+ WHEN 'A' OR '1'.
62530
62553
  ENDCASE.`,
62531
- goodExample: `IF foo = bar OR 1 = a.
62532
- ENDIF.
62533
- CASE bar.
62534
- WHEN '1'.
62535
- WHEN 'A'.
62554
+ goodExample: `IF foo = bar OR 1 = a.
62555
+ ENDIF.
62556
+ CASE bar.
62557
+ WHEN '1'.
62558
+ WHEN 'A'.
62536
62559
  ENDCASE.`,
62537
62560
  };
62538
62561
  }
@@ -62666,23 +62689,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62666
62689
  key: "identical_contents",
62667
62690
  title: "Identical contents",
62668
62691
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62669
- extendedInformation: `
62670
- Prerequsites: code is pretty printed with identical cAsE
62671
-
62692
+ extendedInformation: `
62693
+ Prerequsites: code is pretty printed with identical cAsE
62694
+
62672
62695
  Chained statments are ignored`,
62673
62696
  tags: [_irule_1.RuleTag.SingleFile],
62674
- badExample: `IF foo = bar.
62675
- WRITE 'bar'.
62676
- WRITE 'world'.
62677
- ELSE.
62678
- WRITE 'foo'.
62679
- WRITE 'world'.
62697
+ badExample: `IF foo = bar.
62698
+ WRITE 'bar'.
62699
+ WRITE 'world'.
62700
+ ELSE.
62701
+ WRITE 'foo'.
62702
+ WRITE 'world'.
62680
62703
  ENDIF.`,
62681
- goodExample: `IF foo = bar.
62682
- WRITE 'bar'.
62683
- ELSE.
62684
- WRITE 'foo'.
62685
- ENDIF.
62704
+ goodExample: `IF foo = bar.
62705
+ WRITE 'bar'.
62706
+ ELSE.
62707
+ WRITE 'foo'.
62708
+ ENDIF.
62686
62709
  WRITE 'world'.`,
62687
62710
  };
62688
62711
  }
@@ -62790,12 +62813,12 @@ class IdenticalDescriptions {
62790
62813
  key: "identical_descriptions",
62791
62814
  title: "Identical descriptions",
62792
62815
  shortDescription: `Searches for objects with the same type and same description`,
62793
- extendedInformation: `Case insensitive
62794
-
62795
- Only checks the master language descriptions
62796
-
62797
- Dependencies are skipped
62798
-
62816
+ extendedInformation: `Case insensitive
62817
+
62818
+ Only checks the master language descriptions
62819
+
62820
+ Dependencies are skipped
62821
+
62799
62822
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62800
62823
  tags: [],
62801
62824
  };
@@ -62969,43 +62992,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
62969
62992
  key: "if_in_if",
62970
62993
  title: "IF in IF",
62971
62994
  shortDescription: `Detects nested ifs which can be refactored.`,
62972
- extendedInformation: `
62973
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
62974
-
62975
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62976
-
62977
- https://docs.abapopenchecks.org/checks/01/
62995
+ extendedInformation: `
62996
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
62997
+
62998
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62999
+
63000
+ https://docs.abapopenchecks.org/checks/01/
62978
63001
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
62979
- badExample: `IF condition1.
62980
- IF condition2.
62981
- ...
62982
- ENDIF.
62983
- ENDIF.
62984
-
62985
- IF condition1.
62986
- ...
62987
- ELSE.
62988
- IF condition2.
62989
- ...
62990
- ENDIF.
63002
+ badExample: `IF condition1.
63003
+ IF condition2.
63004
+ ...
63005
+ ENDIF.
63006
+ ENDIF.
63007
+
63008
+ IF condition1.
63009
+ ...
63010
+ ELSE.
63011
+ IF condition2.
63012
+ ...
63013
+ ENDIF.
62991
63014
  ENDIF.`,
62992
- goodExample: `IF ( condition1 ) AND ( condition2 ).
62993
- ...
62994
- ENDIF.
62995
-
62996
- IF condition1.
62997
- ...
62998
- ELSEIF condition2.
62999
- ...
63000
- ENDIF.
63001
-
63002
- CASE variable.
63003
- WHEN value1.
63004
- ...
63005
- WHEN value2.
63006
- IF condition2.
63007
- ...
63008
- ENDIF.
63015
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63016
+ ...
63017
+ ENDIF.
63018
+
63019
+ IF condition1.
63020
+ ...
63021
+ ELSEIF condition2.
63022
+ ...
63023
+ ENDIF.
63024
+
63025
+ CASE variable.
63026
+ WHEN value1.
63027
+ ...
63028
+ WHEN value2.
63029
+ IF condition2.
63030
+ ...
63031
+ ENDIF.
63009
63032
  ENDCASE.`,
63010
63033
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63011
63034
  };
@@ -63190,9 +63213,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63190
63213
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63191
63214
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63192
63215
  if (name === impl.identifier.getName().toUpperCase()) {
63193
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63194
- METHOD ${methodName.toLowerCase()}.
63195
- RETURN. " todo, implement method
63216
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63217
+ METHOD ${methodName.toLowerCase()}.
63218
+ RETURN. " todo, implement method
63196
63219
  ENDMETHOD.`);
63197
63220
  }
63198
63221
  }
@@ -63371,14 +63394,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63371
63394
  key: "implicit_start_of_selection",
63372
63395
  title: "Implicit START-OF-SELECTION",
63373
63396
  shortDescription: `Add explicit selection screen event handling`,
63374
- extendedInformation: `Only runs for executable programs
63375
-
63397
+ extendedInformation: `Only runs for executable programs
63398
+
63376
63399
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63377
63400
  tags: [_irule_1.RuleTag.SingleFile],
63378
- badExample: `REPORT zfoo.
63401
+ badExample: `REPORT zfoo.
63379
63402
  WRITE 'hello'.`,
63380
- goodExample: `
63381
- START-OF-SELECTION.
63403
+ goodExample: `
63404
+ START-OF-SELECTION.
63382
63405
  WRITE 'hello'.`,
63383
63406
  };
63384
63407
  }
@@ -63483,19 +63506,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63483
63506
  key: "in_statement_indentation",
63484
63507
  title: "In-statement indentation",
63485
63508
  shortDescription: "Checks alignment within statements which span multiple lines.",
63486
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63487
-
63488
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63509
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63510
+
63511
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63489
63512
  to distinguish them better from code within the block.`,
63490
- badExample: `IF 1 = 1
63491
- AND 2 = 2.
63492
- WRITE 'hello' &&
63493
- 'world'.
63513
+ badExample: `IF 1 = 1
63514
+ AND 2 = 2.
63515
+ WRITE 'hello' &&
63516
+ 'world'.
63494
63517
  ENDIF.`,
63495
- goodExample: `IF 1 = 1
63496
- AND 2 = 2.
63497
- WRITE 'hello' &&
63498
- 'world'.
63518
+ goodExample: `IF 1 = 1
63519
+ AND 2 = 2.
63520
+ WRITE 'hello' &&
63521
+ 'world'.
63499
63522
  ENDIF.`,
63500
63523
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63501
63524
  };
@@ -63618,23 +63641,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63618
63641
  title: "Indentation",
63619
63642
  shortDescription: `Checks indentation`,
63620
63643
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63621
- badExample: `CLASS lcl DEFINITION.
63622
- PRIVATE SECTION.
63623
- METHODS constructor.
63624
- ENDCLASS.
63625
-
63626
- CLASS lcl IMPLEMENTATION.
63627
- METHOD constructor.
63628
- ENDMETHOD.
63644
+ badExample: `CLASS lcl DEFINITION.
63645
+ PRIVATE SECTION.
63646
+ METHODS constructor.
63647
+ ENDCLASS.
63648
+
63649
+ CLASS lcl IMPLEMENTATION.
63650
+ METHOD constructor.
63651
+ ENDMETHOD.
63629
63652
  ENDCLASS.`,
63630
- goodExample: `CLASS lcl DEFINITION.
63631
- PRIVATE SECTION.
63632
- METHODS constructor.
63633
- ENDCLASS.
63634
-
63635
- CLASS lcl IMPLEMENTATION.
63636
- METHOD constructor.
63637
- ENDMETHOD.
63653
+ goodExample: `CLASS lcl DEFINITION.
63654
+ PRIVATE SECTION.
63655
+ METHODS constructor.
63656
+ ENDCLASS.
63657
+
63658
+ CLASS lcl IMPLEMENTATION.
63659
+ METHOD constructor.
63660
+ ENDMETHOD.
63638
63661
  ENDCLASS.`,
63639
63662
  };
63640
63663
  }
@@ -64027,9 +64050,9 @@ class IntfReferencingClas {
64027
64050
  key: "intf_referencing_clas",
64028
64051
  title: "INTF referencing CLAS",
64029
64052
  shortDescription: `Interface contains references to class`,
64030
- extendedInformation: `Only global interfaces are checked.
64031
- Only first level references are checked.
64032
- Exception class references are ignored.
64053
+ extendedInformation: `Only global interfaces are checked.
64054
+ Only first level references are checked.
64055
+ Exception class references are ignored.
64033
64056
  Void references are ignored.`,
64034
64057
  };
64035
64058
  }
@@ -64114,9 +64137,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64114
64137
  title: "Invalid Table Index",
64115
64138
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64116
64139
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64117
- badExample: `DATA(first) = table[ 0 ].
64140
+ badExample: `DATA(first) = table[ 0 ].
64118
64141
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64119
- goodExample: `DATA(first) = table[ 1 ].
64142
+ goodExample: `DATA(first) = table[ 1 ].
64120
64143
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64121
64144
  };
64122
64145
  }
@@ -64717,8 +64740,8 @@ class LineBreakStyle {
64717
64740
  return {
64718
64741
  key: "line_break_style",
64719
64742
  title: "Makes sure line breaks are consistent in the ABAP code",
64720
- shortDescription: `Enforces LF as newlines in ABAP files
64721
-
64743
+ shortDescription: `Enforces LF as newlines in ABAP files
64744
+
64722
64745
  abapGit does not work with CRLF`,
64723
64746
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64724
64747
  };
@@ -64787,7 +64810,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64787
64810
  key: "line_length",
64788
64811
  title: "Line length",
64789
64812
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64790
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64813
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64791
64814
  https://docs.abapopenchecks.org/checks/04/`,
64792
64815
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64793
64816
  };
@@ -64858,7 +64881,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64858
64881
  key: "line_only_punc",
64859
64882
  title: "Line containing only punctuation",
64860
64883
  shortDescription: `Detects lines containing only punctuation.`,
64861
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64884
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64862
64885
  https://docs.abapopenchecks.org/checks/16/`,
64863
64886
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64864
64887
  badExample: "zcl_class=>method(\n).",
@@ -65121,15 +65144,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65121
65144
  return {
65122
65145
  key: "local_variable_names",
65123
65146
  title: "Local variable naming conventions",
65124
- shortDescription: `
65125
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65147
+ shortDescription: `
65148
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65126
65149
  Regexes are case-insensitive.`,
65127
65150
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65128
- badExample: `FORM bar.
65129
- DATA foo.
65151
+ badExample: `FORM bar.
65152
+ DATA foo.
65130
65153
  ENDFORM.`,
65131
- goodExample: `FORM bar.
65132
- DATA lv_foo.
65154
+ goodExample: `FORM bar.
65155
+ DATA lv_foo.
65133
65156
  ENDFORM.`,
65134
65157
  };
65135
65158
  }
@@ -65281,9 +65304,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65281
65304
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65282
65305
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65283
65306
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65284
- badExample: `DEFINE something.
65307
+ badExample: `DEFINE something.
65285
65308
  END-OF-DEFINITION.`,
65286
- goodExample: `DEFINE _something.
65309
+ goodExample: `DEFINE _something.
65287
65310
  END-OF-DEFINITION.`,
65288
65311
  };
65289
65312
  }
@@ -65356,10 +65379,10 @@ class MainFileContents {
65356
65379
  key: "main_file_contents",
65357
65380
  title: "Main file contents",
65358
65381
  shortDescription: `Checks related to report declarations.`,
65359
- extendedInformation: `Does not run if the target version is Cloud
65360
-
65361
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65362
- * TYPEs must begin with "TYPE-POOL <name>."
65382
+ extendedInformation: `Does not run if the target version is Cloud
65383
+
65384
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65385
+ * TYPEs must begin with "TYPE-POOL <name>."
65363
65386
  `,
65364
65387
  };
65365
65388
  }
@@ -65475,17 +65498,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65475
65498
  title: "Too many parentheses",
65476
65499
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65477
65500
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65478
- badExample: `
65479
- IF ( destination IS INITIAL ).
65480
- ENDIF.
65481
- IF foo = boo AND ( bar = lar AND moo = loo ).
65482
- ENDIF.
65501
+ badExample: `
65502
+ IF ( destination IS INITIAL ).
65503
+ ENDIF.
65504
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65505
+ ENDIF.
65483
65506
  `,
65484
- goodExample: `
65485
- IF destination IS INITIAL.
65486
- ENDIF.
65487
- IF foo = boo AND bar = lar AND moo = loo.
65488
- ENDIF.
65507
+ goodExample: `
65508
+ IF destination IS INITIAL.
65509
+ ENDIF.
65510
+ IF foo = boo AND bar = lar AND moo = loo.
65511
+ ENDIF.
65489
65512
  `,
65490
65513
  };
65491
65514
  }
@@ -65659,14 +65682,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65659
65682
  title: "Max one method parameter definition per line",
65660
65683
  shortDescription: `Keep max one method parameter description per line`,
65661
65684
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65662
- badExample: `
65663
- METHODS apps_scope_token
65664
- IMPORTING
65685
+ badExample: `
65686
+ METHODS apps_scope_token
65687
+ IMPORTING
65665
65688
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65666
- goodExample: `
65667
- METHODS apps_scope_token
65668
- IMPORTING
65669
- body TYPE bodyapps_scope_token
65689
+ goodExample: `
65690
+ METHODS apps_scope_token
65691
+ IMPORTING
65692
+ body TYPE bodyapps_scope_token
65670
65693
  client_id TYPE str.`,
65671
65694
  };
65672
65695
  }
@@ -65731,11 +65754,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65731
65754
  key: "max_one_statement",
65732
65755
  title: "Max one statement per line",
65733
65756
  shortDescription: `Checks that each line contains only a single statement.`,
65734
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65735
-
65736
- Does not report anything for chained statements.
65737
-
65738
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65757
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65758
+
65759
+ Does not report anything for chained statements.
65760
+
65761
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65739
65762
  https://docs.abapopenchecks.org/checks/11/`,
65740
65763
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65741
65764
  badExample: `WRITE foo. WRITE bar.`,
@@ -66073,8 +66096,8 @@ class MethodLength {
66073
66096
  key: "method_length",
66074
66097
  title: "Method/Form Length",
66075
66098
  shortDescription: `Checks relating to method/form length.`,
66076
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66077
-
66099
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66100
+
66078
66101
  Abstract methods without statements are considered okay.`,
66079
66102
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66080
66103
  };
@@ -66179,20 +66202,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66179
66202
  key: "method_overwrites_builtin",
66180
66203
  title: "Method name overwrites builtin function",
66181
66204
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66182
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66183
-
66184
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66185
-
66205
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66206
+
66207
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66208
+
66186
66209
  Interface method names are ignored`,
66187
66210
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66188
- badExample: `CLASS lcl DEFINITION.
66189
- PUBLIC SECTION.
66190
- METHODS matches.
66191
- ENDCLASS.
66192
-
66193
- CLASS lcl IMPLEMENTATION.
66194
- METHOD matches.
66195
- ENDMETHOD.
66211
+ badExample: `CLASS lcl DEFINITION.
66212
+ PUBLIC SECTION.
66213
+ METHODS matches.
66214
+ ENDCLASS.
66215
+
66216
+ CLASS lcl IMPLEMENTATION.
66217
+ METHOD matches.
66218
+ ENDMETHOD.
66196
66219
  ENDCLASS.`,
66197
66220
  };
66198
66221
  }
@@ -66383,12 +66406,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66383
66406
  // eslint-disable-next-line max-len
66384
66407
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66385
66408
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66386
- badExample: `CLASS lcl DEFINITION.
66387
- PUBLIC SECTION.
66388
- METHODS
66389
- foobar
66390
- EXPORTING foo TYPE i
66391
- RETURNING VALUE(rv_string) TYPE string.
66409
+ badExample: `CLASS lcl DEFINITION.
66410
+ PUBLIC SECTION.
66411
+ METHODS
66412
+ foobar
66413
+ EXPORTING foo TYPE i
66414
+ RETURNING VALUE(rv_string) TYPE string.
66392
66415
  ENDCLASS.`,
66393
66416
  };
66394
66417
  }
@@ -66768,7 +66791,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66768
66791
  key: "nesting",
66769
66792
  title: "Check nesting depth",
66770
66793
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66771
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66794
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66772
66795
  https://docs.abapopenchecks.org/checks/74/`,
66773
66796
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66774
66797
  };
@@ -67011,7 +67034,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67011
67034
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67012
67035
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67013
67036
  badExample: `var1 = var2 = var3.`,
67014
- goodExample: `var2 = var3.
67037
+ goodExample: `var2 = var3.
67015
67038
  var1 = var2.`,
67016
67039
  };
67017
67040
  }
@@ -67070,8 +67093,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67070
67093
  key: "no_external_form_calls",
67071
67094
  title: "No external FORM calls",
67072
67095
  shortDescription: `Detect external form calls`,
67073
- badExample: `PERFORM foo IN PROGRAM bar.
67074
-
67096
+ badExample: `PERFORM foo IN PROGRAM bar.
67097
+
67075
67098
  PERFORM foo(bar).`,
67076
67099
  tags: [_irule_1.RuleTag.SingleFile],
67077
67100
  };
@@ -67132,17 +67155,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67132
67155
  key: "no_inline_in_optional_branches",
67133
67156
  title: "Don't declare inline in optional branches",
67134
67157
  shortDescription: `Don't declare inline in optional branches`,
67135
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67136
-
67137
- Considered optional branches:
67138
- * inside IF/ELSEIF/ELSE
67139
- * inside LOOP
67140
- * inside WHILE
67141
- * inside CASE/WHEN, CASE TYPE OF
67142
- * inside DO
67143
- * inside SELECT loops
67144
-
67145
- Not considered optional branches:
67158
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67159
+
67160
+ Considered optional branches:
67161
+ * inside IF/ELSEIF/ELSE
67162
+ * inside LOOP
67163
+ * inside WHILE
67164
+ * inside CASE/WHEN, CASE TYPE OF
67165
+ * inside DO
67166
+ * inside SELECT loops
67167
+
67168
+ Not considered optional branches:
67146
67169
  * TRY/CATCH/CLEANUP`,
67147
67170
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67148
67171
  };
@@ -67242,12 +67265,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67242
67265
  key: "no_prefixes",
67243
67266
  title: "No Prefixes",
67244
67267
  shortDescription: `Dont use hungarian notation`,
67245
- extendedInformation: `
67246
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67247
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67248
-
67249
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67250
-
67268
+ extendedInformation: `
67269
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67270
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67271
+
67272
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67273
+
67251
67274
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67252
67275
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67253
67276
  badExample: `DATA lv_foo TYPE i.`,
@@ -67426,7 +67449,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67426
67449
  return {
67427
67450
  key: "no_public_attributes",
67428
67451
  title: "No public attributes",
67429
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67452
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67430
67453
  Exceptions are excluded from this rule.`,
67431
67454
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67432
67455
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67527,13 +67550,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67527
67550
  key: "no_yoda_conditions",
67528
67551
  title: "No Yoda conditions",
67529
67552
  shortDescription: `Finds Yoda conditions and reports issues`,
67530
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67531
-
67553
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67554
+
67532
67555
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67533
67556
  tags: [_irule_1.RuleTag.SingleFile],
67534
- badExample: `IF 0 <> sy-subrc.
67557
+ badExample: `IF 0 <> sy-subrc.
67535
67558
  ENDIF.`,
67536
- goodExample: `IF sy-subrc <> 0.
67559
+ goodExample: `IF sy-subrc <> 0.
67537
67560
  ENDIF.`,
67538
67561
  };
67539
67562
  }
@@ -67634,8 +67657,8 @@ class NROBConsistency {
67634
67657
  key: "nrob_consistency",
67635
67658
  title: "Number range consistency",
67636
67659
  shortDescription: `Consistency checks for number ranges`,
67637
- extendedInformation: `Issue reported if percentage warning is over 50%
67638
-
67660
+ extendedInformation: `Issue reported if percentage warning is over 50%
67661
+
67639
67662
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67640
67663
  tags: [_irule_1.RuleTag.SingleFile],
67641
67664
  };
@@ -67912,58 +67935,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67912
67935
  title: "Obsolete statements",
67913
67936
  shortDescription: `Checks for usages of certain obsolete statements`,
67914
67937
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67915
- extendedInformation: `
67916
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67917
-
67918
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67919
-
67920
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67921
-
67922
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67923
-
67924
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67925
-
67926
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67927
-
67928
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67929
-
67930
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67931
-
67932
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67933
-
67934
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67935
-
67936
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67937
-
67938
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67939
-
67940
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67941
-
67942
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67943
-
67944
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67945
- SELECT COUNT(*) is considered okay
67946
-
67947
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67948
-
67949
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67950
-
67951
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67952
-
67953
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67954
-
67955
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
67956
-
67938
+ extendedInformation: `
67939
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67940
+
67941
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67942
+
67943
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67944
+
67945
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67946
+
67947
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67948
+
67949
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67950
+
67951
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67952
+
67953
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67954
+
67955
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67956
+
67957
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67958
+
67959
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67960
+
67961
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67962
+
67963
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67964
+
67965
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67966
+
67967
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67968
+ SELECT COUNT(*) is considered okay
67969
+
67970
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67971
+
67972
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67973
+
67974
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67975
+
67976
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67977
+
67978
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
67979
+
67957
67980
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
67958
- badExample: `REFRESH itab.
67959
-
67960
- COMPUTE foo = 2 + 2.
67961
-
67962
- MULTIPLY lv_foo BY 2.
67963
-
67964
- INTERFACE intf LOAD.
67965
-
67966
- IF foo IS SUPPLIED.
67981
+ badExample: `REFRESH itab.
67982
+
67983
+ COMPUTE foo = 2 + 2.
67984
+
67985
+ MULTIPLY lv_foo BY 2.
67986
+
67987
+ INTERFACE intf LOAD.
67988
+
67989
+ IF foo IS SUPPLIED.
67967
67990
  ENDIF.`,
67968
67991
  };
67969
67992
  }
@@ -68303,9 +68326,9 @@ class OmitParameterName {
68303
68326
  key: "omit_parameter_name",
68304
68327
  title: "Omit parameter name",
68305
68328
  shortDescription: `Omit the parameter name in single parameter calls`,
68306
- extendedInformation: `
68307
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68308
-
68329
+ extendedInformation: `
68330
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68331
+
68309
68332
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68310
68333
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68311
68334
  badExample: `method( param = 2 ).`,
@@ -68511,20 +68534,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68511
68534
  shortDescription: `Omit RECEIVING`,
68512
68535
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68513
68536
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68514
- badExample: `
68515
- upload_pack(
68516
- EXPORTING
68517
- io_client = lo_client
68518
- iv_url = iv_url
68519
- iv_deepen_level = iv_deepen_level
68520
- it_hashes = lt_hashes
68521
- RECEIVING
68537
+ badExample: `
68538
+ upload_pack(
68539
+ EXPORTING
68540
+ io_client = lo_client
68541
+ iv_url = iv_url
68542
+ iv_deepen_level = iv_deepen_level
68543
+ it_hashes = lt_hashes
68544
+ RECEIVING
68522
68545
  rt_objects = et_objects ).`,
68523
- goodExample: `
68524
- et_objects = upload_pack(
68525
- io_client = lo_client
68526
- iv_url = iv_url
68527
- iv_deepen_level = iv_deepen_level
68546
+ goodExample: `
68547
+ et_objects = upload_pack(
68548
+ io_client = lo_client
68549
+ iv_url = iv_url
68550
+ iv_deepen_level = iv_deepen_level
68528
68551
  it_hashes = lt_hashes ).`,
68529
68552
  };
68530
68553
  }
@@ -68588,8 +68611,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68588
68611
  return {
68589
68612
  key: "parser_702_chaining",
68590
68613
  title: "Parser Error, bad chanining on 702",
68591
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68592
- this rule finds these and reports errors.
68614
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68615
+ this rule finds these and reports errors.
68593
68616
  Only active on target version 702 and below.`,
68594
68617
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68595
68618
  };
@@ -68669,8 +68692,8 @@ class ParserError {
68669
68692
  return {
68670
68693
  key: "parser_error",
68671
68694
  title: "Parser error",
68672
- shortDescription: `Checks for syntax not recognized by abaplint.
68673
-
68695
+ shortDescription: `Checks for syntax not recognized by abaplint.
68696
+
68674
68697
  See recognized syntax at https://syntax.abaplint.org`,
68675
68698
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68676
68699
  };
@@ -68755,7 +68778,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68755
68778
  return {
68756
68779
  key: "parser_missing_space",
68757
68780
  title: "Parser Error, missing space",
68758
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68781
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68759
68782
  This rule makes sure the spaces are consistently required across the language.`,
68760
68783
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68761
68784
  badExample: `IF ( foo = 'bar').`,
@@ -69167,25 +69190,25 @@ class PreferInline {
69167
69190
  key: "prefer_inline",
69168
69191
  title: "Prefer Inline Declarations",
69169
69192
  shortDescription: `Prefer inline to up-front declarations.`,
69170
- extendedInformation: `EXPERIMENTAL
69171
-
69172
- Activates if language version is v740sp02 or above.
69173
-
69174
- Variables must be local(METHOD or FORM).
69175
-
69176
- No generic or void typed variables. No syntax errors.
69177
-
69178
- First position used must be a full/pure write.
69179
-
69180
- Move statment is not a cast(?=)
69181
-
69193
+ extendedInformation: `EXPERIMENTAL
69194
+
69195
+ Activates if language version is v740sp02 or above.
69196
+
69197
+ Variables must be local(METHOD or FORM).
69198
+
69199
+ No generic or void typed variables. No syntax errors.
69200
+
69201
+ First position used must be a full/pure write.
69202
+
69203
+ Move statment is not a cast(?=)
69204
+
69182
69205
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69183
69206
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69184
- badExample: `DATA foo TYPE i.
69185
- foo = 2.
69186
- DATA percentage TYPE decfloat34.
69207
+ badExample: `DATA foo TYPE i.
69208
+ foo = 2.
69209
+ DATA percentage TYPE decfloat34.
69187
69210
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69188
- goodExample: `DATA(foo) = 2.
69211
+ goodExample: `DATA(foo) = 2.
69189
69212
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69190
69213
  };
69191
69214
  }
@@ -69399,18 +69422,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69399
69422
  key: "prefer_is_not",
69400
69423
  title: "Prefer IS NOT to NOT IS",
69401
69424
  shortDescription: `Prefer IS NOT to NOT IS`,
69402
- extendedInformation: `
69403
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69404
-
69425
+ extendedInformation: `
69426
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69427
+
69405
69428
  "if not is_valid( )." examples are skipped`,
69406
69429
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69407
- goodExample: `IF variable IS NOT INITIAL.
69408
- IF variable NP 'TODO*'.
69409
- IF variable <> 42.
69430
+ goodExample: `IF variable IS NOT INITIAL.
69431
+ IF variable NP 'TODO*'.
69432
+ IF variable <> 42.
69410
69433
  IF variable CO 'hello'.`,
69411
- badExample: `IF NOT variable IS INITIAL.
69412
- IF NOT variable CP 'TODO*'.
69413
- IF NOT variable = 42.
69434
+ badExample: `IF NOT variable IS INITIAL.
69435
+ IF NOT variable CP 'TODO*'.
69436
+ IF NOT variable = 42.
69414
69437
  IF NOT variable CA 'hello'.`,
69415
69438
  };
69416
69439
  }
@@ -69598,14 +69621,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69598
69621
  key: "prefer_raise_exception_new",
69599
69622
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69600
69623
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69601
- extendedInformation: `
69602
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69603
-
69624
+ extendedInformation: `
69625
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69626
+
69604
69627
  From 752 and up`,
69605
69628
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69606
69629
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69607
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69608
- EXPORTING
69630
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69631
+ EXPORTING
69609
69632
  previous = exception.`,
69610
69633
  };
69611
69634
  }
@@ -69683,12 +69706,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69683
69706
  key: "prefer_returning_to_exporting",
69684
69707
  title: "Prefer RETURNING to EXPORTING",
69685
69708
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69686
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69709
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69687
69710
  https://docs.abapopenchecks.org/checks/44/`,
69688
69711
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69689
- badExample: `CLASS lcl DEFINITION.
69690
- PUBLIC SECTION.
69691
- METHODS test EXPORTING ev_foo TYPE i.
69712
+ badExample: `CLASS lcl DEFINITION.
69713
+ PUBLIC SECTION.
69714
+ METHODS test EXPORTING ev_foo TYPE i.
69692
69715
  ENDCLASS.`,
69693
69716
  };
69694
69717
  }
@@ -69784,8 +69807,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69784
69807
  key: "prefer_xsdbool",
69785
69808
  title: "Prefer xsdbool over boolc",
69786
69809
  shortDescription: `Prefer xsdbool over boolc`,
69787
- extendedInformation: `Activates if language version is v740sp08 or above.
69788
-
69810
+ extendedInformation: `Activates if language version is v740sp08 or above.
69811
+
69789
69812
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69790
69813
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69791
69814
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69857,9 +69880,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69857
69880
  title: "Preferred compare operator",
69858
69881
  shortDescription: `Configure undesired operator variants`,
69859
69882
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69860
- badExample: `IF foo EQ bar.
69883
+ badExample: `IF foo EQ bar.
69861
69884
  ENDIF.`,
69862
- goodExample: `IF foo = bar.
69885
+ goodExample: `IF foo = bar.
69863
69886
  ENDIF.`,
69864
69887
  };
69865
69888
  }
@@ -70083,26 +70106,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70083
70106
  key: "reduce_procedural_code",
70084
70107
  title: "Reduce procedural code",
70085
70108
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70086
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70087
-
70088
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70089
-
70109
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70110
+
70111
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70112
+
70090
70113
  Comments are not counted as statements.`,
70091
70114
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70092
- badExample: `FORM foo.
70093
- DATA lv_bar TYPE i.
70094
- lv_bar = 2 + 2.
70095
- IF lv_bar = 4.
70096
- WRITE 'hello world'.
70097
- ENDIF.
70098
- DATA lv_bar TYPE i.
70099
- lv_bar = 2 + 2.
70100
- IF lv_bar = 4.
70101
- WRITE 'hello world'.
70102
- ENDIF.
70115
+ badExample: `FORM foo.
70116
+ DATA lv_bar TYPE i.
70117
+ lv_bar = 2 + 2.
70118
+ IF lv_bar = 4.
70119
+ WRITE 'hello world'.
70120
+ ENDIF.
70121
+ DATA lv_bar TYPE i.
70122
+ lv_bar = 2 + 2.
70123
+ IF lv_bar = 4.
70124
+ WRITE 'hello world'.
70125
+ ENDIF.
70103
70126
  ENDFORM.`,
70104
- goodExample: `FORM foo.
70105
- NEW zcl_global_class( )->run_logic( ).
70127
+ goodExample: `FORM foo.
70128
+ NEW zcl_global_class( )->run_logic( ).
70106
70129
  ENDFORM.`,
70107
70130
  };
70108
70131
  }
@@ -70346,10 +70369,10 @@ class RemoveDescriptions {
70346
70369
  return {
70347
70370
  key: "remove_descriptions",
70348
70371
  title: "Remove descriptions",
70349
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70350
-
70351
- Class descriptions are required, see rule description_empty.
70352
-
70372
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70373
+
70374
+ Class descriptions are required, see rule description_empty.
70375
+
70353
70376
  Consider using ABAP Doc for documentation.`,
70354
70377
  tags: [],
70355
70378
  };
@@ -70474,14 +70497,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70474
70497
  tags: [_irule_1.RuleTag.SingleFile],
70475
70498
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70476
70499
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70477
- badExample: `CALL FUNCTION 'ZRFC'
70500
+ badExample: `CALL FUNCTION 'ZRFC'
70478
70501
  DESTINATION lv_rfc.`,
70479
- goodExample: `CALL FUNCTION 'ZRFC'
70480
- DESTINATION lv_rfc
70481
- EXCEPTIONS
70482
- system_failure = 1 MESSAGE msg
70483
- communication_failure = 2 MESSAGE msg
70484
- resource_failure = 3
70502
+ goodExample: `CALL FUNCTION 'ZRFC'
70503
+ DESTINATION lv_rfc
70504
+ EXCEPTIONS
70505
+ system_failure = 1 MESSAGE msg
70506
+ communication_failure = 2 MESSAGE msg
70507
+ resource_failure = 3
70485
70508
  OTHERS = 4.`,
70486
70509
  };
70487
70510
  }
@@ -70565,11 +70588,11 @@ class SelectAddOrderBy {
70565
70588
  key: "select_add_order_by",
70566
70589
  title: "SELECT add ORDER BY",
70567
70590
  shortDescription: `SELECTs add ORDER BY clause`,
70568
- extendedInformation: `
70569
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70570
-
70571
- add ORDER BY PRIMARY KEY if in doubt
70572
-
70591
+ extendedInformation: `
70592
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70593
+
70594
+ add ORDER BY PRIMARY KEY if in doubt
70595
+
70573
70596
  If the target is a sorted/hashed table, no issue is reported`,
70574
70597
  tags: [_irule_1.RuleTag.SingleFile],
70575
70598
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70700,14 +70723,14 @@ class SelectPerformance {
70700
70723
  key: "select_performance",
70701
70724
  title: "SELECT performance",
70702
70725
  shortDescription: `Various checks regarding SELECT performance.`,
70703
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70704
-
70726
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70727
+
70705
70728
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70706
70729
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70707
- badExample: `SELECT field1, field2 FROM table
70708
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70730
+ badExample: `SELECT field1, field2 FROM table
70731
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70709
70732
  ENDSELECT.`,
70710
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70733
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70711
70734
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70712
70735
  };
70713
70736
  }
@@ -70821,8 +70844,8 @@ class SelectSingleFullKey {
70821
70844
  key: "select_single_full_key",
70822
70845
  title: "Detect SELECT SINGLE which are possibily not unique",
70823
70846
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70824
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70825
-
70847
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70848
+
70826
70849
  If the statement contains a JOIN it is not checked`,
70827
70850
  pseudoComment: "EC CI_NOORDER",
70828
70851
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71246,8 +71269,8 @@ class SICFConsistency {
71246
71269
  key: "sicf_consistency",
71247
71270
  title: "SICF consistency",
71248
71271
  shortDescription: `Checks the validity of ICF services`,
71249
- extendedInformation: `* Class defined in handler must exist
71250
- * Class must not have any syntax errors
71272
+ extendedInformation: `* Class defined in handler must exist
71273
+ * Class must not have any syntax errors
71251
71274
  * Class must implement interface IF_HTTP_EXTENSION`,
71252
71275
  };
71253
71276
  }
@@ -71359,23 +71382,23 @@ class SlowParameterPassing {
71359
71382
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71360
71383
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71361
71384
  tags: [_irule_1.RuleTag.Performance],
71362
- badExample: `CLASS lcl DEFINITION.
71363
- PUBLIC SECTION.
71364
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71365
- ENDCLASS.
71366
- CLASS lcl IMPLEMENTATION.
71367
- METHOD bar.
71368
- WRITE sdf.
71369
- ENDMETHOD.
71385
+ badExample: `CLASS lcl DEFINITION.
71386
+ PUBLIC SECTION.
71387
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71388
+ ENDCLASS.
71389
+ CLASS lcl IMPLEMENTATION.
71390
+ METHOD bar.
71391
+ WRITE sdf.
71392
+ ENDMETHOD.
71370
71393
  ENDCLASS.`,
71371
- goodExample: `CLASS lcl DEFINITION.
71372
- PUBLIC SECTION.
71373
- METHODS bar IMPORTING sdf TYPE string.
71374
- ENDCLASS.
71375
- CLASS lcl IMPLEMENTATION.
71376
- METHOD bar.
71377
- WRITE sdf.
71378
- ENDMETHOD.
71394
+ goodExample: `CLASS lcl DEFINITION.
71395
+ PUBLIC SECTION.
71396
+ METHODS bar IMPORTING sdf TYPE string.
71397
+ ENDCLASS.
71398
+ CLASS lcl IMPLEMENTATION.
71399
+ METHOD bar.
71400
+ WRITE sdf.
71401
+ ENDMETHOD.
71379
71402
  ENDCLASS.`,
71380
71403
  };
71381
71404
  }
@@ -71632,8 +71655,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71632
71655
  key: "space_before_dot",
71633
71656
  title: "Space before dot",
71634
71657
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71635
- extendedInformation: `
71636
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71658
+ extendedInformation: `
71659
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71637
71660
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71638
71661
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71639
71662
  badExample: `WRITE bar .`,
@@ -71819,12 +71842,12 @@ class SQLValueConversion {
71819
71842
  key: "sql_value_conversion",
71820
71843
  title: "Implicit SQL Value Conversion",
71821
71844
  shortDescription: `Ensure types match when selecting from database`,
71822
- extendedInformation: `
71823
- * Integer to CHAR conversion
71824
- * Integer to NUMC conversion
71825
- * NUMC to Integer conversion
71826
- * CHAR to Integer conversion
71827
- * Source field longer than database field, CHAR -> CHAR
71845
+ extendedInformation: `
71846
+ * Integer to CHAR conversion
71847
+ * Integer to NUMC conversion
71848
+ * NUMC to Integer conversion
71849
+ * CHAR to Integer conversion
71850
+ * Source field longer than database field, CHAR -> CHAR
71828
71851
  * Source field longer than database field, NUMC -> NUMC`,
71829
71852
  tags: [],
71830
71853
  };
@@ -71896,7 +71919,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71896
71919
  key: "start_at_tab",
71897
71920
  title: "Start at tab",
71898
71921
  shortDescription: `Checks that statements start at tabstops.`,
71899
- extendedInformation: `Reports max 100 issues per file
71922
+ extendedInformation: `Reports max 100 issues per file
71900
71923
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71901
71924
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71902
71925
  badExample: ` WRITE a.`,
@@ -72073,12 +72096,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72073
72096
  key: "strict_sql",
72074
72097
  title: "Strict SQL",
72075
72098
  shortDescription: `Strict SQL`,
72076
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72077
-
72078
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72079
-
72080
- Also see separate rule sql_escape_host_variables
72081
-
72099
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72100
+
72101
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72102
+
72103
+ Also see separate rule sql_escape_host_variables
72104
+
72082
72105
  Activates from v750 and up`,
72083
72106
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72084
72107
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72332,11 +72355,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72332
72355
  key: "sy_modification",
72333
72356
  title: "Modification of SY fields",
72334
72357
  shortDescription: `Finds modification of sy fields`,
72335
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72336
-
72358
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72359
+
72337
72360
  Changes to SY-TVAR* fields are not reported`,
72338
72361
  tags: [_irule_1.RuleTag.SingleFile],
72339
- badExample: `sy-uname = 2.
72362
+ badExample: `sy-uname = 2.
72340
72363
  sy = sy.`,
72341
72364
  };
72342
72365
  }
@@ -72398,8 +72421,8 @@ class TABLEnhancementCategory {
72398
72421
  key: "tabl_enhancement_category",
72399
72422
  title: "TABL enhancement category must be set",
72400
72423
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72401
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72402
-
72424
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72425
+
72403
72426
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72404
72427
  tags: [],
72405
72428
  };
@@ -72464,8 +72487,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72464
72487
  shortDescription: `TABLES are always global, so declare them globally`,
72465
72488
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72466
72489
  tags: [_irule_1.RuleTag.SingleFile],
72467
- badExample: `FORM foo.
72468
- TABLES t100.
72490
+ badExample: `FORM foo.
72491
+ TABLES t100.
72469
72492
  ENDFORM.`,
72470
72493
  goodExample: `TABLES t000.`,
72471
72494
  };
@@ -72593,9 +72616,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72593
72616
  title: "Type FORM parameters",
72594
72617
  shortDescription: `Checks for untyped FORM parameters`,
72595
72618
  tags: [_irule_1.RuleTag.SingleFile],
72596
- badExample: `FORM foo USING bar.
72619
+ badExample: `FORM foo USING bar.
72597
72620
  ENDFORM.`,
72598
- goodExample: `FORM foo USING bar TYPE string.
72621
+ goodExample: `FORM foo USING bar TYPE string.
72599
72622
  ENDFORM.`,
72600
72623
  };
72601
72624
  }
@@ -73268,38 +73291,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73268
73291
  key: "unnecessary_pragma",
73269
73292
  title: "Unnecessary Pragma",
73270
73293
  shortDescription: `Finds pragmas which can be removed`,
73271
- extendedInformation: `* NO_HANDLER with handler
73272
-
73273
- * NEEDED without definition
73274
-
73275
- * NO_TEXT without texts
73276
-
73277
- * SUBRC_OK where sy-subrc is checked
73278
-
73294
+ extendedInformation: `* NO_HANDLER with handler
73295
+
73296
+ * NEEDED without definition
73297
+
73298
+ * NO_TEXT without texts
73299
+
73300
+ * SUBRC_OK where sy-subrc is checked
73301
+
73279
73302
  NO_HANDLER inside macros are not checked`,
73280
73303
  tags: [_irule_1.RuleTag.SingleFile],
73281
- badExample: `TRY.
73282
- ...
73283
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73284
- RETURN. " it has a handler
73285
- ENDTRY.
73286
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73287
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73288
- IF sy-subrc <> 0.
73304
+ badExample: `TRY.
73305
+ ...
73306
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73307
+ RETURN. " it has a handler
73308
+ ENDTRY.
73309
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73310
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73311
+ IF sy-subrc <> 0.
73289
73312
  ENDIF.`,
73290
- goodExample: `TRY.
73291
- ...
73292
- CATCH zcx_abapgit_exception.
73293
- RETURN.
73294
- ENDTRY.
73295
- MESSAGE w125(zbar) WITH c_foo INTO message.
73296
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73297
- IF sy-subrc <> 0.
73298
- ENDIF.
73299
-
73300
- DATA: BEGIN OF blah ##NEEDED,
73301
- test1 TYPE string,
73302
- test2 TYPE string,
73313
+ goodExample: `TRY.
73314
+ ...
73315
+ CATCH zcx_abapgit_exception.
73316
+ RETURN.
73317
+ ENDTRY.
73318
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73319
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73320
+ IF sy-subrc <> 0.
73321
+ ENDIF.
73322
+
73323
+ DATA: BEGIN OF blah ##NEEDED,
73324
+ test1 TYPE string,
73325
+ test2 TYPE string,
73303
73326
  END OF blah.`,
73304
73327
  };
73305
73328
  }
@@ -73466,18 +73489,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73466
73489
  shortDescription: `Finds unnecessary RETURN statements`,
73467
73490
  extendedInformation: `Finds unnecessary RETURN statements`,
73468
73491
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73469
- badExample: `FORM hello1.
73470
- WRITE 'world'.
73471
- RETURN.
73472
- ENDFORM.
73473
-
73474
- FORM foo.
73475
- IF 1 = 2.
73476
- RETURN.
73477
- ENDIF.
73492
+ badExample: `FORM hello1.
73493
+ WRITE 'world'.
73494
+ RETURN.
73495
+ ENDFORM.
73496
+
73497
+ FORM foo.
73498
+ IF 1 = 2.
73499
+ RETURN.
73500
+ ENDIF.
73478
73501
  ENDFORM.`,
73479
- goodExample: `FORM hello2.
73480
- WRITE 'world'.
73502
+ goodExample: `FORM hello2.
73503
+ WRITE 'world'.
73481
73504
  ENDFORM.`,
73482
73505
  };
73483
73506
  }
@@ -73828,13 +73851,13 @@ class UnusedMacros {
73828
73851
  title: "Unused macros",
73829
73852
  shortDescription: `Checks for unused macro definitions definitions`,
73830
73853
  tags: [_irule_1.RuleTag.Quickfix],
73831
- badExample: `DEFINE foobar1.
73832
- WRITE 'hello'.
73854
+ badExample: `DEFINE foobar1.
73855
+ WRITE 'hello'.
73833
73856
  END-OF-DEFINITION.`,
73834
- goodExample: `DEFINE foobar2.
73835
- WRITE 'hello'.
73836
- END-OF-DEFINITION.
73837
-
73857
+ goodExample: `DEFINE foobar2.
73858
+ WRITE 'hello'.
73859
+ END-OF-DEFINITION.
73860
+
73838
73861
  foobar2.`,
73839
73862
  };
73840
73863
  }
@@ -73889,6 +73912,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
73889
73912
  exports.UnusedMethods = exports.UnusedMethodsConf = void 0;
73890
73913
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
73891
73914
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
73915
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
73892
73916
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
73893
73917
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
73894
73918
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
@@ -73897,6 +73921,8 @@ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./n
73897
73921
  const visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
73898
73922
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
73899
73923
  const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
73924
+ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
73925
+ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
73900
73926
  class UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
73901
73927
  }
73902
73928
  exports.UnusedMethodsConf = UnusedMethodsConf;
@@ -73909,6 +73935,7 @@ class WorkArea {
73909
73935
  this.list.push(id);
73910
73936
  }
73911
73937
  removeIfExists(id) {
73938
+ // todo: optimize
73912
73939
  for (let i = 0; i < this.list.length; i++) {
73913
73940
  if (id.equals(this.list[i].identifier)) {
73914
73941
  this.list.splice(i, 1);
@@ -73942,19 +73969,19 @@ class UnusedMethods {
73942
73969
  key: "unused_methods",
73943
73970
  title: "Unused methods",
73944
73971
  shortDescription: `Checks for unused methods`,
73945
- extendedInformation: `Checks private and protected methods.
73946
-
73947
- Unused methods are not reported if the object contains parser or syntax errors.
73948
-
73949
- Skips:
73950
- * methods FOR TESTING
73951
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73952
- * class_constructor + constructor methods
73953
- * event handlers
73954
- * methods that are redefined
73955
- * INCLUDEs
73972
+ extendedInformation: `Checks private and protected methods.
73973
+
73974
+ Unused methods are not reported if the object contains parser or syntax errors.
73975
+
73976
+ Skips:
73977
+ * methods FOR TESTING
73978
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73979
+ * class_constructor + constructor methods
73980
+ * event handlers
73981
+ * methods that are redefined
73982
+ * INCLUDEs
73956
73983
  `,
73957
- tags: [],
73984
+ tags: [_irule_1.RuleTag.Quickfix],
73958
73985
  pragma: "##CALLED",
73959
73986
  pseudoComment: "EC CALLED",
73960
73987
  };
@@ -74036,11 +74063,33 @@ Skips:
74036
74063
  else if (this.suppressedbyPseudo(statement, file)) {
74037
74064
  continue;
74038
74065
  }
74066
+ const implementation = this.findMethodImplementation(i, file);
74067
+ let fix = undefined;
74068
+ if (implementation !== undefined) {
74069
+ const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);
74070
+ const fix2 = edit_helper_1.EditHelper.deleteRange(file, implementation.getFirstToken().getStart(), implementation.getLastToken().getEnd());
74071
+ fix = edit_helper_1.EditHelper.merge(fix1, fix2);
74072
+ }
74039
74073
  const message = "Method \"" + i.identifier.getName() + "\" not used";
74040
- issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));
74074
+ issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity, fix));
74041
74075
  }
74042
74076
  return issues;
74043
74077
  }
74078
+ findMethodImplementation(method, file) {
74079
+ var _a, _b;
74080
+ for (const classImplementation of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStructures(Structures.ClassImplementation)) || []) {
74081
+ // todo, this will break if there are class implemtations with the same method names
74082
+ // const className = classImplementation.findFirstExpression(Expressions.ClassName)?.concatTokens().toUpperCase();
74083
+ for (const methodImplementation of classImplementation.findAllStructures(Structures.Method)) {
74084
+ const methodName = ((_b = methodImplementation.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) || "";
74085
+ if (methodName !== method.name.toUpperCase()) {
74086
+ continue;
74087
+ }
74088
+ return methodImplementation;
74089
+ }
74090
+ }
74091
+ return undefined;
74092
+ }
74044
74093
  suppressedbyPseudo(statement, file) {
74045
74094
  if (statement === undefined) {
74046
74095
  return false;
@@ -74386,23 +74435,23 @@ class UnusedVariables {
74386
74435
  key: "unused_variables",
74387
74436
  title: "Unused variables",
74388
74437
  shortDescription: `Checks for unused variables and constants`,
74389
- extendedInformation: `Skips event parameters.
74390
-
74391
- Note that this currently does not work if the source code uses macros.
74392
-
74393
- Unused variables are not reported if the object contains parser or syntax errors.
74394
-
74438
+ extendedInformation: `Skips event parameters.
74439
+
74440
+ Note that this currently does not work if the source code uses macros.
74441
+
74442
+ Unused variables are not reported if the object contains parser or syntax errors.
74443
+
74395
74444
  Errors found in INCLUDES are reported for the main program.`,
74396
74445
  tags: [_irule_1.RuleTag.Quickfix],
74397
74446
  pragma: "##NEEDED",
74398
74447
  pseudoComment: "EC NEEDED",
74399
- badExample: `DATA: BEGIN OF blah1,
74400
- test TYPE string,
74401
- test2 TYPE string,
74448
+ badExample: `DATA: BEGIN OF blah1,
74449
+ test TYPE string,
74450
+ test2 TYPE string,
74402
74451
  END OF blah1.`,
74403
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74404
- test TYPE string,
74405
- test2 TYPE string,
74452
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74453
+ test TYPE string,
74454
+ test2 TYPE string,
74406
74455
  END OF blah2.`,
74407
74456
  };
74408
74457
  }
@@ -74621,15 +74670,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74621
74670
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74622
74671
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74623
74672
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74624
- badExample: `IF line IS INITIAL.
74625
- has_entries = abap_false.
74626
- ELSE.
74627
- has_entries = abap_true.
74628
- ENDIF.
74629
-
74673
+ badExample: `IF line IS INITIAL.
74674
+ has_entries = abap_false.
74675
+ ELSE.
74676
+ has_entries = abap_true.
74677
+ ENDIF.
74678
+
74630
74679
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74631
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74632
-
74680
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74681
+
74633
74682
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74634
74683
  };
74635
74684
  }
@@ -74747,15 +74796,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74747
74796
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74748
74797
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74749
74798
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74750
- badExample: `INTERFACE lif.
74751
- METHODS load_data
74752
- EXCEPTIONS
74753
- invalid_parameter.
74799
+ badExample: `INTERFACE lif.
74800
+ METHODS load_data
74801
+ EXCEPTIONS
74802
+ invalid_parameter.
74754
74803
  ENDINTERFACE.`,
74755
- goodExample: `INTERFACE lif.
74756
- METHODS load_data
74757
- RAISING
74758
- cx_something.
74804
+ goodExample: `INTERFACE lif.
74805
+ METHODS load_data
74806
+ RAISING
74807
+ cx_something.
74759
74808
  ENDINTERFACE.`,
74760
74809
  };
74761
74810
  }
@@ -74815,15 +74864,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74815
74864
  key: "use_line_exists",
74816
74865
  title: "Use line_exists",
74817
74866
  shortDescription: `Use line_exists, from 740sp02 and up`,
74818
- extendedInformation: `
74819
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74820
-
74867
+ extendedInformation: `
74868
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74869
+
74821
74870
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74822
74871
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74823
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74824
- IF sy-subrc = 0.
74872
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74873
+ IF sy-subrc = 0.
74825
74874
  ENDIF.`,
74826
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74875
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74827
74876
  ENDIF.`,
74828
74877
  };
74829
74878
  }
@@ -74933,10 +74982,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
74933
74982
  key: "use_new",
74934
74983
  title: "Use NEW",
74935
74984
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
74936
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74937
-
74938
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74939
-
74985
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74986
+
74987
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74988
+
74940
74989
  Applicable from v740sp02 and up`,
74941
74990
  badExample: `CREATE OBJECT ref.`,
74942
74991
  goodExample: `ref = NEW #( ).`,
@@ -75034,13 +75083,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75034
75083
  title: "WHEN OTHERS last",
75035
75084
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75036
75085
  tags: [_irule_1.RuleTag.SingleFile],
75037
- badExample: `CASE bar.
75038
- WHEN OTHERS.
75039
- WHEN 2.
75086
+ badExample: `CASE bar.
75087
+ WHEN OTHERS.
75088
+ WHEN 2.
75040
75089
  ENDCASE.`,
75041
- goodExample: `CASE bar.
75042
- WHEN 2.
75043
- WHEN OTHERS.
75090
+ goodExample: `CASE bar.
75091
+ WHEN 2.
75092
+ WHEN OTHERS.
75044
75093
  ENDCASE.`,
75045
75094
  };
75046
75095
  }