@abaplint/cli 2.108.4 → 2.108.6

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 +854 -803
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -34406,13 +34406,13 @@ class FlowGraph {
34406
34406
  this.label = label;
34407
34407
  }
34408
34408
  toDigraph() {
34409
- return `digraph G {
34410
- labelloc="t";
34411
- label="${this.label}";
34412
- graph [fontname = "helvetica"];
34413
- node [fontname = "helvetica", shape="box"];
34414
- edge [fontname = "helvetica"];
34415
- ${this.toTextEdges()}
34409
+ return `digraph G {
34410
+ labelloc="t";
34411
+ label="${this.label}";
34412
+ graph [fontname = "helvetica"];
34413
+ node [fontname = "helvetica", shape="box"];
34414
+ edge [fontname = "helvetica"];
34415
+ ${this.toTextEdges()}
34416
34416
  }`;
34417
34417
  }
34418
34418
  listSources(node) {
@@ -42489,13 +42489,13 @@ class Help {
42489
42489
  /////////////////////////////////////////////////
42490
42490
  static dumpABAP(file, reg, textDocument, position) {
42491
42491
  let content = "";
42492
- content = `
42493
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
42494
- <a href="#_statements" rel="no-refresh">Statements</a> |
42495
- <a href="#_structure" rel="no-refresh">Structure</a> |
42496
- <a href="#_files" rel="no-refresh">Files</a> |
42497
- <a href="#_info" rel="no-refresh">Info Dump</a>
42498
- <hr>
42492
+ content = `
42493
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
42494
+ <a href="#_statements" rel="no-refresh">Statements</a> |
42495
+ <a href="#_structure" rel="no-refresh">Structure</a> |
42496
+ <a href="#_files" rel="no-refresh">Files</a> |
42497
+ <a href="#_info" rel="no-refresh">Info Dump</a>
42498
+ <hr>
42499
42499
  ` +
42500
42500
  "<tt>" + textDocument.uri + " (" +
42501
42501
  (position.line + 1) + ", " +
@@ -50538,15 +50538,43 @@ class Transaction extends _abstract_object_1.AbstractObject {
50538
50538
  getType() {
50539
50539
  return "TRAN";
50540
50540
  }
50541
+ setDirty() {
50542
+ this.parsedXML = undefined;
50543
+ super.setDirty();
50544
+ }
50541
50545
  getAllowedNaming() {
50542
50546
  return {
50543
50547
  maxLength: 20,
50544
50548
  allowNamespace: true,
50545
50549
  };
50546
50550
  }
50551
+ getProgramName() {
50552
+ var _a;
50553
+ this.parse();
50554
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.programName;
50555
+ }
50547
50556
  getDescription() {
50548
- // todo
50549
- return undefined;
50557
+ var _a;
50558
+ this.parse();
50559
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
50560
+ }
50561
+ parse() {
50562
+ var _a, _b;
50563
+ if (this.parsedXML) {
50564
+ return { updated: false, runtime: 0 };
50565
+ }
50566
+ const start = Date.now();
50567
+ this.parsedXML = {};
50568
+ const parsed = super.parseRaw2();
50569
+ if (parsed === undefined
50570
+ || parsed.abapGit === undefined
50571
+ || parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
50572
+ return { updated: false, runtime: 0 };
50573
+ }
50574
+ this.parsedXML.description = (_a = parsed.abapGit["asx:abap"]["asx:values"].TSTCT) === null || _a === void 0 ? void 0 : _a.TTEXT;
50575
+ this.parsedXML.programName = (_b = parsed.abapGit["asx:abap"]["asx:values"].TSTC) === null || _b === void 0 ? void 0 : _b.PGMNA;
50576
+ const end = Date.now();
50577
+ return { updated: true, runtime: end - start };
50550
50578
  }
50551
50579
  }
50552
50580
  exports.Transaction = Transaction;
@@ -51494,7 +51522,7 @@ class Registry {
51494
51522
  }
51495
51523
  static abaplintVersion() {
51496
51524
  // magic, see build script "version.sh"
51497
- return "2.108.4";
51525
+ return "2.108.6";
51498
51526
  }
51499
51527
  getDDICReferences() {
51500
51528
  return this.ddicReferences;
@@ -51810,10 +51838,10 @@ class SevenBitAscii {
51810
51838
  key: "7bit_ascii",
51811
51839
  title: "Check for 7bit ascii",
51812
51840
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
51813
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51814
-
51815
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51816
-
51841
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51842
+
51843
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51844
+
51817
51845
  Checkes files with extensions ".abap" and ".asddls"`,
51818
51846
  tags: [_irule_1.RuleTag.SingleFile],
51819
51847
  badExample: `WRITE '뽑'.`,
@@ -52019,10 +52047,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
52019
52047
  key: "abapdoc",
52020
52048
  title: "Check abapdoc",
52021
52049
  shortDescription: `Various checks regarding abapdoc.`,
52022
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
52023
-
52024
- Plus class and interface definitions.
52025
-
52050
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
52051
+
52052
+ Plus class and interface definitions.
52053
+
52026
52054
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
52027
52055
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
52028
52056
  };
@@ -52160,49 +52188,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
52160
52188
  key: "align_parameters",
52161
52189
  title: "Align Parameters",
52162
52190
  shortDescription: `Checks for vertially aligned parameters`,
52163
- extendedInformation: `Checks:
52164
- * function module calls
52165
- * method calls
52166
- * VALUE constructors
52167
- * NEW constructors
52168
- * RAISE EXCEPTION statements
52169
- * CREATE OBJECT statements
52170
- * RAISE EVENT statements
52171
-
52172
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
52173
-
52174
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
52175
-
52176
- If parameters are on the same row, no issues are reported, see
52191
+ extendedInformation: `Checks:
52192
+ * function module calls
52193
+ * method calls
52194
+ * VALUE constructors
52195
+ * NEW constructors
52196
+ * RAISE EXCEPTION statements
52197
+ * CREATE OBJECT statements
52198
+ * RAISE EVENT statements
52199
+
52200
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
52201
+
52202
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
52203
+
52204
+ If parameters are on the same row, no issues are reported, see
52177
52205
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
52178
52206
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
52179
- badExample: `CALL FUNCTION 'FOOBAR'
52180
- EXPORTING
52181
- foo = 2
52182
- parameter = 3.
52183
-
52184
- foobar( moo = 1
52185
- param = 1 ).
52186
-
52187
- foo = VALUE #(
52188
- foo = bar
52207
+ badExample: `CALL FUNCTION 'FOOBAR'
52208
+ EXPORTING
52209
+ foo = 2
52210
+ parameter = 3.
52211
+
52212
+ foobar( moo = 1
52213
+ param = 1 ).
52214
+
52215
+ foo = VALUE #(
52216
+ foo = bar
52189
52217
  moo = 2 ).`,
52190
- goodExample: `CALL FUNCTION 'FOOBAR'
52191
- EXPORTING
52192
- foo = 2
52193
- parameter = 3.
52194
-
52195
- foobar( moo = 1
52196
- param = 1 ).
52197
-
52198
- foo = VALUE #(
52199
- foo = bar
52200
- moo = 2 ).
52201
-
52202
- DATA(sdf) = VALUE type(
52203
- common_val = 2
52204
- another_common = 5
52205
- ( row_value = 4
52218
+ goodExample: `CALL FUNCTION 'FOOBAR'
52219
+ EXPORTING
52220
+ foo = 2
52221
+ parameter = 3.
52222
+
52223
+ foobar( moo = 1
52224
+ param = 1 ).
52225
+
52226
+ foo = VALUE #(
52227
+ foo = bar
52228
+ moo = 2 ).
52229
+
52230
+ DATA(sdf) = VALUE type(
52231
+ common_val = 2
52232
+ another_common = 5
52233
+ ( row_value = 4
52206
52234
  value_foo = 5 ) ).`,
52207
52235
  };
52208
52236
  }
@@ -52636,37 +52664,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
52636
52664
  key: "align_type_expressions",
52637
52665
  title: "Align TYPE expressions",
52638
52666
  shortDescription: `Align TYPE expressions in statements`,
52639
- extendedInformation: `
52640
- Currently works for METHODS + BEGIN OF
52641
-
52642
- If BEGIN OF has an INCLUDE TYPE its ignored
52643
-
52644
- Also note that clean ABAP does not recommend aligning TYPE clauses:
52667
+ extendedInformation: `
52668
+ Currently works for METHODS + BEGIN OF
52669
+
52670
+ If BEGIN OF has an INCLUDE TYPE its ignored
52671
+
52672
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
52645
52673
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
52646
52674
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
52647
- badExample: `
52648
- TYPES: BEGIN OF foo,
52649
- bar TYPE i,
52650
- foobar TYPE i,
52651
- END OF foo.
52652
-
52653
- INTERFACE lif.
52654
- METHODS bar
52655
- IMPORTING
52656
- foo TYPE i
52657
- foobar TYPE i.
52675
+ badExample: `
52676
+ TYPES: BEGIN OF foo,
52677
+ bar TYPE i,
52678
+ foobar TYPE i,
52679
+ END OF foo.
52680
+
52681
+ INTERFACE lif.
52682
+ METHODS bar
52683
+ IMPORTING
52684
+ foo TYPE i
52685
+ foobar TYPE i.
52658
52686
  ENDINTERFACE.`,
52659
- goodExample: `
52660
- TYPES: BEGIN OF foo,
52661
- bar TYPE i,
52662
- foobar TYPE i,
52663
- END OF foo.
52664
-
52665
- INTERFACE lif.
52666
- METHODS bar
52667
- IMPORTING
52668
- foo TYPE i
52669
- foobar TYPE i.
52687
+ goodExample: `
52688
+ TYPES: BEGIN OF foo,
52689
+ bar TYPE i,
52690
+ foobar TYPE i,
52691
+ END OF foo.
52692
+
52693
+ INTERFACE lif.
52694
+ METHODS bar
52695
+ IMPORTING
52696
+ foo TYPE i
52697
+ foobar TYPE i.
52670
52698
  ENDINTERFACE.`,
52671
52699
  };
52672
52700
  }
@@ -52945,15 +52973,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
52945
52973
  return {
52946
52974
  key: "ambiguous_statement",
52947
52975
  title: "Check for ambigious statements",
52948
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52949
- Add "TABLE" keyword or "@" for escaping SQL variables
52950
-
52976
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52977
+ Add "TABLE" keyword or "@" for escaping SQL variables
52978
+
52951
52979
  Only works if the target version is 740sp05 or above`,
52952
52980
  tags: [_irule_1.RuleTag.SingleFile],
52953
- badExample: `DELETE foo FROM bar.
52981
+ badExample: `DELETE foo FROM bar.
52954
52982
  MODIFY foo FROM bar.`,
52955
- goodExample: `DELETE foo FROM @bar.
52956
- MODIFY TABLE foo FROM bar.
52983
+ goodExample: `DELETE foo FROM @bar.
52984
+ MODIFY TABLE foo FROM bar.
52957
52985
  MODIFY zfoo FROM @wa.`,
52958
52986
  };
52959
52987
  }
@@ -53058,16 +53086,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
53058
53086
  key: "avoid_use",
53059
53087
  title: "Avoid use of certain statements",
53060
53088
  shortDescription: `Detects usage of certain statements.`,
