@abaplint/cli 2.113.44 → 2.113.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +4 -4
  2. package/abaplint +2 -2
  3. package/build/cli.js +854 -849
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -7514,7 +7514,7 @@ class SelectLoop extends combi_1.Expression {
7514
7514
  const packTab = (0, combi_1.seq)(pack, _1.SQLIntoTable);
7515
7515
  const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
7516
7516
  const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab, into, packTab));
7517
- const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
7517
+ const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)(_1.SQLForAllEntries), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
7518
7518
  const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
7519
7519
  return ret;
7520
7520
  }
@@ -9378,8 +9378,11 @@ class TypeStructure extends combi_1.Expression {
9378
9378
  getRunnable() {
9379
9379
  // todo, add version,
9380
9380
  const hier = (0, combi_1.seq)("HIERARCHY", _1.NamespaceSimpleName);
9381
+ const create = (0, combi_1.seq)("CREATE", _1.NamespaceSimpleName);
9382
+ const update = (0, combi_1.seq)("UPDATE", _1.NamespaceSimpleName);
9383
+ const action = (0, combi_1.seq)("ACTION IMPORT", _1.SourceField);
9381
9384
  const evt = (0, combi_1.seq)("EVENT", _1.EventName);
9382
- return (0, combi_1.seq)("TYPE STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt));
9385
+ return (0, combi_1.seq)("TYPE STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt, create, update, action));
9383
9386
  }
9384
9387
  }
9385
9388
  exports.TypeStructure = TypeStructure;
@@ -14686,7 +14689,9 @@ class MethodDef {
14686
14689
  const link = (0, combi_1.seq)("LINK", expressions_1.MethodParamName);
14687
14690
  const full = (0, combi_1.seq)("FULL", expressions_1.MethodParamName);
14688
14691
  const modify = (0, combi_1.alt)((0, combi_1.seq)("FOR ACTION", expressions_1.TypeName, (0, combi_1.optPrio)(result)), (0, combi_1.seq)("FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("FOR UPDATE", expressions_1.TypeName));
14689
- const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, "FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE AUTHORIZATION IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
14692
+ const forRead = (0, combi_1.seq)("FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link));
14693
+ const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
14694
+ const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE AUTHORIZATION IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
14690
14695
  // todo, this is only from version something
14691
14696
  const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
14692
14697
  const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
@@ -14766,7 +14771,7 @@ class ModifyEntities {
14766
14771
  getMatcher() {
14767
14772
  const fieldsWith = (0, combi_1.seq)("FIELDS (", (0, combi_1.plus)(expressions_1.SimpleName), ") WITH", expressions_1.Source);
14768
14773
  const operation = (0, combi_1.alt)((0, combi_1.seq)("UPDATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("CREATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("UPDATE", fieldsWith), (0, combi_1.seq)("DELETE FROM", expressions_1.Source), (0, combi_1.seq)("EXECUTE", expressions_1.SimpleName, "FROM", expressions_1.Source), (0, combi_1.seq)("CREATE", (0, combi_1.optPrio)("AUTO FILL CID"), fieldsWith));
14769
- const s = (0, combi_1.seq)("MODIFY ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, operation, (0, combi_1.per)((0, combi_1.seq)("FAILED", expressions_1.Target), (0, combi_1.seq)("RESULT", expressions_1.Target), (0, combi_1.seq)("MAPPED", expressions_1.Target), (0, combi_1.seq)("REPORTED", expressions_1.Target)));
14774
+ const s = (0, combi_1.seq)("MODIFY ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, operation, (0, combi_1.optPrio)((0, combi_1.per)((0, combi_1.seq)("FAILED", expressions_1.Target), (0, combi_1.seq)("RESULT", expressions_1.Target), (0, combi_1.seq)("MAPPED", expressions_1.Target), (0, combi_1.seq)("REPORTED", expressions_1.Target))));
14770
14775
  return (0, combi_1.ver)(version_1.Version.v754, s);
14771
14776
  }
14772
14777
  }
@@ -16197,7 +16202,7 @@ class SelectionScreen {
16197
16202
  const endLine = (0, combi_1.str)("END OF LINE");
16198
16203
  const modif = (0, combi_1.seq)("MODIF ID", expressions_1.Modif);
16199
16204
  const visible = (0, combi_1.seq)("VISIBLE LENGTH", (0, combi_1.regex)(/^\d+$/));
16200
- const commentOpt = (0, combi_1.per)((0, combi_1.seq)("FOR FIELD", expressions_1.Field), modif, visible);
16205
+ const commentOpt = (0, combi_1.per)((0, combi_1.seq)("FOR FIELD", expressions_1.FieldSub), modif, visible);
16201
16206
  const position = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.regex)(/^\/?[\d\w]+$/)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.WParenLeft)), expressions_1.Integer, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
16202
16207
  const comment = (0, combi_1.seq)("COMMENT", position, (0, combi_1.opt)((0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement)), (0, combi_1.opt)(commentOpt));
16203
16208
  const command = (0, combi_1.seq)("USER-COMMAND", (0, combi_1.alt)(expressions_1.Field, expressions_1.Constant));
@@ -35263,13 +35268,13 @@ class FlowGraph {
35263
35268
  this.label = label;
35264
35269
  }
35265
35270
  toDigraph() {
35266
- return `digraph G {
35267
- labelloc="t";
35268
- label="${this.label}";
35269
- graph [fontname = "helvetica"];
35270
- node [fontname = "helvetica", shape="box"];
35271
- edge [fontname = "helvetica"];
35272
- ${this.toTextEdges()}
35271
+ return `digraph G {
35272
+ labelloc="t";
35273
+ label="${this.label}";
35274
+ graph [fontname = "helvetica"];
35275
+ node [fontname = "helvetica", shape="box"];
35276
+ edge [fontname = "helvetica"];
35277
+ ${this.toTextEdges()}
35273
35278
  }`;
35274
35279
  }
35275
35280
  listSources(node) {
@@ -43656,13 +43661,13 @@ class Help {
43656
43661
  /////////////////////////////////////////////////
43657
43662
  static dumpABAP(file, reg, textDocument, position) {
43658
43663
  let content = "";
43659
- content = `
43660
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43661
- <a href="#_statements" rel="no-refresh">Statements</a> |
43662
- <a href="#_structure" rel="no-refresh">Structure</a> |
43663
- <a href="#_files" rel="no-refresh">Files</a> |
43664
- <a href="#_info" rel="no-refresh">Info Dump</a>
43665
- <hr>
43664
+ content = `
43665
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43666
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43667
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43668
+ <a href="#_files" rel="no-refresh">Files</a> |
43669
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43670
+ <hr>
43666
43671
  ` +
43667
43672
  "<tt>" + textDocument.uri + " (" +
43668
43673
  (position.line + 1) + ", " +
@@ -43817,9 +43822,9 @@ class Help {
43817
43822
  return ret + "</ul>";
43818
43823
  }
43819
43824
  static tokens(file) {
43820
- let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
43821
- <td><b>Row</b></td><td><b>Column</b></td>
43822
- <td><b>vRow</b></td><td><b>vColumn</b></td>
43825
+ let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
43826
+ <td><b>Row</b></td><td><b>Column</b></td>
43827
+ <td><b>vRow</b></td><td><b>vColumn</b></td>
43823
43828
  </tr>`;
43824
43829
  for (const token of file.getTokens()) {
43825
43830
  const tStart = token.getStart();
@@ -53059,7 +53064,7 @@ class Registry {
53059
53064
  }
53060
53065
  static abaplintVersion() {
53061
53066
  // magic, see build script "version.sh"
53062
- return "2.113.44";
53067
+ return "2.113.45";
53063
53068
  }
53064
53069
  getDDICReferences() {
53065
53070
  return this.ddicReferences;
@@ -53378,10 +53383,10 @@ class SevenBitAscii {
53378
53383
  key: "7bit_ascii",
53379
53384
  title: "Check for 7bit ascii",
53380
53385
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53381
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53382
-
53383
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53384
-
53386
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53387
+
53388
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53389
+
53385
53390
  Checkes files with extensions ".abap" and ".asddls"`,
53386
53391
  tags: [_irule_1.RuleTag.SingleFile],
53387
53392
  badExample: `WRITE '뽑'.`,
@@ -53587,10 +53592,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53587
53592
  key: "abapdoc",
53588
53593
  title: "Check abapdoc",
53589
53594
  shortDescription: `Various checks regarding abapdoc.`,
53590
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53591
-
53592
- Plus class and interface definitions.
53593
-
53595
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53596
+
53597
+ Plus class and interface definitions.
53598
+
53594
53599
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53595
53600
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53596
53601
  };
@@ -53727,27 +53732,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53727
53732
  title: "Add test attributes for tests classes with test methods",
53728
53733
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53729
53734
  tags: [_irule_1.RuleTag.SingleFile],
53730
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53731
- PUBLIC SECTION.
53732
- PROTECTED SECTION.
53733
- PRIVATE SECTION.
53734
- METHODS test FOR TESTING RAISING cx_static_check.
53735
- ENDCLASS.
53736
-
53737
- CLASS ltcl_test1 IMPLEMENTATION.
53738
- METHOD test.
53739
- ENDMETHOD.
53735
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53736
+ PUBLIC SECTION.
53737
+ PROTECTED SECTION.
53738
+ PRIVATE SECTION.
53739
+ METHODS test FOR TESTING RAISING cx_static_check.
53740
+ ENDCLASS.
53741
+
53742
+ CLASS ltcl_test1 IMPLEMENTATION.
53743
+ METHOD test.
53744
+ ENDMETHOD.
53740
53745
  ENDCLASS.`,
53741
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53742
- PUBLIC SECTION.
53743
- PROTECTED SECTION.
53744
- PRIVATE SECTION.
53745
- METHODS test FOR TESTING RAISING cx_static_check.
53746
- ENDCLASS.
53747
-
53748
- CLASS ltcl_test2 IMPLEMENTATION.
53749
- METHOD test.
53750
- ENDMETHOD.
53746
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53747
+ PUBLIC SECTION.
53748
+ PROTECTED SECTION.
53749
+ PRIVATE SECTION.
53750
+ METHODS test FOR TESTING RAISING cx_static_check.
53751
+ ENDCLASS.
53752
+
53753
+ CLASS ltcl_test2 IMPLEMENTATION.
53754
+ METHOD test.
53755
+ ENDMETHOD.
53751
53756
  ENDCLASS.`,
53752
53757
  };
53753
53758
  }
@@ -53833,49 +53838,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53833
53838
  key: "align_parameters",
53834
53839
  title: "Align Parameters",
53835
53840
  shortDescription: `Checks for vertially aligned parameters`,
53836
- extendedInformation: `Checks:
53837
- * function module calls
53838
- * method calls
53839
- * VALUE constructors
53840
- * NEW constructors
53841
- * RAISE EXCEPTION statements
53842
- * CREATE OBJECT statements
53843
- * RAISE EVENT statements
53844
-
53845
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53846
-
53847
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53848
-
53849
- If parameters are on the same row, no issues are reported, see
53841
+ extendedInformation: `Checks:
53842
+ * function module calls
53843
+ * method calls
53844
+ * VALUE constructors
53845
+ * NEW constructors
53846
+ * RAISE EXCEPTION statements
53847
+ * CREATE OBJECT statements
53848
+ * RAISE EVENT statements
53849
+
53850
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53851
+
53852
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53853
+
53854
+ If parameters are on the same row, no issues are reported, see
53850
53855
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53851
53856
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53852
- badExample: `CALL FUNCTION 'FOOBAR'
53853
- EXPORTING
53854
- foo = 2
53855
- parameter = 3.
53856
-
53857
- foobar( moo = 1
53858
- param = 1 ).
53859
-
53860
- foo = VALUE #(
53861
- foo = bar
53857
+ badExample: `CALL FUNCTION 'FOOBAR'
53858
+ EXPORTING
53859
+ foo = 2
53860
+ parameter = 3.
53861
+
53862
+ foobar( moo = 1
53863
+ param = 1 ).
53864
+
53865
+ foo = VALUE #(
53866
+ foo = bar
53862
53867
  moo = 2 ).`,
53863
- goodExample: `CALL FUNCTION 'FOOBAR'
53864
- EXPORTING
53865
- foo = 2
53866
- parameter = 3.
53867
-
53868
- foobar( moo = 1
53869
- param = 1 ).
53870
-
53871
- foo = VALUE #(
53872
- foo = bar
53873
- moo = 2 ).
53874
-
53875
- DATA(sdf) = VALUE type(
53876
- common_val = 2
53877
- another_common = 5
53878
- ( row_value = 4
53868
+ goodExample: `CALL FUNCTION 'FOOBAR'
53869
+ EXPORTING
53870
+ foo = 2
53871
+ parameter = 3.
53872
+
53873
+ foobar( moo = 1
53874
+ param = 1 ).
53875
+
53876
+ foo = VALUE #(
53877
+ foo = bar
53878
+ moo = 2 ).
53879
+
53880
+ DATA(sdf) = VALUE type(
53881
+ common_val = 2
53882
+ another_common = 5
53883
+ ( row_value = 4
53879
53884
  value_foo = 5 ) ).`,
53880
53885
  };
53881
53886
  }
@@ -54309,37 +54314,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
54309
54314
  key: "align_type_expressions",
54310
54315
  title: "Align TYPE expressions",
54311
54316
  shortDescription: `Align TYPE expressions in statements`,
54312
- extendedInformation: `
54313
- Currently works for METHODS + BEGIN OF
54314
-
54315
- If BEGIN OF has an INCLUDE TYPE its ignored
54316
-
54317
- Also note that clean ABAP does not recommend aligning TYPE clauses:
54317
+ extendedInformation: `
54318
+ Currently works for METHODS + BEGIN OF
54319
+
54320
+ If BEGIN OF has an INCLUDE TYPE its ignored
54321
+
54322
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54318
54323
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54319
54324
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
54320
- badExample: `
54321
- TYPES: BEGIN OF foo,
54322
- bar TYPE i,
54323
- foobar TYPE i,
54324
- END OF foo.
54325
-
54326
- INTERFACE lif.
54327
- METHODS bar
54328
- IMPORTING
54329
- foo TYPE i
54330
- foobar TYPE i.
54325
+ badExample: `
54326
+ TYPES: BEGIN OF foo,
54327
+ bar TYPE i,
54328
+ foobar TYPE i,
54329
+ END OF foo.
54330
+
54331
+ INTERFACE lif.
54332
+ METHODS bar
54333
+ IMPORTING
54334
+ foo TYPE i
54335
+ foobar TYPE i.
54331
54336
  ENDINTERFACE.`,
54332
- goodExample: `
54333
- TYPES: BEGIN OF foo,
54334
- bar TYPE i,
54335
- foobar TYPE i,
54336
- END OF foo.
54337
-
54338
- INTERFACE lif.
54339
- METHODS bar
54340
- IMPORTING
54341
- foo TYPE i
54342
- foobar TYPE i.
54337
+ goodExample: `
54338
+ TYPES: BEGIN OF foo,
54339
+ bar TYPE i,
54340
+ foobar TYPE i,
54341
+ END OF foo.
54342
+
54343
+ INTERFACE lif.
54344
+ METHODS bar
54345
+ IMPORTING
54346
+ foo TYPE i
54347
+ foobar TYPE i.
54343
54348
  ENDINTERFACE.`,
54344
54349
  };
54345
54350
  }
@@ -54618,16 +54623,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54618
54623
  return {
54619
54624
  key: "ambiguous_statement",
54620
54625
  title: "Check for ambigious statements",
54621
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54622
- Add "TABLE" keyword or "@" for escaping SQL variables
54623
-
54626
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54627
+ Add "TABLE" keyword or "@" for escaping SQL variables
54628
+
54624
54629
  Only works if the target version is 740sp05 or above`,
54625
54630
  tags: [_irule_1.RuleTag.SingleFile],
54626
- badExample: `DELETE foo FROM bar.
54631
+ badExample: `DELETE foo FROM bar.
54627
54632
  MODIFY foo FROM bar.`,
54628
- goodExample: `DELETE foo FROM @bar.
54629
- DELETE TABLE itab FROM 2.
54630
- MODIFY zfoo FROM @wa.
54633
+ goodExample: `DELETE foo FROM @bar.
54634
+ DELETE TABLE itab FROM 2.
54635
+ MODIFY zfoo FROM @wa.
54631
54636
  MODIFY TABLE foo FROM bar.`,
54632
54637
  };
54633
54638
  }
@@ -54732,16 +54737,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54732
54737
  key: "avoid_use",
54733
54738
  title: "Avoid use of certain statements",
54734
54739
  shortDescription: `Detects usage of certain statements.`,
54735
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54736
-
54737
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54738
-
54739
- STATICS: use CLASS-DATA instead
54740
-
54741
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54742
-
54743
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54744
-
54740
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54741
+
54742
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54743
+
54744
+ STATICS: use CLASS-DATA instead
54745
+
54746
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54747
+
54748
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54749
+
54745
54750
  BREAK points`,
54746
54751
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54747
54752
  };
@@ -54873,11 +54878,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54873
54878
  title: "Check BEGIN END names",
54874
54879
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54875
54880
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54876
- badExample: `DATA: BEGIN OF stru,
54877
- field TYPE i,
54881
+ badExample: `DATA: BEGIN OF stru,
54882
+ field TYPE i,
54878
54883
  END OF structure_not_the_same.`,
54879
- goodExample: `DATA: BEGIN OF stru,
54880
- field TYPE i,
54884
+ goodExample: `DATA: BEGIN OF stru,
54885
+ field TYPE i,
54881
54886
  END OF stru.`,
54882
54887
  };
54883
54888
  }
