@abaplint/cli 2.113.44 → 2.113.46

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 +865 -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();
@@ -46789,6 +46794,17 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46789
46794
  hasParserError() {
46790
46795
  return this.parserError;
46791
46796
  }
46797
+ listKeys() {
46798
+ var _a;
46799
+ this.parse();
46800
+ const ret = [];
46801
+ for (const field of ((_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.fields) || []) {
46802
+ if (field.key === true) {
46803
+ ret.push(field.name);
46804
+ }
46805
+ }
46806
+ return ret;
46807
+ }
46792
46808
  parse() {
46793
46809
  var _a, _b;
46794
46810
  if (this.isDirty() === false) {
@@ -53059,7 +53075,7 @@ class Registry {
53059
53075
  }
53060
53076
  static abaplintVersion() {
53061
53077
  // magic, see build script "version.sh"
53062
- return "2.113.44";
53078
+ return "2.113.46";
53063
53079
  }
53064
53080
  getDDICReferences() {
53065
53081
  return this.ddicReferences;
@@ -53378,10 +53394,10 @@ class SevenBitAscii {
53378
53394
  key: "7bit_ascii",
53379
53395
  title: "Check for 7bit ascii",
53380
53396
  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
-
53397
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53398
+
53399
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53400
+
53385
53401
  Checkes files with extensions ".abap" and ".asddls"`,
53386
53402
  tags: [_irule_1.RuleTag.SingleFile],
53387
53403
  badExample: `WRITE '뽑'.`,
@@ -53587,10 +53603,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53587
53603
  key: "abapdoc",
53588
53604
  title: "Check abapdoc",
53589
53605
  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
-
53606
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53607
+
53608
+ Plus class and interface definitions.
53609
+
53594
53610
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53595
53611
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53596
53612
  };
@@ -53727,27 +53743,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53727
53743
  title: "Add test attributes for tests classes with test methods",
53728
53744
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53729
53745
  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.
53746
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53747
+ PUBLIC SECTION.
53748
+ PROTECTED SECTION.
53749
+ PRIVATE SECTION.
53750
+ METHODS test FOR TESTING RAISING cx_static_check.
53751
+ ENDCLASS.
53752
+
53753
+ CLASS ltcl_test1 IMPLEMENTATION.
53754
+ METHOD test.
53755
+ ENDMETHOD.
53740
53756
  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.
53757
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53758
+ PUBLIC SECTION.
53759
+ PROTECTED SECTION.
53760
+ PRIVATE SECTION.
53761
+ METHODS test FOR TESTING RAISING cx_static_check.
53762
+ ENDCLASS.
53763
+
53764
+ CLASS ltcl_test2 IMPLEMENTATION.
53765
+ METHOD test.
53766
+ ENDMETHOD.
53751
53767
  ENDCLASS.`,
53752
53768
  };
53753
53769
  }
@@ -53833,49 +53849,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53833
53849
  key: "align_parameters",
53834
53850
  title: "Align Parameters",
53835
53851
  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
53852
+ extendedInformation: `Checks:
53853
+ * function module calls
53854
+ * method calls
53855
+ * VALUE constructors
53856
+ * NEW constructors
53857
+ * RAISE EXCEPTION statements
53858
+ * CREATE OBJECT statements
53859
+ * RAISE EVENT statements
53860
+
53861
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53862
+
53863
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53864
+
53865
+ If parameters are on the same row, no issues are reported, see
53850
53866
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53851
53867
  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
53868
+ badExample: `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
53862
53878
  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
53879
+ goodExample: `CALL FUNCTION 'FOOBAR'
53880
+ EXPORTING
53881
+ foo = 2
53882
+ parameter = 3.
53883
+
53884
+ foobar( moo = 1
53885
+ param = 1 ).
53886
+
53887
+ foo = VALUE #(
53888
+ foo = bar
53889
+ moo = 2 ).
53890
+
53891
+ DATA(sdf) = VALUE type(
53892
+ common_val = 2
53893
+ another_common = 5
53894
+ ( row_value = 4
53879
53895
  value_foo = 5 ) ).`,
53880
53896
  };
53881
53897
  }
@@ -54309,37 +54325,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
54309
54325
  key: "align_type_expressions",
54310
54326
  title: "Align TYPE expressions",
54311
54327
  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:
54328
+ extendedInformation: `
54329
+ Currently works for METHODS + BEGIN OF
54330
+
54331
+ If BEGIN OF has an INCLUDE TYPE its ignored
54332
+
54333
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54318
54334
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54319
54335
  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.
54336
+ badExample: `
54337
+ TYPES: BEGIN OF foo,
54338
+ bar TYPE i,
54339
+ foobar TYPE i,
54340
+ END OF foo.
54341
+
54342
+ INTERFACE lif.
54343
+ METHODS bar
54344
+ IMPORTING
54345
+ foo TYPE i
54346
+ foobar TYPE i.
54331
54347
  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.
54348
+ goodExample: `
54349
+ TYPES: BEGIN OF foo,
54350
+ bar TYPE i,
54351
+ foobar TYPE i,
54352
+ END OF foo.
54353
+
54354
+ INTERFACE lif.
54355
+ METHODS bar
54356
+ IMPORTING
54357
+ foo TYPE i
54358
+ foobar TYPE i.
54343
54359
  ENDINTERFACE.`,
54344
54360
  };
54345
54361
  }
@@ -54618,16 +54634,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54618
54634
  return {
54619
54635
  key: "ambiguous_statement",
54620
54636
  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
-
54637
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54638
+ Add "TABLE" keyword or "@" for escaping SQL variables
54639
+
54624
54640
  Only works if the target version is 740sp05 or above`,
54625
54641
  tags: [_irule_1.RuleTag.SingleFile],
54626
- badExample: `DELETE foo FROM bar.
54642
+ badExample: `DELETE foo FROM bar.
54627
54643
  MODIFY foo FROM bar.`,
54628
- goodExample: `DELETE foo FROM @bar.
54629
- DELETE TABLE itab FROM 2.
54630
- MODIFY zfoo FROM @wa.
54644
+ goodExample: `DELETE foo FROM @bar.
54645
+ DELETE TABLE itab FROM 2.
54646
+ MODIFY zfoo FROM @wa.
54631
54647
  MODIFY TABLE foo FROM bar.`,
54632
54648
  };
54633
54649
  }
@@ -54732,16 +54748,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54732
54748
  key: "avoid_use",
54733
54749
  title: "Avoid use of certain statements",
54734
54750
  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
-
54751
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54752
+
54753
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54754
+
54755
+ STATICS: use CLASS-DATA instead
54756
+
54757
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54758
+
54759
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54760
+
54745
54761
  BREAK points`,
54746
54762
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54747
54763
  };
@@ -54873,11 +54889,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54873
54889
  title: "Check BEGIN END names",
54874
54890
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54875
54891
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54876
- badExample: `DATA: BEGIN OF stru,
54877
- field TYPE i,
54892
+ badExample: `DATA: BEGIN OF stru,
54893
+ field TYPE i,
54878
54894
  END OF structure_not_the_same.`,
54879
- goodExample: `DATA: BEGIN OF stru,
54880
- field TYPE i,
54895
+ goodExample: `DATA: BEGIN OF stru,
54896
+ field TYPE i,
54881
54897
  END OF stru.`,
54882
54898
  };
54883
54899
  }
@@ -54974,20 +54990,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
54974
54990
  title: "BEGIN contains single INCLUDE",
54975
54991
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
54976
54992
  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.
54993
+ badExample: `TYPES: BEGIN OF dummy1.
54994
+ INCLUDE TYPE dselc.
54995
+ TYPES: END OF dummy1.
54996
+
54997
+ DATA BEGIN OF foo.
54998
+ INCLUDE STRUCTURE syst.
54999
+ DATA END OF foo.
55000
+
55001
+ STATICS BEGIN OF bar.
55002
+ INCLUDE STRUCTURE syst.
54987
55003
  STATICS END OF bar.`,
54988
- goodExample: `DATA BEGIN OF foo.
54989
- DATA field TYPE i.
54990
- INCLUDE STRUCTURE dselc.
55004
+ goodExample: `DATA BEGIN OF foo.
55005
+ DATA field TYPE i.
55006
+ INCLUDE STRUCTURE dselc.
54991
55007
  DATA END OF foo.`,
54992
55008
  };
54993
55009
  }
@@ -55077,9 +55093,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
55077
55093
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
55078
55094
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55079
55095
  badExample: `CALL TRANSACTION 'FOO'.`,
55080
- goodExample: `TRY.
55081
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55082
- CATCH cx_sy_authorization_error.
55096
+ goodExample: `TRY.
55097
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55098
+ CATCH cx_sy_authorization_error.
55083
55099
  ENDTRY.`,
55084
55100
  };
55085
55101
  }
