@abaplint/cli 2.113.9 → 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 +871 -841
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -35150,13 +35150,13 @@ class FlowGraph {
35150
35150
  this.label = label;
35151
35151
  }
35152
35152
  toDigraph() {
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()}
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()}
35160
35160
  }`;
35161
35161
  }
35162
35162
  listSources(node) {
@@ -43406,13 +43406,13 @@ class Help {
43406
43406
  /////////////////////////////////////////////////
43407
43407
  static dumpABAP(file, reg, textDocument, position) {
43408
43408
  let content = "";
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>
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>
43416
43416
  ` +
43417
43417
  "<tt>" + textDocument.uri + " (" +
43418
43418
  (position.line + 1) + ", " +
@@ -52732,7 +52732,7 @@ class Registry {
52732
52732
  }
52733
52733
  static abaplintVersion() {
52734
52734
  // magic, see build script "version.sh"
52735
- return "2.113.9";
52735
+ return "2.113.10";
52736
52736
  }
52737
52737
  getDDICReferences() {
52738
52738
  return this.ddicReferences;
@@ -53051,10 +53051,10 @@ class SevenBitAscii {
53051
53051
  key: "7bit_ascii",
53052
53052
  title: "Check for 7bit ascii",
53053
53053
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
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
-
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
+
53058
53058
  Checkes files with extensions ".abap" and ".asddls"`,
53059
53059
  tags: [_irule_1.RuleTag.SingleFile],
53060
53060
  badExample: `WRITE '뽑'.`,
@@ -53260,10 +53260,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53260
53260
  key: "abapdoc",
53261
53261
  title: "Check abapdoc",
53262
53262
  shortDescription: `Various checks regarding abapdoc.`,
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
-
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
+
53267
53267
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53268
53268
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53269
53269
  };
@@ -53400,27 +53400,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53400
53400
  title: "Add test attributes for tests classes with test methods",
53401
53401
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53402
53402
  tags: [_irule_1.RuleTag.SingleFile],
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.
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.
53413
53413
  ENDCLASS.`,
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.
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.
53424
53424
  ENDCLASS.`,
53425
53425
  };
53426
53426
  }
@@ -53506,49 +53506,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53506
53506
  key: "align_parameters",
53507
53507
  title: "Align Parameters",
53508
53508
  shortDescription: `Checks for vertially aligned parameters`,
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
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
53523
53523
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53524
53524
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
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
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
53535
53535
  moo = 2 ).`,
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
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
53552
53552
  value_foo = 5 ) ).`,
53553
53553
  };
53554
53554
  }
@@ -53982,37 +53982,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
53982
53982
  key: "align_type_expressions",
53983
53983
  title: "Align TYPE expressions",
53984
53984
  shortDescription: `Align TYPE expressions in statements`,
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:
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:
53991
53991
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
53992
53992
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
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.
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.
54004
54004
  ENDINTERFACE.`,
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.
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.
54016
54016
  ENDINTERFACE.`,
54017
54017
  };
54018
54018
  }
@@ -54291,16 +54291,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54291
54291
  return {
54292
54292
  key: "ambiguous_statement",
54293
54293
  title: "Check for ambigious statements",
54294
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54295
- Add "TABLE" keyword or "@" for escaping SQL variables
54296
-
54294
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54295
+ Add "TABLE" keyword or "@" for escaping SQL variables
54296
+
54297
54297
  Only works if the target version is 740sp05 or above`,
54298
54298
  tags: [_irule_1.RuleTag.SingleFile],
54299
- badExample: `DELETE foo FROM bar.
54299
+ badExample: `DELETE foo FROM bar.
54300
54300
  MODIFY foo FROM bar.`,
54301
- goodExample: `DELETE foo FROM @bar.
54302
- DELETE TABLE itab FROM 2.
54303
- MODIFY zfoo FROM @wa.
54301
+ goodExample: `DELETE foo FROM @bar.
54302
+ DELETE TABLE itab FROM 2.
54303
+ MODIFY zfoo FROM @wa.
54304
54304
  MODIFY TABLE foo FROM bar.`,
54305
54305
  };
54306
54306
  }
@@ -54405,16 +54405,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54405
54405
  key: "avoid_use",
54406
54406
  title: "Avoid use of certain statements",
54407
54407
  shortDescription: `Detects usage of certain statements.`,
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
-
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
+
54418
54418
  BREAK points`,
54419
54419
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54420
54420
  };
@@ -54546,11 +54546,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54546
54546
  title: "Check BEGIN END names",
54547
54547
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54548
54548
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54549
- badExample: `DATA: BEGIN OF stru,
54550
- field TYPE i,
54549
+ badExample: `DATA: BEGIN OF stru,
54550
+ field TYPE i,
54551
54551
  END OF structure_not_the_same.`,
54552
- goodExample: `DATA: BEGIN OF stru,
54553
- field TYPE i,
54552
+ goodExample: `DATA: BEGIN OF stru,
54553
+ field TYPE i,
54554
54554
  END OF stru.`,
54555
54555
  };
54556
54556
  }
@@ -54647,20 +54647,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54647
54647
  title: "BEGIN contains single INCLUDE",
54648
54648
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54649
54649
  tags: [_irule_1.RuleTag.SingleFile],
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.
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.
54660
54660
  STATICS END OF bar.`,
54661
- goodExample: `DATA BEGIN OF foo.
54662
- DATA field TYPE i.
54663
- INCLUDE STRUCTURE dselc.
54661
+ goodExample: `DATA BEGIN OF foo.
54662
+ DATA field TYPE i.
54663
+ INCLUDE STRUCTURE dselc.
54664
54664
  DATA END OF foo.`,
54665
54665
  };
54666
54666
  }
@@ -54750,9 +54750,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54750
54750
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54751
54751
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54752
54752
  badExample: `CALL TRANSACTION 'FOO'.`,
54753
- goodExample: `TRY.
54754
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54755
- CATCH cx_sy_authorization_error.
54753
+ goodExample: `TRY.
54754
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54755
+ CATCH cx_sy_authorization_error.
54756
54756
  ENDTRY.`,
54757
54757
  };
54758
54758
  }
