@abaplint/cli 2.112.19 → 2.112.20

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 +866 -808
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -35126,13 +35126,13 @@ class FlowGraph {
35126
35126
  this.label = label;
35127
35127
  }
35128
35128
  toDigraph() {
35129
- return `digraph G {
35130
- labelloc="t";
35131
- label="${this.label}";
35132
- graph [fontname = "helvetica"];
35133
- node [fontname = "helvetica", shape="box"];
35134
- edge [fontname = "helvetica"];
35135
- ${this.toTextEdges()}
35129
+ return `digraph G {
35130
+ labelloc="t";
35131
+ label="${this.label}";
35132
+ graph [fontname = "helvetica"];
35133
+ node [fontname = "helvetica", shape="box"];
35134
+ edge [fontname = "helvetica"];
35135
+ ${this.toTextEdges()}
35136
35136
  }`;
35137
35137
  }
35138
35138
  listSources(node) {
@@ -35214,6 +35214,30 @@ const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node
35214
35214
  const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
35215
35215
  const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
35216
35216
  const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
35217
+ // Levels: top, FORM, METHOD, FUNCTION-MODULE, (MODULE, AT, END-OF-*, GET, START-OF-SELECTION, TOP-OF-PAGE)
35218
+ //
35219
+ // Loop branching: LOOP, DO, WHILE, SELECT(loop), WITH, PROVIDE
35220
+ //
35221
+ // Branching: IF, CASE, CASE TYPE OF, TRY, ON, CATCH SYSTEM-EXCEPTIONS, AT
35222
+ //
35223
+ // Conditional exits: CHECK, ASSERT
35224
+ //
35225
+ // Exits: RETURN, EXIT, RAISE(not RESUMABLE), MESSAGE(type E and A?), CONTINUE, REJECT, RESUME, STOP
35226
+ //
35227
+ // Not handled? INCLUDE + malplaced macro calls
35228
+ /////////////////////////////////////
35229
+ // TODO: handling static exceptions(only static), refactor some logic from UncaughtException to common file
35230
+ // TODO: RAISE
35231
+ const FLOW_EVENTS = [
35232
+ Statements.StartOfSelection,
35233
+ Statements.AtSelectionScreen,
35234
+ Statements.AtLineSelection,
35235
+ Statements.AtUserCommand,
35236
+ Statements.EndOfSelection,
35237
+ Statements.Initialization,
35238
+ Statements.TopOfPage,
35239
+ Statements.EndOfPage,
35240
+ ];
35217
35241
  class StatementFlow {
35218
35242
  constructor() {
35219
35243
  this.counter = 0;
@@ -35221,9 +35245,9 @@ class StatementFlow {
35221
35245
  build(stru) {
35222
35246
  var _a, _b, _c, _d;
35223
35247
  const ret = [];
35248
+ let name = "";
35224
35249
  const structures = stru.findAllStructuresMulti([Structures.Form, Structures.ClassImplementation, Structures.FunctionModule]);
35225
35250
  for (const s of structures) {
35226
- let name = "";
35227
35251
  if (s.get() instanceof Structures.Form) {
35228
35252
  name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
35229
35253
  ret.push(this.run(s, name));
@@ -35244,9 +35268,43 @@ class StatementFlow {
35244
35268
  throw new Error("StatementFlow, unknown structure");
35245
35269
  }
35246
35270
  }
35271
+ // find the top level events
35272
+ let inFlow = false;
35273
+ let collected = [];
35274
+ for (const s of stru.getChildren() || []) {
35275
+ if (FLOW_EVENTS.some(f => s.get() instanceof f)) {
35276
+ if (inFlow === true) {
35277
+ ret.push(this.runEvent(collected, name));
35278
+ }
35279
+ collected = [];
35280
+ inFlow = true;
35281
+ name = s.concatTokens();
35282
+ }
35283
+ else if (s.get() instanceof Structures.Normal) {
35284
+ collected.push(s);
35285
+ }
35286
+ else {
35287
+ if (inFlow === true) {
35288
+ ret.push(this.runEvent(collected, name));
35289
+ inFlow = false;
35290
+ }
35291
+ collected = [];
35292
+ }
35293
+ }
35294
+ if (inFlow === true) {
35295
+ ret.push(this.runEvent(collected, name));
35296
+ inFlow = false;
35297
+ collected = [];
35298
+ }
35247
35299
  return ret.map(f => f.reduce());
35248
35300
  }
35249
35301
  ////////////////////
35302
+ runEvent(s, name) {
35303
+ this.counter = 1;
35304
+ const graph = this.traverseBody(s, { procedureEnd: "end#1" });
35305
+ graph.setLabel(name);
35306
+ return graph;
35307
+ }
35250
35308
  run(s, name) {
35251
35309
  this.counter = 1;
35252
35310
  const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
@@ -43287,13 +43345,13 @@ class Help {
43287
43345
  /////////////////////////////////////////////////
43288
43346
  static dumpABAP(file, reg, textDocument, position) {
43289
43347
  let content = "";
43290
- content = `
43291
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43292
- <a href="#_statements" rel="no-refresh">Statements</a> |
43293
- <a href="#_structure" rel="no-refresh">Structure</a> |
43294
- <a href="#_files" rel="no-refresh">Files</a> |
43295
- <a href="#_info" rel="no-refresh">Info Dump</a>
43296
- <hr>
43348
+ content = `
43349
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43350
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43351
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43352
+ <a href="#_files" rel="no-refresh">Files</a> |
43353
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43354
+ <hr>
43297
43355
  ` +
43298
43356
  "<tt>" + textDocument.uri + " (" +
43299
43357
  (position.line + 1) + ", " +
@@ -52563,7 +52621,7 @@ class Registry {
52563
52621
  }
52564
52622
  static abaplintVersion() {
52565
52623
  // magic, see build script "version.sh"
52566
- return "2.112.19";
52624
+ return "2.112.20";
52567
52625
  }
52568
52626
  getDDICReferences() {
52569
52627
  return this.ddicReferences;
@@ -52882,10 +52940,10 @@ class SevenBitAscii {
52882
52940
  key: "7bit_ascii",
52883
52941
  title: "Check for 7bit ascii",
52884
52942
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
52885
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
52886
-
52887
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
52888
-
52943
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
52944
+
52945
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
52946
+
52889
52947
  Checkes files with extensions ".abap" and ".asddls"`,
52890
52948
  tags: [_irule_1.RuleTag.SingleFile],
52891
52949
  badExample: `WRITE '뽑'.`,
@@ -53091,10 +53149,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53091
53149
  key: "abapdoc",
53092
53150
  title: "Check abapdoc",
53093
53151
  shortDescription: `Various checks regarding abapdoc.`,
53094
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53095
-
53096
- Plus class and interface definitions.
53097
-
53152
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53153
+
53154
+ Plus class and interface definitions.
53155
+
53098
53156
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53099
53157
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53100
53158
  };
@@ -53232,49 +53290,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53232
53290
  key: "align_parameters",
53233
53291
  title: "Align Parameters",
53234
53292
  shortDescription: `Checks for vertially aligned parameters`,
53235
- extendedInformation: `Checks:
53236
- * function module calls
53237
- * method calls
53238
- * VALUE constructors
53239
- * NEW constructors
53240
- * RAISE EXCEPTION statements
53241
- * CREATE OBJECT statements
53242
- * RAISE EVENT statements
53243
-
53244
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53245
-
53246
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53247
-
53248
- If parameters are on the same row, no issues are reported, see
53293
+ extendedInformation: `Checks:
53294
+ * function module calls
53295
+ * method calls
53296
+ * VALUE constructors
53297
+ * NEW constructors
53298
+ * RAISE EXCEPTION statements
53299
+ * CREATE OBJECT statements
53300
+ * RAISE EVENT statements
53301
+
53302
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53303
+
53304
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53305
+
53306
+ If parameters are on the same row, no issues are reported, see
53249
53307
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53250
53308
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53251
- badExample: `CALL FUNCTION 'FOOBAR'
53252
- EXPORTING
53253
- foo = 2
53254
- parameter = 3.
53255
-
53256
- foobar( moo = 1
53257
- param = 1 ).
53258
-
53259
- foo = VALUE #(
53260
- foo = bar
53309
+ badExample: `CALL FUNCTION 'FOOBAR'
53310
+ EXPORTING
53311
+ foo = 2
53312
+ parameter = 3.
53313
+
53314
+ foobar( moo = 1
53315
+ param = 1 ).
53316
+
53317
+ foo = VALUE #(
53318
+ foo = bar
53261
53319
  moo = 2 ).`,
53262
- goodExample: `CALL FUNCTION 'FOOBAR'
53263
- EXPORTING
53264
- foo = 2
53265
- parameter = 3.
53266
-
53267
- foobar( moo = 1
53268
- param = 1 ).
53269
-
53270
- foo = VALUE #(
53271
- foo = bar
53272
- moo = 2 ).
53273
-
53274
- DATA(sdf) = VALUE type(
53275
- common_val = 2
53276
- another_common = 5
53277
- ( row_value = 4
53320
+ goodExample: `CALL FUNCTION 'FOOBAR'
53321
+ EXPORTING
53322
+ foo = 2
53323
+ parameter = 3.
53324
+
53325
+ foobar( moo = 1
53326
+ param = 1 ).
53327
+
53328
+ foo = VALUE #(
53329
+ foo = bar
53330
+ moo = 2 ).
53331
+
53332
+ DATA(sdf) = VALUE type(
53333
+ common_val = 2
53334
+ another_common = 5
53335
+ ( row_value = 4
53278
53336
  value_foo = 5 ) ).`,
53279
53337
  };
53280
53338
  }
@@ -53708,37 +53766,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
53708
53766
  key: "align_type_expressions",
53709
53767
  title: "Align TYPE expressions",
53710
53768
  shortDescription: `Align TYPE expressions in statements`,
53711
- extendedInformation: `
53712
- Currently works for METHODS + BEGIN OF
53713
-
53714
- If BEGIN OF has an INCLUDE TYPE its ignored
53715
-
53716
- Also note that clean ABAP does not recommend aligning TYPE clauses:
53769
+ extendedInformation: `
53770
+ Currently works for METHODS + BEGIN OF
53771
+
53772
+ If BEGIN OF has an INCLUDE TYPE its ignored
53773
+
53774
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
53717
53775
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
53718
53776
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
53719
- badExample: `
53720
- TYPES: BEGIN OF foo,
53721
- bar TYPE i,
53722
- foobar TYPE i,
53723
- END OF foo.
53724
-
53725
- INTERFACE lif.
53726
- METHODS bar
53727
- IMPORTING
53728
- foo TYPE i
53729
- foobar TYPE i.
53777
+ badExample: `
53778
+ TYPES: BEGIN OF foo,
53779
+ bar TYPE i,
53780
+ foobar TYPE i,
53781
+ END OF foo.
53782
+
53783
+ INTERFACE lif.
53784
+ METHODS bar
53785
+ IMPORTING
53786
+ foo TYPE i
53787
+ foobar TYPE i.
53730
53788
  ENDINTERFACE.`,
53731
- goodExample: `
53732
- TYPES: BEGIN OF foo,
53733
- bar TYPE i,
53734
- foobar TYPE i,
53735
- END OF foo.
53736
-
53737
- INTERFACE lif.
53738
- METHODS bar
53739
- IMPORTING
53740
- foo TYPE i
53741
- foobar TYPE i.
53789
+ goodExample: `
53790
+ TYPES: BEGIN OF foo,
53791
+ bar TYPE i,
53792
+ foobar TYPE i,
53793
+ END OF foo.
53794
+
53795
+ INTERFACE lif.
53796
+ METHODS bar
53797
+ IMPORTING
53798
+ foo TYPE i
53799
+ foobar TYPE i.
53742
53800
  ENDINTERFACE.`,
53743
53801
  };
53744
53802
  }
@@ -54017,15 +54075,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54017
54075
  return {
54018
54076
  key: "ambiguous_statement",
54019
54077
  title: "Check for ambigious statements",
54020
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54021
- Add "TABLE" keyword or "@" for escaping SQL variables
54022
-
54078
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54079
+ Add "TABLE" keyword or "@" for escaping SQL variables
54080
+
54023
54081
  Only works if the target version is 740sp05 or above`,
54024
54082
  tags: [_irule_1.RuleTag.SingleFile],
54025
- badExample: `DELETE foo FROM bar.
54083
+ badExample: `DELETE foo FROM bar.
54026
54084
  MODIFY foo FROM bar.`,
54027
- goodExample: `DELETE foo FROM @bar.
54028
- MODIFY TABLE foo FROM bar.
54085
+ goodExample: `DELETE foo FROM @bar.
54086
+ MODIFY TABLE foo FROM bar.
54029
54087
  MODIFY zfoo FROM @wa.`,
54030
54088
  };
54031
54089
  }
