@abaplint/cli 2.113.9 → 2.113.11

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 +886 -842
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -229,7 +229,7 @@ class ApplyFixes {
229
229
  && list2.range.end.getRow() >= list1.range.start.getRow()) {
230
230
  return true;
231
231
  }
232
- if (list2.range.start.getRow() <= list1.range.start.getRow()
232
+ if (list2.range.start.getRow() <= list1.range.end.getRow()
233
233
  && list2.range.end.getRow() >= list1.range.end.getRow()) {
234
234
  return true;
235
235
  }
@@ -255,6 +255,20 @@ class ApplyFixes {
255
255
  appliedIssues.push(i);
256
256
  edits.push(edit);
257
257
  }
258
+ /*
259
+ if (edits.length > 0) {
260
+ console.log("EDITS:");
261
+ for (const e of edits) {
262
+ for (const filename of Object.keys(e)) {
263
+ console.log("\t" + filename);
264
+ for (const i of e[filename]) {
265
+ console.dir(i.range);
266
+ console.dir(i.newText);
267
+ }
268
+ }
269
+ }
270
+ }
271
+ */
258
272
  const changed = (0, core_1.applyEditList)(reg, edits);
259
273
  for (const filename of changed) {
260
274
  this.changedFiles.add(filename);
@@ -35150,13 +35164,13 @@ class FlowGraph {
35150
35164
  this.label = label;
35151
35165
  }
35152
35166
  toDigraph() {
35153
- return `digraph G {
35154
- labelloc="t";
35155
- label="${this.label}";
35156
- graph [fontname = "helvetica"];
35157
- node [fontname = "helvetica", shape="box"];
35158
- edge [fontname = "helvetica"];
35159
- ${this.toTextEdges()}
35167
+ return `digraph G {
35168
+ labelloc="t";
35169
+ label="${this.label}";
35170
+ graph [fontname = "helvetica"];
35171
+ node [fontname = "helvetica", shape="box"];
35172
+ edge [fontname = "helvetica"];
35173
+ ${this.toTextEdges()}
35160
35174
  }`;
35161
35175
  }
35162
35176
  listSources(node) {
@@ -43406,13 +43420,13 @@ class Help {
43406
43420
  /////////////////////////////////////////////////
43407
43421
  static dumpABAP(file, reg, textDocument, position) {
43408
43422
  let content = "";
43409
- content = `
43410
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43411
- <a href="#_statements" rel="no-refresh">Statements</a> |
43412
- <a href="#_structure" rel="no-refresh">Structure</a> |
43413
- <a href="#_files" rel="no-refresh">Files</a> |
43414
- <a href="#_info" rel="no-refresh">Info Dump</a>
43415
- <hr>
43423
+ content = `
43424
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43425
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43426
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43427
+ <a href="#_files" rel="no-refresh">Files</a> |
43428
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43429
+ <hr>
43416
43430
  ` +
43417
43431
  "<tt>" + textDocument.uri + " (" +
43418
43432
  (position.line + 1) + ", " +
@@ -52732,7 +52746,7 @@ class Registry {
52732
52746
  }
52733
52747
  static abaplintVersion() {
52734
52748
  // magic, see build script "version.sh"
52735
- return "2.113.9";
52749
+ return "2.113.11";
52736
52750
  }
52737
52751
  getDDICReferences() {
52738
52752
  return this.ddicReferences;
@@ -53051,10 +53065,10 @@ class SevenBitAscii {
53051
53065
  key: "7bit_ascii",
53052
53066
  title: "Check for 7bit ascii",
53053
53067
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53054
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53055
-
53056
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53057
-
53068
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53069
+
53070
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53071
+
53058
53072
  Checkes files with extensions ".abap" and ".asddls"`,
53059
53073
  tags: [_irule_1.RuleTag.SingleFile],
53060
53074
  badExample: `WRITE '뽑'.`,
@@ -53260,10 +53274,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53260
53274
  key: "abapdoc",
53261
53275
  title: "Check abapdoc",
53262
53276
  shortDescription: `Various checks regarding abapdoc.`,
53263
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53264
-
53265
- Plus class and interface definitions.
53266
-
53277
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53278
+
53279
+ Plus class and interface definitions.
53280
+
53267
53281
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53268
53282
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53269
53283
  };
@@ -53400,27 +53414,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53400
53414
  title: "Add test attributes for tests classes with test methods",
53401
53415
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53402
53416
  tags: [_irule_1.RuleTag.SingleFile],
53403
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53404
- PUBLIC SECTION.
53405
- PROTECTED SECTION.
53406
- PRIVATE SECTION.
53407
- METHODS test FOR TESTING RAISING cx_static_check.
53408
- ENDCLASS.
53409
-
53410
- CLASS ltcl_test1 IMPLEMENTATION.
53411
- METHOD test.
53412
- ENDMETHOD.
53417
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53418
+ PUBLIC SECTION.
53419
+ PROTECTED SECTION.
53420
+ PRIVATE SECTION.
53421
+ METHODS test FOR TESTING RAISING cx_static_check.
53422
+ ENDCLASS.
53423
+
53424
+ CLASS ltcl_test1 IMPLEMENTATION.
53425
+ METHOD test.
53426
+ ENDMETHOD.
53413
53427
  ENDCLASS.`,
53414
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53415
- PUBLIC SECTION.
53416
- PROTECTED SECTION.
53417
- PRIVATE SECTION.
53418
- METHODS test FOR TESTING RAISING cx_static_check.
53419
- ENDCLASS.
53420
-
53421
- CLASS ltcl_test2 IMPLEMENTATION.
53422
- METHOD test.
53423
- ENDMETHOD.
53428
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53429
+ PUBLIC SECTION.
53430
+ PROTECTED SECTION.
53431
+ PRIVATE SECTION.
53432
+ METHODS test FOR TESTING RAISING cx_static_check.
53433
+ ENDCLASS.
53434
+
53435
+ CLASS ltcl_test2 IMPLEMENTATION.
53436
+ METHOD test.
53437
+ ENDMETHOD.
53424
53438
  ENDCLASS.`,
53425
53439
  };
53426
53440
  }
@@ -53506,49 +53520,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53506
53520
  key: "align_parameters",
53507
53521
  title: "Align Parameters",
53508
53522
  shortDescription: `Checks for vertially aligned parameters`,
53509
- extendedInformation: `Checks:
53510
- * function module calls
53511
- * method calls
53512
- * VALUE constructors
53513
- * NEW constructors
53514
- * RAISE EXCEPTION statements
53515
- * CREATE OBJECT statements
53516
- * RAISE EVENT statements
53517
-
53518
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53519
-
53520
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53521
-
53522
- If parameters are on the same row, no issues are reported, see
53523
+ extendedInformation: `Checks:
53524
+ * function module calls
53525
+ * method calls
53526
+ * VALUE constructors
53527
+ * NEW constructors
53528
+ * RAISE EXCEPTION statements
53529
+ * CREATE OBJECT statements
53530
+ * RAISE EVENT statements
53531
+
53532
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53533
+
53534
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53535
+
53536
+ If parameters are on the same row, no issues are reported, see
53523
53537
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53524
53538
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53525
- badExample: `CALL FUNCTION 'FOOBAR'
53526
- EXPORTING
53527
- foo = 2
53528
- parameter = 3.
53529
-
53530
- foobar( moo = 1
53531
- param = 1 ).
53532
-
53533
- foo = VALUE #(
53534
- foo = bar
53539
+ badExample: `CALL FUNCTION 'FOOBAR'
53540
+ EXPORTING
53541
+ foo = 2
53542
+ parameter = 3.
53543
+
53544
+ foobar( moo = 1
53545
+ param = 1 ).
53546
+
53547
+ foo = VALUE #(
53548
+ foo = bar
53535
53549
  moo = 2 ).`,
53536
- goodExample: `CALL FUNCTION 'FOOBAR'
53537
- EXPORTING
53538
- foo = 2
53539
- parameter = 3.
53540
-
53541
- foobar( moo = 1
53542
- param = 1 ).
53543
-
53544
- foo = VALUE #(
53545
- foo = bar
53546
- moo = 2 ).
53547
-
53548
- DATA(sdf) = VALUE type(
53549
- common_val = 2
53550
- another_common = 5
53551
- ( row_value = 4
53550
+ goodExample: `CALL FUNCTION 'FOOBAR'
53551
+ EXPORTING
53552
+ foo = 2
53553
+ parameter = 3.
53554
+
53555
+ foobar( moo = 1
53556
+ param = 1 ).
53557
+
53558
+ foo = VALUE #(
53559
+ foo = bar
53560
+ moo = 2 ).
53561
+
53562
+ DATA(sdf) = VALUE type(
53563
+ common_val = 2
53564
+ another_common = 5
53565
+ ( row_value = 4
53552
53566
  value_foo = 5 ) ).`,
53553
53567
  };
53554
53568
  }
@@ -53982,37 +53996,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
53982
53996
  key: "align_type_expressions",
53983
53997
  title: "Align TYPE expressions",
53984
53998
  shortDescription: `Align TYPE expressions in statements`,
53985
- extendedInformation: `
53986
- Currently works for METHODS + BEGIN OF
53987
-
53988
- If BEGIN OF has an INCLUDE TYPE its ignored
53989
-
53990
- Also note that clean ABAP does not recommend aligning TYPE clauses:
53999
+ extendedInformation: `
54000
+ Currently works for METHODS + BEGIN OF
54001
+
54002
+ If BEGIN OF has an INCLUDE TYPE its ignored
54003
+
54004
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
53991
54005
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
53992
54006
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
53993
- badExample: `
53994
- TYPES: BEGIN OF foo,
53995
- bar TYPE i,
53996
- foobar TYPE i,
53997
- END OF foo.
53998
-
53999
- INTERFACE lif.
54000
- METHODS bar
54001
- IMPORTING
54002
- foo TYPE i
54003
- foobar TYPE i.
54007
+ badExample: `
54008
+ TYPES: BEGIN OF foo,
54009
+ bar TYPE i,
54010
+ foobar TYPE i,
54011
+ END OF foo.
54012
+
54013
+ INTERFACE lif.
54014
+ METHODS bar
54015
+ IMPORTING
54016
+ foo TYPE i
54017
+ foobar TYPE i.
54004
54018
  ENDINTERFACE.`,
54005
- goodExample: `
54006
- TYPES: BEGIN OF foo,
54007
- bar TYPE i,
54008
- foobar TYPE i,
54009
- END OF foo.
54010
-
54011
- INTERFACE lif.
54012
- METHODS bar
54013
- IMPORTING
54014
- foo TYPE i
54015
- foobar TYPE i.
54019
+ goodExample: `
54020
+ TYPES: BEGIN OF foo,
54021
+ bar TYPE i,
54022
+ foobar TYPE i,
54023
+ END OF foo.
54024
+
54025
+ INTERFACE lif.
54026
+ METHODS bar
54027
+ IMPORTING
54028
+ foo TYPE i
54029
+ foobar TYPE i.
54016
54030
  ENDINTERFACE.`,
54017
54031
  };
54018
54032
  }
@@ -54291,16 +54305,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54291
54305
  return {
54292
54306
  key: "ambiguous_statement",
54293
54307
  title: "Check for ambigious statements",
54294
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54295
- Add "TABLE" keyword or "@" for escaping SQL variables
54296
-
54308
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54309
+ Add "TABLE" keyword or "@" for escaping SQL variables
54310
+
54297
54311
  Only works if the target version is 740sp05 or above`,
54298
54312
  tags: [_irule_1.RuleTag.SingleFile],
54299
- badExample: `DELETE foo FROM bar.
54313
+ badExample: `DELETE foo FROM bar.
54300
54314
  MODIFY foo FROM bar.`,
54301
- goodExample: `DELETE foo FROM @bar.
54302
- DELETE TABLE itab FROM 2.
54303
- MODIFY zfoo FROM @wa.
54315
+ goodExample: `DELETE foo FROM @bar.
54316
+ DELETE TABLE itab FROM 2.
54317
+ MODIFY zfoo FROM @wa.
54304
54318
  MODIFY TABLE foo FROM bar.`,
54305
54319
  };
54306
54320
  }
@@ -54405,16 +54419,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54405
54419
  key: "avoid_use",
54406
54420
  title: "Avoid use of certain statements",
54407
54421
  shortDescription: `Detects usage of certain statements.`,
54408
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54409
-
54410
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54411
-
54412
- STATICS: use CLASS-DATA instead
54413
-
54414
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54415
-
54416
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54417
-
54422
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54423
+
54424
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54425
+
54426
+ STATICS: use CLASS-DATA instead
54427
+
54428
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54429
+
54430
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54431
+
54418
54432
  BREAK points`,
54419
54433
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54420
54434
  };
@@ -54546,11 +54560,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54546
54560
  title: "Check BEGIN END names",
54547
54561
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54548
54562
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54549
- badExample: `DATA: BEGIN OF stru,
54550
- field TYPE i,
54563
+ badExample: `DATA: BEGIN OF stru,
54564
+ field TYPE i,
54551
54565
  END OF structure_not_the_same.`,
54552
- goodExample: `DATA: BEGIN OF stru,
54553
- field TYPE i,
54566
+ goodExample: `DATA: BEGIN OF stru,
54567
+ field TYPE i,
54554
54568
  END OF stru.`,
54555
54569
  };
54556
54570
  }
@@ -54647,20 +54661,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54647
54661
  title: "BEGIN contains single INCLUDE",
54648
54662
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54649
54663
  tags: [_irule_1.RuleTag.SingleFile],
54650
- badExample: `TYPES: BEGIN OF dummy1.
54651
- INCLUDE TYPE dselc.
54652
- TYPES: END OF dummy1.
54653
-
54654
- DATA BEGIN OF foo.
54655
- INCLUDE STRUCTURE syst.
54656
- DATA END OF foo.
54657
-
54658
- STATICS BEGIN OF bar.
54659
- INCLUDE STRUCTURE syst.
54664
+ badExample: `TYPES: BEGIN OF dummy1.
54665
+ INCLUDE TYPE dselc.
54666
+ TYPES: END OF dummy1.
54667
+
54668
+ DATA BEGIN OF foo.
54669
+ INCLUDE STRUCTURE syst.
54670
+ DATA END OF foo.
54671
+
54672
+ STATICS BEGIN OF bar.
54673
+ INCLUDE STRUCTURE syst.
54660
54674
  STATICS END OF bar.`,
54661
- goodExample: `DATA BEGIN OF foo.
54662
- DATA field TYPE i.
54663
- INCLUDE STRUCTURE dselc.
54675
+ goodExample: `DATA BEGIN OF foo.
54676
+ DATA field TYPE i.
54677
+ INCLUDE STRUCTURE dselc.
54664
54678
  DATA END OF foo.`,
54665
54679
  };
54666
54680
  }
@@ -54750,9 +54764,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54750
54764
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54751
54765
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54752
54766
  badExample: `CALL TRANSACTION 'FOO'.`,
54753
- goodExample: `TRY.
54754
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54755
- CATCH cx_sy_authorization_error.
54767
+ goodExample: `TRY.
54768
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54769
+ CATCH cx_sy_authorization_error.
54756
54770
  ENDTRY.`,
54757
54771
  };
54758
54772
  }