@@ -54817,10 +54817,10 @@ class CDSCommentStyle {
54817
54817
  key: "cds_comment_style",
54818
54818
  title: "CDS Comment Style",
54819
54819
  shortDescription: `Check for obsolete comment style`,
54820
- extendedInformation: `Check for obsolete comment style
54821
-
54822
- Comments starting with "--" are considered obsolete
54823
-
54820
+ extendedInformation: `Check for obsolete comment style
54821
+
54822
+ Comments starting with "--" are considered obsolete
54823
+
54824
54824
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54825
54825
  tags: [_irule_1.RuleTag.SingleFile],
54826
54826
  badExample: "-- this is a comment",
@@ -54886,10 +54886,10 @@ class CDSLegacyView {
54886
54886
  key: "cds_legacy_view",
54887
54887
  title: "CDS Legacy View",
54888
54888
  shortDescription: `Identify CDS Legacy Views`,
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
-
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
+
54893
54893
  v755 and up`,
54894
54894
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54895
54895
  };
@@ -55044,10 +55044,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55044
55044
  key: "chain_mainly_declarations",
55045
55045
  title: "Chain mainly declarations",
55046
55046
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
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
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
55051
55051
  `,
55052
55052
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55053
55053
  badExample: `CALL METHOD: bar.`,
@@ -55223,17 +55223,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55223
55223
  title: "Change IF to CASE",
55224
55224
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55225
55225
  // eslint-disable-next-line max-len
55226
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55227
-
55226
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55227
+
55228
55228
  If the first comparison is a boolean compare, no issue is reported.`,
55229
55229
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55230
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55231
- ELSEIF l_fcat-fieldname = 'BAR'
55232
- 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'.
55233
55233
  ENDIF.`,
55234
- goodExample: `CASE l_fcat-fieldname.
55235
- WHEN 'FOO'.
55236
- WHEN 'BAR' OR 'MOO'.
55234
+ goodExample: `CASE l_fcat-fieldname.
55235
+ WHEN 'FOO'.
55236
+ WHEN 'BAR' OR 'MOO'.
55237
55237
  ENDCASE.`,
55238
55238
  };
55239
55239
  }
@@ -55370,8 +55370,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55370
55370
  return {
55371
55371
  key: "check_abstract",
55372
55372
  title: "Check abstract methods and classes",
55373
- shortDescription: `Checks abstract methods and classes:
55374
- - class defined as abstract and final,
55373
+ shortDescription: `Checks abstract methods and classes:
55374
+ - class defined as abstract and final,
55375
55375
  - non-abstract class contains abstract methods`,
55376
55376
  extendedInformation: `If a class defines only constants, use an interface instead`,
55377
55377
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55452,11 +55452,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55452
55452
  return {
55453
55453
  key: "check_comments",
55454
55454
  title: "Check Comments",
55455
- shortDescription: `
55455
+ shortDescription: `
55456
55456
  Various checks for comment usage.`,
55457
- extendedInformation: `
55458
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55459
-
55457
+ extendedInformation: `
55458
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55459
+
55460
55460
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55461
55461
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55462
55462
  badExample: `WRITE 2. " descriptive comment`,
@@ -55618,9 +55618,9 @@ class CheckInclude {
55618
55618
  key: "check_include",
55619
55619
  title: "Check INCLUDEs",
55620
55620
  shortDescription: `Checks INCLUDE statements`,
55621
- extendedInformation: `
55622
- * Reports unused includes
55623
- * Errors if the includes are not found
55621
+ extendedInformation: `
55622
+ * Reports unused includes
55623
+ * Errors if the includes are not found
55624
55624
  * Error if including a main program`,
55625
55625
  tags: [_irule_1.RuleTag.Syntax],
55626
55626
  };
@@ -55696,14 +55696,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55696
55696
  key: "check_subrc",
55697
55697
  title: "Check sy-subrc",
55698
55698
  shortDescription: `Check sy-subrc`,
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
-
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
+
55707
55707
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55708
55708
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55709
55709
  pseudoComment: "EC CI_SUBRC",
@@ -56273,17 +56273,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56273
56273
  shortDescription: `Find overlapping classic exceptions`,
56274
56274
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56275
56275
  tags: [_irule_1.RuleTag.SingleFile],
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
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
56281
56281
  OTHERS = 1.`,
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
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
56287
56287
  OTHERS = 4.`,
56288
56288
  };
56289
56289
  }
@@ -56529,7 +56529,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56529
56529
  key: "commented_code",
56530
56530
  title: "Find commented code",
56531
56531
  shortDescription: `Detects usage of commented out code.`,
56532
- 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
56533
56533
  https://docs.abapopenchecks.org/checks/14/`,
56534
56534
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56535
56535
  badExample: `* WRITE 'hello world'.`,
@@ -56762,10 +56762,10 @@ class ConstructorVisibilityPublic {
56762
56762
  key: "constructor_visibility_public",
56763
56763
  title: "Check constructor visibility is public",
56764
56764
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE 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
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
56769
56769
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56770
56770
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56771
56771
  };
@@ -56840,8 +56840,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56840
56840
  key: "contains_tab",
56841
56841
  title: "Code contains tab",
56842
56842
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56843
- extendedInformation: `
56844
- https://docs.abapopenchecks.org/checks/09/
56843
+ extendedInformation: `
56844
+ https://docs.abapopenchecks.org/checks/09/
56845
56845
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56846
56846
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56847
56847
  badExample: `\tWRITE 'hello world'.`,
@@ -56928,10 +56928,10 @@ class CyclicOO {
56928
56928
  key: "cyclic_oo",
56929
56929
  title: "Cyclic OO",
56930
56930
  shortDescription: `Finds cyclic/circular OO references`,
56931
- extendedInformation: `Runs for global INTF + CLAS objects
56932
-
56933
- Objects must be without syntax errors for this rule to take effect
56934
-
56931
+ extendedInformation: `Runs for global INTF + CLAS objects
56932
+
56933
+ Objects must be without syntax errors for this rule to take effect
56934
+
56935
56935
  References in testclass includes are ignored`,
56936
56936
  };
56937
56937
  }
@@ -57156,6 +57156,7 @@ class DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {
57156
57156
  this.generateSubroutine = true;
57157
57157
  this.deleteReport = true;
57158
57158
  this.deleteTextpool = true;
57159
+ this.insertTextpool = true;
57159
57160
  this.deleteDynpro = true;
57160
57161
  this.exportDynpro = true;
57161
57162
  /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */
@@ -57173,7 +57174,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57173
57174
  key: "dangerous_statement",
57174
57175
  title: "Dangerous statement",
57175
57176
  shortDescription: `Detects potentially dangerous statements`,
57176
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57177
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57177
57178
  dynamic SQL can potentially create SQL injection problems`,
57178
57179
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57179
57180
  };
@@ -57219,6 +57220,9 @@ dynamic SQL can potentially create SQL injection problems`,
57219
57220
  else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {
57220
57221
  message = "DELETE TEXTPOOL";
57221
57222
  }
57223
+ else if (this.conf.insertTextpool && statement instanceof Statements.InsertTextpool) {
57224
+ message = "INSERT TEXTPOOL";
57225
+ }
57222
57226
  else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {
57223
57227
  message = "DELETE DYNPRO";
57224
57228
  }
@@ -57377,13 +57381,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57377
57381
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57378
57382
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57379
57383
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57380
- badExample: `FROM foo.
57381
- WRITE 'hello'.
57382
- DATA int TYPE i.
57384
+ badExample: `FROM foo.
57385
+ WRITE 'hello'.
57386
+ DATA int TYPE i.
57383
57387
  ENDFORM.`,
57384
- goodExample: `FROM foo.
57385
- DATA int TYPE i.
57386
- WRITE 'hello'.
57388
+ goodExample: `FROM foo.
57389
+ DATA int TYPE i.
57390
+ WRITE 'hello'.
57387
57391
  ENDFORM.`,
57388
57392
  };
57389
57393
  }
@@ -57922,39 +57926,39 @@ class Downport {
57922
57926
  key: "downport",
57923
57927
  title: "Downport statement",
57924
57928
  shortDescription: `Downport functionality`,
57925
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57926
- a higher level language version. If successful, various rules are applied to downport the statement.
57927
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57928
-
57929
- Current rules:
57930
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57931
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57932
- * FIELD-SYMBOL() definitions are outlined
57933
- * CONV is outlined
57934
- * COND is outlined
57935
- * REDUCE is outlined
57936
- * SWITCH is outlined
57937
- * FILTER is outlined
57938
- * APPEND expression is outlined
57939
- * INSERT expression is outlined
57940
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57941
- * CAST changed to ?=
57942
- * LOOP AT method_call( ) is outlined
57943
- * VALUE # with structure fields
57944
- * VALUE # with internal table lines
57945
- * Table Expressions are outlined
57946
- * SELECT INTO @DATA definitions are outlined
57947
- * Some occurrences of string template formatting option ALPHA changed to function module call
57948
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57949
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57950
- * RAISE EXCEPTION ... MESSAGE
57951
- * Moving with +=, -=, /=, *=, &&= is expanded
57952
- * line_exists and line_index is downported to READ TABLE
57953
- * ENUMs, but does not nessesarily give the correct type and value
57954
- * MESSAGE with non simple source
57955
-
57956
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57957
-
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
+
57958
57962
  Make sure to test the downported code, it might not always be completely correct.`,
57959
57963
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57960
57964
  };
@@ -58532,10 +58536,10 @@ Make sure to test the downported code, it might not always be completely correct
58532
58536
  const fieldName = f.concatTokens();
58533
58537
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58534
58538
  }
58535
- fieldDefinition = `DATA: BEGIN OF ${name},
58539
+ fieldDefinition = `DATA: BEGIN OF ${name},
58536
58540
  ${fieldDefinition}${indentation} END OF ${name}.`;
58537
58541
  }
58538
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58542
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58539
58543
  ${indentation}`);
58540
58544
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58541
58545
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58579,12 +58583,12 @@ ${indentation}`);
58579
58583
  }
58580
58584
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58581
58585
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
58582
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58583
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58584
- ${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.
58585
58589
  ${indentation}`);
58586
58590
  if (fieldDefinitions === "") {
58587
- 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.
58588
58592
  ${indentation}`);
58589
58593
  }
58590
58594
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58652,7 +58656,7 @@ ${indentation}`);
58652
58656
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58653
58657
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58654
58658
  const firstToken = high.getFirstToken();
58655
- 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()}.
58656
58660
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58657
58661
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58658
58662
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58706,7 +58710,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58706
58710
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58707
58711
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58708
58712
  const firstToken = high.getFirstToken();
58709
- 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()}.
58710
58714
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58711
58715
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58712
58716
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58748,14 +58752,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58748
58752
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58749
58753
  const firstToken = high.getFirstToken();
58750
58754
  // note that the tabix restore should be done before throwing the exception
58751
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58752
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58753
- ${indentation}${tabixBackup} = sy-tabix.
58754
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58755
- ${indentation}sy-tabix = ${tabixBackup}.
58756
- ${indentation}IF sy-subrc <> 0.
58757
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58758
- ${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.
58759
58763
  ${indentation}`);
58760
58764
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58761
58765
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58812,7 +58816,7 @@ ${indentation}`);
58812
58816
  const className = classNames[0].concatTokens();
