@abaplint/cli 2.113.16 → 2.113.17

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 +856 -846
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -35165,13 +35165,13 @@ class FlowGraph {
35165
35165
  this.label = label;
35166
35166
  }
35167
35167
  toDigraph() {
35168
- return `digraph G {
35169
- labelloc="t";
35170
- label="${this.label}";
35171
- graph [fontname = "helvetica"];
35172
- node [fontname = "helvetica", shape="box"];
35173
- edge [fontname = "helvetica"];
35174
- ${this.toTextEdges()}
35168
+ return `digraph G {
35169
+ labelloc="t";
35170
+ label="${this.label}";
35171
+ graph [fontname = "helvetica"];
35172
+ node [fontname = "helvetica", shape="box"];
35173
+ edge [fontname = "helvetica"];
35174
+ ${this.toTextEdges()}
35175
35175
  }`;
35176
35176
  }
35177
35177
  listSources(node) {
@@ -43421,13 +43421,13 @@ class Help {
43421
43421
  /////////////////////////////////////////////////
43422
43422
  static dumpABAP(file, reg, textDocument, position) {
43423
43423
  let content = "";
43424
- content = `
43425
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43426
- <a href="#_statements" rel="no-refresh">Statements</a> |
43427
- <a href="#_structure" rel="no-refresh">Structure</a> |
43428
- <a href="#_files" rel="no-refresh">Files</a> |
43429
- <a href="#_info" rel="no-refresh">Info Dump</a>
43430
- <hr>
43424
+ content = `
43425
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43426
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43427
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43428
+ <a href="#_files" rel="no-refresh">Files</a> |
43429
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43430
+ <hr>
43431
43431
  ` +
43432
43432
  "<tt>" + textDocument.uri + " (" +
43433
43433
  (position.line + 1) + ", " +
@@ -52747,7 +52747,7 @@ class Registry {
52747
52747
  }
52748
52748
  static abaplintVersion() {
52749
52749
  // magic, see build script "version.sh"
52750
- return "2.113.16";
52750
+ return "2.113.17";
52751
52751
  }
52752
52752
  getDDICReferences() {
52753
52753
  return this.ddicReferences;
@@ -53066,10 +53066,10 @@ class SevenBitAscii {
53066
53066
  key: "7bit_ascii",
53067
53067
  title: "Check for 7bit ascii",
53068
53068
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53069
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53070
-
53071
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53072
-
53069
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53070
+
53071
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53072
+
53073
53073
  Checkes files with extensions ".abap" and ".asddls"`,
53074
53074
  tags: [_irule_1.RuleTag.SingleFile],
53075
53075
  badExample: `WRITE '뽑'.`,
@@ -53275,10 +53275,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53275
53275
  key: "abapdoc",
53276
53276
  title: "Check abapdoc",
53277
53277
  shortDescription: `Various checks regarding abapdoc.`,
53278
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53279
-
53280
- Plus class and interface definitions.
53281
-
53278
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53279
+
53280
+ Plus class and interface definitions.
53281
+
53282
53282
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53283
53283
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53284
53284
  };
@@ -53415,27 +53415,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53415
53415
  title: "Add test attributes for tests classes with test methods",
53416
53416
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53417
53417
  tags: [_irule_1.RuleTag.SingleFile],
53418
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53419
- PUBLIC SECTION.
53420
- PROTECTED SECTION.
53421
- PRIVATE SECTION.
53422
- METHODS test FOR TESTING RAISING cx_static_check.
53423
- ENDCLASS.
53424
-
53425
- CLASS ltcl_test1 IMPLEMENTATION.
53426
- METHOD test.
53427
- ENDMETHOD.
53418
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53419
+ PUBLIC SECTION.
53420
+ PROTECTED SECTION.
53421
+ PRIVATE SECTION.
53422
+ METHODS test FOR TESTING RAISING cx_static_check.
53423
+ ENDCLASS.
53424
+
53425
+ CLASS ltcl_test1 IMPLEMENTATION.
53426
+ METHOD test.
53427
+ ENDMETHOD.
53428
53428
  ENDCLASS.`,
53429
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53430
- PUBLIC SECTION.
53431
- PROTECTED SECTION.
53432
- PRIVATE SECTION.
53433
- METHODS test FOR TESTING RAISING cx_static_check.
53434
- ENDCLASS.
53435
-
53436
- CLASS ltcl_test2 IMPLEMENTATION.
53437
- METHOD test.
53438
- ENDMETHOD.
53429
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53430
+ PUBLIC SECTION.
53431
+ PROTECTED SECTION.
53432
+ PRIVATE SECTION.
53433
+ METHODS test FOR TESTING RAISING cx_static_check.
53434
+ ENDCLASS.
53435
+
53436
+ CLASS ltcl_test2 IMPLEMENTATION.
53437
+ METHOD test.
53438
+ ENDMETHOD.
53439
53439
  ENDCLASS.`,
53440
53440
  };
53441
53441
  }
@@ -53521,49 +53521,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53521
53521
  key: "align_parameters",
53522
53522
  title: "Align Parameters",
53523
53523
  shortDescription: `Checks for vertially aligned parameters`,
53524
- extendedInformation: `Checks:
53525
- * function module calls
53526
- * method calls
53527
- * VALUE constructors
53528
- * NEW constructors
53529
- * RAISE EXCEPTION statements
53530
- * CREATE OBJECT statements
53531
- * RAISE EVENT statements
53532
-
53533
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53534
-
53535
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53536
-
53537
- If parameters are on the same row, no issues are reported, see
53524
+ extendedInformation: `Checks:
53525
+ * function module calls
53526
+ * method calls
53527
+ * VALUE constructors
53528
+ * NEW constructors
53529
+ * RAISE EXCEPTION statements
53530
+ * CREATE OBJECT statements
53531
+ * RAISE EVENT statements
53532
+
53533
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53534
+
53535
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53536
+
53537
+ If parameters are on the same row, no issues are reported, see
53538
53538
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53539
53539
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53540
- badExample: `CALL FUNCTION 'FOOBAR'
53541
- EXPORTING
53542
- foo = 2
53543
- parameter = 3.
53544
-
53545
- foobar( moo = 1
53546
- param = 1 ).
53547
-
53548
- foo = VALUE #(
53549
- foo = bar
53540
+ badExample: `CALL FUNCTION 'FOOBAR'
53541
+ EXPORTING
53542
+ foo = 2
53543
+ parameter = 3.
53544
+
53545
+ foobar( moo = 1
53546
+ param = 1 ).
53547
+
53548
+ foo = VALUE #(
53549
+ foo = bar
53550
53550
  moo = 2 ).`,
53551
- goodExample: `CALL FUNCTION 'FOOBAR'
53552
- EXPORTING
53553
- foo = 2
53554
- parameter = 3.
53555
-
53556
- foobar( moo = 1
53557
- param = 1 ).
53558
-
53559
- foo = VALUE #(
53560
- foo = bar
53561
- moo = 2 ).
53562
-
53563
- DATA(sdf) = VALUE type(
53564
- common_val = 2
53565
- another_common = 5
53566
- ( row_value = 4
53551
+ goodExample: `CALL FUNCTION 'FOOBAR'
53552
+ EXPORTING
53553
+ foo = 2
53554
+ parameter = 3.
53555
+
53556
+ foobar( moo = 1
53557
+ param = 1 ).
53558
+
53559
+ foo = VALUE #(
53560
+ foo = bar
53561
+ moo = 2 ).
53562
+
53563
+ DATA(sdf) = VALUE type(
53564
+ common_val = 2
53565
+ another_common = 5
53566
+ ( row_value = 4
53567
53567
  value_foo = 5 ) ).`,
53568
53568
  };
53569
53569
  }
@@ -53997,37 +53997,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
53997
53997
  key: "align_type_expressions",
53998
53998
  title: "Align TYPE expressions",
53999
53999
  shortDescription: `Align TYPE expressions in statements`,
54000
- extendedInformation: `
54001
- Currently works for METHODS + BEGIN OF
54002
-
54003
- If BEGIN OF has an INCLUDE TYPE its ignored
54004
-
54005
- Also note that clean ABAP does not recommend aligning TYPE clauses:
54000
+ extendedInformation: `
54001
+ Currently works for METHODS + BEGIN OF
54002
+
54003
+ If BEGIN OF has an INCLUDE TYPE its ignored
54004
+
54005
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54006
54006
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54007
54007
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
54008
- badExample: `
54009
- TYPES: BEGIN OF foo,
54010
- bar TYPE i,
54011
- foobar TYPE i,
54012
- END OF foo.
54013
-
54014
- INTERFACE lif.
54015
- METHODS bar
54016
- IMPORTING
54017
- foo TYPE i
54018
- foobar TYPE i.
54008
+ badExample: `
54009
+ TYPES: BEGIN OF foo,
54010
+ bar TYPE i,
54011
+ foobar TYPE i,
54012
+ END OF foo.
54013
+
54014
+ INTERFACE lif.
54015
+ METHODS bar
54016
+ IMPORTING
54017
+ foo TYPE i
54018
+ foobar TYPE i.
54019
54019
  ENDINTERFACE.`,
54020
- goodExample: `
54021
- TYPES: BEGIN OF foo,
54022
- bar TYPE i,
54023
- foobar TYPE i,
54024
- END OF foo.
54025
-
54026
- INTERFACE lif.
54027
- METHODS bar
54028
- IMPORTING
54029
- foo TYPE i
54030
- foobar TYPE i.
54020
+ goodExample: `
54021
+ TYPES: BEGIN OF foo,
54022
+ bar TYPE i,
54023
+ foobar TYPE i,
54024
+ END OF foo.
54025
+
54026
+ INTERFACE lif.
54027
+ METHODS bar
54028
+ IMPORTING
54029
+ foo TYPE i
54030
+ foobar TYPE i.
54031
54031
  ENDINTERFACE.`,
54032
54032
  };
54033
54033
  }
@@ -54306,16 +54306,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54306
54306
  return {
54307
54307
  key: "ambiguous_statement",
54308
54308
  title: "Check for ambigious statements",
54309
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54310
- Add "TABLE" keyword or "@" for escaping SQL variables
54311
-
54309
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54310
+ Add "TABLE" keyword or "@" for escaping SQL variables
54311
+
54312
54312
  Only works if the target version is 740sp05 or above`,
54313
54313
  tags: [_irule_1.RuleTag.SingleFile],
54314
- badExample: `DELETE foo FROM bar.
54314
+ badExample: `DELETE foo FROM bar.
54315
54315
  MODIFY foo FROM bar.`,
54316
- goodExample: `DELETE foo FROM @bar.
54317
- DELETE TABLE itab FROM 2.
54318
- MODIFY zfoo FROM @wa.
54316
+ goodExample: `DELETE foo FROM @bar.
54317
+ DELETE TABLE itab FROM 2.
54318
+ MODIFY zfoo FROM @wa.
54319
54319
  MODIFY TABLE foo FROM bar.`,
54320
54320
  };
54321
54321
  }
@@ -54420,16 +54420,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54420
54420
  key: "avoid_use",
54421
54421
  title: "Avoid use of certain statements",
54422
54422
  shortDescription: `Detects usage of certain statements.`,
54423
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54424
-
54425
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54426
-
54427
- STATICS: use CLASS-DATA instead
54428
-
54429
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54430
-
54431
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54432
-
54423
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54424
+
54425
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54426
+
54427
+ STATICS: use CLASS-DATA instead
54428
+
54429
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54430
+
54431
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54432
+
54433
54433
  BREAK points`,
54434
54434
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54435
54435
  };
@@ -54561,11 +54561,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54561
54561
  title: "Check BEGIN END names",
54562
54562
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54563
54563
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54564
- badExample: `DATA: BEGIN OF stru,
54565
- field TYPE i,
54564
+ badExample: `DATA: BEGIN OF stru,
54565
+ field TYPE i,
54566
54566
  END OF structure_not_the_same.`,