@@ -54974,20 +54979,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54974
54979
  title: "BEGIN contains single INCLUDE",
54975
54980
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54976
54981
  tags: [_irule_1.RuleTag.SingleFile],
54977
- badExample: `TYPES: BEGIN OF dummy1.
54978
- INCLUDE TYPE dselc.
54979
- TYPES: END OF dummy1.
54980
-
54981
- DATA BEGIN OF foo.
54982
- INCLUDE STRUCTURE syst.
54983
- DATA END OF foo.
54984
-
54985
- STATICS BEGIN OF bar.
54986
- INCLUDE STRUCTURE syst.
54982
+ badExample: `TYPES: BEGIN OF dummy1.
54983
+ INCLUDE TYPE dselc.
54984
+ TYPES: END OF dummy1.
54985
+
54986
+ DATA BEGIN OF foo.
54987
+ INCLUDE STRUCTURE syst.
54988
+ DATA END OF foo.
54989
+
54990
+ STATICS BEGIN OF bar.
54991
+ INCLUDE STRUCTURE syst.
54987
54992
  STATICS END OF bar.`,
54988
- goodExample: `DATA BEGIN OF foo.
54989
- DATA field TYPE i.
54990
- INCLUDE STRUCTURE dselc.
54993
+ goodExample: `DATA BEGIN OF foo.
54994
+ DATA field TYPE i.
54995
+ INCLUDE STRUCTURE dselc.
54991
54996
  DATA END OF foo.`,
54992
54997
  };
54993
54998
  }
@@ -55077,9 +55082,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
55077
55082
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
55078
55083
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55079
55084
  badExample: `CALL TRANSACTION 'FOO'.`,
55080
- goodExample: `TRY.
55081
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55082
- CATCH cx_sy_authorization_error.
55085
+ goodExample: `TRY.
55086
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55087
+ CATCH cx_sy_authorization_error.
55083
55088
  ENDTRY.`,
55084
55089
  };
55085
55090
  }
@@ -55144,10 +55149,10 @@ class CDSCommentStyle {
55144
55149
  key: "cds_comment_style",
55145
55150
  title: "CDS Comment Style",
55146
55151
  shortDescription: `Check for obsolete comment style`,
55147
- extendedInformation: `Check for obsolete comment style
55148
-
55149
- Comments starting with "--" are considered obsolete
55150
-
55152
+ extendedInformation: `Check for obsolete comment style
55153
+
55154
+ Comments starting with "--" are considered obsolete
55155
+
55151
55156
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
55152
55157
  tags: [_irule_1.RuleTag.SingleFile],
55153
55158
  badExample: "-- this is a comment",
@@ -55213,10 +55218,10 @@ class CDSLegacyView {
55213
55218
  key: "cds_legacy_view",
55214
55219
  title: "CDS Legacy View",
55215
55220
  shortDescription: `Identify CDS Legacy Views`,
55216
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55217
-
55218
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55219
-
55221
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55222
+
55223
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55224
+
55220
55225
  v755 and up`,
55221
55226
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
55222
55227
  };
@@ -55371,10 +55376,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55371
55376
  key: "chain_mainly_declarations",
55372
55377
  title: "Chain mainly declarations",
55373
55378
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55374
- extendedInformation: `
55375
- https://docs.abapopenchecks.org/checks/23/
55376
-
55377
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55379
+ extendedInformation: `
55380
+ https://docs.abapopenchecks.org/checks/23/
55381
+
55382
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55378
55383
  `,
55379
55384
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55380
55385
  badExample: `CALL METHOD: bar.`,
@@ -55550,17 +55555,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55550
55555
  title: "Change IF to CASE",
55551
55556
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55552
55557
  // eslint-disable-next-line max-len
55553
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55554
-
55558
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55559
+
55555
55560
  If the first comparison is a boolean compare, no issue is reported.`,
55556
55561
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55557
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55558
- ELSEIF l_fcat-fieldname = 'BAR'
55559
- OR l_fcat-fieldname = 'MOO'.
55562
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55563
+ ELSEIF l_fcat-fieldname = 'BAR'
55564
+ OR l_fcat-fieldname = 'MOO'.
55560
55565
  ENDIF.`,
55561
- goodExample: `CASE l_fcat-fieldname.
55562
- WHEN 'FOO'.
55563
- WHEN 'BAR' OR 'MOO'.
55566
+ goodExample: `CASE l_fcat-fieldname.
55567
+ WHEN 'FOO'.
55568
+ WHEN 'BAR' OR 'MOO'.
55564
55569
  ENDCASE.`,
55565
55570
  };
55566
55571
  }