@@ -54817,10 +54831,10 @@ class CDSCommentStyle {
54817
54831
  key: "cds_comment_style",
54818
54832
  title: "CDS Comment Style",
54819
54833
  shortDescription: `Check for obsolete comment style`,
54820
- extendedInformation: `Check for obsolete comment style
54821
-
54822
- Comments starting with "--" are considered obsolete
54823
-
54834
+ extendedInformation: `Check for obsolete comment style
54835
+
54836
+ Comments starting with "--" are considered obsolete
54837
+
54824
54838
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54825
54839
  tags: [_irule_1.RuleTag.SingleFile],
54826
54840
  badExample: "-- this is a comment",
@@ -54886,10 +54900,10 @@ class CDSLegacyView {
54886
54900
  key: "cds_legacy_view",
54887
54901
  title: "CDS Legacy View",
54888
54902
  shortDescription: `Identify CDS Legacy Views`,
54889
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54890
-
54891
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54892
-
54903
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54904
+
54905
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54906
+
54893
54907
  v755 and up`,
54894
54908
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54895
54909
  };
@@ -55044,10 +55058,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55044
55058
  key: "chain_mainly_declarations",
55045
55059
  title: "Chain mainly declarations",
55046
55060
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55047
- extendedInformation: `
55048
- https://docs.abapopenchecks.org/checks/23/
55049
-
55050
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55061
+ extendedInformation: `
55062
+ https://docs.abapopenchecks.org/checks/23/
55063
+
55064
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55051
55065
  `,
55052
55066
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55053
55067
  badExample: `CALL METHOD: bar.`,
@@ -55223,17 +55237,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55223
55237
  title: "Change IF to CASE",
55224
55238
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55225
55239
  // eslint-disable-next-line max-len
55226
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55227
-
55240
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55241
+
55228
55242
  If the first comparison is a boolean compare, no issue is reported.`,
55229
55243
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55230
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55231
- ELSEIF l_fcat-fieldname = 'BAR'
55232
- OR l_fcat-fieldname = 'MOO'.
55244
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55245
+ ELSEIF l_fcat-fieldname = 'BAR'
55246
+ OR l_fcat-fieldname = 'MOO'.
55233
55247
  ENDIF.`,
55234
- goodExample: `CASE l_fcat-fieldname.
55235
- WHEN 'FOO'.
55236
- WHEN 'BAR' OR 'MOO'.
55248
+ goodExample: `CASE l_fcat-fieldname.
55249
+ WHEN 'FOO'.
55250
+ WHEN 'BAR' OR 'MOO'.
55237
55251
  ENDCASE.`,
55238
55252
  };
55239
55253
  }
@@ -55370,8 +55384,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55370
55384
  return {
55371
55385
  key: "check_abstract",
55372
55386
  title: "Check abstract methods and classes",
55373
- shortDescription: `Checks abstract methods and classes:
55374
- - class defined as abstract and final,
55387
+ shortDescription: `Checks abstract methods and classes:
55388
+ - class defined as abstract and final,
55375
55389
  - non-abstract class contains abstract methods`,
55376
55390
  extendedInformation: `If a class defines only constants, use an interface instead`,
55377
55391
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55452,11 +55466,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55452
55466
  return {
55453
55467
  key: "check_comments",
55454
55468
  title: "Check Comments",
55455
- shortDescription: `
55469
+ shortDescription: `
55456
55470
  Various checks for comment usage.`,
55457
- extendedInformation: `
55458
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55459
-
55471
+ extendedInformation: `
55472
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55473
+
55460
55474
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55461
55475
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55462
55476
  badExample: `WRITE 2. " descriptive comment`,
@@ -55618,9 +55632,9 @@ class CheckInclude {
55618
55632
  key: "check_include",
55619
55633
  title: "Check INCLUDEs",
55620
55634
  shortDescription: `Checks INCLUDE statements`,
55621
- extendedInformation: `
55622
- * Reports unused includes
55623
- * Errors if the includes are not found
55635
+ extendedInformation: `
55636
+ * Reports unused includes
55637
+ * Errors if the includes are not found
55624
55638
  * Error if including a main program`,
55625
55639
  tags: [_irule_1.RuleTag.Syntax],
55626
55640
  };
@@ -55696,14 +55710,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55696
55710
  key: "check_subrc",
55697
55711
  title: "Check sy-subrc",
55698
55712
  shortDescription: `Check sy-subrc`,
55699
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55700
-
55701
- If sy-dbcnt is checked after database statements, it is considered okay.
55702
-
55703
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55704
-
55705
- If IS ASSIGNED is checked after assigning, it is considered okay.
55706
-
55713
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55714
+
55715
+ If sy-dbcnt is checked after database statements, it is considered okay.
55716
+
55717
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55718
+
55719
+ If IS ASSIGNED is checked after assigning, it is considered okay.
55720
+
55707
55721
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55708
55722
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55709
55723
  pseudoComment: "EC CI_SUBRC",
@@ -56273,17 +56287,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56273
56287
  shortDescription: `Find overlapping classic exceptions`,
56274
56288
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56275
56289
  tags: [_irule_1.RuleTag.SingleFile],
56276
- badExample: `CALL FUNCTION 'SOMETHING'
56277
- EXCEPTIONS
56278
- system_failure = 1 MESSAGE lv_message
56279
- communication_failure = 1 MESSAGE lv_message
56280
- resource_failure = 1
56290
+ badExample: `CALL FUNCTION 'SOMETHING'
56291
+ EXCEPTIONS
56292
+ system_failure = 1 MESSAGE lv_message
56293
+ communication_failure = 1 MESSAGE lv_message
56294
+ resource_failure = 1
56281
56295
  OTHERS = 1.`,
56282
- goodExample: `CALL FUNCTION 'SOMETHING'
56283
- EXCEPTIONS
56284
- system_failure = 1 MESSAGE lv_message
56285
- communication_failure = 2 MESSAGE lv_message
56286
- resource_failure = 3
56296
+ goodExample: `CALL FUNCTION 'SOMETHING'
56297
+ EXCEPTIONS
56298
+ system_failure = 1 MESSAGE lv_message
56299
+ communication_failure = 2 MESSAGE lv_message
56300
+ resource_failure = 3
56287
56301
  OTHERS = 4.`,
56288
56302
  };
56289
56303
  }
@@ -56529,7 +56543,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56529
56543
  key: "commented_code",
56530
56544
  title: "Find commented code",
56531
56545
  shortDescription: `Detects usage of commented out code.`,
56532
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56546
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56533
56547
  https://docs.abapopenchecks.org/checks/14/`,
56534
56548
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56535
56549
  badExample: `* WRITE 'hello world'.`,
@@ -56762,10 +56776,10 @@ class ConstructorVisibilityPublic {
56762
56776
  key: "constructor_visibility_public",
56763
56777
  title: "Check constructor visibility is public",
56764
56778
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
56765
- extendedInformation: `
56766
- This only applies to global classes.
56767
-
56768
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56779
+ extendedInformation: `
56780
+ This only applies to global classes.
56781
+
56782
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56769
56783
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56770
56784
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56771
56785
  };
@@ -56840,8 +56854,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56840
56854
  key: "contains_tab",
56841
56855
  title: "Code contains tab",
56842
56856
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56843
- extendedInformation: `
56844
- https://docs.abapopenchecks.org/checks/09/
56857
+ extendedInformation: `
56858
+ https://docs.abapopenchecks.org/checks/09/
56845
56859
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56846
56860
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56847
56861
  badExample: `\tWRITE 'hello world'.`,
@@ -56928,10 +56942,10 @@ class CyclicOO {
56928
56942
  key: "cyclic_oo",
56929
56943
  title: "Cyclic OO",
56930
56944
  shortDescription: `Finds cyclic/circular OO references`,
56931
- extendedInformation: `Runs for global INTF + CLAS objects
56932
-
56933
- Objects must be without syntax errors for this rule to take effect
56934
-
56945
+ extendedInformation: `Runs for global INTF + CLAS objects
56946
+
56947
+ Objects must be without syntax errors for this rule to take effect
56948
+
56935
56949
  References in testclass includes are ignored`,
56936
56950
  };
56937
56951
  }
@@ -57156,6 +57170,7 @@ class DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {
57156
57170
  this.generateSubroutine = true;
57157
57171
  this.deleteReport = true;
57158
57172
  this.deleteTextpool = true;
57173
+ this.insertTextpool = true;
57159
57174
  this.deleteDynpro = true;
57160
57175
  this.exportDynpro = true;
57161
57176
  /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */
@@ -57173,7 +57188,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57173
57188
  key: "dangerous_statement",
57174
57189
  title: "Dangerous statement",
57175
57190
  shortDescription: `Detects potentially dangerous statements`,
57176
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57191
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57177
57192
  dynamic SQL can potentially create SQL injection problems`,
57178
57193
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57179
57194
  };
@@ -57219,6 +57234,9 @@ dynamic SQL can potentially create SQL injection problems`,
57219
57234
  else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {
57220
57235
  message = "DELETE TEXTPOOL";
57221
57236
  }
57237
+ else if (this.conf.insertTextpool && statement instanceof Statements.InsertTextpool) {
57238
+ message = "INSERT TEXTPOOL";
57239
+ }
57222
57240
  else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {
57223
57241
  message = "DELETE DYNPRO";
57224
57242
  }
@@ -57377,13 +57395,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57377
57395
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57378
57396
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57379
57397
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57380
- badExample: `FROM foo.
57381
- WRITE 'hello'.
57382
- DATA int TYPE i.
57398
+ badExample: `FROM foo.
57399
+ WRITE 'hello'.
57400
+ DATA int TYPE i.
57383
57401
  ENDFORM.`,
57384
- goodExample: `FROM foo.
57385
- DATA int TYPE i.
57386
- WRITE 'hello'.
57402
+ goodExample: `FROM foo.
57403
+ DATA int TYPE i.
57404
+ WRITE 'hello'.
57387
57405
  ENDFORM.`,
57388
57406
  };
57389
57407
  }
@@ -57922,39 +57940,39 @@ class Downport {
57922
57940
  key: "downport",
57923
57941
  title: "Downport statement",
57924
57942
  shortDescription: `Downport functionality`,
57925
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57926
- a higher level language version. If successful, various rules are applied to downport the statement.
57927
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57928
-
57929
- Current rules:
57930
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57931
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57932
- * FIELD-SYMBOL() definitions are outlined
57933
- * CONV is outlined
57934
- * COND is outlined
57935
- * REDUCE is outlined
57936
- * SWITCH is outlined
57937
- * FILTER is outlined
57938
- * APPEND expression is outlined
57939
- * INSERT expression is outlined
57940
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57941
- * CAST changed to ?=
57942
- * LOOP AT method_call( ) is outlined
57943
- * VALUE # with structure fields
57944
- * VALUE # with internal table lines
57945
- * Table Expressions are outlined
57946
- * SELECT INTO @DATA definitions are outlined
57947
- * Some occurrences of string template formatting option ALPHA changed to function module call
57948
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57949
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57950
- * RAISE EXCEPTION ... MESSAGE
57951
- * Moving with +=, -=, /=, *=, &&= is expanded
57952
- * line_exists and line_index is downported to READ TABLE
57953
- * ENUMs, but does not nessesarily give the correct type and value
57954
- * MESSAGE with non simple source
57955
-
57956
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57957
-
57943
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57944
+ a higher level language version. If successful, various rules are applied to downport the statement.
57945
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
57946
+
57947
+ Current rules:
57948
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57949
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57950
+ * FIELD-SYMBOL() definitions are outlined
57951
+ * CONV is outlined
57952
+ * COND is outlined
57953
+ * REDUCE is outlined
57954
+ * SWITCH is outlined
57955
+ * FILTER is outlined
57956
+ * APPEND expression is outlined
57957
+ * INSERT expression is outlined
57958
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57959
+ * CAST changed to ?=
57960
+ * LOOP AT method_call( ) is outlined
57961
+ * VALUE # with structure fields
57962
+ * VALUE # with internal table lines
57963
+ * Table Expressions are outlined
57964
+ * SELECT INTO @DATA definitions are outlined
57965
+ * Some occurrences of string template formatting option ALPHA changed to function module call
57966
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57967
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57968
+ * RAISE EXCEPTION ... MESSAGE
57969
+ * Moving with +=, -=, /=, *=, &&= is expanded
57970
+ * line_exists and line_index is downported to READ TABLE
57971
+ * ENUMs, but does not nessesarily give the correct type and value
57972
+ * MESSAGE with non simple source
57973
+
57974
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57975
+
57958
57976
  Make sure to test the downported code, it might not always be completely correct.`,
57959
57977
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57960
57978
  };
@@ -58532,10 +58550,10 @@ Make sure to test the downported code, it might not always be completely correct
58532
58550
  const fieldName = f.concatTokens();
58533
58551
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58534
58552
  }
58535
- fieldDefinition = `DATA: BEGIN OF ${name},
58553
+ fieldDefinition = `DATA: BEGIN OF ${name},
58536
58554
  ${fieldDefinition}${indentation} END OF ${name}.`;
58537
58555
  }
58538
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58556
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58539
58557
  ${indentation}`);
58540
58558
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58541
58559
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58579,12 +58597,12 @@ ${indentation}`);
58579
58597
  }
58580
58598
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58581
58599
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
58582
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58583
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58584
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58600
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58601
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58602
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58585
58603
  ${indentation}`);