54567
- goodExample: `DATA: BEGIN OF stru,
54568
- field TYPE i,
54567
+ goodExample: `DATA: BEGIN OF stru,
54568
+ field TYPE i,
54569
54569
  END OF stru.`,
54570
54570
  };
54571
54571
  }
@@ -54662,20 +54662,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54662
54662
  title: "BEGIN contains single INCLUDE",
54663
54663
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54664
54664
  tags: [_irule_1.RuleTag.SingleFile],
54665
- badExample: `TYPES: BEGIN OF dummy1.
54666
- INCLUDE TYPE dselc.
54667
- TYPES: END OF dummy1.
54668
-
54669
- DATA BEGIN OF foo.
54670
- INCLUDE STRUCTURE syst.
54671
- DATA END OF foo.
54672
-
54673
- STATICS BEGIN OF bar.
54674
- INCLUDE STRUCTURE syst.
54665
+ badExample: `TYPES: BEGIN OF dummy1.
54666
+ INCLUDE TYPE dselc.
54667
+ TYPES: END OF dummy1.
54668
+
54669
+ DATA BEGIN OF foo.
54670
+ INCLUDE STRUCTURE syst.
54671
+ DATA END OF foo.
54672
+
54673
+ STATICS BEGIN OF bar.
54674
+ INCLUDE STRUCTURE syst.
54675
54675
  STATICS END OF bar.`,
54676
- goodExample: `DATA BEGIN OF foo.
54677
- DATA field TYPE i.
54678
- INCLUDE STRUCTURE dselc.
54676
+ goodExample: `DATA BEGIN OF foo.
54677
+ DATA field TYPE i.
54678
+ INCLUDE STRUCTURE dselc.
54679
54679
  DATA END OF foo.`,
54680
54680
  };
54681
54681
  }
@@ -54765,9 +54765,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54765
54765
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54766
54766
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54767
54767
  badExample: `CALL TRANSACTION 'FOO'.`,
54768
- goodExample: `TRY.
54769
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54770
- CATCH cx_sy_authorization_error.
54768
+ goodExample: `TRY.
54769
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54770
+ CATCH cx_sy_authorization_error.
54771
54771
  ENDTRY.`,
54772
54772
  };
54773
54773
  }