@@ -55697,8 +55702,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55697
55702
  return {
55698
55703
  key: "check_abstract",
55699
55704
  title: "Check abstract methods and classes",
55700
- shortDescription: `Checks abstract methods and classes:
55701
- - class defined as abstract and final,
55705
+ shortDescription: `Checks abstract methods and classes:
55706
+ - class defined as abstract and final,
55702
55707
  - non-abstract class contains abstract methods`,
55703
55708
  extendedInformation: `If a class defines only constants, use an interface instead`,
55704
55709
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55779,11 +55784,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55779
55784
  return {
55780
55785
  key: "check_comments",
55781
55786
  title: "Check Comments",
55782
- shortDescription: `
55787
+ shortDescription: `
55783
55788
  Various checks for comment usage.`,
55784
- extendedInformation: `
55785
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55786
-
55789
+ extendedInformation: `
55790
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55791
+
55787
55792
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55788
55793
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55789
55794
  badExample: `WRITE 2. " descriptive comment`,
@@ -55945,9 +55950,9 @@ class CheckInclude {
55945
55950
  key: "check_include",
55946
55951
  title: "Check INCLUDEs",
55947
55952
  shortDescription: `Checks INCLUDE statements`,
55948
- extendedInformation: `
55949
- * Reports unused includes
55950
- * Errors if the includes are not found
55953
+ extendedInformation: `
55954
+ * Reports unused includes
55955
+ * Errors if the includes are not found
55951
55956
  * Error if including a main program`,
55952
55957
  tags: [_irule_1.RuleTag.Syntax],
55953
55958
  };
@@ -56023,14 +56028,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
56023
56028
  key: "check_subrc",
56024
56029
  title: "Check sy-subrc",
56025
56030
  shortDescription: `Check sy-subrc`,
56026
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56027
-
56028
- If sy-dbcnt is checked after database statements, it is considered okay.
56029
-
56030
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56031
-
56032
- If IS ASSIGNED is checked after assigning, it is considered okay.
56033
-
56031
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56032
+
56033
+ If sy-dbcnt is checked after database statements, it is considered okay.
56034
+
56035
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56036
+
56037
+ If IS ASSIGNED is checked after assigning, it is considered okay.
56038
+
56034
56039
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
56035
56040
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56036
56041
  pseudoComment: "EC CI_SUBRC",
@@ -56600,17 +56605,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56600
56605
  shortDescription: `Find overlapping classic exceptions`,
56601
56606
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56602
56607
  tags: [_irule_1.RuleTag.SingleFile],
56603
- badExample: `CALL FUNCTION 'SOMETHING'
56604
- EXCEPTIONS
56605
- system_failure = 1 MESSAGE lv_message
56606
- communication_failure = 1 MESSAGE lv_message
56607
- resource_failure = 1
56608
+ badExample: `CALL FUNCTION 'SOMETHING'
56609
+ EXCEPTIONS
56610
+ system_failure = 1 MESSAGE lv_message
56611
+ communication_failure = 1 MESSAGE lv_message
56612
+ resource_failure = 1
56608
56613
  OTHERS = 1.`,
56609
- goodExample: `CALL FUNCTION 'SOMETHING'
56610
- EXCEPTIONS
56611
- system_failure = 1 MESSAGE lv_message
56612
- communication_failure = 2 MESSAGE lv_message
56613
- resource_failure = 3
56614
+ goodExample: `CALL FUNCTION 'SOMETHING'
56615
+ EXCEPTIONS
56616
+ system_failure = 1 MESSAGE lv_message
56617
+ communication_failure = 2 MESSAGE lv_message
56618
+ resource_failure = 3
56614
56619
  OTHERS = 4.`,
56615
56620
  };
56616
56621
  }
@@ -56856,7 +56861,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56856
56861
  key: "commented_code",
56857
56862
  title: "Find commented code",
56858
56863
  shortDescription: `Detects usage of commented out code.`,
56859
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56864
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56860
56865
  https://docs.abapopenchecks.org/checks/14/`,
56861
56866
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56862
56867
  badExample: `* WRITE 'hello world'.`,
@@ -57089,10 +57094,10 @@ class ConstructorVisibilityPublic {
57089
57094
  key: "constructor_visibility_public",
57090
57095
  title: "Check constructor visibility is public",
57091
57096
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
57092
- extendedInformation: `
57093
- This only applies to global classes.
57094
-
57095
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57097
+ extendedInformation: `
57098
+ This only applies to global classes.
57099
+
57100
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57096
57101
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
57097
57102
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57098
57103
  };
@@ -57167,8 +57172,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
57167
57172
  key: "contains_tab",
57168
57173
  title: "Code contains tab",
57169
57174
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
57170
- extendedInformation: `
57171
- https://docs.abapopenchecks.org/checks/09/
57175
+ extendedInformation: `
57176
+ https://docs.abapopenchecks.org/checks/09/
57172
57177
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
57173
57178
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57174
57179
  badExample: `\tWRITE 'hello world'.`,
@@ -57255,10 +57260,10 @@ class CyclicOO {
57255
57260
  key: "cyclic_oo",
57256
57261
  title: "Cyclic OO",
57257
57262
  shortDescription: `Finds cyclic/circular OO references`,
57258
- extendedInformation: `Runs for global INTF + CLAS objects
57259
-
57260
- Objects must be without syntax errors for this rule to take effect
57261
-
57263
+ extendedInformation: `Runs for global INTF + CLAS objects
57264
+
57265
+ Objects must be without syntax errors for this rule to take effect
57266
+
57262
57267
  References in testclass includes are ignored`,
57263
57268
  };
57264
57269
  }
@@ -57501,7 +57506,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57501
57506
  key: "dangerous_statement",
57502
57507
  title: "Dangerous statement",
57503
57508
  shortDescription: `Detects potentially dangerous statements`,
57504
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57509
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57505
57510
  dynamic SQL can potentially create SQL injection problems`,
57506
57511
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57507
57512
  };
@@ -57708,13 +57713,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57708
57713
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57709
57714
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57710
57715
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57711
- badExample: `FROM foo.
57712
- WRITE 'hello'.
57713
- DATA int TYPE i.
57716
+ badExample: `FROM foo.
57717
+ WRITE 'hello'.
57718
+ DATA int TYPE i.
57714
57719
  ENDFORM.`,
57715
- goodExample: `FROM foo.
57716
- DATA int TYPE i.
57717
- WRITE 'hello'.
57720
+ goodExample: `FROM foo.
57721
+ DATA int TYPE i.
57722
+ WRITE 'hello'.
57718
57723
  ENDFORM.`,
57719
57724
  };
57720
57725
  }
@@ -58253,39 +58258,39 @@ class Downport {
58253
58258
  key: "downport",
58254
58259
  title: "Downport statement",
58255
58260
  shortDescription: `Downport functionality`,
58256
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58257
- a higher level language version. If successful, various rules are applied to downport the statement.
58258
- Target downport version is always v702, thus rule is only enabled if target version is v702.
58259
-
58260
- Current rules:
58261
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58262
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58263
- * FIELD-SYMBOL() definitions are outlined
58264
- * CONV is outlined
58265
- * COND is outlined
58266
- * REDUCE is outlined
58267
- * SWITCH is outlined
58268
- * FILTER is outlined
58269
- * APPEND expression is outlined
58270
- * INSERT expression is outlined
58271
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58272
- * CAST changed to ?=
58273
- * LOOP AT method_call( ) is outlined
58274
- * VALUE # with structure fields
58275
- * VALUE # with internal table lines
58276
- * Table Expressions are outlined
58277
- * SELECT INTO @DATA definitions are outlined
58278
- * Some occurrences of string template formatting option ALPHA changed to function module call
58279
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58280
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58281
- * RAISE EXCEPTION ... MESSAGE
58282
- * Moving with +=, -=, /=, *=, &&= is expanded
58283
- * line_exists and line_index is downported to READ TABLE
58284
- * ENUMs, but does not nessesarily give the correct type and value
58285
- * MESSAGE with non simple source
58286
-
58287
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58288
-
58261
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58262
+ a higher level language version. If successful, various rules are applied to downport the statement.
58263
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
58264
+
58265
+ Current rules:
58266
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58267
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58268
+ * FIELD-SYMBOL() definitions are outlined
58269
+ * CONV is outlined
58270
+ * COND is outlined
58271
+ * REDUCE is outlined
58272
+ * SWITCH is outlined
58273
+ * FILTER is outlined
58274
+ * APPEND expression is outlined
58275
+ * INSERT expression is outlined
58276
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58277
+ * CAST changed to ?=
58278
+ * LOOP AT method_call( ) is outlined
58279
+ * VALUE # with structure fields
58280
+ * VALUE # with internal table lines
58281
+ * Table Expressions are outlined
58282
+ * SELECT INTO @DATA definitions are outlined
58283
+ * Some occurrences of string template formatting option ALPHA changed to function module call
58284
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58285
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58286
+ * RAISE EXCEPTION ... MESSAGE
58287
+ * Moving with +=, -=, /=, *=, &&= is expanded
58288
+ * line_exists and line_index is downported to READ TABLE
58289
+ * ENUMs, but does not nessesarily give the correct type and value
58290
+ * MESSAGE with non simple source
58291
+
58292
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58293
+
58289
58294
  Make sure to test the downported code, it might not always be completely correct.`,
58290
58295
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
58291
58296
  };
@@ -58863,10 +58868,10 @@ Make sure to test the downported code, it might not always be completely correct
58863
58868
  const fieldName = f.concatTokens();
58864
58869
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58865
58870
  }
58866
- fieldDefinition = `DATA: BEGIN OF ${name},
58871
+ fieldDefinition = `DATA: BEGIN OF ${name},
58867
58872
  ${fieldDefinition}${indentation} END OF ${name}.`;
58868
58873
  }
58869
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58874
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58870
58875
  ${indentation}`);
58871
58876
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58872
58877
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58925,12 +58930,12 @@ ${indentation}`);
58925
58930
  }
58926
58931
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58927
58932
  const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
58928
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58929
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58930
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58933
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58934
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58935
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58931
58936
  ${indentation}`);
58932
58937
  if (fieldDefinitions === "") {
58933
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58938
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58934
58939
  ${indentation}`);
58935
58940
  }
58936
58941
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58998,7 +59003,7 @@ ${indentation}`);
58998
59003
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58999
59004
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59000
59005
  const firstToken = high.getFirstToken();
59001
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59006
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59002
59007
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59003
59008
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59004
59009
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59052,7 +59057,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59052
59057
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59053
59058
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59054
59059
  const firstToken = high.getFirstToken();
59055
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59060
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59056
59061
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59057
59062
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59058
59063
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59094,14 +59099,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59094
59099
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59095
59100
  const firstToken = high.getFirstToken();
59096
59101
  // note that the tabix restore should be done before throwing the exception
59097
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59098
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59099
- ${indentation}${tabixBackup} = sy-tabix.
59100
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59101
- ${indentation}sy-tabix = ${tabixBackup}.
59102
- ${indentation}IF sy-subrc <> 0.
59103
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59104
- ${indentation}ENDIF.
59102
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59103
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59104
+ ${indentation}${tabixBackup} = sy-tabix.
59105
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59106
+ ${indentation}sy-tabix = ${tabixBackup}.
59107
+ ${indentation}IF sy-subrc <> 0.
59108
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59109
+ ${indentation}ENDIF.
59105
59110
  ${indentation}`);
59106
59111
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
59107
59112
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59158,7 +59163,7 @@ ${indentation}`);
59158
59163
  const className = classNames[0].concatTokens();
59159
59164
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59160
59165
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59161
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
59166
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
59162
59167
  ${indentation}CATCH ${className} INTO ${targetName}.`;
59163
59168
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
59164
59169
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -59320,16 +59325,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
59320
59325
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59321
59326
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59322
59327
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59323
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59324
- ${indentation}${uniqueName1}-msgid = ${id}.
59328
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59329
+ ${indentation}${uniqueName1}-msgid = ${id}.
59325
59330
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59326
59331
  if (withs.length > 0) {
59327
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59328
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59329
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59332
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59333
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59334
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59330
59335
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59331
59336
  }
59332
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59337
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59333
59338
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59334
59339
  if (withs.length > 0) {
59335
59340
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59441,10 +59446,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59441
59446
  let code = "";
59442
59447
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59443
59448
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59444
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59445
- IF sy-subrc <> 0.
59446
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59447
- ENDIF.
59449
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59450
+ IF sy-subrc <> 0.
59451
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59452
+ ENDIF.
59448
59453
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59449
59454
  }