58586
58604
  if (fieldDefinitions === "") {
58587
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58605
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58588
58606
  ${indentation}`);
58589
58607
  }
58590
58608
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58652,7 +58670,7 @@ ${indentation}`);
58652
58670
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58653
58671
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58654
58672
  const firstToken = high.getFirstToken();
58655
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58673
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58656
58674
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58657
58675
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58658
58676
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58706,7 +58724,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58706
58724
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58707
58725
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58708
58726
  const firstToken = high.getFirstToken();
58709
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58727
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58710
58728
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58711
58729
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58712
58730
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58748,14 +58766,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58748
58766
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58749
58767
  const firstToken = high.getFirstToken();
58750
58768
  // note that the tabix restore should be done before throwing the exception
58751
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58752
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58753
- ${indentation}${tabixBackup} = sy-tabix.
58754
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58755
- ${indentation}sy-tabix = ${tabixBackup}.
58756
- ${indentation}IF sy-subrc <> 0.
58757
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58758
- ${indentation}ENDIF.
58769
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58770
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58771
+ ${indentation}${tabixBackup} = sy-tabix.
58772
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58773
+ ${indentation}sy-tabix = ${tabixBackup}.
58774
+ ${indentation}IF sy-subrc <> 0.
58775
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58776
+ ${indentation}ENDIF.
58759
58777
  ${indentation}`);
58760
58778
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58761
58779
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58812,7 +58830,7 @@ ${indentation}`);
58812
58830
  const className = classNames[0].concatTokens();
58813
58831
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58814
58832
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58815
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58833
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58816
58834
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58817
58835
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58818
58836
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -58974,16 +58992,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
58974
58992
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58975
58993
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58976
58994
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58977
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58978
- ${indentation}${uniqueName1}-msgid = ${id}.
58995
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58996
+ ${indentation}${uniqueName1}-msgid = ${id}.
58979
58997
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
58980
58998
  if (withs.length > 0) {
58981
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58982
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58983
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58999
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59000
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59001
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58984
59002
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
58985
59003
  }
58986
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59004
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58987
59005
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
58988
59006
  if (withs.length > 0) {
58989
59007
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59095,10 +59113,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59095
59113
  let code = "";
59096
59114
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59097
59115
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59098
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59099
- IF sy-subrc <> 0.
59100
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59101
- ENDIF.
59116
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59117
+ IF sy-subrc <> 0.
59118
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59119
+ ENDIF.
59102
59120
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59103
59121
  }
59104
59122
  else {
@@ -59187,20 +59205,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59187
59205
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59188
59206
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59189
59207
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59190
- code += ` items LIKE ${loopSourceName},
59191
- END OF ${groupTargetName}type.
59192
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59193
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59208
+ code += ` items LIKE ${loopSourceName},
59209
+ END OF ${groupTargetName}type.
59210
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59211
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59194
59212
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59195
59213
  if (groupIndexName !== undefined) {
59196
59214
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59197
59215
  }
59198
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59216
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59199
59217
  IF sy-subrc = 0.\n`;
59200
59218
  if (groupCountName !== undefined) {
59201
59219
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59202
59220
  }
59203
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59221
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59204
59222
  ELSE.\n`;
59205
59223
  code += ` CLEAR ${uniqueName}.\n`;
59206
59224
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59221,8 +59239,8 @@ ELSE.\n`;
59221
59239
  }
59222
59240
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59223
59241
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59224
- code += `ENDIF.
59225
- ENDLOOP.
59242
+ code += `ENDIF.
59243
+ ENDLOOP.
59226
59244
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59227
59245
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59228
59246
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59394,7 +59412,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59394
59412
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59395
59413
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59396
59414
  // all ENUMS are char like?
59397
- let code = `TYPES ${enumName} TYPE string.
59415
+ let code = `TYPES ${enumName} TYPE string.
59398
59416
  CONSTANTS: BEGIN OF ${structureName},\n`;
59399
59417
  let count = 1;
59400
59418
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59438,14 +59456,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59438
59456
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59439
59457
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59440
59458
  // restore tabix before exeption
59441
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59442
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59443
- ${indentation}${tabixBackup} = sy-tabix.
59444
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59445
- ${indentation}sy-tabix = ${tabixBackup}.
59446
- ${indentation}IF sy-subrc <> 0.
59447
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59448
- ${indentation}ENDIF.
59459
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59460
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59461
+ ${indentation}${tabixBackup} = sy-tabix.
59462
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59463
+ ${indentation}sy-tabix = ${tabixBackup}.
59464
+ ${indentation}IF sy-subrc <> 0.
59465
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59466
+ ${indentation}ENDIF.
59449
59467
  ${indentation}${uniqueName}`;
59450
59468
  const start = target.getFirstToken().getStart();
59451
59469
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59529,11 +59547,11 @@ ${indentation}${uniqueName}`;
59529
59547
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59530
59548
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59531
59549
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59532
- const code = `DATA ${uniqueName} TYPE string.
59533
- ${indentation}CALL FUNCTION '${functionName}'
59534
- ${indentation} EXPORTING
59535
- ${indentation} input = ${source}
59536
- ${indentation} IMPORTING
59550
+ const code = `DATA ${uniqueName} TYPE string.
59551
+ ${indentation}CALL FUNCTION '${functionName}'
59552
+ ${indentation} EXPORTING
59553
+ ${indentation} input = ${source}
59554
+ ${indentation} IMPORTING
59537
59555
  ${indentation} output = ${uniqueName}.\n`;
59538
59556
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59539
59557
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60845,12 +60863,12 @@ class EasyToFindMessages {
60845
60863
  key: "easy_to_find_messages",
60846
60864
  title: "Easy to find messages",
60847
60865
  shortDescription: `Make messages easy to find`,
60848
- extendedInformation: `All messages must be statically referenced exactly once
60849
-
60850
- Only MESSAGE and RAISE statments are counted as static references
60851
-
60852
- Also see rule "message_exists"
60853
-
60866
+ extendedInformation: `All messages must be statically referenced exactly once
60867
+
60868
+ Only MESSAGE and RAISE statments are counted as static references
60869
+
60870
+ Also see rule "message_exists"
60871
+
60854
60872
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60855
60873
  tags: [_irule_1.RuleTag.Styleguide],
60856
60874
  };
@@ -60931,13 +60949,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
60931
60949
  shortDescription: `Empty selection screen or list processing event block`,
60932
60950
  extendedInformation: ``,
60933
60951
  tags: [_irule_1.RuleTag.SingleFile],
60934
- badExample: `
60935
- INITIALIZATION.
60936
- WRITE 'hello'.
60952
+ badExample: `
60953
+ INITIALIZATION.
60954
+ WRITE 'hello'.
60937
60955
  END-OF-SELECTION.`,
60938
- goodExample: `
60939
- START-OF-SELECTION.
60940
- PERFORM sdf.
60956
+ goodExample: `
60957
+ START-OF-SELECTION.
60958
+ PERFORM sdf.
60941
60959
  COMMIT WORK.`,
60942
60960
  };
60943
60961
  }
@@ -61029,8 +61047,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61029
61047
  key: "empty_line_in_statement",
61030
61048
  title: "Find empty lines in statements",
61031
61049
  shortDescription: `Checks that statements do not contain empty lines.`,
61032
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61033
-
61050
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61051
+
61034
61052
  https://docs.abapopenchecks.org/checks/41/`,
61035
61053
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61036
61054
  badExample: `WRITE\n\nhello.`,
@@ -61206,13 +61224,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61206
61224
  shortDescription: `Checks that the code does not contain empty blocks.`,
61207
61225
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61208
61226
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61209
- badExample: `IF foo = bar.
61210
- ENDIF.
61211
-
61212
- DO 2 TIMES.
61227
+ badExample: `IF foo = bar.
61228
+ ENDIF.
61229
+
61230
+ DO 2 TIMES.
61213
61231
  ENDDO.`,
61214
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61215
- ENDLOOP.
61232
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61233
+ ENDLOOP.
61216
61234
  result = xsdbool( sy-subrc = 0 ).`,
61217
61235
  };