@@ -54130,16 +54188,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54130
54188
  key: "avoid_use",
54131
54189
  title: "Avoid use of certain statements",
54132
54190
  shortDescription: `Detects usage of certain statements.`,
54133
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54134
-
54135
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54136
-
54137
- STATICS: use CLASS-DATA instead
54138
-
54139
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54140
-
54141
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54142
-
54191
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54192
+
54193
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54194
+
54195
+ STATICS: use CLASS-DATA instead
54196
+
54197
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54198
+
54199
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54200
+
54143
54201
  BREAK points`,
54144
54202
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54145
54203
  };
@@ -54271,11 +54329,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54271
54329
  title: "Check BEGIN END names",
54272
54330
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54273
54331
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54274
- badExample: `DATA: BEGIN OF stru,
54275
- field TYPE i,
54332
+ badExample: `DATA: BEGIN OF stru,
54333
+ field TYPE i,
54276
54334
  END OF structure_not_the_same.`,
54277
- goodExample: `DATA: BEGIN OF stru,
54278
- field TYPE i,
54335
+ goodExample: `DATA: BEGIN OF stru,
54336
+ field TYPE i,
54279
54337
  END OF stru.`,
54280
54338
  };
54281
54339
  }
@@ -54372,20 +54430,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54372
54430
  title: "BEGIN contains single INCLUDE",
54373
54431
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54374
54432
  tags: [_irule_1.RuleTag.SingleFile],
54375
- badExample: `TYPES: BEGIN OF dummy1.
54376
- INCLUDE TYPE dselc.
54377
- TYPES: END OF dummy1.
54378
-
54379
- DATA BEGIN OF foo.
54380
- INCLUDE STRUCTURE syst.
54381
- DATA END OF foo.
54382
-
54383
- STATICS BEGIN OF bar.
54384
- INCLUDE STRUCTURE syst.
54433
+ badExample: `TYPES: BEGIN OF dummy1.
54434
+ INCLUDE TYPE dselc.
54435
+ TYPES: END OF dummy1.
54436
+
54437
+ DATA BEGIN OF foo.
54438
+ INCLUDE STRUCTURE syst.
54439
+ DATA END OF foo.
54440
+
54441
+ STATICS BEGIN OF bar.
54442
+ INCLUDE STRUCTURE syst.
54385
54443
  STATICS END OF bar.`,
54386
- goodExample: `DATA BEGIN OF foo.
54387
- DATA field TYPE i.
54388
- INCLUDE STRUCTURE dselc.
54444
+ goodExample: `DATA BEGIN OF foo.
54445
+ DATA field TYPE i.
54446
+ INCLUDE STRUCTURE dselc.
54389
54447
  DATA END OF foo.`,
54390
54448
  };
54391
54449
  }
@@ -54475,9 +54533,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
54475
54533
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
54476
54534
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
54477
54535
  badExample: `CALL TRANSACTION 'FOO'.`,
54478
- goodExample: `TRY.
54479
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54480
- CATCH cx_sy_authorization_error.
54536
+ goodExample: `TRY.
54537
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
54538
+ CATCH cx_sy_authorization_error.
54481
54539
  ENDTRY.`,
54482
54540
  };
54483
54541
  }
@@ -54542,10 +54600,10 @@ class CDSCommentStyle {
54542
54600
  key: "cds_comment_style",
54543
54601
  title: "CDS Comment Style",
54544
54602
  shortDescription: `Check for obsolete comment style`,
54545
- extendedInformation: `Check for obsolete comment style
54546
-
54547
- Comments starting with "--" are considered obsolete
54548
-
54603
+ extendedInformation: `Check for obsolete comment style
54604
+
54605
+ Comments starting with "--" are considered obsolete
54606
+
54549
54607
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
54550
54608
  tags: [_irule_1.RuleTag.SingleFile],
54551
54609
  badExample: "-- this is a comment",
@@ -54611,10 +54669,10 @@ class CDSLegacyView {
54611
54669
  key: "cds_legacy_view",
54612
54670
  title: "CDS Legacy View",
54613
54671
  shortDescription: `Identify CDS Legacy Views`,
54614
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54615
-
54616
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54617
-
54672
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
54673
+
54674
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
54675
+
54618
54676
  v755 and up`,
54619
54677
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
54620
54678
  };
@@ -54769,10 +54827,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
54769
54827
  key: "chain_mainly_declarations",
54770
54828
  title: "Chain mainly declarations",
54771
54829
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
54772
- extendedInformation: `
54773
- https://docs.abapopenchecks.org/checks/23/
54774
-
54775
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
54830
+ extendedInformation: `
54831
+ https://docs.abapopenchecks.org/checks/23/
54832
+
54833
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
54776
54834
  `,
54777
54835
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
54778
54836
  badExample: `CALL METHOD: bar.`,
@@ -54948,17 +55006,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
54948
55006
  title: "Change IF to CASE",
54949
55007
  shortDescription: `Finds IF constructs that can be changed to CASE`,
54950
55008
  // eslint-disable-next-line max-len
54951
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
54952
-
55009
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55010
+
54953
55011
  If the first comparison is a boolean compare, no issue is reported.`,
54954
55012
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
54955
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
54956
- ELSEIF l_fcat-fieldname = 'BAR'
54957
- OR l_fcat-fieldname = 'MOO'.
55013
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55014
+ ELSEIF l_fcat-fieldname = 'BAR'
55015
+ OR l_fcat-fieldname = 'MOO'.
54958
55016
  ENDIF.`,
54959
- goodExample: `CASE l_fcat-fieldname.
54960
- WHEN 'FOO'.
54961
- WHEN 'BAR' OR 'MOO'.
55017
+ goodExample: `CASE l_fcat-fieldname.
55018
+ WHEN 'FOO'.
55019
+ WHEN 'BAR' OR 'MOO'.
54962
55020
  ENDCASE.`,
54963
55021
  };
54964
55022
  }
@@ -55095,8 +55153,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55095
55153
  return {
55096
55154
  key: "check_abstract",
55097
55155
  title: "Check abstract methods and classes",
55098
- shortDescription: `Checks abstract methods and classes:
55099
- - class defined as abstract and final,
55156
+ shortDescription: `Checks abstract methods and classes:
55157
+ - class defined as abstract and final,
55100
55158
  - non-abstract class contains abstract methods`,
55101
55159
  extendedInformation: `If a class defines only constants, use an interface instead`,
55102
55160
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55177,11 +55235,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55177
55235
  return {
55178
55236
  key: "check_comments",
55179
55237
  title: "Check Comments",
55180
- shortDescription: `
55238
+ shortDescription: `
55181
55239
  Various checks for comment usage.`,
55182
- extendedInformation: `
55183
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55184
-
55240
+ extendedInformation: `
55241
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55242
+
55185
55243
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55186
55244
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55187
55245
  badExample: `WRITE 2. " descriptive comment`,
@@ -55343,9 +55401,9 @@ class CheckInclude {
55343
55401
  key: "check_include",
55344
55402
  title: "Check INCLUDEs",
55345
55403
  shortDescription: `Checks INCLUDE statements`,
55346
- extendedInformation: `
55347
- * Reports unused includes
55348
- * Errors if the includes are not found
55404
+ extendedInformation: `
55405
+ * Reports unused includes
55406
+ * Errors if the includes are not found
55349
55407
  * Error if including a main program`,
55350
55408
  tags: [_irule_1.RuleTag.Syntax],
55351
55409
  };
@@ -55421,14 +55479,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
55421
55479
  key: "check_subrc",
55422
55480
  title: "Check sy-subrc",
55423
55481
  shortDescription: `Check sy-subrc`,
55424
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55425
-
55426
- If sy-dbcnt is checked after database statements, it is considered okay.
55427
-
55428
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55429
-
55430
- If IS ASSIGNED is checked after assigning, it is considered okay.
55431
-
55482
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
55483
+
55484
+ If sy-dbcnt is checked after database statements, it is considered okay.
55485
+
55486
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
55487
+
55488
+ If IS ASSIGNED is checked after assigning, it is considered okay.
55489
+
55432
55490
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
55433
55491
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55434
55492
  pseudoComment: "EC CI_SUBRC",
@@ -55998,17 +56056,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
55998
56056
  shortDescription: `Find overlapping classic exceptions`,
55999
56057
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56000
56058
  tags: [_irule_1.RuleTag.SingleFile],
56001
- badExample: `CALL FUNCTION 'SOMETHING'
56002
- EXCEPTIONS
56003
- system_failure = 1 MESSAGE lv_message
56004
- communication_failure = 1 MESSAGE lv_message
56005
- resource_failure = 1
56059
+ badExample: `CALL FUNCTION 'SOMETHING'
56060
+ EXCEPTIONS
56061
+ system_failure = 1 MESSAGE lv_message
56062
+ communication_failure = 1 MESSAGE lv_message
56063
+ resource_failure = 1
56006
56064
  OTHERS = 1.`,
56007
- goodExample: `CALL FUNCTION 'SOMETHING'
56008
- EXCEPTIONS
56009
- system_failure = 1 MESSAGE lv_message
56010
- communication_failure = 2 MESSAGE lv_message
56011
- resource_failure = 3
56065
+ goodExample: `CALL FUNCTION 'SOMETHING'
56066
+ EXCEPTIONS
56067
+ system_failure = 1 MESSAGE lv_message
56068
+ communication_failure = 2 MESSAGE lv_message
56069
+ resource_failure = 3
56012
56070
  OTHERS = 4.`,
56013
56071
  };
56014
56072
  }
@@ -56254,7 +56312,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56254
56312
  key: "commented_code",
56255
56313
  title: "Find commented code",
56256
56314
  shortDescription: `Detects usage of commented out code.`,
56257
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56315
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56258
56316
  https://docs.abapopenchecks.org/checks/14/`,
56259
56317
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56260
56318
  badExample: `* WRITE 'hello world'.`,
@@ -56487,10 +56545,10 @@ class ConstructorVisibilityPublic {
56487
56545
  key: "constructor_visibility_public",
56488
56546
  title: "Check constructor visibility is public",
56489
56547
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
56490
- extendedInformation: `
56491
- This only applies to global classes.
56492
-
56493
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56548
+ extendedInformation: `
56549
+ This only applies to global classes.
56550
+
56551
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
56494
56552
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
56495
56553
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56496
56554
  };
@@ -56565,8 +56623,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
56565
56623
  key: "contains_tab",
56566
56624
  title: "Code contains tab",
56567
56625
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
56568
- extendedInformation: `
56569
- https://docs.abapopenchecks.org/checks/09/
56626
+ extendedInformation: `
56627
+ https://docs.abapopenchecks.org/checks/09/
56570
56628
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
56571
56629
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
56572
56630
  badExample: `\tWRITE 'hello world'.`,
@@ -56653,10 +56711,10 @@ class CyclicOO {
56653
56711
  key: "cyclic_oo",
56654
56712
  title: "Cyclic OO",
56655
56713
  shortDescription: `Finds cyclic/circular OO references`,
56656
- extendedInformation: `Runs for global INTF + CLAS objects
56657
-
56658
- Objects must be without syntax errors for this rule to take effect
56659
-
56714
+ extendedInformation: `Runs for global INTF + CLAS objects
56715
+
56716
+ Objects must be without syntax errors for this rule to take effect
56717
+
56660
56718
  References in testclass includes are ignored`,
56661
56719
  };
56662
56720
  }
@@ -56898,7 +56956,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
56898
56956
  key: "dangerous_statement",
56899
56957
  title: "Dangerous statement",
56900
56958
  shortDescription: `Detects potentially dangerous statements`,
56901
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
56959
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
56902
56960
  dynamic SQL can potentially create SQL injection problems`,
56903
56961
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
56904
56962
  };
@@ -57102,13 +57160,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57102
57160
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57103
57161
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57104
57162
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57105
- badExample: `FROM foo.
57106
- WRITE 'hello'.
57107
- DATA int TYPE i.
57163
+ badExample: `FROM foo.
57164
+ WRITE 'hello'.
57165
+ DATA int TYPE i.
57108
57166
  ENDFORM.`,
57109
- goodExample: `FROM foo.
57110
- DATA int TYPE i.
57111
- WRITE 'hello'.
57167
+ goodExample: `FROM foo.
57168
+ DATA int TYPE i.
57169
+ WRITE 'hello'.
57112
57170
  ENDFORM.`,
57113
57171
  };
57114
57172
  }
@@ -57647,39 +57705,39 @@ class Downport {
57647
57705
  key: "downport",
57648
57706
  title: "Downport statement",
57649
57707
  shortDescription: `Downport functionality`,
57650
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57651
- a higher level language version. If successful, various rules are applied to downport the statement.
57652
- Target downport version is always v702, thus rule is only enabled if target version is v702.
57653
-
57654
- Current rules:
57655
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57656
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57657
- * FIELD-SYMBOL() definitions are outlined
57658
- * CONV is outlined
57659
- * COND is outlined
57660
- * REDUCE is outlined
57661
- * SWITCH is outlined
57662
- * FILTER is outlined
57663
- * APPEND expression is outlined
57664
- * INSERT expression is outlined
57665
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57666
- * CAST changed to ?=
57667
- * LOOP AT method_call( ) is outlined
57668
- * VALUE # with structure fields
57669
- * VALUE # with internal table lines
57670
- * Table Expressions are outlined
57671
- * SELECT INTO @DATA definitions are outlined
57672
- * Some occurrences of string template formatting option ALPHA changed to function module call
57673
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57674
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57675
- * RAISE EXCEPTION ... MESSAGE
57676
- * Moving with +=, -=, /=, *=, &&= is expanded
57677
- * line_exists and line_index is downported to READ TABLE
57678
- * ENUMs, but does not nessesarily give the correct type and value
57679
- * MESSAGE with non simple source
57680
-
57681
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57682
-
57708
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
57709
+ a higher level language version. If successful, various rules are applied to downport the statement.
57710
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
57711
+
57712
+ Current rules:
57713
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
57714
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
57715
+ * FIELD-SYMBOL() definitions are outlined
57716
+ * CONV is outlined
57717
+ * COND is outlined
57718
+ * REDUCE is outlined
57719
+ * SWITCH is outlined
57720
+ * FILTER is outlined
57721
+ * APPEND expression is outlined
57722
+ * INSERT expression is outlined
57723
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
57724
+ * CAST changed to ?=
57725
+ * LOOP AT method_call( ) is outlined
57726
+ * VALUE # with structure fields
57727
+ * VALUE # with internal table lines
57728
+ * Table Expressions are outlined
57729
+ * SELECT INTO @DATA definitions are outlined
57730
+ * Some occurrences of string template formatting option ALPHA changed to function module call
57731
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
57732
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
57733
+ * RAISE EXCEPTION ... MESSAGE
57734
+ * Moving with +=, -=, /=, *=, &&= is expanded
57735
+ * line_exists and line_index is downported to READ TABLE
57736
+ * ENUMs, but does not nessesarily give the correct type and value
57737
+ * MESSAGE with non simple source
57738
+
57739
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
57740
+
57683
57741
  Make sure to test the downported code, it might not always be completely correct.`,
57684
57742
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
57685
57743
  };
@@ -58257,10 +58315,10 @@ Make sure to test the downported code, it might not always be completely correct
58257
58315
  const fieldName = f.concatTokens();
58258
58316
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58259
58317
  }
58260
- fieldDefinition = `DATA: BEGIN OF ${name},
58318
+ fieldDefinition = `DATA: BEGIN OF ${name},
58261
58319
  ${fieldDefinition}${indentation} END OF ${name}.`;
58262
58320
  }
58263
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58321
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58264
58322
  ${indentation}`);
58265
58323
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58266
58324
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58304,12 +58362,12 @@ ${indentation}`);
58304
58362
  }