53061
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
53062
-
53063
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
53064
-
53065
- STATICS: use CLASS-DATA instead
53066
-
53067
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
53068
-
53069
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
53070
-
53089
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
53090
+
53091
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
53092
+
53093
+ STATICS: use CLASS-DATA instead
53094
+
53095
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
53096
+
53097
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
53098
+
53071
53099
  BREAK points`,
53072
53100
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53073
53101
  };
@@ -53199,11 +53227,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
53199
53227
  title: "Check BEGIN END names",
53200
53228
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
53201
53229
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
53202
- badExample: `DATA: BEGIN OF stru,
53203
- field TYPE i,
53230
+ badExample: `DATA: BEGIN OF stru,
53231
+ field TYPE i,
53204
53232
  END OF structure_not_the_same.`,
53205
- goodExample: `DATA: BEGIN OF stru,
53206
- field TYPE i,
53233
+ goodExample: `DATA: BEGIN OF stru,
53234
+ field TYPE i,
53207
53235
  END OF stru.`,
53208
53236
  };
53209
53237
  }
@@ -53300,20 +53328,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
53300
53328
  title: "BEGIN contains single INCLUDE",
53301
53329
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
53302
53330
  tags: [_irule_1.RuleTag.SingleFile],
53303
- badExample: `TYPES: BEGIN OF dummy1.
53304
- INCLUDE TYPE dselc.
53305
- TYPES: END OF dummy1.
53306
-
53307
- DATA BEGIN OF foo.
53308
- INCLUDE STRUCTURE syst.
53309
- DATA END OF foo.
53310
-
53311
- STATICS BEGIN OF bar.
53312
- INCLUDE STRUCTURE syst.
53331
+ badExample: `TYPES: BEGIN OF dummy1.
53332
+ INCLUDE TYPE dselc.
53333
+ TYPES: END OF dummy1.
53334
+
53335
+ DATA BEGIN OF foo.
53336
+ INCLUDE STRUCTURE syst.
53337
+ DATA END OF foo.
53338
+
53339
+ STATICS BEGIN OF bar.
53340
+ INCLUDE STRUCTURE syst.
53313
53341
  STATICS END OF bar.`,
53314
- goodExample: `DATA BEGIN OF foo.
53315
- DATA field TYPE i.
53316
- INCLUDE STRUCTURE dselc.
53342
+ goodExample: `DATA BEGIN OF foo.
53343
+ DATA field TYPE i.
53344
+ INCLUDE STRUCTURE dselc.
53317
53345
  DATA END OF foo.`,
53318
53346
  };
53319
53347
  }
@@ -53403,9 +53431,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
53403
53431
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
53404
53432
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
53405
53433
  badExample: `CALL TRANSACTION 'FOO'.`,
53406
- goodExample: `TRY.
53407
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
53408
- CATCH cx_sy_authorization_error.
53434
+ goodExample: `TRY.
53435
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
53436
+ CATCH cx_sy_authorization_error.
53409
53437
  ENDTRY.`,
53410
53438
  };
53411
53439
  }
@@ -53470,10 +53498,10 @@ class CDSCommentStyle {
53470
53498
  key: "cds_comment_style",
53471
53499
  title: "CDS Comment Style",
53472
53500
  shortDescription: `Check for obsolete comment style`,
53473
- extendedInformation: `Check for obsolete comment style
53474
-
53475
- Comments starting with "--" are considered obsolete
53476
-
53501
+ extendedInformation: `Check for obsolete comment style
53502
+
53503
+ Comments starting with "--" are considered obsolete
53504
+
53477
53505
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
53478
53506
  tags: [_irule_1.RuleTag.SingleFile],
53479
53507
  badExample: "-- this is a comment",
@@ -53540,10 +53568,10 @@ class CDSLegacyView {
53540
53568
  title: "CDS Legacy View",
53541
53569
  shortDescription: `Identify CDS Legacy Views`,
53542
53570
  // eslint-disable-next-line max-len
53543
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
53544
-
53545
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
53546
-
53571
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
53572
+
53573
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
53574
+
53547
53575
  v755 and up`,
53548
53576
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
53549
53577
  };
@@ -53698,10 +53726,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
53698
53726
  key: "chain_mainly_declarations",
53699
53727
  title: "Chain mainly declarations",
53700
53728
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
53701
- extendedInformation: `
53702
- https://docs.abapopenchecks.org/checks/23/
53703
-
53704
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53729
+ extendedInformation: `
53730
+ https://docs.abapopenchecks.org/checks/23/
53731
+
53732
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53705
53733
  `,
53706
53734
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53707
53735
  badExample: `CALL METHOD: bar.`,
@@ -53877,17 +53905,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
53877
53905
  title: "Change IF to CASE",
53878
53906
  shortDescription: `Finds IF constructs that can be changed to CASE`,
53879
53907
  // eslint-disable-next-line max-len
53880
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53881
-
53908
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53909
+
53882
53910
  If the first comparison is a boolean compare, no issue is reported.`,
53883
53911
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53884
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
53885
- ELSEIF l_fcat-fieldname = 'BAR'
53886
- OR l_fcat-fieldname = 'MOO'.
53912
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
53913
+ ELSEIF l_fcat-fieldname = 'BAR'
53914
+ OR l_fcat-fieldname = 'MOO'.
53887
53915
  ENDIF.`,
53888
- goodExample: `CASE l_fcat-fieldname.
53889
- WHEN 'FOO'.
53890
- WHEN 'BAR' OR 'MOO'.
53916
+ goodExample: `CASE l_fcat-fieldname.
53917
+ WHEN 'FOO'.
53918
+ WHEN 'BAR' OR 'MOO'.
53891
53919
  ENDCASE.`,
53892
53920
  };
53893
53921
  }
@@ -54024,8 +54052,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
54024
54052
  return {
54025
54053
  key: "check_abstract",
54026
54054
  title: "Check abstract methods and classes",
54027
- shortDescription: `Checks abstract methods and classes:
54028
- - class defined as abstract and final,
54055
+ shortDescription: `Checks abstract methods and classes:
54056
+ - class defined as abstract and final,
54029
54057
  - non-abstract class contains abstract methods`,
54030
54058
  extendedInformation: `If a class defines only constants, use an interface instead`,
54031
54059
  tags: [_irule_1.RuleTag.SingleFile],
@@ -54106,11 +54134,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
54106
54134
  return {
54107
54135
  key: "check_comments",
54108
54136
  title: "Check Comments",
54109
- shortDescription: `
54137
+ shortDescription: `
54110
54138
  Various checks for comment usage.`,
54111
- extendedInformation: `
54112
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
54113
-
54139
+ extendedInformation: `
54140
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
54141
+
54114
54142
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
54115
54143
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54116
54144
  badExample: `WRITE 2. " descriptive comment`,
@@ -54272,9 +54300,9 @@ class CheckInclude {
54272
54300
  key: "check_include",
54273
54301
  title: "Check INCLUDEs",
54274
54302
  shortDescription: `Checks INCLUDE statements`,
54275
- extendedInformation: `
54276
- * Reports unused includes
54277
- * Errors if the includes are not found
54303
+ extendedInformation: `
54304
+ * Reports unused includes
54305
+ * Errors if the includes are not found
54278
54306
  * Error if including a main program`,
54279
54307
  tags: [_irule_1.RuleTag.Syntax],
54280
54308
  };
@@ -54350,14 +54378,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
54350
54378
  key: "check_subrc",
54351
54379
  title: "Check sy-subrc",
54352
54380
  shortDescription: `Check sy-subrc`,
54353
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
54354
-
54355
- If sy-dbcnt is checked after database statements, it is considered okay.
54356
-
54357
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
54358
-
54359
- If IS ASSIGNED is checked after assigning, it is considered okay.
54360
-
54381
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
54382
+
54383
+ If sy-dbcnt is checked after database statements, it is considered okay.
54384
+
54385
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
54386
+
54387
+ If IS ASSIGNED is checked after assigning, it is considered okay.
54388
+
54361
54389
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
54362
54390
  tags: [_irule_1.RuleTag.SingleFile],
54363
54391
  pseudoComment: "EC CI_SUBRC",
@@ -54926,17 +54954,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
54926
54954
  shortDescription: `Find overlapping classic exceptions`,
54927
54955
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
54928
54956
  tags: [_irule_1.RuleTag.SingleFile],
54929
- badExample: `CALL FUNCTION 'SOMETHING'
54930
- EXCEPTIONS
54931
- system_failure = 1 MESSAGE lv_message
54932
- communication_failure = 1 MESSAGE lv_message
54933
- resource_failure = 1
54957
+ badExample: `CALL FUNCTION 'SOMETHING'
54958
+ EXCEPTIONS
54959
+ system_failure = 1 MESSAGE lv_message
54960
+ communication_failure = 1 MESSAGE lv_message
54961
+ resource_failure = 1
54934
54962
  OTHERS = 1.`,
54935
- goodExample: `CALL FUNCTION 'SOMETHING'
54936
- EXCEPTIONS
54937
- system_failure = 1 MESSAGE lv_message
54938
- communication_failure = 2 MESSAGE lv_message
54939
- resource_failure = 3
54963
+ goodExample: `CALL FUNCTION 'SOMETHING'
54964
+ EXCEPTIONS
54965
+ system_failure = 1 MESSAGE lv_message
54966
+ communication_failure = 2 MESSAGE lv_message
54967
+ resource_failure = 3
54940
54968
  OTHERS = 4.`,
54941
54969
  };
54942
54970
  }
@@ -55182,7 +55210,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
55182
55210
  key: "commented_code",
55183
55211
  title: "Find commented code",
55184
55212
  shortDescription: `Detects usage of commented out code.`,
55185
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
55213
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
55186
55214
  https://docs.abapopenchecks.org/checks/14/`,
55187
55215
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
55188
55216
  badExample: `* WRITE 'hello world'.`,
@@ -55415,10 +55443,10 @@ class ConstructorVisibilityPublic {
55415
55443
  key: "constructor_visibility_public",
55416
55444
  title: "Check constructor visibility is public",
55417
55445
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
55418
- extendedInformation: `
55419
- This only applies to global classes.
55420
-
55421
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
55446
+ extendedInformation: `
55447
+ This only applies to global classes.
55448
+
55449
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
55422
55450
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
55423
55451
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55424
55452
  };
@@ -55493,8 +55521,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
55493
55521
  key: "contains_tab",
55494
55522
  title: "Code contains tab",
55495
55523
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
55496
- extendedInformation: `
55497
- https://docs.abapopenchecks.org/checks/09/
55524
+ extendedInformation: `
55525
+ https://docs.abapopenchecks.org/checks/09/
55498
55526
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
55499
55527
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55500
55528
  badExample: `\tWRITE 'hello world'.`,
@@ -55581,10 +55609,10 @@ class CyclicOO {
55581
55609
  key: "cyclic_oo",
55582
55610
  title: "Cyclic OO",
55583
55611
  shortDescription: `Finds cyclic OO references`,
55584
- extendedInformation: `Runs for global INTF + CLAS objects
55585
-
55586
- Objects must be without syntax errors for this rule to take effect
55587
-
55612
+ extendedInformation: `Runs for global INTF + CLAS objects
55613
+
55614
+ Objects must be without syntax errors for this rule to take effect
55615
+
55588
55616
  References in testclass includes are ignored`,
55589
55617
  };
55590
55618
  }
@@ -55826,7 +55854,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
55826
55854
  key: "dangerous_statement",
55827
55855
  title: "Dangerous statement",
55828
55856
  shortDescription: `Detects potentially dangerous statements`,
55829
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55857
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55830
55858
  dynamic SQL can potentially create SQL injection problems`,
55831
55859
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55832
55860
  };
@@ -56030,13 +56058,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
56030
56058
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
56031
56059
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
56032
56060
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56033
- badExample: `FROM foo.
56034
- WRITE 'hello'.
56035
- DATA int TYPE i.
56061
+ badExample: `FROM foo.
56062
+ WRITE 'hello'.
56063
+ DATA int TYPE i.
56036
56064
  ENDFORM.`,
56037
- goodExample: `FROM foo.
56038
- DATA int TYPE i.
56039
- WRITE 'hello'.
56065
+ goodExample: `FROM foo.
56066
+ DATA int TYPE i.
56067
+ WRITE 'hello'.
56040
56068
  ENDFORM.`,
56041
56069
  };
56042
56070
  }
@@ -56572,39 +56600,39 @@ class Downport {
56572
56600
  key: "downport",
56573
56601
  title: "Downport statement",
56574
56602
  shortDescription: `Downport functionality`,
56575
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56576
- a higher level language version. If successful, various rules are applied to downport the statement.
56577
- Target downport version is always v702, thus rule is only enabled if target version is v702.
56578
-
56579
- Current rules:
56580
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56581
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56582
- * FIELD-SYMBOL() definitions are outlined
56583
- * CONV is outlined
56584
- * COND is outlined
56585
- * REDUCE is outlined
56586
- * SWITCH is outlined
56587
- * FILTER is outlined
56588
- * APPEND expression is outlined
56589
- * INSERT expression is outlined
56590
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56591
- * CAST changed to ?=
56592
- * LOOP AT method_call( ) is outlined
56593
- * VALUE # with structure fields
56594
- * VALUE # with internal table lines
56595
- * Table Expressions are outlined
56596
- * SELECT INTO @DATA definitions are outlined
56597
- * Some occurrences of string template formatting option ALPHA changed to function module call
56598
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56599
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56600
- * RAISE EXCEPTION ... MESSAGE
56601
- * Moving with +=, -=, /=, *=, &&= is expanded
56602
- * line_exists and line_index is downported to READ TABLE
56603
- * ENUMs, but does not nessesarily give the correct type and value
56604
- * MESSAGE with non simple source
56605
-
56606
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56607
-
56603
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56604
+ a higher level language version. If successful, various rules are applied to downport the statement.
56605
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
56606
+
56607
+ Current rules:
56608
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56609
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56610
+ * FIELD-SYMBOL() definitions are outlined
56611
+ * CONV is outlined
56612
+ * COND is outlined
56613
+ * REDUCE is outlined
56614
+ * SWITCH is outlined
56615
+ * FILTER is outlined
56616
+ * APPEND expression is outlined
56617
+ * INSERT expression is outlined
56618
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56619
+ * CAST changed to ?=
56620
+ * LOOP AT method_call( ) is outlined
56621
+ * VALUE # with structure fields
56622
+ * VALUE # with internal table lines
56623
+ * Table Expressions are outlined
56624
+ * SELECT INTO @DATA definitions are outlined
56625
+ * Some occurrences of string template formatting option ALPHA changed to function module call
56626
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56627
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56628
+ * RAISE EXCEPTION ... MESSAGE
56629
+ * Moving with +=, -=, /=, *=, &&= is expanded
56630
+ * line_exists and line_index is downported to READ TABLE
56631
+ * ENUMs, but does not nessesarily give the correct type and value
56632
+ * MESSAGE with non simple source
56633
+
56634
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56635
+
56608
56636
  Make sure to test the downported code, it might not always be completely correct.`,
56609
56637
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
56610
56638
  };
@@ -56968,6 +56996,10 @@ Make sure to test the downported code, it might not always be completely correct
56968
56996
  if (found) {
56969
56997
  return found;
56970
56998
  }
56999
+ found = this.downportMessageSource(high, lowFile, highSyntax);
57000
+ if (found) {
57001
+ return found;
57002
+ }
56971
57003
  found = this.downportMessage(high, lowFile, highSyntax);
56972
57004
  if (found) {
56973
57005
  return found;
@@ -57178,10 +57210,10 @@ Make sure to test the downported code, it might not always be completely correct
57178
57210
  const fieldName = f.concatTokens();
57179
57211
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
57180
57212
  }
57181
- fieldDefinition = `DATA: BEGIN OF ${name},
57213
+ fieldDefinition = `DATA: BEGIN OF ${name},
57182
57214
  ${fieldDefinition}${indentation} END OF ${name}.`;
57183
57215
  }
57184
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
57216
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
57185
57217
  ${indentation}`);
57186
57218
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
57187
57219
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57225,12 +57257,12 @@ ${indentation}`);
57225
57257
  }