61218
61236
  }
@@ -61354,10 +61372,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61354
61372
  return {
61355
61373
  key: "exit_or_check",
61356
61374
  title: "Find EXIT or CHECK outside loops",
61357
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61375
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61358
61376
  Use RETURN to leave procesing blocks instead.`,
61359
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61360
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61377
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61378
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61361
61379
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61362
61380
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61363
61381
  };
@@ -61440,12 +61458,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61440
61458
  key: "expand_macros",
61441
61459
  title: "Expand Macros",
61442
61460
  shortDescription: `Allows expanding macro calls with quick fixes`,
61443
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61444
-
61461
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61462
+
61445
61463
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61446
- badExample: `DEFINE _hello.
61447
- WRITE 'hello'.
61448
- END-OF-DEFINITION.
61464
+ badExample: `DEFINE _hello.
61465
+ WRITE 'hello'.
61466
+ END-OF-DEFINITION.
61449
61467
  _hello.`,
61450
61468
  goodExample: `WRITE 'hello'.`,
61451
61469
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61532,7 +61550,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61532
61550
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61533
61551
  badExample: `call_method( EXPORTING foo = bar ).`,
61534
61552
  goodExample: `call_method( foo = bar ).`,
61535
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61553
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61536
61554
  https://docs.abapopenchecks.org/checks/30/`,
61537
61555
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61538
61556
  };
@@ -61630,7 +61648,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61630
61648
  key: "forbidden_identifier",
61631
61649
  title: "Forbidden Identifier",
61632
61650
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61633
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61651
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61634
61652
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61635
61653
  tags: [_irule_1.RuleTag.SingleFile],
61636
61654
  };
@@ -61872,8 +61890,8 @@ class ForbiddenVoidType {
61872
61890
  key: "forbidden_void_type",
61873
61891
  title: "Forbidden Void Types",
61874
61892
  shortDescription: `Avoid usage of specified void types.`,
61875
- extendedInformation: `Inspiration:
61876
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61893
+ extendedInformation: `Inspiration:
61894
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61877
61895
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61878
61896
  };
61879
61897
  }
@@ -62116,7 +62134,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62116
62134
  key: "fully_type_itabs",
62117
62135
  title: "Fully type internal tables",
62118
62136
  shortDescription: `No implict table types or table keys`,
62119
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62137
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62120
62138
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62121
62139
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62122
62140
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62301,26 +62319,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62301
62319
  key: "functional_writing",
62302
62320
  title: "Use functional writing",
62303
62321
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62304
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62322
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62305
62323
  https://docs.abapopenchecks.org/checks/07/`,
62306
62324
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62307
- badExample: `CALL METHOD zcl_class=>method( ).
62308
- CALL METHOD cl_abap_typedescr=>describe_by_name
62309
- EXPORTING
62310
- p_name = 'NAME'
62311
- RECEIVING
62312
- p_descr_ref = lr_typedescr
62313
- EXCEPTIONS
62314
- type_not_found = 1
62325
+ badExample: `CALL METHOD zcl_class=>method( ).
62326
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62327
+ EXPORTING
62328
+ p_name = 'NAME'
62329
+ RECEIVING
62330
+ p_descr_ref = lr_typedescr
62331
+ EXCEPTIONS
62332
+ type_not_found = 1
62315
62333
  OTHERS = 2.`,
62316
- goodExample: `zcl_class=>method( ).
62317
- cl_abap_typedescr=>describe_by_name(
62318
- EXPORTING
62319
- p_name = 'NAME'
62320
- RECEIVING
62321
- p_descr_ref = lr_typedescr
62322
- EXCEPTIONS
62323
- type_not_found = 1
62334
+ goodExample: `zcl_class=>method( ).
62335
+ cl_abap_typedescr=>describe_by_name(
62336
+ EXPORTING
62337
+ p_name = 'NAME'
62338
+ RECEIVING
62339
+ p_descr_ref = lr_typedescr
62340
+ EXCEPTIONS
62341
+ type_not_found = 1
62324
62342
  OTHERS = 2 ).`,
62325
62343
  };
62326
62344
  }
@@ -62431,14 +62449,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62431
62449
  key: "global_class",
62432
62450
  title: "Global class checks",
62433
62451
  shortDescription: `Checks related to global classes`,
62434
- extendedInformation: `* global classes must be in own files
62435
-
62436
- * file names must match class name
62437
-
62438
- * file names must match interface name
62439
-
62440
- * global classes must be global definitions
62441
-
62452
+ extendedInformation: `* global classes must be in own files
62453
+
62454
+ * file names must match class name
62455
+
62456
+ * file names must match interface name
62457
+
62458
+ * global classes must be global definitions
62459
+
62442
62460
  * global interfaces must be global definitions`,
62443
62461
  tags: [_irule_1.RuleTag.Syntax],
62444
62462
  };
@@ -62537,21 +62555,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62537
62555
  return {
62538
62556
  key: "identical_conditions",
62539
62557
  title: "Identical conditions",
62540
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62541
-
62558
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62559
+
62542
62560
  Prerequsites: code is pretty printed with identical cAsE`,
62543
62561
  tags: [_irule_1.RuleTag.SingleFile],
62544
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62545
- ENDIF.
62546
- CASE bar.
62547
- WHEN '1'.
62548
- WHEN 'A' OR '1'.
62562
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62563
+ ENDIF.
62564
+ CASE bar.
62565
+ WHEN '1'.
62566
+ WHEN 'A' OR '1'.
62549
62567
  ENDCASE.`,
62550
- goodExample: `IF foo = bar OR 1 = a.
62551
- ENDIF.
62552
- CASE bar.
62553
- WHEN '1'.
62554
- WHEN 'A'.
62568
+ goodExample: `IF foo = bar OR 1 = a.
62569
+ ENDIF.
62570
+ CASE bar.
62571
+ WHEN '1'.
62572
+ WHEN 'A'.
62555
62573
  ENDCASE.`,
62556
62574
  };
62557
62575
  }
@@ -62685,23 +62703,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62685
62703
  key: "identical_contents",
62686
62704
  title: "Identical contents",
62687
62705
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62688
- extendedInformation: `
62689
- Prerequsites: code is pretty printed with identical cAsE
62690
-
62706
+ extendedInformation: `
62707
+ Prerequsites: code is pretty printed with identical cAsE
62708
+
62691
62709
  Chained statments are ignored`,
62692
62710
  tags: [_irule_1.RuleTag.SingleFile],
62693
- badExample: `IF foo = bar.
62694
- WRITE 'bar'.
62695
- WRITE 'world'.
62696
- ELSE.
62697
- WRITE 'foo'.
62698
- WRITE 'world'.
62711
+ badExample: `IF foo = bar.
62712
+ WRITE 'bar'.
62713
+ WRITE 'world'.
62714
+ ELSE.
62715
+ WRITE 'foo'.
62716
+ WRITE 'world'.
62699
62717
  ENDIF.`,
62700
- goodExample: `IF foo = bar.
62701
- WRITE 'bar'.
62702
- ELSE.
62703
- WRITE 'foo'.
62704
- ENDIF.
62718
+ goodExample: `IF foo = bar.
62719
+ WRITE 'bar'.
62720
+ ELSE.
62721
+ WRITE 'foo'.
62722
+ ENDIF.
62705
62723
  WRITE 'world'.`,
62706
62724
  };
62707
62725
  }
@@ -62809,12 +62827,12 @@ class IdenticalDescriptions {
62809
62827
  key: "identical_descriptions",
62810
62828
  title: "Identical descriptions",
62811
62829
  shortDescription: `Searches for objects with the same type and same description`,
62812
- extendedInformation: `Case insensitive
62813
-
62814
- Only checks the master language descriptions
62815
-
62816
- Dependencies are skipped
62817
-
62830
+ extendedInformation: `Case insensitive
62831
+
62832
+ Only checks the master language descriptions
62833
+
62834
+ Dependencies are skipped
62835
+
62818
62836
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62819
62837
  tags: [],
62820
62838
  };
@@ -62988,43 +63006,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
62988
63006
  key: "if_in_if",
62989
63007
  title: "IF in IF",
62990
63008
  shortDescription: `Detects nested ifs which can be refactored.`,
62991
- extendedInformation: `
62992
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
62993
-
62994
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62995
-
62996
- https://docs.abapopenchecks.org/checks/01/
63009
+ extendedInformation: `
63010
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63011
+
63012
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63013
+
63014
+ https://docs.abapopenchecks.org/checks/01/
62997
63015
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
62998
- badExample: `IF condition1.
62999
- IF condition2.
63000
- ...
63001
- ENDIF.
63002
- ENDIF.
63003
-
63004
- IF condition1.
63005
- ...
63006
- ELSE.
63007
- IF condition2.
63008
- ...
63009
- ENDIF.
63016
+ badExample: `IF condition1.
63017
+ IF condition2.
63018
+ ...
63019
+ ENDIF.
63020
+ ENDIF.
63021
+
63022
+ IF condition1.
63023
+ ...
63024
+ ELSE.
63025
+ IF condition2.
63026
+ ...
63027
+ ENDIF.
63010
63028
  ENDIF.`,
63011
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63012
- ...
63013
- ENDIF.
63014
-
63015
- IF condition1.
63016
- ...
63017
- ELSEIF condition2.
63018
- ...
63019
- ENDIF.
63020
-
63021
- CASE variable.
63022
- WHEN value1.
63023
- ...
63024
- WHEN value2.
63025
- IF condition2.
63026
- ...
63027
- ENDIF.
63029
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63030
+ ...
63031
+ ENDIF.
63032
+
63033
+ IF condition1.
63034
+ ...
63035
+ ELSEIF condition2.
63036
+ ...
63037
+ ENDIF.
63038
+
63039
+ CASE variable.
63040
+ WHEN value1.
63041
+ ...
63042
+ WHEN value2.
63043
+ IF condition2.
63044
+ ...
63045
+ ENDIF.
63028
63046
  ENDCASE.`,
63029
63047
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63030
63048
  };
@@ -63209,9 +63227,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63209
63227
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63210
63228
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63211
63229
  if (name === impl.identifier.getName().toUpperCase()) {
63212
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63213
- METHOD ${methodName.toLowerCase()}.
63214
- RETURN. " todo, implement method
63230
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63231
+ METHOD ${methodName.toLowerCase()}.
63232
+ RETURN. " todo, implement method
63215
63233
  ENDMETHOD.`);
63216
63234
  }
63217
63235
  }
@@ -63390,14 +63408,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63390
63408
  key: "implicit_start_of_selection",
63391
63409
  title: "Implicit START-OF-SELECTION",
63392
63410
  shortDescription: `Add explicit selection screen event handling`,
63393
- extendedInformation: `Only runs for executable programs
63394
-
63411
+ extendedInformation: `Only runs for executable programs
63412
+
63395
63413
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63396
63414
  tags: [_irule_1.RuleTag.SingleFile],
63397
- badExample: `REPORT zfoo.
63415
+ badExample: `REPORT zfoo.
63398
63416
  WRITE 'hello'.`,
63399
- goodExample: `
63400
- START-OF-SELECTION.
63417
+ goodExample: `
63418
+ START-OF-SELECTION.
63401
63419
  WRITE 'hello'.`,
63402
63420
  };