@@ -54832,10 +54832,10 @@ class CDSCommentStyle {
54832
54832
  key: "cds_comment_style",
54833
54833
  title: "CDS Comment Style",
54834
54834
  shortDescription: `Check for obsolete comment style`,
54835
- extendedInformation: `Check for obsolete comment style
54836
-
54837
- Comments starting with "--" are considered obsolete
54838
-
54835
+ extendedInformation: `Check for obsolete comment style
54836
+
54837
+ Comments starting with "--" are considered obsolete
54838
+
54839
54839
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54840
54840
  tags: [_irule_1.RuleTag.SingleFile],
54841
54841
  badExample: "-- this is a comment",
@@ -54901,10 +54901,10 @@ class CDSLegacyView {
54901
54901
  key: "cds_legacy_view",
54902
54902
  title: "CDS Legacy View",
54903
54903
  shortDescription: `Identify CDS Legacy Views`,
54904
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54905
-
54906
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54907
-
54904
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54905
+
54906
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54907
+
54908
54908
  v755 and up`,
54909
54909
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54910
54910
  };
@@ -55059,10 +55059,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55059
55059
  key: "chain_mainly_declarations",
55060
55060
  title: "Chain mainly declarations",
55061
55061
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55062
- extendedInformation: `
55063
- https://docs.abapopenchecks.org/checks/23/
55064
-
55065
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55062
+ extendedInformation: `
55063
+ https://docs.abapopenchecks.org/checks/23/
55064
+
55065
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55066
55066
  `,
55067
55067
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55068
55068
  badExample: `CALL METHOD: bar.`,
@@ -55238,17 +55238,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55238
55238
  title: "Change IF to CASE",
55239
55239
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55240
55240
  // eslint-disable-next-line max-len
55241
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55242
-
55241
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55242
+
55243
55243
  If the first comparison is a boolean compare, no issue is reported.`,
55244
55244
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55245
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55246
- ELSEIF l_fcat-fieldname = 'BAR'
55247
- OR l_fcat-fieldname = 'MOO'.
55245
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55246
+ ELSEIF l_fcat-fieldname = 'BAR'
55247
+ OR l_fcat-fieldname = 'MOO'.
55248
55248
  ENDIF.`,
55249
- goodExample: `CASE l_fcat-fieldname.
55250
- WHEN 'FOO'.
55251
- WHEN 'BAR' OR 'MOO'.
55249
+ goodExample: `CASE l_fcat-fieldname.
55250
+ WHEN 'FOO'.
55251
+ WHEN 'BAR' OR 'MOO'.
55252
55252
  ENDCASE.`,
55253
55253
  };
55254
55254
  }
@@ -55385,8 +55385,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55385
55385
  return {
55386
55386
  key: "check_abstract",
55387
55387
  title: "Check abstract methods and classes",
55388
- shortDescription: `Checks abstract methods and classes:
55389
- - class defined as abstract and final,
55388
+ shortDescription: `Checks abstract methods and classes:
55389
+ - class defined as abstract and final,
55390
55390
  - non-abstract class contains abstract methods`,
55391
55391
  extendedInformation: `If a class defines only constants, use an interface instead`,
55392
55392
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55467,11 +55467,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55467
55467
  return {
55468
55468
  key: "check_comments",
55469
55469
  title: "Check Comments",
55470
- shortDescription: `
55470
+ shortDescription: `
55471
55471
  Various checks for comment usage.`,
55472
- extendedInformation: `
55473
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55474
-
55472
+ extendedInformation: `
55473
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55474
+
55475
55475
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55476
55476
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55477
55477
  badExample: `WRITE 2. " descriptive comment`,
@@ -55633,9 +55633,9 @@ class CheckInclude {
55633
55633
  key: "check_include",
55634
55634
  title: "Check INCLUDEs",
55635
55635
  shortDescription: `Checks INCLUDE statements`,
55636
- extendedInformation: `
55637
- * Reports unused includes
55638
- * Errors if the includes are not found
55636
+ extendedInformation: `
55637
+ * Reports unused includes
55638
+ * Errors if the includes are not found
55639
55639
  * Error if including a main program`,
55640
55640
  tags: [_irule_1.RuleTag.Syntax],
55641
55641
  };
@@ -55711,14 +55711,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55711
55711
  key: "check_subrc",
55712
55712
  title: "Check sy-subrc",
55713
55713
  shortDescription: `Check sy-subrc`,
55714
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55715
-
55716
- If sy-dbcnt is checked after database statements, it is considered okay.
55717
-
55718
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55719
-
55720
- If IS ASSIGNED is checked after assigning, it is considered okay.
55721
-
55714
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55715
+
55716
+ If sy-dbcnt is checked after database statements, it is considered okay.
55717
+
55718
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55719
+
55720
+ If IS ASSIGNED is checked after assigning, it is considered okay.
55721
+
55722
55722
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55723
55723
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55724
55724
  pseudoComment: "EC CI_SUBRC",
@@ -56288,17 +56288,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56288
56288
  shortDescription: `Find overlapping classic exceptions`,
56289
56289
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56290
56290
  tags: [_irule_1.RuleTag.SingleFile],
56291
- badExample: `CALL FUNCTION 'SOMETHING'
56292
- EXCEPTIONS
56293
- system_failure = 1 MESSAGE lv_message
56294
- communication_failure = 1 MESSAGE lv_message
56295
- resource_failure = 1
56291
+ badExample: `CALL FUNCTION 'SOMETHING'
56292
+ EXCEPTIONS
56293
+ system_failure = 1 MESSAGE lv_message
56294
+ communication_failure = 1 MESSAGE lv_message
56295
+ resource_failure = 1
56296
56296
  OTHERS = 1.`,
56297
- goodExample: `CALL FUNCTION 'SOMETHING'
56298
- EXCEPTIONS
56299
- system_failure = 1 MESSAGE lv_message
56300
- communication_failure = 2 MESSAGE lv_message
56301
- resource_failure = 3
56297
+ goodExample: `CALL FUNCTION 'SOMETHING'
56298
+ EXCEPTIONS
56299
+ system_failure = 1 MESSAGE lv_message
56300
+ communication_failure = 2 MESSAGE lv_message
56301
+ resource_failure = 3
56302
56302
  OTHERS = 4.`,
56303
56303
  };
56304
56304
  }
@@ -56544,7 +56544,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56544
56544
  key: "commented_code",
56545
56545
  title: "Find commented code",
56546
56546
  shortDescription: `Detects usage of commented out code.`,
56547
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56547
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56548
56548
  https://docs.abapopenchecks.org/checks/14/`,
56549
56549
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56550
56550
  badExample: `* WRITE 'hello world'.`,
@@ -56777,10 +56777,10 @@ class ConstructorVisibilityPublic {
56777
56777
  key: "constructor_visibility_public",
56778
56778
  title: "Check constructor visibility is public",
56779
56779
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
56780
- extendedInformation: `
56781
- This only applies to global classes.
56782
-
56783
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56780
+ extendedInformation: `
56781
+ This only applies to global classes.
56782
+
56783
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56784
56784
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56785
56785
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56786
56786
  };
@@ -56855,8 +56855,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56855
56855
  key: "contains_tab",
56856
56856
  title: "Code contains tab",
56857
56857
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56858
- extendedInformation: `
56859
- https://docs.abapopenchecks.org/checks/09/
56858
+ extendedInformation: `
56859
+ https://docs.abapopenchecks.org/checks/09/
56860
56860
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56861
56861
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56862
56862
  badExample: `\tWRITE 'hello world'.`,
@@ -56943,10 +56943,10 @@ class CyclicOO {
56943
56943
  key: "cyclic_oo",
56944
56944
  title: "Cyclic OO",
56945
56945
  shortDescription: `Finds cyclic/circular OO references`,
56946
- extendedInformation: `Runs for global INTF + CLAS objects
56947
-
56948
- Objects must be without syntax errors for this rule to take effect
56949
-
56946
+ extendedInformation: `Runs for global INTF + CLAS objects
56947
+
56948
+ Objects must be without syntax errors for this rule to take effect
56949
+
56950
56950
  References in testclass includes are ignored`,
56951
56951
  };
56952
56952
  }
@@ -57189,7 +57189,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57189
57189
  key: "dangerous_statement",
57190
57190
  title: "Dangerous statement",
57191
57191
  shortDescription: `Detects potentially dangerous statements`,
57192
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57192
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57193
57193
  dynamic SQL can potentially create SQL injection problems`,
57194
57194
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57195
57195
  };
@@ -57396,13 +57396,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57396
57396
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57397
57397
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57398
57398
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57399
- badExample: `FROM foo.
57400
- WRITE 'hello'.
57401
- DATA int TYPE i.
57399
+ badExample: `FROM foo.
57400
+ WRITE 'hello'.
57401
+ DATA int TYPE i.
57402
57402
  ENDFORM.`,
57403
- goodExample: `FROM foo.
57404
- DATA int TYPE i.
57405
- WRITE 'hello'.
57403
+ goodExample: `FROM foo.
57404
+ DATA int TYPE i.
57405
+ WRITE 'hello'.
57406
57406
  ENDFORM.`,
57407
57407
  };
57408
57408
  }
@@ -57941,39 +57941,39 @@ class Downport {
57941
57941
  key: "downport",
57942
57942
  title: "Downport statement",
57943
57943
  shortDescription: `Downport functionality`,
57944
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57945
- a higher level language version. If successful, various rules are applied to downport the statement.
57946
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57947
-
57948
- Current rules:
57949
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57950
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57951
- * FIELD-SYMBOL() definitions are outlined
57952
- * CONV is outlined
57953
- * COND is outlined
57954
- * REDUCE is outlined
57955
- * SWITCH is outlined
57956
- * FILTER is outlined
57957
- * APPEND expression is outlined
57958
- * INSERT expression is outlined
57959
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57960
- * CAST changed to ?=
57961
- * LOOP AT method_call( ) is outlined
57962
- * VALUE # with structure fields
57963
- * VALUE # with internal table lines
57964
- * Table Expressions are outlined
57965
- * SELECT INTO @DATA definitions are outlined
57966
- * Some occurrences of string template formatting option ALPHA changed to function module call
57967
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57968
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57969
- * RAISE EXCEPTION ... MESSAGE
57970
- * Moving with +=, -=, /=, *=, &&= is expanded
57971
- * line_exists and line_index is downported to READ TABLE
57972
- * ENUMs, but does not nessesarily give the correct type and value
57973
- * MESSAGE with non simple source
57974
-
57975
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57976
-
57944
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57945
+ a higher level language version. If successful, various rules are applied to downport the statement.
57946
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
57947
+
57948
+ Current rules:
57949
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57950
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57951
+ * FIELD-SYMBOL() definitions are outlined
57952
+ * CONV is outlined
57953
+ * COND is outlined
57954
+ * REDUCE is outlined
57955
+ * SWITCH is outlined
57956
+ * FILTER is outlined
57957
+ * APPEND expression is outlined
57958
+ * INSERT expression is outlined
57959
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57960
+ * CAST changed to ?=
57961
+ * LOOP AT method_call( ) is outlined
57962
+ * VALUE # with structure fields
57963
+ * VALUE # with internal table lines
57964
+ * Table Expressions are outlined
57965
+ * SELECT INTO @DATA definitions are outlined
57966
+ * Some occurrences of string template formatting option ALPHA changed to function module call
57967
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57968
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57969
+ * RAISE EXCEPTION ... MESSAGE
57970
+ * Moving with +=, -=, /=, *=, &&= is expanded
57971
+ * line_exists and line_index is downported to READ TABLE
57972
+ * ENUMs, but does not nessesarily give the correct type and value
57973
+ * MESSAGE with non simple source
57974
+
57975
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57976
+
57977
57977
  Make sure to test the downported code, it might not always be completely correct.`,
57978
57978
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57979
57979
  };
@@ -58551,17 +58551,17 @@ Make sure to test the downported code, it might not always be completely correct
58551
58551
  const fieldName = f.concatTokens();
58552
58552
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58553
58553
  }
58554
- fieldDefinition = `DATA: BEGIN OF ${name},
58554
+ fieldDefinition = `DATA: BEGIN OF ${name},
58555
58555
  ${fieldDefinition}${indentation} END OF ${name}.`;
58556
58556
  }
58557
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58557
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58558
58558
  ${indentation}`);
58559
58559
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58560
58560
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
58561
58561
  return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), "Outline SELECT @DATA", this.getMetadata().key, this.conf.severity, fix);
58562
58562
  }
58563
58563
  downportSelectTableInline(low, high, lowFile, highSyntax) {
58564
- var _a, _b, _c, _d, _e;
58564
+ var _a, _b, _c, _d, _e, _f, _g;
58565
58565
  if (!(low.get() instanceof _statement_1.Unknown)) {
58566
58566
  return undefined;
58567
58567
  }
@@ -58582,13 +58582,22 @@ ${indentation}`);
58582
58582
  if (tableName === undefined) {
58583
58583
  return undefined;
58584
58584
  }
58585
+ const tableMap = {};
58586
+ for (const from of sqlFrom) {
58587
+ const dbName = (_c = from.findDirectExpression(Expressions.DatabaseTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
58588
+ if (dbName === undefined) {
58589
+ continue;
58590
+ }
58591
+ const asName = ((_d = from.findDirectExpression(Expressions.SQLAsName)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase()) || dbName;
58592
+ tableMap[asName] = dbName;
58593
+ }
58585
58594
  const fieldList = high.findFirstExpression(Expressions.SQLFieldList);
58586
58595
  if (fieldList === undefined) {
58587
58596
  return undefined;
58588
58597
  }
58589
58598
  let fieldDefinitions = "";
58590
58599
  for (const f of fieldList.findAllExpressions(Expressions.SQLField)) {
58591
- let fieldName = (_c = f.findFirstExpression(Expressions.SQLFieldName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
58600
+ let fieldName = (_e = f.findFirstExpression(Expressions.SQLFieldName)) === null || _e === void 0 ? void 0 : _e.concatTokens();
58592
58601
  if (fieldName === undefined) {
58593
58602
  continue;
58594
58603
  }
@@ -58597,18 +58606,19 @@ ${indentation}`);
58597
58606
  tableName = split[0];
58598
58607
  fieldName = split[1];
58599
58608
  }
58600
- const typeName = tableName + "-" + fieldName;
58601
- fieldName = ((_d = f.findFirstExpression(Expressions.SQLAsName)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || fieldName;
58602
- fieldDefinitions += indentation + " " + fieldName + " TYPE " + typeName + ",\n";
58609
+ const translated = tableMap[tableName.toUpperCase()];
58610
+ const typeName = translated + "-" + fieldName;
58611
+ fieldName = ((_f = f.findFirstExpression(Expressions.SQLAsName)) === null || _f === void 0 ? void 0 : _f.concatTokens()) || fieldName;
58612
+ fieldDefinitions += indentation + " " + fieldName + " TYPE " + typeName.toLowerCase() + ",\n";
58603
58613
  }
58604
58614
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58605
- const name = ((_e = inlineData.findFirstExpression(Expressions.TargetField)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "error";
58606
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58607
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58608
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58615
+ const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
58616
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58617
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58618
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58609
58619
  ${indentation}`);
58610
58620
  if (fieldDefinitions === "") {
58611
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58621
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58612
58622
  ${indentation}`);
58613
58623
  }
58614
58624
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58676,7 +58686,7 @@ ${indentation}`);
58676
58686
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58677
58687
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58678
58688
  const firstToken = high.getFirstToken();
58679
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58689
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58680
58690
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58681
58691
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58682
58692
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58730,7 +58740,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58730
58740
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58731
58741
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58732
58742
  const firstToken = high.getFirstToken();
58733
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58743
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58734
58744
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58735
58745
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58736
58746
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58772,14 +58782,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58772
58782
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58773
58783
  const firstToken = high.getFirstToken();
58774
58784
  // note that the tabix restore should be done before throwing the exception
58775
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58776
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58777
- ${indentation}${tabixBackup} = sy-tabix.
58778
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58779
- ${indentation}sy-tabix = ${tabixBackup}.
58780
- ${indentation}IF sy-subrc <> 0.
58781
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58782
- ${indentation}ENDIF.
58785
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58786
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58787
+ ${indentation}${tabixBackup} = sy-tabix.
58788
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58789
+ ${indentation}sy-tabix = ${tabixBackup}.
58790
+ ${indentation}IF sy-subrc <> 0.
58791
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58792
+ ${indentation}ENDIF.
58783
58793
  ${indentation}`);
58784
58794
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58785
58795
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58836,7 +58846,7 @@ ${indentation}`);
58836
58846
  const className = classNames[0].concatTokens();
58837
58847
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58838
58848
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58839
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58849
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58840
58850
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58841
58851
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58842
58852
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -58998,16 +59008,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
58998
59008
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58999
59009
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59000
59010
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59001
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59002
- ${indentation}${uniqueName1}-msgid = ${id}.
59011
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59012
+ ${indentation}${uniqueName1}-msgid = ${id}.
59003
59013
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59004
59014
  if (withs.length > 0) {
59005
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59006
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59007
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59015
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59016
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59017
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59008
59018
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59009
59019
  }
59010
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59020
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59011
59021
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59012
59022
  if (withs.length > 0) {
59013
59023
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59119,10 +59129,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59119
59129
  let code = "";
59120
59130
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59121
59131
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59122
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59123
- IF sy-subrc <> 0.
59124
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59125
- ENDIF.
59132
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59133
+ IF sy-subrc <> 0.
59134
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59135
+ ENDIF.
59126
59136
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59127
59137
  }
59128
59138
  else {
@@ -59211,20 +59221,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59211
59221
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59212
59222
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59213
59223
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59214
- code += ` items LIKE ${loopSourceName},
59215
- END OF ${groupTargetName}type.
59216
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59217
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59224
+ code += ` items LIKE ${loopSourceName},
59225
+ END OF ${groupTargetName}type.
59226
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59227
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59218
59228
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59219
59229
  if (groupIndexName !== undefined) {
59220
59230
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59221
59231
  }
59222
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59232
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59223
59233
  IF sy-subrc = 0.\n`;
59224
59234
  if (groupCountName !== undefined) {
59225
59235
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59226
59236
  }
59227
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59237
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59228
59238
  ELSE.\n`;
59229
59239
  code += ` CLEAR ${uniqueName}.\n`;
59230
59240
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59245,8 +59255,8 @@ ELSE.\n`;
59245
59255
  }
59246
59256
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59247
59257
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59248
- code += `ENDIF.
59249
- ENDLOOP.
59258
+ code += `ENDIF.
59259
+ ENDLOOP.
59250
59260
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59251
59261
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59252
59262
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59418,7 +59428,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59418
59428
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59419
59429
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59420
59430
  // all ENUMS are char like?
59421
- let code = `TYPES ${enumName} TYPE string.
59431
+ let code = `TYPES ${enumName} TYPE string.
59422
59432
  CONSTANTS: BEGIN OF ${structureName},\n`;
59423
59433
  let count = 1;
59424
59434
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59462,14 +59472,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59462
59472
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59463
59473
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59464
59474
  // restore tabix before exeption
59465
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59466
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59467
- ${indentation}${tabixBackup} = sy-tabix.
59468
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59469
- ${indentation}sy-tabix = ${tabixBackup}.
59470
- ${indentation}IF sy-subrc <> 0.
59471
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59472
- ${indentation}ENDIF.
59475
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59476
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59477
+ ${indentation}${tabixBackup} = sy-tabix.
59478
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59479
+ ${indentation}sy-tabix = ${tabixBackup}.
59480
+ ${indentation}IF sy-subrc <> 0.
59481
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59482
+ ${indentation}ENDIF.
59473
59483
  ${indentation}${uniqueName}`;
59474
59484
  const start = target.getFirstToken().getStart();
59475
59485
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59553,11 +59563,11 @@ ${indentation}${uniqueName}`;
59553
59563
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59554
59564
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59555
59565
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59556
- const code = `DATA ${uniqueName} TYPE string.
59557
- ${indentation}CALL FUNCTION '${functionName}'
59558
- ${indentation} EXPORTING
59559
- ${indentation} input = ${source}
59560
- ${indentation} IMPORTING
59566
+ const code = `DATA ${uniqueName} TYPE string.
59567
+ ${indentation}CALL FUNCTION '${functionName}'
59568
+ ${indentation} EXPORTING
59569
+ ${indentation} input = ${source}
59570
+ ${indentation} IMPORTING
59561
59571
  ${indentation} output = ${uniqueName}.\n`;
59562
59572
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59563
59573
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60869,12 +60879,12 @@ class EasyToFindMessages {
60869
60879
  key: "easy_to_find_messages",
60870
60880
  title: "Easy to find messages",
60871
60881
  shortDescription: `Make messages easy to find`,
60872
- extendedInformation: `All messages must be statically referenced exactly once
60873
-
60874
- Only MESSAGE and RAISE statments are counted as static references
60875
-
60876
- Also see rule "message_exists"
60877
-
60882
+ extendedInformation: `All messages must be statically referenced exactly once
60883
+
60884
+ Only MESSAGE and RAISE statments are counted as static references
60885
+
60886
+ Also see rule "message_exists"
60887
+
60878
60888
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60879
60889
  tags: [_irule_1.RuleTag.Styleguide],
60880
60890
  };
@@ -60955,13 +60965,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
60955
60965
  shortDescription: `Empty selection screen or list processing event block`,
60956
60966
  extendedInformation: ``,
60957
60967
  tags: [_irule_1.RuleTag.SingleFile],
60958
- badExample: `
60959
- INITIALIZATION.
60960
- WRITE 'hello'.
60968
+ badExample: `
60969
+ INITIALIZATION.
60970
+ WRITE 'hello'.
60961
60971
  END-OF-SELECTION.`,
60962
- goodExample: `
60963
- START-OF-SELECTION.
60964
- PERFORM sdf.
60972
+ goodExample: `
60973
+ START-OF-SELECTION.
60974
+ PERFORM sdf.
60965
60975
  COMMIT WORK.`,
60966
60976
  };
60967
60977
  }
@@ -61053,8 +61063,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61053
61063
  key: "empty_line_in_statement",
61054
61064
  title: "Find empty lines in statements",
61055
61065
  shortDescription: `Checks that statements do not contain empty lines.`,
61056
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61057
-
61066
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61067
+
61058
61068
  https://docs.abapopenchecks.org/checks/41/`,
61059
61069
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61060
61070
  badExample: `WRITE\n\nhello.`,
@@ -61230,13 +61240,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61230
61240
  shortDescription: `Checks that the code does not contain empty blocks.`,
61231
61241
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61232
61242
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61233
- badExample: `IF foo = bar.
61234
- ENDIF.
61235
-
61236
- DO 2 TIMES.
61243
+ badExample: `IF foo = bar.
61244
+ ENDIF.
61245
+
61246
+ DO 2 TIMES.
61237
61247
  ENDDO.`,
61238
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61239
- ENDLOOP.
61248
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61249
+ ENDLOOP.
61240
61250
  result = xsdbool( sy-subrc = 0 ).`,
61241
61251
  };
61242
61252
  }
@@ -61378,10 +61388,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61378
61388
  return {
61379
61389
  key: "exit_or_check",
61380
61390
  title: "Find EXIT or CHECK outside loops",
61381
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61391
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61382
61392
  Use RETURN to leave procesing blocks instead.`,
61383
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61384
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61393
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61394
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61385
61395
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61386
61396
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61387
61397
  };
@@ -61464,12 +61474,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61464
61474
  key: "expand_macros",
61465
61475
  title: "Expand Macros",
61466
61476
  shortDescription: `Allows expanding macro calls with quick fixes`,
61467
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61468
-
61477
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61478
+
61469
61479
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61470
- badExample: `DEFINE _hello.
61471
- WRITE 'hello'.
61472
- END-OF-DEFINITION.
61480
+ badExample: `DEFINE _hello.
61481
+ WRITE 'hello'.
61482
+ END-OF-DEFINITION.
61473
61483
  _hello.`,
61474
61484
  goodExample: `WRITE 'hello'.`,
61475
61485
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61556,7 +61566,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61556
61566
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61557
61567
  badExample: `call_method( EXPORTING foo = bar ).`,
61558
61568
  goodExample: `call_method( foo = bar ).`,
61559
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61569
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61560
61570
  https://docs.abapopenchecks.org/checks/30/`,
61561
61571
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61562
61572
  };
@@ -61654,7 +61664,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61654
61664
  key: "forbidden_identifier",
61655
61665
  title: "Forbidden Identifier",
61656
61666
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61657
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61667
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61658
61668
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61659
61669
  tags: [_irule_1.RuleTag.SingleFile],
61660
61670
  };
@@ -61896,8 +61906,8 @@ class ForbiddenVoidType {
61896
61906
  key: "forbidden_void_type",
61897
61907
  title: "Forbidden Void Types",
61898
61908
  shortDescription: `Avoid usage of specified void types.`,
61899
- extendedInformation: `Inspiration:
61900
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61909
+ extendedInformation: `Inspiration:
61910
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61901
61911
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61902
61912
  };
61903
61913
  }
@@ -62140,7 +62150,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62140
62150
  key: "fully_type_itabs",
62141
62151
  title: "Fully type internal tables",
62142
62152
  shortDescription: `No implict table types or table keys`,
62143
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62153
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62144
62154
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62145
62155
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62146
62156
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62325,26 +62335,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62325
62335
  key: "functional_writing",
62326
62336
  title: "Use functional writing",
62327
62337
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62328
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62338
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62329
62339
  https://docs.abapopenchecks.org/checks/07/`,
62330
62340
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62331
- badExample: `CALL METHOD zcl_class=>method( ).
62332
- CALL METHOD cl_abap_typedescr=>describe_by_name
62333
- EXPORTING
62334
- p_name = 'NAME'
62335
- RECEIVING
62336
- p_descr_ref = lr_typedescr
62337
- EXCEPTIONS
62338
- type_not_found = 1
62341
+ badExample: `CALL METHOD zcl_class=>method( ).
62342
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62343
+ EXPORTING
62344
+ p_name = 'NAME'
62345
+ RECEIVING
62346
+ p_descr_ref = lr_typedescr
62347
+ EXCEPTIONS
62348
+ type_not_found = 1
62339
62349
  OTHERS = 2.`,
62340
- goodExample: `zcl_class=>method( ).
62341
- cl_abap_typedescr=>describe_by_name(
62342
- EXPORTING
62343
- p_name = 'NAME'
62344
- RECEIVING
62345
- p_descr_ref = lr_typedescr
62346
- EXCEPTIONS
62347
- type_not_found = 1
62350
+ goodExample: `zcl_class=>method( ).
62351
+ cl_abap_typedescr=>describe_by_name(
62352
+ EXPORTING
62353
+ p_name = 'NAME'
62354
+ RECEIVING
62355
+ p_descr_ref = lr_typedescr
62356
+ EXCEPTIONS
62357
+ type_not_found = 1
62348
62358
  OTHERS = 2 ).`,
62349
62359
  };
62350
62360
  }
@@ -62455,14 +62465,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62455
62465
  key: "global_class",
62456
62466
  title: "Global class checks",
62457
62467
  shortDescription: `Checks related to global classes`,
62458
- extendedInformation: `* global classes must be in own files
62459
-
62460
- * file names must match class name
62461
-
62462
- * file names must match interface name
62463
-
62464
- * global classes must be global definitions
62465
-
62468
+ extendedInformation: `* global classes must be in own files
62469
+
62470
+ * file names must match class name
62471
+
62472
+ * file names must match interface name
62473
+
62474
+ * global classes must be global definitions
62475
+
62466
62476
  * global interfaces must be global definitions`,
62467
62477
  tags: [_irule_1.RuleTag.Syntax],
62468
62478
  };
@@ -62561,21 +62571,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62561
62571
  return {
62562
62572
  key: "identical_conditions",
62563
62573
  title: "Identical conditions",
62564
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62565
-
62574
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62575
+
62566
62576
  Prerequsites: code is pretty printed with identical cAsE`,
62567
62577
  tags: [_irule_1.RuleTag.SingleFile],
62568
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62569
- ENDIF.
62570
- CASE bar.
62571
- WHEN '1'.
62572
- WHEN 'A' OR '1'.
62578
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62579
+ ENDIF.
62580
+ CASE bar.
62581
+ WHEN '1'.
62582
+ WHEN 'A' OR '1'.
62573
62583
  ENDCASE.`,
62574
- goodExample: `IF foo = bar OR 1 = a.
62575
- ENDIF.
62576
- CASE bar.
62577
- WHEN '1'.
62578
- WHEN 'A'.
62584
+ goodExample: `IF foo = bar OR 1 = a.
62585
+ ENDIF.
62586
+ CASE bar.
62587
+ WHEN '1'.
62588
+ WHEN 'A'.
62579
62589
  ENDCASE.`,
62580
62590
  };