59450
59455
  else {
@@ -59533,20 +59538,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59533
59538
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59534
59539
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59535
59540
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59536
- code += ` items LIKE ${loopSourceName},
59537
- END OF ${groupTargetName}type.
59538
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59539
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59541
+ code += ` items LIKE ${loopSourceName},
59542
+ END OF ${groupTargetName}type.
59543
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59544
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59540
59545
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59541
59546
  if (groupIndexName !== undefined) {
59542
59547
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59543
59548
  }
59544
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59549
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59545
59550
  IF sy-subrc = 0.\n`;
59546
59551
  if (groupCountName !== undefined) {
59547
59552
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59548
59553
  }
59549
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59554
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59550
59555
  ELSE.\n`;
59551
59556
  code += ` CLEAR ${uniqueName}.\n`;
59552
59557
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59567,8 +59572,8 @@ ELSE.\n`;
59567
59572
  }
59568
59573
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59569
59574
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59570
- code += `ENDIF.
59571
- ENDLOOP.
59575
+ code += `ENDIF.
59576
+ ENDLOOP.
59572
59577
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59573
59578
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59574
59579
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59740,7 +59745,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59740
59745
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59741
59746
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59742
59747
  // all ENUMS are char like?
59743
- let code = `TYPES ${enumName} TYPE string.
59748
+ let code = `TYPES ${enumName} TYPE string.
59744
59749
  CONSTANTS: BEGIN OF ${structureName},\n`;
59745
59750
  let count = 1;
59746
59751
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59784,14 +59789,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59784
59789
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59785
59790
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59786
59791
  // restore tabix before exeption
59787
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59788
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59789
- ${indentation}${tabixBackup} = sy-tabix.
59790
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59791
- ${indentation}sy-tabix = ${tabixBackup}.
59792
- ${indentation}IF sy-subrc <> 0.
59793
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59794
- ${indentation}ENDIF.
59792
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59793
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59794
+ ${indentation}${tabixBackup} = sy-tabix.
59795
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59796
+ ${indentation}sy-tabix = ${tabixBackup}.
59797
+ ${indentation}IF sy-subrc <> 0.
59798
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59799
+ ${indentation}ENDIF.
59795
59800
  ${indentation}${uniqueName}`;
59796
59801
  const start = target.getFirstToken().getStart();
59797
59802
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59871,11 +59876,11 @@ ${indentation}${uniqueName}`;
59871
59876
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59872
59877
  const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59873
59878
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59874
- const code = `DATA ${uniqueName} TYPE string.
59875
- ${indentation}CALL FUNCTION '${functionName}'
59876
- ${indentation} EXPORTING
59877
- ${indentation} input = ${source}
59878
- ${indentation} IMPORTING
59879
+ const code = `DATA ${uniqueName} TYPE string.
59880
+ ${indentation}CALL FUNCTION '${functionName}'
59881
+ ${indentation} EXPORTING
59882
+ ${indentation} input = ${source}
59883
+ ${indentation} IMPORTING
59879
59884
  ${indentation} output = ${uniqueName}.\n`;
59880
59885
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59881
59886
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -61187,12 +61192,12 @@ class EasyToFindMessages {
61187
61192
  key: "easy_to_find_messages",
61188
61193
  title: "Easy to find messages",
61189
61194
  shortDescription: `Make messages easy to find`,
61190
- extendedInformation: `All messages must be statically referenced exactly once
61191
-
61192
- Only MESSAGE and RAISE statments are counted as static references
61193
-
61194
- Also see rule "message_exists"
61195
-
61195
+ extendedInformation: `All messages must be statically referenced exactly once
61196
+
61197
+ Only MESSAGE and RAISE statments are counted as static references
61198
+
61199
+ Also see rule "message_exists"
61200
+
61196
61201
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
61197
61202
  tags: [_irule_1.RuleTag.Styleguide],
61198
61203
  };
@@ -61273,13 +61278,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
61273
61278
  shortDescription: `Empty selection screen or list processing event block`,
61274
61279
  extendedInformation: ``,
61275
61280
  tags: [_irule_1.RuleTag.SingleFile],
61276
- badExample: `
61277
- INITIALIZATION.
61278
- WRITE 'hello'.
61281
+ badExample: `
61282
+ INITIALIZATION.
61283
+ WRITE 'hello'.
61279
61284
  END-OF-SELECTION.`,
61280
- goodExample: `
61281
- START-OF-SELECTION.
61282
- PERFORM sdf.
61285
+ goodExample: `
61286
+ START-OF-SELECTION.
61287
+ PERFORM sdf.
61283
61288
  COMMIT WORK.`,
61284
61289
  };
61285
61290
  }
@@ -61371,8 +61376,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61371
61376
  key: "empty_line_in_statement",
61372
61377
  title: "Find empty lines in statements",
61373
61378
  shortDescription: `Checks that statements do not contain empty lines.`,
61374
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61375
-
61379
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61380
+
61376
61381
  https://docs.abapopenchecks.org/checks/41/`,
61377
61382
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61378
61383
  badExample: `WRITE\n\nhello.`,
@@ -61548,13 +61553,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61548
61553
  shortDescription: `Checks that the code does not contain empty blocks.`,
61549
61554
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61550
61555
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61551
- badExample: `IF foo = bar.
61552
- ENDIF.
61553
-
61554
- DO 2 TIMES.
61556
+ badExample: `IF foo = bar.
61557
+ ENDIF.
61558
+
61559
+ DO 2 TIMES.
61555
61560
  ENDDO.`,
61556
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61557
- ENDLOOP.
61561
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61562
+ ENDLOOP.
61558
61563
  result = xsdbool( sy-subrc = 0 ).`,
61559
61564
  };
61560
61565
  }
@@ -61696,10 +61701,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61696
61701
  return {
61697
61702
  key: "exit_or_check",
61698
61703
  title: "Find EXIT or CHECK outside loops",
61699
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61704
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61700
61705
  Use RETURN to leave procesing blocks instead.`,
61701
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61702
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61706
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61707
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61703
61708
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61704
61709
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61705
61710
  };
@@ -61782,12 +61787,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61782
61787
  key: "expand_macros",
61783
61788
  title: "Expand Macros",
61784
61789
  shortDescription: `Allows expanding macro calls with quick fixes`,
61785
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61786
-
61790
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61791
+
61787
61792
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61788
- badExample: `DEFINE _hello.
61789
- WRITE 'hello'.
61790
- END-OF-DEFINITION.
61793
+ badExample: `DEFINE _hello.
61794
+ WRITE 'hello'.
61795
+ END-OF-DEFINITION.
61791
61796
  _hello.`,
61792
61797
  goodExample: `WRITE 'hello'.`,
61793
61798
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61874,7 +61879,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61874
61879
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61875
61880
  badExample: `call_method( EXPORTING foo = bar ).`,
61876
61881
  goodExample: `call_method( foo = bar ).`,
61877
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61882
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61878
61883
  https://docs.abapopenchecks.org/checks/30/`,
61879
61884
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61880
61885
  };
@@ -61972,7 +61977,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61972
61977
  key: "forbidden_identifier",
61973
61978
  title: "Forbidden Identifier",
61974
61979
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61975
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61980
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61976
61981
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61977
61982
  tags: [_irule_1.RuleTag.SingleFile],
61978
61983
  };
@@ -62214,8 +62219,8 @@ class ForbiddenVoidType {
62214
62219
  key: "forbidden_void_type",
62215
62220
  title: "Forbidden Void Types",
62216
62221
  shortDescription: `Avoid usage of specified void types.`,
62217
- extendedInformation: `Inspiration:
62218
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62222
+ extendedInformation: `Inspiration:
62223
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62219
62224
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
62220
62225
  };
62221
62226
  }
@@ -62458,9 +62463,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62458
62463
  key: "fully_type_itabs",
62459
62464
  title: "Fully type internal tables",
62460
62465
  shortDescription: `No implict table types or table keys`,
62461
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62466
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62462
62467
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
62463
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62468
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62464
62469
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62465
62470
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62466
62471
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62645,26 +62650,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62645
62650
  key: "functional_writing",
62646
62651
  title: "Use functional writing",
62647
62652
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62648
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62653
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62649
62654
  https://docs.abapopenchecks.org/checks/07/`,
62650
62655
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62651
- badExample: `CALL METHOD zcl_class=>method( ).
62652
- CALL METHOD cl_abap_typedescr=>describe_by_name
62653
- EXPORTING
62654
- p_name = 'NAME'
62655
- RECEIVING
62656
- p_descr_ref = lr_typedescr
62657
- EXCEPTIONS
62658
- type_not_found = 1
62656
+ badExample: `CALL METHOD zcl_class=>method( ).
62657
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62658
+ EXPORTING
62659
+ p_name = 'NAME'
62660
+ RECEIVING
62661
+ p_descr_ref = lr_typedescr
62662
+ EXCEPTIONS
62663
+ type_not_found = 1
62659
62664
  OTHERS = 2.`,
62660
- goodExample: `zcl_class=>method( ).
62661
- cl_abap_typedescr=>describe_by_name(
62662
- EXPORTING
62663
- p_name = 'NAME'
62664
- RECEIVING
62665
- p_descr_ref = lr_typedescr
62666
- EXCEPTIONS
62667
- type_not_found = 1
62665
+ goodExample: `zcl_class=>method( ).
62666
+ cl_abap_typedescr=>describe_by_name(
62667
+ EXPORTING
62668
+ p_name = 'NAME'
62669
+ RECEIVING
62670
+ p_descr_ref = lr_typedescr
62671
+ EXCEPTIONS
62672
+ type_not_found = 1
62668
62673
  OTHERS = 2 ).`,
62669
62674
  };
62670
62675
  }
@@ -62775,14 +62780,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62775
62780
  key: "global_class",
62776
62781
  title: "Global class checks",
62777
62782
  shortDescription: `Checks related to global classes`,
62778
- extendedInformation: `* global classes must be in own files
62779
-
62780
- * file names must match class name
62781
-
62782
- * file names must match interface name
62783
-
62784
- * global classes must be global definitions
62785
-
62783
+ extendedInformation: `* global classes must be in own files
62784
+
62785
+ * file names must match class name
62786
+
62787
+ * file names must match interface name
62788
+
62789
+ * global classes must be global definitions
62790
+
62786
62791
  * global interfaces must be global definitions`,
62787
62792
  tags: [_irule_1.RuleTag.Syntax],
62788
62793
  };
@@ -62881,21 +62886,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62881
62886
  return {
62882
62887
  key: "identical_conditions",
62883
62888
  title: "Identical conditions",
62884
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62885
-
62889
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62890
+
62886
62891
  Prerequsites: code is pretty printed with identical cAsE`,
62887
62892
  tags: [_irule_1.RuleTag.SingleFile],
62888
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62889
- ENDIF.
62890
- CASE bar.
62891
- WHEN '1'.
62892
- WHEN 'A' OR '1'.
62893
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62894
+ ENDIF.
62895
+ CASE bar.
62896
+ WHEN '1'.
62897
+ WHEN 'A' OR '1'.
62893
62898
  ENDCASE.`,
62894
- goodExample: `IF foo = bar OR 1 = a.
62895
- ENDIF.
62896
- CASE bar.
62897
- WHEN '1'.
62898
- WHEN 'A'.
62899
+ goodExample: `IF foo = bar OR 1 = a.
62900
+ ENDIF.
62901
+ CASE bar.
62902
+ WHEN '1'.
62903
+ WHEN 'A'.
62899
62904
  ENDCASE.`,
62900
62905
  };
62901
62906
  }
@@ -63029,23 +63034,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
63029
63034
  key: "identical_contents",
63030
63035
  title: "Identical contents",
63031
63036
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
63032
- extendedInformation: `
63033
- Prerequsites: code is pretty printed with identical cAsE
63034
-
63037
+ extendedInformation: `
63038
+ Prerequsites: code is pretty printed with identical cAsE
63039
+
63035
63040
  Chained statments are ignored`,
63036
63041
  tags: [_irule_1.RuleTag.SingleFile],
63037
- badExample: `IF foo = bar.
63038
- WRITE 'bar'.
63039
- WRITE 'world'.
63040
- ELSE.
63041
- WRITE 'foo'.
63042
- WRITE 'world'.
63042
+ badExample: `IF foo = bar.
63043
+ WRITE 'bar'.
63044
+ WRITE 'world'.
63045
+ ELSE.
63046
+ WRITE 'foo'.
63047
+ WRITE 'world'.
63043
63048
  ENDIF.`,
63044
- goodExample: `IF foo = bar.
63045
- WRITE 'bar'.
63046
- ELSE.
63047
- WRITE 'foo'.
63048
- ENDIF.
63049
+ goodExample: `IF foo = bar.
63050
+ WRITE 'bar'.
63051
+ ELSE.
63052
+ WRITE 'foo'.
63053
+ ENDIF.
63049
63054
  WRITE 'world'.`,
63050
63055
  };
63051
63056
  }
@@ -63153,12 +63158,12 @@ class IdenticalDescriptions {
63153
63158
  key: "identical_descriptions",
63154
63159
  title: "Identical descriptions",
63155
63160
  shortDescription: `Searches for objects with the same type and same description`,
63156
- extendedInformation: `Case insensitive
63157
-
63158
- Only checks the master language descriptions
63159
-
63160
- Dependencies are skipped
63161
-
63161
+ extendedInformation: `Case insensitive
63162
+
63163
+ Only checks the master language descriptions
63164
+
63165
+ Dependencies are skipped
63166
+
63162
63167
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
63163
63168
  tags: [],
63164
63169
  };
@@ -63332,43 +63337,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63332
63337
  key: "if_in_if",
63333
63338
  title: "IF in IF",
63334
63339
  shortDescription: `Detects nested ifs which can be refactored.`,
63335
- extendedInformation: `
63336
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
63337
-
63338
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63339
-
63340
- https://docs.abapopenchecks.org/checks/01/
63340
+ extendedInformation: `
63341
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63342
+
63343
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63344
+
63345
+ https://docs.abapopenchecks.org/checks/01/
63341
63346
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
63342
- badExample: `IF condition1.
63343
- IF condition2.
63344
- ...
63345
- ENDIF.
63346
- ENDIF.
63347
-
63348
- IF condition1.
63349
- ...
63350
- ELSE.
63351
- IF condition2.
63352
- ...
63353
- ENDIF.
63347
+ badExample: `IF condition1.
63348
+ IF condition2.
63349
+ ...
63350
+ ENDIF.
63351
+ ENDIF.
63352
+
63353
+ IF condition1.
63354
+ ...
63355
+ ELSE.
63356
+ IF condition2.
63357
+ ...
63358
+ ENDIF.
63354
63359
  ENDIF.`,