63403
63421
  }
@@ -63502,19 +63520,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63502
63520
  key: "in_statement_indentation",
63503
63521
  title: "In-statement indentation",
63504
63522
  shortDescription: "Checks alignment within statements which span multiple lines.",
63505
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63506
-
63507
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63523
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63524
+
63525
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63508
63526
  to distinguish them better from code within the block.`,
63509
- badExample: `IF 1 = 1
63510
- AND 2 = 2.
63511
- WRITE 'hello' &&
63512
- 'world'.
63527
+ badExample: `IF 1 = 1
63528
+ AND 2 = 2.
63529
+ WRITE 'hello' &&
63530
+ 'world'.
63513
63531
  ENDIF.`,
63514
- goodExample: `IF 1 = 1
63515
- AND 2 = 2.
63516
- WRITE 'hello' &&
63517
- 'world'.
63532
+ goodExample: `IF 1 = 1
63533
+ AND 2 = 2.
63534
+ WRITE 'hello' &&
63535
+ 'world'.
63518
63536
  ENDIF.`,
63519
63537
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63520
63538
  };
@@ -63637,23 +63655,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63637
63655
  title: "Indentation",
63638
63656
  shortDescription: `Checks indentation`,
63639
63657
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63640
- badExample: `CLASS lcl DEFINITION.
63641
- PRIVATE SECTION.
63642
- METHODS constructor.
63643
- ENDCLASS.
63644
-
63645
- CLASS lcl IMPLEMENTATION.
63646
- METHOD constructor.
63647
- ENDMETHOD.
63658
+ badExample: `CLASS lcl DEFINITION.
63659
+ PRIVATE SECTION.
63660
+ METHODS constructor.
63661
+ ENDCLASS.
63662
+
63663
+ CLASS lcl IMPLEMENTATION.
63664
+ METHOD constructor.
63665
+ ENDMETHOD.
63648
63666
  ENDCLASS.`,
63649
- goodExample: `CLASS lcl DEFINITION.
63650
- PRIVATE SECTION.
63651
- METHODS constructor.
63652
- ENDCLASS.
63653
-
63654
- CLASS lcl IMPLEMENTATION.
63655
- METHOD constructor.
63656
- ENDMETHOD.
63667
+ goodExample: `CLASS lcl DEFINITION.
63668
+ PRIVATE SECTION.
63669
+ METHODS constructor.
63670
+ ENDCLASS.
63671
+
63672
+ CLASS lcl IMPLEMENTATION.
63673
+ METHOD constructor.
63674
+ ENDMETHOD.
63657
63675
  ENDCLASS.`,
63658
63676
  };
63659
63677
  }
@@ -64046,9 +64064,9 @@ class IntfReferencingClas {
64046
64064
  key: "intf_referencing_clas",
64047
64065
  title: "INTF referencing CLAS",
64048
64066
  shortDescription: `Interface contains references to class`,
64049
- extendedInformation: `Only global interfaces are checked.
64050
- Only first level references are checked.
64051
- Exception class references are ignored.
64067
+ extendedInformation: `Only global interfaces are checked.
64068
+ Only first level references are checked.
64069
+ Exception class references are ignored.
64052
64070
  Void references are ignored.`,
64053
64071
  };
64054
64072
  }
@@ -64133,9 +64151,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64133
64151
  title: "Invalid Table Index",
64134
64152
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64135
64153
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64136
- badExample: `DATA(first) = table[ 0 ].
64154
+ badExample: `DATA(first) = table[ 0 ].
64137
64155
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64138
- goodExample: `DATA(first) = table[ 1 ].
64156
+ goodExample: `DATA(first) = table[ 1 ].
64139
64157
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64140
64158
  };
64141
64159
  }
@@ -64736,8 +64754,8 @@ class LineBreakStyle {
64736
64754
  return {
64737
64755
  key: "line_break_style",
64738
64756
  title: "Makes sure line breaks are consistent in the ABAP code",
64739
- shortDescription: `Enforces LF as newlines in ABAP files
64740
-
64757
+ shortDescription: `Enforces LF as newlines in ABAP files
64758
+
64741
64759
  abapGit does not work with CRLF`,
64742
64760
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64743
64761
  };
@@ -64806,7 +64824,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64806
64824
  key: "line_length",
64807
64825
  title: "Line length",
64808
64826
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64809
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64827
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64810
64828
  https://docs.abapopenchecks.org/checks/04/`,
64811
64829
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64812
64830
  };
@@ -64877,7 +64895,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64877
64895
  key: "line_only_punc",
64878
64896
  title: "Line containing only punctuation",
64879
64897
  shortDescription: `Detects lines containing only punctuation.`,
64880
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64898
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64881
64899
  https://docs.abapopenchecks.org/checks/16/`,
64882
64900
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64883
64901
  badExample: "zcl_class=>method(\n).",
@@ -65140,15 +65158,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65140
65158
  return {
65141
65159
  key: "local_variable_names",
65142
65160
  title: "Local variable naming conventions",
65143
- shortDescription: `
65144
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65161
+ shortDescription: `
65162
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65145
65163
  Regexes are case-insensitive.`,
65146
65164
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65147
- badExample: `FORM bar.
65148
- DATA foo.
65165
+ badExample: `FORM bar.
65166
+ DATA foo.
65149
65167
  ENDFORM.`,
65150
- goodExample: `FORM bar.
65151
- DATA lv_foo.
65168
+ goodExample: `FORM bar.
65169
+ DATA lv_foo.
65152
65170
  ENDFORM.`,
65153
65171
  };
65154
65172
  }
@@ -65300,9 +65318,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65300
65318
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65301
65319
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65302
65320
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65303
- badExample: `DEFINE something.
65321
+ badExample: `DEFINE something.
65304
65322
  END-OF-DEFINITION.`,
65305
- goodExample: `DEFINE _something.
65323
+ goodExample: `DEFINE _something.
65306
65324
  END-OF-DEFINITION.`,
65307
65325
  };
65308
65326
  }
@@ -65375,10 +65393,10 @@ class MainFileContents {
65375
65393
  key: "main_file_contents",
65376
65394
  title: "Main file contents",
65377
65395
  shortDescription: `Checks related to report declarations.`,
65378
- extendedInformation: `Does not run if the target version is Cloud
65379
-
65380
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65381
- * TYPEs must begin with "TYPE-POOL <name>."
65396
+ extendedInformation: `Does not run if the target version is Cloud
65397
+
65398
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65399
+ * TYPEs must begin with "TYPE-POOL <name>."
65382
65400
  `,
65383
65401
  };
65384
65402
  }
@@ -65494,17 +65512,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65494
65512
  title: "Too many parentheses",
65495
65513
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65496
65514
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65497
- badExample: `
65498
- IF ( destination IS INITIAL ).
65499
- ENDIF.
65500
- IF foo = boo AND ( bar = lar AND moo = loo ).
65501
- ENDIF.
65515
+ badExample: `
65516
+ IF ( destination IS INITIAL ).
65517
+ ENDIF.
65518
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65519
+ ENDIF.
65502
65520
  `,
65503
- goodExample: `
65504
- IF destination IS INITIAL.
65505
- ENDIF.
65506
- IF foo = boo AND bar = lar AND moo = loo.
65507
- ENDIF.
65521
+ goodExample: `
65522
+ IF destination IS INITIAL.
65523
+ ENDIF.
65524
+ IF foo = boo AND bar = lar AND moo = loo.
65525
+ ENDIF.
65508
65526
  `,
65509
65527
  };
65510
65528
  }
@@ -65678,14 +65696,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65678
65696
  title: "Max one method parameter definition per line",
65679
65697
  shortDescription: `Keep max one method parameter description per line`,
65680
65698
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65681
- badExample: `
65682
- METHODS apps_scope_token
65683
- IMPORTING
65699
+ badExample: `
65700
+ METHODS apps_scope_token
65701
+ IMPORTING
65684
65702
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65685
- goodExample: `
65686
- METHODS apps_scope_token
65687
- IMPORTING
65688
- body TYPE bodyapps_scope_token
65703
+ goodExample: `
65704
+ METHODS apps_scope_token
65705
+ IMPORTING
65706
+ body TYPE bodyapps_scope_token
65689
65707
  client_id TYPE str.`,
65690
65708
  };
65691
65709
  }
@@ -65750,11 +65768,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65750
65768
  key: "max_one_statement",
65751
65769
  title: "Max one statement per line",
65752
65770
  shortDescription: `Checks that each line contains only a single statement.`,
65753
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65754
-
65755
- Does not report anything for chained statements.
65756
-
65757
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65771
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65772
+
65773
+ Does not report anything for chained statements.
65774
+
65775
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65758
65776
  https://docs.abapopenchecks.org/checks/11/`,
65759
65777
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65760
65778
  badExample: `WRITE foo. WRITE bar.`,
@@ -66092,8 +66110,8 @@ class MethodLength {
66092
66110
  key: "method_length",
66093
66111
  title: "Method/Form Length",
66094
66112
  shortDescription: `Checks relating to method/form length.`,
66095
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66096
-
66113
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66114
+
66097
66115
  Abstract methods without statements are considered okay.`,
66098
66116
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66099
66117
  };
@@ -66198,20 +66216,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66198
66216
  key: "method_overwrites_builtin",
66199
66217
  title: "Method name overwrites builtin function",
66200
66218
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66201
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66202
-
66203
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66204
-
66219
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66220
+
66221
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66222
+
66205
66223
  Interface method names are ignored`,
66206
66224
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66207
- badExample: `CLASS lcl DEFINITION.
66208
- PUBLIC SECTION.
66209
- METHODS matches.
66210
- ENDCLASS.
66211
-
66212
- CLASS lcl IMPLEMENTATION.
66213
- METHOD matches.
66214
- ENDMETHOD.
66225
+ badExample: `CLASS lcl DEFINITION.
66226
+ PUBLIC SECTION.
66227
+ METHODS matches.
66228
+ ENDCLASS.
66229
+
66230
+ CLASS lcl IMPLEMENTATION.
66231
+ METHOD matches.
66232
+ ENDMETHOD.
66215
66233
  ENDCLASS.`,
66216
66234
  };
66217
66235
  }
@@ -66402,12 +66420,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66402
66420
  // eslint-disable-next-line max-len
66403
66421
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66404
66422
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66405
- badExample: `CLASS lcl DEFINITION.
66406
- PUBLIC SECTION.
66407
- METHODS
66408
- foobar
66409
- EXPORTING foo TYPE i
66410
- RETURNING VALUE(rv_string) TYPE string.
66423
+ badExample: `CLASS lcl DEFINITION.
66424
+ PUBLIC SECTION.
66425
+ METHODS
66426
+ foobar
66427
+ EXPORTING foo TYPE i
66428
+ RETURNING VALUE(rv_string) TYPE string.
66411
66429
  ENDCLASS.`,
66412
66430
  };
66413
66431
  }
@@ -66787,7 +66805,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66787
66805
  key: "nesting",
66788
66806
  title: "Check nesting depth",
66789
66807
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66790
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66808
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66791
66809
  https://docs.abapopenchecks.org/checks/74/`,
66792
66810
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66793
66811
  };
@@ -67030,7 +67048,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67030
67048
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67031
67049
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67032
67050
  badExample: `var1 = var2 = var3.`,
67033
- goodExample: `var2 = var3.
67051
+ goodExample: `var2 = var3.
67034
67052
  var1 = var2.`,
67035
67053
  };
67036
67054
  }
@@ -67089,8 +67107,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67089
67107
  key: "no_external_form_calls",
67090
67108
  title: "No external FORM calls",
67091
67109
  shortDescription: `Detect external form calls`,
67092
- badExample: `PERFORM foo IN PROGRAM bar.
67093
-
67110
+ badExample: `PERFORM foo IN PROGRAM bar.
67111
+
67094
67112
  PERFORM foo(bar).`,
67095
67113
  tags: [_irule_1.RuleTag.SingleFile],
67096
67114
  };
@@ -67151,17 +67169,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67151
67169
  key: "no_inline_in_optional_branches",