62581
62591
  }
@@ -62709,23 +62719,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62709
62719
  key: "identical_contents",
62710
62720
  title: "Identical contents",
62711
62721
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62712
- extendedInformation: `
62713
- Prerequsites: code is pretty printed with identical cAsE
62714
-
62722
+ extendedInformation: `
62723
+ Prerequsites: code is pretty printed with identical cAsE
62724
+
62715
62725
  Chained statments are ignored`,
62716
62726
  tags: [_irule_1.RuleTag.SingleFile],
62717
- badExample: `IF foo = bar.
62718
- WRITE 'bar'.
62719
- WRITE 'world'.
62720
- ELSE.
62721
- WRITE 'foo'.
62722
- WRITE 'world'.
62727
+ badExample: `IF foo = bar.
62728
+ WRITE 'bar'.
62729
+ WRITE 'world'.
62730
+ ELSE.
62731
+ WRITE 'foo'.
62732
+ WRITE 'world'.
62723
62733
  ENDIF.`,
62724
- goodExample: `IF foo = bar.
62725
- WRITE 'bar'.
62726
- ELSE.
62727
- WRITE 'foo'.
62728
- ENDIF.
62734
+ goodExample: `IF foo = bar.
62735
+ WRITE 'bar'.
62736
+ ELSE.
62737
+ WRITE 'foo'.
62738
+ ENDIF.
62729
62739
  WRITE 'world'.`,
62730
62740
  };
62731
62741
  }
@@ -62833,12 +62843,12 @@ class IdenticalDescriptions {
62833
62843
  key: "identical_descriptions",
62834
62844
  title: "Identical descriptions",
62835
62845
  shortDescription: `Searches for objects with the same type and same description`,
62836
- extendedInformation: `Case insensitive
62837
-
62838
- Only checks the master language descriptions
62839
-
62840
- Dependencies are skipped
62841
-
62846
+ extendedInformation: `Case insensitive
62847
+
62848
+ Only checks the master language descriptions
62849
+
62850
+ Dependencies are skipped
62851
+
62842
62852
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62843
62853
  tags: [],
62844
62854
  };
@@ -63012,43 +63022,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63012
63022
  key: "if_in_if",
63013
63023
  title: "IF in IF",
63014
63024
  shortDescription: `Detects nested ifs which can be refactored.`,
63015
- extendedInformation: `
63016
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
63017
-
63018
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63019
-
63020
- https://docs.abapopenchecks.org/checks/01/
63025
+ extendedInformation: `
63026
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63027
+
63028
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63029
+
63030
+ https://docs.abapopenchecks.org/checks/01/
63021
63031
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
63022
- badExample: `IF condition1.
63023
- IF condition2.
63024
- ...
63025
- ENDIF.
63026
- ENDIF.
63027
-
63028
- IF condition1.
63029
- ...
63030
- ELSE.
63031
- IF condition2.
63032
- ...
63033
- ENDIF.
63032
+ badExample: `IF condition1.
63033
+ IF condition2.
63034
+ ...
63035
+ ENDIF.
63036
+ ENDIF.
63037
+
63038
+ IF condition1.
63039
+ ...
63040
+ ELSE.
63041
+ IF condition2.
63042
+ ...
63043
+ ENDIF.
63034
63044
  ENDIF.`,