58813
58817
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58814
58818
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58815
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58819
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58816
58820
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58817
58821
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58818
58822
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -58974,16 +58978,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
58974
58978
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58975
58979
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58976
58980
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58977
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58978
- ${indentation}${uniqueName1}-msgid = ${id}.
58981
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58982
+ ${indentation}${uniqueName1}-msgid = ${id}.
58979
58983
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
58980
58984
  if (withs.length > 0) {
58981
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58982
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58983
- ${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'.
58984
58988
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
58985
58989
  }
58986
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58990
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58987
58991
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
58988
58992
  if (withs.length > 0) {
58989
58993
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59095,10 +59099,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59095
59099
  let code = "";
59096
59100
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59097
59101
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59098
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59099
- IF sy-subrc <> 0.
59100
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59101
- 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.
59102
59106
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59103
59107
  }
59104
59108
  else {
@@ -59187,20 +59191,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59187
59191
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59188
59192
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59189
59193
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59190
- code += ` items LIKE ${loopSourceName},
59191
- END OF ${groupTargetName}type.
59192
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59193
- 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.
59194
59198
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59195
59199
  if (groupIndexName !== undefined) {
59196
59200
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59197
59201
  }
59198
- 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}.
59199
59203
  IF sy-subrc = 0.\n`;
59200
59204
  if (groupCountName !== undefined) {
59201
59205
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59202
59206
  }
59203
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59207
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59204
59208
  ELSE.\n`;
59205
59209
  code += ` CLEAR ${uniqueName}.\n`;
59206
59210
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59221,8 +59225,8 @@ ELSE.\n`;
59221
59225
  }
59222
59226
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59223
59227
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59224
- code += `ENDIF.
59225
- ENDLOOP.
59228
+ code += `ENDIF.
59229
+ ENDLOOP.
59226
59230
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59227
59231
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59228
59232
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59394,7 +59398,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59394
59398
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59395
59399
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59396
59400
  // all ENUMS are char like?
59397
- let code = `TYPES ${enumName} TYPE string.
59401
+ let code = `TYPES ${enumName} TYPE string.
59398
59402
  CONSTANTS: BEGIN OF ${structureName},\n`;
59399
59403
  let count = 1;
59400
59404
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59438,14 +59442,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59438
59442
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59439
59443
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59440
59444
  // restore tabix before exeption
59441
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59442
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59443
- ${indentation}${tabixBackup} = sy-tabix.
59444
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59445
- ${indentation}sy-tabix = ${tabixBackup}.
59446
- ${indentation}IF sy-subrc <> 0.
59447
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59448
- ${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.
59449
59453
  ${indentation}${uniqueName}`;
59450
59454
  const start = target.getFirstToken().getStart();
59451
59455
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59529,11 +59533,11 @@ ${indentation}${uniqueName}`;
59529
59533
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59530
59534
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59531
59535
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59532
- const code = `DATA ${uniqueName} TYPE string.
59533
- ${indentation}CALL FUNCTION '${functionName}'
59534
- ${indentation} EXPORTING
59535
- ${indentation} input = ${source}
59536
- ${indentation} IMPORTING
59536
+ const code = `DATA ${uniqueName} TYPE string.
59537
+ ${indentation}CALL FUNCTION '${functionName}'
59538
+ ${indentation} EXPORTING
59539
+ ${indentation} input = ${source}
59540
+ ${indentation} IMPORTING
59537
59541
  ${indentation} output = ${uniqueName}.\n`;
59538
59542
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59539
59543
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60845,12 +60849,12 @@ class EasyToFindMessages {
60845
60849
  key: "easy_to_find_messages",
60846
60850
  title: "Easy to find messages",
60847
60851
  shortDescription: `Make messages easy to find`,
60848
- extendedInformation: `All messages must be statically referenced exactly once
60849
-
60850
- Only MESSAGE and RAISE statments are counted as static references
60851
-
60852
- Also see rule "message_exists"
60853
-
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
+
60854
60858
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60855
60859
  tags: [_irule_1.RuleTag.Styleguide],
60856
60860
  };
@@ -60931,13 +60935,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
60931
60935
  shortDescription: `Empty selection screen or list processing event block`,
60932
60936
  extendedInformation: ``,
60933
60937
  tags: [_irule_1.RuleTag.SingleFile],
60934
- badExample: `
60935
- INITIALIZATION.
60936
- WRITE 'hello'.
60938
+ badExample: `
60939
+ INITIALIZATION.
60940
+ WRITE 'hello'.
60937
60941
  END-OF-SELECTION.`,
60938
- goodExample: `
60939
- START-OF-SELECTION.
60940
- PERFORM sdf.
60942
+ goodExample: `
60943
+ START-OF-SELECTION.
60944
+ PERFORM sdf.
60941
60945
  COMMIT WORK.`,
60942
60946
  };
60943
60947
  }
@@ -61029,8 +61033,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61029
61033
  key: "empty_line_in_statement",
61030
61034
  title: "Find empty lines in statements",
61031
61035
  shortDescription: `Checks that statements do not contain empty lines.`,
61032
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61033
-
61036
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61037
+
61034
61038
  https://docs.abapopenchecks.org/checks/41/`,
61035
61039
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61036
61040
  badExample: `WRITE\n\nhello.`,
@@ -61206,13 +61210,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61206
61210
  shortDescription: `Checks that the code does not contain empty blocks.`,
61207
61211
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61208
61212
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61209
- badExample: `IF foo = bar.
61210
- ENDIF.
61211
-
61212
- DO 2 TIMES.
61213
+ badExample: `IF foo = bar.
61214
+ ENDIF.
61215
+
61216
+ DO 2 TIMES.
61213
61217
  ENDDO.`,
61214
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61215
- ENDLOOP.
61218
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61219
+ ENDLOOP.
61216
61220
  result = xsdbool( sy-subrc = 0 ).`,
61217
61221
  };
61218
61222
  }
@@ -61354,10 +61358,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61354
61358
  return {
61355
61359
  key: "exit_or_check",
61356
61360
  title: "Find EXIT or CHECK outside loops",
61357
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61361
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61358
61362
  Use RETURN to leave procesing blocks instead.`,
61359
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61360
- 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
61361
61365
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61362
61366
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61363
61367
  };
@@ -61440,12 +61444,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61440
61444
  key: "expand_macros",
61441
61445
  title: "Expand Macros",
61442
61446
  shortDescription: `Allows expanding macro calls with quick fixes`,
61443
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61444
-
61447
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61448
+
61445
61449
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61446
- badExample: `DEFINE _hello.
61447
- WRITE 'hello'.
61448
- END-OF-DEFINITION.
61450
+ badExample: `DEFINE _hello.
61451
+ WRITE 'hello'.
61452
+ END-OF-DEFINITION.
61449
61453
  _hello.`,
61450
61454
  goodExample: `WRITE 'hello'.`,
61451
61455
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61532,7 +61536,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61532
61536
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61533
61537
  badExample: `call_method( EXPORTING foo = bar ).`,
61534
61538
  goodExample: `call_method( foo = bar ).`,
61535
- 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
61536
61540
  https://docs.abapopenchecks.org/checks/30/`,
61537
61541
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61538
61542
  };
@@ -61630,7 +61634,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61630
61634
  key: "forbidden_identifier",
61631
61635
  title: "Forbidden Identifier",
61632
61636
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61633
- 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,
61634
61638
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61635
61639
  tags: [_irule_1.RuleTag.SingleFile],
61636
61640
  };
@@ -61872,8 +61876,8 @@ class ForbiddenVoidType {
61872
61876
  key: "forbidden_void_type",
61873
61877
  title: "Forbidden Void Types",
61874
61878
  shortDescription: `Avoid usage of specified void types.`,
61875
- extendedInformation: `Inspiration:
61876
- 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,
61877
61881
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61878
61882
  };
61879
61883
  }
@@ -62116,7 +62120,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62116
62120
  key: "fully_type_itabs",
62117
62121
  title: "Fully type internal tables",
62118
62122
  shortDescription: `No implict table types or table keys`,
62119
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62123
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62120
62124
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62121
62125
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62122
62126
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62301,26 +62305,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62301
62305
  key: "functional_writing",
62302
62306
  title: "Use functional writing",
62303
62307
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62304
- 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
62305
62309
  https://docs.abapopenchecks.org/checks/07/`,
62306
62310
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62307
- badExample: `CALL METHOD zcl_class=>method( ).
62308
- CALL METHOD cl_abap_typedescr=>describe_by_name
62309
- EXPORTING
62310
- p_name = 'NAME'
62311
- RECEIVING
62312
- p_descr_ref = lr_typedescr
62313
- EXCEPTIONS
62314
- 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
62315
62319
  OTHERS = 2.`,
62316
- goodExample: `zcl_class=>method( ).
62317
- cl_abap_typedescr=>describe_by_name(
62318
- EXPORTING
62319
- p_name = 'NAME'
62320
- RECEIVING
62321
- p_descr_ref = lr_typedescr
62322
- EXCEPTIONS
62323
- 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
62324
62328
  OTHERS = 2 ).`,
62325
62329
  };
62326
62330
  }
@@ -62431,14 +62435,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62431
62435
  key: "global_class",
62432
62436
  title: "Global class checks",
62433
62437
  shortDescription: `Checks related to global classes`,
62434
- extendedInformation: `* global classes must be in own files
62435
-
62436
- * file names must match class name
62437
-
62438
- * file names must match interface name
62439
-
62440
- * global classes must be global definitions
62441
-
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
+
62442
62446
  * global interfaces must be global definitions`,
62443
62447
  tags: [_irule_1.RuleTag.Syntax],
62444
62448
  };