67152
67170
  title: "Don't declare inline in optional branches",
67153
67171
  shortDescription: `Don't declare inline in optional branches`,
67154
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67155
-
67156
- Considered optional branches:
67157
- * inside IF/ELSEIF/ELSE
67158
- * inside LOOP
67159
- * inside WHILE
67160
- * inside CASE/WHEN, CASE TYPE OF
67161
- * inside DO
67162
- * inside SELECT loops
67163
-
67164
- Not considered optional branches:
67172
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67173
+
67174
+ Considered optional branches:
67175
+ * inside IF/ELSEIF/ELSE
67176
+ * inside LOOP
67177
+ * inside WHILE
67178
+ * inside CASE/WHEN, CASE TYPE OF
67179
+ * inside DO
67180
+ * inside SELECT loops
67181
+
67182
+ Not considered optional branches:
67165
67183
  * TRY/CATCH/CLEANUP`,
67166
67184
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67167
67185
  };
@@ -67261,12 +67279,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67261
67279
  key: "no_prefixes",
67262
67280
  title: "No Prefixes",
67263
67281
  shortDescription: `Dont use hungarian notation`,
67264
- extendedInformation: `
67265
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67266
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67267
-
67268
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67269
-
67282
+ extendedInformation: `
67283
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67284
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67285
+
67286
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67287
+
67270
67288
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67271
67289
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67272
67290
  badExample: `DATA lv_foo TYPE i.`,
@@ -67445,7 +67463,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67445
67463
  return {
67446
67464
  key: "no_public_attributes",
67447
67465
  title: "No public attributes",
67448
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67466
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67449
67467
  Exceptions are excluded from this rule.`,
67450
67468
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67451
67469
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67546,13 +67564,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67546
67564
  key: "no_yoda_conditions",
67547
67565
  title: "No Yoda conditions",
67548
67566
  shortDescription: `Finds Yoda conditions and reports issues`,
67549
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67550
-
67567
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67568
+
67551
67569
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67552
67570
  tags: [_irule_1.RuleTag.SingleFile],
67553
- badExample: `IF 0 <> sy-subrc.
67571
+ badExample: `IF 0 <> sy-subrc.
67554
67572
  ENDIF.`,
67555
- goodExample: `IF sy-subrc <> 0.
67573
+ goodExample: `IF sy-subrc <> 0.
67556
67574
  ENDIF.`,
67557
67575
  };
67558
67576
  }
@@ -67653,8 +67671,8 @@ class NROBConsistency {
67653
67671
  key: "nrob_consistency",
67654
67672
  title: "Number range consistency",
67655
67673
  shortDescription: `Consistency checks for number ranges`,
67656
- extendedInformation: `Issue reported if percentage warning is over 50%
67657
-
67674
+ extendedInformation: `Issue reported if percentage warning is over 50%
67675
+
67658
67676
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67659
67677
  tags: [_irule_1.RuleTag.SingleFile],
67660
67678
  };
@@ -67931,58 +67949,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67931
67949
  title: "Obsolete statements",
67932
67950
  shortDescription: `Checks for usages of certain obsolete statements`,
67933
67951
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67934
- extendedInformation: `
67935
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67936
-
67937
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67938
-
67939
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67940
-
67941
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67942
-
67943
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67944
-
67945
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67946
-
67947
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67948
-
67949
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67950
-
67951
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67952
-
67953
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67954
-
67955
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67956
-
67957
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67958
-
67959
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67960
-
67961
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67962
-
67963
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67964
- SELECT COUNT(*) is considered okay
67965
-
67966
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67967
-
67968
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67969
-
67970
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67971
-
67972
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67973
-
67974
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
67975
-
67952
+ extendedInformation: `
67953
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67954
+
67955
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67956
+
67957
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67958
+
67959
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67960
+
67961
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67962
+
67963
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67964
+
67965
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67966
+
67967
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67968
+
67969
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67970
+
67971
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67972
+
67973
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67974
+
67975
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67976
+
67977
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67978
+
67979
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67980
+
67981
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67982
+ SELECT COUNT(*) is considered okay
67983
+
67984
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67985
+
67986
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67987
+
67988
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67989
+
67990
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67991
+
67992
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
67993
+
67976
67994
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
67977
- badExample: `REFRESH itab.
67978
-
67979
- COMPUTE foo = 2 + 2.
67980
-
67981
- MULTIPLY lv_foo BY 2.
67982
-
67983
- INTERFACE intf LOAD.
67984
-
67985
- IF foo IS SUPPLIED.
67995
+ badExample: `REFRESH itab.
67996
+
67997
+ COMPUTE foo = 2 + 2.
67998
+
67999
+ MULTIPLY lv_foo BY 2.
68000
+
68001
+ INTERFACE intf LOAD.
68002
+
68003
+ IF foo IS SUPPLIED.
67986
68004
  ENDIF.`,
67987
68005
  };
67988
68006
  }
@@ -68322,9 +68340,9 @@ class OmitParameterName {
68322
68340
  key: "omit_parameter_name",
68323
68341
  title: "Omit parameter name",
68324
68342
  shortDescription: `Omit the parameter name in single parameter calls`,
68325
- extendedInformation: `
68326
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68327
-
68343
+ extendedInformation: `
68344
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68345
+
68328
68346
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68329
68347
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68330
68348
  badExample: `method( param = 2 ).`,
@@ -68530,20 +68548,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68530
68548
  shortDescription: `Omit RECEIVING`,
68531
68549
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68532
68550
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68533
- badExample: `
68534
- upload_pack(
68535
- EXPORTING
68536
- io_client = lo_client
68537
- iv_url = iv_url
68538
- iv_deepen_level = iv_deepen_level
68539
- it_hashes = lt_hashes
68540
- RECEIVING
68551
+ badExample: `
68552
+ upload_pack(
68553
+ EXPORTING
68554
+ io_client = lo_client
68555
+ iv_url = iv_url
68556
+ iv_deepen_level = iv_deepen_level
68557
+ it_hashes = lt_hashes
68558
+ RECEIVING
68541
68559
  rt_objects = et_objects ).`,
68542
- goodExample: `
68543
- et_objects = upload_pack(
68544
- io_client = lo_client
68545
- iv_url = iv_url
68546
- iv_deepen_level = iv_deepen_level
68560
+ goodExample: `
68561
+ et_objects = upload_pack(
68562
+ io_client = lo_client
68563
+ iv_url = iv_url
68564
+ iv_deepen_level = iv_deepen_level
68547
68565
  it_hashes = lt_hashes ).`,
68548
68566
  };
68549
68567
  }
@@ -68607,8 +68625,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68607
68625
  return {
68608
68626
  key: "parser_702_chaining",
68609
68627
  title: "Parser Error, bad chanining on 702",
68610
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68611
- this rule finds these and reports errors.
68628
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68629
+ this rule finds these and reports errors.
68612
68630
  Only active on target version 702 and below.`,
68613
68631
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68614
68632
  };
@@ -68688,8 +68706,8 @@ class ParserError {
68688
68706
  return {
68689
68707
  key: "parser_error",
68690
68708
  title: "Parser error",
68691
- shortDescription: `Checks for syntax not recognized by abaplint.
68692
-
68709
+ shortDescription: `Checks for syntax not recognized by abaplint.
68710
+
68693
68711
  See recognized syntax at https://syntax.abaplint.org`,
68694
68712
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68695
68713
  };
@@ -68774,7 +68792,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68774
68792
  return {
68775
68793
  key: "parser_missing_space",
68776
68794
  title: "Parser Error, missing space",
68777
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68795
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68778
68796
  This rule makes sure the spaces are consistently required across the language.`,
68779
68797
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68780
68798
  badExample: `IF ( foo = 'bar').`,
@@ -69186,25 +69204,25 @@ class PreferInline {
69186
69204
  key: "prefer_inline",
69187
69205
  title: "Prefer Inline Declarations",
69188
69206
  shortDescription: `Prefer inline to up-front declarations.`,
69189
- extendedInformation: `EXPERIMENTAL
69190
-
69191
- Activates if language version is v740sp02 or above.
69192
-
69193
- Variables must be local(METHOD or FORM).
69194
-
69195
- No generic or void typed variables. No syntax errors.
69196
-
69197
- First position used must be a full/pure write.
69198
-
69199
- Move statment is not a cast(?=)
69200
-
69207
+ extendedInformation: `EXPERIMENTAL
69208
+
69209
+ Activates if language version is v740sp02 or above.
69210
+
69211
+ Variables must be local(METHOD or FORM).
69212
+
69213
+ No generic or void typed variables. No syntax errors.
69214
+
69215
+ First position used must be a full/pure write.
69216
+
69217
+ Move statment is not a cast(?=)
69218
+
69201
69219
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69202
69220
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69203
- badExample: `DATA foo TYPE i.
69204
- foo = 2.
69205
- DATA percentage TYPE decfloat34.
69221
+ badExample: `DATA foo TYPE i.
69222
+ foo = 2.
69223
+ DATA percentage TYPE decfloat34.
69206
69224
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69207
- goodExample: `DATA(foo) = 2.
69225
+ goodExample: `DATA(foo) = 2.
69208
69226
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69209
69227
  };
69210
69228
  }
@@ -69418,18 +69436,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69418
69436
  key: "prefer_is_not",
69419
69437
  title: "Prefer IS NOT to NOT IS",
69420
69438
  shortDescription: `Prefer IS NOT to NOT IS`,
69421
- extendedInformation: `
69422
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69423
-
69439
+ extendedInformation: `
69440
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69441
+
69424
69442
  "if not is_valid( )." examples are skipped`,
69425
69443
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69426
- goodExample: `IF variable IS NOT INITIAL.
69427
- IF variable NP 'TODO*'.
69428
- IF variable <> 42.
69444
+ goodExample: `IF variable IS NOT INITIAL.
69445
+ IF variable NP 'TODO*'.
69446
+ IF variable <> 42.
69429
69447
  IF variable CO 'hello'.`,
69430
- badExample: `IF NOT variable IS INITIAL.
69431
- IF NOT variable CP 'TODO*'.
69432
- IF NOT variable = 42.
69448
+ badExample: `IF NOT variable IS INITIAL.
69449
+ IF NOT variable CP 'TODO*'.
69450
+ IF NOT variable = 42.
69433
69451
  IF NOT variable CA 'hello'.`,
69434
69452
  };
69435
69453
  }
@@ -69617,14 +69635,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69617
69635
  key: "prefer_raise_exception_new",
69618
69636
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69619
69637
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69620
- extendedInformation: `
69621
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69622
-
69638
+ extendedInformation: `
69639
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69640
+
69623
69641
  From 752 and up`,
69624
69642
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69625
69643
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69626
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69627
- EXPORTING
69644
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69645
+ EXPORTING
69628
69646
  previous = exception.`,
69629
69647
  };
69630
69648
  }
@@ -69702,12 +69720,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69702
69720
  key: "prefer_returning_to_exporting",
69703
69721
  title: "Prefer RETURNING to EXPORTING",
69704
69722
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69705
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69723
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69706
69724
  https://docs.abapopenchecks.org/checks/44/`,
69707
69725
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69708
- badExample: `CLASS lcl DEFINITION.
69709
- PUBLIC SECTION.
69710
- METHODS test EXPORTING ev_foo TYPE i.
69726
+ badExample: `CLASS lcl DEFINITION.
69727
+ PUBLIC SECTION.
69728
+ METHODS test EXPORTING ev_foo TYPE i.
69711
69729
  ENDCLASS.`,
69712
69730
  };
69713
69731
  }
@@ -69803,8 +69821,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69803
69821
  key: "prefer_xsdbool",
69804
69822
  title: "Prefer xsdbool over boolc",
69805
69823
  shortDescription: `Prefer xsdbool over boolc`,
69806
- extendedInformation: `Activates if language version is v740sp08 or above.
69807
-
69824
+ extendedInformation: `Activates if language version is v740sp08 or above.
69825
+
69808
69826
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69809
69827
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69810
69828
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69876,9 +69894,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69876
69894
  title: "Preferred compare operator",
69877
69895
  shortDescription: `Configure undesired operator variants`,
69878
69896
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69879
- badExample: `IF foo EQ bar.
69897
+ badExample: `IF foo EQ bar.
69880
69898
  ENDIF.`,