63035
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63036
- ...
63037
- ENDIF.
63038
-
63039
- IF condition1.
63040
- ...
63041
- ELSEIF condition2.
63042
- ...
63043
- ENDIF.
63044
-
63045
- CASE variable.
63046
- WHEN value1.
63047
- ...
63048
- WHEN value2.
63049
- IF condition2.
63050
- ...
63051
- ENDIF.
63045
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63046
+ ...
63047
+ ENDIF.
63048
+
63049
+ IF condition1.
63050
+ ...
63051
+ ELSEIF condition2.
63052
+ ...
63053
+ ENDIF.
63054
+
63055
+ CASE variable.
63056
+ WHEN value1.
63057
+ ...
63058
+ WHEN value2.
63059
+ IF condition2.
63060
+ ...
63061
+ ENDIF.
63052
63062
  ENDCASE.`,
63053
63063
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63054
63064
  };
@@ -63233,9 +63243,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63233
63243
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63234
63244
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63235
63245
  if (name === impl.identifier.getName().toUpperCase()) {
63236
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63237
- METHOD ${methodName.toLowerCase()}.
63238
- RETURN. " todo, implement method
63246
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63247
+ METHOD ${methodName.toLowerCase()}.
63248
+ RETURN. " todo, implement method
63239
63249
  ENDMETHOD.`);
63240
63250
  }
63241
63251
  }
@@ -63414,14 +63424,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63414
63424
  key: "implicit_start_of_selection",
63415
63425
  title: "Implicit START-OF-SELECTION",
63416
63426
  shortDescription: `Add explicit selection screen event handling`,
63417
- extendedInformation: `Only runs for executable programs
63418
-
63427
+ extendedInformation: `Only runs for executable programs
63428
+
63419
63429
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63420
63430
  tags: [_irule_1.RuleTag.SingleFile],
63421
- badExample: `REPORT zfoo.
63431
+ badExample: `REPORT zfoo.
63422
63432
  WRITE 'hello'.`,
63423
- goodExample: `
63424
- START-OF-SELECTION.
63433
+ goodExample: `
63434
+ START-OF-SELECTION.
63425
63435
  WRITE 'hello'.`,
63426
63436
  };
63427
63437
  }
@@ -63526,19 +63536,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63526
63536
  key: "in_statement_indentation",
63527
63537
  title: "In-statement indentation",
63528
63538
  shortDescription: "Checks alignment within statements which span multiple lines.",
63529
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63530
-
63531
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63539
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63540
+
63541
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63532
63542
  to distinguish them better from code within the block.`,
63533
- badExample: `IF 1 = 1
63534
- AND 2 = 2.
63535
- WRITE 'hello' &&
63536
- 'world'.
63543
+ badExample: `IF 1 = 1
63544
+ AND 2 = 2.
63545
+ WRITE 'hello' &&
63546
+ 'world'.
63537
63547
  ENDIF.`,
63538
- goodExample: `IF 1 = 1
63539
- AND 2 = 2.
63540
- WRITE 'hello' &&
63541
- 'world'.
63548
+ goodExample: `IF 1 = 1
63549
+ AND 2 = 2.
63550
+ WRITE 'hello' &&
63551
+ 'world'.
63542
63552
  ENDIF.`,
63543
63553
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63544
63554
  };
@@ -63661,23 +63671,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63661
63671
  title: "Indentation",
63662
63672
  shortDescription: `Checks indentation`,
63663
63673
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63664
- badExample: `CLASS lcl DEFINITION.
63665
- PRIVATE SECTION.
63666
- METHODS constructor.
63667
- ENDCLASS.
63668
-
63669
- CLASS lcl IMPLEMENTATION.
63670
- METHOD constructor.
63671
- ENDMETHOD.
63674
+ badExample: `CLASS lcl DEFINITION.
63675
+ PRIVATE SECTION.
63676
+ METHODS constructor.
63677
+ ENDCLASS.
63678
+
63679
+ CLASS lcl IMPLEMENTATION.
63680
+ METHOD constructor.
63681
+ ENDMETHOD.
63672
63682
  ENDCLASS.`,
63673
- goodExample: `CLASS lcl DEFINITION.
63674
- PRIVATE SECTION.
63675
- METHODS constructor.
63676
- ENDCLASS.
63677
-
63678
- CLASS lcl IMPLEMENTATION.
63679
- METHOD constructor.
63680
- ENDMETHOD.
63683
+ goodExample: `CLASS lcl DEFINITION.
63684
+ PRIVATE SECTION.
63685
+ METHODS constructor.
63686
+ ENDCLASS.
63687
+
63688
+ CLASS lcl IMPLEMENTATION.
63689
+ METHOD constructor.
63690
+ ENDMETHOD.
63681
63691
  ENDCLASS.`,
63682
63692
  };
63683
63693
  }
@@ -64078,9 +64088,9 @@ class IntfReferencingClas {
64078
64088
  key: "intf_referencing_clas",
64079
64089
  title: "INTF referencing CLAS",
64080
64090
  shortDescription: `Interface contains references to class`,
64081
- extendedInformation: `Only global interfaces are checked.
64082
- Only first level references are checked.
64083
- Exception class references are ignored.
64091
+ extendedInformation: `Only global interfaces are checked.
64092
+ Only first level references are checked.
64093
+ Exception class references are ignored.
64084
64094
  Void references are ignored.`,
64085
64095
  };
64086
64096
  }
@@ -64165,9 +64175,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64165
64175
  title: "Invalid Table Index",
64166
64176
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64167
64177
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64168
- badExample: `DATA(first) = table[ 0 ].
64178
+ badExample: `DATA(first) = table[ 0 ].
64169
64179
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64170
- goodExample: `DATA(first) = table[ 1 ].
64180
+ goodExample: `DATA(first) = table[ 1 ].
64171
64181
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64172
64182
  };
64173
64183
  }
@@ -64768,8 +64778,8 @@ class LineBreakStyle {
64768
64778
  return {
64769
64779
  key: "line_break_style",
64770
64780
  title: "Makes sure line breaks are consistent in the ABAP code",
64771
- shortDescription: `Enforces LF as newlines in ABAP files
64772
-
64781
+ shortDescription: `Enforces LF as newlines in ABAP files
64782
+
64773
64783
  abapGit does not work with CRLF`,
64774
64784
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64775
64785
  };
@@ -64838,7 +64848,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64838
64848
  key: "line_length",
64839
64849
  title: "Line length",
64840
64850
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64841
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64851
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64842
64852
  https://docs.abapopenchecks.org/checks/04/`,
64843
64853
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64844
64854
  };
@@ -64909,7 +64919,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64909
64919
  key: "line_only_punc",
64910
64920
  title: "Line containing only punctuation",
64911
64921
  shortDescription: `Detects lines containing only punctuation.`,
64912
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64922
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64913
64923
  https://docs.abapopenchecks.org/checks/16/`,
64914
64924
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64915
64925
  badExample: "zcl_class=>method(\n).",
@@ -65172,15 +65182,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65172
65182
  return {
65173
65183
  key: "local_variable_names",
65174
65184
  title: "Local variable naming conventions",
65175
- shortDescription: `
65176
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65185
+ shortDescription: `
65186
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65177
65187
  Regexes are case-insensitive.`,
65178
65188
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65179
- badExample: `FORM bar.
65180
- DATA foo.
65189
+ badExample: `FORM bar.
65190
+ DATA foo.
65181
65191
  ENDFORM.`,
65182
- goodExample: `FORM bar.
65183
- DATA lv_foo.
65192
+ goodExample: `FORM bar.
65193
+ DATA lv_foo.
65184
65194
  ENDFORM.`,
65185
65195
  };
65186
65196
  }
@@ -65332,9 +65342,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65332
65342
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65333
65343
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65334
65344
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65335
- badExample: `DEFINE something.
65345
+ badExample: `DEFINE something.
65336
65346
  END-OF-DEFINITION.`,
65337
- goodExample: `DEFINE _something.
65347
+ goodExample: `DEFINE _something.
65338
65348
  END-OF-DEFINITION.`,
65339
65349
  };
65340
65350
  }
@@ -65407,10 +65417,10 @@ class MainFileContents {
65407
65417
  key: "main_file_contents",
65408
65418
  title: "Main file contents",
65409
65419
  shortDescription: `Checks related to report declarations.`,
65410
- extendedInformation: `Does not run if the target version is Cloud
65411
-
65412
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65413
- * TYPEs must begin with "TYPE-POOL <name>."
65420
+ extendedInformation: `Does not run if the target version is Cloud
65421
+
65422
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65423
+ * TYPEs must begin with "TYPE-POOL <name>."
65414
65424
  `,
65415
65425
  };
65416
65426
  }
@@ -65526,17 +65536,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65526
65536
  title: "Too many parentheses",
65527
65537
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65528
65538
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65529
- badExample: `
65530
- IF ( destination IS INITIAL ).
65531
- ENDIF.
65532
- IF foo = boo AND ( bar = lar AND moo = loo ).
65533
- ENDIF.
65539
+ badExample: `
65540
+ IF ( destination IS INITIAL ).
65541
+ ENDIF.
65542
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65543
+ ENDIF.
65534
65544
  `,
65535
- goodExample: `
65536
- IF destination IS INITIAL.
65537
- ENDIF.
65538
- IF foo = boo AND bar = lar AND moo = loo.
65539
- ENDIF.
65545
+ goodExample: `
65546
+ IF destination IS INITIAL.
65547
+ ENDIF.
65548
+ IF foo = boo AND bar = lar AND moo = loo.
65549
+ ENDIF.
65540
65550
  `,
65541
65551
  };
65542
65552
  }
@@ -65710,14 +65720,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65710
65720
  title: "Max one method parameter definition per line",
65711
65721
  shortDescription: `Keep max one method parameter description per line`,
65712
65722
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65713
- badExample: `
65714
- METHODS apps_scope_token
65715
- IMPORTING
65723
+ badExample: `
65724
+ METHODS apps_scope_token
65725
+ IMPORTING
65716
65726
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65717
- goodExample: `
65718
- METHODS apps_scope_token
65719
- IMPORTING
65720
- body TYPE bodyapps_scope_token
65727
+ goodExample: `
65728
+ METHODS apps_scope_token
65729
+ IMPORTING
65730
+ body TYPE bodyapps_scope_token
65721
65731
  client_id TYPE str.`,
65722
65732
  };
65723
65733
  }
@@ -65782,11 +65792,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65782
65792
  key: "max_one_statement",
65783
65793
  title: "Max one statement per line",
65784
65794
  shortDescription: `Checks that each line contains only a single statement.`,
65785
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65786
-
65787
- Does not report anything for chained statements.
65788
-
65789
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65795
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65796
+
65797
+ Does not report anything for chained statements.
65798
+
65799
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65790
65800
  https://docs.abapopenchecks.org/checks/11/`,
65791
65801
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65792
65802
  badExample: `WRITE foo. WRITE bar.`,
@@ -66124,8 +66134,8 @@ class MethodLength {
66124
66134
  key: "method_length",
66125
66135
  title: "Method/Form Length",
66126
66136
  shortDescription: `Checks relating to method/form length.`,
66127
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66128
-
66137
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66138
+
66129
66139
  Abstract methods without statements are considered okay.`,
66130
66140
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66131
66141
  };
@@ -66230,20 +66240,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66230
66240
  key: "method_overwrites_builtin",
66231
66241
  title: "Method name overwrites builtin function",
66232
66242
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66233
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66234
-
66235
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66236
-
66243
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66244
+
66245
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66246
+
66237
66247
  Interface method names are ignored`,
66238
66248
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66239
- badExample: `CLASS lcl DEFINITION.
66240
- PUBLIC SECTION.
66241
- METHODS matches.
66242
- ENDCLASS.
66243
-
66244
- CLASS lcl IMPLEMENTATION.
66245
- METHOD matches.
66246
- ENDMETHOD.
66249
+ badExample: `CLASS lcl DEFINITION.
66250
+ PUBLIC SECTION.
66251
+ METHODS matches.
66252
+ ENDCLASS.
66253
+
66254
+ CLASS lcl IMPLEMENTATION.
66255
+ METHOD matches.
66256
+ ENDMETHOD.
66247
66257
  ENDCLASS.`,
66248
66258
  };
66249
66259
  }
@@ -66434,12 +66444,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66434
66444
  // eslint-disable-next-line max-len
66435
66445
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66436
66446
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66437
- badExample: `CLASS lcl DEFINITION.
66438
- PUBLIC SECTION.
66439
- METHODS
66440
- foobar
66441
- EXPORTING foo TYPE i
66442
- RETURNING VALUE(rv_string) TYPE string.
66447
+ badExample: `CLASS lcl DEFINITION.
66448
+ PUBLIC SECTION.
66449
+ METHODS
66450
+ foobar
66451
+ EXPORTING foo TYPE i
66452
+ RETURNING VALUE(rv_string) TYPE string.
66443
66453
  ENDCLASS.`,
66444
66454
  };