58305
58363
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58306
58364
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
58307
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58308
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58309
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58365
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58366
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58367
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58310
58368
  ${indentation}`);
58311
58369
  if (fieldDefinitions === "") {
58312
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58370
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58313
58371
  ${indentation}`);
58314
58372
  }
58315
58373
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58377,7 +58435,7 @@ ${indentation}`);
58377
58435
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58378
58436
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58379
58437
  const firstToken = high.getFirstToken();
58380
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58438
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58381
58439
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58382
58440
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58383
58441
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58431,7 +58489,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58431
58489
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58432
58490
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58433
58491
  const firstToken = high.getFirstToken();
58434
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58492
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
58435
58493
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58436
58494
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
58437
58495
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58473,14 +58531,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
58473
58531
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58474
58532
  const firstToken = high.getFirstToken();
58475
58533
  // note that the tabix restore should be done before throwing the exception
58476
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58477
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58478
- ${indentation}${tabixBackup} = sy-tabix.
58479
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58480
- ${indentation}sy-tabix = ${tabixBackup}.
58481
- ${indentation}IF sy-subrc <> 0.
58482
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58483
- ${indentation}ENDIF.
58534
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
58535
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58536
+ ${indentation}${tabixBackup} = sy-tabix.
58537
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
58538
+ ${indentation}sy-tabix = ${tabixBackup}.
58539
+ ${indentation}IF sy-subrc <> 0.
58540
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58541
+ ${indentation}ENDIF.
58484
58542
  ${indentation}`);
58485
58543
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
58486
58544
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58537,7 +58595,7 @@ ${indentation}`);
58537
58595
  const className = classNames[0].concatTokens();
58538
58596
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58539
58597
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58540
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
58598
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
58541
58599
  ${indentation}CATCH ${className} INTO ${targetName}.`;
58542
58600
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
58543
58601
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -58699,16 +58757,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
58699
58757
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58700
58758
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58701
58759
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
58702
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58703
- ${indentation}${uniqueName1}-msgid = ${id}.
58760
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
58761
+ ${indentation}${uniqueName1}-msgid = ${id}.
58704
58762
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
58705
58763
  if (withs.length > 0) {
58706
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58707
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58708
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58764
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
58765
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
58766
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
58709
58767
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
58710
58768
  }
58711
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58769
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
58712
58770
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
58713
58771
  if (withs.length > 0) {
58714
58772
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -58820,10 +58878,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
58820
58878
  let code = "";
58821
58879
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
58822
58880
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58823
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
58824
- IF sy-subrc <> 0.
58825
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58826
- ENDIF.
58881
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
58882
+ IF sy-subrc <> 0.
58883
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58884
+ ENDIF.
58827
58885
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
58828
58886
  }
58829
58887
  else {
@@ -58912,20 +58970,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
58912
58970
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58913
58971
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58914
58972
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58915
- code += ` items LIKE ${loopSourceName},
58916
- END OF ${groupTargetName}type.
58917
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
58918
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
58973
+ code += ` items LIKE ${loopSourceName},
58974
+ END OF ${groupTargetName}type.
58975
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
58976
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
58919
58977
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
58920
58978
  if (groupIndexName !== undefined) {
58921
58979
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
58922
58980
  }
58923
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
58981
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
58924
58982
  IF sy-subrc = 0.\n`;
58925
58983
  if (groupCountName !== undefined) {
58926
58984
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
58927
58985
  }
58928
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
58986
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
58929
58987
  ELSE.\n`;
58930
58988
  code += ` CLEAR ${uniqueName}.\n`;
58931
58989
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -58946,8 +59004,8 @@ ELSE.\n`;
58946
59004
  }
58947
59005
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
58948
59006
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
58949
- code += `ENDIF.
58950
- ENDLOOP.
59007
+ code += `ENDIF.
59008
+ ENDLOOP.
58951
59009
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
58952
59010
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
58953
59011
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59119,7 +59177,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59119
59177
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59120
59178
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59121
59179
  // all ENUMS are char like?
59122
- let code = `TYPES ${enumName} TYPE string.
59180
+ let code = `TYPES ${enumName} TYPE string.
59123
59181
  CONSTANTS: BEGIN OF ${structureName},\n`;
59124
59182
  let count = 1;
59125
59183
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59163,14 +59221,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59163
59221
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59164
59222
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59165
59223
  // restore tabix before exeption
59166
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59167
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59168
- ${indentation}${tabixBackup} = sy-tabix.
59169
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59170
- ${indentation}sy-tabix = ${tabixBackup}.
59171
- ${indentation}IF sy-subrc <> 0.
59172
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59173
- ${indentation}ENDIF.
59224
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59225
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59226
+ ${indentation}${tabixBackup} = sy-tabix.
59227
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59228
+ ${indentation}sy-tabix = ${tabixBackup}.
59229
+ ${indentation}IF sy-subrc <> 0.
59230
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59231
+ ${indentation}ENDIF.
59174
59232
  ${indentation}${uniqueName}`;
59175
59233
  const start = target.getFirstToken().getStart();
59176
59234
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59254,11 +59312,11 @@ ${indentation}${uniqueName}`;
59254
59312
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59255
59313
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59256
59314
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59257
- const code = `DATA ${uniqueName} TYPE string.
59258
- ${indentation}CALL FUNCTION '${functionName}'
59259
- ${indentation} EXPORTING
59260
- ${indentation} input = ${source}
59261
- ${indentation} IMPORTING
59315
+ const code = `DATA ${uniqueName} TYPE string.
59316
+ ${indentation}CALL FUNCTION '${functionName}'
59317
+ ${indentation} EXPORTING
59318
+ ${indentation} input = ${source}
59319
+ ${indentation} IMPORTING
59262
59320
  ${indentation} output = ${uniqueName}.\n`;
59263
59321
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59264
59322
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -60570,12 +60628,12 @@ class EasyToFindMessages {
60570
60628
  key: "easy_to_find_messages",
60571
60629
  title: "Easy to find messages",
60572
60630
  shortDescription: `Make messages easy to find`,
60573
- extendedInformation: `All messages must be statically referenced exactly once
60574
-
60575
- Only MESSAGE and RAISE statments are counted as static references
60576
-
60577
- Also see rule "message_exists"
60578
-
60631
+ extendedInformation: `All messages must be statically referenced exactly once
60632
+
60633
+ Only MESSAGE and RAISE statments are counted as static references
60634
+
60635
+ Also see rule "message_exists"
60636
+
60579
60637
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
60580
60638
  tags: [_irule_1.RuleTag.Styleguide],
60581
60639
  };
@@ -60660,8 +60718,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
60660
60718
  key: "empty_line_in_statement",
60661
60719
  title: "Find empty lines in statements",
60662
60720
  shortDescription: `Checks that statements do not contain empty lines.`,
60663
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
60664
-
60721
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
60722
+
60665
60723
  https://docs.abapopenchecks.org/checks/41/`,
60666
60724
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
60667
60725
  badExample: `WRITE\n\nhello.`,
@@ -60837,13 +60895,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
60837
60895
  shortDescription: `Checks that the code does not contain empty blocks.`,
60838
60896
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
60839
60897
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
60840
- badExample: `IF foo = bar.
60841
- ENDIF.
60842
-
60843
- DO 2 TIMES.
60898
+ badExample: `IF foo = bar.
60899
+ ENDIF.
60900
+
60901
+ DO 2 TIMES.
60844
60902
  ENDDO.`,
60845
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
60846
- ENDLOOP.
60903
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
60904
+ ENDLOOP.
60847
60905
  result = xsdbool( sy-subrc = 0 ).`,
60848
60906
  };