69881
- goodExample: `IF foo = bar.
69899
+ goodExample: `IF foo = bar.
69882
69900
  ENDIF.`,
69883
69901
  };
69884
69902
  }
@@ -70102,26 +70120,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70102
70120
  key: "reduce_procedural_code",
70103
70121
  title: "Reduce procedural code",
70104
70122
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70105
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70106
-
70107
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70108
-
70123
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70124
+
70125
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70126
+
70109
70127
  Comments are not counted as statements.`,
70110
70128
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70111
- badExample: `FORM foo.
70112
- DATA lv_bar TYPE i.
70113
- lv_bar = 2 + 2.
70114
- IF lv_bar = 4.
70115
- WRITE 'hello world'.
70116
- ENDIF.
70117
- DATA lv_bar TYPE i.
70118
- lv_bar = 2 + 2.
70119
- IF lv_bar = 4.
70120
- WRITE 'hello world'.
70121
- ENDIF.
70129
+ badExample: `FORM foo.
70130
+ DATA lv_bar TYPE i.
70131
+ lv_bar = 2 + 2.
70132
+ IF lv_bar = 4.
70133
+ WRITE 'hello world'.
70134
+ ENDIF.
70135
+ DATA lv_bar TYPE i.
70136
+ lv_bar = 2 + 2.
70137
+ IF lv_bar = 4.
70138
+ WRITE 'hello world'.
70139
+ ENDIF.
70122
70140
  ENDFORM.`,
70123
- goodExample: `FORM foo.
70124
- NEW zcl_global_class( )->run_logic( ).
70141
+ goodExample: `FORM foo.
70142
+ NEW zcl_global_class( )->run_logic( ).
70125
70143
  ENDFORM.`,
70126
70144
  };
70127
70145
  }
@@ -70365,10 +70383,10 @@ class RemoveDescriptions {
70365
70383
  return {
70366
70384
  key: "remove_descriptions",
70367
70385
  title: "Remove descriptions",
70368
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70369
-
70370
- Class descriptions are required, see rule description_empty.
70371
-
70386
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70387
+
70388
+ Class descriptions are required, see rule description_empty.
70389
+
70372
70390
  Consider using ABAP Doc for documentation.`,
70373
70391
  tags: [],
70374
70392
  };
@@ -70493,14 +70511,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70493
70511
  tags: [_irule_1.RuleTag.SingleFile],
70494
70512
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70495
70513
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70496
- badExample: `CALL FUNCTION 'ZRFC'
70514
+ badExample: `CALL FUNCTION 'ZRFC'
70497
70515
  DESTINATION lv_rfc.`,
70498
- goodExample: `CALL FUNCTION 'ZRFC'
70499
- DESTINATION lv_rfc
70500
- EXCEPTIONS
70501
- system_failure = 1 MESSAGE msg
70502
- communication_failure = 2 MESSAGE msg
70503
- resource_failure = 3
70516
+ goodExample: `CALL FUNCTION 'ZRFC'
70517
+ DESTINATION lv_rfc
70518
+ EXCEPTIONS
70519
+ system_failure = 1 MESSAGE msg
70520
+ communication_failure = 2 MESSAGE msg
70521
+ resource_failure = 3
70504
70522
  OTHERS = 4.`,
70505
70523
  };
70506
70524
  }
@@ -70584,11 +70602,11 @@ class SelectAddOrderBy {
70584
70602
  key: "select_add_order_by",
70585
70603
  title: "SELECT add ORDER BY",
70586
70604
  shortDescription: `SELECTs add ORDER BY clause`,
70587
- extendedInformation: `
70588
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70589
-
70590
- add ORDER BY PRIMARY KEY if in doubt
70591
-
70605
+ extendedInformation: `
70606
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70607
+
70608
+ add ORDER BY PRIMARY KEY if in doubt
70609
+
70592
70610
  If the target is a sorted/hashed table, no issue is reported`,
70593
70611
  tags: [_irule_1.RuleTag.SingleFile],
70594
70612
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70719,14 +70737,14 @@ class SelectPerformance {
70719
70737
  key: "select_performance",
70720
70738
  title: "SELECT performance",
70721
70739
  shortDescription: `Various checks regarding SELECT performance.`,
70722
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70723
-
70740
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70741
+
70724
70742
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70725
70743
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70726
- badExample: `SELECT field1, field2 FROM table
70727
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70744
+ badExample: `SELECT field1, field2 FROM table
70745
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70728
70746
  ENDSELECT.`,
70729
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70747
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70730
70748
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70731
70749
  };
70732
70750
  }
@@ -70840,8 +70858,8 @@ class SelectSingleFullKey {
70840
70858
  key: "select_single_full_key",
70841
70859
  title: "Detect SELECT SINGLE which are possibily not unique",
70842
70860
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70843
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70844
-
70861
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70862
+
70845
70863
  If the statement contains a JOIN it is not checked`,
70846
70864
  pseudoComment: "EC CI_NOORDER",
70847
70865
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71265,8 +71283,8 @@ class SICFConsistency {
71265
71283
  key: "sicf_consistency",
71266
71284
  title: "SICF consistency",
71267
71285
  shortDescription: `Checks the validity of ICF services`,
71268
- extendedInformation: `* Class defined in handler must exist
71269
- * Class must not have any syntax errors
71286
+ extendedInformation: `* Class defined in handler must exist
71287
+ * Class must not have any syntax errors
71270
71288
  * Class must implement interface IF_HTTP_EXTENSION`,
71271
71289
  };
71272
71290
  }
@@ -71378,23 +71396,23 @@ class SlowParameterPassing {
71378
71396
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71379
71397
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71380
71398
  tags: [_irule_1.RuleTag.Performance],
71381
- badExample: `CLASS lcl DEFINITION.
71382
- PUBLIC SECTION.
71383
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71384
- ENDCLASS.
71385
- CLASS lcl IMPLEMENTATION.
71386
- METHOD bar.
71387
- WRITE sdf.
71388
- ENDMETHOD.
71399
+ badExample: `CLASS lcl DEFINITION.
71400
+ PUBLIC SECTION.
71401
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71402
+ ENDCLASS.
71403
+ CLASS lcl IMPLEMENTATION.
71404
+ METHOD bar.
71405
+ WRITE sdf.
71406
+ ENDMETHOD.
71389
71407
  ENDCLASS.`,
71390
- goodExample: `CLASS lcl DEFINITION.
71391
- PUBLIC SECTION.
71392
- METHODS bar IMPORTING sdf TYPE string.
71393
- ENDCLASS.
71394
- CLASS lcl IMPLEMENTATION.
71395
- METHOD bar.
71396
- WRITE sdf.
71397
- ENDMETHOD.
71408
+ goodExample: `CLASS lcl DEFINITION.
71409
+ PUBLIC SECTION.
71410
+ METHODS bar IMPORTING sdf TYPE string.
71411
+ ENDCLASS.
71412
+ CLASS lcl IMPLEMENTATION.
71413
+ METHOD bar.
71414
+ WRITE sdf.
71415
+ ENDMETHOD.
71398
71416
  ENDCLASS.`,
71399
71417
  };
71400
71418
  }
@@ -71651,8 +71669,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71651
71669
  key: "space_before_dot",
71652
71670
  title: "Space before dot",
71653
71671
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71654
- extendedInformation: `
71655
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71672
+ extendedInformation: `
71673
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71656
71674
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71657
71675
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71658
71676
  badExample: `WRITE bar .`,
@@ -71838,12 +71856,12 @@ class SQLValueConversion {
71838
71856
  key: "sql_value_conversion",
71839
71857
  title: "Implicit SQL Value Conversion",
71840
71858
  shortDescription: `Ensure types match when selecting from database`,
71841
- extendedInformation: `
71842
- * Integer to CHAR conversion
71843
- * Integer to NUMC conversion
71844
- * NUMC to Integer conversion
71845
- * CHAR to Integer conversion
71846
- * Source field longer than database field, CHAR -> CHAR
71859
+ extendedInformation: `
71860
+ * Integer to CHAR conversion
71861
+ * Integer to NUMC conversion
71862
+ * NUMC to Integer conversion
71863
+ * CHAR to Integer conversion
71864
+ * Source field longer than database field, CHAR -> CHAR
71847
71865
  * Source field longer than database field, NUMC -> NUMC`,
71848
71866
  tags: [],
71849
71867
  };
@@ -71915,7 +71933,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71915
71933
  key: "start_at_tab",
71916
71934
  title: "Start at tab",
71917
71935
  shortDescription: `Checks that statements start at tabstops.`,
71918
- extendedInformation: `Reports max 100 issues per file
71936
+ extendedInformation: `Reports max 100 issues per file
71919
71937
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71920
71938
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71921
71939
  badExample: ` WRITE a.`,
@@ -72092,12 +72110,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72092
72110
  key: "strict_sql",
72093
72111
  title: "Strict SQL",
72094
72112
  shortDescription: `Strict SQL`,
72095
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72096
-
72097
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72098
-
72099
- Also see separate rule sql_escape_host_variables
72100
-
72113
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72114
+
72115
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72116
+
72117
+ Also see separate rule sql_escape_host_variables
72118
+
72101
72119
  Activates from v750 and up`,
72102
72120
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72103
72121
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72351,11 +72369,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72351
72369
  key: "sy_modification",
72352
72370
  title: "Modification of SY fields",
72353
72371
  shortDescription: `Finds modification of sy fields`,
72354
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72355
-
72372
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72373
+
72356
72374
  Changes to SY-TVAR* fields are not reported`,
72357
72375
  tags: [_irule_1.RuleTag.SingleFile],
72358
- badExample: `sy-uname = 2.
72376
+ badExample: `sy-uname = 2.
72359
72377
  sy = sy.`,
72360
72378
  };
72361
72379
  }
@@ -72417,8 +72435,8 @@ class TABLEnhancementCategory {
72417
72435
  key: "tabl_enhancement_category",
72418
72436
  title: "TABL enhancement category must be set",
72419
72437
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72420
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72421
-
72438
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72439
+
72422
72440
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72423
72441
  tags: [],
72424
72442
  };
@@ -72483,8 +72501,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72483
72501
  shortDescription: `TABLES are always global, so declare them globally`,
72484
72502
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72485
72503
  tags: [_irule_1.RuleTag.SingleFile],
72486
- badExample: `FORM foo.
72487
- TABLES t100.
72504
+ badExample: `FORM foo.
72505
+ TABLES t100.
72488
72506
  ENDFORM.`,
72489
72507
  goodExample: `TABLES t000.`,
72490
72508
  };
@@ -72612,9 +72630,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72612
72630
  title: "Type FORM parameters",
72613
72631
  shortDescription: `Checks for untyped FORM parameters`,
72614
72632
  tags: [_irule_1.RuleTag.SingleFile],
72615
- badExample: `FORM foo USING bar.
72633
+ badExample: `FORM foo USING bar.
72616
72634
  ENDFORM.`,
72617
- goodExample: `FORM foo USING bar TYPE string.
72635
+ goodExample: `FORM foo USING bar TYPE string.
72618
72636
  ENDFORM.`,
72619
72637
  };
72620
72638
  }
@@ -73287,38 +73305,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73287
73305
  key: "unnecessary_pragma",
73288
73306
  title: "Unnecessary Pragma",
73289
73307
  shortDescription: `Finds pragmas which can be removed`,