66445
66455
  }
@@ -66819,7 +66829,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66819
66829
  key: "nesting",
66820
66830
  title: "Check nesting depth",
66821
66831
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66822
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66832
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66823
66833
  https://docs.abapopenchecks.org/checks/74/`,
66824
66834
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66825
66835
  };
@@ -67062,7 +67072,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67062
67072
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67063
67073
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67064
67074
  badExample: `var1 = var2 = var3.`,
67065
- goodExample: `var2 = var3.
67075
+ goodExample: `var2 = var3.
67066
67076
  var1 = var2.`,
67067
67077
  };
67068
67078
  }
@@ -67121,8 +67131,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67121
67131
  key: "no_external_form_calls",
67122
67132
  title: "No external FORM calls",
67123
67133
  shortDescription: `Detect external form calls`,
67124
- badExample: `PERFORM foo IN PROGRAM bar.
67125
-
67134
+ badExample: `PERFORM foo IN PROGRAM bar.
67135
+
67126
67136
  PERFORM foo(bar).`,
67127
67137
  tags: [_irule_1.RuleTag.SingleFile],
67128
67138
  };
@@ -67183,17 +67193,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67183
67193
  key: "no_inline_in_optional_branches",
67184
67194
  title: "Don't declare inline in optional branches",
67185
67195
  shortDescription: `Don't declare inline in optional branches`,
67186
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67187
-
67188
- Considered optional branches:
67189
- * inside IF/ELSEIF/ELSE
67190
- * inside LOOP
67191
- * inside WHILE
67192
- * inside CASE/WHEN, CASE TYPE OF
67193
- * inside DO
67194
- * inside SELECT loops
67195
-
67196
- Not considered optional branches:
67196
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67197
+
67198
+ Considered optional branches:
67199
+ * inside IF/ELSEIF/ELSE
67200
+ * inside LOOP
67201
+ * inside WHILE
67202
+ * inside CASE/WHEN, CASE TYPE OF
67203
+ * inside DO
67204
+ * inside SELECT loops
67205
+
67206
+ Not considered optional branches:
67197
67207
  * TRY/CATCH/CLEANUP`,
67198
67208
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67199
67209
  };
@@ -67293,12 +67303,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67293
67303
  key: "no_prefixes",
67294
67304
  title: "No Prefixes",
67295
67305
  shortDescription: `Dont use hungarian notation`,
67296
- extendedInformation: `
67297
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67298
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67299
-
67300
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67301
-
67306
+ extendedInformation: `
67307
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67308
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67309
+
67310
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67311
+
67302
67312
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67303
67313
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67304
67314
  badExample: `DATA lv_foo TYPE i.`,
@@ -67477,7 +67487,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67477
67487
  return {
67478
67488
  key: "no_public_attributes",
67479
67489
  title: "No public attributes",
67480
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67490
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67481
67491
  Exceptions are excluded from this rule.`,
67482
67492
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67483
67493
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67578,13 +67588,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67578
67588
  key: "no_yoda_conditions",
67579
67589
  title: "No Yoda conditions",
67580
67590
  shortDescription: `Finds Yoda conditions and reports issues`,
67581
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67582
-
67591
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67592
+
67583
67593
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67584
67594
  tags: [_irule_1.RuleTag.SingleFile],
67585
- badExample: `IF 0 <> sy-subrc.
67595
+ badExample: `IF 0 <> sy-subrc.
67586
67596
  ENDIF.`,
67587
- goodExample: `IF sy-subrc <> 0.
67597
+ goodExample: `IF sy-subrc <> 0.
67588
67598
  ENDIF.`,
67589
67599
  };
67590
67600
  }
@@ -67685,8 +67695,8 @@ class NROBConsistency {
67685
67695
  key: "nrob_consistency",
67686
67696
  title: "Number range consistency",
67687
67697
  shortDescription: `Consistency checks for number ranges`,
67688
- extendedInformation: `Issue reported if percentage warning is over 50%
67689
-
67698
+ extendedInformation: `Issue reported if percentage warning is over 50%
67699
+
67690
67700
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67691
67701
  tags: [_irule_1.RuleTag.SingleFile],
67692
67702
  };
@@ -67963,58 +67973,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67963
67973
  title: "Obsolete statements",
67964
67974
  shortDescription: `Checks for usages of certain obsolete statements`,
67965
67975
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67966
- extendedInformation: `
67967
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67968
-
67969
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67970
-
67971
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67972
-
67973
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67974
-
67975
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67976
-
67977
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67978
-
67979
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67980
-
67981
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67982
-
67983
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67984
-
67985
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67986
-
67987
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67988
-
67989
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67990
-
67991
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67992
-
67993
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67994
-
67995
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67996
- SELECT COUNT(*) is considered okay
67997
-
67998
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67999
-
68000
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68001
-
68002
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68003
-
68004
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68005
-
68006
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
68007
-
67976
+ extendedInformation: `
67977
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67978
+
67979
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67980
+
67981
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67982
+
67983
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67984
+
67985
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67986
+
67987
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67988
+
67989
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67990
+
67991
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67992
+
67993
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67994
+
67995
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67996
+
67997
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67998
+
67999
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68000
+
68001
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68002
+
68003
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68004
+
68005
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68006
+ SELECT COUNT(*) is considered okay
68007
+
68008
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68009
+
68010
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68011
+
68012
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68013
+
68014
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68015
+
68016
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68017
+
68008
68018
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
68009
- badExample: `REFRESH itab.
68010
-
68011
- COMPUTE foo = 2 + 2.
68012
-
68013
- MULTIPLY lv_foo BY 2.
68014
-
68015
- INTERFACE intf LOAD.
68016
-
68017
- IF foo IS SUPPLIED.
68019
+ badExample: `REFRESH itab.
68020
+
68021
+ COMPUTE foo = 2 + 2.
68022
+
68023
+ MULTIPLY lv_foo BY 2.
68024
+
68025
+ INTERFACE intf LOAD.
68026
+
68027
+ IF foo IS SUPPLIED.
68018
68028
  ENDIF.`,
68019
68029
  };
68020
68030
  }
@@ -68354,9 +68364,9 @@ class OmitParameterName {
68354
68364
  key: "omit_parameter_name",
68355
68365
  title: "Omit parameter name",
68356
68366
  shortDescription: `Omit the parameter name in single parameter calls`,
68357
- extendedInformation: `
68358
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68359
-
68367
+ extendedInformation: `
68368
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68369
+
68360
68370
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68361
68371
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68362
68372
  badExample: `method( param = 2 ).`,
@@ -68562,20 +68572,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68562
68572
  shortDescription: `Omit RECEIVING`,
68563
68573
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68564
68574
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68565
- badExample: `
68566
- upload_pack(
68567
- EXPORTING
68568
- io_client = lo_client
68569
- iv_url = iv_url
68570
- iv_deepen_level = iv_deepen_level
68571
- it_hashes = lt_hashes
68572
- RECEIVING
68575
+ badExample: `
68576
+ upload_pack(
68577
+ EXPORTING
68578
+ io_client = lo_client
68579
+ iv_url = iv_url
68580
+ iv_deepen_level = iv_deepen_level
68581
+ it_hashes = lt_hashes
68582
+ RECEIVING
68573
68583
  rt_objects = et_objects ).`,
68574
- goodExample: `
68575
- et_objects = upload_pack(
68576
- io_client = lo_client
68577
- iv_url = iv_url
68578
- iv_deepen_level = iv_deepen_level
68584
+ goodExample: `
68585
+ et_objects = upload_pack(
68586
+ io_client = lo_client
68587
+ iv_url = iv_url
68588
+ iv_deepen_level = iv_deepen_level
68579
68589
  it_hashes = lt_hashes ).`,
68580
68590
  };
68581
68591
  }
@@ -68639,8 +68649,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68639
68649
  return {
68640
68650
  key: "parser_702_chaining",
68641
68651
  title: "Parser Error, bad chanining on 702",
68642
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68643
- this rule finds these and reports errors.
68652
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68653
+ this rule finds these and reports errors.
68644
68654
  Only active on target version 702 and below.`,
68645
68655
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68646
68656
  };
@@ -68720,8 +68730,8 @@ class ParserError {
68720
68730
  return {
68721
68731
  key: "parser_error",
68722
68732
  title: "Parser error",
68723
- shortDescription: `Checks for syntax not recognized by abaplint.
68724
-
68733
+ shortDescription: `Checks for syntax not recognized by abaplint.
68734
+
68725
68735
  See recognized syntax at https://syntax.abaplint.org`,
68726
68736
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68727
68737
  };
@@ -68806,7 +68816,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68806
68816
  return {
68807
68817
  key: "parser_missing_space",
68808
68818
  title: "Parser Error, missing space",
68809
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68819
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68810
68820
  This rule makes sure the spaces are consistently required across the language.`,
68811
68821
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68812
68822
  badExample: `IF ( foo = 'bar').`,
@@ -69218,25 +69228,25 @@ class PreferInline {
69218
69228
  key: "prefer_inline",
69219
69229
  title: "Prefer Inline Declarations",
69220
69230
  shortDescription: `Prefer inline to up-front declarations.`,
69221
- extendedInformation: `EXPERIMENTAL
69222
-
69223
- Activates if language version is v740sp02 or above.
69224
-
69225
- Variables must be local(METHOD or FORM).
69226
-
69227
- No generic or void typed variables. No syntax errors.
69228
-
69229
- First position used must be a full/pure write.
69230
-
69231
- Move statment is not a cast(?=)
69232
-
69231
+ extendedInformation: `EXPERIMENTAL
69232
+
69233
+ Activates if language version is v740sp02 or above.
69234
+
69235
+ Variables must be local(METHOD or FORM).
69236
+
69237
+ No generic or void typed variables. No syntax errors.
69238
+
69239
+ First position used must be a full/pure write.
69240
+
69241
+ Move statment is not a cast(?=)
69242
+
69233
69243
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69234
69244
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69235
- badExample: `DATA foo TYPE i.
69236
- foo = 2.
69237
- DATA percentage TYPE decfloat34.
69245
+ badExample: `DATA foo TYPE i.
69246
+ foo = 2.
69247
+ DATA percentage TYPE decfloat34.
69238
69248
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69239
- goodExample: `DATA(foo) = 2.
69249
+ goodExample: `DATA(foo) = 2.
69240
69250
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69241
69251
  };
69242
69252
  }
@@ -69450,18 +69460,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69450
69460
  key: "prefer_is_not",
69451
69461
  title: "Prefer IS NOT to NOT IS",
69452
69462
  shortDescription: `Prefer IS NOT to NOT IS`,
69453
- extendedInformation: `
69454
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69455
-
69463
+ extendedInformation: `
69464
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69465
+
69456
69466
  "if not is_valid( )." examples are skipped`,
69457
69467
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69458
- goodExample: `IF variable IS NOT INITIAL.
69459
- IF variable NP 'TODO*'.
69460
- IF variable <> 42.
69468
+ goodExample: `IF variable IS NOT INITIAL.
69469
+ IF variable NP 'TODO*'.
69470
+ IF variable <> 42.
69461
69471
  IF variable CO 'hello'.`,
69462
- badExample: `IF NOT variable IS INITIAL.
69463
- IF NOT variable CP 'TODO*'.
69464
- IF NOT variable = 42.
69472
+ badExample: `IF NOT variable IS INITIAL.
69473
+ IF NOT variable CP 'TODO*'.
69474
+ IF NOT variable = 42.
69465
69475
  IF NOT variable CA 'hello'.`,
69466
69476
  };
69467
69477
  }