57226
57258
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57227
57259
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
57228
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
57229
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
57230
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
57260
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
57261
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
57262
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
57231
57263
  ${indentation}`);
57232
57264
  if (fieldDefinitions === "") {
57233
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
57265
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
57234
57266
  ${indentation}`);
57235
57267
  }
57236
57268
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -57298,7 +57330,7 @@ ${indentation}`);
57298
57330
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57299
57331
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57300
57332
  const firstToken = high.getFirstToken();
57301
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57333
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57302
57334
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57303
57335
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
57304
57336
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57322,6 +57354,22 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57322
57354
  }
57323
57355
  return undefined;
57324
57356
  }
57357
+ downportMessageSource(high, lowFile, highSyntax) {
57358
+ if (!(high.get() instanceof Statements.Message)) {
57359
+ return undefined;
57360
+ }
57361
+ const source = high.findExpressionAfterToken("MESSAGE");
57362
+ if ((source === null || source === void 0 ? void 0 : source.get()) instanceof Expressions.Source) {
57363
+ const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57364
+ const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57365
+ const firstToken = high.getFirstToken();
57366
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA(${uniqueName}) = ${source.concatTokens()}.\n` + indentation);
57367
+ const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
57368
+ const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
57369
+ return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline message source", this.getMetadata().key, this.conf.severity, fix);
57370
+ }
57371
+ return undefined;
57372
+ }
57325
57373
  replaceInsertExpression(high, lowFile, highSyntax) {
57326
57374
  if (!(high.get() instanceof Statements.InsertInternal)) {
57327
57375
  return undefined;
@@ -57336,7 +57384,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57336
57384
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57337
57385
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57338
57386
  const firstToken = high.getFirstToken();
57339
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57387
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57340
57388
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57341
57389
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
57342
57390
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57378,14 +57426,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57378
57426
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57379
57427
  const firstToken = high.getFirstToken();
57380
57428
  // note that the tabix restore should be done before throwing the exception
57381
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
57382
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57383
- ${indentation}${tabixBackup} = sy-tabix.
57384
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
57385
- ${indentation}sy-tabix = ${tabixBackup}.
57386
- ${indentation}IF sy-subrc <> 0.
57387
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57388
- ${indentation}ENDIF.
57429
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
57430
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57431
+ ${indentation}${tabixBackup} = sy-tabix.
57432
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
57433
+ ${indentation}sy-tabix = ${tabixBackup}.
57434
+ ${indentation}IF sy-subrc <> 0.
57435
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57436
+ ${indentation}ENDIF.
57389
57437
  ${indentation}`);
57390
57438
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
57391
57439
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57442,7 +57490,7 @@ ${indentation}`);
57442
57490
  const className = classNames[0].concatTokens();
57443
57491
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57444
57492
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
57445
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
57493
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
57446
57494
  ${indentation}CATCH ${className} INTO ${targetName}.`;
57447
57495
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
57448
57496
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -57604,16 +57652,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
57604
57652
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57605
57653
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57606
57654
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
57607
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57608
- ${indentation}${uniqueName1}-msgid = ${id}.
57655
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57656
+ ${indentation}${uniqueName1}-msgid = ${id}.
57609
57657
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
57610
57658
  if (withs.length > 0) {
57611
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57612
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57613
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57659
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57660
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57661
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57614
57662
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
57615
57663
  }
57616
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57664
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57617
57665
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
57618
57666
  if (withs.length > 0) {
57619
57667
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -57725,10 +57773,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
57725
57773
  let code = "";
57726
57774
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
57727
57775
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57728
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57729
- IF sy-subrc <> 0.
57730
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57731
- ENDIF.
57776
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57777
+ IF sy-subrc <> 0.
57778
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57779
+ ENDIF.
57732
57780
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57733
57781
  }
57734
57782
  else {
@@ -57817,20 +57865,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57817
57865
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57818
57866
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57819
57867
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57820
- code += ` items LIKE ${loopSourceName},
57821
- END OF ${groupTargetName}type.
57822
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57823
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57868
+ code += ` items LIKE ${loopSourceName},
57869
+ END OF ${groupTargetName}type.
57870
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57871
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57824
57872
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
57825
57873
  if (groupIndexName !== undefined) {
57826
57874
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
57827
57875
  }
57828
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57876
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57829
57877
  IF sy-subrc = 0.\n`;
57830
57878
  if (groupCountName !== undefined) {
57831
57879
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
57832
57880
  }
57833
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57881
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57834
57882
  ELSE.\n`;
57835
57883
  code += ` CLEAR ${uniqueName}.\n`;
57836
57884
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -57851,8 +57899,8 @@ ELSE.\n`;
57851
57899
  }
57852
57900
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
57853
57901
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
57854
- code += `ENDIF.
57855
- ENDLOOP.
57902
+ code += `ENDIF.
57903
+ ENDLOOP.
57856
57904
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57857
57905
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
57858
57906
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -58024,7 +58072,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
58024
58072
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
58025
58073
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
58026
58074
  // all ENUMS are char like?
58027
- let code = `TYPES ${enumName} TYPE string.
58075
+ let code = `TYPES ${enumName} TYPE string.
58028
58076
  CONSTANTS: BEGIN OF ${structureName},\n`;
58029
58077
  let count = 1;
58030
58078
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -58068,14 +58116,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
58068
58116
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58069
58117
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58070
58118
  // restore tabix before exeption
58071
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
58072
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58073
- ${indentation}${tabixBackup} = sy-tabix.
58074
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
58075
- ${indentation}sy-tabix = ${tabixBackup}.
58076
- ${indentation}IF sy-subrc <> 0.
58077
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58078
- ${indentation}ENDIF.
58119
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
58120
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58121
+ ${indentation}${tabixBackup} = sy-tabix.
58122
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
58123
+ ${indentation}sy-tabix = ${tabixBackup}.
58124
+ ${indentation}IF sy-subrc <> 0.
58125
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58126
+ ${indentation}ENDIF.
58079
58127
  ${indentation}${uniqueName}`;
58080
58128
  const start = target.getFirstToken().getStart();
58081
58129
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -58159,11 +58207,11 @@ ${indentation}${uniqueName}`;
58159
58207
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58160
58208
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58161
58209
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58162
- const code = `DATA ${uniqueName} TYPE string.
58163
- ${indentation}CALL FUNCTION '${functionName}'
58164
- ${indentation} EXPORTING
58165
- ${indentation} input = ${source}
58166
- ${indentation} IMPORTING
58210
+ const code = `DATA ${uniqueName} TYPE string.
58211
+ ${indentation}CALL FUNCTION '${functionName}'
58212
+ ${indentation} EXPORTING
58213
+ ${indentation} input = ${source}
58214
+ ${indentation} IMPORTING
58167
58215
  ${indentation} output = ${uniqueName}.\n`;
58168
58216
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
58169
58217
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -59475,12 +59523,12 @@ class EasyToFindMessages {
59475
59523
  key: "easy_to_find_messages",
59476
59524
  title: "Easy to find messages",
59477
59525
  shortDescription: `Make messages easy to find`,
59478
- extendedInformation: `All messages must be statically referenced exactly once
59479
-
59480
- Only MESSAGE and RAISE statments are counted as static references
59481
-
59482
- Also see rule "message_exists"
59483
-
59526
+ extendedInformation: `All messages must be statically referenced exactly once
59527
+
59528
+ Only MESSAGE and RAISE statments are counted as static references
59529
+
59530
+ Also see rule "message_exists"
59531
+
59484
59532
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
59485
59533
  tags: [_irule_1.RuleTag.Styleguide],
59486
59534
  };