@@ -55144,10 +55160,10 @@ class CDSCommentStyle {
55144
55160
  key: "cds_comment_style",
55145
55161
  title: "CDS Comment Style",
55146
55162
  shortDescription: `Check for obsolete comment style`,
55147
- extendedInformation: `Check for obsolete comment style
55148
-
55149
- Comments starting with "--" are considered obsolete
55150
-
55163
+ extendedInformation: `Check for obsolete comment style
55164
+
55165
+ Comments starting with "--" are considered obsolete
55166
+
55151
55167
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
55152
55168
  tags: [_irule_1.RuleTag.SingleFile],
55153
55169
  badExample: "-- this is a comment",
@@ -55213,10 +55229,10 @@ class CDSLegacyView {
55213
55229
  key: "cds_legacy_view",
55214
55230
  title: "CDS Legacy View",
55215
55231
  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
-
55232
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55233
+
55234
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55235
+
55220
55236
  v755 and up`,
55221
55237
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
55222
55238
  };
@@ -55371,10 +55387,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55371
55387
  key: "chain_mainly_declarations",
55372
55388
  title: "Chain mainly declarations",
55373
55389
  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
55390
+ extendedInformation: `
55391
+ https://docs.abapopenchecks.org/checks/23/
55392
+
55393
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55378
55394
  `,
55379
55395
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55380
55396
  badExample: `CALL METHOD: bar.`,
@@ -55550,17 +55566,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55550
55566
  title: "Change IF to CASE",
55551
55567
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55552
55568
  // 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
-
55569
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55570
+
55555
55571
  If the first comparison is a boolean compare, no issue is reported.`,
55556
55572
  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'.
55573
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55574
+ ELSEIF l_fcat-fieldname = 'BAR'
55575
+ OR l_fcat-fieldname = 'MOO'.
55560
55576
  ENDIF.`,
55561
- goodExample: `CASE l_fcat-fieldname.
55562
- WHEN 'FOO'.
55563
- WHEN 'BAR' OR 'MOO'.
55577
+ goodExample: `CASE l_fcat-fieldname.
55578
+ WHEN 'FOO'.
55579
+ WHEN 'BAR' OR 'MOO'.
55564
55580
  ENDCASE.`,
55565
55581
  };
55566
55582
  }
@@ -55697,8 +55713,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55697
55713
  return {
55698
55714
  key: "check_abstract",
55699
55715
  title: "Check abstract methods and classes",
55700
- shortDescription: `Checks abstract methods and classes:
55701
- - class defined as abstract and final,
55716
+ shortDescription: `Checks abstract methods and classes:
55717
+ - class defined as abstract and final,
55702
55718
  - non-abstract class contains abstract methods`,
55703
55719
  extendedInformation: `If a class defines only constants, use an interface instead`,
55704
55720
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55779,11 +55795,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55779
55795
  return {
55780
55796
  key: "check_comments",
55781
55797
  title: "Check Comments",
55782
- shortDescription: `
55798
+ shortDescription: `
55783
55799
  Various checks for comment usage.`,
55784
- extendedInformation: `
55785
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55786
-
55800
+ extendedInformation: `
55801
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55802
+
55787
55803
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55788
55804
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55789
55805
  badExample: `WRITE 2. " descriptive comment`,
@@ -55945,9 +55961,9 @@ class CheckInclude {
55945
55961
  key: "check_include",
55946
55962
  title: "Check INCLUDEs",
55947
55963
  shortDescription: `Checks INCLUDE statements`,
55948
- extendedInformation: `
55949
- * Reports unused includes
55950
- * Errors if the includes are not found
55964
+ extendedInformation: `
55965
+ * Reports unused includes
55966
+ * Errors if the includes are not found
55951
55967
  * Error if including a main program`,
55952
55968
  tags: [_irule_1.RuleTag.Syntax],
55953
55969
  };
@@ -56023,14 +56039,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
56023
56039
  key: "check_subrc",
56024
56040
  title: "Check sy-subrc",
56025
56041
  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
-
56042
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56043
+
56044
+ If sy-dbcnt is checked after database statements, it is considered okay.
56045
+
56046
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56047
+
56048
+ If IS ASSIGNED is checked after assigning, it is considered okay.
56049
+
56034
56050
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
56035
56051
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56036
56052
  pseudoComment: "EC CI_SUBRC",
@@ -56600,17 +56616,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56600
56616
  shortDescription: `Find overlapping classic exceptions`,
56601
56617
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56602
56618
  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
56619
+ badExample: `CALL FUNCTION 'SOMETHING'
56620
+ EXCEPTIONS
56621
+ system_failure = 1 MESSAGE lv_message
56622
+ communication_failure = 1 MESSAGE lv_message
56623
+ resource_failure = 1
56608
56624
  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
56625
+ goodExample: `CALL FUNCTION 'SOMETHING'
56626
+ EXCEPTIONS
56627
+ system_failure = 1 MESSAGE lv_message
56628
+ communication_failure = 2 MESSAGE lv_message
56629
+ resource_failure = 3
56614
56630
  OTHERS = 4.`,
56615
56631
  };
56616
56632
  }
@@ -56856,7 +56872,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56856
56872
  key: "commented_code",
56857
56873
  title: "Find commented code",
56858
56874
  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
56875
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56860
56876
  https://docs.abapopenchecks.org/checks/14/`,
56861
56877
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56862
56878
  badExample: `* WRITE 'hello world'.`,
@@ -57089,10 +57105,10 @@ class ConstructorVisibilityPublic {
57089
57105
  key: "constructor_visibility_public",
57090
57106
  title: "Check constructor visibility is public",
57091
57107
  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
57108
+ extendedInformation: `
57109
+ This only applies to global classes.
57110
+
57111
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57096
57112
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
57097
57113
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57098
57114
  };
@@ -57167,8 +57183,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
57167
57183
  key: "contains_tab",
57168
57184
  title: "Code contains tab",
57169
57185
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
57170
- extendedInformation: `
57171
- https://docs.abapopenchecks.org/checks/09/
57186
+ extendedInformation: `
57187
+ https://docs.abapopenchecks.org/checks/09/
57172
57188
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
57173
57189
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57174
57190
  badExample: `\tWRITE 'hello world'.`,
@@ -57255,10 +57271,10 @@ class CyclicOO {
57255
57271
  key: "cyclic_oo",
57256
57272
  title: "Cyclic OO",
57257
57273
  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
-
57274
+ extendedInformation: `Runs for global INTF + CLAS objects
57275
+
57276
+ Objects must be without syntax errors for this rule to take effect
57277
+
57262
57278
  References in testclass includes are ignored`,
57263
57279
  };
57264
57280
  }
@@ -57501,7 +57517,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57501
57517
  key: "dangerous_statement",
57502
57518
  title: "Dangerous statement",
57503
57519
  shortDescription: `Detects potentially dangerous statements`,
57504
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57520
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57505
57521
  dynamic SQL can potentially create SQL injection problems`,
57506
57522
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57507
57523
  };
@@ -57708,13 +57724,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57708
57724
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57709
57725
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57710
57726
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57711
- badExample: `FROM foo.
57712
- WRITE 'hello'.
57713
- DATA int TYPE i.
57727
+ badExample: `FROM foo.
57728
+ WRITE 'hello'.
57729
+ DATA int TYPE i.
57714
57730
  ENDFORM.`,
57715
- goodExample: `FROM foo.
57716
- DATA int TYPE i.
57717
- WRITE 'hello'.
57731
+ goodExample: `FROM foo.
57732
+ DATA int TYPE i.
57733
+ WRITE 'hello'.
57718
57734
  ENDFORM.`,
57719
57735
  };
57720
57736
  }
@@ -58253,39 +58269,39 @@ class Downport {
58253
58269
  key: "downport",
58254
58270
  title: "Downport statement",
58255
58271
  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
-
58272
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58273
+ a higher level language version. If successful, various rules are applied to downport the statement.
58274
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
58275
+
58276
+ Current rules:
58277
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58278
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58279
+ * FIELD-SYMBOL() definitions are outlined
58280
+ * CONV is outlined
58281
+ * COND is outlined
58282
+ * REDUCE is outlined
58283
+ * SWITCH is outlined
58284
+ * FILTER is outlined
58285
+ * APPEND expression is outlined
58286
+ * INSERT expression is outlined
58287
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58288
+ * CAST changed to ?=
58289
+ * LOOP AT method_call( ) is outlined
58290
+ * VALUE # with structure fields
58291
+ * VALUE # with internal table lines
58292
+ * Table Expressions are outlined
58293
+ * SELECT INTO @DATA definitions are outlined
58294
+ * Some occurrences of string template formatting option ALPHA changed to function module call
58295
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58296
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58297
+ * RAISE EXCEPTION ... MESSAGE
58298
+ * Moving with +=, -=, /=, *=, &&= is expanded
58299
+ * line_exists and line_index is downported to READ TABLE
58300
+ * ENUMs, but does not nessesarily give the correct type and value
58301
+ * MESSAGE with non simple source
58302
+
58303
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58304
+
58289
58305
  Make sure to test the downported code, it might not always be completely correct.`,
58290
58306
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
58291
58307
  };
@@ -58863,10 +58879,10 @@ Make sure to test the downported code, it might not always be completely correct
58863
58879
  const fieldName = f.concatTokens();
58864
58880
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58865
58881
  }
58866
- fieldDefinition = `DATA: BEGIN OF ${name},
58882
+ fieldDefinition = `DATA: BEGIN OF ${name},
58867
58883
  ${fieldDefinition}${indentation} END OF ${name}.`;
58868
58884
  }