@@ -62537,21 +62541,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62537
62541
  return {
62538
62542
  key: "identical_conditions",
62539
62543
  title: "Identical conditions",
62540
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62541
-
62544
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62545
+
62542
62546
  Prerequsites: code is pretty printed with identical cAsE`,
62543
62547
  tags: [_irule_1.RuleTag.SingleFile],
62544
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62545
- ENDIF.
62546
- CASE bar.
62547
- WHEN '1'.
62548
- 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'.
62549
62553
  ENDCASE.`,
62550
- goodExample: `IF foo = bar OR 1 = a.
62551
- ENDIF.
62552
- CASE bar.
62553
- WHEN '1'.
62554
- WHEN 'A'.
62554
+ goodExample: `IF foo = bar OR 1 = a.
62555
+ ENDIF.
62556
+ CASE bar.
62557
+ WHEN '1'.
62558
+ WHEN 'A'.
62555
62559
  ENDCASE.`,
62556
62560
  };
62557
62561
  }
@@ -62685,23 +62689,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62685
62689
  key: "identical_contents",
62686
62690
  title: "Identical contents",
62687
62691
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62688
- extendedInformation: `
62689
- Prerequsites: code is pretty printed with identical cAsE
62690
-
62692
+ extendedInformation: `
62693
+ Prerequsites: code is pretty printed with identical cAsE
62694
+
62691
62695
  Chained statments are ignored`,
62692
62696
  tags: [_irule_1.RuleTag.SingleFile],
62693
- badExample: `IF foo = bar.
62694
- WRITE 'bar'.
62695
- WRITE 'world'.
62696
- ELSE.
62697
- WRITE 'foo'.
62698
- WRITE 'world'.
62697
+ badExample: `IF foo = bar.
62698
+ WRITE 'bar'.
62699
+ WRITE 'world'.
62700
+ ELSE.
62701
+ WRITE 'foo'.
62702
+ WRITE 'world'.
62699
62703
  ENDIF.`,
62700
- goodExample: `IF foo = bar.
62701
- WRITE 'bar'.
62702
- ELSE.
62703
- WRITE 'foo'.
62704
- ENDIF.
62704
+ goodExample: `IF foo = bar.
62705
+ WRITE 'bar'.
62706
+ ELSE.
62707
+ WRITE 'foo'.
62708
+ ENDIF.
62705
62709
  WRITE 'world'.`,
62706
62710
  };
62707
62711
  }
@@ -62809,12 +62813,12 @@ class IdenticalDescriptions {
62809
62813
  key: "identical_descriptions",
62810
62814
  title: "Identical descriptions",
62811
62815
  shortDescription: `Searches for objects with the same type and same description`,
62812
- extendedInformation: `Case insensitive
62813
-
62814
- Only checks the master language descriptions
62815
-
62816
- Dependencies are skipped
62817
-
62816
+ extendedInformation: `Case insensitive
62817
+
62818
+ Only checks the master language descriptions
62819
+
62820
+ Dependencies are skipped
62821
+
62818
62822
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62819
62823
  tags: [],
62820
62824
  };
@@ -62988,43 +62992,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
62988
62992
  key: "if_in_if",
62989
62993
  title: "IF in IF",
62990
62994
  shortDescription: `Detects nested ifs which can be refactored.`,
62991
- extendedInformation: `
62992
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
62993
-
62994
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62995
-
62996
- 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/
62997
63001
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
62998
- badExample: `IF condition1.
62999
- IF condition2.
63000
- ...
63001
- ENDIF.
63002
- ENDIF.
63003
-
63004
- IF condition1.
63005
- ...
63006
- ELSE.
63007
- IF condition2.
63008
- ...
63009
- 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.
63010
63014
  ENDIF.`,
63011
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63012
- ...
63013
- ENDIF.
63014
-
63015
- IF condition1.
63016
- ...
63017
- ELSEIF condition2.
63018
- ...
63019
- ENDIF.
63020
-
63021
- CASE variable.
63022
- WHEN value1.
63023
- ...
63024
- WHEN value2.
63025
- IF condition2.
63026
- ...
63027
- 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.
63028
63032
  ENDCASE.`,
63029
63033
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63030
63034
  };
@@ -63209,9 +63213,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63209
63213
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63210
63214
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63211
63215
  if (name === impl.identifier.getName().toUpperCase()) {
63212
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63213
- METHOD ${methodName.toLowerCase()}.
63214
- RETURN. " todo, implement method
63216
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63217
+ METHOD ${methodName.toLowerCase()}.
63218
+ RETURN. " todo, implement method
63215
63219
  ENDMETHOD.`);
63216
63220
  }
63217
63221
  }
@@ -63390,14 +63394,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63390
63394
  key: "implicit_start_of_selection",
63391
63395
  title: "Implicit START-OF-SELECTION",
63392
63396
  shortDescription: `Add explicit selection screen event handling`,
63393
- extendedInformation: `Only runs for executable programs
63394
-
63397
+ extendedInformation: `Only runs for executable programs
63398
+
63395
63399
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63396
63400
  tags: [_irule_1.RuleTag.SingleFile],
63397
- badExample: `REPORT zfoo.
63401
+ badExample: `REPORT zfoo.
63398
63402
  WRITE 'hello'.`,
63399
- goodExample: `
63400
- START-OF-SELECTION.
63403
+ goodExample: `
63404
+ START-OF-SELECTION.
63401
63405
  WRITE 'hello'.`,
63402
63406
  };
63403
63407
  }
@@ -63502,19 +63506,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63502
63506
  key: "in_statement_indentation",
63503
63507
  title: "In-statement indentation",
63504
63508
  shortDescription: "Checks alignment within statements which span multiple lines.",
63505
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63506
-
63507
- 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)
63508
63512
  to distinguish them better from code within the block.`,
63509
- badExample: `IF 1 = 1
63510
- AND 2 = 2.
63511
- WRITE 'hello' &&
63512
- 'world'.
63513
+ badExample: `IF 1 = 1
63514
+ AND 2 = 2.
63515
+ WRITE 'hello' &&
63516
+ 'world'.
63513
63517
  ENDIF.`,
63514
- goodExample: `IF 1 = 1
63515
- AND 2 = 2.
63516
- WRITE 'hello' &&
63517
- 'world'.
63518
+ goodExample: `IF 1 = 1
63519
+ AND 2 = 2.
63520
+ WRITE 'hello' &&
63521
+ 'world'.
63518
63522
  ENDIF.`,
63519
63523
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63520
63524
  };
@@ -63637,23 +63641,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63637
63641
  title: "Indentation",
63638
63642
  shortDescription: `Checks indentation`,
63639
63643
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63640
- badExample: `CLASS lcl DEFINITION.
63641
- PRIVATE SECTION.
63642
- METHODS constructor.
63643
- ENDCLASS.
63644
-
63645
- CLASS lcl IMPLEMENTATION.
63646
- METHOD constructor.
63647
- ENDMETHOD.
63644
+ badExample: `CLASS lcl DEFINITION.
63645
+ PRIVATE SECTION.
63646
+ METHODS constructor.
63647
+ ENDCLASS.
63648
+
63649
+ CLASS lcl IMPLEMENTATION.
63650
+ METHOD constructor.
63651
+ ENDMETHOD.
63648
63652
  ENDCLASS.`,
63649
- goodExample: `CLASS lcl DEFINITION.
63650
- PRIVATE SECTION.
63651
- METHODS constructor.
63652
- ENDCLASS.
63653
-
63654
- CLASS lcl IMPLEMENTATION.
63655
- METHOD constructor.
63656
- ENDMETHOD.
63653
+ goodExample: `CLASS lcl DEFINITION.
63654
+ PRIVATE SECTION.
63655
+ METHODS constructor.
63656
+ ENDCLASS.
63657
+
63658
+ CLASS lcl IMPLEMENTATION.
63659
+ METHOD constructor.
63660
+ ENDMETHOD.
63657
63661
  ENDCLASS.`,
63658
63662
  };
63659
63663
  }
@@ -64046,9 +64050,9 @@ class IntfReferencingClas {
64046
64050
  key: "intf_referencing_clas",
64047
64051
  title: "INTF referencing CLAS",
64048
64052
  shortDescription: `Interface contains references to class`,
64049
- extendedInformation: `Only global interfaces are checked.
64050
- Only first level references are checked.
64051
- 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.
64052
64056
  Void references are ignored.`,
64053
64057
  };
64054
64058
  }
@@ -64133,9 +64137,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64133
64137
  title: "Invalid Table Index",
64134
64138
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64135
64139
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64136
- badExample: `DATA(first) = table[ 0 ].
64140
+ badExample: `DATA(first) = table[ 0 ].
64137
64141
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64138
- goodExample: `DATA(first) = table[ 1 ].
64142
+ goodExample: `DATA(first) = table[ 1 ].
64139
64143
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64140
64144
  };
64141
64145
  }
