@abaplint/cli 2.113.21 → 2.113.23

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 +869 -844
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -35173,13 +35173,13 @@ class FlowGraph {
35173
35173
  this.label = label;
35174
35174
  }
35175
35175
  toDigraph() {
35176
- return `digraph G {
35177
- labelloc="t";
35178
- label="${this.label}";
35179
- graph [fontname = "helvetica"];
35180
- node [fontname = "helvetica", shape="box"];
35181
- edge [fontname = "helvetica"];
35182
- ${this.toTextEdges()}
35176
+ return `digraph G {
35177
+ labelloc="t";
35178
+ label="${this.label}";
35179
+ graph [fontname = "helvetica"];
35180
+ node [fontname = "helvetica", shape="box"];
35181
+ edge [fontname = "helvetica"];
35182
+ ${this.toTextEdges()}
35183
35183
  }`;
35184
35184
  }
35185
35185
  listSources(node) {
@@ -35549,6 +35549,14 @@ class StatementFlow {
35549
35549
  }
35550
35550
  // TODO, handle CLEANUP
35551
35551
  }
35552
+ else if (type instanceof Structures.CatchSystemExceptions) {
35553
+ // TODO: this is not completely correct
35554
+ const catchName = this.buildName(n.getFirstStatement());
35555
+ const body = this.traverseBody(this.findBody(n), context);
35556
+ graph.addEdge(current, catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35557
+ graph.addGraph(catchName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
35558
+ graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
35559
+ }
35552
35560
  else if (type instanceof Structures.Case) {
35553
35561
  const caseName = this.buildName(n.getFirstStatement());
35554
35562
  graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
@@ -43430,13 +43438,13 @@ class Help {
43430
43438
  /////////////////////////////////////////////////
43431
43439
  static dumpABAP(file, reg, textDocument, position) {
43432
43440
  let content = "";
43433
- content = `
43434
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43435
- <a href="#_statements" rel="no-refresh">Statements</a> |
43436
- <a href="#_structure" rel="no-refresh">Structure</a> |
43437
- <a href="#_files" rel="no-refresh">Files</a> |
43438
- <a href="#_info" rel="no-refresh">Info Dump</a>
43439
- <hr>
43441
+ content = `
43442
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43443
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43444
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43445
+ <a href="#_files" rel="no-refresh">Files</a> |
43446
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43447
+ <hr>
43440
43448
  ` +
43441
43449
  "<tt>" + textDocument.uri + " (" +
43442
43450
  (position.line + 1) + ", " +
@@ -46525,8 +46533,9 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46525
46533
  return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.definitionName;
46526
46534
  }
46527
46535
  getDescription() {
46528
- // todo
46529
- return undefined;
46536
+ var _a;
46537
+ this.parse();
46538
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.description;
46530
46539
  }
46531
46540
  parseType(reg) {
46532
46541
  this.parse();
@@ -46560,6 +46569,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46560
46569
  this.parsedData = {
46561
46570
  sqlViewName: undefined,
46562
46571
  definitionName: undefined,
46572
+ description: this.findDescription(),
46563
46573
  fields: [],
46564
46574
  sources: [],
46565
46575
  relations: [],
@@ -46599,6 +46609,14 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46599
46609
  this.parsedData.sqlViewName = match[1].toUpperCase();
46600
46610
  }
46601
46611
  }