58869
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58885
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58870
58886
  ${indentation}`);
58871
58887
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58872
58888
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -58925,12 +58941,12 @@ ${indentation}`);
58925
58941
  }
58926
58942
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58927
58943
  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.
58944
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
58945
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
58946
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
58931
58947
  ${indentation}`);
58932
58948
  if (fieldDefinitions === "") {
58933
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58949
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
58934
58950
  ${indentation}`);
58935
58951
  }
58936
58952
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -58998,7 +59014,7 @@ ${indentation}`);
58998
59014
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58999
59015
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59000
59016
  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()}.
59017
+ 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
59018
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59003
59019
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59004
59020
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59052,7 +59068,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59052
59068
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59053
59069
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59054
59070
  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()}.
59071
+ 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
59072
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59057
59073
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59058
59074
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59094,14 +59110,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59094
59110
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59095
59111
  const firstToken = high.getFirstToken();
59096
59112
  // 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.
59113
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59114
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59115
+ ${indentation}${tabixBackup} = sy-tabix.
59116
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59117
+ ${indentation}sy-tabix = ${tabixBackup}.
59118
+ ${indentation}IF sy-subrc <> 0.
59119
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59120
+ ${indentation}ENDIF.
59105
59121
  ${indentation}`);
59106
59122
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
59107
59123
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59158,7 +59174,7 @@ ${indentation}`);
59158
59174
  const className = classNames[0].concatTokens();
59159
59175
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59160
59176
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59161
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
59177
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
59162
59178
  ${indentation}CATCH ${className} INTO ${targetName}.`;
59163
59179
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
59164
59180
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -59320,16 +59336,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
59320
59336
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59321
59337
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59322
59338
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59323
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59324
- ${indentation}${uniqueName1}-msgid = ${id}.
59339
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59340
+ ${indentation}${uniqueName1}-msgid = ${id}.
59325
59341
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59326
59342
  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'.
59343
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59344
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59345
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59330
59346
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59331
59347
  }
59332
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59348
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59333
59349
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59334
59350
  if (withs.length > 0) {
59335
59351
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59441,10 +59457,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59441
59457
  let code = "";
59442
59458
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59443
59459
  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.
59460
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59461
+ IF sy-subrc <> 0.
59462
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59463
+ ENDIF.
59448
59464
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59449
59465
  }
59450
59466
  else {
@@ -59533,20 +59549,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59533
59549
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59534
59550
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59535
59551
  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.
59552
+ code += ` items LIKE ${loopSourceName},
59553
+ END OF ${groupTargetName}type.
59554
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59555
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59540
59556
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59541
59557
  if (groupIndexName !== undefined) {
59542
59558
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59543
59559
  }
59544
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59560
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59545
59561
  IF sy-subrc = 0.\n`;
59546
59562
  if (groupCountName !== undefined) {
59547
59563
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59548
59564
  }
59549
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59565
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59550
59566
  ELSE.\n`;
59551
59567
  code += ` CLEAR ${uniqueName}.\n`;
59552
59568
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59567,8 +59583,8 @@ ELSE.\n`;
59567
59583
  }
59568
59584
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59569
59585
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59570
- code += `ENDIF.
59571
- ENDLOOP.
59586
+ code += `ENDIF.
59587
+ ENDLOOP.
59572
59588
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59573
59589
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59574
59590
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59740,7 +59756,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59740
59756
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59741
59757
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59742
59758
  // all ENUMS are char like?
59743
- let code = `TYPES ${enumName} TYPE string.
59759
+ let code = `TYPES ${enumName} TYPE string.
59744
59760
  CONSTANTS: BEGIN OF ${structureName},\n`;
59745
59761
  let count = 1;
59746
59762
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59784,14 +59800,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59784
59800
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59785
59801
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59786
59802
  // 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.
59803
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59804
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59805
+ ${indentation}${tabixBackup} = sy-tabix.
59806
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59807
+ ${indentation}sy-tabix = ${tabixBackup}.
59808
+ ${indentation}IF sy-subrc <> 0.
59809
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59810
+ ${indentation}ENDIF.
59795
59811
  ${indentation}${uniqueName}`;
59796
59812
  const start = target.getFirstToken().getStart();
59797
59813
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59871,11 +59887,11 @@ ${indentation}${uniqueName}`;
59871
59887
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59872
59888
  const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59873
59889
  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
59890
+ const code = `DATA ${uniqueName} TYPE string.
59891
+ ${indentation}CALL FUNCTION '${functionName}'
59892
+ ${indentation} EXPORTING
59893
+ ${indentation} input = ${source}
59894
+ ${indentation} IMPORTING
59879
59895
  ${indentation} output = ${uniqueName}.\n`;
59880
59896
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59881
59897
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -61187,12 +61203,12 @@ class EasyToFindMessages {
61187
61203
  key: "easy_to_find_messages",
61188
61204
  title: "Easy to find messages",
61189
61205
  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
-
61206
+ extendedInformation: `All messages must be statically referenced exactly once
61207
+
61208
+ Only MESSAGE and RAISE statments are counted as static references
61209
+
61210
+ Also see rule "message_exists"
61211
+
61196
61212
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
61197
61213
  tags: [_irule_1.RuleTag.Styleguide],
61198
61214
  };
@@ -61273,13 +61289,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
61273
61289
  shortDescription: `Empty selection screen or list processing event block`,
61274
61290
  extendedInformation: ``,
61275
61291
  tags: [_irule_1.RuleTag.SingleFile],
61276
- badExample: `
61277
- INITIALIZATION.
61278
- WRITE 'hello'.
61292
+ badExample: `
61293
+ INITIALIZATION.
61294
+ WRITE 'hello'.
61279
61295
  END-OF-SELECTION.`,
61280
- goodExample: `
61281
- START-OF-SELECTION.
61282
- PERFORM sdf.
61296
+ goodExample: `
61297
+ START-OF-SELECTION.
61298
+ PERFORM sdf.
61283
61299
  COMMIT WORK.`,
61284
61300
  };
61285
61301
  }
@@ -61371,8 +61387,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61371
61387
  key: "empty_line_in_statement",
61372
61388
  title: "Find empty lines in statements",
61373
61389
  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
-
61390
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61391
+
61376
61392
  https://docs.abapopenchecks.org/checks/41/`,
61377
61393
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61378
61394
  badExample: `WRITE\n\nhello.`,
@@ -61548,13 +61564,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61548
61564
  shortDescription: `Checks that the code does not contain empty blocks.`,
61549
61565
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61550
61566
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61551
- badExample: `IF foo = bar.
61552
- ENDIF.
61553
-
61554
- DO 2 TIMES.
61567
+ badExample: `IF foo = bar.
61568
+ ENDIF.
61569
+
61570
+ DO 2 TIMES.
61555
61571
  ENDDO.`,
61556
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61557
- ENDLOOP.
61572
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61573
+ ENDLOOP.
61558
61574
  result = xsdbool( sy-subrc = 0 ).`,
61559
61575
  };
61560
61576
  }
@@ -61696,10 +61712,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61696
61712
  return {
61697
61713
  key: "exit_or_check",
61698
61714
  title: "Find EXIT or CHECK outside loops",
61699
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61715
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61700
61716
  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
61717
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61718
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61703
61719
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61704
61720
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61705
61721
  };
@@ -61782,12 +61798,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61782
61798
  key: "expand_macros",
61783
61799
  title: "Expand Macros",
61784
61800
  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
-
61801
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61802
+
61787
61803
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61788
- badExample: `DEFINE _hello.
61789
- WRITE 'hello'.
61790
- END-OF-DEFINITION.
61804
+ badExample: `DEFINE _hello.
61805
+ WRITE 'hello'.
61806
+ END-OF-DEFINITION.
61791
61807
  _hello.`,
61792
61808
  goodExample: `WRITE 'hello'.`,
61793
61809
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61874,7 +61890,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61874
61890
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61875
61891
  badExample: `call_method( EXPORTING foo = bar ).`,
61876
61892
  goodExample: `call_method( foo = bar ).`,
61877
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61893
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61878
61894
  https://docs.abapopenchecks.org/checks/30/`,