63355
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63356
- ...
63357
- ENDIF.
63358
-
63359
- IF condition1.
63360
- ...
63361
- ELSEIF condition2.
63362
- ...
63363
- ENDIF.
63364
-
63365
- CASE variable.
63366
- WHEN value1.
63367
- ...
63368
- WHEN value2.
63369
- IF condition2.
63370
- ...
63371
- ENDIF.
63360
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63361
+ ...
63362
+ ENDIF.
63363
+
63364
+ IF condition1.
63365
+ ...
63366
+ ELSEIF condition2.
63367
+ ...
63368
+ ENDIF.
63369
+
63370
+ CASE variable.
63371
+ WHEN value1.
63372
+ ...
63373
+ WHEN value2.
63374
+ IF condition2.
63375
+ ...
63376
+ ENDIF.
63372
63377
  ENDCASE.`,
63373
63378
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63374
63379
  };
@@ -63553,9 +63558,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63553
63558
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63554
63559
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63555
63560
  if (name === impl.identifier.getName().toUpperCase()) {
63556
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63557
- METHOD ${methodName.toLowerCase()}.
63558
- RETURN. " todo, implement method
63561
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63562
+ METHOD ${methodName.toLowerCase()}.
63563
+ RETURN. " todo, implement method
63559
63564
  ENDMETHOD.`);
63560
63565
  }
63561
63566
  }
@@ -63734,14 +63739,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63734
63739
  key: "implicit_start_of_selection",
63735
63740
  title: "Implicit START-OF-SELECTION",
63736
63741
  shortDescription: `Add explicit selection screen event handling`,
63737
- extendedInformation: `Only runs for executable programs
63738
-
63742
+ extendedInformation: `Only runs for executable programs
63743
+
63739
63744
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63740
63745
  tags: [_irule_1.RuleTag.SingleFile],
63741
- badExample: `REPORT zfoo.
63746
+ badExample: `REPORT zfoo.
63742
63747
  WRITE 'hello'.`,
63743
- goodExample: `
63744
- START-OF-SELECTION.
63748
+ goodExample: `
63749
+ START-OF-SELECTION.
63745
63750
  WRITE 'hello'.`,
63746
63751
  };
63747
63752
  }
@@ -63846,19 +63851,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63846
63851
  key: "in_statement_indentation",
63847
63852
  title: "In-statement indentation",
63848
63853
  shortDescription: "Checks alignment within statements which span multiple lines.",
63849
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63850
-
63851
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63854
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63855
+
63856
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63852
63857
  to distinguish them better from code within the block.`,
63853
- badExample: `IF 1 = 1
63854
- AND 2 = 2.
63855
- WRITE 'hello' &&
63856
- 'world'.
63858
+ badExample: `IF 1 = 1
63859
+ AND 2 = 2.
63860
+ WRITE 'hello' &&
63861
+ 'world'.
63857
63862
  ENDIF.`,
63858
- goodExample: `IF 1 = 1
63859
- AND 2 = 2.
63860
- WRITE 'hello' &&
63861
- 'world'.
63863
+ goodExample: `IF 1 = 1
63864
+ AND 2 = 2.
63865
+ WRITE 'hello' &&
63866
+ 'world'.
63862
63867
  ENDIF.`,
63863
63868
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63864
63869
  };
@@ -63981,23 +63986,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63981
63986
  title: "Indentation",
63982
63987
  shortDescription: `Checks indentation`,
63983
63988
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63984
- badExample: `CLASS lcl DEFINITION.
63985
- PRIVATE SECTION.
63986
- METHODS constructor.
63987
- ENDCLASS.
63988
-
63989
- CLASS lcl IMPLEMENTATION.
63990
- METHOD constructor.
63991
- ENDMETHOD.
63989
+ badExample: `CLASS lcl DEFINITION.
63990
+ PRIVATE SECTION.
63991
+ METHODS constructor.
63992
+ ENDCLASS.
63993
+
63994
+ CLASS lcl IMPLEMENTATION.
63995
+ METHOD constructor.
63996
+ ENDMETHOD.
63992
63997
  ENDCLASS.`,
63993
- goodExample: `CLASS lcl DEFINITION.
63994
- PRIVATE SECTION.
63995
- METHODS constructor.
63996
- ENDCLASS.
63997
-
63998
- CLASS lcl IMPLEMENTATION.
63999
- METHOD constructor.
64000
- ENDMETHOD.
63998
+ goodExample: `CLASS lcl DEFINITION.
63999
+ PRIVATE SECTION.
64000
+ METHODS constructor.
64001
+ ENDCLASS.
64002
+
64003
+ CLASS lcl IMPLEMENTATION.
64004
+ METHOD constructor.
64005
+ ENDMETHOD.
64001
64006
  ENDCLASS.`,
64002
64007
  };
64003
64008
  }
@@ -64398,9 +64403,9 @@ class IntfReferencingClas {
64398
64403
  key: "intf_referencing_clas",
64399
64404
  title: "INTF referencing CLAS",
64400
64405
  shortDescription: `Interface contains references to class`,
64401
- extendedInformation: `Only global interfaces are checked.
64402
- Only first level references are checked.
64403
- Exception class references are ignored.
64406
+ extendedInformation: `Only global interfaces are checked.
64407
+ Only first level references are checked.
64408
+ Exception class references are ignored.
64404
64409
  Void references are ignored.`,
64405
64410
  };
64406
64411
  }
@@ -64485,9 +64490,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64485
64490
  title: "Invalid Table Index",
64486
64491
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64487
64492
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64488
- badExample: `DATA(first) = table[ 0 ].
64493
+ badExample: `DATA(first) = table[ 0 ].
64489
64494
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64490
- goodExample: `DATA(first) = table[ 1 ].
64495
+ goodExample: `DATA(first) = table[ 1 ].
64491
64496
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64492
64497
  };
64493
64498
  }
@@ -65088,8 +65093,8 @@ class LineBreakStyle {
65088
65093
  return {
65089
65094
  key: "line_break_style",
65090
65095
  title: "Makes sure line breaks are consistent in the ABAP code",
65091
- shortDescription: `Enforces LF as newlines in ABAP files
65092
-
65096
+ shortDescription: `Enforces LF as newlines in ABAP files
65097
+
65093
65098
  abapGit does not work with CRLF`,
65094
65099
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
65095
65100
  };
@@ -65158,7 +65163,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
65158
65163
  key: "line_length",
65159
65164
  title: "Line length",
65160
65165
  shortDescription: `Detects lines exceeding the provided maximum length.`,
65161
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65166
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65162
65167
  https://docs.abapopenchecks.org/checks/04/`,
65163
65168
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65164
65169
  };
@@ -65229,7 +65234,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
65229
65234
  key: "line_only_punc",
65230
65235
  title: "Line containing only punctuation",
65231
65236
  shortDescription: `Detects lines containing only punctuation.`,
65232
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65237
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65233
65238
  https://docs.abapopenchecks.org/checks/16/`,
65234
65239
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65235
65240
  badExample: "zcl_class=>method(\n).",
@@ -65492,15 +65497,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65492
65497
  return {
65493
65498
  key: "local_variable_names",
65494
65499
  title: "Local variable naming conventions",
65495
- shortDescription: `
65496
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65500
+ shortDescription: `
65501
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65497
65502
  Regexes are case-insensitive.`,
65498
65503
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65499
- badExample: `FORM bar.
65500
- DATA foo.
65504
+ badExample: `FORM bar.
65505
+ DATA foo.
65501
65506
  ENDFORM.`,
65502
- goodExample: `FORM bar.
65503
- DATA lv_foo.
65507
+ goodExample: `FORM bar.
65508
+ DATA lv_foo.
65504
65509
  ENDFORM.`,
65505
65510
  };
65506
65511
  }
@@ -65652,9 +65657,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65652
65657
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65653
65658
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65654
65659
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65655
- badExample: `DEFINE something.
65660
+ badExample: `DEFINE something.
65656
65661
  END-OF-DEFINITION.`,
65657
- goodExample: `DEFINE _something.
65662
+ goodExample: `DEFINE _something.
65658
65663
  END-OF-DEFINITION.`,
65659
65664
  };
65660
65665
  }
@@ -65727,10 +65732,10 @@ class MainFileContents {
65727
65732
  key: "main_file_contents",
65728
65733
  title: "Main file contents",
65729
65734
  shortDescription: `Checks related to report declarations.`,
65730
- extendedInformation: `Does not run if the target version is Cloud
65731
-
65732
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65733
- * TYPEs must begin with "TYPE-POOL <name>."
65735
+ extendedInformation: `Does not run if the target version is Cloud
65736
+
65737
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65738
+ * TYPEs must begin with "TYPE-POOL <name>."
65734
65739
  `,
65735
65740
  };
65736
65741
  }
@@ -65846,17 +65851,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65846
65851
  title: "Too many parentheses",
65847
65852
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65848
65853
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65849
- badExample: `
65850
- IF ( destination IS INITIAL ).
65851
- ENDIF.
65852
- IF foo = boo AND ( bar = lar AND moo = loo ).
65853
- ENDIF.
65854
+ badExample: `
65855
+ IF ( destination IS INITIAL ).
65856
+ ENDIF.
65857
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65858
+ ENDIF.
65854
65859
  `,
65855
- goodExample: `
65856
- IF destination IS INITIAL.
65857
- ENDIF.
65858
- IF foo = boo AND bar = lar AND moo = loo.
65859
- ENDIF.
65860
+ goodExample: `
65861
+ IF destination IS INITIAL.
65862
+ ENDIF.
65863
+ IF foo = boo AND bar = lar AND moo = loo.
65864
+ ENDIF.
65860
65865
  `,
65861
65866
  };
65862
65867
  }
@@ -66030,14 +66035,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
66030
66035
  title: "Max one method parameter definition per line",
66031
66036
  shortDescription: `Keep max one method parameter description per line`,
66032
66037
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
66033
- badExample: `
66034
- METHODS apps_scope_token
66035
- IMPORTING
66038
+ badExample: `
66039
+ METHODS apps_scope_token
66040
+ IMPORTING
66036
66041
  body TYPE bodyapps_scope_token client_id TYPE str.`,
66037
- goodExample: `
66038
- METHODS apps_scope_token
66039
- IMPORTING
66040
- body TYPE bodyapps_scope_token
66042
+ goodExample: `
66043
+ METHODS apps_scope_token
66044
+ IMPORTING
66045
+ body TYPE bodyapps_scope_token
66041
66046
  client_id TYPE str.`,
66042
66047
  };
66043
66048
  }
@@ -66102,11 +66107,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
66102
66107
  key: "max_one_statement",
66103
66108
  title: "Max one statement per line",
66104
66109
  shortDescription: `Checks that each line contains only a single statement.`,
66105
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66106
-
66107
- Does not report anything for chained statements.
66108
-
66109
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66110
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66111
+
66112
+ Does not report anything for chained statements.
66113
+
66114
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66110
66115
  https://docs.abapopenchecks.org/checks/11/`,
66111
66116
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66112
66117
  badExample: `WRITE foo. WRITE bar.`,