46612
+ findDescription() {
46613
+ var _a;
46614
+ const match = (_a = this.findSourceFile()) === null || _a === void 0 ? void 0 : _a.getRaw().match(/@EndUserText\.label: '([\w ]+)'/);
46615
+ if (match) {
46616
+ return match[1];
46617
+ }
46618
+ return undefined;
46619
+ }
46602
46620
  findFieldNames(tree) {
46603
46621
  var _a, _b;
46604
46622
  let expr = tree.findFirstExpression(expressions_1.CDSSelect);
@@ -51992,8 +52010,11 @@ class View extends _abstract_object_1.AbstractObject {
51992
52010
  return new Types.StructureType(components, this.getName());
51993
52011
  }
51994
52012
  getDescription() {
51995
- // todo
51996
- return undefined;
52013
+ var _a;
52014
+ if (this.parsedData === undefined) {
52015
+ this.parseXML();
52016
+ }
52017
+ return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.header.DDTEXT;
51997
52018
  }
51998
52019
  ///////////////
51999
52020
  parseXML() {
@@ -52001,6 +52022,7 @@ class View extends _abstract_object_1.AbstractObject {
52001
52022
  this.parsedData = {
52002
52023
  header: {
52003
52024
  VIEWCLASS: "",
52025
+ DDTEXT: "",
52004
52026
  },
52005
52027
  fields: [],
52006
52028
  join: [],
@@ -52012,6 +52034,7 @@ class View extends _abstract_object_1.AbstractObject {
52012
52034
  const header = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.DD25V;
52013
52035
  this.parsedData.header = {
52014
52036
  VIEWCLASS: (header === null || header === void 0 ? void 0 : header.VIEWCLASS) || "",
52037
+ DDTEXT: (header === null || header === void 0 ? void 0 : header.DDTEXT) || "",
52015
52038
  };
52016
52039
  const fields = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.DD27P_TABLE;
52017
52040
  for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD27P)) {
@@ -52757,7 +52780,7 @@ class Registry {
52757
52780
  }
52758
52781
  static abaplintVersion() {
52759
52782
  // magic, see build script "version.sh"
52760
- return "2.113.21";
52783
+ return "2.113.23";
52761
52784
  }
52762
52785
  getDDICReferences() {
52763
52786
  return this.ddicReferences;
@@ -53076,10 +53099,10 @@ class SevenBitAscii {
53076
53099
  key: "7bit_ascii",
53077
53100
  title: "Check for 7bit ascii",
53078
53101
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53079
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53080
-
53081
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53082
-
53102
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53103
+
53104
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53105
+
53083
53106
  Checkes files with extensions ".abap" and ".asddls"`,
53084
53107
  tags: [_irule_1.RuleTag.SingleFile],
53085
53108
  badExample: `WRITE '뽑'.`,
@@ -53285,10 +53308,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53285
53308
  key: "abapdoc",
53286
53309
  title: "Check abapdoc",
53287
53310
  shortDescription: `Various checks regarding abapdoc.`,
53288
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53289
-
53290
- Plus class and interface definitions.
53291
-
53311
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53312
+
53313
+ Plus class and interface definitions.
53314
+
53292
53315
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53293
53316
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53294
53317
  };
@@ -53425,27 +53448,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53425
53448
  title: "Add test attributes for tests classes with test methods",
53426
53449
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53427
53450
  tags: [_irule_1.RuleTag.SingleFile],
53428
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53429
- PUBLIC SECTION.
53430
- PROTECTED SECTION.
53431
- PRIVATE SECTION.
53432
- METHODS test FOR TESTING RAISING cx_static_check.
53433
- ENDCLASS.
53434
-
53435
- CLASS ltcl_test1 IMPLEMENTATION.
53436
- METHOD test.
53437
- ENDMETHOD.
53451
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53452
+ PUBLIC SECTION.
53453
+ PROTECTED SECTION.
53454
+ PRIVATE SECTION.
53455
+ METHODS test FOR TESTING RAISING cx_static_check.
53456
+ ENDCLASS.
53457
+
53458
+ CLASS ltcl_test1 IMPLEMENTATION.
53459
+ METHOD test.
53460
+ ENDMETHOD.
53438
53461
  ENDCLASS.`,
53439
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53440
- PUBLIC SECTION.
53441
- PROTECTED SECTION.
53442
- PRIVATE SECTION.
53443
- METHODS test FOR TESTING RAISING cx_static_check.
53444
- ENDCLASS.
53445
-
53446
- CLASS ltcl_test2 IMPLEMENTATION.
53447
- METHOD test.
53448
- ENDMETHOD.
53462
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53463
+ PUBLIC SECTION.
53464
+ PROTECTED SECTION.
53465
+ PRIVATE SECTION.
53466
+ METHODS test FOR TESTING RAISING cx_static_check.
53467
+ ENDCLASS.
53468
+
53469
+ CLASS ltcl_test2 IMPLEMENTATION.
53470
+ METHOD test.
53471
+ ENDMETHOD.
53449
53472
  ENDCLASS.`,
53450
53473
  };
53451
53474
  }
@@ -53531,49 +53554,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53531
53554
  key: "align_parameters",
53532
53555
  title: "Align Parameters",
53533
53556
  shortDescription: `Checks for vertially aligned parameters`,
53534
- extendedInformation: `Checks:
53535
- * function module calls
53536
- * method calls
53537
- * VALUE constructors
53538
- * NEW constructors
53539
- * RAISE EXCEPTION statements
53540
- * CREATE OBJECT statements
53541
- * RAISE EVENT statements
53542
-
53543
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53544
-
53545
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53546
-
53547
- If parameters are on the same row, no issues are reported, see
53557
+ extendedInformation: `Checks:
53558
+ * function module calls
53559
+ * method calls
53560
+ * VALUE constructors
53561
+ * NEW constructors
53562
+ * RAISE EXCEPTION statements
53563
+ * CREATE OBJECT statements
53564
+ * RAISE EVENT statements
53565
+
53566
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53567
+
53568
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53569
+
53570
+ If parameters are on the same row, no issues are reported, see
53548
53571
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53549
53572
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53550
- badExample: `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
53573
+ badExample: `CALL FUNCTION 'FOOBAR'
53574
+ EXPORTING
53575
+ foo = 2
53576
+ parameter = 3.
53577
+
53578
+ foobar( moo = 1
53579
+ param = 1 ).
53580
+
53581
+ foo = VALUE #(
53582
+ foo = bar
53560
53583
  moo = 2 ).`,
53561
- goodExample: `CALL FUNCTION 'FOOBAR'
53562
- EXPORTING
53563
- foo = 2
53564
- parameter = 3.
53565
-
53566
- foobar( moo = 1
53567
- param = 1 ).
53568
-
53569
- foo = VALUE #(
53570
- foo = bar
53571
- moo = 2 ).
53572
-
53573
- DATA(sdf) = VALUE type(
53574
- common_val = 2
53575
- another_common = 5
53576
- ( row_value = 4
53584
+ goodExample: `CALL FUNCTION 'FOOBAR'
53585
+ EXPORTING
53586
+ foo = 2
53587
+ parameter = 3.
53588
+
53589
+ foobar( moo = 1
53590
+ param = 1 ).
53591
+
53592
+ foo = VALUE #(
53593
+ foo = bar
53594
+ moo = 2 ).
53595
+
53596
+ DATA(sdf) = VALUE type(
53597
+ common_val = 2
53598
+ another_common = 5
53599
+ ( row_value = 4
53577
53600
  value_foo = 5 ) ).`,
53578
53601
  };
53579
53602
  }
@@ -54007,37 +54030,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
54007
54030
  key: "align_type_expressions",
54008
54031
  title: "Align TYPE expressions",
54009
54032
  shortDescription: `Align TYPE expressions in statements`,
54010
- extendedInformation: `
54011
- Currently works for METHODS + BEGIN OF
54012
-
54013
- If BEGIN OF has an INCLUDE TYPE its ignored
54014
-
54015
- Also note that clean ABAP does not recommend aligning TYPE clauses:
54033
+ extendedInformation: `
54034
+ Currently works for METHODS + BEGIN OF
54035
+
54036
+ If BEGIN OF has an INCLUDE TYPE its ignored
54037
+
54038
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54016
54039
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54017
54040
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
54018
- badExample: `
54019
- TYPES: BEGIN OF foo,
54020
- bar TYPE i,
54021
- foobar TYPE i,
54022
- END OF foo.
54023
-
54024
- INTERFACE lif.
54025
- METHODS bar
54026
- IMPORTING
54027
- foo TYPE i
54028
- foobar TYPE i.
54041
+ badExample: `
54042
+ TYPES: BEGIN OF foo,
54043
+ bar TYPE i,
54044
+ foobar TYPE i,
54045
+ END OF foo.
54046
+
54047
+ INTERFACE lif.
54048
+ METHODS bar
54049
+ IMPORTING
54050
+ foo TYPE i
54051
+ foobar TYPE i.
54029
54052
  ENDINTERFACE.`,
54030
- goodExample: `
54031
- TYPES: BEGIN OF foo,
54032
- bar TYPE i,
54033
- foobar TYPE i,
54034
- END OF foo.
54035
-
54036
- INTERFACE lif.
54037
- METHODS bar
54038
- IMPORTING
54039
- foo TYPE i
54040
- foobar TYPE i.
54053
+ goodExample: `
54054
+ TYPES: BEGIN OF foo,
54055
+ bar TYPE i,
54056
+ foobar TYPE i,
54057
+ END OF foo.
54058
+
54059
+ INTERFACE lif.
54060
+ METHODS bar
54061
+ IMPORTING
54062
+ foo TYPE i
54063
+ foobar TYPE i.
54041
54064
  ENDINTERFACE.`,
54042
54065
  };
54043
54066
  }
@@ -54316,16 +54339,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54316
54339
  return {
54317
54340
  key: "ambiguous_statement",
54318
54341
  title: "Check for ambigious statements",
54319
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54320
- Add "TABLE" keyword or "@" for escaping SQL variables
54321
-
54342
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54343
+ Add "TABLE" keyword or "@" for escaping SQL variables
54344
+
54322
54345
  Only works if the target version is 740sp05 or above`,
54323
54346
  tags: [_irule_1.RuleTag.SingleFile],
54324
- badExample: `DELETE foo FROM bar.
54347
+ badExample: `DELETE foo FROM bar.
54325
54348
  MODIFY foo FROM bar.`,
54326
- goodExample: `DELETE foo FROM @bar.
54327
- DELETE TABLE itab FROM 2.
54328
- MODIFY zfoo FROM @wa.
54349
+ goodExample: `DELETE foo FROM @bar.
54350
+ DELETE TABLE itab FROM 2.
54351
+ MODIFY zfoo FROM @wa.
54329
54352
  MODIFY TABLE foo FROM bar.`,
54330
54353
  };
54331
54354
  }
@@ -54430,16 +54453,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54430
54453
  key: "avoid_use",
54431
54454
  title: "Avoid use of certain statements",
54432
54455
  shortDescription: `Detects usage of certain statements.`,
54433
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54434
-
54435
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54436
-
54437
- STATICS: use CLASS-DATA instead
54438
-
54439
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54440
-
54441
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54442
-
54456
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54457
+
54458
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54459
+
54460
+ STATICS: use CLASS-DATA instead
54461
+
54462
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54463
+
54464
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54465
+
54443
54466
  BREAK points`,
54444
54467
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54445
54468
  };
@@ -54571,11 +54594,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54571
54594
  title: "Check BEGIN END names",
54572
54595
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54573
54596
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54574
- badExample: `DATA: BEGIN OF stru,
54575
- field TYPE i,
54597
+ badExample: `DATA: BEGIN OF stru,
54598
+ field TYPE i,
54576
54599
  END OF structure_not_the_same.`,
54577
- goodExample: `DATA: BEGIN OF stru,
54578
- field TYPE i,
54600
+ goodExample: `DATA: BEGIN OF stru,
54601
+ field TYPE i,
54579
54602
  END OF stru.`,
54580
54603
  };
54581
54604
  }
@@ -54672,20 +54695,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54672
54695
  title: "BEGIN contains single INCLUDE",
54673
54696
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54674
54697
  tags: [_irule_1.RuleTag.SingleFile],
54675
- badExample: `TYPES: BEGIN OF dummy1.
54676
- INCLUDE TYPE dselc.
54677
- TYPES: END OF dummy1.
54678
-
54679
- DATA BEGIN OF foo.
54680
- INCLUDE STRUCTURE syst.
54681
- DATA END OF foo.
54682
-
54683
- STATICS BEGIN OF bar.
54684
- INCLUDE STRUCTURE syst.
54698
+ badExample: `TYPES: BEGIN OF dummy1.
54699
+ INCLUDE TYPE dselc.
54700
+ TYPES: END OF dummy1.
54701
+
54702
+ DATA BEGIN OF foo.
54703
+ INCLUDE STRUCTURE syst.
54704
+ DATA END OF foo.
54705
+
54706
+ STATICS BEGIN OF bar.
54707
+ INCLUDE STRUCTURE syst.
54685
54708
  STATICS END OF bar.`,
54686
- goodExample: `DATA BEGIN OF foo.
54687
- DATA field TYPE i.
54688
- INCLUDE STRUCTURE dselc.
54709
+ goodExample: `DATA BEGIN OF foo.
54710
+ DATA field TYPE i.
54711
+ INCLUDE STRUCTURE dselc.
54689
54712
  DATA END OF foo.`,
54690
54713
  };
54691
54714
  }
@@ -54775,9 +54798,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54775
54798
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54776
54799
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54777
54800
  badExample: `CALL TRANSACTION 'FOO'.`,
54778
- goodExample: `TRY.
54779
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54780
- CATCH cx_sy_authorization_error.
54801
+ goodExample: `TRY.
54802
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54803
+ CATCH cx_sy_authorization_error.
54781
54804
  ENDTRY.`,
54782
54805
  };
54783
54806
  }
@@ -54842,10 +54865,10 @@ class CDSCommentStyle {
54842
54865
  key: "cds_comment_style",
54843
54866
  title: "CDS Comment Style",
54844
54867
  shortDescription: `Check for obsolete comment style`,
54845
- extendedInformation: `Check for obsolete comment style
54846
-
54847
- Comments starting with "--" are considered obsolete
54848
-
54868
+ extendedInformation: `Check for obsolete comment style
54869
+
54870
+ Comments starting with "--" are considered obsolete
54871
+
54849
54872
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54850
54873
  tags: [_irule_1.RuleTag.SingleFile],
54851
54874
  badExample: "-- this is a comment",
@@ -54911,10 +54934,10 @@ class CDSLegacyView {
54911
54934
  key: "cds_legacy_view",
54912
54935
  title: "CDS Legacy View",
54913
54936
  shortDescription: `Identify CDS Legacy Views`,
54914
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54915
-
54916
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54917
-
54937
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54938
+
54939
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54940
+
54918
54941
  v755 and up`,
54919
54942
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54920
54943
  };
@@ -55069,10 +55092,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55069
55092
  key: "chain_mainly_declarations",
55070
55093
  title: "Chain mainly declarations",
55071
55094
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55072
- extendedInformation: `
55073
- https://docs.abapopenchecks.org/checks/23/
55074
-
55075
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55095
+ extendedInformation: `
55096
+ https://docs.abapopenchecks.org/checks/23/
55097
+
55098
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55076
55099
  `,
55077
55100
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55078
55101
  badExample: `CALL METHOD: bar.`,
@@ -55248,17 +55271,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55248
55271
  title: "Change IF to CASE",
55249
55272
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55250
55273
  // eslint-disable-next-line max-len
55251
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55252
-
55274
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55275
+
55253
55276
  If the first comparison is a boolean compare, no issue is reported.`,
55254
55277
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55255
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55256
- ELSEIF l_fcat-fieldname = 'BAR'
55257
- OR l_fcat-fieldname = 'MOO'.
55278
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55279
+ ELSEIF l_fcat-fieldname = 'BAR'
55280
+ OR l_fcat-fieldname = 'MOO'.
55258
55281
  ENDIF.`,
55259
- goodExample: `CASE l_fcat-fieldname.
55260
- WHEN 'FOO'.
55261
- WHEN 'BAR' OR 'MOO'.
55282
+ goodExample: `CASE l_fcat-fieldname.
55283
+ WHEN 'FOO'.
55284
+ WHEN 'BAR' OR 'MOO'.
55262
55285
  ENDCASE.`,
55263
55286
  };
55264
55287
  }
@@ -55395,8 +55418,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55395
55418
  return {
55396
55419
  key: "check_abstract",
55397
55420
  title: "Check abstract methods and classes",
55398
- shortDescription: `Checks abstract methods and classes:
55399
- - class defined as abstract and final,
55421
+ shortDescription: `Checks abstract methods and classes:
55422
+ - class defined as abstract and final,
55400
55423
  - non-abstract class contains abstract methods`,
55401
55424
  extendedInformation: `If a class defines only constants, use an interface instead`,
55402
55425
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55477,11 +55500,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55477
55500
  return {
55478
55501
  key: "check_comments",
55479
55502
  title: "Check Comments",
55480
- shortDescription: `
55503
+ shortDescription: `
55481
55504
  Various checks for comment usage.`,
55482
- extendedInformation: `
55483
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55484
-
55505
+ extendedInformation: `
55506
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55507
+
55485
55508
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55486
55509
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55487
55510
  badExample: `WRITE 2. " descriptive comment`,
@@ -55643,9 +55666,9 @@ class CheckInclude {
55643
55666
  key: "check_include",
55644
55667
  title: "Check INCLUDEs",
55645
55668
  shortDescription: `Checks INCLUDE statements`,
55646
- extendedInformation: `
55647
- * Reports unused includes
55648
- * Errors if the includes are not found
55669
+ extendedInformation: `
55670
+ * Reports unused includes
55671
+ * Errors if the includes are not found
55649
55672
  * Error if including a main program`,
55650
55673
  tags: [_irule_1.RuleTag.Syntax],
55651
55674
  };
@@ -55721,14 +55744,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55721
55744
  key: "check_subrc",
55722
55745
  title: "Check sy-subrc",
55723
55746
  shortDescription: `Check sy-subrc`,
55724
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55725
-
55726
- If sy-dbcnt is checked after database statements, it is considered okay.
55727
-
55728
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55729
-
55730
- If IS ASSIGNED is checked after assigning, it is considered okay.
55731
-
55747
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55748
+
55749
+ If sy-dbcnt is checked after database statements, it is considered okay.
55750
+
55751
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55752
+
55753
+ If IS ASSIGNED is checked after assigning, it is considered okay.
55754
+
55732
55755
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55733
55756
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55734
55757
  pseudoComment: "EC CI_SUBRC",
@@ -56298,17 +56321,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56298
56321
  shortDescription: `Find overlapping classic exceptions`,
56299
56322
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56300
56323
  tags: [_irule_1.RuleTag.SingleFile],
56301
- badExample: `CALL FUNCTION 'SOMETHING'
56302
- EXCEPTIONS
56303
- system_failure = 1 MESSAGE lv_message
56304
- communication_failure = 1 MESSAGE lv_message
56305
- resource_failure = 1
56324
+ badExample: `CALL FUNCTION 'SOMETHING'
56325
+ EXCEPTIONS
56326
+ system_failure = 1 MESSAGE lv_message
56327
+ communication_failure = 1 MESSAGE lv_message
56328
+ resource_failure = 1
56306
56329
  OTHERS = 1.`,
56307
- goodExample: `CALL FUNCTION 'SOMETHING'
56308
- EXCEPTIONS
56309
- system_failure = 1 MESSAGE lv_message
56310
- communication_failure = 2 MESSAGE lv_message
56311
- resource_failure = 3
56330
+ goodExample: `CALL FUNCTION 'SOMETHING'
56331
+ EXCEPTIONS
56332
+ system_failure = 1 MESSAGE lv_message
56333
+ communication_failure = 2 MESSAGE lv_message
56334
+ resource_failure = 3
56312
56335
  OTHERS = 4.`,
56313
56336
  };
56314
56337
  }
@@ -56554,7 +56577,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56554
56577
  key: "commented_code",
56555
56578
  title: "Find commented code",
56556
56579
  shortDescription: `Detects usage of commented out code.`,
56557
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56580
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56558
56581
  https://docs.abapopenchecks.org/checks/14/`,
56559
56582
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56560
56583
  badExample: `* WRITE 'hello world'.`,
@@ -56787,10 +56810,10 @@ class ConstructorVisibilityPublic {
56787
56810
  key: "constructor_visibility_public",
56788
56811
  title: "Check constructor visibility is public",
56789
56812
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
56790
- extendedInformation: `
56791
- This only applies to global classes.
56792
-
56793
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56813
+ extendedInformation: `
56814
+ This only applies to global classes.
56815
+
56816
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56794
56817
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56795
56818
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56796
56819
  };
@@ -56865,8 +56888,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56865
56888
  key: "contains_tab",
56866
56889
  title: "Code contains tab",
56867
56890
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56868
- extendedInformation: `
56869
- https://docs.abapopenchecks.org/checks/09/
56891
+ extendedInformation: `
56892
+ https://docs.abapopenchecks.org/checks/09/
56870
56893
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56871
56894
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56872
56895
  badExample: `\tWRITE 'hello world'.`,
@@ -56953,10 +56976,10 @@ class CyclicOO {
56953
56976
  key: "cyclic_oo",
56954
56977
  title: "Cyclic OO",
56955
56978
  shortDescription: `Finds cyclic/circular OO references`,
56956
- extendedInformation: `Runs for global INTF + CLAS objects
56957
-
56958
- Objects must be without syntax errors for this rule to take effect
56959
-
56979
+ extendedInformation: `Runs for global INTF + CLAS objects
56980
+
56981
+ Objects must be without syntax errors for this rule to take effect
56982
+
56960
56983
  References in testclass includes are ignored`,
56961
56984
  };
56962
56985
  }
@@ -57199,7 +57222,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57199
57222
  key: "dangerous_statement",
57200
57223
  title: "Dangerous statement",
57201
57224
  shortDescription: `Detects potentially dangerous statements`,
57202
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57225
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57203
57226
  dynamic SQL can potentially create SQL injection problems`,
57204
57227
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57205
57228
  };
@@ -57406,13 +57429,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57406
57429
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57407
57430
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57408
57431
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57409
- badExample: `FROM foo.
57410
- WRITE 'hello'.
57411
- DATA int TYPE i.
57432
+ badExample: `FROM foo.
57433
+ WRITE 'hello'.
57434
+ DATA int TYPE i.
57412
57435
  ENDFORM.`,
57413
- goodExample: `FROM foo.
57414
- DATA int TYPE i.
57415
- WRITE 'hello'.
57436
+ goodExample: `FROM foo.
57437
+ DATA int TYPE i.
57438
+ WRITE 'hello'.
57416
57439
  ENDFORM.`,
57417
57440
  };
57418
57441
  }
@@ -57951,39 +57974,39 @@ class Downport {
57951
57974
  key: "downport",
57952
57975
  title: "Downport statement",
57953
57976
  shortDescription: `Downport functionality`,
57954
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57955
- a higher level language version. If successful, various rules are applied to downport the statement.
57956
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57957
-
57958
- Current rules:
57959
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57960
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57961
- * FIELD-SYMBOL() definitions are outlined
57962
- * CONV is outlined
57963
- * COND is outlined
57964
- * REDUCE is outlined
57965
- * SWITCH is outlined
57966
- * FILTER is outlined
57967
- * APPEND expression is outlined
57968
- * INSERT expression is outlined
57969
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57970
- * CAST changed to ?=
57971
- * LOOP AT method_call( ) is outlined
57972
- * VALUE # with structure fields
57973
- * VALUE # with internal table lines
57974
- * Table Expressions are outlined
57975
- * SELECT INTO @DATA definitions are outlined
57976
- * Some occurrences of string template formatting option ALPHA changed to function module call
57977
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57978
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57979
- * RAISE EXCEPTION ... MESSAGE
57980
- * Moving with +=, -=, /=, *=, &&= is expanded
57981
- * line_exists and line_index is downported to READ TABLE
57982
- * ENUMs, but does not nessesarily give the correct type and value
57983
- * MESSAGE with non simple source
57984
-
57985
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57986
-
57977
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57978
+ a higher level language version. If successful, various rules are applied to downport the statement.
57979
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
57980
+
57981
+ Current rules:
57982
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57983
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57984
+ * FIELD-SYMBOL() definitions are outlined
57985
+ * CONV is outlined
57986
+ * COND is outlined
57987
+ * REDUCE is outlined
57988
+ * SWITCH is outlined
57989
+ * FILTER is outlined
57990
+ * APPEND expression is outlined
57991
+ * INSERT expression is outlined
57992
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57993
+ * CAST changed to ?=
57994
+ * LOOP AT method_call( ) is outlined
57995
+ * VALUE # with structure fields
57996
+ * VALUE # with internal table lines
57997
+ * Table Expressions are outlined
57998
+ * SELECT INTO @DATA definitions are outlined
57999
+ * Some occurrences of string template formatting option ALPHA changed to function module call
58000
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58001
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58002
+ * RAISE EXCEPTION ... MESSAGE
58003
+ * Moving with +=, -=, /=, *=, &&= is expanded
58004
+ * line_exists and line_index is downported to READ TABLE
58005
+ * ENUMs, but does not nessesarily give the correct type and value
58006
+ * MESSAGE with non simple source
58007
+
58008
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58009
+
57987
58010
  Make sure to test the downported code, it might not always be completely correct.`,
57988
58011
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57989
58012
  };
@@ -58561,10 +58584,10 @@ Make sure to test the downported code, it might not always be completely correct
58561
58584
  const fieldName = f.concatTokens();
58562
58585
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58563
58586
  }
58564
- fieldDefinition = `DATA: BEGIN OF ${name},
58587
+ fieldDefinition = `DATA: BEGIN OF ${name},
58565
58588
  ${fieldDefinition}${indentation} END OF ${name}.`;
58566
58589
  }
58567
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58590
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58568
58591
  ${indentation}`);
58569
58592
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58570
58593
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58623,12 +58646,12 @@ ${indentation}`);
58623
58646
  }
58624
58647
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58625
58648
  const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
58626
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58627
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58628
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58649
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58650
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58651
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58629
58652
  ${indentation}`);
58630
58653
  if (fieldDefinitions === "") {
58631
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58654
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58632
58655
  ${indentation}`);