@@ -59565,8 +59613,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
59565
59613
  key: "empty_line_in_statement",
59566
59614
  title: "Find empty lines in statements",
59567
59615
  shortDescription: `Checks that statements do not contain empty lines.`,
59568
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
59569
-
59616
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
59617
+
59570
59618
  https://docs.abapopenchecks.org/checks/41/`,
59571
59619
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
59572
59620
  badExample: `WRITE\n\nhello.`,
@@ -59742,13 +59790,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
59742
59790
  shortDescription: `Checks that the code does not contain empty blocks.`,
59743
59791
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
59744
59792
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
59745
- badExample: `IF foo = bar.
59746
- ENDIF.
59747
-
59748
- DO 2 TIMES.
59793
+ badExample: `IF foo = bar.
59794
+ ENDIF.
59795
+
59796
+ DO 2 TIMES.
59749
59797
  ENDDO.`,
59750
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
59751
- ENDLOOP.
59798
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
59799
+ ENDLOOP.
59752
59800
  result = xsdbool( sy-subrc = 0 ).`,
59753
59801
  };
59754
59802
  }
@@ -59890,10 +59938,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
59890
59938
  return {
59891
59939
  key: "exit_or_check",
59892
59940
  title: "Find EXIT or CHECK outside loops",
59893
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59941
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59894
59942
  Use RETURN to leave procesing blocks instead.`,
59895
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59896
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59943
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59944
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59897
59945
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
59898
59946
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
59899
59947
  };
@@ -59976,12 +60024,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
59976
60024
  key: "expand_macros",
59977
60025
  title: "Expand Macros",
59978
60026
  shortDescription: `Allows expanding macro calls with quick fixes`,
59979
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59980
-
60027
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
60028
+
59981
60029
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
59982
- badExample: `DEFINE _hello.
59983
- WRITE 'hello'.
59984
- END-OF-DEFINITION.
60030
+ badExample: `DEFINE _hello.
60031
+ WRITE 'hello'.
60032
+ END-OF-DEFINITION.
59985
60033
  _hello.`,
59986
60034
  goodExample: `WRITE 'hello'.`,
59987
60035
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -60068,7 +60116,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
60068
60116
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
60069
60117
  badExample: `call_method( EXPORTING foo = bar ).`,
60070
60118
  goodExample: `call_method( foo = bar ).`,
60071
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
60119
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
60072
60120
  https://docs.abapopenchecks.org/checks/30/`,
60073
60121
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
60074
60122
  };
@@ -60166,7 +60214,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
60166
60214
  key: "forbidden_identifier",
60167
60215
  title: "Forbidden Identifier",
60168
60216
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
60169
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
60217
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
60170
60218
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
60171
60219
  tags: [_irule_1.RuleTag.SingleFile],
60172
60220
  };
@@ -60408,8 +60456,8 @@ class ForbiddenVoidType {
60408
60456
  key: "forbidden_void_type",
60409
60457
  title: "Forbidden Void Types",
60410
60458
  shortDescription: `Avoid usage of specified void types.`,
60411
- extendedInformation: `Inspiration:
60412
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
60459
+ extendedInformation: `Inspiration:
60460
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
60413
60461
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
60414
60462
  };
60415
60463
  }
@@ -60652,7 +60700,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
60652
60700
  key: "fully_type_itabs",
60653
60701
  title: "Fully type internal tables",
60654
60702
  shortDescription: `No implict table types or table keys`,
60655
- badExample: `DATA lt_foo TYPE TABLE OF ty.
60703
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
60656
60704
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
60657
60705
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
60658
60706
  tags: [_irule_1.RuleTag.SingleFile],
@@ -60837,26 +60885,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
60837
60885
  key: "functional_writing",
60838
60886
  title: "Use functional writing",
60839
60887
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
60840
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60888
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60841
60889
  https://docs.abapopenchecks.org/checks/07/`,
60842
60890
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
60843
- badExample: `CALL METHOD zcl_class=>method( ).
60844
- CALL METHOD cl_abap_typedescr=>describe_by_name
60845
- EXPORTING
60846
- p_name = 'NAME'
60847
- RECEIVING
60848
- p_descr_ref = lr_typedescr
60849
- EXCEPTIONS
60850
- type_not_found = 1
60891
+ badExample: `CALL METHOD zcl_class=>method( ).
60892
+ CALL METHOD cl_abap_typedescr=>describe_by_name
60893
+ EXPORTING
60894
+ p_name = 'NAME'
60895
+ RECEIVING
60896
+ p_descr_ref = lr_typedescr
60897
+ EXCEPTIONS
60898
+ type_not_found = 1
60851
60899
  OTHERS = 2.`,
60852
- goodExample: `zcl_class=>method( ).
60853
- cl_abap_typedescr=>describe_by_name(
60854
- EXPORTING
60855
- p_name = 'NAME'
60856
- RECEIVING
60857
- p_descr_ref = lr_typedescr
60858
- EXCEPTIONS
60859
- type_not_found = 1
60900
+ goodExample: `zcl_class=>method( ).
60901
+ cl_abap_typedescr=>describe_by_name(
60902
+ EXPORTING
60903
+ p_name = 'NAME'
60904
+ RECEIVING
60905
+ p_descr_ref = lr_typedescr
60906
+ EXCEPTIONS
60907
+ type_not_found = 1
60860
60908
  OTHERS = 2 ).`,
60861
60909
  };
60862
60910
  }
@@ -60967,14 +61015,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
60967
61015
  key: "global_class",
60968
61016
  title: "Global class checks",
60969
61017
  shortDescription: `Checks related to global classes`,
60970
- extendedInformation: `* global classes must be in own files
60971
-
60972
- * file names must match class name
60973
-
60974
- * file names must match interface name
60975
-
60976
- * global classes must be global definitions
60977
-
61018
+ extendedInformation: `* global classes must be in own files
61019
+
61020
+ * file names must match class name
61021
+
61022
+ * file names must match interface name
61023
+
61024
+ * global classes must be global definitions
61025
+
60978
61026
  * global interfaces must be global definitions`,
60979
61027
  tags: [_irule_1.RuleTag.Syntax],
60980
61028
  };
@@ -61073,21 +61121,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
61073
61121
  return {
61074
61122
  key: "identical_conditions",
61075
61123
  title: "Identical conditions",
61076
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
61077
-
61124
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
61125
+
61078
61126
  Prerequsites: code is pretty printed with identical cAsE`,
61079
61127
  tags: [_irule_1.RuleTag.SingleFile],
61080
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
61081
- ENDIF.
61082
- CASE bar.
61083
- WHEN '1'.
61084
- WHEN 'A' OR '1'.
61128
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
61129
+ ENDIF.
61130
+ CASE bar.
61131
+ WHEN '1'.
61132
+ WHEN 'A' OR '1'.
61085
61133
  ENDCASE.`,
61086
- goodExample: `IF foo = bar OR 1 = a.
61087
- ENDIF.
61088
- CASE bar.
61089
- WHEN '1'.
61090
- WHEN 'A'.
61134
+ goodExample: `IF foo = bar OR 1 = a.
61135
+ ENDIF.
61136
+ CASE bar.
61137
+ WHEN '1'.
61138
+ WHEN 'A'.
61091
61139
  ENDCASE.`,
61092
61140
  };
61093
61141
  }
@@ -61221,23 +61269,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
61221
61269
  key: "identical_contents",
61222
61270
  title: "Identical contents",
61223
61271
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
61224
- extendedInformation: `
61225
- Prerequsites: code is pretty printed with identical cAsE
61226
-
61272
+ extendedInformation: `
61273
+ Prerequsites: code is pretty printed with identical cAsE
61274
+
61227
61275
  Chained statments are ignored`,
61228
61276
  tags: [_irule_1.RuleTag.SingleFile],
61229
- badExample: `IF foo = bar.
61230
- WRITE 'bar'.
61231
- WRITE 'world'.
61232
- ELSE.
61233
- WRITE 'foo'.
61234
- WRITE 'world'.
61277
+ badExample: `IF foo = bar.
61278
+ WRITE 'bar'.
61279
+ WRITE 'world'.
61280
+ ELSE.
61281
+ WRITE 'foo'.
61282
+ WRITE 'world'.
61235
61283
  ENDIF.`,
61236
- goodExample: `IF foo = bar.
61237
- WRITE 'bar'.
61238
- ELSE.
61239
- WRITE 'foo'.
61240
- ENDIF.
61284
+ goodExample: `IF foo = bar.
61285
+ WRITE 'bar'.
61286
+ ELSE.
61287
+ WRITE 'foo'.
61288
+ ENDIF.
61241
61289
  WRITE 'world'.`,
61242
61290
  };
61243
61291
  }
@@ -61345,12 +61393,12 @@ class IdenticalDescriptions {
61345
61393
  key: "identical_descriptions",
61346
61394
  title: "Identical descriptions",
61347
61395
  shortDescription: `Searches for objects with the same type and same description`,
61348
- extendedInformation: `Case insensitive
61349
-
61350
- Only checks the master language descriptions
61351
-
61352
- Dependencies are skipped
61353
-
61396
+ extendedInformation: `Case insensitive
61397
+
61398
+ Only checks the master language descriptions
61399
+
61400
+ Dependencies are skipped
61401
+
61354
61402
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
61355
61403
  tags: [],
61356
61404
  };
@@ -61524,43 +61572,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
61524
61572
  key: "if_in_if",
61525
61573
  title: "IF in IF",
61526
61574
  shortDescription: `Detects nested ifs which can be refactored.`,
61527
- extendedInformation: `
61528
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
61529
-
61530
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
61531
-
61532
- https://docs.abapopenchecks.org/checks/01/
61575
+ extendedInformation: `
61576
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
61577
+
61578
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
61579
+
61580
+ https://docs.abapopenchecks.org/checks/01/
61533
61581
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
61534
- badExample: `IF condition1.
61535
- IF condition2.
61536
- ...
61537
- ENDIF.
61538
- ENDIF.
61539
-
61540
- IF condition1.
61541
- ...
61542
- ELSE.
61543
- IF condition2.
61544
- ...
61545
- ENDIF.
61582
+ badExample: `IF condition1.
61583
+ IF condition2.
61584
+ ...
61585
+ ENDIF.
61586
+ ENDIF.
61587
+
61588
+ IF condition1.
61589
+ ...
61590
+ ELSE.
61591
+ IF condition2.
61592
+ ...
61593
+ ENDIF.
61546
61594
  ENDIF.`,
61547
- goodExample: `IF ( condition1 ) AND ( condition2 ).
61548
- ...
61549
- ENDIF.
61550
-
61551
- IF condition1.
61552
- ...
61553
- ELSEIF condition2.
61554
- ...
61555
- ENDIF.
61556
-
61557
- CASE variable.
61558
- WHEN value1.
61559
- ...
61560
- WHEN value2.
61561
- IF condition2.
61562
- ...
61563
- ENDIF.
61595
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
61596
+ ...
61597
+ ENDIF.
61598
+
61599
+ IF condition1.
61600
+ ...
61601
+ ELSEIF condition2.
61602
+ ...
61603
+ ENDIF.
61604
+
61605
+ CASE variable.
61606
+ WHEN value1.
61607
+ ...
61608
+ WHEN value2.
61609
+ IF condition2.
61610
+ ...
61611
+ ENDIF.
61564
61612
  ENDCASE.`,
61565
61613
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61566
61614
  };