@@ -64736,8 +64740,8 @@ class LineBreakStyle {
64736
64740
  return {
64737
64741
  key: "line_break_style",
64738
64742
  title: "Makes sure line breaks are consistent in the ABAP code",
64739
- shortDescription: `Enforces LF as newlines in ABAP files
64740
-
64743
+ shortDescription: `Enforces LF as newlines in ABAP files
64744
+
64741
64745
  abapGit does not work with CRLF`,
64742
64746
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64743
64747
  };
@@ -64806,7 +64810,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64806
64810
  key: "line_length",
64807
64811
  title: "Line length",
64808
64812
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64809
- 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
64810
64814
  https://docs.abapopenchecks.org/checks/04/`,
64811
64815
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64812
64816
  };
@@ -64877,7 +64881,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64877
64881
  key: "line_only_punc",
64878
64882
  title: "Line containing only punctuation",
64879
64883
  shortDescription: `Detects lines containing only punctuation.`,
64880
- 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
64881
64885
  https://docs.abapopenchecks.org/checks/16/`,
64882
64886
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64883
64887
  badExample: "zcl_class=>method(\n).",
@@ -65140,15 +65144,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65140
65144
  return {
65141
65145
  key: "local_variable_names",
65142
65146
  title: "Local variable naming conventions",
65143
- shortDescription: `
65144
- 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.
65145
65149
  Regexes are case-insensitive.`,
65146
65150
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65147
- badExample: `FORM bar.
65148
- DATA foo.
65151
+ badExample: `FORM bar.
65152
+ DATA foo.
65149
65153
  ENDFORM.`,
65150
- goodExample: `FORM bar.
65151
- DATA lv_foo.
65154
+ goodExample: `FORM bar.
65155
+ DATA lv_foo.
65152
65156
  ENDFORM.`,
65153
65157
  };
65154
65158
  }
@@ -65300,9 +65304,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65300
65304
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65301
65305
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65302
65306
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65303
- badExample: `DEFINE something.
65307
+ badExample: `DEFINE something.
65304
65308
  END-OF-DEFINITION.`,
65305
- goodExample: `DEFINE _something.
65309
+ goodExample: `DEFINE _something.
65306
65310
  END-OF-DEFINITION.`,
65307
65311
  };
65308
65312
  }
@@ -65375,10 +65379,10 @@ class MainFileContents {
65375
65379
  key: "main_file_contents",
65376
65380
  title: "Main file contents",
65377
65381
  shortDescription: `Checks related to report declarations.`,
65378
- extendedInformation: `Does not run if the target version is Cloud
65379
-
65380
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65381
- * 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>."
65382
65386
  `,
65383
65387
  };
65384
65388
  }
@@ -65494,17 +65498,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65494
65498
  title: "Too many parentheses",
65495
65499
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65496
65500
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65497
- badExample: `
65498
- IF ( destination IS INITIAL ).
65499
- ENDIF.
65500
- IF foo = boo AND ( bar = lar AND moo = loo ).
65501
- ENDIF.
65501
+ badExample: `
65502
+ IF ( destination IS INITIAL ).
65503
+ ENDIF.
65504
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65505
+ ENDIF.
65502
65506
  `,
65503
- goodExample: `
65504
- IF destination IS INITIAL.
65505
- ENDIF.
65506
- IF foo = boo AND bar = lar AND moo = loo.
65507
- ENDIF.
65507
+ goodExample: `
65508
+ IF destination IS INITIAL.
65509
+ ENDIF.
65510
+ IF foo = boo AND bar = lar AND moo = loo.
65511
+ ENDIF.
65508
65512
  `,
65509
65513
  };
65510
65514
  }
@@ -65678,14 +65682,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65678
65682
  title: "Max one method parameter definition per line",
65679
65683
  shortDescription: `Keep max one method parameter description per line`,
65680
65684
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65681
- badExample: `
65682
- METHODS apps_scope_token
65683
- IMPORTING
65685
+ badExample: `
65686
+ METHODS apps_scope_token
65687
+ IMPORTING
65684
65688
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65685
- goodExample: `
65686
- METHODS apps_scope_token
65687
- IMPORTING
65688
- body TYPE bodyapps_scope_token
65689
+ goodExample: `
65690
+ METHODS apps_scope_token
65691
+ IMPORTING
65692
+ body TYPE bodyapps_scope_token
65689
65693
  client_id TYPE str.`,
65690
65694
  };
65691
65695
  }
@@ -65750,11 +65754,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65750
65754
  key: "max_one_statement",
65751
65755
  title: "Max one statement per line",
65752
65756
  shortDescription: `Checks that each line contains only a single statement.`,
65753
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65754
-
65755
- Does not report anything for chained statements.
65756
-
65757
- 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
65758
65762
  https://docs.abapopenchecks.org/checks/11/`,
65759
65763
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65760
65764
  badExample: `WRITE foo. WRITE bar.`,
@@ -66092,8 +66096,8 @@ class MethodLength {
66092
66096
  key: "method_length",
66093
66097
  title: "Method/Form Length",
66094
66098
  shortDescription: `Checks relating to method/form length.`,
66095
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66096
-
66099
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66100
+
66097
66101
  Abstract methods without statements are considered okay.`,
66098
66102
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66099
66103
  };
@@ -66198,20 +66202,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66198
66202
  key: "method_overwrites_builtin",
66199
66203
  title: "Method name overwrites builtin function",
66200
66204
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66201
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66202
-
66203
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66204
-
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
+
66205
66209
  Interface method names are ignored`,
66206
66210
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66207
- badExample: `CLASS lcl DEFINITION.
66208
- PUBLIC SECTION.
66209
- METHODS matches.
66210
- ENDCLASS.
66211
-
66212
- CLASS lcl IMPLEMENTATION.
66213
- METHOD matches.
66214
- ENDMETHOD.
66211
+ badExample: `CLASS lcl DEFINITION.
66212
+ PUBLIC SECTION.
66213
+ METHODS matches.
66214
+ ENDCLASS.
66215
+
66216
+ CLASS lcl IMPLEMENTATION.
66217
+ METHOD matches.
66218
+ ENDMETHOD.
66215
66219
  ENDCLASS.`,
66216
66220
  };
66217
66221
  }
@@ -66402,12 +66406,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66402
66406
  // eslint-disable-next-line max-len
66403
66407
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66404
66408
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66405
- badExample: `CLASS lcl DEFINITION.
66406
- PUBLIC SECTION.
66407
- METHODS
66408
- foobar
66409
- EXPORTING foo TYPE i
66410
- 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.
66411
66415
  ENDCLASS.`,
66412
66416
  };
66413
66417
  }
@@ -66787,7 +66791,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66787
66791
  key: "nesting",
66788
66792
  title: "Check nesting depth",
66789
66793
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66790
- 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
66791
66795
  https://docs.abapopenchecks.org/checks/74/`,
66792
66796
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66793
66797
  };
@@ -67030,7 +67034,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67030
67034
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67031
67035
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67032
67036
  badExample: `var1 = var2 = var3.`,
67033
- goodExample: `var2 = var3.
67037
+ goodExample: `var2 = var3.
67034
67038
  var1 = var2.`,
67035
67039
  };
67036
67040
  }
@@ -67089,8 +67093,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67089
67093
  key: "no_external_form_calls",
67090
67094
  title: "No external FORM calls",
67091
67095
  shortDescription: `Detect external form calls`,
67092
- badExample: `PERFORM foo IN PROGRAM bar.
67093
-
67096
+ badExample: `PERFORM foo IN PROGRAM bar.
67097
+
67094
67098
  PERFORM foo(bar).`,
67095
67099
  tags: [_irule_1.RuleTag.SingleFile],
67096
67100
  };
@@ -67151,17 +67155,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67151
67155
  key: "no_inline_in_optional_branches",
67152
67156
  title: "Don't declare inline in optional branches",
67153
67157
  shortDescription: `Don't declare inline in optional branches`,
67154
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67155
-
67156
- Considered optional branches:
67157
- * inside IF/ELSEIF/ELSE
67158
- * inside LOOP
67159
- * inside WHILE
67160
- * inside CASE/WHEN, CASE TYPE OF
67161
- * inside DO
67162
- * inside SELECT loops
67163
-
67164
- 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:
67165
67169
  * TRY/CATCH/CLEANUP`,
67166
67170
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67167
67171
  };
@@ -67261,12 +67265,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67261
67265
  key: "no_prefixes",
67262
67266
  title: "No Prefixes",
67263
67267
  shortDescription: `Dont use hungarian notation`,
67264
- extendedInformation: `
67265
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67266
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67267
-
67268
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67269
-
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
+
67270
67274
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67271
67275
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67272
67276
  badExample: `DATA lv_foo TYPE i.`,