61879
61895
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61880
61896
  };
@@ -61972,7 +61988,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
61972
61988
  key: "forbidden_identifier",
61973
61989
  title: "Forbidden Identifier",
61974
61990
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
61975
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61991
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
61976
61992
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
61977
61993
  tags: [_irule_1.RuleTag.SingleFile],
61978
61994
  };
@@ -62214,8 +62230,8 @@ class ForbiddenVoidType {
62214
62230
  key: "forbidden_void_type",
62215
62231
  title: "Forbidden Void Types",
62216
62232
  shortDescription: `Avoid usage of specified void types.`,
62217
- extendedInformation: `Inspiration:
62218
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62233
+ extendedInformation: `Inspiration:
62234
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62219
62235
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
62220
62236
  };
62221
62237
  }
@@ -62458,9 +62474,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62458
62474
  key: "fully_type_itabs",
62459
62475
  title: "Fully type internal tables",
62460
62476
  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
62477
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62462
62478
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
62463
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62479
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62464
62480
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62465
62481
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62466
62482
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62645,26 +62661,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62645
62661
  key: "functional_writing",
62646
62662
  title: "Use functional writing",
62647
62663
  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
62664
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62649
62665
  https://docs.abapopenchecks.org/checks/07/`,
62650
62666
  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
62667
+ badExample: `CALL METHOD zcl_class=>method( ).
62668
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62669
+ EXPORTING
62670
+ p_name = 'NAME'
62671
+ RECEIVING
62672
+ p_descr_ref = lr_typedescr
62673
+ EXCEPTIONS
62674
+ type_not_found = 1
62659
62675
  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
62676
+ goodExample: `zcl_class=>method( ).
62677
+ cl_abap_typedescr=>describe_by_name(
62678
+ EXPORTING
62679
+ p_name = 'NAME'
62680
+ RECEIVING
62681
+ p_descr_ref = lr_typedescr
62682
+ EXCEPTIONS
62683
+ type_not_found = 1
62668
62684
  OTHERS = 2 ).`,
62669
62685
  };
62670
62686
  }
@@ -62775,14 +62791,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62775
62791
  key: "global_class",
62776
62792
  title: "Global class checks",
62777
62793
  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
-
62794
+ extendedInformation: `* global classes must be in own files
62795
+
62796
+ * file names must match class name
62797
+
62798
+ * file names must match interface name
62799
+
62800
+ * global classes must be global definitions
62801
+
62786
62802
  * global interfaces must be global definitions`,
62787
62803
  tags: [_irule_1.RuleTag.Syntax],
62788
62804
  };
@@ -62881,21 +62897,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62881
62897
  return {
62882
62898
  key: "identical_conditions",
62883
62899
  title: "Identical conditions",
62884
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62885
-
62900
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62901
+
62886
62902
  Prerequsites: code is pretty printed with identical cAsE`,
62887
62903
  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'.
62904
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62905
+ ENDIF.
62906
+ CASE bar.
62907
+ WHEN '1'.
62908
+ WHEN 'A' OR '1'.
62893
62909
  ENDCASE.`,
62894
- goodExample: `IF foo = bar OR 1 = a.
62895
- ENDIF.
62896
- CASE bar.
62897
- WHEN '1'.
62898
- WHEN 'A'.
62910
+ goodExample: `IF foo = bar OR 1 = a.
62911
+ ENDIF.
62912
+ CASE bar.
62913
+ WHEN '1'.
62914
+ WHEN 'A'.
62899
62915
  ENDCASE.`,
62900
62916
  };
62901
62917
  }
@@ -63029,23 +63045,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
63029
63045
  key: "identical_contents",
63030
63046
  title: "Identical contents",
63031
63047
  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
-
63048
+ extendedInformation: `
63049
+ Prerequsites: code is pretty printed with identical cAsE
63050
+
63035
63051
  Chained statments are ignored`,
63036
63052
  tags: [_irule_1.RuleTag.SingleFile],
63037
- badExample: `IF foo = bar.
63038
- WRITE 'bar'.
63039
- WRITE 'world'.
63040
- ELSE.
63041
- WRITE 'foo'.
63042
- WRITE 'world'.
63053
+ badExample: `IF foo = bar.
63054
+ WRITE 'bar'.
63055
+ WRITE 'world'.
63056
+ ELSE.
63057
+ WRITE 'foo'.
63058
+ WRITE 'world'.
63043
63059
  ENDIF.`,
63044
- goodExample: `IF foo = bar.
63045
- WRITE 'bar'.
63046
- ELSE.
63047
- WRITE 'foo'.
63048
- ENDIF.
63060
+ goodExample: `IF foo = bar.
63061
+ WRITE 'bar'.
63062
+ ELSE.
63063
+ WRITE 'foo'.
63064
+ ENDIF.
63049
63065
  WRITE 'world'.`,
63050
63066
  };
63051
63067
  }
@@ -63153,12 +63169,12 @@ class IdenticalDescriptions {
63153
63169
  key: "identical_descriptions",
63154
63170
  title: "Identical descriptions",
63155
63171
  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
-
63172
+ extendedInformation: `Case insensitive
63173
+
63174
+ Only checks the master language descriptions
63175
+
63176
+ Dependencies are skipped
63177
+
63162
63178
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
63163
63179
  tags: [],
63164
63180
  };
@@ -63332,43 +63348,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63332
63348
  key: "if_in_if",
63333
63349
  title: "IF in IF",
63334
63350
  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/
63351
+ extendedInformation: `
63352
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63353
+
63354
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63355
+
63356
+ https://docs.abapopenchecks.org/checks/01/
63341
63357
  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.
63358
+ badExample: `IF condition1.
63359
+ IF condition2.
63360
+ ...
63361
+ ENDIF.
63362
+ ENDIF.
63363
+
63364
+ IF condition1.
63365
+ ...
63366
+ ELSE.
63367
+ IF condition2.
63368
+ ...
63369
+ ENDIF.
63354
63370
  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.
63371
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63372
+ ...
63373
+ ENDIF.
63374
+
63375
+ IF condition1.
63376
+ ...
63377
+ ELSEIF condition2.
63378
+ ...
63379
+ ENDIF.
63380
+
63381
+ CASE variable.
63382
+ WHEN value1.
63383
+ ...
63384
+ WHEN value2.
63385
+ IF condition2.
63386
+ ...
63387
+ ENDIF.
63372
63388
  ENDCASE.`,
63373
63389
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63374
63390
  };
@@ -63553,9 +63569,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63553
63569
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63554
63570
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63555
63571
  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
63572
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63573
+ METHOD ${methodName.toLowerCase()}.
63574
+ RETURN. " todo, implement method
63559
63575
  ENDMETHOD.`);
63560
63576
  }
63561
63577
  }
@@ -63734,14 +63750,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63734
63750
  key: "implicit_start_of_selection",
63735
63751
  title: "Implicit START-OF-SELECTION",
63736
63752
  shortDescription: `Add explicit selection screen event handling`,
63737
- extendedInformation: `Only runs for executable programs
63738
-
63753
+ extendedInformation: `Only runs for executable programs
63754
+
63739
63755
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63740
63756
  tags: [_irule_1.RuleTag.SingleFile],
63741
- badExample: `REPORT zfoo.
63757
+ badExample: `REPORT zfoo.
63742
63758
  WRITE 'hello'.`,
63743
- goodExample: `
63744
- START-OF-SELECTION.
63759
+ goodExample: `
63760
+ START-OF-SELECTION.
63745
63761
  WRITE 'hello'.`,
63746
63762
  };
63747
63763
  }
@@ -63846,19 +63862,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63846
63862
  key: "in_statement_indentation",
63847
63863
  title: "In-statement indentation",
63848
63864
  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)
63865
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63866
+
63867
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63852
63868
  to distinguish them better from code within the block.`,
63853
- badExample: `IF 1 = 1
63854
- AND 2 = 2.
63855
- WRITE 'hello' &&
63856
- 'world'.
63869
+ badExample: `IF 1 = 1
63870
+ AND 2 = 2.
63871
+ WRITE 'hello' &&
63872
+ 'world'.
63857
63873
  ENDIF.`,
63858
- goodExample: `IF 1 = 1
63859
- AND 2 = 2.
63860
- WRITE 'hello' &&
63861
- 'world'.
63874
+ goodExample: `IF 1 = 1
63875
+ AND 2 = 2.
63876
+ WRITE 'hello' &&
63877
+ 'world'.
63862
63878
  ENDIF.`,
63863
63879
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63864
63880
  };
@@ -63981,23 +63997,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
63981
63997
  title: "Indentation",
63982
63998
  shortDescription: `Checks indentation`,
63983
63999
  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.