@@ -66444,8 +66449,8 @@ class MethodLength {
66444
66449
  key: "method_length",
66445
66450
  title: "Method/Form Length",
66446
66451
  shortDescription: `Checks relating to method/form length.`,
66447
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66448
-
66452
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66453
+
66449
66454
  Abstract methods without statements are considered okay.`,
66450
66455
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66451
66456
  };
@@ -66550,20 +66555,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66550
66555
  key: "method_overwrites_builtin",
66551
66556
  title: "Method name overwrites builtin function",
66552
66557
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66553
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66554
-
66555
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66556
-
66558
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66559
+
66560
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66561
+
66557
66562
  Interface method names are ignored`,
66558
66563
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66559
- badExample: `CLASS lcl DEFINITION.
66560
- PUBLIC SECTION.
66561
- METHODS matches.
66562
- ENDCLASS.
66563
-
66564
- CLASS lcl IMPLEMENTATION.
66565
- METHOD matches.
66566
- ENDMETHOD.
66564
+ badExample: `CLASS lcl DEFINITION.
66565
+ PUBLIC SECTION.
66566
+ METHODS matches.
66567
+ ENDCLASS.
66568
+
66569
+ CLASS lcl IMPLEMENTATION.
66570
+ METHOD matches.
66571
+ ENDMETHOD.
66567
66572
  ENDCLASS.`,
66568
66573
  };
66569
66574
  }
@@ -66754,12 +66759,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66754
66759
  // eslint-disable-next-line max-len
66755
66760
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66756
66761
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66757
- badExample: `CLASS lcl DEFINITION.
66758
- PUBLIC SECTION.
66759
- METHODS
66760
- foobar
66761
- EXPORTING foo TYPE i
66762
- RETURNING VALUE(rv_string) TYPE string.
66762
+ badExample: `CLASS lcl DEFINITION.
66763
+ PUBLIC SECTION.
66764
+ METHODS
66765
+ foobar
66766
+ EXPORTING foo TYPE i
66767
+ RETURNING VALUE(rv_string) TYPE string.
66763
66768
  ENDCLASS.`,
66764
66769
  };
66765
66770
  }
@@ -67139,7 +67144,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
67139
67144
  key: "nesting",
67140
67145
  title: "Check nesting depth",
67141
67146
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
67142
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67147
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67143
67148
  https://docs.abapopenchecks.org/checks/74/`,
67144
67149
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67145
67150
  };
@@ -67382,7 +67387,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67382
67387
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67383
67388
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67384
67389
  badExample: `var1 = var2 = var3.`,
67385
- goodExample: `var2 = var3.
67390
+ goodExample: `var2 = var3.
67386
67391
  var1 = var2.`,
67387
67392
  };
67388
67393
  }
@@ -67441,8 +67446,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67441
67446
  key: "no_external_form_calls",
67442
67447
  title: "No external FORM calls",
67443
67448
  shortDescription: `Detect external form calls`,
67444
- badExample: `PERFORM foo IN PROGRAM bar.
67445
-
67449
+ badExample: `PERFORM foo IN PROGRAM bar.
67450
+
67446
67451
  PERFORM foo(bar).`,
67447
67452
  tags: [_irule_1.RuleTag.SingleFile],
67448
67453
  };
@@ -67503,17 +67508,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67503
67508
  key: "no_inline_in_optional_branches",
67504
67509
  title: "Don't declare inline in optional branches",
67505
67510
  shortDescription: `Don't declare inline in optional branches`,
67506
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67507
-
67508
- Considered optional branches:
67509
- * inside IF/ELSEIF/ELSE
67510
- * inside LOOP
67511
- * inside WHILE
67512
- * inside CASE/WHEN, CASE TYPE OF
67513
- * inside DO
67514
- * inside SELECT loops
67515
-
67516
- Not considered optional branches:
67511
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67512
+
67513
+ Considered optional branches:
67514
+ * inside IF/ELSEIF/ELSE
67515
+ * inside LOOP
67516
+ * inside WHILE
67517
+ * inside CASE/WHEN, CASE TYPE OF
67518
+ * inside DO
67519
+ * inside SELECT loops
67520
+
67521
+ Not considered optional branches:
67517
67522
  * TRY/CATCH/CLEANUP`,
67518
67523
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67519
67524
  };
@@ -67613,12 +67618,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67613
67618
  key: "no_prefixes",
67614
67619
  title: "No Prefixes",
67615
67620
  shortDescription: `Dont use hungarian notation`,
67616
- extendedInformation: `
67617
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67618
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67619
-
67620
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67621
-
67621
+ extendedInformation: `
67622
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67623
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67624
+
67625
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67626
+
67622
67627
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67623
67628
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67624
67629
  badExample: `DATA lv_foo TYPE i.`,
@@ -67797,7 +67802,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67797
67802
  return {
67798
67803
  key: "no_public_attributes",
67799
67804
  title: "No public attributes",
67800
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67805
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67801
67806
  Exceptions are excluded from this rule.`,
67802
67807
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67803
67808
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67898,13 +67903,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67898
67903
  key: "no_yoda_conditions",
67899
67904
  title: "No Yoda conditions",
67900
67905
  shortDescription: `Finds Yoda conditions and reports issues`,
67901
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67902
-
67906
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67907
+
67903
67908
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67904
67909
  tags: [_irule_1.RuleTag.SingleFile],
67905
- badExample: `IF 0 <> sy-subrc.
67910
+ badExample: `IF 0 <> sy-subrc.
67906
67911
  ENDIF.`,
67907
- goodExample: `IF sy-subrc <> 0.
67912
+ goodExample: `IF sy-subrc <> 0.
67908
67913
  ENDIF.`,
67909
67914
  };
67910
67915
  }
@@ -68005,8 +68010,8 @@ class NROBConsistency {
68005
68010
  key: "nrob_consistency",
68006
68011
  title: "Number range consistency",
68007
68012
  shortDescription: `Consistency checks for number ranges`,
68008
- extendedInformation: `Issue reported if percentage warning is over 50%
68009
-
68013
+ extendedInformation: `Issue reported if percentage warning is over 50%
68014
+
68010
68015
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
68011
68016
  tags: [_irule_1.RuleTag.SingleFile],
68012
68017
  };
@@ -68283,58 +68288,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
68283
68288
  title: "Obsolete statements",
68284
68289
  shortDescription: `Checks for usages of certain obsolete statements`,
68285
68290
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68286
- extendedInformation: `
68287
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68288
-
68289
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68290
-
68291
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68292
-
68293
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68294
-
68295
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68296
-
68297
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68298
-
68299
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68300
-
68301
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68302
-
68303
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68304
-
68305
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68306
-
68307
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68308
-
68309
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68310
-
68311
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68312
-
68313
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68314
-
68315
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68316
- SELECT COUNT(*) is considered okay
68317
-
68318
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68319
-
68320
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68321
-
68322
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68323
-
68324
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68325
-
68326
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
68327
-
68291
+ extendedInformation: `
68292
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68293
+
68294
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68295
+
68296
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68297
+
68298
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68299
+
68300
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68301
+
68302
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68303
+
68304
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68305
+
68306
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68307
+
68308
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68309
+
68310
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68311
+
68312
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68313
+
68314
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68315
+
68316
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68317
+
68318
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68319
+
68320
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68321
+ SELECT COUNT(*) is considered okay
68322
+
68323
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68324
+
68325
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68326
+
68327
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68328
+
68329
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68330
+
68331
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68332
+
68328
68333
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
68329
- badExample: `REFRESH itab.
68330
-
68331
- COMPUTE foo = 2 + 2.
68332
-
68333
- MULTIPLY lv_foo BY 2.
68334
-
68335
- INTERFACE intf LOAD.
68336
-
68337
- IF foo IS SUPPLIED.
68334
+ badExample: `REFRESH itab.
68335
+
68336
+ COMPUTE foo = 2 + 2.
68337
+
68338
+ MULTIPLY lv_foo BY 2.
68339
+
68340
+ INTERFACE intf LOAD.
68341
+
68342
+ IF foo IS SUPPLIED.
68338
68343
  ENDIF.`,
68339
68344
  };
68340
68345
  }
@@ -68674,9 +68679,9 @@ class OmitParameterName {
68674
68679
  key: "omit_parameter_name",
68675
68680
  title: "Omit parameter name",
68676
68681
  shortDescription: `Omit the parameter name in single parameter calls`,
68677
- extendedInformation: `
68678
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68679
-
68682
+ extendedInformation: `
68683
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68684
+
68680
68685
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68681
68686
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68682
68687
  badExample: `method( param = 2 ).`,
@@ -68882,20 +68887,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68882
68887
  shortDescription: `Omit RECEIVING`,
68883
68888
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68884
68889
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68885
- badExample: `
68886
- upload_pack(
68887
- EXPORTING
68888
- io_client = lo_client
68889
- iv_url = iv_url
68890
- iv_deepen_level = iv_deepen_level
68891
- it_hashes = lt_hashes
68892
- RECEIVING
68890
+ badExample: `
68891
+ upload_pack(
68892
+ EXPORTING
68893
+ io_client = lo_client
68894
+ iv_url = iv_url
68895
+ iv_deepen_level = iv_deepen_level
68896
+ it_hashes = lt_hashes
68897
+ RECEIVING
68893
68898
  rt_objects = et_objects ).`,
68894
- goodExample: `
68895
- et_objects = upload_pack(
68896
- io_client = lo_client
68897
- iv_url = iv_url
68898
- iv_deepen_level = iv_deepen_level
68899
+ goodExample: `
68900
+ et_objects = upload_pack(
68901
+ io_client = lo_client
68902
+ iv_url = iv_url
68903
+ iv_deepen_level = iv_deepen_level
68899
68904
  it_hashes = lt_hashes ).`,
68900
68905
  };
68901
68906
  }
@@ -68959,8 +68964,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68959
68964
  return {
68960
68965
  key: "parser_702_chaining",
68961
68966
  title: "Parser Error, bad chanining on 702",
68962
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68963
- this rule finds these and reports errors.
68967
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68968
+ this rule finds these and reports errors.
68964
68969
  Only active on target version 702 and below.`,
68965
68970
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68966
68971
  };
@@ -69040,8 +69045,8 @@ class ParserError {
69040
69045
  return {
69041
69046
  key: "parser_error",
69042
69047
  title: "Parser error",
69043
- shortDescription: `Checks for syntax not recognized by abaplint.
69044
-
69048
+ shortDescription: `Checks for syntax not recognized by abaplint.
69049
+
69045
69050
  See recognized syntax at https://syntax.abaplint.org`,
69046
69051
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69047
69052
  };
@@ -69126,7 +69131,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
69126
69131
  return {
69127
69132
  key: "parser_missing_space",
69128
69133
  title: "Parser Error, missing space",
69129
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69134
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69130
69135
  This rule makes sure the spaces are consistently required across the language.`,
69131
69136
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
69132
69137
  badExample: `IF ( foo = 'bar').`,
@@ -69549,25 +69554,25 @@ class PreferInline {
69549
69554
  key: "prefer_inline",
69550
69555
  title: "Prefer Inline Declarations",
69551
69556
  shortDescription: `Prefer inline to up-front declarations.`,
69552
- extendedInformation: `EXPERIMENTAL
69553
-
69554
- Activates if language version is v740sp02 or above.
69555
-
69556
- Variables must be local(METHOD or FORM).
69557
-
69558
- No generic or void typed variables. No syntax errors.
69559
-
69560
- First position used must be a full/pure write.
69561
-
69562
- Move statment is not a cast(?=)
69563
-
69557
+ extendedInformation: `EXPERIMENTAL
69558
+
69559
+ Activates if language version is v740sp02 or above.
69560
+
69561
+ Variables must be local(METHOD or FORM).
69562
+
69563
+ No generic or void typed variables. No syntax errors.
69564
+
69565
+ First position used must be a full/pure write.
69566
+
69567
+ Move statment is not a cast(?=)
69568
+
69564
69569
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69565
69570
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69566
- badExample: `DATA foo TYPE i.
69567
- foo = 2.
69568
- DATA percentage TYPE decfloat34.
69571
+ badExample: `DATA foo TYPE i.
69572
+ foo = 2.
69573
+ DATA percentage TYPE decfloat34.
69569
69574
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69570
- goodExample: `DATA(foo) = 2.
69575
+ goodExample: `DATA(foo) = 2.
69571
69576
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69572
69577
  };
69573
69578
  }
@@ -69781,18 +69786,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69781
69786
  key: "prefer_is_not",
69782
69787
  title: "Prefer IS NOT to NOT IS",
69783
69788
  shortDescription: `Prefer IS NOT to NOT IS`,
69784
- extendedInformation: `
69785
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69786
-
69789
+ extendedInformation: `
69790
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69791
+
69787
69792
  "if not is_valid( )." examples are skipped`,
69788
69793
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69789
- goodExample: `IF variable IS NOT INITIAL.
69790
- IF variable NP 'TODO*'.
69791
- IF variable <> 42.
69794
+ goodExample: `IF variable IS NOT INITIAL.
69795
+ IF variable NP 'TODO*'.
69796
+ IF variable <> 42.
69792
69797
  IF variable CO 'hello'.`,
69793
- badExample: `IF NOT variable IS INITIAL.
69794
- IF NOT variable CP 'TODO*'.
69795
- IF NOT variable = 42.
69798
+ badExample: `IF NOT variable IS INITIAL.
69799
+ IF NOT variable CP 'TODO*'.
69800
+ IF NOT variable = 42.
69796
69801
  IF NOT variable CA 'hello'.`,
69797
69802
  };
69798
69803
  }