58633
58656
  }
58634
58657
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58696,7 +58719,7 @@ ${indentation}`);
58696
58719
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58697
58720
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58698
58721
  const firstToken = high.getFirstToken();
58699
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58722
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58700
58723
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58701
58724
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58702
58725
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58750,7 +58773,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58750
58773
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58751
58774
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58752
58775
  const firstToken = high.getFirstToken();
58753
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58776
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58754
58777
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58755
58778
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58756
58779
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58792,14 +58815,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58792
58815
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58793
58816
  const firstToken = high.getFirstToken();
58794
58817
  // note that the tabix restore should be done before throwing the exception
58795
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58796
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58797
- ${indentation}${tabixBackup} = sy-tabix.
58798
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58799
- ${indentation}sy-tabix = ${tabixBackup}.
58800
- ${indentation}IF sy-subrc <> 0.
58801
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58802
- ${indentation}ENDIF.
58818
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58819
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58820
+ ${indentation}${tabixBackup} = sy-tabix.
58821
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58822
+ ${indentation}sy-tabix = ${tabixBackup}.
58823
+ ${indentation}IF sy-subrc <> 0.
58824
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58825
+ ${indentation}ENDIF.
58803
58826
  ${indentation}`);
58804
58827
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58805
58828
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58856,7 +58879,7 @@ ${indentation}`);
58856
58879
  const className = classNames[0].concatTokens();
58857
58880
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58858
58881
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58859
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58882
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58860
58883
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58861
58884
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58862
58885
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -59018,16 +59041,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
59018
59041
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59019
59042
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59020
59043
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59021
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59022
- ${indentation}${uniqueName1}-msgid = ${id}.
59044
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59045
+ ${indentation}${uniqueName1}-msgid = ${id}.
59023
59046
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59024
59047
  if (withs.length > 0) {
59025
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59026
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59027
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59048
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59049
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59050
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59028
59051
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59029
59052
  }
59030
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59053
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59031
59054
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59032
59055
  if (withs.length > 0) {
59033
59056
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59139,10 +59162,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59139
59162
  let code = "";
59140
59163
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59141
59164
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59142
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59143
- IF sy-subrc <> 0.
59144
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59145
- ENDIF.
59165
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59166
+ IF sy-subrc <> 0.
59167
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59168
+ ENDIF.
59146
59169
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59147
59170
  }
59148
59171
  else {
@@ -59231,20 +59254,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59231
59254
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59232
59255
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59233
59256
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59234
- code += ` items LIKE ${loopSourceName},
59235
- END OF ${groupTargetName}type.
59236
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59237
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59257
+ code += ` items LIKE ${loopSourceName},
59258
+ END OF ${groupTargetName}type.
59259
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59260
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59238
59261
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59239
59262
  if (groupIndexName !== undefined) {
59240
59263
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59241
59264
  }
59242
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59265
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59243
59266
  IF sy-subrc = 0.\n`;
59244
59267
  if (groupCountName !== undefined) {
59245
59268
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59246
59269
  }
59247
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59270
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59248
59271
  ELSE.\n`;
59249
59272
  code += ` CLEAR ${uniqueName}.\n`;
59250
59273
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59265,8 +59288,8 @@ ELSE.\n`;
59265
59288
  }
59266
59289
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59267
59290
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59268
- code += `ENDIF.
59269
- ENDLOOP.
59291
+ code += `ENDIF.
59292
+ ENDLOOP.
59270
59293
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59271
59294
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59272
59295
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59438,7 +59461,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59438
59461
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59439
59462
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59440
59463
  // all ENUMS are char like?
59441
- let code = `TYPES ${enumName} TYPE string.
59464
+ let code = `TYPES ${enumName} TYPE string.
59442
59465
  CONSTANTS: BEGIN OF ${structureName},\n`;
59443
59466
  let count = 1;
59444
59467
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59482,14 +59505,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59482
59505
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59483
59506
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59484
59507
  // restore tabix before exeption
59485
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59486
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59487
- ${indentation}${tabixBackup} = sy-tabix.
59488
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59489
- ${indentation}sy-tabix = ${tabixBackup}.
59490
- ${indentation}IF sy-subrc <> 0.
59491
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59492
- ${indentation}ENDIF.
59508
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59509
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59510
+ ${indentation}${tabixBackup} = sy-tabix.
59511
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59512
+ ${indentation}sy-tabix = ${tabixBackup}.
59513
+ ${indentation}IF sy-subrc <> 0.
59514
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59515
+ ${indentation}ENDIF.
59493
59516
  ${indentation}${uniqueName}`;
59494
59517
  const start = target.getFirstToken().getStart();
59495
59518
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59573,11 +59596,11 @@ ${indentation}${uniqueName}`;
59573
59596
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59574
59597
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59575
59598
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59576
- const code = `DATA ${uniqueName} TYPE string.
59577
- ${indentation}CALL FUNCTION '${functionName}'
59578
- ${indentation} EXPORTING
59579
- ${indentation} input = ${source}
59580
- ${indentation} IMPORTING
59599
+ const code = `DATA ${uniqueName} TYPE string.
59600
+ ${indentation}CALL FUNCTION '${functionName}'
59601
+ ${indentation} EXPORTING
59602
+ ${indentation} input = ${source}
59603
+ ${indentation} IMPORTING
59581
59604
  ${indentation} output = ${uniqueName}.\n`;