64000
+ badExample: `CLASS lcl DEFINITION.
64001
+ PRIVATE SECTION.
64002
+ METHODS constructor.
64003
+ ENDCLASS.
64004
+
64005
+ CLASS lcl IMPLEMENTATION.
64006
+ METHOD constructor.
64007
+ ENDMETHOD.
63992
64008
  ENDCLASS.`,
63993
- goodExample: `CLASS lcl DEFINITION.
63994
- PRIVATE SECTION.
63995
- METHODS constructor.
63996
- ENDCLASS.
63997
-
63998
- CLASS lcl IMPLEMENTATION.
63999
- METHOD constructor.
64000
- ENDMETHOD.
64009
+ goodExample: `CLASS lcl DEFINITION.
64010
+ PRIVATE SECTION.
64011
+ METHODS constructor.
64012
+ ENDCLASS.
64013
+
64014
+ CLASS lcl IMPLEMENTATION.
64015
+ METHOD constructor.
64016
+ ENDMETHOD.
64001
64017
  ENDCLASS.`,
64002
64018
  };
64003
64019
  }
@@ -64398,9 +64414,9 @@ class IntfReferencingClas {
64398
64414
  key: "intf_referencing_clas",
64399
64415
  title: "INTF referencing CLAS",
64400
64416
  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.
64417
+ extendedInformation: `Only global interfaces are checked.
64418
+ Only first level references are checked.
64419
+ Exception class references are ignored.
64404
64420
  Void references are ignored.`,
64405
64421
  };
64406
64422
  }
@@ -64485,9 +64501,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64485
64501
  title: "Invalid Table Index",
64486
64502
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64487
64503
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64488
- badExample: `DATA(first) = table[ 0 ].
64504
+ badExample: `DATA(first) = table[ 0 ].
64489
64505
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64490
- goodExample: `DATA(first) = table[ 1 ].
64506
+ goodExample: `DATA(first) = table[ 1 ].
64491
64507
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64492
64508
  };
64493
64509
  }
@@ -65088,8 +65104,8 @@ class LineBreakStyle {
65088
65104
  return {
65089
65105
  key: "line_break_style",
65090
65106
  title: "Makes sure line breaks are consistent in the ABAP code",
65091
- shortDescription: `Enforces LF as newlines in ABAP files
65092
-
65107
+ shortDescription: `Enforces LF as newlines in ABAP files
65108
+
65093
65109
  abapGit does not work with CRLF`,
65094
65110
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
65095
65111
  };
@@ -65158,7 +65174,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
65158
65174
  key: "line_length",
65159
65175
  title: "Line length",
65160
65176
  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
65177
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65162
65178
  https://docs.abapopenchecks.org/checks/04/`,
65163
65179
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65164
65180
  };
@@ -65229,7 +65245,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
65229
65245
  key: "line_only_punc",
65230
65246
  title: "Line containing only punctuation",
65231
65247
  shortDescription: `Detects lines containing only punctuation.`,
65232
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65248
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65233
65249
  https://docs.abapopenchecks.org/checks/16/`,
65234
65250
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65235
65251
  badExample: "zcl_class=>method(\n).",
@@ -65492,15 +65508,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65492
65508
  return {
65493
65509
  key: "local_variable_names",
65494
65510
  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.
65511
+ shortDescription: `
65512
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65497
65513
  Regexes are case-insensitive.`,
65498
65514
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65499
- badExample: `FORM bar.
65500
- DATA foo.
65515
+ badExample: `FORM bar.
65516
+ DATA foo.
65501
65517
  ENDFORM.`,
65502
- goodExample: `FORM bar.
65503
- DATA lv_foo.
65518
+ goodExample: `FORM bar.
65519
+ DATA lv_foo.
65504
65520
  ENDFORM.`,
65505
65521
  };
65506
65522
  }
@@ -65652,9 +65668,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65652
65668
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65653
65669
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65654
65670
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65655
- badExample: `DEFINE something.
65671
+ badExample: `DEFINE something.
65656
65672
  END-OF-DEFINITION.`,
65657
- goodExample: `DEFINE _something.
65673
+ goodExample: `DEFINE _something.
65658
65674
  END-OF-DEFINITION.`,
65659
65675
  };
65660
65676
  }
@@ -65727,10 +65743,10 @@ class MainFileContents {
65727
65743
  key: "main_file_contents",
65728
65744
  title: "Main file contents",
65729
65745
  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>."
65746
+ extendedInformation: `Does not run if the target version is Cloud
65747
+
65748
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65749
+ * TYPEs must begin with "TYPE-POOL <name>."
65734
65750
  `,
65735
65751
  };
65736
65752
  }
@@ -65846,17 +65862,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65846
65862
  title: "Too many parentheses",
65847
65863
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65848
65864
  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.
65865
+ badExample: `
65866
+ IF ( destination IS INITIAL ).
65867
+ ENDIF.
65868
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65869
+ ENDIF.
65854
65870
  `,
65855
- goodExample: `
65856
- IF destination IS INITIAL.
65857
- ENDIF.
65858
- IF foo = boo AND bar = lar AND moo = loo.
65859
- ENDIF.
65871
+ goodExample: `
65872
+ IF destination IS INITIAL.
65873
+ ENDIF.
65874
+ IF foo = boo AND bar = lar AND moo = loo.
65875
+ ENDIF.
65860
65876
  `,
65861
65877
  };
65862
65878
  }
@@ -66030,14 +66046,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
66030
66046
  title: "Max one method parameter definition per line",
66031
66047
  shortDescription: `Keep max one method parameter description per line`,
66032
66048
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
66033
- badExample: `
66034
- METHODS apps_scope_token
66035
- IMPORTING
66049
+ badExample: `
66050
+ METHODS apps_scope_token
66051
+ IMPORTING
66036
66052
  body TYPE bodyapps_scope_token client_id TYPE str.`,
66037
- goodExample: `
66038
- METHODS apps_scope_token
66039
- IMPORTING
66040
- body TYPE bodyapps_scope_token
66053
+ goodExample: `
66054
+ METHODS apps_scope_token
66055
+ IMPORTING
66056
+ body TYPE bodyapps_scope_token
66041
66057
  client_id TYPE str.`,
66042
66058
  };
66043
66059
  }
@@ -66102,11 +66118,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
66102
66118
  key: "max_one_statement",
66103
66119
  title: "Max one statement per line",
66104
66120
  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
66121
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66122
+
66123
+ Does not report anything for chained statements.
66124
+
66125
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66110
66126
  https://docs.abapopenchecks.org/checks/11/`,
66111
66127
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66112
66128
  badExample: `WRITE foo. WRITE bar.`,
@@ -66444,8 +66460,8 @@ class MethodLength {
66444
66460
  key: "method_length",
66445
66461
  title: "Method/Form Length",
66446
66462
  shortDescription: `Checks relating to method/form length.`,
66447
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66448
-
66463
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66464
+
66449
66465
  Abstract methods without statements are considered okay.`,
66450
66466
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66451
66467
  };
@@ -66550,20 +66566,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66550
66566
  key: "method_overwrites_builtin",
66551
66567
  title: "Method name overwrites builtin function",
66552
66568
  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
-
66569
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66570
+
66571
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66572
+
66557
66573
  Interface method names are ignored`,
66558
66574
  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.
66575
+ badExample: `CLASS lcl DEFINITION.
66576
+ PUBLIC SECTION.
66577
+ METHODS matches.
66578
+ ENDCLASS.
66579
+
66580
+ CLASS lcl IMPLEMENTATION.
66581
+ METHOD matches.
66582
+ ENDMETHOD.
66567
66583
  ENDCLASS.`,
66568
66584
  };
66569
66585
  }
@@ -66754,12 +66770,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66754
66770
  // eslint-disable-next-line max-len
66755
66771
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66756
66772
  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.
66773
+ badExample: `CLASS lcl DEFINITION.
66774
+ PUBLIC SECTION.
66775
+ METHODS
66776
+ foobar
66777
+ EXPORTING foo TYPE i
66778
+ RETURNING VALUE(rv_string) TYPE string.
66763
66779
  ENDCLASS.`,
66764
66780
  };
66765
66781
  }
@@ -67139,7 +67155,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
67139
67155
  key: "nesting",
67140
67156
  title: "Check nesting depth",
67141
67157
  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
67158
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67143
67159
  https://docs.abapopenchecks.org/checks/74/`,
67144
67160
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67145
67161
  };
@@ -67382,7 +67398,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67382
67398
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67383
67399
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67384
67400
  badExample: `var1 = var2 = var3.`,