@@ -69980,14 +69985,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69980
69985
  key: "prefer_raise_exception_new",
69981
69986
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69982
69987
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
69983
- extendedInformation: `
69984
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69985
-
69988
+ extendedInformation: `
69989
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
69990
+
69986
69991
  From 752 and up`,
69987
69992
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69988
69993
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69989
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69990
- EXPORTING
69994
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
69995
+ EXPORTING
69991
69996
  previous = exception.`,
69992
69997
  };
69993
69998
  }
@@ -70065,12 +70070,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
70065
70070
  key: "prefer_returning_to_exporting",
70066
70071
  title: "Prefer RETURNING to EXPORTING",
70067
70072
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
70068
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70073
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70069
70074
  https://docs.abapopenchecks.org/checks/44/`,
70070
70075
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70071
- badExample: `CLASS lcl DEFINITION.
70072
- PUBLIC SECTION.
70073
- METHODS test EXPORTING ev_foo TYPE i.
70076
+ badExample: `CLASS lcl DEFINITION.
70077
+ PUBLIC SECTION.
70078
+ METHODS test EXPORTING ev_foo TYPE i.
70074
70079
  ENDCLASS.`,
70075
70080
  };
70076
70081
  }
@@ -70166,8 +70171,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
70166
70171
  key: "prefer_xsdbool",
70167
70172
  title: "Prefer xsdbool over boolc",
70168
70173
  shortDescription: `Prefer xsdbool over boolc`,
70169
- extendedInformation: `Activates if language version is v740sp08 or above.
70170
-
70174
+ extendedInformation: `Activates if language version is v740sp08 or above.
70175
+
70171
70176
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
70172
70177
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70173
70178
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -70239,9 +70244,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
70239
70244
  title: "Preferred compare operator",
70240
70245
  shortDescription: `Configure undesired operator variants`,
70241
70246
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70242
- badExample: `IF foo EQ bar.
70247
+ badExample: `IF foo EQ bar.
70243
70248
  ENDIF.`,
70244
- goodExample: `IF foo = bar.
70249
+ goodExample: `IF foo = bar.
70245
70250
  ENDIF.`,
70246
70251
  };
70247
70252
  }
@@ -70465,26 +70470,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70465
70470
  key: "reduce_procedural_code",
70466
70471
  title: "Reduce procedural code",
70467
70472
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70468
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70469
-
70470
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70471
-
70473
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70474
+
70475
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70476
+
70472
70477
  Comments are not counted as statements.`,
70473
70478
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70474
- badExample: `FORM foo.
70475
- DATA lv_bar TYPE i.
70476
- lv_bar = 2 + 2.
70477
- IF lv_bar = 4.
70478
- WRITE 'hello world'.
70479
- ENDIF.
70480
- DATA lv_bar TYPE i.
70481
- lv_bar = 2 + 2.
70482
- IF lv_bar = 4.
70483
- WRITE 'hello world'.
70484
- ENDIF.
70479
+ badExample: `FORM foo.
70480
+ DATA lv_bar TYPE i.
70481
+ lv_bar = 2 + 2.
70482
+ IF lv_bar = 4.
70483
+ WRITE 'hello world'.
70484
+ ENDIF.
70485
+ DATA lv_bar TYPE i.
70486
+ lv_bar = 2 + 2.
70487
+ IF lv_bar = 4.
70488
+ WRITE 'hello world'.
70489
+ ENDIF.
70485
70490
  ENDFORM.`,
70486
- goodExample: `FORM foo.
70487
- NEW zcl_global_class( )->run_logic( ).
70491
+ goodExample: `FORM foo.
70492
+ NEW zcl_global_class( )->run_logic( ).
70488
70493
  ENDFORM.`,
70489
70494
  };
70490
70495
  }
@@ -70728,10 +70733,10 @@ class RemoveDescriptions {
70728
70733
  return {
70729
70734
  key: "remove_descriptions",
70730
70735
  title: "Remove descriptions",
70731
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70732
-
70733
- Class descriptions are required, see rule description_empty.
70734
-
70736
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70737
+
70738
+ Class descriptions are required, see rule description_empty.
70739
+
70735
70740
  Consider using ABAP Doc for documentation.`,
70736
70741
  tags: [],
70737
70742
  };
@@ -70856,14 +70861,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70856
70861
  tags: [_irule_1.RuleTag.SingleFile],
70857
70862
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70858
70863
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70859
- badExample: `CALL FUNCTION 'ZRFC'
70864
+ badExample: `CALL FUNCTION 'ZRFC'
70860
70865
  DESTINATION lv_rfc.`,
70861
- goodExample: `CALL FUNCTION 'ZRFC'
70862
- DESTINATION lv_rfc
70863
- EXCEPTIONS
70864
- system_failure = 1 MESSAGE msg
70865
- communication_failure = 2 MESSAGE msg
70866
- resource_failure = 3
70866
+ goodExample: `CALL FUNCTION 'ZRFC'
70867
+ DESTINATION lv_rfc
70868
+ EXCEPTIONS
70869
+ system_failure = 1 MESSAGE msg
70870
+ communication_failure = 2 MESSAGE msg
70871
+ resource_failure = 3
70867
70872
  OTHERS = 4.`,
70868
70873
  };
70869
70874
  }
@@ -70947,11 +70952,11 @@ class SelectAddOrderBy {
70947
70952
  key: "select_add_order_by",
70948
70953
  title: "SELECT add ORDER BY",
70949
70954
  shortDescription: `SELECTs add ORDER BY clause`,
70950
- extendedInformation: `
70951
- This will make sure that the SELECT statement returns results in the same sequence on different databases
70952
-
70953
- add ORDER BY PRIMARY KEY if in doubt
70954
-
70955
+ extendedInformation: `
70956
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70957
+
70958
+ add ORDER BY PRIMARY KEY if in doubt
70959
+
70955
70960
  If the target is a sorted/hashed table, no issue is reported`,
70956
70961
  tags: [_irule_1.RuleTag.SingleFile],
70957
70962
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -71082,14 +71087,14 @@ class SelectPerformance {
71082
71087
  key: "select_performance",
71083
71088
  title: "SELECT performance",
71084
71089
  shortDescription: `Various checks regarding SELECT performance.`,
71085
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71086
-
71090
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71091
+
71087
71092
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
71088
71093
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
71089
- badExample: `SELECT field1, field2 FROM table
71090
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71094
+ badExample: `SELECT field1, field2 FROM table
71095
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71091
71096
  ENDSELECT.`,
71092
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71097
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71093
71098
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
71094
71099
  };
71095
71100
  }
@@ -71203,8 +71208,8 @@ class SelectSingleFullKey {
71203
71208
  key: "select_single_full_key",
71204
71209
  title: "Detect SELECT SINGLE which are possibily not unique",
71205
71210
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
71206
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71207
-
71211
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71212
+
71208
71213
  If the statement contains a JOIN it is not checked`,
71209
71214
  pseudoComment: "EC CI_NOORDER",
71210
71215
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71628,8 +71633,8 @@ class SICFConsistency {
71628
71633
  key: "sicf_consistency",
71629
71634
  title: "SICF consistency",
71630
71635
  shortDescription: `Checks the validity of ICF services`,
71631
- extendedInformation: `* Class defined in handler must exist
71632
- * Class must not have any syntax errors
71636
+ extendedInformation: `* Class defined in handler must exist
71637
+ * Class must not have any syntax errors
71633
71638
  * Class must implement interface IF_HTTP_EXTENSION`,
71634
71639
  };
71635
71640
  }
@@ -71741,23 +71746,23 @@ class SlowParameterPassing {
71741
71746
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71742
71747
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71743
71748
  tags: [_irule_1.RuleTag.Performance],
71744
- badExample: `CLASS lcl DEFINITION.
71745
- PUBLIC SECTION.
71746
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71747
- ENDCLASS.
71748
- CLASS lcl IMPLEMENTATION.
71749
- METHOD bar.
71750
- WRITE sdf.
71751
- ENDMETHOD.
71749
+ badExample: `CLASS lcl DEFINITION.
71750
+ PUBLIC SECTION.
71751
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71752
+ ENDCLASS.
71753
+ CLASS lcl IMPLEMENTATION.
71754
+ METHOD bar.
71755
+ WRITE sdf.
71756
+ ENDMETHOD.
71752
71757
  ENDCLASS.`,
71753
- goodExample: `CLASS lcl DEFINITION.
71754
- PUBLIC SECTION.
71755
- METHODS bar IMPORTING sdf TYPE string.
71756
- ENDCLASS.
71757
- CLASS lcl IMPLEMENTATION.
71758
- METHOD bar.
71759
- WRITE sdf.
71760
- ENDMETHOD.
71758
+ goodExample: `CLASS lcl DEFINITION.
71759
+ PUBLIC SECTION.
71760
+ METHODS bar IMPORTING sdf TYPE string.
71761
+ ENDCLASS.
71762
+ CLASS lcl IMPLEMENTATION.
71763
+ METHOD bar.
71764
+ WRITE sdf.
71765
+ ENDMETHOD.
71761
71766
  ENDCLASS.`,
71762
71767
  };
71763
71768
  }
@@ -72014,8 +72019,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
72014
72019
  key: "space_before_dot",
72015
72020
  title: "Space before dot",
72016
72021
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
72017
- extendedInformation: `
72018
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72022
+ extendedInformation: `
72023
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72019
72024
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
72020
72025
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72021
72026
  badExample: `WRITE bar .`,
@@ -72201,12 +72206,12 @@ class SQLValueConversion {
72201
72206
  key: "sql_value_conversion",
72202
72207
  title: "Implicit SQL Value Conversion",
72203
72208
  shortDescription: `Ensure types match when selecting from database`,
72204
- extendedInformation: `
72205
- * Integer to CHAR conversion
72206
- * Integer to NUMC conversion
72207
- * NUMC to Integer conversion
72208
- * CHAR to Integer conversion
72209
- * Source field longer than database field, CHAR -> CHAR
72209
+ extendedInformation: `
72210
+ * Integer to CHAR conversion
72211
+ * Integer to NUMC conversion
72212
+ * NUMC to Integer conversion
72213
+ * CHAR to Integer conversion
72214
+ * Source field longer than database field, CHAR -> CHAR
72210
72215
  * Source field longer than database field, NUMC -> NUMC`,
72211
72216
  tags: [],
72212
72217
  };
@@ -72278,7 +72283,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
72278
72283
  key: "start_at_tab",
72279
72284
  title: "Start at tab",
72280
72285
  shortDescription: `Checks that statements start at tabstops.`,
72281
- extendedInformation: `Reports max 100 issues per file
72286
+ extendedInformation: `Reports max 100 issues per file
72282
72287
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
72283
72288
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72284
72289
  badExample: ` WRITE a.`,
@@ -72455,12 +72460,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72455
72460
  key: "strict_sql",
72456
72461
  title: "Strict SQL",
72457
72462
  shortDescription: `Strict SQL`,
72458
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72459
-
72460
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72461
-
72462
- Also see separate rule sql_escape_host_variables
72463
-
72463
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72464
+
72465
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72466
+
72467
+ Also see separate rule sql_escape_host_variables
72468
+
72464
72469
  Activates from v750 and up`,
72465
72470
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72466
72471
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72714,11 +72719,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72714
72719
  key: "sy_modification",
72715
72720
  title: "Modification of SY fields",
72716
72721
  shortDescription: `Finds modification of sy fields`,
72717
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72718
-
72722
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72723
+
72719
72724
  Changes to SY-TVAR* fields are not reported`,
72720
72725
  tags: [_irule_1.RuleTag.SingleFile],
72721
- badExample: `sy-uname = 2.
72726
+ badExample: `sy-uname = 2.
72722
72727
  sy = sy.`,
72723
72728
  };
72724
72729
  }
@@ -72780,8 +72785,8 @@ class TABLEnhancementCategory {
72780
72785
  key: "tabl_enhancement_category",
72781
72786
  title: "TABL enhancement category must be set",
72782
72787
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72783
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72784
-
72788
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72789
+
72785
72790
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72786
72791
  tags: [],
72787
72792
  };
@@ -72846,8 +72851,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72846
72851
  shortDescription: `TABLES are always global, so declare them globally`,
72847
72852
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72848
72853
  tags: [_irule_1.RuleTag.SingleFile],
72849
- badExample: `FORM foo.
72850
- TABLES t100.
72854
+ badExample: `FORM foo.
72855
+ TABLES t100.
72851
72856
  ENDFORM.`,
72852
72857
  goodExample: `TABLES t000.`,
72853
72858
  };
@@ -72975,9 +72980,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72975
72980
  title: "Type FORM parameters",
72976
72981
  shortDescription: `Checks for untyped FORM parameters`,
72977
72982
  tags: [_irule_1.RuleTag.SingleFile],
72978
- badExample: `FORM foo USING bar.
72983
+ badExample: `FORM foo USING bar.
72979
72984
  ENDFORM.`,
72980
- goodExample: `FORM foo USING bar TYPE string.
72985
+ goodExample: `FORM foo USING bar TYPE string.
72981
72986
  ENDFORM.`,
72982
72987
  };
72983
72988
  }