@@ -67445,7 +67449,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67445
67449
  return {
67446
67450
  key: "no_public_attributes",
67447
67451
  title: "No public attributes",
67448
- 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.
67449
67453
  Exceptions are excluded from this rule.`,
67450
67454
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67451
67455
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67546,13 +67550,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67546
67550
  key: "no_yoda_conditions",
67547
67551
  title: "No Yoda conditions",
67548
67552
  shortDescription: `Finds Yoda conditions and reports issues`,
67549
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67550
-
67553
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67554
+
67551
67555
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67552
67556
  tags: [_irule_1.RuleTag.SingleFile],
67553
- badExample: `IF 0 <> sy-subrc.
67557
+ badExample: `IF 0 <> sy-subrc.
67554
67558
  ENDIF.`,
67555
- goodExample: `IF sy-subrc <> 0.
67559
+ goodExample: `IF sy-subrc <> 0.
67556
67560
  ENDIF.`,
67557
67561
  };
67558
67562
  }
@@ -67653,8 +67657,8 @@ class NROBConsistency {
67653
67657
  key: "nrob_consistency",
67654
67658
  title: "Number range consistency",
67655
67659
  shortDescription: `Consistency checks for number ranges`,
67656
- extendedInformation: `Issue reported if percentage warning is over 50%
67657
-
67660
+ extendedInformation: `Issue reported if percentage warning is over 50%
67661
+
67658
67662
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67659
67663
  tags: [_irule_1.RuleTag.SingleFile],
67660
67664
  };
@@ -67931,58 +67935,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67931
67935
  title: "Obsolete statements",
67932
67936
  shortDescription: `Checks for usages of certain obsolete statements`,
67933
67937
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67934
- extendedInformation: `
67935
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67936
-
67937
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67938
-
67939
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67940
-
67941
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67942
-
67943
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67944
-
67945
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67946
-
67947
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67948
-
67949
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67950
-
67951
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67952
-
67953
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67954
-
67955
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67956
-
67957
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67958
-
67959
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67960
-
67961
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67962
-
67963
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67964
- SELECT COUNT(*) is considered okay
67965
-
67966
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67967
-
67968
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67969
-
67970
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67971
-
67972
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67973
-
67974
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
67975
-
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
+
67976
67980
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
67977
- badExample: `REFRESH itab.
67978
-
67979
- COMPUTE foo = 2 + 2.
67980
-
67981
- MULTIPLY lv_foo BY 2.
67982
-
67983
- INTERFACE intf LOAD.
67984
-
67985
- 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.
67986
67990
  ENDIF.`,
67987
67991
  };
67988
67992
  }
@@ -68322,9 +68326,9 @@ class OmitParameterName {
68322
68326
  key: "omit_parameter_name",
68323
68327
  title: "Omit parameter name",
68324
68328
  shortDescription: `Omit the parameter name in single parameter calls`,
68325
- extendedInformation: `
68326
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68327
-
68329
+ extendedInformation: `
68330
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68331
+
68328
68332
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68329
68333
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68330
68334
  badExample: `method( param = 2 ).`,
@@ -68530,20 +68534,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68530
68534
  shortDescription: `Omit RECEIVING`,
68531
68535
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68532
68536
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68533
- badExample: `
68534
- upload_pack(
68535
- EXPORTING
68536
- io_client = lo_client
68537
- iv_url = iv_url
68538
- iv_deepen_level = iv_deepen_level
68539
- it_hashes = lt_hashes
68540
- 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
68541
68545
  rt_objects = et_objects ).`,
68542
- goodExample: `
68543
- et_objects = upload_pack(
68544
- io_client = lo_client
68545
- iv_url = iv_url
68546
- 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
68547
68551
  it_hashes = lt_hashes ).`,
68548
68552
  };
68549
68553
  }
@@ -68607,8 +68611,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68607
68611
  return {
68608
68612
  key: "parser_702_chaining",
68609
68613
  title: "Parser Error, bad chanining on 702",
68610
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68611
- 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.
68612
68616
  Only active on target version 702 and below.`,
68613
68617
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68614
68618
  };
@@ -68688,8 +68692,8 @@ class ParserError {
68688
68692
  return {
68689
68693
  key: "parser_error",
68690
68694
  title: "Parser error",
68691
- shortDescription: `Checks for syntax not recognized by abaplint.
68692
-
68695
+ shortDescription: `Checks for syntax not recognized by abaplint.
68696
+
68693
68697
  See recognized syntax at https://syntax.abaplint.org`,
68694
68698
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68695
68699
  };
@@ -68774,7 +68778,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68774
68778
  return {
68775
68779
  key: "parser_missing_space",
68776
68780
  title: "Parser Error, missing space",
68777
- 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.
68778
68782
  This rule makes sure the spaces are consistently required across the language.`,
68779
68783
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68780
68784
  badExample: `IF ( foo = 'bar').`,
@@ -69186,25 +69190,25 @@ class PreferInline {
69186
69190
  key: "prefer_inline",
69187
69191
  title: "Prefer Inline Declarations",
69188
69192
  shortDescription: `Prefer inline to up-front declarations.`,
69189
- extendedInformation: `EXPERIMENTAL
69190
-
69191
- Activates if language version is v740sp02 or above.
69192
-
69193
- Variables must be local(METHOD or FORM).
69194
-
69195
- No generic or void typed variables. No syntax errors.
69196
-
69197
- First position used must be a full/pure write.
69198
-
69199
- Move statment is not a cast(?=)
69200
-
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
+
69201
69205
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69202
69206
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69203
- badExample: `DATA foo TYPE i.
69204
- foo = 2.
69205
- DATA percentage TYPE decfloat34.
69207
+ badExample: `DATA foo TYPE i.
69208
+ foo = 2.
69209
+ DATA percentage TYPE decfloat34.
69206
69210
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69207
- goodExample: `DATA(foo) = 2.
69211
+ goodExample: `DATA(foo) = 2.
69208
69212
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69209
69213
  };
69210
69214
  }
@@ -69418,18 +69422,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69418
69422
  key: "prefer_is_not",
69419
69423
  title: "Prefer IS NOT to NOT IS",
69420
69424
  shortDescription: `Prefer IS NOT to NOT IS`,
69421
- extendedInformation: `
69422
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69423
-
69425
+ extendedInformation: `
69426
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69427
+
69424
69428
  "if not is_valid( )." examples are skipped`,
69425
69429
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69426
- goodExample: `IF variable IS NOT INITIAL.
69427
- IF variable NP 'TODO*'.
69428
- IF variable <> 42.
69430
+ goodExample: `IF variable IS NOT INITIAL.
69431
+ IF variable NP 'TODO*'.
69432
+ IF variable <> 42.
69429
69433
  IF variable CO 'hello'.`,
69430
- badExample: `IF NOT variable IS INITIAL.
69431
- IF NOT variable CP 'TODO*'.
69432
- IF NOT variable = 42.
69434
+ badExample: `IF NOT variable IS INITIAL.
69435
+ IF NOT variable CP 'TODO*'.
69436
+ IF NOT variable = 42.
69433
69437
  IF NOT variable CA 'hello'.`,
69434
69438
  };
69435
69439
  }
@@ -69617,14 +69621,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69617
69621
  key: "prefer_raise_exception_new",
69618
69622
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69619
69623
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69620
- extendedInformation: `
69621
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69622
-
69624
+ extendedInformation: `
69625
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69626
+
69623
69627
  From 752 and up`,
69624
69628
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69625
69629
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69626
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69627
- EXPORTING
69630
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69631
+ EXPORTING
69628
69632
  previous = exception.`,
69629
69633
  };
69630
69634
  }
@@ -69702,12 +69706,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69702
69706
  key: "prefer_returning_to_exporting",
69703
69707
  title: "Prefer RETURNING to EXPORTING",
69704
69708
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69705
- 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
69706
69710
  https://docs.abapopenchecks.org/checks/44/`,
69707
69711
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69708
- badExample: `CLASS lcl DEFINITION.
69709
- PUBLIC SECTION.
69710
- METHODS test EXPORTING ev_foo TYPE i.
69712
+ badExample: `CLASS lcl DEFINITION.
69713
+ PUBLIC SECTION.
69714
+ METHODS test EXPORTING ev_foo TYPE i.
69711
69715
  ENDCLASS.`,
69712
69716
  };
69713
69717
  }
@@ -69803,8 +69807,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69803
69807
  key: "prefer_xsdbool",
69804
69808
  title: "Prefer xsdbool over boolc",
69805
69809
  shortDescription: `Prefer xsdbool over boolc`,
69806
- extendedInformation: `Activates if language version is v740sp08 or above.
69807
-
69810
+ extendedInformation: `Activates if language version is v740sp08 or above.
69811
+
69808
69812
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69809
69813
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69810
69814
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69876,9 +69880,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69876
69880
  title: "Preferred compare operator",
69877
69881
  shortDescription: `Configure undesired operator variants`,
69878
69882
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69879
- badExample: `IF foo EQ bar.
69883
+ badExample: `IF foo EQ bar.
69880
69884
  ENDIF.`,
69881
- goodExample: `IF foo = bar.
69885
+ goodExample: `IF foo = bar.
69882
69886
  ENDIF.`,
69883
69887
  };
69884
69888
  }
@@ -70102,26 +70106,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70102
70106
  key: "reduce_procedural_code",
70103
70107
  title: "Reduce procedural code",
70104
70108
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70105
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70106
-
70107
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70108
-
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
+
70109
70113
  Comments are not counted as statements.`,