@@ -61745,9 +61793,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
61745
61793
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
61746
61794
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
61747
61795
  if (name === impl.identifier.getName().toUpperCase()) {
61748
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61749
- METHOD ${methodName.toLowerCase()}.
61750
- RETURN. " todo, implement method
61796
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61797
+ METHOD ${methodName.toLowerCase()}.
61798
+ RETURN. " todo, implement method
61751
61799
  ENDMETHOD.`);
61752
61800
  }
61753
61801
  }
@@ -61935,19 +61983,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
61935
61983
  key: "in_statement_indentation",
61936
61984
  title: "In-statement indentation",
61937
61985
  shortDescription: "Checks alignment within statements which span multiple lines.",
61938
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
61939
-
61940
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61986
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
61987
+
61988
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61941
61989
  to distinguish them better from code within the block.`,
61942
- badExample: `IF 1 = 1
61943
- AND 2 = 2.
61944
- WRITE 'hello' &&
61945
- 'world'.
61990
+ badExample: `IF 1 = 1
61991
+ AND 2 = 2.
61992
+ WRITE 'hello' &&
61993
+ 'world'.
61946
61994
  ENDIF.`,
61947
- goodExample: `IF 1 = 1
61948
- AND 2 = 2.
61949
- WRITE 'hello' &&
61950
- 'world'.
61995
+ goodExample: `IF 1 = 1
61996
+ AND 2 = 2.
61997
+ WRITE 'hello' &&
61998
+ 'world'.
61951
61999
  ENDIF.`,
61952
62000
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61953
62001
  };
@@ -62070,23 +62118,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
62070
62118
  title: "Indentation",
62071
62119
  shortDescription: `Checks indentation`,
62072
62120
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62073
- badExample: `CLASS lcl DEFINITION.
62074
- PRIVATE SECTION.
62075
- METHODS constructor.
62076
- ENDCLASS.
62077
-
62078
- CLASS lcl IMPLEMENTATION.
62079
- METHOD constructor.
62080
- ENDMETHOD.
62121
+ badExample: `CLASS lcl DEFINITION.
62122
+ PRIVATE SECTION.
62123
+ METHODS constructor.
62124
+ ENDCLASS.
62125
+
62126
+ CLASS lcl IMPLEMENTATION.
62127
+ METHOD constructor.
62128
+ ENDMETHOD.
62081
62129
  ENDCLASS.`,
62082
- goodExample: `CLASS lcl DEFINITION.
62083
- PRIVATE SECTION.
62084
- METHODS constructor.
62085
- ENDCLASS.
62086
-
62087
- CLASS lcl IMPLEMENTATION.
62088
- METHOD constructor.
62089
- ENDMETHOD.
62130
+ goodExample: `CLASS lcl DEFINITION.
62131
+ PRIVATE SECTION.
62132
+ METHODS constructor.
62133
+ ENDCLASS.
62134
+
62135
+ CLASS lcl IMPLEMENTATION.
62136
+ METHOD constructor.
62137
+ ENDMETHOD.
62090
62138
  ENDCLASS.`,
62091
62139
  };
62092
62140
  }
@@ -62473,9 +62521,9 @@ class IntfReferencingClas {
62473
62521
  key: "intf_referencing_clas",
62474
62522
  title: "INTF referencing CLAS",
62475
62523
  shortDescription: `Interface contains references to class`,
62476
- extendedInformation: `Only global interfaces are checked.
62477
- Only first level references are checked.
62478
- Exception class references are ignored.
62524
+ extendedInformation: `Only global interfaces are checked.
62525
+ Only first level references are checked.
62526
+ Exception class references are ignored.
62479
62527
  Void references are ignored.`,
62480
62528
  };
62481
62529
  }
@@ -62560,9 +62608,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
62560
62608
  title: "Invalid Table Index",
62561
62609
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
62562
62610
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62563
- badExample: `DATA(first) = table[ 0 ].
62611
+ badExample: `DATA(first) = table[ 0 ].
62564
62612
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
62565
- goodExample: `DATA(first) = table[ 1 ].
62613
+ goodExample: `DATA(first) = table[ 1 ].
62566
62614
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
62567
62615
  };
62568
62616
  }
@@ -62991,8 +63039,11 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
62991
63039
  /** returns a list of tokens which violates the keyword_case rule */
62992
63040
  traverse(s, parent) {
62993
63041
  let ret = [];
62994
- for (const child of s.getChildren()) {
63042
+ const children = s.getChildren();
63043
+ for (let i = 0; i < children.length; i++) {
63044
+ const child = children[i];
62995
63045
  if (child instanceof nodes_1.TokenNodeRegex) {
63046
+ const next = children[i + 1];
62996
63047
  if (this.conf.ignoreLowerClassImplmentationStatement
62997
63048
  && parent instanceof Statements.ClassImplementation) {
62998
63049
  continue;
@@ -63000,7 +63051,7 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
63000
63051
  const str = child.get().getStr();
63001
63052
  const upper = str.toUpperCase();
63002
63053
  // todo, this is a hack, the parser should recongize OTHERS/TEXT as a keyword
63003
- if (upper === "OTHERS" || upper === "TEXT") {
63054
+ if (upper === "OTHERS" || (upper === "TEXT" && (next === null || next === void 0 ? void 0 : next.concatTokens()) === "-")) {
63004
63055
  continue;
63005
63056
  }
63006
63057
  if (this.conf.ignoreFunctionModuleName === true
@@ -63160,8 +63211,8 @@ class LineBreakStyle {
63160
63211
  return {
63161
63212
  key: "line_break_style",
63162
63213
  title: "Makes sure line breaks are consistent in the ABAP code",
63163
- shortDescription: `Enforces LF as newlines in ABAP files
63164
-
63214
+ shortDescription: `Enforces LF as newlines in ABAP files
63215
+
63165
63216
  abapGit does not work with CRLF`,
63166
63217
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
63167
63218
  };
@@ -63230,7 +63281,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
63230
63281
  key: "line_length",
63231
63282
  title: "Line length",
63232
63283
  shortDescription: `Detects lines exceeding the provided maximum length.`,
63233
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
63284
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
63234
63285
  https://docs.abapopenchecks.org/checks/04/`,
63235
63286
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63236
63287
  };
@@ -63301,7 +63352,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
63301
63352
  key: "line_only_punc",
63302
63353
  title: "Line containing only punctuation",
63303
63354
  shortDescription: `Detects lines containing only punctuation.`,
63304
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
63355
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
63305
63356
  https://docs.abapopenchecks.org/checks/16/`,
63306
63357
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63307
63358
  badExample: "zcl_class=>method(\n).",
@@ -63561,15 +63612,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
63561
63612
  return {
63562
63613
  key: "local_variable_names",
63563
63614
  title: "Local variable naming conventions",
63564
- shortDescription: `
63565
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
63615
+ shortDescription: `
63616
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
63566
63617
  Regexes are case-insensitive.`,
63567
63618
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
63568
- badExample: `FORM bar.
63569
- DATA foo.
63619
+ badExample: `FORM bar.
63620
+ DATA foo.
63570
63621
  ENDFORM.`,
63571
- goodExample: `FORM bar.
63572
- DATA lv_foo.
63622
+ goodExample: `FORM bar.
63623
+ DATA lv_foo.
63573
63624
  ENDFORM.`,
63574
63625
  };
63575
63626
  }
@@ -63715,10 +63766,10 @@ class MainFileContents {
63715
63766
  key: "main_file_contents",
63716
63767
  title: "Main file contents",
63717
63768
  shortDescription: `Checks related to report declarations.`,
63718
- extendedInformation: `Does not run if the target version is Cloud
63719
-
63720
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
63721
- * TYPEs must begin with "TYPE-POOL <name>."
63769
+ extendedInformation: `Does not run if the target version is Cloud
63770
+
63771
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
63772
+ * TYPEs must begin with "TYPE-POOL <name>."
63722
63773
  `,
63723
63774
  };
63724
63775
  }
@@ -63834,17 +63885,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
63834
63885
  title: "Too many parentheses",
63835
63886
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
63836
63887
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63837
- badExample: `
63838
- IF ( destination IS INITIAL ).
63839
- ENDIF.
63840
- IF foo = boo AND ( bar = lar AND moo = loo ).
63841
- ENDIF.
63888
+ badExample: `
63889
+ IF ( destination IS INITIAL ).
63890
+ ENDIF.
63891
+ IF foo = boo AND ( bar = lar AND moo = loo ).
63892
+ ENDIF.
63842
63893
  `,
63843
- goodExample: `
63844
- IF destination IS INITIAL.
63845
- ENDIF.
63846
- IF foo = boo AND bar = lar AND moo = loo.
63847
- ENDIF.
63894
+ goodExample: `
63895
+ IF destination IS INITIAL.
63896
+ ENDIF.
63897
+ IF foo = boo AND bar = lar AND moo = loo.
63898
+ ENDIF.
63848
63899
  `,
63849
63900
  };
63850
63901
  }
@@ -64018,14 +64069,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
64018
64069
  title: "Max one method parameter definition per line",
64019
64070
  shortDescription: `Keep max one method parameter description per line`,
64020
64071
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
64021
- badExample: `
64022
- METHODS apps_scope_token
64023
- IMPORTING
64072
+ badExample: `
64073
+ METHODS apps_scope_token
64074
+ IMPORTING
64024
64075
  body TYPE bodyapps_scope_token client_id TYPE str.`,
64025
- goodExample: `
64026
- METHODS apps_scope_token
64027
- IMPORTING
64028
- body TYPE bodyapps_scope_token
64076
+ goodExample: `
64077
+ METHODS apps_scope_token
64078
+ IMPORTING
64079
+ body TYPE bodyapps_scope_token
64029
64080
  client_id TYPE str.`,
64030
64081
  };
64031
64082
  }
@@ -64090,11 +64141,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
64090
64141
  key: "max_one_statement",
64091
64142
  title: "Max one statement per line",
64092
64143
  shortDescription: `Checks that each line contains only a single statement.`,
64093
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
64094
-
64095
- Does not report anything for chained statements.
64096
-
64097
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
64144
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
64145
+
64146
+ Does not report anything for chained statements.
64147
+
64148
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
64098
64149
  https://docs.abapopenchecks.org/checks/11/`,
64099
64150
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64100
64151
  badExample: `WRITE foo. WRITE bar.`,
@@ -64432,8 +64483,8 @@ class MethodLength {
64432
64483
  key: "method_length",
64433
64484
  title: "Method/Form Length",
64434
64485
  shortDescription: `Checks relating to method/form length.`,
64435
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
64436
-
64486
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
64487
+
64437
64488
  Abstract methods without statements are considered okay.`,
64438
64489
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64439
64490
  };
@@ -64538,20 +64589,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
64538
64589
  key: "method_overwrites_builtin",
64539
64590
  title: "Method name overwrites builtin function",
64540
64591
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
64541
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
64542
-
64543
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
64544
-
64592
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
64593
+
64594
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
64595
+
64545
64596
  Interface method names are ignored`,
64546
64597
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64547
- badExample: `CLASS lcl DEFINITION.
64548
- PUBLIC SECTION.
64549
- METHODS matches.
64550
- ENDCLASS.
64551
-
64552
- CLASS lcl IMPLEMENTATION.
64553
- METHOD matches.
64554
- ENDMETHOD.
64598
+ badExample: `CLASS lcl DEFINITION.
64599
+ PUBLIC SECTION.
64600
+ METHODS matches.
64601
+ ENDCLASS.
64602
+
64603
+ CLASS lcl IMPLEMENTATION.
64604
+ METHOD matches.
64605
+ ENDMETHOD.
64555
64606
  ENDCLASS.`,
64556
64607
  };
64557
64608
  }
@@ -64742,12 +64793,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
64742
64793
  // eslint-disable-next-line max-len
64743
64794
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
64744
64795
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64745
- badExample: `CLASS lcl DEFINITION.
64746
- PUBLIC SECTION.
64747
- METHODS
64748
- foobar
64749
- EXPORTING foo TYPE i
64750
- RETURNING VALUE(rv_string) TYPE string.
64796
+ badExample: `CLASS lcl DEFINITION.
64797
+ PUBLIC SECTION.
64798
+ METHODS
64799
+ foobar
64800
+ EXPORTING foo TYPE i
64801
+ RETURNING VALUE(rv_string) TYPE string.
64751
64802
  ENDCLASS.`,
64752
64803
  };