59582
59605
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59583
59606
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60889,12 +60912,12 @@ class EasyToFindMessages {
60889
60912
  key: "easy_to_find_messages",
60890
60913
  title: "Easy to find messages",
60891
60914
  shortDescription: `Make messages easy to find`,
60892
- extendedInformation: `All messages must be statically referenced exactly once
60893
-
60894
- Only MESSAGE and RAISE statments are counted as static references
60895
-
60896
- Also see rule "message_exists"
60897
-
60915
+ extendedInformation: `All messages must be statically referenced exactly once
60916
+
60917
+ Only MESSAGE and RAISE statments are counted as static references
60918
+
60919
+ Also see rule "message_exists"
60920
+
60898
60921
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60899
60922
  tags: [_irule_1.RuleTag.Styleguide],
60900
60923
  };
@@ -60975,13 +60998,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
60975
60998
  shortDescription: `Empty selection screen or list processing event block`,
60976
60999
  extendedInformation: ``,
60977
61000
  tags: [_irule_1.RuleTag.SingleFile],
60978
- badExample: `
60979
- INITIALIZATION.
60980
- WRITE 'hello'.
61001
+ badExample: `
61002
+ INITIALIZATION.
61003
+ WRITE 'hello'.
60981
61004
  END-OF-SELECTION.`,
60982
- goodExample: `
60983
- START-OF-SELECTION.
60984
- PERFORM sdf.
61005
+ goodExample: `
61006
+ START-OF-SELECTION.
61007
+ PERFORM sdf.
60985
61008
  COMMIT WORK.`,
60986
61009
  };
60987
61010
  }
@@ -61073,8 +61096,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61073
61096
  key: "empty_line_in_statement",
61074
61097
  title: "Find empty lines in statements",
61075
61098
  shortDescription: `Checks that statements do not contain empty lines.`,
61076
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61077
-
61099
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61100
+
61078
61101
  https://docs.abapopenchecks.org/checks/41/`,
61079
61102
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61080
61103
  badExample: `WRITE\n\nhello.`,
@@ -61250,13 +61273,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61250
61273
  shortDescription: `Checks that the code does not contain empty blocks.`,
61251
61274
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61252
61275
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61253
- badExample: `IF foo = bar.
61254
- ENDIF.
61255
-
61256
- DO 2 TIMES.
61276
+ badExample: `IF foo = bar.
61277
+ ENDIF.
61278
+
61279
+ DO 2 TIMES.
61257
61280
  ENDDO.`,
61258
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61259
- ENDLOOP.
61281
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61282
+ ENDLOOP.
61260
61283
  result = xsdbool( sy-subrc = 0 ).`,
61261
61284
  };
61262
61285
  }
@@ -61398,10 +61421,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61398
61421
  return {
61399
61422
  key: "exit_or_check",
61400
61423
  title: "Find EXIT or CHECK outside loops",
61401
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61424
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61402
61425
  Use RETURN to leave procesing blocks instead.`,
61403
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61404
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61426
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61427
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61405
61428
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61406
61429
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61407
61430
  };
@@ -61484,12 +61507,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61484
61507
  key: "expand_macros",
61485
61508
  title: "Expand Macros",
61486
61509
  shortDescription: `Allows expanding macro calls with quick fixes`,
61487
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61488
-
61510
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61511
+
61489
61512
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61490
- badExample: `DEFINE _hello.
61491
- WRITE 'hello'.
61492
- END-OF-DEFINITION.
61513
+ badExample: `DEFINE _hello.
61514
+ WRITE 'hello'.
61515
+ END-OF-DEFINITION.
61493
61516
  _hello.`,
61494
61517
  goodExample: `WRITE 'hello'.`,
61495
61518
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61576,7 +61599,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61576
61599
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61577
61600
  badExample: `call_method( EXPORTING foo = bar ).`,
61578
61601
  goodExample: `call_method( foo = bar ).`,
61579
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61602
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61580
61603
  https://docs.abapopenchecks.org/checks/30/`,
61581
61604
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61582
61605
  };
@@ -61674,7 +61697,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61674
61697
  key: "forbidden_identifier",
61675
61698
  title: "Forbidden Identifier",
61676
61699
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61677
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61700
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61678
61701
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61679
61702
  tags: [_irule_1.RuleTag.SingleFile],
61680
61703
  };
@@ -61916,8 +61939,8 @@ class ForbiddenVoidType {
61916
61939
  key: "forbidden_void_type",
61917
61940
  title: "Forbidden Void Types",
61918
61941
  shortDescription: `Avoid usage of specified void types.`,
61919
- extendedInformation: `Inspiration:
61920
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61942
+ extendedInformation: `Inspiration:
61943
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61921
61944
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61922
61945
  };
61923
61946
  }
@@ -62160,7 +62183,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62160
62183
  key: "fully_type_itabs",
62161
62184
  title: "Fully type internal tables",
62162
62185
  shortDescription: `No implict table types or table keys`,
62163
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62186
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62187
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
62188
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62164
62189
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62165
62190
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62166
62191
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62345,26 +62370,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62345
62370
  key: "functional_writing",
62346
62371
  title: "Use functional writing",
62347
62372
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62348
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62373
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62349
62374
  https://docs.abapopenchecks.org/checks/07/`,
62350
62375
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62351
- badExample: `CALL METHOD zcl_class=>method( ).
62352
- CALL METHOD cl_abap_typedescr=>describe_by_name
62353
- EXPORTING
62354
- p_name = 'NAME'
62355
- RECEIVING
62356
- p_descr_ref = lr_typedescr
62357
- EXCEPTIONS
62358
- type_not_found = 1
62376
+ badExample: `CALL METHOD zcl_class=>method( ).
62377
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62378
+ EXPORTING
62379
+ p_name = 'NAME'
62380
+ RECEIVING
62381
+ p_descr_ref = lr_typedescr
62382
+ EXCEPTIONS
62383
+ type_not_found = 1
62359
62384
  OTHERS = 2.`,
62360
- goodExample: `zcl_class=>method( ).
62361
- cl_abap_typedescr=>describe_by_name(
62362
- EXPORTING
62363
- p_name = 'NAME'
62364
- RECEIVING
62365
- p_descr_ref = lr_typedescr
62366
- EXCEPTIONS
62367
- type_not_found = 1
62385
+ goodExample: `zcl_class=>method( ).
62386
+ cl_abap_typedescr=>describe_by_name(
62387
+ EXPORTING
62388
+ p_name = 'NAME'
62389
+ RECEIVING
62390
+ p_descr_ref = lr_typedescr
62391
+ EXCEPTIONS
62392
+ type_not_found = 1
62368
62393
  OTHERS = 2 ).`,
62369
62394
  };
62370
62395
  }
@@ -62475,14 +62500,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62475
62500
  key: "global_class",
62476
62501
  title: "Global class checks",
62477
62502
  shortDescription: `Checks related to global classes`,
62478
- extendedInformation: `* global classes must be in own files
62479
-
62480
- * file names must match class name
62481
-
62482
- * file names must match interface name
62483
-
62484
- * global classes must be global definitions
62485
-
62503
+ extendedInformation: `* global classes must be in own files
62504
+
62505
+ * file names must match class name
62506
+
62507
+ * file names must match interface name
62508
+
62509
+ * global classes must be global definitions
62510
+
62486
62511
  * global interfaces must be global definitions`,
62487
62512
  tags: [_irule_1.RuleTag.Syntax],
62488
62513
  };
@@ -62581,21 +62606,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62581
62606
  return {
62582
62607
  key: "identical_conditions",
62583
62608
  title: "Identical conditions",
62584
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62585
-
62609
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62610
+
62586
62611
  Prerequsites: code is pretty printed with identical cAsE`,
62587
62612
  tags: [_irule_1.RuleTag.SingleFile],
62588
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62589
- ENDIF.
62590
- CASE bar.
62591
- WHEN '1'.
62592
- WHEN 'A' OR '1'.
62613
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62614
+ ENDIF.
62615
+ CASE bar.
62616
+ WHEN '1'.
62617
+ WHEN 'A' OR '1'.
62593
62618
  ENDCASE.`,
62594
- goodExample: `IF foo = bar OR 1 = a.
62595
- ENDIF.
62596
- CASE bar.
62597
- WHEN '1'.
62598
- WHEN 'A'.
62619
+ goodExample: `IF foo = bar OR 1 = a.
62620
+ ENDIF.
62621
+ CASE bar.
62622
+ WHEN '1'.
62623
+ WHEN 'A'.
62599
62624
  ENDCASE.`,
62600
62625
  };
62601
62626
  }
@@ -62729,23 +62754,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62729
62754
  key: "identical_contents",
62730
62755
  title: "Identical contents",
62731
62756
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62732
- extendedInformation: `
62733
- Prerequsites: code is pretty printed with identical cAsE
62734
-
62757
+ extendedInformation: `
62758
+ Prerequsites: code is pretty printed with identical cAsE
62759
+
62735
62760
  Chained statments are ignored`,
62736
62761
  tags: [_irule_1.RuleTag.SingleFile],
62737
- badExample: `IF foo = bar.
62738
- WRITE 'bar'.
62739
- WRITE 'world'.
62740
- ELSE.
62741
- WRITE 'foo'.
62742
- WRITE 'world'.
62762
+ badExample: `IF foo = bar.
62763
+ WRITE 'bar'.
62764
+ WRITE 'world'.
62765
+ ELSE.
62766
+ WRITE 'foo'.
62767
+ WRITE 'world'.
62743
62768
  ENDIF.`,
62744
- goodExample: `IF foo = bar.
62745
- WRITE 'bar'.
62746
- ELSE.
62747
- WRITE 'foo'.
62748
- ENDIF.
62769
+ goodExample: `IF foo = bar.
62770
+ WRITE 'bar'.
62771
+ ELSE.
62772
+ WRITE 'foo'.
62773
+ ENDIF.
62749
62774
  WRITE 'world'.`,
62750
62775
  };
62751
62776
  }
@@ -62853,12 +62878,12 @@ class IdenticalDescriptions {
62853
62878
  key: "identical_descriptions",
62854
62879
  title: "Identical descriptions",
62855
62880
  shortDescription: `Searches for objects with the same type and same description`,
62856
- extendedInformation: `Case insensitive
62857
-
62858
- Only checks the master language descriptions
62859
-
62860
- Dependencies are skipped
62861
-
62881
+ extendedInformation: `Case insensitive
62882
+
62883
+ Only checks the master language descriptions
62884
+
62885
+ Dependencies are skipped
62886
+
62862
62887
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62863
62888
  tags: [],
62864
62889
  };
@@ -63032,43 +63057,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63032
63057
  key: "if_in_if",
63033
63058
  title: "IF in IF",
63034
63059
  shortDescription: `Detects nested ifs which can be refactored.`,
63035
- extendedInformation: `
63036
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
63037
-
63038
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63039
-
63040
- https://docs.abapopenchecks.org/checks/01/
63060
+ extendedInformation: `
63061
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63062
+
63063
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63064
+
63065
+ https://docs.abapopenchecks.org/checks/01/
63041
63066
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
63042
- badExample: `IF condition1.
63043
- IF condition2.
63044
- ...
63045
- ENDIF.
63046
- ENDIF.
63047
-
63048
- IF condition1.
63049
- ...
63050
- ELSE.
63051
- IF condition2.
63052
- ...
63053
- ENDIF.
63067
+ badExample: `IF condition1.
63068
+ IF condition2.
63069
+ ...
63070
+ ENDIF.
63071
+ ENDIF.
63072
+
63073
+ IF condition1.
63074
+ ...
63075
+ ELSE.
63076
+ IF condition2.
63077
+ ...
63078
+ ENDIF.
63054
63079
  ENDIF.`,