67385
- goodExample: `var2 = var3.
67401
+ goodExample: `var2 = var3.
67386
67402
  var1 = var2.`,
67387
67403
  };
67388
67404
  }
@@ -67441,8 +67457,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67441
67457
  key: "no_external_form_calls",
67442
67458
  title: "No external FORM calls",
67443
67459
  shortDescription: `Detect external form calls`,
67444
- badExample: `PERFORM foo IN PROGRAM bar.
67445
-
67460
+ badExample: `PERFORM foo IN PROGRAM bar.
67461
+
67446
67462
  PERFORM foo(bar).`,
67447
67463
  tags: [_irule_1.RuleTag.SingleFile],
67448
67464
  };
@@ -67503,17 +67519,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67503
67519
  key: "no_inline_in_optional_branches",
67504
67520
  title: "Don't declare inline in optional branches",
67505
67521
  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:
67522
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67523
+
67524
+ Considered optional branches:
67525
+ * inside IF/ELSEIF/ELSE
67526
+ * inside LOOP
67527
+ * inside WHILE
67528
+ * inside CASE/WHEN, CASE TYPE OF
67529
+ * inside DO
67530
+ * inside SELECT loops
67531
+
67532
+ Not considered optional branches:
67517
67533
  * TRY/CATCH/CLEANUP`,
67518
67534
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67519
67535
  };
@@ -67613,12 +67629,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67613
67629
  key: "no_prefixes",
67614
67630
  title: "No Prefixes",
67615
67631
  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
-
67632
+ extendedInformation: `
67633
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67634
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67635
+
67636
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67637
+
67622
67638
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67623
67639
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67624
67640
  badExample: `DATA lv_foo TYPE i.`,
@@ -67797,7 +67813,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67797
67813
  return {
67798
67814
  key: "no_public_attributes",
67799
67815
  title: "No public attributes",
67800
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67816
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67801
67817
  Exceptions are excluded from this rule.`,
67802
67818
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67803
67819
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67898,13 +67914,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67898
67914
  key: "no_yoda_conditions",
67899
67915
  title: "No Yoda conditions",
67900
67916
  shortDescription: `Finds Yoda conditions and reports issues`,
67901
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67902
-
67917
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67918
+
67903
67919
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67904
67920
  tags: [_irule_1.RuleTag.SingleFile],
67905
- badExample: `IF 0 <> sy-subrc.
67921
+ badExample: `IF 0 <> sy-subrc.
67906
67922
  ENDIF.`,
67907
- goodExample: `IF sy-subrc <> 0.
67923
+ goodExample: `IF sy-subrc <> 0.
67908
67924
  ENDIF.`,
67909
67925
  };
67910
67926
  }
@@ -68005,8 +68021,8 @@ class NROBConsistency {
68005
68021
  key: "nrob_consistency",
68006
68022
  title: "Number range consistency",
68007
68023
  shortDescription: `Consistency checks for number ranges`,
68008
- extendedInformation: `Issue reported if percentage warning is over 50%
68009
-
68024
+ extendedInformation: `Issue reported if percentage warning is over 50%
68025
+
68010
68026
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
68011
68027
  tags: [_irule_1.RuleTag.SingleFile],
68012
68028
  };
@@ -68283,58 +68299,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
68283
68299
  title: "Obsolete statements",
68284
68300
  shortDescription: `Checks for usages of certain obsolete statements`,
68285
68301
  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
-
68302
+ extendedInformation: `
68303
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68304
+
68305
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68306
+
68307
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68308
+
68309
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68310
+
68311
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68312
+
68313
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68314
+
68315
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68316
+
68317
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68318
+
68319
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68320
+
68321
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68322
+
68323
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68324
+
68325
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68326
+
68327
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68328
+
68329
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68330
+
68331
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68332
+ SELECT COUNT(*) is considered okay
68333
+
68334
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68335
+
68336
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68337
+
68338
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68339
+
68340
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68341
+
68342
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68343
+
68328
68344
  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.
68345
+ badExample: `REFRESH itab.
68346
+
68347
+ COMPUTE foo = 2 + 2.
68348
+
68349
+ MULTIPLY lv_foo BY 2.
68350
+
68351
+ INTERFACE intf LOAD.
68352
+
68353
+ IF foo IS SUPPLIED.
68338
68354
  ENDIF.`,
68339
68355
  };
68340
68356
  }
@@ -68674,9 +68690,9 @@ class OmitParameterName {
68674
68690
  key: "omit_parameter_name",
68675
68691
  title: "Omit parameter name",
68676
68692
  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
-
68693
+ extendedInformation: `
68694
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68695
+
68680
68696
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68681
68697
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68682
68698
  badExample: `method( param = 2 ).`,
@@ -68882,20 +68898,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68882
68898
  shortDescription: `Omit RECEIVING`,
68883
68899
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68884
68900
  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
68901
+ badExample: `
68902
+ upload_pack(
68903
+ EXPORTING
68904
+ io_client = lo_client
68905
+ iv_url = iv_url
68906
+ iv_deepen_level = iv_deepen_level
68907
+ it_hashes = lt_hashes
68908
+ RECEIVING
68893
68909
  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
68910
+ goodExample: `
68911
+ et_objects = upload_pack(
68912
+ io_client = lo_client
68913
+ iv_url = iv_url
68914
+ iv_deepen_level = iv_deepen_level
68899
68915
  it_hashes = lt_hashes ).`,
68900
68916
  };
68901
68917
  }
@@ -68959,8 +68975,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
68959
68975
  return {
68960
68976
  key: "parser_702_chaining",
68961
68977
  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.
68978
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
68979
+ this rule finds these and reports errors.
68964
68980
  Only active on target version 702 and below.`,
68965
68981
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
68966
68982
  };
@@ -69040,8 +69056,8 @@ class ParserError {
69040
69056
  return {
69041
69057
  key: "parser_error",
69042
69058
  title: "Parser error",
69043
- shortDescription: `Checks for syntax not recognized by abaplint.
69044
-
69059
+ shortDescription: `Checks for syntax not recognized by abaplint.
69060
+
69045
69061
  See recognized syntax at https://syntax.abaplint.org`,
69046
69062
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69047
69063
  };
@@ -69126,7 +69142,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
69126
69142
  return {
69127
69143
  key: "parser_missing_space",
69128
69144
  title: "Parser Error, missing space",
69129
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69145
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69130
69146
  This rule makes sure the spaces are consistently required across the language.`,
69131
69147
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
69132
69148
  badExample: `IF ( foo = 'bar').`,
@@ -69549,25 +69565,25 @@ class PreferInline {
69549
69565
  key: "prefer_inline",
69550
69566
  title: "Prefer Inline Declarations",
69551
69567
  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
-
69568
+ extendedInformation: `EXPERIMENTAL
69569
+
69570
+ Activates if language version is v740sp02 or above.
69571
+
69572
+ Variables must be local(METHOD or FORM).
69573
+
69574
+ No generic or void typed variables. No syntax errors.
69575
+
69576
+ First position used must be a full/pure write.
69577
+
69578
+ Move statment is not a cast(?=)
69579
+
69564
69580
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69565
69581
  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.
69582
+ badExample: `DATA foo TYPE i.
69583
+ foo = 2.
69584
+ DATA percentage TYPE decfloat34.
69569
69585
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69570
- goodExample: `DATA(foo) = 2.
69586
+ goodExample: `DATA(foo) = 2.
69571
69587
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69572
69588
  };
69573
69589
  }
@@ -69781,18 +69797,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69781
69797
  key: "prefer_is_not",
69782
69798
  title: "Prefer IS NOT to NOT IS",
69783
69799
  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
-
69800
+ extendedInformation: `
69801
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69802
+
69787
69803
  "if not is_valid( )." examples are skipped`,
69788
69804
  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.
69805
+ goodExample: `IF variable IS NOT INITIAL.
69806
+ IF variable NP 'TODO*'.
69807
+ IF variable <> 42.
69792
69808
  IF variable CO 'hello'.`,
69793
- badExample: `IF NOT variable IS INITIAL.
69794
- IF NOT variable CP 'TODO*'.
69795
- IF NOT variable = 42.
69809
+ badExample: `IF NOT variable IS INITIAL.
69810
+ IF NOT variable CP 'TODO*'.
69811
+ IF NOT variable = 42.
69796
69812
  IF NOT variable CA 'hello'.`,
69797
69813
  };
69798
69814
  }
@@ -69980,14 +69996,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
69980
69996
  key: "prefer_raise_exception_new",
69981
69997
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
69982
69998
  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
-
69999
+ extendedInformation: `
70000
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70001
+
69986
70002
  From 752 and up`,
69987
70003
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
69988
70004
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
69989
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
69990
- EXPORTING
70005
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
70006
+ EXPORTING
69991
70007
  previous = exception.`,
69992
70008
  };
69993
70009
  }
@@ -70065,12 +70081,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
70065
70081
  key: "prefer_returning_to_exporting",
70066
70082
  title: "Prefer RETURNING to EXPORTING",
70067
70083
  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
70084
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70069
70085
  https://docs.abapopenchecks.org/checks/44/`,