@@ -69649,14 +69659,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69649
69659
  key: "prefer_raise_exception_new",
69650
69660
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69651
69661
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69652
- extendedInformation: `
69653
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69654
-
69662
+ extendedInformation: `
69663
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69664
+
69655
69665
  From 752 and up`,
69656
69666
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69657
69667
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69658
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69659
- EXPORTING
69668
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69669
+ EXPORTING
69660
69670
  previous = exception.`,
69661
69671
  };
69662
69672
  }
@@ -69734,12 +69744,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69734
69744
  key: "prefer_returning_to_exporting",
69735
69745
  title: "Prefer RETURNING to EXPORTING",
69736
69746
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69737
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69747
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69738
69748
  https://docs.abapopenchecks.org/checks/44/`,
69739
69749
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69740
- badExample: `CLASS lcl DEFINITION.
69741
- PUBLIC SECTION.
69742
- METHODS test EXPORTING ev_foo TYPE i.
69750
+ badExample: `CLASS lcl DEFINITION.
69751
+ PUBLIC SECTION.
69752
+ METHODS test EXPORTING ev_foo TYPE i.
69743
69753
  ENDCLASS.`,
69744
69754
  };
69745
69755
  }
@@ -69835,8 +69845,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69835
69845
  key: "prefer_xsdbool",
69836
69846
  title: "Prefer xsdbool over boolc",
69837
69847
  shortDescription: `Prefer xsdbool over boolc`,
69838
- extendedInformation: `Activates if language version is v740sp08 or above.
69839
-
69848
+ extendedInformation: `Activates if language version is v740sp08 or above.
69849
+
69840
69850
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69841
69851
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69842
69852
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69908,9 +69918,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69908
69918
  title: "Preferred compare operator",
69909
69919
  shortDescription: `Configure undesired operator variants`,
69910
69920
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69911
- badExample: `IF foo EQ bar.
69921
+ badExample: `IF foo EQ bar.
69912
69922
  ENDIF.`,
69913
- goodExample: `IF foo = bar.
69923
+ goodExample: `IF foo = bar.
69914
69924
  ENDIF.`,
69915
69925
  };
69916
69926
  }
@@ -70134,26 +70144,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70134
70144
  key: "reduce_procedural_code",
70135
70145
  title: "Reduce procedural code",
70136
70146
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70137
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70138
-
70139
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70140
-
70147
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70148
+
70149
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70150
+
70141
70151
  Comments are not counted as statements.`,
70142
70152
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70143
- badExample: `FORM foo.
70144
- DATA lv_bar TYPE i.
70145
- lv_bar = 2 + 2.
70146
- IF lv_bar = 4.
70147
- WRITE 'hello world'.
70148
- ENDIF.
70149
- DATA lv_bar TYPE i.
70150
- lv_bar = 2 + 2.
70151
- IF lv_bar = 4.
70152
- WRITE 'hello world'.
70153
- ENDIF.
70153
+ badExample: `FORM foo.
70154
+ DATA lv_bar TYPE i.
70155
+ lv_bar = 2 + 2.
70156
+ IF lv_bar = 4.
70157
+ WRITE 'hello world'.
70158
+ ENDIF.
70159
+ DATA lv_bar TYPE i.
70160
+ lv_bar = 2 + 2.
70161
+ IF lv_bar = 4.
70162
+ WRITE 'hello world'.
70163
+ ENDIF.
70154
70164
  ENDFORM.`,
70155
- goodExample: `FORM foo.
70156
- NEW zcl_global_class( )->run_logic( ).
70165
+ goodExample: `FORM foo.
70166
+ NEW zcl_global_class( )->run_logic( ).
70157
70167
  ENDFORM.`,
70158
70168
  };
70159
70169
  }
@@ -70397,10 +70407,10 @@ class RemoveDescriptions {
70397
70407
  return {
70398
70408
  key: "remove_descriptions",
70399
70409
  title: "Remove descriptions",
70400
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70401
-
70402
- Class descriptions are required, see rule description_empty.
70403
-
70410
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70411
+
70412
+ Class descriptions are required, see rule description_empty.
70413
+
70404
70414
  Consider using ABAP Doc for documentation.`,
70405
70415
  tags: [],
70406
70416
  };
@@ -70525,14 +70535,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70525
70535
  tags: [_irule_1.RuleTag.SingleFile],
70526
70536
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70527
70537
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70528
- badExample: `CALL FUNCTION 'ZRFC'
70538
+ badExample: `CALL FUNCTION 'ZRFC'
70529
70539
  DESTINATION lv_rfc.`,
70530
- goodExample: `CALL FUNCTION 'ZRFC'
70531
- DESTINATION lv_rfc
70532
- EXCEPTIONS
70533
- system_failure = 1 MESSAGE msg
70534
- communication_failure = 2 MESSAGE msg
70535
- resource_failure = 3
70540
+ goodExample: `CALL FUNCTION 'ZRFC'
70541
+ DESTINATION lv_rfc
70542
+ EXCEPTIONS
70543
+ system_failure = 1 MESSAGE msg
70544
+ communication_failure = 2 MESSAGE msg
70545
+ resource_failure = 3
70536
70546
  OTHERS = 4.`,
70537
70547
  };
70538
70548
  }
@@ -70616,11 +70626,11 @@ class SelectAddOrderBy {
70616
70626
  key: "select_add_order_by",
70617
70627
  title: "SELECT add ORDER BY",
70618
70628
  shortDescription: `SELECTs add ORDER BY clause`,
70619
- extendedInformation: `
70620
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70621
-
70622
- add ORDER BY PRIMARY KEY if in doubt
70623
-
70629
+ extendedInformation: `
70630
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70631
+
70632
+ add ORDER BY PRIMARY KEY if in doubt
70633
+
70624
70634
  If the target is a sorted/hashed table, no issue is reported`,
70625
70635
  tags: [_irule_1.RuleTag.SingleFile],
70626
70636
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70751,14 +70761,14 @@ class SelectPerformance {
70751
70761
  key: "select_performance",
70752
70762
  title: "SELECT performance",
70753
70763
  shortDescription: `Various checks regarding SELECT performance.`,
70754
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70755
-
70764
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70765
+
70756
70766
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70757
70767
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70758
- badExample: `SELECT field1, field2 FROM table
70759
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70768
+ badExample: `SELECT field1, field2 FROM table
70769
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70760
70770
  ENDSELECT.`,
70761
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70771
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70762
70772
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70763
70773
  };
70764
70774
  }
@@ -70872,8 +70882,8 @@ class SelectSingleFullKey {
70872
70882
  key: "select_single_full_key",
70873
70883
  title: "Detect SELECT SINGLE which are possibily not unique",
70874
70884
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70875
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70876
-
70885
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70886
+
70877
70887
  If the statement contains a JOIN it is not checked`,
70878
70888
  pseudoComment: "EC CI_NOORDER",
70879
70889
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71297,8 +71307,8 @@ class SICFConsistency {
71297
71307
  key: "sicf_consistency",
71298
71308
  title: "SICF consistency",
71299
71309
  shortDescription: `Checks the validity of ICF services`,
71300
- extendedInformation: `* Class defined in handler must exist
71301
- * Class must not have any syntax errors
71310
+ extendedInformation: `* Class defined in handler must exist
71311
+ * Class must not have any syntax errors
71302
71312
  * Class must implement interface IF_HTTP_EXTENSION`,
71303
71313
  };
71304
71314
  }
@@ -71410,23 +71420,23 @@ class SlowParameterPassing {
71410
71420
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71411
71421
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71412
71422
  tags: [_irule_1.RuleTag.Performance],
71413
- badExample: `CLASS lcl DEFINITION.
71414
- PUBLIC SECTION.
71415
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71416
- ENDCLASS.
71417
- CLASS lcl IMPLEMENTATION.
71418
- METHOD bar.
71419
- WRITE sdf.
71420
- ENDMETHOD.
71423
+ badExample: `CLASS lcl DEFINITION.
71424
+ PUBLIC SECTION.
71425
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71426
+ ENDCLASS.
71427
+ CLASS lcl IMPLEMENTATION.
71428
+ METHOD bar.
71429
+ WRITE sdf.
71430
+ ENDMETHOD.
71421
71431
  ENDCLASS.`,
71422
- goodExample: `CLASS lcl DEFINITION.
71423
- PUBLIC SECTION.
71424
- METHODS bar IMPORTING sdf TYPE string.
71425
- ENDCLASS.
71426
- CLASS lcl IMPLEMENTATION.
71427
- METHOD bar.
71428
- WRITE sdf.
71429
- ENDMETHOD.
71432
+ goodExample: `CLASS lcl DEFINITION.
71433
+ PUBLIC SECTION.
71434
+ METHODS bar IMPORTING sdf TYPE string.
71435
+ ENDCLASS.
71436
+ CLASS lcl IMPLEMENTATION.
71437
+ METHOD bar.
71438
+ WRITE sdf.
71439
+ ENDMETHOD.
71430
71440
  ENDCLASS.`,
71431
71441
  };
71432
71442
  }
@@ -71683,8 +71693,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71683
71693
  key: "space_before_dot",
71684
71694
  title: "Space before dot",
71685
71695
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71686
- extendedInformation: `
71687
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71696
+ extendedInformation: `
71697
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71688
71698
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71689
71699
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71690
71700
  badExample: `WRITE bar .`,
@@ -71870,12 +71880,12 @@ class SQLValueConversion {
71870
71880
  key: "sql_value_conversion",
71871
71881
  title: "Implicit SQL Value Conversion",
71872
71882
  shortDescription: `Ensure types match when selecting from database`,
71873
- extendedInformation: `
71874
- * Integer to CHAR conversion
71875
- * Integer to NUMC conversion
71876
- * NUMC to Integer conversion
71877
- * CHAR to Integer conversion
71878
- * Source field longer than database field, CHAR -> CHAR
71883
+ extendedInformation: `
71884
+ * Integer to CHAR conversion
71885
+ * Integer to NUMC conversion
71886
+ * NUMC to Integer conversion
71887
+ * CHAR to Integer conversion
71888
+ * Source field longer than database field, CHAR -> CHAR
71879
71889
  * Source field longer than database field, NUMC -> NUMC`,
71880
71890
  tags: [],
71881
71891
  };
@@ -71947,7 +71957,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71947
71957
  key: "start_at_tab",
71948
71958
  title: "Start at tab",
71949
71959
  shortDescription: `Checks that statements start at tabstops.`,
71950
- extendedInformation: `Reports max 100 issues per file
71960
+ extendedInformation: `Reports max 100 issues per file
71951
71961
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71952
71962
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71953
71963
  badExample: ` WRITE a.`,
@@ -72124,12 +72134,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72124
72134
  key: "strict_sql",
72125
72135
  title: "Strict SQL",
72126
72136
  shortDescription: `Strict SQL`,
72127
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72128
-
72129
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72130
-
72131
- Also see separate rule sql_escape_host_variables
72132
-
72137
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72138
+
72139
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72140
+
72141
+ Also see separate rule sql_escape_host_variables
72142
+
72133
72143
  Activates from v750 and up`,
72134
72144
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72135
72145
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72383,11 +72393,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72383
72393
  key: "sy_modification",
72384
72394
  title: "Modification of SY fields",
72385
72395
  shortDescription: `Finds modification of sy fields`,
72386
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72387
-
72396
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72397
+
72388
72398
  Changes to SY-TVAR* fields are not reported`,
72389
72399
  tags: [_irule_1.RuleTag.SingleFile],
72390
- badExample: `sy-uname = 2.
72400
+ badExample: `sy-uname = 2.
72391
72401
  sy = sy.`,
72392
72402
  };
72393
72403
  }
@@ -72449,8 +72459,8 @@ class TABLEnhancementCategory {
72449
72459
  key: "tabl_enhancement_category",
72450
72460
  title: "TABL enhancement category must be set",
72451
72461
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72452
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72453
-
72462
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72463
+
72454
72464
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72455
72465
  tags: [],
72456
72466
  };
@@ -72515,8 +72525,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72515
72525
  shortDescription: `TABLES are always global, so declare them globally`,
72516
72526
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72517
72527
  tags: [_irule_1.RuleTag.SingleFile],
72518
- badExample: `FORM foo.
72519
- TABLES t100.
72528
+ badExample: `FORM foo.
72529
+ TABLES t100.
72520
72530
  ENDFORM.`,
72521
72531
  goodExample: `TABLES t000.`,
72522
72532
  };
@@ -72644,9 +72654,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72644
72654
  title: "Type FORM parameters",
72645
72655
  shortDescription: `Checks for untyped FORM parameters`,
72646
72656
  tags: [_irule_1.RuleTag.SingleFile],
72647
- badExample: `FORM foo USING bar.
72657
+ badExample: `FORM foo USING bar.
72648
72658
  ENDFORM.`,
72649
- goodExample: `FORM foo USING bar TYPE string.
72659
+ goodExample: `FORM foo USING bar TYPE string.
72650
72660
  ENDFORM.`,
72651
72661
  };
72652
72662
  }