@@ -73650,38 +73655,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73650
73655
  key: "unnecessary_pragma",
73651
73656
  title: "Unnecessary Pragma",
73652
73657
  shortDescription: `Finds pragmas which can be removed`,
73653
- extendedInformation: `* NO_HANDLER with handler
73654
-
73655
- * NEEDED without definition
73656
-
73657
- * NO_TEXT without texts
73658
-
73659
- * SUBRC_OK where sy-subrc is checked
73660
-
73658
+ extendedInformation: `* NO_HANDLER with handler
73659
+
73660
+ * NEEDED without definition
73661
+
73662
+ * NO_TEXT without texts
73663
+
73664
+ * SUBRC_OK where sy-subrc is checked
73665
+
73661
73666
  NO_HANDLER inside macros are not checked`,
73662
73667
  tags: [_irule_1.RuleTag.SingleFile],
73663
- badExample: `TRY.
73664
- ...
73665
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73666
- RETURN. " it has a handler
73667
- ENDTRY.
73668
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73669
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73670
- IF sy-subrc <> 0.
73668
+ badExample: `TRY.
73669
+ ...
73670
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73671
+ RETURN. " it has a handler
73672
+ ENDTRY.
73673
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73674
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73675
+ IF sy-subrc <> 0.
73671
73676
  ENDIF.`,
73672
- goodExample: `TRY.
73673
- ...
73674
- CATCH zcx_abapgit_exception.
73675
- RETURN.
73676
- ENDTRY.
73677
- MESSAGE w125(zbar) WITH c_foo INTO message.
73678
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73679
- IF sy-subrc <> 0.
73680
- ENDIF.
73681
-
73682
- DATA: BEGIN OF blah ##NEEDED,
73683
- test1 TYPE string,
73684
- test2 TYPE string,
73677
+ goodExample: `TRY.
73678
+ ...
73679
+ CATCH zcx_abapgit_exception.
73680
+ RETURN.
73681
+ ENDTRY.
73682
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73683
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73684
+ IF sy-subrc <> 0.
73685
+ ENDIF.
73686
+
73687
+ DATA: BEGIN OF blah ##NEEDED,
73688
+ test1 TYPE string,
73689
+ test2 TYPE string,
73685
73690
  END OF blah.`,
73686
73691
  };
73687
73692
  }
@@ -73848,18 +73853,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73848
73853
  shortDescription: `Finds unnecessary RETURN statements`,
73849
73854
  extendedInformation: `Finds unnecessary RETURN statements`,
73850
73855
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73851
- badExample: `FORM hello1.
73852
- WRITE 'world'.
73853
- RETURN.
73854
- ENDFORM.
73855
-
73856
- FORM foo.
73857
- IF 1 = 2.
73858
- RETURN.
73859
- ENDIF.
73856
+ badExample: `FORM hello1.
73857
+ WRITE 'world'.
73858
+ RETURN.
73859
+ ENDFORM.
73860
+
73861
+ FORM foo.
73862
+ IF 1 = 2.
73863
+ RETURN.
73864
+ ENDIF.
73860
73865
  ENDFORM.`,
73861
- goodExample: `FORM hello2.
73862
- WRITE 'world'.
73866
+ goodExample: `FORM hello2.
73867
+ WRITE 'world'.
73863
73868
  ENDFORM.`,
73864
73869
  };
73865
73870
  }
@@ -74210,13 +74215,13 @@ class UnusedMacros {
74210
74215
  title: "Unused macros",
74211
74216
  shortDescription: `Checks for unused macro definitions definitions`,
74212
74217
  tags: [_irule_1.RuleTag.Quickfix],
74213
- badExample: `DEFINE foobar1.
74214
- WRITE 'hello'.
74218
+ badExample: `DEFINE foobar1.
74219
+ WRITE 'hello'.
74215
74220
  END-OF-DEFINITION.`,
74216
- goodExample: `DEFINE foobar2.
74217
- WRITE 'hello'.
74218
- END-OF-DEFINITION.
74219
-
74221
+ goodExample: `DEFINE foobar2.
74222
+ WRITE 'hello'.
74223
+ END-OF-DEFINITION.
74224
+
74220
74225
  foobar2.`,
74221
74226
  };
74222
74227
  }
@@ -74328,18 +74333,18 @@ class UnusedMethods {
74328
74333
  key: "unused_methods",
74329
74334
  title: "Unused methods",
74330
74335
  shortDescription: `Checks for unused methods`,
74331
- extendedInformation: `Checks private and protected methods.
74332
-
74333
- Unused methods are not reported if the object contains parser or syntax errors.
74334
- Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74335
-
74336
- Skips:
74337
- * methods FOR TESTING
74338
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74339
- * class_constructor + constructor methods
74340
- * event handlers
74341
- * methods that are redefined
74342
- * INCLUDEs
74336
+ extendedInformation: `Checks private and protected methods.
74337
+
74338
+ Unused methods are not reported if the object contains parser or syntax errors.
74339
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74340
+
74341
+ Skips:
74342
+ * methods FOR TESTING
74343
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74344
+ * class_constructor + constructor methods
74345
+ * event handlers
74346
+ * methods that are redefined
74347
+ * INCLUDEs
74343
74348
  `,
74344
74349
  tags: [_irule_1.RuleTag.Quickfix],
74345
74350
  pragma: "##CALLED",
@@ -74815,23 +74820,23 @@ class UnusedVariables {
74815
74820
  key: "unused_variables",
74816
74821
  title: "Unused variables",
74817
74822
  shortDescription: `Checks for unused variables and constants`,
74818
- extendedInformation: `Skips event parameters.
74819
-
74820
- Note that this currently does not work if the source code uses macros.
74821
-
74822
- Unused variables are not reported if the object contains parser or syntax errors.
74823
-
74823
+ extendedInformation: `Skips event parameters.
74824
+
74825
+ Note that this currently does not work if the source code uses macros.
74826
+
74827
+ Unused variables are not reported if the object contains parser or syntax errors.
74828
+
74824
74829
  Errors found in INCLUDES are reported for the main program.`,
74825
74830
  tags: [_irule_1.RuleTag.Quickfix],
74826
74831
  pragma: "##NEEDED",
74827
74832
  pseudoComment: "EC NEEDED",
74828
- badExample: `DATA: BEGIN OF blah1,
74829
- test TYPE string,
74830
- test2 TYPE string,
74833
+ badExample: `DATA: BEGIN OF blah1,
74834
+ test TYPE string,
74835
+ test2 TYPE string,
74831
74836
  END OF blah1.`,
74832
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74833
- test TYPE string,
74834
- test2 TYPE string,
74837
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74838
+ test TYPE string,
74839
+ test2 TYPE string,
74835
74840
  END OF blah2.`,
74836
74841
  };
74837
74842
  }
@@ -75050,15 +75055,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
75050
75055
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
75051
75056
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
75052
75057
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
75053
- badExample: `IF line IS INITIAL.
75054
- has_entries = abap_false.
75055
- ELSE.
75056
- has_entries = abap_true.
75057
- ENDIF.
75058
-
75058
+ badExample: `IF line IS INITIAL.
75059
+ has_entries = abap_false.
75060
+ ELSE.
75061
+ has_entries = abap_true.
75062
+ ENDIF.
75063
+
75059
75064
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
75060
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75061
-
75065
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75066
+
75062
75067
  DATA(fsdf) = xsdbool( foo <> bar ).`,
75063
75068
  };
75064
75069
  }
@@ -75176,15 +75181,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
75176
75181
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
75177
75182
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
75178
75183
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75179
- badExample: `INTERFACE lif.
75180
- METHODS load_data
75181
- EXCEPTIONS
75182
- invalid_parameter.
75184
+ badExample: `INTERFACE lif.
75185
+ METHODS load_data
75186
+ EXCEPTIONS
75187
+ invalid_parameter.
75183
75188
  ENDINTERFACE.`,
75184
- goodExample: `INTERFACE lif.
75185
- METHODS load_data
75186
- RAISING
75187
- cx_something.
75189
+ goodExample: `INTERFACE lif.
75190
+ METHODS load_data
75191
+ RAISING
75192
+ cx_something.
75188
75193
  ENDINTERFACE.`,
75189
75194
  };
75190
75195
  }
@@ -75244,15 +75249,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
75244
75249
  key: "use_line_exists",
75245
75250
  title: "Use line_exists",
75246
75251
  shortDescription: `Use line_exists, from 740sp02 and up`,
75247
- extendedInformation: `
75248
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75249
-
75252
+ extendedInformation: `
75253
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75254
+
75250
75255
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
75251
75256
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75252
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75253
- IF sy-subrc = 0.
75257
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75258
+ IF sy-subrc = 0.
75254
75259
  ENDIF.`,
75255
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75260
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75256
75261
  ENDIF.`,
75257
75262
  };
75258
75263
  }
@@ -75362,10 +75367,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75362
75367
  key: "use_new",
75363
75368
  title: "Use NEW",
75364
75369
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
75365
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75366
-
75367
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75368
-
75370
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75371
+
75372
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75373
+
75369
75374
  Applicable from v740sp02 and up`,
75370
75375
  badExample: `CREATE OBJECT ref.`,
75371
75376
  goodExample: `ref = NEW #( ).`,
@@ -75463,13 +75468,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75463
75468
  title: "WHEN OTHERS last",
75464
75469
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75465
75470
  tags: [_irule_1.RuleTag.SingleFile],
75466
- badExample: `CASE bar.
75467
- WHEN OTHERS.
75468
- WHEN 2.
75471
+ badExample: `CASE bar.
75472
+ WHEN OTHERS.
75473
+ WHEN 2.
75469
75474
  ENDCASE.`,
75470
- goodExample: `CASE bar.
75471
- WHEN 2.
75472
- WHEN OTHERS.
75475
+ goodExample: `CASE bar.
75476
+ WHEN 2.
75477
+ WHEN OTHERS.
75473
75478
  ENDCASE.`,
75474
75479
  };
75475
75480
  }