63055
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63056
- ...
63057
- ENDIF.
63058
-
63059
- IF condition1.
63060
- ...
63061
- ELSEIF condition2.
63062
- ...
63063
- ENDIF.
63064
-
63065
- CASE variable.
63066
- WHEN value1.
63067
- ...
63068
- WHEN value2.
63069
- IF condition2.
63070
- ...
63071
- ENDIF.
63080
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63081
+ ...
63082
+ ENDIF.
63083
+
63084
+ IF condition1.
63085
+ ...
63086
+ ELSEIF condition2.
63087
+ ...
63088
+ ENDIF.
63089
+
63090
+ CASE variable.
63091
+ WHEN value1.
63092
+ ...
63093
+ WHEN value2.
63094
+ IF condition2.
63095
+ ...
63096
+ ENDIF.
63072
63097
  ENDCASE.`,
63073
63098
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63074
63099
  };
@@ -63253,9 +63278,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63253
63278
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63254
63279
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63255
63280
  if (name === impl.identifier.getName().toUpperCase()) {
63256
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63257
- METHOD ${methodName.toLowerCase()}.
63258
- RETURN. " todo, implement method
63281
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63282
+ METHOD ${methodName.toLowerCase()}.
63283
+ RETURN. " todo, implement method
63259
63284
  ENDMETHOD.`);
63260
63285
  }
63261
63286
  }
@@ -63434,14 +63459,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63434
63459
  key: "implicit_start_of_selection",
63435
63460
  title: "Implicit START-OF-SELECTION",
63436
63461
  shortDescription: `Add explicit selection screen event handling`,
63437
- extendedInformation: `Only runs for executable programs
63438
-
63462
+ extendedInformation: `Only runs for executable programs
63463
+
63439
63464
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63440
63465
  tags: [_irule_1.RuleTag.SingleFile],
63441
- badExample: `REPORT zfoo.
63466
+ badExample: `REPORT zfoo.
63442
63467
  WRITE 'hello'.`,
63443
- goodExample: `
63444
- START-OF-SELECTION.
63468
+ goodExample: `
63469
+ START-OF-SELECTION.
63445
63470
  WRITE 'hello'.`,
63446
63471
  };
63447
63472
  }
@@ -63546,19 +63571,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63546
63571
  key: "in_statement_indentation",
63547
63572
  title: "In-statement indentation",
63548
63573
  shortDescription: "Checks alignment within statements which span multiple lines.",
63549
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63550
-
63551
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63574
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63575
+
63576
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63552
63577
  to distinguish them better from code within the block.`,
63553
- badExample: `IF 1 = 1
63554
- AND 2 = 2.
63555
- WRITE 'hello' &&
63556
- 'world'.
63578
+ badExample: `IF 1 = 1
63579
+ AND 2 = 2.
63580
+ WRITE 'hello' &&
63581
+ 'world'.
63557
63582
  ENDIF.`,
63558
- goodExample: `IF 1 = 1
63559
- AND 2 = 2.
63560
- WRITE 'hello' &&
63561
- 'world'.
63583
+ goodExample: `IF 1 = 1
63584
+ AND 2 = 2.
63585
+ WRITE 'hello' &&
63586
+ 'world'.
63562
63587
  ENDIF.`,
63563
63588
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63564
63589
  };
@@ -63681,23 +63706,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63681
63706
  title: "Indentation",
63682
63707
  shortDescription: `Checks indentation`,
63683
63708
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63684
- badExample: `CLASS lcl DEFINITION.
63685
- PRIVATE SECTION.
63686
- METHODS constructor.
63687
- ENDCLASS.
63688
-
63689
- CLASS lcl IMPLEMENTATION.
63690
- METHOD constructor.
63691
- ENDMETHOD.
63709
+ badExample: `CLASS lcl DEFINITION.
63710
+ PRIVATE SECTION.
63711
+ METHODS constructor.
63712
+ ENDCLASS.
63713
+
63714
+ CLASS lcl IMPLEMENTATION.
63715
+ METHOD constructor.
63716
+ ENDMETHOD.
63692
63717
  ENDCLASS.`,
63693
- goodExample: `CLASS lcl DEFINITION.
63694
- PRIVATE SECTION.
63695
- METHODS constructor.
63696
- ENDCLASS.
63697
-
63698
- CLASS lcl IMPLEMENTATION.
63699
- METHOD constructor.
63700
- ENDMETHOD.
63718
+ goodExample: `CLASS lcl DEFINITION.
63719
+ PRIVATE SECTION.
63720
+ METHODS constructor.
63721
+ ENDCLASS.
63722
+
63723
+ CLASS lcl IMPLEMENTATION.
63724
+ METHOD constructor.
63725
+ ENDMETHOD.
63701
63726
  ENDCLASS.`,
63702
63727
  };
63703
63728
  }
@@ -64098,9 +64123,9 @@ class IntfReferencingClas {
64098
64123
  key: "intf_referencing_clas",
64099
64124
  title: "INTF referencing CLAS",
64100
64125
  shortDescription: `Interface contains references to class`,
64101
- extendedInformation: `Only global interfaces are checked.
64102
- Only first level references are checked.
64103
- Exception class references are ignored.
64126
+ extendedInformation: `Only global interfaces are checked.
64127
+ Only first level references are checked.
64128
+ Exception class references are ignored.
64104
64129
  Void references are ignored.`,
64105
64130
  };
64106
64131
  }
@@ -64185,9 +64210,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64185
64210
  title: "Invalid Table Index",
64186
64211
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64187
64212
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64188
- badExample: `DATA(first) = table[ 0 ].
64213
+ badExample: `DATA(first) = table[ 0 ].
64189
64214
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64190
- goodExample: `DATA(first) = table[ 1 ].
64215
+ goodExample: `DATA(first) = table[ 1 ].
64191
64216
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64192
64217
  };
64193
64218
  }
@@ -64788,8 +64813,8 @@ class LineBreakStyle {
64788
64813
  return {
64789
64814
  key: "line_break_style",
64790
64815
  title: "Makes sure line breaks are consistent in the ABAP code",
64791
- shortDescription: `Enforces LF as newlines in ABAP files
64792
-
64816
+ shortDescription: `Enforces LF as newlines in ABAP files
64817
+
64793
64818
  abapGit does not work with CRLF`,
64794
64819
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64795
64820
  };
@@ -64858,7 +64883,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64858
64883
  key: "line_length",
64859
64884
  title: "Line length",
64860
64885
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64861
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64886
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64862
64887
  https://docs.abapopenchecks.org/checks/04/`,
64863
64888
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64864
64889
  };
@@ -64929,7 +64954,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64929
64954
  key: "line_only_punc",
64930
64955
  title: "Line containing only punctuation",
64931
64956
  shortDescription: `Detects lines containing only punctuation.`,
64932
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64957
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64933
64958
  https://docs.abapopenchecks.org/checks/16/`,
64934
64959
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64935
64960
  badExample: "zcl_class=>method(\n).",
@@ -65192,15 +65217,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65192
65217
  return {
65193
65218
  key: "local_variable_names",
65194
65219
  title: "Local variable naming conventions",
65195
- shortDescription: `
65196
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65220
+ shortDescription: `
65221
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65197
65222
  Regexes are case-insensitive.`,
65198
65223
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65199
- badExample: `FORM bar.
65200
- DATA foo.
65224
+ badExample: `FORM bar.
65225
+ DATA foo.
65201
65226
  ENDFORM.`,
65202
- goodExample: `FORM bar.
65203
- DATA lv_foo.
65227
+ goodExample: `FORM bar.
65228
+ DATA lv_foo.
65204
65229
  ENDFORM.`,
65205
65230
  };
65206
65231
  }
@@ -65352,9 +65377,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65352
65377
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65353
65378
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65354
65379
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65355
- badExample: `DEFINE something.
65380
+ badExample: `DEFINE something.
65356
65381
  END-OF-DEFINITION.`,
65357
- goodExample: `DEFINE _something.
65382
+ goodExample: `DEFINE _something.
65358
65383
  END-OF-DEFINITION.`,
65359
65384
  };
65360
65385
  }
@@ -65427,10 +65452,10 @@ class MainFileContents {
65427
65452
  key: "main_file_contents",
65428
65453
  title: "Main file contents",
65429
65454
  shortDescription: `Checks related to report declarations.`,
65430
- extendedInformation: `Does not run if the target version is Cloud
65431
-
65432
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65433
- * TYPEs must begin with "TYPE-POOL <name>."
65455
+ extendedInformation: `Does not run if the target version is Cloud
65456
+
65457
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65458
+ * TYPEs must begin with "TYPE-POOL <name>."
65434
65459
  `,
65435
65460
  };
65436
65461
  }
@@ -65546,17 +65571,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65546
65571
  title: "Too many parentheses",
65547
65572
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65548
65573
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65549
- badExample: `
65550
- IF ( destination IS INITIAL ).
65551
- ENDIF.
65552
- IF foo = boo AND ( bar = lar AND moo = loo ).
65553
- ENDIF.
65574
+ badExample: `
65575
+ IF ( destination IS INITIAL ).
65576
+ ENDIF.
65577
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65578
+ ENDIF.
65554
65579
  `,
65555
- goodExample: `
65556
- IF destination IS INITIAL.
65557
- ENDIF.
65558
- IF foo = boo AND bar = lar AND moo = loo.
65559
- ENDIF.
65580
+ goodExample: `
65581
+ IF destination IS INITIAL.
65582
+ ENDIF.
65583
+ IF foo = boo AND bar = lar AND moo = loo.
65584
+ ENDIF.
65560
65585
  `,
65561
65586
  };
65562
65587
  }
@@ -65730,14 +65755,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65730
65755
  title: "Max one method parameter definition per line",
65731
65756
  shortDescription: `Keep max one method parameter description per line`,
65732
65757
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65733
- badExample: `
65734
- METHODS apps_scope_token
65735
- IMPORTING
65758
+ badExample: `
65759
+ METHODS apps_scope_token
65760
+ IMPORTING
65736
65761
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65737
- goodExample: `
65738
- METHODS apps_scope_token
65739
- IMPORTING
65740
- body TYPE bodyapps_scope_token
65762
+ goodExample: `
65763
+ METHODS apps_scope_token
65764
+ IMPORTING
65765
+ body TYPE bodyapps_scope_token
65741
65766
  client_id TYPE str.`,
65742
65767
  };
65743
65768
  }
@@ -65802,11 +65827,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65802
65827
  key: "max_one_statement",
65803
65828
  title: "Max one statement per line",
65804
65829
  shortDescription: `Checks that each line contains only a single statement.`,
65805
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65806
-
65807
- Does not report anything for chained statements.
65808
-
65809
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65830
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65831
+
65832
+ Does not report anything for chained statements.
65833
+
65834
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65810
65835
  https://docs.abapopenchecks.org/checks/11/`,
65811
65836
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65812
65837
  badExample: `WRITE foo. WRITE bar.`,
@@ -66144,8 +66169,8 @@ class MethodLength {
66144
66169
  key: "method_length",
66145
66170
  title: "Method/Form Length",
66146
66171
  shortDescription: `Checks relating to method/form length.`,
66147
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66148
-
66172
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66173
+
66149
66174
  Abstract methods without statements are considered okay.`,
66150
66175
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66151
66176
  };
@@ -66250,20 +66275,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66250
66275
  key: "method_overwrites_builtin",
66251
66276
  title: "Method name overwrites builtin function",
66252
66277
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66253
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66254
-
66255
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66256
-
66278
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66279
+
66280
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66281
+
66257
66282
  Interface method names are ignored`,
66258
66283
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66259
- badExample: `CLASS lcl DEFINITION.
66260
- PUBLIC SECTION.
66261
- METHODS matches.
66262
- ENDCLASS.
66263
-
66264
- CLASS lcl IMPLEMENTATION.
66265
- METHOD matches.
66266
- ENDMETHOD.
66284
+ badExample: `CLASS lcl DEFINITION.
66285
+ PUBLIC SECTION.
66286
+ METHODS matches.
66287
+ ENDCLASS.
66288
+
66289
+ CLASS lcl IMPLEMENTATION.
66290
+ METHOD matches.
66291
+ ENDMETHOD.
66267
66292
  ENDCLASS.`,
66268
66293
  };
66269
66294
  }
@@ -66454,12 +66479,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66454
66479
  // eslint-disable-next-line max-len
66455
66480
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66456
66481
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66457
- badExample: `CLASS lcl DEFINITION.
66458
- PUBLIC SECTION.
66459
- METHODS
66460
- foobar
66461
- EXPORTING foo TYPE i
66462
- RETURNING VALUE(rv_string) TYPE string.
66482
+ badExample: `CLASS lcl DEFINITION.
66483
+ PUBLIC SECTION.
66484
+ METHODS
66485
+ foobar
66486
+ EXPORTING foo TYPE i
66487
+ RETURNING VALUE(rv_string) TYPE string.
66463
66488
  ENDCLASS.`,
66464
66489
  };