60849
60907
  }
@@ -60985,10 +61043,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
60985
61043
  return {
60986
61044
  key: "exit_or_check",
60987
61045
  title: "Find EXIT or CHECK outside loops",
60988
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61046
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
60989
61047
  Use RETURN to leave procesing blocks instead.`,
60990
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
60991
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61048
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61049
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
60992
61050
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
60993
61051
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60994
61052
  };
@@ -61071,12 +61129,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61071
61129
  key: "expand_macros",
61072
61130
  title: "Expand Macros",
61073
61131
  shortDescription: `Allows expanding macro calls with quick fixes`,
61074
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61075
-
61132
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61133
+
61076
61134
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61077
- badExample: `DEFINE _hello.
61078
- WRITE 'hello'.
61079
- END-OF-DEFINITION.
61135
+ badExample: `DEFINE _hello.
61136
+ WRITE 'hello'.
61137
+ END-OF-DEFINITION.
61080
61138
  _hello.`,
61081
61139
  goodExample: `WRITE 'hello'.`,
61082
61140
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61163,7 +61221,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61163
61221
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61164
61222
  badExample: `call_method( EXPORTING foo = bar ).`,
61165
61223
  goodExample: `call_method( foo = bar ).`,
61166
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61224
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61167
61225
  https://docs.abapopenchecks.org/checks/30/`,
61168
61226
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61169
61227
  };
@@ -61261,7 +61319,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61261
61319
  key: "forbidden_identifier",
61262
61320
  title: "Forbidden Identifier",
61263
61321
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61264
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61322
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61265
61323
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61266
61324
  tags: [_irule_1.RuleTag.SingleFile],
61267
61325
  };
@@ -61503,8 +61561,8 @@ class ForbiddenVoidType {
61503
61561
  key: "forbidden_void_type",
61504
61562
  title: "Forbidden Void Types",
61505
61563
  shortDescription: `Avoid usage of specified void types.`,
61506
- extendedInformation: `Inspiration:
61507
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61564
+ extendedInformation: `Inspiration:
61565
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
61508
61566
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
61509
61567
  };
61510
61568
  }
@@ -61747,7 +61805,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
61747
61805
  key: "fully_type_itabs",
61748
61806
  title: "Fully type internal tables",
61749
61807
  shortDescription: `No implict table types or table keys`,
61750
- badExample: `DATA lt_foo TYPE TABLE OF ty.
61808
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
61751
61809
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
61752
61810
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
61753
61811
  tags: [_irule_1.RuleTag.SingleFile],
@@ -61932,26 +61990,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
61932
61990
  key: "functional_writing",
61933
61991
  title: "Use functional writing",
61934
61992
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
61935
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
61993
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
61936
61994
  https://docs.abapopenchecks.org/checks/07/`,
61937
61995
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61938
- badExample: `CALL METHOD zcl_class=>method( ).
61939
- CALL METHOD cl_abap_typedescr=>describe_by_name
61940
- EXPORTING
61941
- p_name = 'NAME'
61942
- RECEIVING
61943
- p_descr_ref = lr_typedescr
61944
- EXCEPTIONS
61945
- type_not_found = 1
61996
+ badExample: `CALL METHOD zcl_class=>method( ).
61997
+ CALL METHOD cl_abap_typedescr=>describe_by_name
61998
+ EXPORTING
61999
+ p_name = 'NAME'
62000
+ RECEIVING
62001
+ p_descr_ref = lr_typedescr
62002
+ EXCEPTIONS
62003
+ type_not_found = 1
61946
62004
  OTHERS = 2.`,
61947
- goodExample: `zcl_class=>method( ).
61948
- cl_abap_typedescr=>describe_by_name(
61949
- EXPORTING
61950
- p_name = 'NAME'
61951
- RECEIVING
61952
- p_descr_ref = lr_typedescr
61953
- EXCEPTIONS
61954
- type_not_found = 1
62005
+ goodExample: `zcl_class=>method( ).
62006
+ cl_abap_typedescr=>describe_by_name(
62007
+ EXPORTING
62008
+ p_name = 'NAME'
62009
+ RECEIVING
62010
+ p_descr_ref = lr_typedescr
62011
+ EXCEPTIONS
62012
+ type_not_found = 1
61955
62013
  OTHERS = 2 ).`,
61956
62014
  };
61957
62015
  }
@@ -62062,14 +62120,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62062
62120
  key: "global_class",
62063
62121
  title: "Global class checks",
62064
62122
  shortDescription: `Checks related to global classes`,
62065
- extendedInformation: `* global classes must be in own files
62066
-
62067
- * file names must match class name
62068
-
62069
- * file names must match interface name
62070
-
62071
- * global classes must be global definitions
62072
-
62123
+ extendedInformation: `* global classes must be in own files
62124
+
62125
+ * file names must match class name
62126
+
62127
+ * file names must match interface name
62128
+
62129
+ * global classes must be global definitions
62130
+
62073
62131
  * global interfaces must be global definitions`,
62074
62132
  tags: [_irule_1.RuleTag.Syntax],
62075
62133
  };
@@ -62168,21 +62226,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62168
62226
  return {
62169
62227
  key: "identical_conditions",
62170
62228
  title: "Identical conditions",
62171
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62172
-
62229
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62230
+
62173
62231
  Prerequsites: code is pretty printed with identical cAsE`,
62174
62232
  tags: [_irule_1.RuleTag.SingleFile],
62175
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62176
- ENDIF.
62177
- CASE bar.
62178
- WHEN '1'.
62179
- WHEN 'A' OR '1'.
62233
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62234
+ ENDIF.
62235
+ CASE bar.
62236
+ WHEN '1'.
62237
+ WHEN 'A' OR '1'.
62180
62238
  ENDCASE.`,
62181
- goodExample: `IF foo = bar OR 1 = a.
62182
- ENDIF.
62183
- CASE bar.
62184
- WHEN '1'.
62185
- WHEN 'A'.
62239
+ goodExample: `IF foo = bar OR 1 = a.
62240
+ ENDIF.
62241
+ CASE bar.
62242
+ WHEN '1'.
62243
+ WHEN 'A'.
62186
62244
  ENDCASE.`,
62187
62245
  };
62188
62246
  }
@@ -62316,23 +62374,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
62316
62374
  key: "identical_contents",
62317
62375
  title: "Identical contents",
62318
62376
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
62319
- extendedInformation: `
62320
- Prerequsites: code is pretty printed with identical cAsE
62321
-
62377
+ extendedInformation: `
62378
+ Prerequsites: code is pretty printed with identical cAsE
62379
+
62322
62380
  Chained statments are ignored`,
62323
62381
  tags: [_irule_1.RuleTag.SingleFile],
62324
- badExample: `IF foo = bar.
62325
- WRITE 'bar'.
62326
- WRITE 'world'.
62327
- ELSE.
62328
- WRITE 'foo'.
62329
- WRITE 'world'.
62382
+ badExample: `IF foo = bar.
62383
+ WRITE 'bar'.
62384
+ WRITE 'world'.
62385
+ ELSE.
62386
+ WRITE 'foo'.
62387
+ WRITE 'world'.
62330
62388
  ENDIF.`,
62331
- goodExample: `IF foo = bar.
62332
- WRITE 'bar'.
62333
- ELSE.
62334
- WRITE 'foo'.
62335
- ENDIF.
62389
+ goodExample: `IF foo = bar.
62390
+ WRITE 'bar'.
62391
+ ELSE.
62392
+ WRITE 'foo'.
62393
+ ENDIF.
62336
62394
  WRITE 'world'.`,
62337
62395
  };
62338
62396
  }
@@ -62440,12 +62498,12 @@ class IdenticalDescriptions {
62440
62498
  key: "identical_descriptions",
62441
62499
  title: "Identical descriptions",
62442
62500
  shortDescription: `Searches for objects with the same type and same description`,
62443
- extendedInformation: `Case insensitive
62444
-
62445
- Only checks the master language descriptions
62446
-
62447
- Dependencies are skipped
62448
-
62501
+ extendedInformation: `Case insensitive
62502
+
62503
+ Only checks the master language descriptions
62504
+
62505
+ Dependencies are skipped
62506
+
62449
62507
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
62450
62508
  tags: [],
62451
62509
  };
@@ -62619,43 +62677,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
62619
62677
  key: "if_in_if",
62620
62678
  title: "IF in IF",
62621
62679
  shortDescription: `Detects nested ifs which can be refactored.`,
62622
- extendedInformation: `
62623
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
62624
-
62625
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62626
-
62627
- https://docs.abapopenchecks.org/checks/01/
62680
+ extendedInformation: `
62681
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
62682
+
62683
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
62684
+
62685
+ https://docs.abapopenchecks.org/checks/01/
62628
62686
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
62629
- badExample: `IF condition1.
62630
- IF condition2.
62631
- ...
62632
- ENDIF.
62633
- ENDIF.
62634
-
62635
- IF condition1.
62636
- ...
62637
- ELSE.
62638
- IF condition2.
62639
- ...
62640
- ENDIF.
62687
+ badExample: `IF condition1.
62688
+ IF condition2.
62689
+ ...
62690
+ ENDIF.
62691
+ ENDIF.
62692
+
62693
+ IF condition1.
62694
+ ...
62695
+ ELSE.
62696
+ IF condition2.
62697
+ ...
62698
+ ENDIF.
62641
62699
  ENDIF.`,
62642
- goodExample: `IF ( condition1 ) AND ( condition2 ).
62643
- ...
62644
- ENDIF.
62645
-
62646
- IF condition1.
62647
- ...
62648
- ELSEIF condition2.
62649
- ...
62650
- ENDIF.
62651
-
62652
- CASE variable.
62653
- WHEN value1.
62654
- ...
62655
- WHEN value2.
62656
- IF condition2.
62657
- ...
62658
- ENDIF.
62700
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
62701
+ ...
62702
+ ENDIF.
62703
+
62704
+ IF condition1.
62705
+ ...
62706
+ ELSEIF condition2.
62707
+ ...
62708
+ ENDIF.
62709
+
62710
+ CASE variable.
62711
+ WHEN value1.
62712
+ ...
62713
+ WHEN value2.
62714
+ IF condition2.
62715
+ ...
62716
+ ENDIF.
62659
62717
  ENDCASE.`,
62660
62718
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62661
62719
  };