64753
64804
  }
@@ -65127,7 +65178,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
65127
65178
  key: "nesting",
65128
65179
  title: "Check nesting depth",
65129
65180
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
65130
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
65181
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
65131
65182
  https://docs.abapopenchecks.org/checks/74/`,
65132
65183
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65133
65184
  };
@@ -65370,7 +65421,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
65370
65421
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
65371
65422
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
65372
65423
  badExample: `var1 = var2 = var3.`,
65373
- goodExample: `var2 = var3.
65424
+ goodExample: `var2 = var3.
65374
65425
  var1 = var2.`,
65375
65426
  };
65376
65427
  }
@@ -65429,8 +65480,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
65429
65480
  key: "no_external_form_calls",
65430
65481
  title: "No external FORM calls",
65431
65482
  shortDescription: `Detect external form calls`,
65432
- badExample: `PERFORM foo IN PROGRAM bar.
65433
-
65483
+ badExample: `PERFORM foo IN PROGRAM bar.
65484
+
65434
65485
  PERFORM foo(bar).`,
65435
65486
  tags: [_irule_1.RuleTag.SingleFile],
65436
65487
  };
@@ -65491,17 +65542,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
65491
65542
  key: "no_inline_in_optional_branches",
65492
65543
  title: "Don't declare inline in optional branches",
65493
65544
  shortDescription: `Don't declare inline in optional branches`,
65494
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
65495
-
65496
- Considered optional branches:
65497
- * inside IF/ELSEIF/ELSE
65498
- * inside LOOP
65499
- * inside WHILE
65500
- * inside CASE/WHEN, CASE TYPE OF
65501
- * inside DO
65502
- * inside SELECT loops
65503
-
65504
- Not considered optional branches:
65545
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
65546
+
65547
+ Considered optional branches:
65548
+ * inside IF/ELSEIF/ELSE
65549
+ * inside LOOP
65550
+ * inside WHILE
65551
+ * inside CASE/WHEN, CASE TYPE OF
65552
+ * inside DO
65553
+ * inside SELECT loops
65554
+
65555
+ Not considered optional branches:
65505
65556
  * TRY/CATCH/CLEANUP`,
65506
65557
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65507
65558
  };
@@ -65601,12 +65652,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
65601
65652
  key: "no_prefixes",
65602
65653
  title: "No Prefixes",
65603
65654
  shortDescription: `Dont use hungarian notation`,
65604
- extendedInformation: `
65605
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
65606
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
65607
-
65608
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
65609
-
65655
+ extendedInformation: `
65656
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
65657
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
65658
+
65659
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
65660
+
65610
65661
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
65611
65662
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
65612
65663
  badExample: `DATA lv_foo TYPE i.`,
@@ -65785,7 +65836,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
65785
65836
  return {
65786
65837
  key: "no_public_attributes",
65787
65838
  title: "No public attributes",
65788
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
65839
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
65789
65840
  Exceptions are excluded from this rule.`,
65790
65841
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
65791
65842
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -65886,13 +65937,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
65886
65937
  key: "no_yoda_conditions",
65887
65938
  title: "No Yoda conditions",
65888
65939
  shortDescription: `Finds Yoda conditions and reports issues`,
65889
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65890
-
65940
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65941
+
65891
65942
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
65892
65943
  tags: [_irule_1.RuleTag.SingleFile],
65893
- badExample: `IF 0 <> sy-subrc.
65944
+ badExample: `IF 0 <> sy-subrc.
65894
65945
  ENDIF.`,
65895
- goodExample: `IF sy-subrc <> 0.
65946
+ goodExample: `IF sy-subrc <> 0.
65896
65947
  ENDIF.`,
65897
65948
  };
65898
65949
  }
@@ -65993,8 +66044,8 @@ class NROBConsistency {
65993
66044
  key: "nrob_consistency",
65994
66045
  title: "Number range consistency",
65995
66046
  shortDescription: `Consistency checks for number ranges`,
65996
- extendedInformation: `Issue reported if percentage warning is over 50%
65997
-
66047
+ extendedInformation: `Issue reported if percentage warning is over 50%
66048
+
65998
66049
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
65999
66050
  tags: [_irule_1.RuleTag.SingleFile],
66000
66051
  };
@@ -66271,58 +66322,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
66271
66322
  title: "Obsolete statements",
66272
66323
  shortDescription: `Checks for usages of certain obsolete statements`,
66273
66324
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
66274
- extendedInformation: `
66275
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
66276
-
66277
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
66278
-
66279
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
66280
-
66281
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
66282
-
66283
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
66284
-
66285
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
66286
-
66287
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66288
-
66289
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66290
-
66291
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
66292
-
66293
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
66294
-
66295
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
66296
-
66297
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
66298
-
66299
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
66300
-
66301
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
66302
-
66303
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
66304
- SELECT COUNT(*) is considered okay
66305
-
66306
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
66307
-
66308
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
66309
-
66310
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
66311
-
66312
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
66313
-
66314
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
66315
-
66325
+ extendedInformation: `
66326
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
66327
+
66328
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
66329
+
66330
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
66331
+
66332
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
66333
+
66334
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
66335
+
66336
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
66337
+
66338
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66339
+
66340
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66341
+
66342
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
66343
+
66344
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
66345
+
66346
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
66347
+
66348
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
66349
+
66350
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
66351
+
66352
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
66353
+
66354
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
66355
+ SELECT COUNT(*) is considered okay
66356
+
66357
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
66358
+
66359
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
66360
+
66361
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
66362
+
66363
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
66364
+
66365
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
66366
+
66316
66367
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
66317
- badExample: `REFRESH itab.
66318
-
66319
- COMPUTE foo = 2 + 2.
66320
-
66321
- MULTIPLY lv_foo BY 2.
66322
-
66323
- INTERFACE intf LOAD.
66324
-
66325
- IF foo IS SUPPLIED.
66368
+ badExample: `REFRESH itab.
66369
+
66370
+ COMPUTE foo = 2 + 2.
66371
+
66372
+ MULTIPLY lv_foo BY 2.
66373
+
66374
+ INTERFACE intf LOAD.
66375
+
66376
+ IF foo IS SUPPLIED.
66326
66377
  ENDIF.`,
66327
66378
  };
66328
66379
  }
@@ -66662,9 +66713,9 @@ class OmitParameterName {
66662
66713
  key: "omit_parameter_name",
66663
66714
  title: "Omit parameter name",
66664
66715
  shortDescription: `Omit the parameter name in single parameter calls`,
66665
- extendedInformation: `
66666
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
66667
-
66716
+ extendedInformation: `
66717
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
66718
+
66668
66719
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
66669
66720
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
66670
66721
  badExample: `method( param = 2 ).`,
@@ -66870,20 +66921,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
66870
66921
  shortDescription: `Omit RECEIVING`,
66871
66922
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
66872
66923
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66873
- badExample: `
66874
- upload_pack(
66875
- EXPORTING
66876
- io_client = lo_client
66877
- iv_url = iv_url
66878
- iv_deepen_level = iv_deepen_level
66879
- it_hashes = lt_hashes
66880
- RECEIVING
66924
+ badExample: `
66925
+ upload_pack(
66926
+ EXPORTING
66927
+ io_client = lo_client
66928
+ iv_url = iv_url
66929
+ iv_deepen_level = iv_deepen_level
66930
+ it_hashes = lt_hashes
66931
+ RECEIVING
66881
66932
  rt_objects = et_objects ).`,
66882
- goodExample: `
66883
- et_objects = upload_pack(
66884
- io_client = lo_client
66885
- iv_url = iv_url
66886
- iv_deepen_level = iv_deepen_level
66933
+ goodExample: `
66934
+ et_objects = upload_pack(
66935
+ io_client = lo_client
66936
+ iv_url = iv_url
66937
+ iv_deepen_level = iv_deepen_level
66887
66938
  it_hashes = lt_hashes ).`,
66888
66939
  };
66889
66940
  }
@@ -66947,8 +66998,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
66947
66998
  return {
66948
66999
  key: "parser_702_chaining",
66949
67000
  title: "Parser Error, bad chanining on 702",
66950
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66951
- this rule finds these and reports errors.
67001
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
67002
+ this rule finds these and reports errors.
66952
67003
  Only active on target version 702 and below.`,
66953
67004
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66954
67005
  };
@@ -67028,8 +67079,8 @@ class ParserError {
67028
67079
  return {
67029
67080
  key: "parser_error",
67030
67081
  title: "Parser error",
67031
- shortDescription: `Checks for syntax not recognized by abaplint.
67032
-
67082
+ shortDescription: `Checks for syntax not recognized by abaplint.
67083
+
67033
67084
  See recognized syntax at https://syntax.abaplint.org`,
67034
67085
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
67035
67086
  };
@@ -67114,7 +67165,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
67114
67165
  return {
67115
67166
  key: "parser_missing_space",
67116
67167
  title: "Parser Error, missing space",
67117
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
67168
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
67118
67169
  This rule makes sure the spaces are consistently required across the language.`,
67119
67170
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
67120
67171
  badExample: `IF ( foo = 'bar').`,
@@ -67526,25 +67577,25 @@ class PreferInline {
67526
67577
  key: "prefer_inline",
67527
67578
  title: "Prefer Inline Declarations",
67528
67579
  shortDescription: `Prefer inline to up-front declarations.`,
67529
- extendedInformation: `EXPERIMENTAL
67530
-
67531
- Activates if language version is v740sp02 or above.
67532
-
67533
- Variables must be local(METHOD or FORM).
67534
-
67535
- No generic or void typed variables. No syntax errors.
67536
-
67537
- First position used must be a full/pure write.
67538
-
67539
- Move statment is not a cast(?=)
67540
-
67580
+ extendedInformation: `EXPERIMENTAL
67581
+
67582
+ Activates if language version is v740sp02 or above.
67583
+
67584
+ Variables must be local(METHOD or FORM).
67585
+
67586
+ No generic or void typed variables. No syntax errors.
67587
+
67588
+ First position used must be a full/pure write.
67589
+
67590
+ Move statment is not a cast(?=)
67591
+
67541
67592
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
67542
67593
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
67543
- badExample: `DATA foo TYPE i.
67544
- foo = 2.
67545
- DATA percentage TYPE decfloat34.
67594
+ badExample: `DATA foo TYPE i.
67595
+ foo = 2.
67596
+ DATA percentage TYPE decfloat34.
67546
67597
  percentage = ( comment_number / abs_statement_number ) * 100.`,
67547
- goodExample: `DATA(foo) = 2.
67598
+ goodExample: `DATA(foo) = 2.
67548
67599
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
67549
67600
  };
67550
67601
  }
@@ -67758,18 +67809,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
67758
67809
  key: "prefer_is_not",
67759
67810
  title: "Prefer IS NOT to NOT IS",