66465
66490
  }
@@ -66839,7 +66864,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66839
66864
  key: "nesting",
66840
66865
  title: "Check nesting depth",
66841
66866
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66842
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66867
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66843
66868
  https://docs.abapopenchecks.org/checks/74/`,
66844
66869
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66845
66870
  };
@@ -67082,7 +67107,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67082
67107
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67083
67108
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67084
67109
  badExample: `var1 = var2 = var3.`,
67085
- goodExample: `var2 = var3.
67110
+ goodExample: `var2 = var3.
67086
67111
  var1 = var2.`,
67087
67112
  };
67088
67113
  }
@@ -67141,8 +67166,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67141
67166
  key: "no_external_form_calls",
67142
67167
  title: "No external FORM calls",
67143
67168
  shortDescription: `Detect external form calls`,
67144
- badExample: `PERFORM foo IN PROGRAM bar.
67145
-
67169
+ badExample: `PERFORM foo IN PROGRAM bar.
67170
+
67146
67171
  PERFORM foo(bar).`,
67147
67172
  tags: [_irule_1.RuleTag.SingleFile],
67148
67173
  };
@@ -67203,17 +67228,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67203
67228
  key: "no_inline_in_optional_branches",
67204
67229
  title: "Don't declare inline in optional branches",
67205
67230
  shortDescription: `Don't declare inline in optional branches`,
67206
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67207
-
67208
- Considered optional branches:
67209
- * inside IF/ELSEIF/ELSE
67210
- * inside LOOP
67211
- * inside WHILE
67212
- * inside CASE/WHEN, CASE TYPE OF
67213
- * inside DO
67214
- * inside SELECT loops
67215
-
67216
- Not considered optional branches:
67231
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67232
+
67233
+ Considered optional branches:
67234
+ * inside IF/ELSEIF/ELSE
67235
+ * inside LOOP
67236
+ * inside WHILE
67237
+ * inside CASE/WHEN, CASE TYPE OF
67238
+ * inside DO
67239
+ * inside SELECT loops
67240
+
67241
+ Not considered optional branches:
67217
67242
  * TRY/CATCH/CLEANUP`,
67218
67243
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67219
67244
  };
@@ -67313,12 +67338,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67313
67338
  key: "no_prefixes",
67314
67339
  title: "No Prefixes",
67315
67340
  shortDescription: `Dont use hungarian notation`,
67316
- extendedInformation: `
67317
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67318
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67319
-
67320
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67321
-
67341
+ extendedInformation: `
67342
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67343
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67344
+
67345
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67346
+
67322
67347
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67323
67348
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67324
67349
  badExample: `DATA lv_foo TYPE i.`,
@@ -67497,7 +67522,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67497
67522
  return {
67498
67523
  key: "no_public_attributes",
67499
67524
  title: "No public attributes",
67500
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67525
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67501
67526
  Exceptions are excluded from this rule.`,
67502
67527
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67503
67528
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67598,13 +67623,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67598
67623
  key: "no_yoda_conditions",
67599
67624
  title: "No Yoda conditions",
67600
67625
  shortDescription: `Finds Yoda conditions and reports issues`,
67601
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67602
-
67626
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67627
+
67603
67628
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67604
67629
  tags: [_irule_1.RuleTag.SingleFile],
67605
- badExample: `IF 0 <> sy-subrc.
67630
+ badExample: `IF 0 <> sy-subrc.
67606
67631
  ENDIF.`,
67607
- goodExample: `IF sy-subrc <> 0.
67632
+ goodExample: `IF sy-subrc <> 0.
67608
67633
  ENDIF.`,
67609
67634
  };
67610
67635
  }
@@ -67705,8 +67730,8 @@ class NROBConsistency {
67705
67730
  key: "nrob_consistency",
67706
67731
  title: "Number range consistency",
67707
67732
  shortDescription: `Consistency checks for number ranges`,
67708
- extendedInformation: `Issue reported if percentage warning is over 50%
67709
-
67733
+ extendedInformation: `Issue reported if percentage warning is over 50%
67734
+
67710
67735
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67711
67736
  tags: [_irule_1.RuleTag.SingleFile],
67712
67737
  };
@@ -67983,58 +68008,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67983
68008
  title: "Obsolete statements",
67984
68009
  shortDescription: `Checks for usages of certain obsolete statements`,
67985
68010
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67986
- extendedInformation: `
67987
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67988
-
67989
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67990
-
67991
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67992
-
67993
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67994
-
67995
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67996
-
67997
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67998
-
67999
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68000
-
68001
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68002
-
68003
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68004
-
68005
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68006
-
68007
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68008
-
68009
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68010
-
68011
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68012
-
68013
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68014
-
68015
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68016
- SELECT COUNT(*) is considered okay
68017
-
68018
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68019
-
68020
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68021
-
68022
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68023
-
68024
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68025
-
68026
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
68027
-
68011
+ extendedInformation: `
68012
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68013
+
68014
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68015
+
68016
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68017
+
68018
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68019
+
68020
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68021
+
68022
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68023
+
68024
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68025
+
68026
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68027
+
68028
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68029
+
68030
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68031
+
68032
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68033
+
68034
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68035
+
68036
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68037
+
68038
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68039
+
68040
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68041
+ SELECT COUNT(*) is considered okay
68042
+
68043
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68044
+
68045
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68046
+
68047
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68048
+
68049
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68050
+
68051
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68052
+
68028
68053
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
68029
- badExample: `REFRESH itab.
68030
-
68031
- COMPUTE foo = 2 + 2.
68032
-
68033
- MULTIPLY lv_foo BY 2.
68034
-
68035
- INTERFACE intf LOAD.
68036
-
68037
- IF foo IS SUPPLIED.
68054
+ badExample: `REFRESH itab.
68055
+
68056
+ COMPUTE foo = 2 + 2.
68057
+
68058
+ MULTIPLY lv_foo BY 2.
68059
+
68060
+ INTERFACE intf LOAD.
68061
+
68062
+ IF foo IS SUPPLIED.
68038
68063
  ENDIF.`,
68039
68064
  };
68040
68065
  }
@@ -68374,9 +68399,9 @@ class OmitParameterName {
68374
68399
  key: "omit_parameter_name",
68375
68400
  title: "Omit parameter name",
68376
68401
  shortDescription: `Omit the parameter name in single parameter calls`,
68377
- extendedInformation: `
68378
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68379
-
68402
+ extendedInformation: `
68403
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68404
+
68380
68405
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68381
68406
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68382
68407
  badExample: `method( param = 2 ).`,
@@ -68582,20 +68607,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68582
68607
  shortDescription: `Omit RECEIVING`,
68583
68608
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68584
68609
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68585
- badExample: `
68586
- upload_pack(
68587
- EXPORTING
68588
- io_client = lo_client
68589
- iv_url = iv_url
68590
- iv_deepen_level = iv_deepen_level
68591
- it_hashes = lt_hashes
68592
- RECEIVING
68610
+ badExample: `
68611
+ upload_pack(
68612
+ EXPORTING
68613
+ io_client = lo_client
68614
+ iv_url = iv_url
68615
+ iv_deepen_level = iv_deepen_level
68616
+ it_hashes = lt_hashes
68617
+ RECEIVING
68593
68618
  rt_objects = et_objects ).`,
68594
- goodExample: `
68595
- et_objects = upload_pack(
68596
- io_client = lo_client
68597
- iv_url = iv_url
68598
- iv_deepen_level = iv_deepen_level
68619
+ goodExample: `
68620
+ et_objects = upload_pack(
68621
+ io_client = lo_client
68622
+ iv_url = iv_url
68623
+ iv_deepen_level = iv_deepen_level
68599
68624
  it_hashes = lt_hashes ).`,
68600
68625
  };
68601
68626
  }
@@ -68659,8 +68684,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68659
68684
  return {
68660
68685
  key: "parser_702_chaining",
68661
68686
  title: "Parser Error, bad chanining on 702",
68662
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68663
- this rule finds these and reports errors.
68687
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68688
+ this rule finds these and reports errors.
68664
68689
  Only active on target version 702 and below.`,
68665
68690
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68666
68691
  };
@@ -68740,8 +68765,8 @@ class ParserError {
68740
68765
  return {
68741
68766
  key: "parser_error",
68742
68767
  title: "Parser error",
68743
- shortDescription: `Checks for syntax not recognized by abaplint.
68744
-
68768
+ shortDescription: `Checks for syntax not recognized by abaplint.
68769
+
68745
68770
  See recognized syntax at https://syntax.abaplint.org`,
68746
68771
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68747
68772
  };
@@ -68826,7 +68851,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68826
68851
  return {
68827
68852
  key: "parser_missing_space",
68828
68853
  title: "Parser Error, missing space",
68829
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68854
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68830
68855
  This rule makes sure the spaces are consistently required across the language.`,
68831
68856
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68832
68857
  badExample: `IF ( foo = 'bar').`,
@@ -69238,25 +69263,25 @@ class PreferInline {
69238
69263
  key: "prefer_inline",
69239
69264
  title: "Prefer Inline Declarations",
69240
69265
  shortDescription: `Prefer inline to up-front declarations.`,
69241
- extendedInformation: `EXPERIMENTAL
69242
-
69243
- Activates if language version is v740sp02 or above.
69244
-
69245
- Variables must be local(METHOD or FORM).
69246
-
69247
- No generic or void typed variables. No syntax errors.
69248
-
69249
- First position used must be a full/pure write.
69250
-
69251
- Move statment is not a cast(?=)
69252
-
69266
+ extendedInformation: `EXPERIMENTAL
69267
+
69268
+ Activates if language version is v740sp02 or above.
69269
+
69270
+ Variables must be local(METHOD or FORM).
69271
+
69272
+ No generic or void typed variables. No syntax errors.
69273
+
69274
+ First position used must be a full/pure write.
69275
+
69276
+ Move statment is not a cast(?=)
69277
+
69253
69278
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69254
69279
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69255
- badExample: `DATA foo TYPE i.
69256
- foo = 2.
69257
- DATA percentage TYPE decfloat34.
69280
+ badExample: `DATA foo TYPE i.
69281
+ foo = 2.
69282
+ DATA percentage TYPE decfloat34.
69258
69283
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69259
- goodExample: `DATA(foo) = 2.
69284
+ goodExample: `DATA(foo) = 2.
69260
69285
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69261
69286
  };
69262
69287
  }
@@ -69470,18 +69495,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69470
69495
  key: "prefer_is_not",
69471
69496
  title: "Prefer IS NOT to NOT IS",
69472
69497
  shortDescription: `Prefer IS NOT to NOT IS`,
69473
- extendedInformation: `
69474
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69475
-
69498
+ extendedInformation: `
69499
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69500
+
69476
69501
  "if not is_valid( )." examples are skipped`,
69477
69502
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69478
- goodExample: `IF variable IS NOT INITIAL.
69479
- IF variable NP 'TODO*'.
69480
- IF variable <> 42.
69503
+ goodExample: `IF variable IS NOT INITIAL.
69504
+ IF variable NP 'TODO*'.
69505
+ IF variable <> 42.
69481
69506
  IF variable CO 'hello'.`,
69482
- badExample: `IF NOT variable IS INITIAL.
69483
- IF NOT variable CP 'TODO*'.
69484
- IF NOT variable = 42.
69507
+ badExample: `IF NOT variable IS INITIAL.
69508
+ IF NOT variable CP 'TODO*'.
69509
+ IF NOT variable = 42.
69485
69510
  IF NOT variable CA 'hello'.`,
69486
69511
  };
69487
69512
  }