@@ -73319,38 +73329,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73319
73329
  key: "unnecessary_pragma",
73320
73330
  title: "Unnecessary Pragma",
73321
73331
  shortDescription: `Finds pragmas which can be removed`,
73322
- extendedInformation: `* NO_HANDLER with handler
73323
-
73324
- * NEEDED without definition
73325
-
73326
- * NO_TEXT without texts
73327
-
73328
- * SUBRC_OK where sy-subrc is checked
73329
-
73332
+ extendedInformation: `* NO_HANDLER with handler
73333
+
73334
+ * NEEDED without definition
73335
+
73336
+ * NO_TEXT without texts
73337
+
73338
+ * SUBRC_OK where sy-subrc is checked
73339
+
73330
73340
  NO_HANDLER inside macros are not checked`,
73331
73341
  tags: [_irule_1.RuleTag.SingleFile],
73332
- badExample: `TRY.
73333
- ...
73334
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73335
- RETURN. " it has a handler
73336
- ENDTRY.
73337
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73338
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73339
- IF sy-subrc <> 0.
73342
+ badExample: `TRY.
73343
+ ...
73344
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73345
+ RETURN. " it has a handler
73346
+ ENDTRY.
73347
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73348
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73349
+ IF sy-subrc <> 0.
73340
73350
  ENDIF.`,
73341
- goodExample: `TRY.
73342
- ...
73343
- CATCH zcx_abapgit_exception.
73344
- RETURN.
73345
- ENDTRY.
73346
- MESSAGE w125(zbar) WITH c_foo INTO message.
73347
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73348
- IF sy-subrc <> 0.
73349
- ENDIF.
73350
-
73351
- DATA: BEGIN OF blah ##NEEDED,
73352
- test1 TYPE string,
73353
- test2 TYPE string,
73351
+ goodExample: `TRY.
73352
+ ...
73353
+ CATCH zcx_abapgit_exception.
73354
+ RETURN.
73355
+ ENDTRY.
73356
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73357
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73358
+ IF sy-subrc <> 0.
73359
+ ENDIF.
73360
+
73361
+ DATA: BEGIN OF blah ##NEEDED,
73362
+ test1 TYPE string,
73363
+ test2 TYPE string,
73354
73364
  END OF blah.`,
73355
73365
  };
73356
73366
  }
@@ -73517,18 +73527,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73517
73527
  shortDescription: `Finds unnecessary RETURN statements`,
73518
73528
  extendedInformation: `Finds unnecessary RETURN statements`,
73519
73529
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73520
- badExample: `FORM hello1.
73521
- WRITE 'world'.
73522
- RETURN.
73523
- ENDFORM.
73524
-
73525
- FORM foo.
73526
- IF 1 = 2.
73527
- RETURN.
73528
- ENDIF.
73530
+ badExample: `FORM hello1.
73531
+ WRITE 'world'.
73532
+ RETURN.
73533
+ ENDFORM.
73534
+
73535
+ FORM foo.
73536
+ IF 1 = 2.
73537
+ RETURN.
73538
+ ENDIF.
73529
73539
  ENDFORM.`,
73530
- goodExample: `FORM hello2.
73531
- WRITE 'world'.
73540
+ goodExample: `FORM hello2.
73541
+ WRITE 'world'.
73532
73542
  ENDFORM.`,
73533
73543
  };
73534
73544
  }
@@ -73879,13 +73889,13 @@ class UnusedMacros {
73879
73889
  title: "Unused macros",
73880
73890
  shortDescription: `Checks for unused macro definitions definitions`,
73881
73891
  tags: [_irule_1.RuleTag.Quickfix],
73882
- badExample: `DEFINE foobar1.
73883
- WRITE 'hello'.
73892
+ badExample: `DEFINE foobar1.
73893
+ WRITE 'hello'.
73884
73894
  END-OF-DEFINITION.`,
73885
- goodExample: `DEFINE foobar2.
73886
- WRITE 'hello'.
73887
- END-OF-DEFINITION.
73888
-
73895
+ goodExample: `DEFINE foobar2.
73896
+ WRITE 'hello'.
73897
+ END-OF-DEFINITION.
73898
+
73889
73899
  foobar2.`,
73890
73900
  };
73891
73901
  }
@@ -73997,18 +74007,18 @@ class UnusedMethods {
73997
74007
  key: "unused_methods",
73998
74008
  title: "Unused methods",
73999
74009
  shortDescription: `Checks for unused methods`,
74000
- extendedInformation: `Checks private and protected methods.
74001
-
74002
- Unused methods are not reported if the object contains parser or syntax errors.
74003
- Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74004
-
74005
- Skips:
74006
- * methods FOR TESTING
74007
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74008
- * class_constructor + constructor methods
74009
- * event handlers
74010
- * methods that are redefined
74011
- * INCLUDEs
74010
+ extendedInformation: `Checks private and protected methods.
74011
+
74012
+ Unused methods are not reported if the object contains parser or syntax errors.
74013
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74014
+
74015
+ Skips:
74016
+ * methods FOR TESTING
74017
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74018
+ * class_constructor + constructor methods
74019
+ * event handlers
74020
+ * methods that are redefined
74021
+ * INCLUDEs
74012
74022
  `,
74013
74023
  tags: [_irule_1.RuleTag.Quickfix],
74014
74024
  pragma: "##CALLED",
@@ -74484,23 +74494,23 @@ class UnusedVariables {
74484
74494
  key: "unused_variables",
74485
74495
  title: "Unused variables",
74486
74496
  shortDescription: `Checks for unused variables and constants`,
74487
- extendedInformation: `Skips event parameters.
74488
-
74489
- Note that this currently does not work if the source code uses macros.
74490
-
74491
- Unused variables are not reported if the object contains parser or syntax errors.
74492
-
74497
+ extendedInformation: `Skips event parameters.
74498
+
74499
+ Note that this currently does not work if the source code uses macros.
74500
+
74501
+ Unused variables are not reported if the object contains parser or syntax errors.
74502
+
74493
74503
  Errors found in INCLUDES are reported for the main program.`,
74494
74504
  tags: [_irule_1.RuleTag.Quickfix],
74495
74505
  pragma: "##NEEDED",
74496
74506
  pseudoComment: "EC NEEDED",
74497
- badExample: `DATA: BEGIN OF blah1,
74498
- test TYPE string,
74499
- test2 TYPE string,
74507
+ badExample: `DATA: BEGIN OF blah1,
74508
+ test TYPE string,
74509
+ test2 TYPE string,
74500
74510
  END OF blah1.`,
74501
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74502
- test TYPE string,
74503
- test2 TYPE string,
74511
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74512
+ test TYPE string,
74513
+ test2 TYPE string,
74504
74514
  END OF blah2.`,
74505
74515
  };
74506
74516
  }
@@ -74719,15 +74729,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74719
74729
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74720
74730
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74721
74731
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74722
- badExample: `IF line IS INITIAL.
74723
- has_entries = abap_false.
74724
- ELSE.
74725
- has_entries = abap_true.
74726
- ENDIF.
74727
-
74732
+ badExample: `IF line IS INITIAL.
74733
+ has_entries = abap_false.
74734
+ ELSE.
74735
+ has_entries = abap_true.
74736
+ ENDIF.
74737
+
74728
74738
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74729
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74730
-
74739
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74740
+
74731
74741
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74732
74742
  };
74733
74743
  }
@@ -74845,15 +74855,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74845
74855
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74846
74856
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74847
74857
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74848
- badExample: `INTERFACE lif.
74849
- METHODS load_data
74850
- EXCEPTIONS
74851
- invalid_parameter.
74858
+ badExample: `INTERFACE lif.
74859
+ METHODS load_data
74860
+ EXCEPTIONS
74861
+ invalid_parameter.
74852
74862
  ENDINTERFACE.`,
74853
- goodExample: `INTERFACE lif.
74854
- METHODS load_data
74855
- RAISING
74856
- cx_something.
74863
+ goodExample: `INTERFACE lif.
74864
+ METHODS load_data
74865
+ RAISING
74866
+ cx_something.
74857
74867
  ENDINTERFACE.`,
74858
74868
  };
74859
74869
  }
@@ -74913,15 +74923,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74913
74923
  key: "use_line_exists",
74914
74924
  title: "Use line_exists",
74915
74925
  shortDescription: `Use line_exists, from 740sp02 and up`,
74916
- extendedInformation: `
74917
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74918
-
74926
+ extendedInformation: `
74927
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74928
+
74919
74929
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74920
74930
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74921
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74922
- IF sy-subrc = 0.
74931
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74932
+ IF sy-subrc = 0.
74923
74933
  ENDIF.`,
74924
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74934
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74925
74935
  ENDIF.`,
74926
74936
  };
74927
74937
  }
@@ -75031,10 +75041,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75031
75041
  key: "use_new",
75032
75042
  title: "Use NEW",
75033
75043
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
75034
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75035
-
75036
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75037
-
75044
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75045
+
75046
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75047
+
75038
75048
  Applicable from v740sp02 and up`,
75039
75049
  badExample: `CREATE OBJECT ref.`,
75040
75050
  goodExample: `ref = NEW #( ).`,
@@ -75132,13 +75142,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75132
75142
  title: "WHEN OTHERS last",
75133
75143
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75134
75144
  tags: [_irule_1.RuleTag.SingleFile],
75135
- badExample: `CASE bar.
75136
- WHEN OTHERS.
75137
- WHEN 2.
75145
+ badExample: `CASE bar.
75146
+ WHEN OTHERS.
75147
+ WHEN 2.
75138
75148
  ENDCASE.`,
75139
- goodExample: `CASE bar.
75140
- WHEN 2.
75141
- WHEN OTHERS.
75149
+ goodExample: `CASE bar.
75150
+ WHEN 2.
75151
+ WHEN OTHERS.
75142
75152
  ENDCASE.`,
75143
75153
  };
75144
75154
  }