70070
70086
  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.
70087
+ badExample: `CLASS lcl DEFINITION.
70088
+ PUBLIC SECTION.
70089
+ METHODS test EXPORTING ev_foo TYPE i.
70074
70090
  ENDCLASS.`,
70075
70091
  };
70076
70092
  }
@@ -70166,8 +70182,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
70166
70182
  key: "prefer_xsdbool",
70167
70183
  title: "Prefer xsdbool over boolc",
70168
70184
  shortDescription: `Prefer xsdbool over boolc`,
70169
- extendedInformation: `Activates if language version is v740sp08 or above.
70170
-
70185
+ extendedInformation: `Activates if language version is v740sp08 or above.
70186
+
70171
70187
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
70172
70188
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70173
70189
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -70239,9 +70255,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
70239
70255
  title: "Preferred compare operator",
70240
70256
  shortDescription: `Configure undesired operator variants`,
70241
70257
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70242
- badExample: `IF foo EQ bar.
70258
+ badExample: `IF foo EQ bar.
70243
70259
  ENDIF.`,
70244
- goodExample: `IF foo = bar.
70260
+ goodExample: `IF foo = bar.
70245
70261
  ENDIF.`,
70246
70262
  };
70247
70263
  }
@@ -70465,26 +70481,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70465
70481
  key: "reduce_procedural_code",
70466
70482
  title: "Reduce procedural code",
70467
70483
  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
-
70484
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70485
+
70486
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70487
+
70472
70488
  Comments are not counted as statements.`,
70473
70489
  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.
70490
+ badExample: `FORM foo.
70491
+ DATA lv_bar TYPE i.
70492
+ lv_bar = 2 + 2.
70493
+ IF lv_bar = 4.
70494
+ WRITE 'hello world'.
70495
+ ENDIF.
70496
+ DATA lv_bar TYPE i.
70497
+ lv_bar = 2 + 2.
70498
+ IF lv_bar = 4.
70499
+ WRITE 'hello world'.
70500
+ ENDIF.
70485
70501
  ENDFORM.`,
70486
- goodExample: `FORM foo.
70487
- NEW zcl_global_class( )->run_logic( ).
70502
+ goodExample: `FORM foo.
70503
+ NEW zcl_global_class( )->run_logic( ).
70488
70504
  ENDFORM.`,
70489
70505
  };
70490
70506
  }
@@ -70728,10 +70744,10 @@ class RemoveDescriptions {
70728
70744
  return {
70729
70745
  key: "remove_descriptions",
70730
70746
  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
-
70747
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70748
+
70749
+ Class descriptions are required, see rule description_empty.
70750
+
70735
70751
  Consider using ABAP Doc for documentation.`,
70736
70752
  tags: [],
70737
70753
  };
@@ -70856,14 +70872,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70856
70872
  tags: [_irule_1.RuleTag.SingleFile],
70857
70873
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70858
70874
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70859
- badExample: `CALL FUNCTION 'ZRFC'
70875
+ badExample: `CALL FUNCTION 'ZRFC'
70860
70876
  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
70877
+ goodExample: `CALL FUNCTION 'ZRFC'
70878
+ DESTINATION lv_rfc
70879
+ EXCEPTIONS
70880
+ system_failure = 1 MESSAGE msg
70881
+ communication_failure = 2 MESSAGE msg
70882
+ resource_failure = 3
70867
70883
  OTHERS = 4.`,
70868
70884
  };
70869
70885
  }
@@ -70947,11 +70963,11 @@ class SelectAddOrderBy {
70947
70963
  key: "select_add_order_by",
70948
70964
  title: "SELECT add ORDER BY",
70949
70965
  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
-
70966
+ extendedInformation: `
70967
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
70968
+
70969
+ add ORDER BY PRIMARY KEY if in doubt
70970
+
70955
70971
  If the target is a sorted/hashed table, no issue is reported`,
70956
70972
  tags: [_irule_1.RuleTag.SingleFile],
70957
70973
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -71082,14 +71098,14 @@ class SelectPerformance {
71082
71098
  key: "select_performance",
71083
71099
  title: "SELECT performance",
71084
71100
  shortDescription: `Various checks regarding SELECT performance.`,
71085
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71086
-
71101
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71102
+
71087
71103
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
71088
71104
  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.
71105
+ badExample: `SELECT field1, field2 FROM table
71106
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71091
71107
  ENDSELECT.`,
71092
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71108
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71093
71109
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
71094
71110
  };
71095
71111
  }
@@ -71203,8 +71219,8 @@ class SelectSingleFullKey {
71203
71219
  key: "select_single_full_key",
71204
71220
  title: "Detect SELECT SINGLE which are possibily not unique",
71205
71221
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
71206
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71207
-
71222
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71223
+
71208
71224
  If the statement contains a JOIN it is not checked`,
71209
71225
  pseudoComment: "EC CI_NOORDER",
71210
71226
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71628,8 +71644,8 @@ class SICFConsistency {
71628
71644
  key: "sicf_consistency",
71629
71645
  title: "SICF consistency",
71630
71646
  shortDescription: `Checks the validity of ICF services`,
71631
- extendedInformation: `* Class defined in handler must exist
71632
- * Class must not have any syntax errors
71647
+ extendedInformation: `* Class defined in handler must exist
71648
+ * Class must not have any syntax errors
71633
71649
  * Class must implement interface IF_HTTP_EXTENSION`,
71634
71650
  };
71635
71651
  }
@@ -71741,23 +71757,23 @@ class SlowParameterPassing {
71741
71757
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71742
71758
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71743
71759
  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.
71760
+ badExample: `CLASS lcl DEFINITION.
71761
+ PUBLIC SECTION.
71762
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71763
+ ENDCLASS.
71764
+ CLASS lcl IMPLEMENTATION.
71765
+ METHOD bar.
71766
+ WRITE sdf.
71767
+ ENDMETHOD.
71752
71768
  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.
71769
+ goodExample: `CLASS lcl DEFINITION.
71770
+ PUBLIC SECTION.
71771
+ METHODS bar IMPORTING sdf TYPE string.
71772
+ ENDCLASS.
71773
+ CLASS lcl IMPLEMENTATION.
71774
+ METHOD bar.
71775
+ WRITE sdf.
71776
+ ENDMETHOD.
71761
71777
  ENDCLASS.`,
71762
71778
  };
71763
71779
  }
@@ -72014,8 +72030,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
72014
72030
  key: "space_before_dot",
72015
72031
  title: "Space before dot",
72016
72032
  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
72033
+ extendedInformation: `
72034
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72019
72035
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
72020
72036
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72021
72037
  badExample: `WRITE bar .`,
@@ -72201,12 +72217,12 @@ class SQLValueConversion {
72201
72217
  key: "sql_value_conversion",
72202
72218
  title: "Implicit SQL Value Conversion",
72203
72219
  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
72220
+ extendedInformation: `
72221
+ * Integer to CHAR conversion
72222
+ * Integer to NUMC conversion
72223
+ * NUMC to Integer conversion
72224
+ * CHAR to Integer conversion
72225
+ * Source field longer than database field, CHAR -> CHAR
72210
72226
  * Source field longer than database field, NUMC -> NUMC`,
72211
72227
  tags: [],
72212
72228
  };
@@ -72278,7 +72294,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
72278
72294
  key: "start_at_tab",
72279
72295
  title: "Start at tab",
72280
72296
  shortDescription: `Checks that statements start at tabstops.`,
72281
- extendedInformation: `Reports max 100 issues per file
72297
+ extendedInformation: `Reports max 100 issues per file
72282
72298
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
72283
72299
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72284
72300
  badExample: ` WRITE a.`,
@@ -72455,12 +72471,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72455
72471
  key: "strict_sql",
72456
72472
  title: "Strict SQL",
72457
72473
  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
-
72474
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72475
+
72476
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72477
+
72478
+ Also see separate rule sql_escape_host_variables
72479
+
72464
72480
  Activates from v750 and up`,
72465
72481
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72466
72482
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72714,11 +72730,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72714
72730
  key: "sy_modification",
72715
72731
  title: "Modification of SY fields",
72716
72732
  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
-
72733
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72734
+
72719
72735
  Changes to SY-TVAR* fields are not reported`,
72720
72736
  tags: [_irule_1.RuleTag.SingleFile],
72721
- badExample: `sy-uname = 2.
72737
+ badExample: `sy-uname = 2.
72722
72738
  sy = sy.`,
72723
72739
  };
72724
72740
  }
@@ -72780,8 +72796,8 @@ class TABLEnhancementCategory {
72780
72796
  key: "tabl_enhancement_category",
72781
72797
  title: "TABL enhancement category must be set",
72782
72798
  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
-
72799
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72800
+
72785
72801
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72786
72802
  tags: [],
72787
72803
  };