@@ -62840,9 +62898,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
62840
62898
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
62841
62899
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
62842
62900
  if (name === impl.identifier.getName().toUpperCase()) {
62843
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
62844
- METHOD ${methodName.toLowerCase()}.
62845
- RETURN. " todo, implement method
62901
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
62902
+ METHOD ${methodName.toLowerCase()}.
62903
+ RETURN. " todo, implement method
62846
62904
  ENDMETHOD.`);
62847
62905
  }
62848
62906
  }
@@ -63030,19 +63088,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63030
63088
  key: "in_statement_indentation",
63031
63089
  title: "In-statement indentation",
63032
63090
  shortDescription: "Checks alignment within statements which span multiple lines.",
63033
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63034
-
63035
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63091
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63092
+
63093
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63036
63094
  to distinguish them better from code within the block.`,
63037
- badExample: `IF 1 = 1
63038
- AND 2 = 2.
63039
- WRITE 'hello' &&
63040
- 'world'.
63095
+ badExample: `IF 1 = 1
63096
+ AND 2 = 2.
63097
+ WRITE 'hello' &&
63098
+ 'world'.
63041
63099
  ENDIF.`,
63042
- goodExample: `IF 1 = 1
63043
- AND 2 = 2.
63044
- WRITE 'hello' &&
63045
- 'world'.
63100
+ goodExample: `IF 1 = 1
63101
+ AND 2 = 2.
63102
+ WRITE 'hello' &&
63103
+ 'world'.
63046
63104
  ENDIF.`,
63047
63105
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63048
63106
  };
@@ -63165,23 +63223,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63165
63223
  title: "Indentation",
63166
63224
  shortDescription: `Checks indentation`,
63167
63225
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63168
- badExample: `CLASS lcl DEFINITION.
63169
- PRIVATE SECTION.
63170
- METHODS constructor.
63171
- ENDCLASS.
63172
-
63173
- CLASS lcl IMPLEMENTATION.
63174
- METHOD constructor.
63175
- ENDMETHOD.
63226
+ badExample: `CLASS lcl DEFINITION.
63227
+ PRIVATE SECTION.
63228
+ METHODS constructor.
63229
+ ENDCLASS.
63230
+
63231
+ CLASS lcl IMPLEMENTATION.
63232
+ METHOD constructor.
63233
+ ENDMETHOD.
63176
63234
  ENDCLASS.`,
63177
- goodExample: `CLASS lcl DEFINITION.
63178
- PRIVATE SECTION.
63179
- METHODS constructor.
63180
- ENDCLASS.
63181
-
63182
- CLASS lcl IMPLEMENTATION.
63183
- METHOD constructor.
63184
- ENDMETHOD.
63235
+ goodExample: `CLASS lcl DEFINITION.
63236
+ PRIVATE SECTION.
63237
+ METHODS constructor.
63238
+ ENDCLASS.
63239
+
63240
+ CLASS lcl IMPLEMENTATION.
63241
+ METHOD constructor.
63242
+ ENDMETHOD.
63185
63243
  ENDCLASS.`,
63186
63244
  };
63187
63245
  }
@@ -63571,9 +63629,9 @@ class IntfReferencingClas {
63571
63629
  key: "intf_referencing_clas",
63572
63630
  title: "INTF referencing CLAS",
63573
63631
  shortDescription: `Interface contains references to class`,
63574
- extendedInformation: `Only global interfaces are checked.
63575
- Only first level references are checked.
63576
- Exception class references are ignored.
63632
+ extendedInformation: `Only global interfaces are checked.
63633
+ Only first level references are checked.
63634
+ Exception class references are ignored.
63577
63635
  Void references are ignored.`,
63578
63636
  };
63579
63637
  }
@@ -63658,9 +63716,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
63658
63716
  title: "Invalid Table Index",
63659
63717
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
63660
63718
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63661
- badExample: `DATA(first) = table[ 0 ].
63719
+ badExample: `DATA(first) = table[ 0 ].
63662
63720
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
63663
- goodExample: `DATA(first) = table[ 1 ].
63721
+ goodExample: `DATA(first) = table[ 1 ].
63664
63722
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
63665
63723
  };
63666
63724
  }
@@ -64261,8 +64319,8 @@ class LineBreakStyle {
64261
64319
  return {
64262
64320
  key: "line_break_style",
64263
64321
  title: "Makes sure line breaks are consistent in the ABAP code",
64264
- shortDescription: `Enforces LF as newlines in ABAP files
64265
-
64322
+ shortDescription: `Enforces LF as newlines in ABAP files
64323
+
64266
64324
  abapGit does not work with CRLF`,
64267
64325
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
64268
64326
  };
@@ -64331,7 +64389,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
64331
64389
  key: "line_length",
64332
64390
  title: "Line length",
64333
64391
  shortDescription: `Detects lines exceeding the provided maximum length.`,
64334
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64392
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
64335
64393
  https://docs.abapopenchecks.org/checks/04/`,
64336
64394
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64337
64395
  };
@@ -64402,7 +64460,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
64402
64460
  key: "line_only_punc",
64403
64461
  title: "Line containing only punctuation",
64404
64462
  shortDescription: `Detects lines containing only punctuation.`,
64405
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64463
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
64406
64464
  https://docs.abapopenchecks.org/checks/16/`,
64407
64465
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64408
64466
  badExample: "zcl_class=>method(\n).",
@@ -64662,15 +64720,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
64662
64720
  return {
64663
64721
  key: "local_variable_names",
64664
64722
  title: "Local variable naming conventions",
64665
- shortDescription: `
64666
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
64723
+ shortDescription: `
64724
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
64667
64725
  Regexes are case-insensitive.`,
64668
64726
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
64669
- badExample: `FORM bar.
64670
- DATA foo.
64727
+ badExample: `FORM bar.
64728
+ DATA foo.
64671
64729
  ENDFORM.`,
64672
- goodExample: `FORM bar.
64673
- DATA lv_foo.
64730
+ goodExample: `FORM bar.
64731
+ DATA lv_foo.
64674
64732
  ENDFORM.`,
64675
64733
  };
64676
64734
  }
@@ -64822,9 +64880,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
64822
64880
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
64823
64881
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
64824
64882
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
64825
- badExample: `DEFINE something.
64883
+ badExample: `DEFINE something.
64826
64884
  END-OF-DEFINITION.`,
64827
- goodExample: `DEFINE _something.
64885
+ goodExample: `DEFINE _something.
64828
64886
  END-OF-DEFINITION.`,
64829
64887
  };
64830
64888
  }
@@ -64897,10 +64955,10 @@ class MainFileContents {
64897
64955
  key: "main_file_contents",
64898
64956
  title: "Main file contents",
64899
64957
  shortDescription: `Checks related to report declarations.`,
64900
- extendedInformation: `Does not run if the target version is Cloud
64901
-
64902
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
64903
- * TYPEs must begin with "TYPE-POOL <name>."
64958
+ extendedInformation: `Does not run if the target version is Cloud
64959
+
64960
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
64961
+ * TYPEs must begin with "TYPE-POOL <name>."
64904
64962
  `,
64905
64963
  };
64906
64964
  }
@@ -65016,17 +65074,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65016
65074
  title: "Too many parentheses",
65017
65075
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65018
65076
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65019
- badExample: `
65020
- IF ( destination IS INITIAL ).
65021
- ENDIF.
65022
- IF foo = boo AND ( bar = lar AND moo = loo ).
65023
- ENDIF.
65077
+ badExample: `
65078
+ IF ( destination IS INITIAL ).
65079
+ ENDIF.
65080
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65081
+ ENDIF.
65024
65082
  `,
65025
- goodExample: `
65026
- IF destination IS INITIAL.
65027
- ENDIF.
65028
- IF foo = boo AND bar = lar AND moo = loo.
65029
- ENDIF.
65083
+ goodExample: `
65084
+ IF destination IS INITIAL.
65085
+ ENDIF.
65086
+ IF foo = boo AND bar = lar AND moo = loo.
65087
+ ENDIF.
65030
65088
  `,
65031
65089
  };
65032
65090
  }
@@ -65200,14 +65258,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
65200
65258
  title: "Max one method parameter definition per line",
65201
65259
  shortDescription: `Keep max one method parameter description per line`,
65202
65260
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
65203
- badExample: `
65204
- METHODS apps_scope_token
65205
- IMPORTING
65261
+ badExample: `
65262
+ METHODS apps_scope_token
65263
+ IMPORTING
65206
65264
  body TYPE bodyapps_scope_token client_id TYPE str.`,
65207
- goodExample: `
65208
- METHODS apps_scope_token
65209
- IMPORTING
65210
- body TYPE bodyapps_scope_token
65265
+ goodExample: `
65266
+ METHODS apps_scope_token
65267
+ IMPORTING
65268
+ body TYPE bodyapps_scope_token
65211
65269
  client_id TYPE str.`,
65212
65270
  };
65213
65271
  }
@@ -65272,11 +65330,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
65272
65330
  key: "max_one_statement",
65273
65331
  title: "Max one statement per line",
65274
65332
  shortDescription: `Checks that each line contains only a single statement.`,
65275
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65276
-
65277
- Does not report anything for chained statements.
65278
-
65279
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65333
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
65334
+
65335
+ Does not report anything for chained statements.
65336
+
65337
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
65280
65338
  https://docs.abapopenchecks.org/checks/11/`,
65281
65339
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65282
65340
  badExample: `WRITE foo. WRITE bar.`,
@@ -65614,8 +65672,8 @@ class MethodLength {
65614
65672
  key: "method_length",
65615
65673
  title: "Method/Form Length",
65616
65674
  shortDescription: `Checks relating to method/form length.`,
65617
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
65618
-
65675
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
65676
+
65619
65677
  Abstract methods without statements are considered okay.`,
65620
65678
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65621
65679
  };
@@ -65720,20 +65778,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
65720
65778
  key: "method_overwrites_builtin",
65721
65779
  title: "Method name overwrites builtin function",
65722
65780
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
65723
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
65724
-
65725
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
65726
-
65781
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
65782
+
65783
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
65784
+
65727
65785
  Interface method names are ignored`,
65728
65786
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
65729
- badExample: `CLASS lcl DEFINITION.
65730
- PUBLIC SECTION.
65731
- METHODS matches.
65732
- ENDCLASS.
65733
-
65734
- CLASS lcl IMPLEMENTATION.
65735
- METHOD matches.
65736
- ENDMETHOD.
65787
+ badExample: `CLASS lcl DEFINITION.
65788
+ PUBLIC SECTION.
65789
+ METHODS matches.
65790
+ ENDCLASS.
65791
+
65792
+ CLASS lcl IMPLEMENTATION.
65793
+ METHOD matches.
65794
+ ENDMETHOD.
65737
65795
  ENDCLASS.`,
65738
65796
  };
65739
65797
  }
@@ -65924,12 +65982,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
65924
65982
  // eslint-disable-next-line max-len
65925
65983
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
65926
65984
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65927
- badExample: `CLASS lcl DEFINITION.
65928
- PUBLIC SECTION.
65929
- METHODS
65930
- foobar
65931
- EXPORTING foo TYPE i
65932
- RETURNING VALUE(rv_string) TYPE string.
65985
+ badExample: `CLASS lcl DEFINITION.
65986
+ PUBLIC SECTION.
65987
+ METHODS
65988
+ foobar
65989
+ EXPORTING foo TYPE i
65990
+ RETURNING VALUE(rv_string) TYPE string.
65933
65991
  ENDCLASS.`,
65934
65992
  };
65935
65993
  }
@@ -66309,7 +66367,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
66309
66367
  key: "nesting",
66310
66368
  title: "Check nesting depth",