67760
67811
  shortDescription: `Prefer IS NOT to NOT IS`,
67761
- extendedInformation: `
67762
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
67763
-
67812
+ extendedInformation: `
67813
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
67814
+
67764
67815
  "if not is_valid( )." examples are skipped`,
67765
67816
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
67766
- goodExample: `IF variable IS NOT INITIAL.
67767
- IF variable NP 'TODO*'.
67768
- IF variable <> 42.
67817
+ goodExample: `IF variable IS NOT INITIAL.
67818
+ IF variable NP 'TODO*'.
67819
+ IF variable <> 42.
67769
67820
  IF variable CO 'hello'.`,
67770
- badExample: `IF NOT variable IS INITIAL.
67771
- IF NOT variable CP 'TODO*'.
67772
- IF NOT variable = 42.
67821
+ badExample: `IF NOT variable IS INITIAL.
67822
+ IF NOT variable CP 'TODO*'.
67823
+ IF NOT variable = 42.
67773
67824
  IF NOT variable CA 'hello'.`,
67774
67825
  };
67775
67826
  }
@@ -67957,14 +68008,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
67957
68008
  key: "prefer_raise_exception_new",
67958
68009
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
67959
68010
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
67960
- extendedInformation: `
67961
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67962
-
68011
+ extendedInformation: `
68012
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
68013
+
67963
68014
  From 752 and up`,
67964
68015
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
67965
68016
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
67966
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
67967
- EXPORTING
68017
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
68018
+ EXPORTING
67968
68019
  previous = exception.`,
67969
68020
  };
67970
68021
  }
@@ -68042,12 +68093,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
68042
68093
  key: "prefer_returning_to_exporting",
68043
68094
  title: "Prefer RETURNING to EXPORTING",
68044
68095
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
68045
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
68096
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
68046
68097
  https://docs.abapopenchecks.org/checks/44/`,
68047
68098
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68048
- badExample: `CLASS lcl DEFINITION.
68049
- PUBLIC SECTION.
68050
- METHODS test EXPORTING ev_foo TYPE i.
68099
+ badExample: `CLASS lcl DEFINITION.
68100
+ PUBLIC SECTION.
68101
+ METHODS test EXPORTING ev_foo TYPE i.
68051
68102
  ENDCLASS.`,
68052
68103
  };
68053
68104
  }
@@ -68143,8 +68194,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
68143
68194
  key: "prefer_xsdbool",
68144
68195
  title: "Prefer xsdbool over boolc",
68145
68196
  shortDescription: `Prefer xsdbool over boolc`,
68146
- extendedInformation: `Activates if language version is v740sp08 or above.
68147
-
68197
+ extendedInformation: `Activates if language version is v740sp08 or above.
68198
+
68148
68199
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
68149
68200
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
68150
68201
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -68216,9 +68267,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
68216
68267
  title: "Preferred compare operator",
68217
68268
  shortDescription: `Configure undesired operator variants`,
68218
68269
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
68219
- badExample: `IF foo EQ bar.
68270
+ badExample: `IF foo EQ bar.
68220
68271
  ENDIF.`,
68221
- goodExample: `IF foo = bar.
68272
+ goodExample: `IF foo = bar.
68222
68273
  ENDIF.`,
68223
68274
  };
68224
68275
  }
@@ -68442,26 +68493,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
68442
68493
  key: "reduce_procedural_code",
68443
68494
  title: "Reduce procedural code",
68444
68495
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
68445
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
68446
-
68447
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
68448
-
68496
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
68497
+
68498
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
68499
+
68449
68500
  Comments are not counted as statements.`,
68450
68501
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
68451
- badExample: `FORM foo.
68452
- DATA lv_bar TYPE i.
68453
- lv_bar = 2 + 2.
68454
- IF lv_bar = 4.
68455
- WRITE 'hello world'.
68456
- ENDIF.
68457
- DATA lv_bar TYPE i.
68458
- lv_bar = 2 + 2.
68459
- IF lv_bar = 4.
68460
- WRITE 'hello world'.
68461
- ENDIF.
68502
+ badExample: `FORM foo.
68503
+ DATA lv_bar TYPE i.
68504
+ lv_bar = 2 + 2.
68505
+ IF lv_bar = 4.
68506
+ WRITE 'hello world'.
68507
+ ENDIF.
68508
+ DATA lv_bar TYPE i.
68509
+ lv_bar = 2 + 2.
68510
+ IF lv_bar = 4.
68511
+ WRITE 'hello world'.
68512
+ ENDIF.
68462
68513
  ENDFORM.`,
68463
- goodExample: `FORM foo.
68464
- NEW zcl_global_class( )->run_logic( ).
68514
+ goodExample: `FORM foo.
68515
+ NEW zcl_global_class( )->run_logic( ).
68465
68516
  ENDFORM.`,
68466
68517
  };
68467
68518
  }
@@ -68705,10 +68756,10 @@ class RemoveDescriptions {
68705
68756
  return {
68706
68757
  key: "remove_descriptions",
68707
68758
  title: "Remove descriptions",
68708
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
68709
-
68710
- Class descriptions are required, see rule description_empty.
68711
-
68759
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
68760
+
68761
+ Class descriptions are required, see rule description_empty.
68762
+
68712
68763
  Consider using ABAP Doc for documentation.`,
68713
68764
  tags: [],
68714
68765
  };
@@ -68833,16 +68884,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
68833
68884
  tags: [_irule_1.RuleTag.SingleFile],
68834
68885
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
68835
68886
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
68836
- badExample: `
68837
- CALL FUNCTION 'ZRFC'
68887
+ badExample: `
68888
+ CALL FUNCTION 'ZRFC'
68838
68889
  DESTINATION lv_rfc.`,
68839
- goodExample: `
68840
- CALL FUNCTION 'ZRFC'
68841
- DESTINATION lv_rfc
68842
- EXCEPTIONS
68843
- system_failure = 1 MESSAGE msg
68844
- communication_failure = 2 MESSAGE msg
68845
- resource_failure = 3
68890
+ goodExample: `
68891
+ CALL FUNCTION 'ZRFC'
68892
+ DESTINATION lv_rfc
68893
+ EXCEPTIONS
68894
+ system_failure = 1 MESSAGE msg
68895
+ communication_failure = 2 MESSAGE msg
68896
+ resource_failure = 3
68846
68897
  OTHERS = 4.`,
68847
68898
  };
68848
68899
  }
@@ -68926,11 +68977,11 @@ class SelectAddOrderBy {
68926
68977
  key: "select_add_order_by",
68927
68978
  title: "SELECT add ORDER BY",
68928
68979
  shortDescription: `SELECTs add ORDER BY clause`,
68929
- extendedInformation: `
68930
- This will make sure that the SELECT statement returns results in the same sequence on different databases
68931
-
68932
- add ORDER BY PRIMARY KEY if in doubt
68933
-
68980
+ extendedInformation: `
68981
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
68982
+
68983
+ add ORDER BY PRIMARY KEY if in doubt
68984
+
68934
68985
  If the target is a sorted/hashed table, no issue is reported`,
68935
68986
  tags: [_irule_1.RuleTag.SingleFile],
68936
68987
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -69061,14 +69112,14 @@ class SelectPerformance {
69061
69112
  key: "select_performance",
69062
69113
  title: "SELECT performance",
69063
69114
  shortDescription: `Various checks regarding SELECT performance.`,
69064
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
69065
-
69115
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
69116
+
69066
69117
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
69067
69118
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
69068
- badExample: `SELECT field1, field2 FROM table
69069
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
69119
+ badExample: `SELECT field1, field2 FROM table
69120
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
69070
69121
  ENDSELECT.`,
69071
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
69122
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
69072
69123
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
69073
69124
  };
69074
69125
  }
@@ -69180,8 +69231,8 @@ class SelectSingleFullKey {
69180
69231
  key: "select_single_full_key",
69181
69232
  title: "Detect SELECT SINGLE which are possibily not unique",
69182
69233
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
69183
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
69184
-
69234
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
69235
+
69185
69236
  If the statement contains a JOIN it is not checked`,
69186
69237
  pseudoComment: "EC CI_NOORDER",
69187
69238
  tags: [],
@@ -69598,8 +69649,8 @@ class SICFConsistency {
69598
69649
  key: "sicf_consistency",
69599
69650
  title: "SICF consistency",
69600
69651
  shortDescription: `Checks the validity of ICF services`,
69601
- extendedInformation: `* Class defined in handler must exist
69602
- * Class must not have any syntax errors
69652
+ extendedInformation: `* Class defined in handler must exist
69653
+ * Class must not have any syntax errors
69603
69654
  * Class must implement interface IF_HTTP_EXTENSION`,
69604
69655
  };
69605
69656
  }
@@ -69711,23 +69762,23 @@ class SlowParameterPassing {
69711
69762
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
69712
69763
  extendedInformation: `Method parameters defined in interfaces is not checked`,
69713
69764
  tags: [_irule_1.RuleTag.Performance],
69714
- badExample: `CLASS lcl DEFINITION.
69715
- PUBLIC SECTION.
69716
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
69717
- ENDCLASS.
69718
- CLASS lcl IMPLEMENTATION.
69719
- METHOD bar.
69720
- WRITE sdf.
69721
- ENDMETHOD.
69765
+ badExample: `CLASS lcl DEFINITION.
69766
+ PUBLIC SECTION.
69767
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
69768
+ ENDCLASS.
69769
+ CLASS lcl IMPLEMENTATION.
69770
+ METHOD bar.
69771
+ WRITE sdf.
69772
+ ENDMETHOD.
69722
69773
  ENDCLASS.`,
69723
- goodExample: `CLASS lcl DEFINITION.
69724
- PUBLIC SECTION.
69725
- METHODS bar IMPORTING sdf TYPE string.
69726
- ENDCLASS.
69727
- CLASS lcl IMPLEMENTATION.
69728
- METHOD bar.
69729
- WRITE sdf.
69730
- ENDMETHOD.
69774
+ goodExample: `CLASS lcl DEFINITION.
69775
+ PUBLIC SECTION.
69776
+ METHODS bar IMPORTING sdf TYPE string.
69777
+ ENDCLASS.
69778
+ CLASS lcl IMPLEMENTATION.
69779
+ METHOD bar.
69780
+ WRITE sdf.
69781
+ ENDMETHOD.
69731
69782
  ENDCLASS.`,
69732
69783
  };
69733
69784
  }
@@ -69984,8 +70035,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
69984
70035
  key: "space_before_dot",
69985
70036
  title: "Space before dot",
69986
70037
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
69987
- extendedInformation: `
69988
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
70038
+ extendedInformation: `
70039
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69989
70040
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
69990
70041
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69991
70042
  badExample: `WRITE bar .`,
@@ -70171,12 +70222,12 @@ class SQLValueConversion {
70171
70222
  key: "sql_value_conversion",
70172
70223
  title: "Implicit SQL Value Conversion",
70173
70224
  shortDescription: `Ensure types match when selecting from database`,
70174
- extendedInformation: `
70175
- * Integer to CHAR conversion
70176
- * Integer to NUMC conversion
70177
- * NUMC to Integer conversion
70178
- * CHAR to Integer conversion
70179
- * Source field longer than database field, CHAR -> CHAR
70225
+ extendedInformation: `
70226
+ * Integer to CHAR conversion
70227
+ * Integer to NUMC conversion
70228
+ * NUMC to Integer conversion
70229
+ * CHAR to Integer conversion
70230
+ * Source field longer than database field, CHAR -> CHAR
70180
70231
  * Source field longer than database field, NUMC -> NUMC`,
70181
70232
  tags: [],
70182
70233
  };
@@ -70248,7 +70299,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
70248
70299
  key: "start_at_tab",
70249
70300
  title: "Start at tab",
70250
70301
  shortDescription: `Checks that statements start at tabstops.`,
70251
- extendedInformation: `Reports max 100 issues per file
70302
+ extendedInformation: `Reports max 100 issues per file
70252
70303
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
70253
70304
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70254
70305
  badExample: ` WRITE a.`,
@@ -70425,12 +70476,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
70425
70476
  key: "strict_sql",
70426
70477
  title: "Strict SQL",
70427
70478
  shortDescription: `Strict SQL`,
70428
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
70429
-
70430
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
70431
-
70432
- Also see separate rule sql_escape_host_variables
70433
-
70479
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
70480
+
70481
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
70482
+
70483
+ Also see separate rule sql_escape_host_variables
70484
+
70434
70485
  Activates from v750 and up`,
70435
70486
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
70436
70487
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -70684,11 +70735,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
70684
70735
  key: "sy_modification",
70685
70736
  title: "Modification of SY fields",
70686
70737
  shortDescription: `Finds modification of sy fields`,
70687
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
70688
-
70738
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
70739
+
70689
70740
  Changes to SY-TVAR* fields are not reported`,
70690
70741
  tags: [_irule_1.RuleTag.SingleFile],
70691
- badExample: `sy-uname = 2.
70742
+ badExample: `sy-uname = 2.
70692
70743
  sy = sy.`,
70693
70744
  };
70694
70745
  }
@@ -70750,8 +70801,8 @@ class TABLEnhancementCategory {
70750
70801
  key: "tabl_enhancement_category",
70751
70802
  title: "TABL enhancement category must be set",
70752
70803
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
70753
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
70754
-
70804
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
70805
+
70755
70806
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
70756
70807
  tags: [],
70757
70808
  };
@@ -70879,9 +70930,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
70879
70930
  title: "Type FORM parameters",
70880
70931
  shortDescription: `Checks for untyped FORM parameters`,
70881
70932
  tags: [_irule_1.RuleTag.SingleFile],
70882
- badExample: `FORM foo USING bar.
70933
+ badExample: `FORM foo USING bar.
70883
70934
  ENDFORM.`,
70884
- goodExample: `FORM foo USING bar TYPE string.
70935
+ goodExample: `FORM foo USING bar TYPE string.
70885
70936
  ENDFORM.`,
70886
70937
  };
70887
70938
  }
@@ -71554,38 +71605,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
71554
71605
  key: "unnecessary_pragma",
71555
71606
  title: "Unnecessary Pragma",
71556
71607
  shortDescription: `Finds pragmas which can be removed`,
71557
- extendedInformation: `* NO_HANDLER with handler
71558
-
71559
- * NEEDED without definition
71560
-
71561
- * NO_TEXT without texts
71562
-
71563
- * SUBRC_OK where sy-subrc is checked
71564
-
71608
+ extendedInformation: `* NO_HANDLER with handler
71609
+
71610
+ * NEEDED without definition
71611
+
71612
+ * NO_TEXT without texts
71613
+
71614
+ * SUBRC_OK where sy-subrc is checked
71615
+
71565
71616
  NO_HANDLER inside macros are not checked`,
71566
71617
  tags: [_irule_1.RuleTag.SingleFile],
71567
- badExample: `TRY.
71568
- ...
71569
- CATCH zcx_abapgit_exception ##NO_HANDLER.
71570
- RETURN. " it has a handler
71571
- ENDTRY.
71572
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
71573
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
71574
- IF sy-subrc <> 0.
71618
+ badExample: `TRY.
71619
+ ...
71620
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
71621
+ RETURN. " it has a handler
71622
+ ENDTRY.
71623
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
71624
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
71625
+ IF sy-subrc <> 0.
71575
71626
  ENDIF.`,
71576
- goodExample: `TRY.
71577
- ...
71578
- CATCH zcx_abapgit_exception.
71579
- RETURN.
71580
- ENDTRY.
71581
- MESSAGE w125(zbar) WITH c_foo INTO message.
71582
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
71583
- IF sy-subrc <> 0.
71584
- ENDIF.
71585
-
71586
- DATA: BEGIN OF blah ##NEEDED,
71587
- test1 TYPE string,
71588
- test2 TYPE string,
71627
+ goodExample: `TRY.
71628
+ ...
71629
+ CATCH zcx_abapgit_exception.
71630
+ RETURN.
71631
+ ENDTRY.
71632
+ MESSAGE w125(zbar) WITH c_foo INTO message.
71633
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
71634
+ IF sy-subrc <> 0.
71635
+ ENDIF.
71636
+
71637
+ DATA: BEGIN OF blah ##NEEDED,
71638
+ test1 TYPE string,
71639
+ test2 TYPE string,
71589
71640
  END OF blah.`,
71590
71641
  };
71591
71642
  }
@@ -71746,18 +71797,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
71746
71797
  shortDescription: `Finds unnecessary RETURN statements`,
71747
71798
  extendedInformation: `Finds unnecessary RETURN statements`,
71748
71799
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
71749
- badExample: `FORM hello1.
71750
- WRITE 'world'.
71751
- RETURN.
71752
- ENDFORM.
71753
-
71754
- FORM foo.
71755
- IF 1 = 2.
71756
- RETURN.
71757
- ENDIF.
71800
+ badExample: `FORM hello1.
71801
+ WRITE 'world'.
71802
+ RETURN.
71803
+ ENDFORM.
71804
+
71805
+ FORM foo.
71806
+ IF 1 = 2.
71807
+ RETURN.
71808
+ ENDIF.
71758
71809
  ENDFORM.`,
71759
- goodExample: `FORM hello2.
71760
- WRITE 'world'.
71810
+ goodExample: `FORM hello2.
71811
+ WRITE 'world'.
71761
71812
  ENDFORM.`,
71762
71813
  };