70110
70114
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70111
- badExample: `FORM foo.
70112
- DATA lv_bar TYPE i.
70113
- lv_bar = 2 + 2.
70114
- IF lv_bar = 4.
70115
- WRITE 'hello world'.
70116
- ENDIF.
70117
- DATA lv_bar TYPE i.
70118
- lv_bar = 2 + 2.
70119
- IF lv_bar = 4.
70120
- WRITE 'hello world'.
70121
- 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.
70122
70126
  ENDFORM.`,
70123
- goodExample: `FORM foo.
70124
- NEW zcl_global_class( )->run_logic( ).
70127
+ goodExample: `FORM foo.
70128
+ NEW zcl_global_class( )->run_logic( ).
70125
70129
  ENDFORM.`,
70126
70130
  };
70127
70131
  }
@@ -70365,10 +70369,10 @@ class RemoveDescriptions {
70365
70369
  return {
70366
70370
  key: "remove_descriptions",
70367
70371
  title: "Remove descriptions",
70368
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70369
-
70370
- Class descriptions are required, see rule description_empty.
70371
-
70372
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70373
+
70374
+ Class descriptions are required, see rule description_empty.
70375
+
70372
70376
  Consider using ABAP Doc for documentation.`,
70373
70377
  tags: [],
70374
70378
  };
@@ -70493,14 +70497,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70493
70497
  tags: [_irule_1.RuleTag.SingleFile],
70494
70498
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70495
70499
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70496
- badExample: `CALL FUNCTION 'ZRFC'
70500
+ badExample: `CALL FUNCTION 'ZRFC'
70497
70501
  DESTINATION lv_rfc.`,
70498
- goodExample: `CALL FUNCTION 'ZRFC'
70499
- DESTINATION lv_rfc
70500
- EXCEPTIONS
70501
- system_failure = 1 MESSAGE msg
70502
- communication_failure = 2 MESSAGE msg
70503
- 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
70504
70508
  OTHERS = 4.`,
70505
70509
  };
70506
70510
  }
@@ -70584,11 +70588,11 @@ class SelectAddOrderBy {
70584
70588
  key: "select_add_order_by",
70585
70589
  title: "SELECT add ORDER BY",
70586
70590
  shortDescription: `SELECTs add ORDER BY clause`,
70587
- extendedInformation: `
70588
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70589
-
70590
- add ORDER BY PRIMARY KEY if in doubt
70591
-
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
+
70592
70596
  If the target is a sorted/hashed table, no issue is reported`,
70593
70597
  tags: [_irule_1.RuleTag.SingleFile],
70594
70598
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70719,14 +70723,14 @@ class SelectPerformance {
70719
70723
  key: "select_performance",
70720
70724
  title: "SELECT performance",
70721
70725
  shortDescription: `Various checks regarding SELECT performance.`,
70722
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70723
-
70726
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70727
+
70724
70728
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70725
70729
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70726
- badExample: `SELECT field1, field2 FROM table
70727
- 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.
70728
70732
  ENDSELECT.`,
70729
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70733
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70730
70734
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70731
70735
  };
70732
70736
  }
@@ -70840,8 +70844,8 @@ class SelectSingleFullKey {
70840
70844
  key: "select_single_full_key",
70841
70845
  title: "Detect SELECT SINGLE which are possibily not unique",
70842
70846
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70843
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70844
-
70847
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70848
+
70845
70849
  If the statement contains a JOIN it is not checked`,
70846
70850
  pseudoComment: "EC CI_NOORDER",
70847
70851
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71265,8 +71269,8 @@ class SICFConsistency {
71265
71269
  key: "sicf_consistency",
71266
71270
  title: "SICF consistency",
71267
71271
  shortDescription: `Checks the validity of ICF services`,
71268
- extendedInformation: `* Class defined in handler must exist
71269
- * Class must not have any syntax errors
71272
+ extendedInformation: `* Class defined in handler must exist
71273
+ * Class must not have any syntax errors
71270
71274
  * Class must implement interface IF_HTTP_EXTENSION`,
71271
71275
  };
71272
71276
  }
@@ -71378,23 +71382,23 @@ class SlowParameterPassing {
71378
71382
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71379
71383
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71380
71384
  tags: [_irule_1.RuleTag.Performance],
71381
- badExample: `CLASS lcl DEFINITION.
71382
- PUBLIC SECTION.
71383
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71384
- ENDCLASS.
71385
- CLASS lcl IMPLEMENTATION.
71386
- METHOD bar.
71387
- WRITE sdf.
71388
- 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.
71389
71393
  ENDCLASS.`,
71390
- goodExample: `CLASS lcl DEFINITION.
71391
- PUBLIC SECTION.
71392
- METHODS bar IMPORTING sdf TYPE string.
71393
- ENDCLASS.
71394
- CLASS lcl IMPLEMENTATION.
71395
- METHOD bar.
71396
- WRITE sdf.
71397
- 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.
71398
71402
  ENDCLASS.`,
71399
71403
  };
71400
71404
  }
@@ -71651,8 +71655,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71651
71655
  key: "space_before_dot",
71652
71656
  title: "Space before dot",
71653
71657
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71654
- extendedInformation: `
71655
- 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
71656
71660
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71657
71661
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71658
71662
  badExample: `WRITE bar .`,
@@ -71838,12 +71842,12 @@ class SQLValueConversion {
71838
71842
  key: "sql_value_conversion",
71839
71843
  title: "Implicit SQL Value Conversion",
71840
71844
  shortDescription: `Ensure types match when selecting from database`,
71841
- extendedInformation: `
71842
- * Integer to CHAR conversion
71843
- * Integer to NUMC conversion
71844
- * NUMC to Integer conversion
71845
- * CHAR to Integer conversion
71846
- * 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
71847
71851
  * Source field longer than database field, NUMC -> NUMC`,
71848
71852
  tags: [],
71849
71853
  };
@@ -71915,7 +71919,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71915
71919
  key: "start_at_tab",
71916
71920
  title: "Start at tab",
71917
71921
  shortDescription: `Checks that statements start at tabstops.`,
71918
- extendedInformation: `Reports max 100 issues per file
71922
+ extendedInformation: `Reports max 100 issues per file
71919
71923
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71920
71924
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71921
71925
  badExample: ` WRITE a.`,
@@ -72092,12 +72096,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72092
72096
  key: "strict_sql",
72093
72097
  title: "Strict SQL",
72094
72098
  shortDescription: `Strict SQL`,
72095
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72096
-
72097
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72098
-
72099
- Also see separate rule sql_escape_host_variables
72100
-
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
+
72101
72105
  Activates from v750 and up`,
72102
72106
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72103
72107
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72351,11 +72355,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72351
72355
  key: "sy_modification",
72352
72356
  title: "Modification of SY fields",
72353
72357
  shortDescription: `Finds modification of sy fields`,
72354
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72355
-
72358
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72359
+
72356
72360
  Changes to SY-TVAR* fields are not reported`,
72357
72361
  tags: [_irule_1.RuleTag.SingleFile],
72358
- badExample: `sy-uname = 2.
72362
+ badExample: `sy-uname = 2.
72359
72363
  sy = sy.`,
72360
72364
  };
72361
72365
  }
@@ -72417,8 +72421,8 @@ class TABLEnhancementCategory {
72417
72421
  key: "tabl_enhancement_category",
72418
72422
  title: "TABL enhancement category must be set",
72419
72423
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72420
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72421
-
72424
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72425
+
72422
72426
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72423
72427
  tags: [],
72424
72428
  };
@@ -72483,8 +72487,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72483
72487
  shortDescription: `TABLES are always global, so declare them globally`,
72484
72488
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72485
72489
  tags: [_irule_1.RuleTag.SingleFile],
72486
- badExample: `FORM foo.
72487
- TABLES t100.
72490
+ badExample: `FORM foo.
72491
+ TABLES t100.
72488
72492
  ENDFORM.`,
72489
72493
  goodExample: `TABLES t000.`,
72490
72494
  };
@@ -72612,9 +72616,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72612
72616
  title: "Type FORM parameters",
72613
72617
  shortDescription: `Checks for untyped FORM parameters`,
72614
72618
  tags: [_irule_1.RuleTag.SingleFile],
72615
- badExample: `FORM foo USING bar.
72619
+ badExample: `FORM foo USING bar.
72616
72620
  ENDFORM.`,
72617
- goodExample: `FORM foo USING bar TYPE string.
72621
+ goodExample: `FORM foo USING bar TYPE string.
72618
72622
  ENDFORM.`,
72619
72623
  };
72620
72624
  }
@@ -73287,38 +73291,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73287
73291
  key: "unnecessary_pragma",
73288
73292
  title: "Unnecessary Pragma",
73289
73293
  shortDescription: `Finds pragmas which can be removed`,
73290
- extendedInformation: `* NO_HANDLER with handler
73291
-
73292
- * NEEDED without definition
73293
-
73294
- * NO_TEXT without texts
73295
-
73296
- * SUBRC_OK where sy-subrc is checked
73297
-
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
+
73298
73302
  NO_HANDLER inside macros are not checked`,
73299
73303
  tags: [_irule_1.RuleTag.SingleFile],
73300
- badExample: `TRY.
73301
- ...
73302
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73303
- RETURN. " it has a handler
73304
- ENDTRY.
73305
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73306
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73307
- 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.
73308
73312
  ENDIF.`,