66311
66369
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
66312
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66370
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
66313
66371
  https://docs.abapopenchecks.org/checks/74/`,
66314
66372
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66315
66373
  };
@@ -66552,7 +66610,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
66552
66610
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
66553
66611
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66554
66612
  badExample: `var1 = var2 = var3.`,
66555
- goodExample: `var2 = var3.
66613
+ goodExample: `var2 = var3.
66556
66614
  var1 = var2.`,
66557
66615
  };
66558
66616
  }
@@ -66611,8 +66669,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
66611
66669
  key: "no_external_form_calls",
66612
66670
  title: "No external FORM calls",
66613
66671
  shortDescription: `Detect external form calls`,
66614
- badExample: `PERFORM foo IN PROGRAM bar.
66615
-
66672
+ badExample: `PERFORM foo IN PROGRAM bar.
66673
+
66616
66674
  PERFORM foo(bar).`,
66617
66675
  tags: [_irule_1.RuleTag.SingleFile],
66618
66676
  };
@@ -66673,17 +66731,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
66673
66731
  key: "no_inline_in_optional_branches",
66674
66732
  title: "Don't declare inline in optional branches",
66675
66733
  shortDescription: `Don't declare inline in optional branches`,
66676
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
66677
-
66678
- Considered optional branches:
66679
- * inside IF/ELSEIF/ELSE
66680
- * inside LOOP
66681
- * inside WHILE
66682
- * inside CASE/WHEN, CASE TYPE OF
66683
- * inside DO
66684
- * inside SELECT loops
66685
-
66686
- Not considered optional branches:
66734
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
66735
+
66736
+ Considered optional branches:
66737
+ * inside IF/ELSEIF/ELSE
66738
+ * inside LOOP
66739
+ * inside WHILE
66740
+ * inside CASE/WHEN, CASE TYPE OF
66741
+ * inside DO
66742
+ * inside SELECT loops
66743
+
66744
+ Not considered optional branches:
66687
66745
  * TRY/CATCH/CLEANUP`,
66688
66746
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66689
66747
  };
@@ -66783,12 +66841,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
66783
66841
  key: "no_prefixes",
66784
66842
  title: "No Prefixes",
66785
66843
  shortDescription: `Dont use hungarian notation`,
66786
- extendedInformation: `
66787
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
66788
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
66789
-
66790
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
66791
-
66844
+ extendedInformation: `
66845
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
66846
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
66847
+
66848
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
66849
+
66792
66850
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
66793
66851
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66794
66852
  badExample: `DATA lv_foo TYPE i.`,
@@ -66967,7 +67025,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
66967
67025
  return {
66968
67026
  key: "no_public_attributes",
66969
67027
  title: "No public attributes",
66970
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67028
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
66971
67029
  Exceptions are excluded from this rule.`,
66972
67030
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
66973
67031
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67068,13 +67126,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67068
67126
  key: "no_yoda_conditions",
67069
67127
  title: "No Yoda conditions",
67070
67128
  shortDescription: `Finds Yoda conditions and reports issues`,
67071
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67072
-
67129
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67130
+
67073
67131
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67074
67132
  tags: [_irule_1.RuleTag.SingleFile],
67075
- badExample: `IF 0 <> sy-subrc.
67133
+ badExample: `IF 0 <> sy-subrc.
67076
67134
  ENDIF.`,
67077
- goodExample: `IF sy-subrc <> 0.
67135
+ goodExample: `IF sy-subrc <> 0.
67078
67136
  ENDIF.`,
67079
67137
  };
67080
67138
  }
@@ -67175,8 +67233,8 @@ class NROBConsistency {
67175
67233
  key: "nrob_consistency",
67176
67234
  title: "Number range consistency",
67177
67235
  shortDescription: `Consistency checks for number ranges`,
67178
- extendedInformation: `Issue reported if percentage warning is over 50%
67179
-
67236
+ extendedInformation: `Issue reported if percentage warning is over 50%
67237
+
67180
67238
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
67181
67239
  tags: [_irule_1.RuleTag.SingleFile],
67182
67240
  };
@@ -67453,58 +67511,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
67453
67511
  title: "Obsolete statements",
67454
67512
  shortDescription: `Checks for usages of certain obsolete statements`,
67455
67513
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67456
- extendedInformation: `
67457
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67458
-
67459
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67460
-
67461
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67462
-
67463
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67464
-
67465
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67466
-
67467
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67468
-
67469
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67470
-
67471
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67472
-
67473
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67474
-
67475
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67476
-
67477
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67478
-
67479
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67480
-
67481
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67482
-
67483
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67484
-
67485
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67486
- SELECT COUNT(*) is considered okay
67487
-
67488
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67489
-
67490
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67491
-
67492
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67493
-
67494
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67495
-
67496
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
67497
-
67514
+ extendedInformation: `
67515
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
67516
+
67517
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
67518
+
67519
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
67520
+
67521
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
67522
+
67523
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
67524
+
67525
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
67526
+
67527
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67528
+
67529
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
67530
+
67531
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
67532
+
67533
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
67534
+
67535
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
67536
+
67537
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
67538
+
67539
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
67540
+
67541
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
67542
+
67543
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
67544
+ SELECT COUNT(*) is considered okay
67545
+
67546
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
67547
+
67548
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
67549
+
67550
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
67551
+
67552
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
67553
+
67554
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
67555
+
67498
67556
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
67499
- badExample: `REFRESH itab.
67500
-
67501
- COMPUTE foo = 2 + 2.
67502
-
67503
- MULTIPLY lv_foo BY 2.
67504
-
67505
- INTERFACE intf LOAD.
67506
-
67507
- IF foo IS SUPPLIED.
67557
+ badExample: `REFRESH itab.
67558
+
67559
+ COMPUTE foo = 2 + 2.
67560
+
67561
+ MULTIPLY lv_foo BY 2.
67562
+
67563
+ INTERFACE intf LOAD.
67564
+
67565
+ IF foo IS SUPPLIED.
67508
67566
  ENDIF.`,
67509
67567
  };
67510
67568
  }
@@ -67844,9 +67902,9 @@ class OmitParameterName {
67844
67902
  key: "omit_parameter_name",
67845
67903
  title: "Omit parameter name",
67846
67904
  shortDescription: `Omit the parameter name in single parameter calls`,
67847
- extendedInformation: `
67848
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
67849
-
67905
+ extendedInformation: `
67906
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
67907
+
67850
67908
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
67851
67909
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67852
67910
  badExample: `method( param = 2 ).`,
@@ -68052,20 +68110,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68052
68110
  shortDescription: `Omit RECEIVING`,
68053
68111
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68054
68112
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68055
- badExample: `
68056
- upload_pack(
68057
- EXPORTING
68058
- io_client = lo_client
68059
- iv_url = iv_url
68060
- iv_deepen_level = iv_deepen_level
68061
- it_hashes = lt_hashes
68062
- RECEIVING
68113
+ badExample: `
68114
+ upload_pack(
68115
+ EXPORTING
68116
+ io_client = lo_client
68117
+ iv_url = iv_url
68118
+ iv_deepen_level = iv_deepen_level
68119
+ it_hashes = lt_hashes
68120
+ RECEIVING
68063
68121
  rt_objects = et_objects ).`,
68064
- goodExample: `
68065
- et_objects = upload_pack(
68066
- io_client = lo_client
68067
- iv_url = iv_url
68068
- iv_deepen_level = iv_deepen_level
68122
+ goodExample: `
68123
+ et_objects = upload_pack(
68124
+ io_client = lo_client
68125
+ iv_url = iv_url
68126
+ iv_deepen_level = iv_deepen_level
68069
68127
  it_hashes = lt_hashes ).`,
68070
68128
  };
68071
68129
  }
@@ -68129,8 +68187,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68129
68187
  return {
68130
68188
  key: "parser_702_chaining",
68131
68189
  title: "Parser Error, bad chanining on 702",
68132
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68133
- this rule finds these and reports errors.
68190
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68191
+ this rule finds these and reports errors.
68134
68192
  Only active on target version 702 and below.`,
68135
68193
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68136
68194
  };
@@ -68210,8 +68268,8 @@ class ParserError {
68210
68268
  return {
68211
68269
  key: "parser_error",
68212
68270
  title: "Parser error",
68213
- shortDescription: `Checks for syntax not recognized by abaplint.
68214
-
68271
+ shortDescription: `Checks for syntax not recognized by abaplint.
68272
+
68215
68273
  See recognized syntax at https://syntax.abaplint.org`,
68216
68274
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68217
68275
  };
@@ -68296,7 +68354,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
68296
68354
  return {
68297
68355
  key: "parser_missing_space",
68298
68356
  title: "Parser Error, missing space",
68299
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68357
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
68300
68358
  This rule makes sure the spaces are consistently required across the language.`,
68301
68359
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
68302
68360
  badExample: `IF ( foo = 'bar').`,
@@ -68708,25 +68766,25 @@ class PreferInline {
68708
68766
  key: "prefer_inline",
68709
68767
  title: "Prefer Inline Declarations",
68710
68768
  shortDescription: `Prefer inline to up-front declarations.`,
68711
- extendedInformation: `EXPERIMENTAL
68712
-
68713
- Activates if language version is v740sp02 or above.
68714
-
68715
- Variables must be local(METHOD or FORM).
68716
-
68717
- No generic or void typed variables. No syntax errors.
68718
-
68719
- First position used must be a full/pure write.
68720
-
68721
- Move statment is not a cast(?=)
68722
-
68769
+ extendedInformation: `EXPERIMENTAL
68770
+
68771
+ Activates if language version is v740sp02 or above.
68772
+
68773
+ Variables must be local(METHOD or FORM).
68774
+
68775
+ No generic or void typed variables. No syntax errors.
68776
+
68777
+ First position used must be a full/pure write.
68778
+
68779
+ Move statment is not a cast(?=)
68780
+
68723
68781
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
68724
68782
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
68725
- badExample: `DATA foo TYPE i.
68726
- foo = 2.
68727
- DATA percentage TYPE decfloat34.
68783
+ badExample: `DATA foo TYPE i.
68784
+ foo = 2.
68785
+ DATA percentage TYPE decfloat34.
68728
68786
  percentage = ( comment_number / abs_statement_number ) * 100.`,
68729
- goodExample: `DATA(foo) = 2.
68787
+ goodExample: `DATA(foo) = 2.
68730
68788
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
68731
68789
  };
68732
68790
  }
@@ -68940,18 +68998,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
68940
68998
  key: "prefer_is_not",
68941
68999
  title: "Prefer IS NOT to NOT IS",
68942
69000
  shortDescription: `Prefer IS NOT to NOT IS`,
68943
- extendedInformation: `
68944
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
68945
-
69001
+ extendedInformation: `
69002
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69003
+
68946
69004
  "if not is_valid( )." examples are skipped`,
68947
69005
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
68948
- goodExample: `IF variable IS NOT INITIAL.
68949
- IF variable NP 'TODO*'.
68950
- IF variable <> 42.
69006
+ goodExample: `IF variable IS NOT INITIAL.
69007
+ IF variable NP 'TODO*'.
69008
+ IF variable <> 42.
68951
69009
  IF variable CO 'hello'.`,
68952
- badExample: `IF NOT variable IS INITIAL.
68953
- IF NOT variable CP 'TODO*'.
68954
- IF NOT variable = 42.
69010
+ badExample: `IF NOT variable IS INITIAL.
69011
+ IF NOT variable CP 'TODO*'.
69012
+ IF NOT variable = 42.
68955
69013
  IF NOT variable CA 'hello'.`,
68956
69014
  };
68957
69015
  }
@@ -69139,14 +69197,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69139
69197
  key: "prefer_raise_exception_new",
69140
69198
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69141
69199
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69142
- extendedInformation: `
69143
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69144
-
69200
+ extendedInformation: `
69201
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69202
+
69145
69203
  From 752 and up`,