71763
71814
  }
@@ -72124,17 +72175,17 @@ class UnusedMethods {
72124
72175
  key: "unused_methods",
72125
72176
  title: "Unused methods",
72126
72177
  shortDescription: `Checks for unused methods`,
72127
- extendedInformation: `Checks private and protected methods.
72128
-
72129
- Unused methods are not reported if the object contains parser or syntax errors.
72130
-
72131
- Skips:
72132
- * methods FOR TESTING
72133
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
72134
- * class_constructor + constructor methods
72135
- * event handlers
72136
- * methods that are redefined
72137
- * INCLUDEs
72178
+ extendedInformation: `Checks private and protected methods.
72179
+
72180
+ Unused methods are not reported if the object contains parser or syntax errors.
72181
+
72182
+ Skips:
72183
+ * methods FOR TESTING
72184
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
72185
+ * class_constructor + constructor methods
72186
+ * event handlers
72187
+ * methods that are redefined
72188
+ * INCLUDEs
72138
72189
  `,
72139
72190
  tags: [],
72140
72191
  pragma: "##CALLED",
@@ -72568,23 +72619,23 @@ class UnusedVariables {
72568
72619
  key: "unused_variables",
72569
72620
  title: "Unused variables",
72570
72621
  shortDescription: `Checks for unused variables and constants`,
72571
- extendedInformation: `Skips event parameters.
72572
-
72573
- Note that this currently does not work if the source code uses macros.
72574
-
72575
- Unused variables are not reported if the object contains parser or syntax errors.
72576
-
72622
+ extendedInformation: `Skips event parameters.
72623
+
72624
+ Note that this currently does not work if the source code uses macros.
72625
+
72626
+ Unused variables are not reported if the object contains parser or syntax errors.
72627
+
72577
72628
  Errors found in INCLUDES are reported for the main program.`,
72578
72629
  tags: [_irule_1.RuleTag.Quickfix],
72579
72630
  pragma: "##NEEDED",
72580
72631
  pseudoComment: "EC NEEDED",
72581
- badExample: `DATA: BEGIN OF blah1,
72582
- test TYPE string,
72583
- test2 TYPE string,
72632
+ badExample: `DATA: BEGIN OF blah1,
72633
+ test TYPE string,
72634
+ test2 TYPE string,
72584
72635
  END OF blah1.`,
72585
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
72586
- test TYPE string,
72587
- test2 TYPE string,
72636
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
72637
+ test TYPE string,
72638
+ test2 TYPE string,
72588
72639
  END OF blah2.`,
72589
72640
  };
72590
72641
  }
@@ -72803,15 +72854,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
72803
72854
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
72804
72855
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
72805
72856
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
72806
- badExample: `IF line IS INITIAL.
72807
- has_entries = abap_false.
72808
- ELSE.
72809
- has_entries = abap_true.
72810
- ENDIF.
72811
-
72857
+ badExample: `IF line IS INITIAL.
72858
+ has_entries = abap_false.
72859
+ ELSE.
72860
+ has_entries = abap_true.
72861
+ ENDIF.
72862
+
72812
72863
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
72813
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
72814
-
72864
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
72865
+
72815
72866
  DATA(fsdf) = xsdbool( foo <> bar ).`,
72816
72867
  };
72817
72868
  }
@@ -72929,15 +72980,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
72929
72980
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
72930
72981
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
72931
72982
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72932
- badExample: `INTERFACE lif.
72933
- METHODS load_data
72934
- EXCEPTIONS
72935
- invalid_parameter.
72983
+ badExample: `INTERFACE lif.
72984
+ METHODS load_data
72985
+ EXCEPTIONS
72986
+ invalid_parameter.
72936
72987
  ENDINTERFACE.`,
72937
- goodExample: `INTERFACE lif.
72938
- METHODS load_data
72939
- RAISING
72940
- cx_something.
72988
+ goodExample: `INTERFACE lif.
72989
+ METHODS load_data
72990
+ RAISING
72991
+ cx_something.
72941
72992
  ENDINTERFACE.`,
72942
72993
  };
72943
72994
  }
@@ -72997,15 +73048,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
72997
73048
  key: "use_line_exists",
72998
73049
  title: "Use line_exists",
72999
73050
  shortDescription: `Use line_exists, from 740sp02 and up`,
73000
- extendedInformation: `
73001
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
73002
-
73051
+ extendedInformation: `
73052
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
73053
+
73003
73054
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
73004
73055
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
73005
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
73006
- IF sy-subrc = 0.
73056
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
73057
+ IF sy-subrc = 0.
73007
73058
  ENDIF.`,
73008
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
73059
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
73009
73060
  ENDIF.`,
73010
73061
  };
73011
73062
  }
@@ -73115,10 +73166,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
73115
73166
  key: "use_new",
73116
73167
  title: "Use NEW",
73117
73168
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
73118
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
73119
-
73120
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
73121
-
73169
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
73170
+
73171
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
73172
+
73122
73173
  Applicable from v740sp02 and up`,
73123
73174
  badExample: `CREATE OBJECT ref.`,
73124
73175
  goodExample: `ref = NEW #( ).`,
@@ -73216,13 +73267,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
73216
73267
  title: "WHEN OTHERS last",
73217
73268
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
73218
73269
  tags: [_irule_1.RuleTag.SingleFile],
73219
- badExample: `CASE bar.
73220
- WHEN OTHERS.
73221
- WHEN 2.
73270
+ badExample: `CASE bar.
73271
+ WHEN OTHERS.
73272
+ WHEN 2.
73222
73273
  ENDCASE.`,
73223
- goodExample: `CASE bar.
73224
- WHEN 2.
73225
- WHEN OTHERS.
73274
+ goodExample: `CASE bar.
73275
+ WHEN 2.
73276
+ WHEN OTHERS.
73226
73277
  ENDCASE.`,
73227
73278
  };
73228
73279
  }