@@ -72846,8 +72862,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72846
72862
  shortDescription: `TABLES are always global, so declare them globally`,
72847
72863
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72848
72864
  tags: [_irule_1.RuleTag.SingleFile],
72849
- badExample: `FORM foo.
72850
- TABLES t100.
72865
+ badExample: `FORM foo.
72866
+ TABLES t100.
72851
72867
  ENDFORM.`,
72852
72868
  goodExample: `TABLES t000.`,
72853
72869
  };
@@ -72975,9 +72991,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
72975
72991
  title: "Type FORM parameters",
72976
72992
  shortDescription: `Checks for untyped FORM parameters`,
72977
72993
  tags: [_irule_1.RuleTag.SingleFile],
72978
- badExample: `FORM foo USING bar.
72994
+ badExample: `FORM foo USING bar.
72979
72995
  ENDFORM.`,
72980
- goodExample: `FORM foo USING bar TYPE string.
72996
+ goodExample: `FORM foo USING bar TYPE string.
72981
72997
  ENDFORM.`,
72982
72998
  };
72983
72999
  }
@@ -73650,38 +73666,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73650
73666
  key: "unnecessary_pragma",
73651
73667
  title: "Unnecessary Pragma",
73652
73668
  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
-
73669
+ extendedInformation: `* NO_HANDLER with handler
73670
+
73671
+ * NEEDED without definition
73672
+
73673
+ * NO_TEXT without texts
73674
+
73675
+ * SUBRC_OK where sy-subrc is checked
73676
+
73661
73677
  NO_HANDLER inside macros are not checked`,
73662
73678
  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.
73679
+ badExample: `TRY.
73680
+ ...
73681
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73682
+ RETURN. " it has a handler
73683
+ ENDTRY.
73684
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73685
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73686
+ IF sy-subrc <> 0.
73671
73687
  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,
73688
+ goodExample: `TRY.
73689
+ ...
73690
+ CATCH zcx_abapgit_exception.
73691
+ RETURN.
73692
+ ENDTRY.
73693
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73694
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73695
+ IF sy-subrc <> 0.
73696
+ ENDIF.
73697
+
73698
+ DATA: BEGIN OF blah ##NEEDED,
73699
+ test1 TYPE string,
73700
+ test2 TYPE string,
73685
73701
  END OF blah.`,
73686
73702
  };
73687
73703
  }
@@ -73848,18 +73864,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73848
73864
  shortDescription: `Finds unnecessary RETURN statements`,
73849
73865
  extendedInformation: `Finds unnecessary RETURN statements`,
73850
73866
  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.
73867
+ badExample: `FORM hello1.
73868
+ WRITE 'world'.
73869
+ RETURN.
73870
+ ENDFORM.
73871
+
73872
+ FORM foo.
73873
+ IF 1 = 2.
73874
+ RETURN.
73875
+ ENDIF.
73860
73876
  ENDFORM.`,
73861
- goodExample: `FORM hello2.
73862
- WRITE 'world'.
73877
+ goodExample: `FORM hello2.
73878
+ WRITE 'world'.
73863
73879
  ENDFORM.`,
73864
73880
  };
73865
73881
  }
@@ -74210,13 +74226,13 @@ class UnusedMacros {
74210
74226
  title: "Unused macros",
74211
74227
  shortDescription: `Checks for unused macro definitions definitions`,
74212
74228
  tags: [_irule_1.RuleTag.Quickfix],
74213
- badExample: `DEFINE foobar1.
74214
- WRITE 'hello'.
74229
+ badExample: `DEFINE foobar1.
74230
+ WRITE 'hello'.
74215
74231
  END-OF-DEFINITION.`,
74216
- goodExample: `DEFINE foobar2.
74217
- WRITE 'hello'.
74218
- END-OF-DEFINITION.
74219
-
74232
+ goodExample: `DEFINE foobar2.
74233
+ WRITE 'hello'.
74234
+ END-OF-DEFINITION.
74235
+
74220
74236
  foobar2.`,
74221
74237
  };
74222
74238
  }
@@ -74328,18 +74344,18 @@ class UnusedMethods {
74328
74344
  key: "unused_methods",
74329
74345
  title: "Unused methods",
74330
74346
  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
74347
+ extendedInformation: `Checks private and protected methods.
74348
+
74349
+ Unused methods are not reported if the object contains parser or syntax errors.
74350
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74351
+
74352
+ Skips:
74353
+ * methods FOR TESTING
74354
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74355
+ * class_constructor + constructor methods
74356
+ * event handlers
74357
+ * methods that are redefined
74358
+ * INCLUDEs
74343
74359
  `,
74344
74360
  tags: [_irule_1.RuleTag.Quickfix],
74345
74361
  pragma: "##CALLED",
@@ -74815,23 +74831,23 @@ class UnusedVariables {
74815
74831
  key: "unused_variables",
74816
74832
  title: "Unused variables",
74817
74833
  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
-
74834
+ extendedInformation: `Skips event parameters.
74835
+
74836
+ Note that this currently does not work if the source code uses macros.
74837
+
74838
+ Unused variables are not reported if the object contains parser or syntax errors.
74839
+
74824
74840
  Errors found in INCLUDES are reported for the main program.`,
74825
74841
  tags: [_irule_1.RuleTag.Quickfix],
74826
74842
  pragma: "##NEEDED",
74827
74843
  pseudoComment: "EC NEEDED",
74828
- badExample: `DATA: BEGIN OF blah1,
74829
- test TYPE string,
74830
- test2 TYPE string,
74844
+ badExample: `DATA: BEGIN OF blah1,
74845
+ test TYPE string,
74846
+ test2 TYPE string,
74831
74847
  END OF blah1.`,
74832
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74833
- test TYPE string,
74834
- test2 TYPE string,
74848
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74849
+ test TYPE string,
74850
+ test2 TYPE string,
74835
74851
  END OF blah2.`,
74836
74852
  };
74837
74853
  }
@@ -75050,15 +75066,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
75050
75066
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
75051
75067
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
75052
75068
  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
-
75069
+ badExample: `IF line IS INITIAL.
75070
+ has_entries = abap_false.
75071
+ ELSE.
75072
+ has_entries = abap_true.
75073
+ ENDIF.
75074
+
75059
75075
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
75060
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75061
-
75076
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75077
+
75062
75078
  DATA(fsdf) = xsdbool( foo <> bar ).`,
75063
75079
  };
75064
75080
  }
@@ -75176,15 +75192,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
75176
75192
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
75177
75193
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
75178
75194
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75179
- badExample: `INTERFACE lif.
75180
- METHODS load_data
75181
- EXCEPTIONS
75182
- invalid_parameter.
75195
+ badExample: `INTERFACE lif.
75196
+ METHODS load_data
75197
+ EXCEPTIONS
75198
+ invalid_parameter.
75183
75199
  ENDINTERFACE.`,
75184
- goodExample: `INTERFACE lif.
75185
- METHODS load_data
75186
- RAISING
75187
- cx_something.
75200
+ goodExample: `INTERFACE lif.
75201
+ METHODS load_data
75202
+ RAISING
75203
+ cx_something.
75188
75204
  ENDINTERFACE.`,
75189
75205
  };
75190
75206
  }
@@ -75244,15 +75260,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
75244
75260
  key: "use_line_exists",
75245
75261
  title: "Use line_exists",
75246
75262
  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
-
75263
+ extendedInformation: `
75264
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75265
+
75250
75266
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
75251
75267
  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.
75268
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75269
+ IF sy-subrc = 0.
75254
75270
  ENDIF.`,
75255
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75271
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75256
75272
  ENDIF.`,
75257
75273
  };
75258
75274
  }
@@ -75362,10 +75378,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75362
75378
  key: "use_new",
75363
75379
  title: "Use NEW",
75364
75380
  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
-
75381
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75382
+
75383
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75384
+
75369
75385
  Applicable from v740sp02 and up`,
75370
75386
  badExample: `CREATE OBJECT ref.`,
75371
75387
  goodExample: `ref = NEW #( ).`,
@@ -75463,13 +75479,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75463
75479
  title: "WHEN OTHERS last",
75464
75480
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75465
75481
  tags: [_irule_1.RuleTag.SingleFile],
75466
- badExample: `CASE bar.
75467
- WHEN OTHERS.
75468
- WHEN 2.
75482
+ badExample: `CASE bar.
75483
+ WHEN OTHERS.
75484
+ WHEN 2.
75469
75485
  ENDCASE.`,
75470
- goodExample: `CASE bar.
75471
- WHEN 2.
75472
- WHEN OTHERS.
75486
+ goodExample: `CASE bar.
75487
+ WHEN 2.
75488
+ WHEN OTHERS.
75473
75489
  ENDCASE.`,
75474
75490
  };
75475
75491
  }