69146
69204
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69147
69205
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69148
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69149
- EXPORTING
69206
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69207
+ EXPORTING
69150
69208
  previous = exception.`,
69151
69209
  };
69152
69210
  }
@@ -69224,12 +69282,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
69224
69282
  key: "prefer_returning_to_exporting",
69225
69283
  title: "Prefer RETURNING to EXPORTING",
69226
69284
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
69227
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69285
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
69228
69286
  https://docs.abapopenchecks.org/checks/44/`,
69229
69287
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69230
- badExample: `CLASS lcl DEFINITION.
69231
- PUBLIC SECTION.
69232
- METHODS test EXPORTING ev_foo TYPE i.
69288
+ badExample: `CLASS lcl DEFINITION.
69289
+ PUBLIC SECTION.
69290
+ METHODS test EXPORTING ev_foo TYPE i.
69233
69291
  ENDCLASS.`,
69234
69292
  };
69235
69293
  }
@@ -69325,8 +69383,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
69325
69383
  key: "prefer_xsdbool",
69326
69384
  title: "Prefer xsdbool over boolc",
69327
69385
  shortDescription: `Prefer xsdbool over boolc`,
69328
- extendedInformation: `Activates if language version is v740sp08 or above.
69329
-
69386
+ extendedInformation: `Activates if language version is v740sp08 or above.
69387
+
69330
69388
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
69331
69389
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69332
69390
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -69398,9 +69456,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
69398
69456
  title: "Preferred compare operator",
69399
69457
  shortDescription: `Configure undesired operator variants`,
69400
69458
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
69401
- badExample: `IF foo EQ bar.
69459
+ badExample: `IF foo EQ bar.
69402
69460
  ENDIF.`,
69403
- goodExample: `IF foo = bar.
69461
+ goodExample: `IF foo = bar.
69404
69462
  ENDIF.`,
69405
69463
  };
69406
69464
  }
@@ -69624,26 +69682,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
69624
69682
  key: "reduce_procedural_code",
69625
69683
  title: "Reduce procedural code",
69626
69684
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
69627
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
69628
-
69629
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
69630
-
69685
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
69686
+
69687
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
69688
+
69631
69689
  Comments are not counted as statements.`,
69632
69690
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
69633
- badExample: `FORM foo.
69634
- DATA lv_bar TYPE i.
69635
- lv_bar = 2 + 2.
69636
- IF lv_bar = 4.
69637
- WRITE 'hello world'.
69638
- ENDIF.
69639
- DATA lv_bar TYPE i.
69640
- lv_bar = 2 + 2.
69641
- IF lv_bar = 4.
69642
- WRITE 'hello world'.
69643
- ENDIF.
69691
+ badExample: `FORM foo.
69692
+ DATA lv_bar TYPE i.
69693
+ lv_bar = 2 + 2.
69694
+ IF lv_bar = 4.
69695
+ WRITE 'hello world'.
69696
+ ENDIF.
69697
+ DATA lv_bar TYPE i.
69698
+ lv_bar = 2 + 2.
69699
+ IF lv_bar = 4.
69700
+ WRITE 'hello world'.
69701
+ ENDIF.
69644
69702
  ENDFORM.`,
69645
- goodExample: `FORM foo.
69646
- NEW zcl_global_class( )->run_logic( ).
69703
+ goodExample: `FORM foo.
69704
+ NEW zcl_global_class( )->run_logic( ).
69647
69705
  ENDFORM.`,
69648
69706
  };
69649
69707
  }
@@ -69887,10 +69945,10 @@ class RemoveDescriptions {
69887
69945
  return {
69888
69946
  key: "remove_descriptions",
69889
69947
  title: "Remove descriptions",
69890
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
69891
-
69892
- Class descriptions are required, see rule description_empty.
69893
-
69948
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
69949
+
69950
+ Class descriptions are required, see rule description_empty.
69951
+
69894
69952
  Consider using ABAP Doc for documentation.`,
69895
69953
  tags: [],
69896
69954
  };
@@ -70015,14 +70073,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70015
70073
  tags: [_irule_1.RuleTag.SingleFile],
70016
70074
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70017
70075
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70018
- badExample: `CALL FUNCTION 'ZRFC'
70076
+ badExample: `CALL FUNCTION 'ZRFC'
70019
70077
  DESTINATION lv_rfc.`,
70020
- goodExample: `CALL FUNCTION 'ZRFC'
70021
- DESTINATION lv_rfc
70022
- EXCEPTIONS
70023
- system_failure = 1 MESSAGE msg
70024
- communication_failure = 2 MESSAGE msg
70025
- resource_failure = 3
70078
+ goodExample: `CALL FUNCTION 'ZRFC'
70079
+ DESTINATION lv_rfc
70080
+ EXCEPTIONS
70081
+ system_failure = 1 MESSAGE msg
70082
+ communication_failure = 2 MESSAGE msg
70083
+ resource_failure = 3
70026
70084
  OTHERS = 4.`,
70027
70085
  };
70028
70086
  }
@@ -70106,11 +70164,11 @@ class SelectAddOrderBy {
70106
70164
  key: "select_add_order_by",
70107
70165
  title: "SELECT add ORDER BY",
70108
70166
  shortDescription: `SELECTs add ORDER BY clause`,
70109
- extendedInformation: `
70110
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70111
-
70112
- add ORDER BY PRIMARY KEY if in doubt
70113
-
70167
+ extendedInformation: `
70168
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70169
+
70170
+ add ORDER BY PRIMARY KEY if in doubt
70171
+
70114
70172
  If the target is a sorted/hashed table, no issue is reported`,
70115
70173
  tags: [_irule_1.RuleTag.SingleFile],
70116
70174
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -70241,14 +70299,14 @@ class SelectPerformance {
70241
70299
  key: "select_performance",
70242
70300
  title: "SELECT performance",
70243
70301
  shortDescription: `Various checks regarding SELECT performance.`,
70244
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70245
-
70302
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
70303
+
70246
70304
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
70247
70305
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
70248
- badExample: `SELECT field1, field2 FROM table
70249
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70306
+ badExample: `SELECT field1, field2 FROM table
70307
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
70250
70308
  ENDSELECT.`,
70251
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70309
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
70252
70310
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
70253
70311
  };
70254
70312
  }
@@ -70362,8 +70420,8 @@ class SelectSingleFullKey {
70362
70420
  key: "select_single_full_key",
70363
70421
  title: "Detect SELECT SINGLE which are possibily not unique",
70364
70422
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
70365
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70366
-
70423
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
70424
+
70367
70425
  If the statement contains a JOIN it is not checked`,
70368
70426
  pseudoComment: "EC CI_NOORDER",
70369
70427
  tags: [_irule_1.RuleTag.Quickfix],
@@ -70787,8 +70845,8 @@ class SICFConsistency {
70787
70845
  key: "sicf_consistency",
70788
70846
  title: "SICF consistency",
70789
70847
  shortDescription: `Checks the validity of ICF services`,
70790
- extendedInformation: `* Class defined in handler must exist
70791
- * Class must not have any syntax errors
70848
+ extendedInformation: `* Class defined in handler must exist
70849
+ * Class must not have any syntax errors
70792
70850
  * Class must implement interface IF_HTTP_EXTENSION`,
70793
70851
  };
70794
70852
  }
@@ -70900,23 +70958,23 @@ class SlowParameterPassing {
70900
70958
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
70901
70959
  extendedInformation: `Method parameters defined in interfaces is not checked`,
70902
70960
  tags: [_irule_1.RuleTag.Performance],
70903
- badExample: `CLASS lcl DEFINITION.
70904
- PUBLIC SECTION.
70905
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
70906
- ENDCLASS.
70907
- CLASS lcl IMPLEMENTATION.
70908
- METHOD bar.
70909
- WRITE sdf.
70910
- ENDMETHOD.
70961
+ badExample: `CLASS lcl DEFINITION.
70962
+ PUBLIC SECTION.
70963
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
70964
+ ENDCLASS.
70965
+ CLASS lcl IMPLEMENTATION.
70966
+ METHOD bar.
70967
+ WRITE sdf.
70968
+ ENDMETHOD.
70911
70969
  ENDCLASS.`,
70912
- goodExample: `CLASS lcl DEFINITION.
70913
- PUBLIC SECTION.
70914
- METHODS bar IMPORTING sdf TYPE string.
70915
- ENDCLASS.
70916
- CLASS lcl IMPLEMENTATION.
70917
- METHOD bar.
70918
- WRITE sdf.
70919
- ENDMETHOD.
70970
+ goodExample: `CLASS lcl DEFINITION.
70971
+ PUBLIC SECTION.
70972
+ METHODS bar IMPORTING sdf TYPE string.
70973
+ ENDCLASS.
70974
+ CLASS lcl IMPLEMENTATION.
70975
+ METHOD bar.
70976
+ WRITE sdf.
70977
+ ENDMETHOD.
70920
70978
  ENDCLASS.`,
70921
70979
  };
70922
70980
  }
@@ -71173,8 +71231,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
71173
71231
  key: "space_before_dot",
71174
71232
  title: "Space before dot",
71175
71233
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
71176
- extendedInformation: `
71177
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71234
+ extendedInformation: `
71235
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
71178
71236
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
71179
71237
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71180
71238
  badExample: `WRITE bar .`,
@@ -71360,12 +71418,12 @@ class SQLValueConversion {
71360
71418
  key: "sql_value_conversion",
71361
71419
  title: "Implicit SQL Value Conversion",
71362
71420
  shortDescription: `Ensure types match when selecting from database`,
71363
- extendedInformation: `
71364
- * Integer to CHAR conversion
71365
- * Integer to NUMC conversion
71366
- * NUMC to Integer conversion
71367
- * CHAR to Integer conversion
71368
- * Source field longer than database field, CHAR -> CHAR
71421
+ extendedInformation: `
71422
+ * Integer to CHAR conversion
71423
+ * Integer to NUMC conversion
71424
+ * NUMC to Integer conversion
71425
+ * CHAR to Integer conversion
71426
+ * Source field longer than database field, CHAR -> CHAR
71369
71427
  * Source field longer than database field, NUMC -> NUMC`,
71370
71428
  tags: [],
71371
71429
  };
@@ -71437,7 +71495,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
71437
71495
  key: "start_at_tab",
71438
71496
  title: "Start at tab",
71439
71497
  shortDescription: `Checks that statements start at tabstops.`,
71440
- extendedInformation: `Reports max 100 issues per file
71498
+ extendedInformation: `Reports max 100 issues per file
71441
71499
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
71442
71500
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71443
71501
  badExample: ` WRITE a.`,
@@ -71614,12 +71672,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
71614
71672
  key: "strict_sql",
71615
71673
  title: "Strict SQL",
71616
71674
  shortDescription: `Strict SQL`,
71617
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
71618
-
71619
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
71620
-
71621
- Also see separate rule sql_escape_host_variables
71622
-
71675
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
71676
+
71677
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
71678
+
71679
+ Also see separate rule sql_escape_host_variables
71680
+
71623
71681
  Activates from v750 and up`,
71624
71682
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
71625
71683
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -71873,11 +71931,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
71873
71931
  key: "sy_modification",
71874
71932
  title: "Modification of SY fields",
71875
71933
  shortDescription: `Finds modification of sy fields`,
71876
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
71877
-
71934
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
71935
+
71878
71936
  Changes to SY-TVAR* fields are not reported`,
71879
71937
  tags: [_irule_1.RuleTag.SingleFile],
71880
- badExample: `sy-uname = 2.
71938
+ badExample: `sy-uname = 2.
71881
71939
  sy = sy.`,
71882
71940
  };
71883
71941
  }
@@ -71939,8 +71997,8 @@ class TABLEnhancementCategory {
71939
71997
  key: "tabl_enhancement_category",
71940
71998
  title: "TABL enhancement category must be set",
71941
71999
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
71942
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
71943
-
72000
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72001
+
71944
72002
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
71945
72003
  tags: [],
71946
72004
  };
@@ -72005,8 +72063,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72005
72063
  shortDescription: `TABLES are always global, so declare them globally`,
72006
72064
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72007
72065
  tags: [_irule_1.RuleTag.SingleFile],
72008
- badExample: `FORM foo.
72009
- TABLES t100.
72066
+ badExample: `FORM foo.
72067
+ TABLES t100.
72010
72068
  ENDFORM.`,
72011
72069
  goodExample: `TABLES t000.`,
72012
72070
  };
@@ -72134,9 +72192,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72134
72192
  title: "Type FORM parameters",
72135
72193
  shortDescription: `Checks for untyped FORM parameters`,
72136
72194
  tags: [_irule_1.RuleTag.SingleFile],
72137
- badExample: `FORM foo USING bar.
72195
+ badExample: `FORM foo USING bar.
72138
72196
  ENDFORM.`,
72139
- goodExample: `FORM foo USING bar TYPE string.
72197
+ goodExample: `FORM foo USING bar TYPE string.
72140
72198
  ENDFORM.`,
72141
72199
  };
72142
72200
  }