@@ -69669,14 +69694,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69669
69694
  key: "prefer_raise_exception_new",
69670
69695
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69671
69696
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69672
- extendedInformation: `
69673
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69674
-
69697
+ extendedInformation: `
69698
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69699
+
69675
69700
  From 752 and up`,
69676
69701
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69677
69702
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69678
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69679
- EXPORTING
69703
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69704
+ EXPORTING
69680
69705
  previous = exception.`,
69681
69706
  };
69682
69707
  }
@@ -69754,12 +69779,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69754
69779
  key: "prefer_returning_to_exporting",
69755
69780
  title: "Prefer RETURNING to EXPORTING",
69756
69781
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69757
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69782
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69758
69783
  https://docs.abapopenchecks.org/checks/44/`,
69759
69784
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69760
- badExample: `CLASS lcl DEFINITION.
69761
- PUBLIC SECTION.
69762
- METHODS test EXPORTING ev_foo TYPE i.
69785
+ badExample: `CLASS lcl DEFINITION.
69786
+ PUBLIC SECTION.
69787
+ METHODS test EXPORTING ev_foo TYPE i.
69763
69788
  ENDCLASS.`,
69764
69789
  };
69765
69790
  }
@@ -69855,8 +69880,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69855
69880
  key: "prefer_xsdbool",
69856
69881
  title: "Prefer xsdbool over boolc",
69857
69882
  shortDescription: `Prefer xsdbool over boolc`,
69858
- extendedInformation: `Activates if language version is v740sp08 or above.
69859
-
69883
+ extendedInformation: `Activates if language version is v740sp08 or above.
69884
+
69860
69885
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69861
69886
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69862
69887
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69928,9 +69953,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69928
69953
  title: "Preferred compare operator",
69929
69954
  shortDescription: `Configure undesired operator variants`,
69930
69955
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69931
- badExample: `IF foo EQ bar.
69956
+ badExample: `IF foo EQ bar.
69932
69957
  ENDIF.`,
69933
- goodExample: `IF foo = bar.
69958
+ goodExample: `IF foo = bar.
69934
69959
  ENDIF.`,
69935
69960
  };
69936
69961
  }
@@ -70154,26 +70179,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70154
70179
  key: "reduce_procedural_code",
70155
70180
  title: "Reduce procedural code",
70156
70181
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70157
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70158
-
70159
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70160
-
70182
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70183
+
70184
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70185
+
70161
70186
  Comments are not counted as statements.`,
70162
70187
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70163
- badExample: `FORM foo.
70164
- DATA lv_bar TYPE i.
70165
- lv_bar = 2 + 2.
70166
- IF lv_bar = 4.
70167
- WRITE 'hello world'.
70168
- ENDIF.
70169
- DATA lv_bar TYPE i.
70170
- lv_bar = 2 + 2.
70171
- IF lv_bar = 4.
70172
- WRITE 'hello world'.
70173
- ENDIF.
70188
+ badExample: `FORM foo.
70189
+ DATA lv_bar TYPE i.
70190
+ lv_bar = 2 + 2.
70191
+ IF lv_bar = 4.
70192
+ WRITE 'hello world'.
70193
+ ENDIF.
70194
+ DATA lv_bar TYPE i.
70195
+ lv_bar = 2 + 2.
70196
+ IF lv_bar = 4.
70197
+ WRITE 'hello world'.
70198
+ ENDIF.
70174
70199
  ENDFORM.`,
70175
- goodExample: `FORM foo.
70176
- NEW zcl_global_class( )->run_logic( ).
70200
+ goodExample: `FORM foo.
70201
+ NEW zcl_global_class( )->run_logic( ).
70177
70202
  ENDFORM.`,
70178
70203
  };
70179
70204
  }
@@ -70417,10 +70442,10 @@ class RemoveDescriptions {
70417
70442
  return {
70418
70443
  key: "remove_descriptions",
70419
70444
  title: "Remove descriptions",
70420
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70421
-
70422
- Class descriptions are required, see rule description_empty.
70423
-
70445
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70446
+
70447
+ Class descriptions are required, see rule description_empty.
70448
+
70424
70449
  Consider using ABAP Doc for documentation.`,
70425
70450
  tags: [],
70426
70451
  };
@@ -70545,14 +70570,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70545
70570
  tags: [_irule_1.RuleTag.SingleFile],
70546
70571
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70547
70572
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70548
- badExample: `CALL FUNCTION 'ZRFC'
70573
+ badExample: `CALL FUNCTION 'ZRFC'
70549
70574
  DESTINATION lv_rfc.`,
70550
- goodExample: `CALL FUNCTION 'ZRFC'
70551
- DESTINATION lv_rfc
70552
- EXCEPTIONS
70553
- system_failure = 1 MESSAGE msg
70554
- communication_failure = 2 MESSAGE msg
70555
- resource_failure = 3
70575
+ goodExample: `CALL FUNCTION 'ZRFC'
70576
+ DESTINATION lv_rfc
70577
+ EXCEPTIONS
70578
+ system_failure = 1 MESSAGE msg
70579
+ communication_failure = 2 MESSAGE msg
70580
+ resource_failure = 3
70556
70581
  OTHERS = 4.`,
70557
70582
  };
70558
70583
  }
@@ -70636,11 +70661,11 @@ class SelectAddOrderBy {
70636
70661
  key: "select_add_order_by",
70637
70662
  title: "SELECT add ORDER BY",
70638
70663
  shortDescription: `SELECTs add ORDER BY clause`,
70639
- extendedInformation: `
70640
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70641
-
70642
- add ORDER BY PRIMARY KEY if in doubt
70643
-
70664
+ extendedInformation: `
70665
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70666
+
70667
+ add ORDER BY PRIMARY KEY if in doubt
70668
+
70644
70669
  If the target is a sorted/hashed table, no issue is reported`,
70645
70670
  tags: [_irule_1.RuleTag.SingleFile],
70646
70671
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70771,14 +70796,14 @@ class SelectPerformance {
70771
70796
  key: "select_performance",
70772
70797
  title: "SELECT performance",
70773
70798
  shortDescription: `Various checks regarding SELECT performance.`,
70774
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70775
-
70799
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70800
+
70776
70801
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70777
70802
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70778
- badExample: `SELECT field1, field2 FROM table
70779
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70803
+ badExample: `SELECT field1, field2 FROM table
70804
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70780
70805
  ENDSELECT.`,
70781
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70806
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70782
70807
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70783
70808
  };
70784
70809
  }
@@ -70892,8 +70917,8 @@ class SelectSingleFullKey {
70892
70917
  key: "select_single_full_key",
70893
70918
  title: "Detect SELECT SINGLE which are possibily not unique",
70894
70919
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70895
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70896
-
70920
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70921
+
70897
70922
  If the statement contains a JOIN it is not checked`,
70898
70923
  pseudoComment: "EC CI_NOORDER",
70899
70924
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71317,8 +71342,8 @@ class SICFConsistency {
71317
71342
  key: "sicf_consistency",
71318
71343
  title: "SICF consistency",
71319
71344
  shortDescription: `Checks the validity of ICF services`,
71320
- extendedInformation: `* Class defined in handler must exist
71321
- * Class must not have any syntax errors
71345
+ extendedInformation: `* Class defined in handler must exist
71346
+ * Class must not have any syntax errors
71322
71347
  * Class must implement interface IF_HTTP_EXTENSION`,
71323
71348
  };
71324
71349
  }
@@ -71430,23 +71455,23 @@ class SlowParameterPassing {
71430
71455
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71431
71456
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71432
71457
  tags: [_irule_1.RuleTag.Performance],
71433
- badExample: `CLASS lcl DEFINITION.
71434
- PUBLIC SECTION.
71435
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71436
- ENDCLASS.
71437
- CLASS lcl IMPLEMENTATION.
71438
- METHOD bar.
71439
- WRITE sdf.
71440
- ENDMETHOD.
71458
+ badExample: `CLASS lcl DEFINITION.
71459
+ PUBLIC SECTION.
71460
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71461
+ ENDCLASS.
71462
+ CLASS lcl IMPLEMENTATION.
71463
+ METHOD bar.
71464
+ WRITE sdf.
71465
+ ENDMETHOD.
71441
71466
  ENDCLASS.`,
71442
- goodExample: `CLASS lcl DEFINITION.
71443
- PUBLIC SECTION.
71444
- METHODS bar IMPORTING sdf TYPE string.
71445
- ENDCLASS.
71446
- CLASS lcl IMPLEMENTATION.
71447
- METHOD bar.
71448
- WRITE sdf.
71449
- ENDMETHOD.
71467
+ goodExample: `CLASS lcl DEFINITION.
71468
+ PUBLIC SECTION.
71469
+ METHODS bar IMPORTING sdf TYPE string.
71470
+ ENDCLASS.
71471
+ CLASS lcl IMPLEMENTATION.
71472
+ METHOD bar.
71473
+ WRITE sdf.
71474
+ ENDMETHOD.
71450
71475
  ENDCLASS.`,
71451
71476
  };
71452
71477
  }
@@ -71703,8 +71728,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71703
71728
  key: "space_before_dot",
71704
71729
  title: "Space before dot",
71705
71730
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71706
- extendedInformation: `
71707
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71731
+ extendedInformation: `
71732
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71708
71733
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71709
71734
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71710
71735
  badExample: `WRITE bar .`,
@@ -71890,12 +71915,12 @@ class SQLValueConversion {
71890
71915
  key: "sql_value_conversion",
71891
71916
  title: "Implicit SQL Value Conversion",
71892
71917
  shortDescription: `Ensure types match when selecting from database`,
71893
- extendedInformation: `
71894
- * Integer to CHAR conversion
71895
- * Integer to NUMC conversion
71896
- * NUMC to Integer conversion
71897
- * CHAR to Integer conversion
71898
- * Source field longer than database field, CHAR -> CHAR
71918
+ extendedInformation: `
71919
+ * Integer to CHAR conversion
71920
+ * Integer to NUMC conversion
71921
+ * NUMC to Integer conversion
71922
+ * CHAR to Integer conversion
71923
+ * Source field longer than database field, CHAR -> CHAR
71899
71924
  * Source field longer than database field, NUMC -> NUMC`,
71900
71925
  tags: [],
71901
71926
  };
@@ -71967,7 +71992,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71967
71992
  key: "start_at_tab",
71968
71993
  title: "Start at tab",
71969
71994
  shortDescription: `Checks that statements start at tabstops.`,
71970
- extendedInformation: `Reports max 100 issues per file
71995
+ extendedInformation: `Reports max 100 issues per file
71971
71996
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71972
71997
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71973
71998
  badExample: ` WRITE a.`,
@@ -72144,12 +72169,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72144
72169
  key: "strict_sql",
72145
72170
  title: "Strict SQL",
72146
72171
  shortDescription: `Strict SQL`,
72147
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72148
-
72149
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72150
-
72151
- Also see separate rule sql_escape_host_variables
72152
-
72172
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72173
+
72174
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72175
+
72176
+ Also see separate rule sql_escape_host_variables
72177
+
72153
72178
  Activates from v750 and up`,
72154
72179
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72155
72180
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72403,11 +72428,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72403
72428
  key: "sy_modification",
72404
72429
  title: "Modification of SY fields",
72405
72430
  shortDescription: `Finds modification of sy fields`,
72406
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72407
-
72431
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72432
+
72408
72433
  Changes to SY-TVAR* fields are not reported`,
72409
72434
  tags: [_irule_1.RuleTag.SingleFile],
72410
- badExample: `sy-uname = 2.
72435
+ badExample: `sy-uname = 2.
72411
72436
  sy = sy.`,
72412
72437
  };
72413
72438
  }
@@ -72469,8 +72494,8 @@ class TABLEnhancementCategory {
72469
72494
  key: "tabl_enhancement_category",
72470
72495
  title: "TABL enhancement category must be set",
72471
72496
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72472
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72473
-
72497
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72498
+
72474
72499
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72475
72500
  tags: [],
72476
72501
  };
@@ -72535,8 +72560,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72535
72560
  shortDescription: `TABLES are always global, so declare them globally`,
72536
72561
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72537
72562
  tags: [_irule_1.RuleTag.SingleFile],
72538
- badExample: `FORM foo.
72539
- TABLES t100.
72563
+ badExample: `FORM foo.
72564
+ TABLES t100.
72540
72565
  ENDFORM.`,
72541
72566
  goodExample: `TABLES t000.`,
72542
72567
  };
@@ -72664,9 +72689,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72664
72689
  title: "Type FORM parameters",
72665
72690
  shortDescription: `Checks for untyped FORM parameters`,
72666
72691
  tags: [_irule_1.RuleTag.SingleFile],
72667
- badExample: `FORM foo USING bar.
72692
+ badExample: `FORM foo USING bar.
72668
72693
  ENDFORM.`,
72669
- goodExample: `FORM foo USING bar TYPE string.
72694
+ goodExample: `FORM foo USING bar TYPE string.
72670
72695
  ENDFORM.`,
72671
72696
  };
72672
72697
  }