73309
- goodExample: `TRY.
73310
- ...
73311
- CATCH zcx_abapgit_exception.
73312
- RETURN.
73313
- ENDTRY.
73314
- MESSAGE w125(zbar) WITH c_foo INTO message.
73315
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73316
- IF sy-subrc <> 0.
73317
- ENDIF.
73318
-
73319
- DATA: BEGIN OF blah ##NEEDED,
73320
- test1 TYPE string,
73321
- 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,
73322
73326
  END OF blah.`,
73323
73327
  };
73324
73328
  }
@@ -73485,18 +73489,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73485
73489
  shortDescription: `Finds unnecessary RETURN statements`,
73486
73490
  extendedInformation: `Finds unnecessary RETURN statements`,
73487
73491
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73488
- badExample: `FORM hello1.
73489
- WRITE 'world'.
73490
- RETURN.
73491
- ENDFORM.
73492
-
73493
- FORM foo.
73494
- IF 1 = 2.
73495
- RETURN.
73496
- ENDIF.
73492
+ badExample: `FORM hello1.
73493
+ WRITE 'world'.
73494
+ RETURN.
73495
+ ENDFORM.
73496
+
73497
+ FORM foo.
73498
+ IF 1 = 2.
73499
+ RETURN.
73500
+ ENDIF.
73497
73501
  ENDFORM.`,
73498
- goodExample: `FORM hello2.
73499
- WRITE 'world'.
73502
+ goodExample: `FORM hello2.
73503
+ WRITE 'world'.
73500
73504
  ENDFORM.`,
73501
73505
  };
73502
73506
  }
@@ -73847,13 +73851,13 @@ class UnusedMacros {
73847
73851
  title: "Unused macros",
73848
73852
  shortDescription: `Checks for unused macro definitions definitions`,
73849
73853
  tags: [_irule_1.RuleTag.Quickfix],
73850
- badExample: `DEFINE foobar1.
73851
- WRITE 'hello'.
73854
+ badExample: `DEFINE foobar1.
73855
+ WRITE 'hello'.
73852
73856
  END-OF-DEFINITION.`,
73853
- goodExample: `DEFINE foobar2.
73854
- WRITE 'hello'.
73855
- END-OF-DEFINITION.
73856
-
73857
+ goodExample: `DEFINE foobar2.
73858
+ WRITE 'hello'.
73859
+ END-OF-DEFINITION.
73860
+
73857
73861
  foobar2.`,
73858
73862
  };
73859
73863
  }
@@ -73908,6 +73912,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
73908
73912
  exports.UnusedMethods = exports.UnusedMethodsConf = void 0;
73909
73913
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
73910
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");
73911
73916
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
73912
73917
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
73913
73918
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
@@ -73916,6 +73921,8 @@ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./n
73916
73921
  const visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
73917
73922
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
73918
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");
73919
73926
  class UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
73920
73927
  }
73921
73928
  exports.UnusedMethodsConf = UnusedMethodsConf;
@@ -73928,6 +73935,7 @@ class WorkArea {
73928
73935
  this.list.push(id);
73929
73936
  }
73930
73937
  removeIfExists(id) {
73938
+ // todo: optimize
73931
73939
  for (let i = 0; i < this.list.length; i++) {
73932
73940
  if (id.equals(this.list[i].identifier)) {
73933
73941
  this.list.splice(i, 1);
@@ -73961,19 +73969,19 @@ class UnusedMethods {
73961
73969
  key: "unused_methods",
73962
73970
  title: "Unused methods",
73963
73971
  shortDescription: `Checks for unused methods`,
73964
- extendedInformation: `Checks private and protected methods.
73965
-
73966
- Unused methods are not reported if the object contains parser or syntax errors.
73967
-
73968
- Skips:
73969
- * methods FOR TESTING
73970
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73971
- * class_constructor + constructor methods
73972
- * event handlers
73973
- * methods that are redefined
73974
- * 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
73975
73983
  `,
73976
- tags: [],
73984
+ tags: [_irule_1.RuleTag.Quickfix],
73977
73985
  pragma: "##CALLED",
73978
73986
  pseudoComment: "EC CALLED",
73979
73987
  };
@@ -74055,11 +74063,33 @@ Skips:
74055
74063
  else if (this.suppressedbyPseudo(statement, file)) {
74056
74064
  continue;
74057
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
+ }
74058
74073
  const message = "Method \"" + i.identifier.getName() + "\" not used";
74059
- 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));
74060
74075
  }
74061
74076
  return issues;
74062
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
+ }
74063
74093
  suppressedbyPseudo(statement, file) {
74064
74094
  if (statement === undefined) {
74065
74095
  return false;
@@ -74405,23 +74435,23 @@ class UnusedVariables {
74405
74435
  key: "unused_variables",
74406
74436
  title: "Unused variables",
74407
74437
  shortDescription: `Checks for unused variables and constants`,
74408
- extendedInformation: `Skips event parameters.
74409
-
74410
- Note that this currently does not work if the source code uses macros.
74411
-
74412
- Unused variables are not reported if the object contains parser or syntax errors.
74413
-
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
+
74414
74444
  Errors found in INCLUDES are reported for the main program.`,
74415
74445
  tags: [_irule_1.RuleTag.Quickfix],
74416
74446
  pragma: "##NEEDED",
74417
74447
  pseudoComment: "EC NEEDED",
74418
- badExample: `DATA: BEGIN OF blah1,
74419
- test TYPE string,
74420
- test2 TYPE string,
74448
+ badExample: `DATA: BEGIN OF blah1,
74449
+ test TYPE string,
74450
+ test2 TYPE string,
74421
74451
  END OF blah1.`,
74422
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74423
- test TYPE string,
74424
- test2 TYPE string,
74452
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74453
+ test TYPE string,
74454
+ test2 TYPE string,
74425
74455
  END OF blah2.`,
74426
74456
  };
74427
74457
  }
@@ -74640,15 +74670,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74640
74670
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74641
74671
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74642
74672
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74643
- badExample: `IF line IS INITIAL.
74644
- has_entries = abap_false.
74645
- ELSE.
74646
- has_entries = abap_true.
74647
- ENDIF.
74648
-
74673
+ badExample: `IF line IS INITIAL.
74674
+ has_entries = abap_false.
74675
+ ELSE.
74676
+ has_entries = abap_true.
74677
+ ENDIF.
74678
+
74649
74679
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74650
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74651
-
74680
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74681
+
74652
74682
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74653
74683
  };
74654
74684
  }
@@ -74766,15 +74796,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74766
74796
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74767
74797
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74768
74798
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74769
- badExample: `INTERFACE lif.
74770
- METHODS load_data
74771
- EXCEPTIONS
74772
- invalid_parameter.
74799
+ badExample: `INTERFACE lif.
74800
+ METHODS load_data
74801
+ EXCEPTIONS
74802
+ invalid_parameter.
74773
74803
  ENDINTERFACE.`,
74774
- goodExample: `INTERFACE lif.
74775
- METHODS load_data
74776
- RAISING
74777
- cx_something.
74804
+ goodExample: `INTERFACE lif.
74805
+ METHODS load_data
74806
+ RAISING
74807
+ cx_something.
74778
74808
  ENDINTERFACE.`,
74779
74809
  };
74780
74810
  }
@@ -74834,15 +74864,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74834
74864
  key: "use_line_exists",
74835
74865
  title: "Use line_exists",
74836
74866
  shortDescription: `Use line_exists, from 740sp02 and up`,
74837
- extendedInformation: `
74838
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74839
-
74867
+ extendedInformation: `
74868
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74869
+
74840
74870
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74841
74871
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74842
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74843
- IF sy-subrc = 0.
74872
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74873
+ IF sy-subrc = 0.
74844
74874
  ENDIF.`,
74845
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74875
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74846
74876
  ENDIF.`,
74847
74877
  };
74848
74878
  }
@@ -74952,10 +74982,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
74952
74982
  key: "use_new",
74953
74983
  title: "Use NEW",
74954
74984
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
74955
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74956
-
74957
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74958
-
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
+
74959
74989
  Applicable from v740sp02 and up`,
74960
74990
  badExample: `CREATE OBJECT ref.`,
74961
74991
  goodExample: `ref = NEW #( ).`,
@@ -75053,13 +75083,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75053
75083
  title: "WHEN OTHERS last",
75054
75084
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75055
75085
  tags: [_irule_1.RuleTag.SingleFile],
75056
- badExample: `CASE bar.
75057
- WHEN OTHERS.
75058
- WHEN 2.
75086
+ badExample: `CASE bar.
75087
+ WHEN OTHERS.
75088
+ WHEN 2.
75059
75089
  ENDCASE.`,
75060
- goodExample: `CASE bar.
75061
- WHEN 2.
75062
- WHEN OTHERS.
75090
+ goodExample: `CASE bar.
75091
+ WHEN 2.
75092
+ WHEN OTHERS.
75063
75093
  ENDCASE.`,
75064
75094
  };
75065
75095
  }