@@ -72809,38 +72867,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
72809
72867
  key: "unnecessary_pragma",
72810
72868
  title: "Unnecessary Pragma",
72811
72869
  shortDescription: `Finds pragmas which can be removed`,
72812
- extendedInformation: `* NO_HANDLER with handler
72813
-
72814
- * NEEDED without definition
72815
-
72816
- * NO_TEXT without texts
72817
-
72818
- * SUBRC_OK where sy-subrc is checked
72819
-
72870
+ extendedInformation: `* NO_HANDLER with handler
72871
+
72872
+ * NEEDED without definition
72873
+
72874
+ * NO_TEXT without texts
72875
+
72876
+ * SUBRC_OK where sy-subrc is checked
72877
+
72820
72878
  NO_HANDLER inside macros are not checked`,
72821
72879
  tags: [_irule_1.RuleTag.SingleFile],
72822
- badExample: `TRY.
72823
- ...
72824
- CATCH zcx_abapgit_exception ##NO_HANDLER.
72825
- RETURN. " it has a handler
72826
- ENDTRY.
72827
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
72828
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
72829
- IF sy-subrc <> 0.
72880
+ badExample: `TRY.
72881
+ ...
72882
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
72883
+ RETURN. " it has a handler
72884
+ ENDTRY.
72885
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
72886
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
72887
+ IF sy-subrc <> 0.
72830
72888
  ENDIF.`,
72831
- goodExample: `TRY.
72832
- ...
72833
- CATCH zcx_abapgit_exception.
72834
- RETURN.
72835
- ENDTRY.
72836
- MESSAGE w125(zbar) WITH c_foo INTO message.
72837
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
72838
- IF sy-subrc <> 0.
72839
- ENDIF.
72840
-
72841
- DATA: BEGIN OF blah ##NEEDED,
72842
- test1 TYPE string,
72843
- test2 TYPE string,
72889
+ goodExample: `TRY.
72890
+ ...
72891
+ CATCH zcx_abapgit_exception.
72892
+ RETURN.
72893
+ ENDTRY.
72894
+ MESSAGE w125(zbar) WITH c_foo INTO message.
72895
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
72896
+ IF sy-subrc <> 0.
72897
+ ENDIF.
72898
+
72899
+ DATA: BEGIN OF blah ##NEEDED,
72900
+ test1 TYPE string,
72901
+ test2 TYPE string,
72844
72902
  END OF blah.`,
72845
72903
  };
72846
72904
  }
@@ -73007,18 +73065,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73007
73065
  shortDescription: `Finds unnecessary RETURN statements`,
73008
73066
  extendedInformation: `Finds unnecessary RETURN statements`,
73009
73067
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73010
- badExample: `FORM hello1.
73011
- WRITE 'world'.
73012
- RETURN.
73013
- ENDFORM.
73014
-
73015
- FORM foo.
73016
- IF 1 = 2.
73017
- RETURN.
73018
- ENDIF.
73068
+ badExample: `FORM hello1.
73069
+ WRITE 'world'.
73070
+ RETURN.
73071
+ ENDFORM.
73072
+
73073
+ FORM foo.
73074
+ IF 1 = 2.
73075
+ RETURN.
73076
+ ENDIF.
73019
73077
  ENDFORM.`,
73020
- goodExample: `FORM hello2.
73021
- WRITE 'world'.
73078
+ goodExample: `FORM hello2.
73079
+ WRITE 'world'.
73022
73080
  ENDFORM.`,
73023
73081
  };
73024
73082
  }
@@ -73369,13 +73427,13 @@ class UnusedMacros {
73369
73427
  title: "Unused macros",
73370
73428
  shortDescription: `Checks for unused macro definitions definitions`,
73371
73429
  tags: [_irule_1.RuleTag.Quickfix],
73372
- badExample: `DEFINE foobar1.
73373
- WRITE 'hello'.
73430
+ badExample: `DEFINE foobar1.
73431
+ WRITE 'hello'.
73374
73432
  END-OF-DEFINITION.`,
73375
- goodExample: `DEFINE foobar2.
73376
- WRITE 'hello'.
73377
- END-OF-DEFINITION.
73378
-
73433
+ goodExample: `DEFINE foobar2.
73434
+ WRITE 'hello'.
73435
+ END-OF-DEFINITION.
73436
+
73379
73437
  foobar2.`,
73380
73438
  };
73381
73439
  }
@@ -73483,17 +73541,17 @@ class UnusedMethods {
73483
73541
  key: "unused_methods",
73484
73542
  title: "Unused methods",
73485
73543
  shortDescription: `Checks for unused methods`,
73486
- extendedInformation: `Checks private and protected methods.
73487
-
73488
- Unused methods are not reported if the object contains parser or syntax errors.
73489
-
73490
- Skips:
73491
- * methods FOR TESTING
73492
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73493
- * class_constructor + constructor methods
73494
- * event handlers
73495
- * methods that are redefined
73496
- * INCLUDEs
73544
+ extendedInformation: `Checks private and protected methods.
73545
+
73546
+ Unused methods are not reported if the object contains parser or syntax errors.
73547
+
73548
+ Skips:
73549
+ * methods FOR TESTING
73550
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
73551
+ * class_constructor + constructor methods
73552
+ * event handlers
73553
+ * methods that are redefined
73554
+ * INCLUDEs
73497
73555
  `,
73498
73556
  tags: [],
73499
73557
  pragma: "##CALLED",
@@ -73927,23 +73985,23 @@ class UnusedVariables {
73927
73985
  key: "unused_variables",
73928
73986
  title: "Unused variables",
73929
73987
  shortDescription: `Checks for unused variables and constants`,
73930
- extendedInformation: `Skips event parameters.
73931
-
73932
- Note that this currently does not work if the source code uses macros.
73933
-
73934
- Unused variables are not reported if the object contains parser or syntax errors.
73935
-
73988
+ extendedInformation: `Skips event parameters.
73989
+
73990
+ Note that this currently does not work if the source code uses macros.
73991
+
73992
+ Unused variables are not reported if the object contains parser or syntax errors.
73993
+
73936
73994
  Errors found in INCLUDES are reported for the main program.`,
73937
73995
  tags: [_irule_1.RuleTag.Quickfix],
73938
73996
  pragma: "##NEEDED",
73939
73997
  pseudoComment: "EC NEEDED",
73940
- badExample: `DATA: BEGIN OF blah1,
73941
- test TYPE string,
73942
- test2 TYPE string,
73998
+ badExample: `DATA: BEGIN OF blah1,
73999
+ test TYPE string,
74000
+ test2 TYPE string,
73943
74001
  END OF blah1.`,
73944
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
73945
- test TYPE string,
73946
- test2 TYPE string,
74002
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74003
+ test TYPE string,
74004
+ test2 TYPE string,
73947
74005
  END OF blah2.`,
73948
74006
  };
73949
74007
  }
@@ -74162,15 +74220,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
74162
74220
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
74163
74221
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
74164
74222
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
74165
- badExample: `IF line IS INITIAL.
74166
- has_entries = abap_false.
74167
- ELSE.
74168
- has_entries = abap_true.
74169
- ENDIF.
74170
-
74223
+ badExample: `IF line IS INITIAL.
74224
+ has_entries = abap_false.
74225
+ ELSE.
74226
+ has_entries = abap_true.
74227
+ ENDIF.
74228
+
74171
74229
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
74172
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74173
-
74230
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
74231
+
74174
74232
  DATA(fsdf) = xsdbool( foo <> bar ).`,
74175
74233
  };
74176
74234
  }
@@ -74288,15 +74346,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
74288
74346
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
74289
74347
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
74290
74348
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74291
- badExample: `INTERFACE lif.
74292
- METHODS load_data
74293
- EXCEPTIONS
74294
- invalid_parameter.
74349
+ badExample: `INTERFACE lif.
74350
+ METHODS load_data
74351
+ EXCEPTIONS
74352
+ invalid_parameter.
74295
74353
  ENDINTERFACE.`,
74296
- goodExample: `INTERFACE lif.
74297
- METHODS load_data
74298
- RAISING
74299
- cx_something.
74354
+ goodExample: `INTERFACE lif.
74355
+ METHODS load_data
74356
+ RAISING
74357
+ cx_something.
74300
74358
  ENDINTERFACE.`,
74301
74359
  };
74302
74360
  }
@@ -74356,15 +74414,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
74356
74414
  key: "use_line_exists",
74357
74415
  title: "Use line_exists",
74358
74416
  shortDescription: `Use line_exists, from 740sp02 and up`,
74359
- extendedInformation: `
74360
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74361
-
74417
+ extendedInformation: `
74418
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
74419
+
74362
74420
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
74363
74421
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
74364
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74365
- IF sy-subrc = 0.
74422
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
74423
+ IF sy-subrc = 0.
74366
74424
  ENDIF.`,
74367
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74425
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
74368
74426
  ENDIF.`,
74369
74427
  };
74370
74428
  }
@@ -74474,10 +74532,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
74474
74532
  key: "use_new",
74475
74533
  title: "Use NEW",
74476
74534
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
74477
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74478
-
74479
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74480
-
74535
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
74536
+
74537
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
74538
+
74481
74539
  Applicable from v740sp02 and up`,
74482
74540
  badExample: `CREATE OBJECT ref.`,
74483
74541
  goodExample: `ref = NEW #( ).`,
@@ -74575,13 +74633,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
74575
74633
  title: "WHEN OTHERS last",
74576
74634
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
74577
74635
  tags: [_irule_1.RuleTag.SingleFile],
74578
- badExample: `CASE bar.
74579
- WHEN OTHERS.
74580
- WHEN 2.
74636
+ badExample: `CASE bar.
74637
+ WHEN OTHERS.
74638
+ WHEN 2.
74581
74639
  ENDCASE.`,
74582
- goodExample: `CASE bar.
74583
- WHEN 2.
74584
- WHEN OTHERS.
74640
+ goodExample: `CASE bar.
74641
+ WHEN 2.
74642
+ WHEN OTHERS.
74585
74643
  ENDCASE.`,
74586
74644
  };
74587
74645
  }