@@ -73339,38 +73364,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73339
73364
  key: "unnecessary_pragma",
73340
73365
  title: "Unnecessary Pragma",
73341
73366
  shortDescription: `Finds pragmas which can be removed`,
73342
- extendedInformation: `* NO_HANDLER with handler
73343
-
73344
- * NEEDED without definition
73345
-
73346
- * NO_TEXT without texts
73347
-
73348
- * SUBRC_OK where sy-subrc is checked
73349
-
73367
+ extendedInformation: `* NO_HANDLER with handler
73368
+
73369
+ * NEEDED without definition
73370
+
73371
+ * NO_TEXT without texts
73372
+
73373
+ * SUBRC_OK where sy-subrc is checked
73374
+
73350
73375
  NO_HANDLER inside macros are not checked`,
73351
73376
  tags: [_irule_1.RuleTag.SingleFile],
73352
- badExample: `TRY.
73353
- ...
73354
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73355
- RETURN. " it has a handler
73356
- ENDTRY.
73357
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73358
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73359
- IF sy-subrc <> 0.
73377
+ badExample: `TRY.
73378
+ ...
73379
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73380
+ RETURN. " it has a handler
73381
+ ENDTRY.
73382
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73383
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73384
+ IF sy-subrc <> 0.
73360
73385
  ENDIF.`,
73361
- goodExample: `TRY.
73362
- ...
73363
- CATCH zcx_abapgit_exception.
73364
- RETURN.
73365
- ENDTRY.
73366
- MESSAGE w125(zbar) WITH c_foo INTO message.
73367
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73368
- IF sy-subrc <> 0.
73369
- ENDIF.
73370
-
73371
- DATA: BEGIN OF blah ##NEEDED,
73372
- test1 TYPE string,
73373
- test2 TYPE string,
73386
+ goodExample: `TRY.
73387
+ ...
73388
+ CATCH zcx_abapgit_exception.
73389
+ RETURN.
73390
+ ENDTRY.
73391
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73392
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73393
+ IF sy-subrc <> 0.
73394
+ ENDIF.
73395
+
73396
+ DATA: BEGIN OF blah ##NEEDED,
73397
+ test1 TYPE string,
73398
+ test2 TYPE string,
73374
73399
  END OF blah.`,
73375
73400
  };
73376
73401
  }
@@ -73537,18 +73562,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73537
73562
  shortDescription: `Finds unnecessary RETURN statements`,
73538
73563
  extendedInformation: `Finds unnecessary RETURN statements`,
73539
73564
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73540
- badExample: `FORM hello1.
73541
- WRITE 'world'.
73542
- RETURN.
73543
- ENDFORM.
73544
-
73545
- FORM foo.
73546
- IF 1 = 2.
73547
- RETURN.
73548
- ENDIF.
73565
+ badExample: `FORM hello1.
73566
+ WRITE 'world'.
73567
+ RETURN.
73568
+ ENDFORM.
73569
+
73570
+ FORM foo.
73571
+ IF 1 = 2.
73572
+ RETURN.
73573
+ ENDIF.
73549
73574
  ENDFORM.`,
73550
- goodExample: `FORM hello2.
73551
- WRITE 'world'.
73575
+ goodExample: `FORM hello2.
73576
+ WRITE 'world'.
73552
73577
  ENDFORM.`,
73553
73578
  };
73554
73579
  }
@@ -73899,13 +73924,13 @@ class UnusedMacros {
73899
73924
  title: "Unused macros",
73900
73925
  shortDescription: `Checks for unused macro definitions definitions`,
73901
73926
  tags: [_irule_1.RuleTag.Quickfix],
73902
- badExample: `DEFINE foobar1.
73903
- WRITE 'hello'.
73927
+ badExample: `DEFINE foobar1.
73928
+ WRITE 'hello'.
73904
73929
  END-OF-DEFINITION.`,
73905
- goodExample: `DEFINE foobar2.
73906
- WRITE 'hello'.
73907
- END-OF-DEFINITION.
73908
-
73930
+ goodExample: `DEFINE foobar2.
73931
+ WRITE 'hello'.
73932
+ END-OF-DEFINITION.
73933
+
73909
73934
  foobar2.`,
73910
73935
  };
73911
73936
  }
@@ -74017,18 +74042,18 @@ class UnusedMethods {
74017
74042
  key: "unused_methods",
74018
74043
  title: "Unused methods",
74019
74044
  shortDescription: `Checks for unused methods`,
74020
- extendedInformation: `Checks private and protected methods.
74021
-
74022
- Unused methods are not reported if the object contains parser or syntax errors.
74023
- Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74024
-
74025
- Skips:
74026
- * methods FOR TESTING
74027
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74028
- * class_constructor + constructor methods
74029
- * event handlers
74030
- * methods that are redefined
74031
- * INCLUDEs
74045
+ extendedInformation: `Checks private and protected methods.
74046
+
74047
+ Unused methods are not reported if the object contains parser or syntax errors.
74048
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74049
+
74050
+ Skips:
74051
+ * methods FOR TESTING
74052
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74053
+ * class_constructor + constructor methods
74054
+ * event handlers
74055
+ * methods that are redefined
74056
+ * INCLUDEs
74032
74057
  `,
74033
74058
  tags: [_irule_1.RuleTag.Quickfix],
74034
74059
  pragma: "##CALLED",
@@ -74504,23 +74529,23 @@ class UnusedVariables {
74504
74529
  key: "unused_variables",
74505
74530
  title: "Unused variables",
74506
74531
  shortDescription: `Checks for unused variables and constants`,
74507
- extendedInformation: `Skips event parameters.
74508
-
74509
- Note that this currently does not work if the source code uses macros.
74510
-
74511
- Unused variables are not reported if the object contains parser or syntax errors.
74512
-
74532
+ extendedInformation: `Skips event parameters.
74533
+
74534
+ Note that this currently does not work if the source code uses macros.
74535
+
74536
+ Unused variables are not reported if the object contains parser or syntax errors.
74537
+
74513
74538
  Errors found in INCLUDES are reported for the main program.`,
74514
74539
  tags: [_irule_1.RuleTag.Quickfix],
74515
74540
  pragma: "##NEEDED",
74516
74541
  pseudoComment: "EC NEEDED",
74517
- badExample: `DATA: BEGIN OF blah1,
74518
- test TYPE string,
74519
- test2 TYPE string,
74542
+ badExample: `DATA: BEGIN OF blah1,
74543
+ test TYPE string,
74544
+ test2 TYPE string,
74520
74545
  END OF blah1.`,
74521
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74522
- test TYPE string,
74523
- test2 TYPE string,
74546
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74547
+ test TYPE string,
74548
+ test2 TYPE string,
74524
74549
  END OF blah2.`,
74525
74550
  };
74526
74551
  }
@@ -74739,15 +74764,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74739
74764
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74740
74765
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74741
74766
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74742
- badExample: `IF line IS INITIAL.
74743
- has_entries = abap_false.
74744
- ELSE.
74745
- has_entries = abap_true.
74746
- ENDIF.
74747
-
74767
+ badExample: `IF line IS INITIAL.
74768
+ has_entries = abap_false.
74769
+ ELSE.
74770
+ has_entries = abap_true.
74771
+ ENDIF.
74772
+
74748
74773
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74749
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74750
-
74774
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74775
+
74751
74776
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74752
74777
  };
74753
74778
  }
@@ -74865,15 +74890,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74865
74890
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74866
74891
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74867
74892
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74868
- badExample: `INTERFACE lif.
74869
- METHODS load_data
74870
- EXCEPTIONS
74871
- invalid_parameter.
74893
+ badExample: `INTERFACE lif.
74894
+ METHODS load_data
74895
+ EXCEPTIONS
74896
+ invalid_parameter.
74872
74897
  ENDINTERFACE.`,
74873
- goodExample: `INTERFACE lif.
74874
- METHODS load_data
74875
- RAISING
74876
- cx_something.
74898
+ goodExample: `INTERFACE lif.
74899
+ METHODS load_data
74900
+ RAISING
74901
+ cx_something.
74877
74902
  ENDINTERFACE.`,
74878
74903
  };
74879
74904
  }
@@ -74933,15 +74958,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74933
74958
  key: "use_line_exists",
74934
74959
  title: "Use line_exists",
74935
74960
  shortDescription: `Use line_exists, from 740sp02 and up`,
74936
- extendedInformation: `
74937
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74938
-
74961
+ extendedInformation: `
74962
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74963
+
74939
74964
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74940
74965
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74941
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74942
- IF sy-subrc = 0.
74966
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74967
+ IF sy-subrc = 0.
74943
74968
  ENDIF.`,
74944
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74969
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74945
74970
  ENDIF.`,
74946
74971
  };
74947
74972
  }
@@ -75051,10 +75076,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75051
75076
  key: "use_new",
75052
75077
  title: "Use NEW",
75053
75078
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
75054
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75055
-
75056
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75057
-
75079
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75080
+
75081
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75082
+
75058
75083
  Applicable from v740sp02 and up`,
75059
75084
  badExample: `CREATE OBJECT ref.`,
75060
75085
  goodExample: `ref = NEW #( ).`,
@@ -75152,13 +75177,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75152
75177
  title: "WHEN OTHERS last",
75153
75178
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75154
75179
  tags: [_irule_1.RuleTag.SingleFile],
75155
- badExample: `CASE bar.
75156
- WHEN OTHERS.
75157
- WHEN 2.
75180
+ badExample: `CASE bar.
75181
+ WHEN OTHERS.
75182
+ WHEN 2.
75158
75183
  ENDCASE.`,
75159
- goodExample: `CASE bar.
75160
- WHEN 2.
75161
- WHEN OTHERS.
75184
+ goodExample: `CASE bar.
75185
+ WHEN 2.
75186
+ WHEN OTHERS.
75162
75187
  ENDCASE.`,
75163
75188
  };
75164
75189
  }