73290
- extendedInformation: `* NO_HANDLER with handler
73291
-
73292
- * NEEDED without definition
73293
-
73294
- * NO_TEXT without texts
73295
-
73296
- * SUBRC_OK where sy-subrc is checked
73297
-
73308
+ extendedInformation: `* NO_HANDLER with handler
73309
+
73310
+ * NEEDED without definition
73311
+
73312
+ * NO_TEXT without texts
73313
+
73314
+ * SUBRC_OK where sy-subrc is checked
73315
+
73298
73316
  NO_HANDLER inside macros are not checked`,
73299
73317
  tags: [_irule_1.RuleTag.SingleFile],
73300
- badExample: `TRY.
73301
- ...
73302
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73303
- RETURN. " it has a handler
73304
- ENDTRY.
73305
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73306
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73307
- IF sy-subrc <> 0.
73318
+ badExample: `TRY.
73319
+ ...
73320
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73321
+ RETURN. " it has a handler
73322
+ ENDTRY.
73323
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73324
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73325
+ IF sy-subrc <> 0.
73308
73326
  ENDIF.`,
73309
- goodExample: `TRY.
73310
- ...
73311
- CATCH zcx_abapgit_exception.
73312
- RETURN.
73313
- ENDTRY.
73314
- MESSAGE w125(zbar) WITH c_foo INTO message.
73315
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73316
- IF sy-subrc <> 0.
73317
- ENDIF.
73318
-
73319
- DATA: BEGIN OF blah ##NEEDED,
73320
- test1 TYPE string,
73321
- test2 TYPE string,
73327
+ goodExample: `TRY.
73328
+ ...
73329
+ CATCH zcx_abapgit_exception.
73330
+ RETURN.
73331
+ ENDTRY.
73332
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73333
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73334
+ IF sy-subrc <> 0.
73335
+ ENDIF.
73336
+
73337
+ DATA: BEGIN OF blah ##NEEDED,
73338
+ test1 TYPE string,
73339
+ test2 TYPE string,
73322
73340
  END OF blah.`,
73323
73341
  };
73324
73342
  }
@@ -73485,18 +73503,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73485
73503
  shortDescription: `Finds unnecessary RETURN statements`,
73486
73504
  extendedInformation: `Finds unnecessary RETURN statements`,
73487
73505
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73488
- badExample: `FORM hello1.
73489
- WRITE 'world'.
73490
- RETURN.
73491
- ENDFORM.
73492
-
73493
- FORM foo.
73494
- IF 1 = 2.
73495
- RETURN.
73496
- ENDIF.
73506
+ badExample: `FORM hello1.
73507
+ WRITE 'world'.
73508
+ RETURN.
73509
+ ENDFORM.
73510
+
73511
+ FORM foo.
73512
+ IF 1 = 2.
73513
+ RETURN.
73514
+ ENDIF.
73497
73515
  ENDFORM.`,
73498
- goodExample: `FORM hello2.
73499
- WRITE 'world'.
73516
+ goodExample: `FORM hello2.
73517
+ WRITE 'world'.
73500
73518
  ENDFORM.`,
73501
73519
  };
73502
73520
  }
@@ -73847,13 +73865,13 @@ class UnusedMacros {
73847
73865
  title: "Unused macros",
73848
73866
  shortDescription: `Checks for unused macro definitions definitions`,
73849
73867
  tags: [_irule_1.RuleTag.Quickfix],
73850
- badExample: `DEFINE foobar1.
73851
- WRITE 'hello'.
73868
+ badExample: `DEFINE foobar1.
73869
+ WRITE 'hello'.
73852
73870
  END-OF-DEFINITION.`,
73853
- goodExample: `DEFINE foobar2.
73854
- WRITE 'hello'.
73855
- END-OF-DEFINITION.
73856
-
73871
+ goodExample: `DEFINE foobar2.
73872
+ WRITE 'hello'.
73873
+ END-OF-DEFINITION.
73874
+
73857
73875
  foobar2.`,
73858
73876
  };
73859
73877
  }
@@ -73908,6 +73926,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
73908
73926
  exports.UnusedMethods = exports.UnusedMethodsConf = void 0;
73909
73927
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
73910
73928
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
73929
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
73911
73930
  const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
73912
73931
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
73913
73932
  const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
@@ -73916,6 +73935,8 @@ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./n
73916
73935
  const visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
73917
73936
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
73918
73937
  const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
73938
+ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
73939
+ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
73919
73940
  class UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
73920
73941
  }
73921
73942
  exports.UnusedMethodsConf = UnusedMethodsConf;
@@ -73928,6 +73949,7 @@ class WorkArea {
73928
73949
  this.list.push(id);
73929
73950
  }
73930
73951
  removeIfExists(id) {
73952
+ // todo: optimize
73931
73953
  for (let i = 0; i < this.list.length; i++) {
73932
73954
  if (id.equals(this.list[i].identifier)) {
73933
73955
  this.list.splice(i, 1);
@@ -73961,19 +73983,19 @@ class UnusedMethods {
73961
73983
  key: "unused_methods",
73962
73984
  title: "Unused methods",
73963
73985
  shortDescription: `Checks for unused methods`,
73964
- extendedInformation: `Checks private and protected methods.
73965
-
73966
- Unused methods are not reported if the object contains parser or syntax errors.
73967
-
73968
- Skips:
73969
- * methods FOR TESTING
73970
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73971
- * class_constructor + constructor methods
73972
- * event handlers
73973
- * methods that are redefined
73974
- * INCLUDEs
73986
+ extendedInformation: `Checks private and protected methods.
73987
+
73988
+ Unused methods are not reported if the object contains parser or syntax errors.
73989
+
73990
+ Skips:
73991
+ * methods FOR TESTING
73992
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73993
+ * class_constructor + constructor methods
73994
+ * event handlers
73995
+ * methods that are redefined
73996
+ * INCLUDEs
73975
73997
  `,
73976
- tags: [],
73998
+ tags: [_irule_1.RuleTag.Quickfix],
73977
73999
  pragma: "##CALLED",
73978
74000
  pseudoComment: "EC CALLED",
73979
74001
  };
@@ -74055,11 +74077,33 @@ Skips:
74055
74077
  else if (this.suppressedbyPseudo(statement, file)) {
74056
74078
  continue;
74057
74079
  }
74080
+ const implementation = this.findMethodImplementation(i, file);
74081
+ let fix = undefined;
74082
+ if (implementation !== undefined) {
74083
+ const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);
74084
+ const fix2 = edit_helper_1.EditHelper.deleteRange(file, implementation.getFirstToken().getStart(), implementation.getLastToken().getEnd());
74085
+ fix = edit_helper_1.EditHelper.merge(fix1, fix2);
74086
+ }
74058
74087
  const message = "Method \"" + i.identifier.getName() + "\" not used";
74059
- issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));
74088
+ issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity, fix));
74060
74089
  }
74061
74090
  return issues;
74062
74091
  }
74092
+ findMethodImplementation(method, file) {
74093
+ var _a, _b;
74094
+ for (const classImplementation of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStructures(Structures.ClassImplementation)) || []) {
74095
+ // todo, this will break if there are class implemtations with the same method names
74096
+ // const className = classImplementation.findFirstExpression(Expressions.ClassName)?.concatTokens().toUpperCase();
74097
+ for (const methodImplementation of classImplementation.findAllStructures(Structures.Method)) {
74098
+ const methodName = ((_b = methodImplementation.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) || "";
74099
+ if (methodName !== method.name.toUpperCase()) {
74100
+ continue;
74101
+ }
74102
+ return methodImplementation;
74103
+ }
74104
+ }
74105
+ return undefined;
74106
+ }
74063
74107
  suppressedbyPseudo(statement, file) {
74064
74108
  if (statement === undefined) {
74065
74109
  return false;
@@ -74405,23 +74449,23 @@ class UnusedVariables {
74405
74449
  key: "unused_variables",
74406
74450
  title: "Unused variables",
74407
74451
  shortDescription: `Checks for unused variables and constants`,
74408
- extendedInformation: `Skips event parameters.
74409
-
74410
- Note that this currently does not work if the source code uses macros.
74411
-
74412
- Unused variables are not reported if the object contains parser or syntax errors.
74413
-
74452
+ extendedInformation: `Skips event parameters.
74453
+
74454
+ Note that this currently does not work if the source code uses macros.
74455
+
74456
+ Unused variables are not reported if the object contains parser or syntax errors.
74457
+
74414
74458
  Errors found in INCLUDES are reported for the main program.`,
74415
74459
  tags: [_irule_1.RuleTag.Quickfix],
74416
74460
  pragma: "##NEEDED",
74417
74461
  pseudoComment: "EC NEEDED",
74418
- badExample: `DATA: BEGIN OF blah1,
74419
- test TYPE string,
74420
- test2 TYPE string,
74462
+ badExample: `DATA: BEGIN OF blah1,
74463
+ test TYPE string,
74464
+ test2 TYPE string,
74421
74465
  END OF blah1.`,
74422
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74423
- test TYPE string,
74424
- test2 TYPE string,
74466
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74467
+ test TYPE string,
74468
+ test2 TYPE string,
74425
74469
  END OF blah2.`,
74426
74470
  };
74427
74471
  }
@@ -74640,15 +74684,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74640
74684
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74641
74685
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74642
74686
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74643
- badExample: `IF line IS INITIAL.
74644
- has_entries = abap_false.
74645
- ELSE.
74646
- has_entries = abap_true.
74647
- ENDIF.
74648
-
74687
+ badExample: `IF line IS INITIAL.
74688
+ has_entries = abap_false.
74689
+ ELSE.
74690
+ has_entries = abap_true.
74691
+ ENDIF.
74692
+
74649
74693
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74650
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74651
-
74694
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74695
+
74652
74696
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74653
74697
  };
74654
74698
  }
@@ -74766,15 +74810,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74766
74810
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74767
74811
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74768
74812
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74769
- badExample: `INTERFACE lif.
74770
- METHODS load_data
74771
- EXCEPTIONS
74772
- invalid_parameter.
74813
+ badExample: `INTERFACE lif.
74814
+ METHODS load_data
74815
+ EXCEPTIONS
74816
+ invalid_parameter.
74773
74817
  ENDINTERFACE.`,
74774
- goodExample: `INTERFACE lif.
74775
- METHODS load_data
74776
- RAISING
74777
- cx_something.
74818
+ goodExample: `INTERFACE lif.
74819
+ METHODS load_data
74820
+ RAISING
74821
+ cx_something.
74778
74822
  ENDINTERFACE.`,
74779
74823
  };
74780
74824
  }
@@ -74834,15 +74878,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74834
74878
  key: "use_line_exists",
74835
74879
  title: "Use line_exists",
74836
74880
  shortDescription: `Use line_exists, from 740sp02 and up`,
74837
- extendedInformation: `
74838
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74839
-
74881
+ extendedInformation: `
74882
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74883
+
74840
74884
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74841
74885
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74842
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74843
- IF sy-subrc = 0.
74886
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74887
+ IF sy-subrc = 0.
74844
74888
  ENDIF.`,
74845
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74889
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74846
74890
  ENDIF.`,
74847
74891
  };
74848
74892
  }
@@ -74952,10 +74996,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
74952
74996
  key: "use_new",
74953
74997
  title: "Use NEW",
74954
74998
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
74955
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74956
-
74957
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74958
-
74999
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75000
+
75001
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75002
+
74959
75003
  Applicable from v740sp02 and up`,
74960
75004
  badExample: `CREATE OBJECT ref.`,
74961
75005
  goodExample: `ref = NEW #( ).`,
@@ -75053,13 +75097,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75053
75097
  title: "WHEN OTHERS last",
75054
75098
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75055
75099
  tags: [_irule_1.RuleTag.SingleFile],
75056
- badExample: `CASE bar.
75057
- WHEN OTHERS.
75058
- WHEN 2.
75100
+ badExample: `CASE bar.
75101
+ WHEN OTHERS.
75102
+ WHEN 2.
75059
75103
  ENDCASE.`,
75060
- goodExample: `CASE bar.
75061
- WHEN 2.
75062
- WHEN OTHERS.
75104
+ goodExample: `CASE bar.
75105
+ WHEN 2.
75106
+ WHEN OTHERS.
75063
75107
  ENDCASE.`,
75064
75108
  };
75065
75109
  }