@abaplint/cli 2.113.56 → 2.113.57

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 +862 -854
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -6416,7 +6416,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
6416
6416
  class MessageClass extends combi_1.Expression {
6417
6417
  getRunnable() {
6418
6418
  // "&1" can be used for almost anything(field names, method names etc.) in macros
6419
- return (0, combi_1.seq)((0, combi_1.regex)(/^>?[\w\/]+#?@?\/?!?&?>?\$?\??$/), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)((0, combi_1.regex)(/^\w+$/)))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
6419
+ return (0, combi_1.seq)((0, combi_1.regex)(/^>?[\w\/]+#?@?\/?!?&?>?\$?\??<?$/), (0, combi_1.starPrio)((0, combi_1.tok)(tokens_1.PlusW)), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)((0, combi_1.regex)(/^\w+$/)))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
6420
6420
  }
6421
6421
  }
6422
6422
  exports.MessageClass = MessageClass;
@@ -9421,12 +9421,12 @@ class TypeTable extends combi_1.Expression {
9421
9421
  // a maximum of 15 secondary table keys can be defined
9422
9422
  // "WITH" is not allowed as a field name in keys
9423
9423
  const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
9424
- const occurs = (0, combi_1.seq)("OCCURS", _1.Integer);
9424
+ const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
9425
9425
  const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "FAILED", "LOCK", "READ RESULT", "UPDATE"), _1.TypeName));
9426
9426
  const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
9427
9427
  const oldLike = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
9428
9428
  const typeLine = (0, combi_1.seq)("LINE OF", _1.TypeName, occurs, header);
9429
- const ret = (0, combi_1.altPrio)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), (0, combi_1.seq)("LIKE", (0, combi_1.alt)(oldLike, likeType, rangeLike)), (0, combi_1.seq)("TYPE", (0, combi_1.alt)(oldType, typetable, rangeType, typeLine, derived)));
9429
+ const ret = (0, combi_1.altPrio)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), (0, combi_1.seq)("LIKE", (0, combi_1.alt)(oldLike, likeType, rangeLike, typeLine)), (0, combi_1.seq)("TYPE", (0, combi_1.alt)(oldType, typetable, rangeType, typeLine, derived)));
9430
9430
  return ret;
9431
9431
  }
9432
9432
  }
@@ -10174,7 +10174,10 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
10174
10174
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
10175
10175
  class AssignLocalCopy {
10176
10176
  getMatcher() {
10177
- const ret = (0, combi_1.seq)("ASSIGN LOCAL COPY OF", (0, combi_1.opt)((0, combi_1.seq)("INITIAL", (0, combi_1.opt)("LINE OF"))), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic), "TO", expressions_1.TargetFieldSymbol);
10177
+ const init = (0, combi_1.seq)("INITIAL", (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic));
10178
+ const iline = (0, combi_1.seq)("INITIAL LINE OF", (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic));
10179
+ const main = (0, combi_1.seq)("MAIN TABLE FIELD", expressions_1.Dynamic);
10180
+ const ret = (0, combi_1.seq)("ASSIGN LOCAL COPY OF", (0, combi_1.alt)(init, iline, main, expressions_1.Source), "TO", expressions_1.TargetFieldSymbol);
10178
10181
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
10179
10182
  }
10180
10183
  }
@@ -11967,7 +11970,7 @@ class Describe {
11967
11970
  const table = (0, combi_1.seq)("TABLE", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.per)(tlines, kind, occurs)));
11968
11971
  const mode = (0, combi_1.seq)("IN", (0, combi_1.alt)("BYTE", "CHARACTER"), "MODE");
11969
11972
  const field = (0, combi_1.seq)("FIELD", expressions_1.Source, (0, combi_1.per)((0, combi_1.seq)("TYPE", expressions_1.Target), (0, combi_1.seq)("COMPONENTS", expressions_1.Target), (0, combi_1.seq)("LENGTH", expressions_1.Target, (0, combi_1.opt)(mode)), (0, combi_1.seq)("DECIMALS", expressions_1.Target), (0, combi_1.seq)("HELP-ID", expressions_1.Target), (0, combi_1.seq)("OUTPUT-LENGTH", expressions_1.Target), (0, combi_1.seq)("EDIT MASK", expressions_1.Target), (0, combi_1.seq)("INTO", expressions_1.Target)));
11970
- const distance = (0, combi_1.seq)("DISTANCE BETWEEN", expressions_1.Source, "AND", expressions_1.Source, "INTO", expressions_1.Target, mode);
11973
+ const distance = (0, combi_1.seq)("DISTANCE BETWEEN", expressions_1.Source, "AND", expressions_1.Source, "INTO", expressions_1.Target, (0, combi_1.opt)(mode));
11971
11974
  const lines = (0, combi_1.seq)("NUMBER OF LINES", expressions_1.Target);
11972
11975
  const pages = (0, combi_1.seq)("NUMBER OF PAGES", expressions_1.Target);
11973
11976
  const line = (0, combi_1.seq)("LINE", expressions_1.Source);
@@ -13105,7 +13108,7 @@ class Format {
13105
13108
  getMatcher() {
13106
13109
  const eq = (0, combi_1.seq)("=", expressions_1.Source);
13107
13110
  const value = (0, combi_1.altPrio)(eq, "ON", "OFF");
13108
- const options = (0, combi_1.per)("RESET", (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(value)), (0, combi_1.seq)("INVERSE", (0, combi_1.opt)(value)), (0, combi_1.seq)("HOTSPOT", (0, combi_1.opt)(value)), (0, combi_1.seq)("FRAMES", value), (0, combi_1.seq)("INPUT", value), expressions_1.Color);
13111
+ const options = (0, combi_1.per)("RESET", (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(value)), (0, combi_1.seq)("INVERSE", (0, combi_1.opt)(value)), (0, combi_1.seq)("HOTSPOT", (0, combi_1.opt)(value)), (0, combi_1.seq)("FRAMES", value), (0, combi_1.seq)("INPUT", (0, combi_1.opt)(value)), expressions_1.Color);
13109
13112
  const ret = (0, combi_1.seq)("FORMAT", options);
13110
13113
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
13111
13114
  }
@@ -14920,7 +14923,7 @@ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules
14920
14923
  class Move {
14921
14924
  getMatcher() {
14922
14925
  const mov = (0, combi_1.verNot)(version_1.Version.Cloud, "MOVE");
14923
- const move = (0, combi_1.seq)(mov, (0, combi_1.altPrio)((0, combi_1.seq)("EXACT", expressions_1.Source, "TO", expressions_1.Target), (0, combi_1.seq)(expressions_1.Source, (0, combi_1.altPrio)("?TO", "TO"), expressions_1.Target)));
14926
+ const move = (0, combi_1.seq)(mov, (0, combi_1.altPrio)((0, combi_1.seq)("EXACT", expressions_1.Source, "TO", expressions_1.Target), (0, combi_1.seq)(expressions_1.Source, (0, combi_1.altPrio)("?TO", "TO"), expressions_1.Target)), (0, combi_1.opt)((0, combi_1.seq)("PERCENTAGE", expressions_1.Source)));
14924
14927
  const calcAssign = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.WPlus), "="), (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WDash), "="), "/=", "*=", "&&="));
14925
14928
  const chained = (0, combi_1.seq)("=", (0, combi_1.star)((0, combi_1.seq)(expressions_1.Target, "=")));
14926
14929
  const equals = (0, combi_1.altPrio)((0, combi_1.altPrio)(chained, "?="), calcAssign);
@@ -15236,7 +15239,8 @@ class Parameter {
15236
15239
  const length = (0, combi_1.seq)("LENGTH", expressions_1.Constant);
15237
15240
  const match = (0, combi_1.seq)("MATCHCODE OBJECT", expressions_1.Field);
15238
15241
  const decimals = (0, combi_1.seq)("DECIMALS", expressions_1.Source);
15239
- const perm = (0, combi_1.per)(type, def, "OBLIGATORY", match, cmd, length, decimals, radio, memory, modif, listbox, visible, "VALUE CHECK", "NO-DISPLAY", "AS CHECKBOX", "LOWER CASE");
15242
+ const forTable = (0, combi_1.seq)("FOR TABLE", expressions_1.DatabaseTable);
15243
+ const perm = (0, combi_1.per)(type, def, "OBLIGATORY", match, cmd, length, decimals, radio, memory, modif, listbox, visible, forTable, "VALUE CHECK", "NO-DISPLAY", "AS CHECKBOX", "LOWER CASE");
15240
15244
  const ret = (0, combi_1.seq)(para, expressions_1.FieldSub, (0, combi_1.opt)(expressions_1.FieldLength), (0, combi_1.opt)(perm));
15241
15245
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
15242
15246
  }
@@ -15319,7 +15323,10 @@ class PrintControl {
15319
15323
  getMatcher() {
15320
15324
  const index = (0, combi_1.seq)("INDEX-LINE", expressions_1.Source);
15321
15325
  const func = (0, combi_1.seq)("FUNCTION", expressions_1.Source);
15322
- const ret = (0, combi_1.seq)("PRINT-CONTROL", (0, combi_1.alt)(index, func));
15326
+ const line = (0, combi_1.seq)("LINE", expressions_1.Source);
15327
+ const position = (0, combi_1.seq)("POSITION", expressions_1.Source);
15328
+ const size = (0, combi_1.seq)("SIZE", expressions_1.Source);
15329
+ const ret = (0, combi_1.seq)("PRINT-CONTROL", (0, combi_1.per)(index, func, line, position, size));
15323
15330
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
15324
15331
  }
15325
15332
  }
@@ -15417,7 +15424,8 @@ class Provide {
15417
15424
  const list = (0, combi_1.plus)((0, combi_1.altPrio)("*", expressions_1.Field));
15418
15425
  const fields = (0, combi_1.seq)("FIELDS", list, "FROM", expressions_1.Source, "INTO", expressions_1.Target, "VALID", expressions_1.Field, "BOUNDS", expressions_1.Field, "AND", expressions_1.Field);
15419
15426
  const fieldList = (0, combi_1.altPrio)((0, combi_1.seq)(list, "FROM", expressions_1.Source), list);
15420
- const ret = (0, combi_1.seq)("PROVIDE", (0, combi_1.altPrio)((0, combi_1.plus)(fields), (0, combi_1.plus)(fieldList)), "BETWEEN", expressions_1.SimpleSource3, "AND", expressions_1.SimpleSource3);
15427
+ const where = (0, combi_1.seq)("WHERE", expressions_1.Cond);
15428
+ const ret = (0, combi_1.seq)("PROVIDE", (0, combi_1.altPrio)((0, combi_1.plus)(fields), (0, combi_1.plus)(fieldList)), "BETWEEN", expressions_1.SimpleSource3, "AND", expressions_1.SimpleSource3, (0, combi_1.optPrio)(where));
15421
15429
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
15422
15430
  }
15423
15431
  }
@@ -35296,13 +35304,13 @@ class FlowGraph {
35296
35304
  this.label = label;
35297
35305
  }
35298
35306
  toDigraph() {
35299
- return `digraph G {
35300
- labelloc="t";
35301
- label="${this.label}";
35302
- graph [fontname = "helvetica"];
35303
- node [fontname = "helvetica", shape="box"];
35304
- edge [fontname = "helvetica"];
35305
- ${this.toTextEdges()}
35307
+ return `digraph G {
35308
+ labelloc="t";
35309
+ label="${this.label}";
35310
+ graph [fontname = "helvetica"];
35311
+ node [fontname = "helvetica", shape="box"];
35312
+ edge [fontname = "helvetica"];
35313
+ ${this.toTextEdges()}
35306
35314
  }`;
35307
35315
  }
35308
35316
  listSources(node) {
@@ -43720,13 +43728,13 @@ class Help {
43720
43728
  /////////////////////////////////////////////////
43721
43729
  static dumpABAP(file, reg, textDocument, position) {
43722
43730
  let content = "";
43723
- content = `
43724
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43725
- <a href="#_statements" rel="no-refresh">Statements</a> |
43726
- <a href="#_structure" rel="no-refresh">Structure</a> |
43727
- <a href="#_files" rel="no-refresh">Files</a> |
43728
- <a href="#_info" rel="no-refresh">Info Dump</a>
43729
- <hr>
43731
+ content = `
43732
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43733
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43734
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43735
+ <a href="#_files" rel="no-refresh">Files</a> |
43736
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43737
+ <hr>
43730
43738
  ` +
43731
43739
  "<tt>" + textDocument.uri + " (" +
43732
43740
  (position.line + 1) + ", " +
@@ -43881,9 +43889,9 @@ class Help {
43881
43889
  return ret + "</ul>";
43882
43890
  }
43883
43891
  static tokens(file) {
43884
- let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
43885
- <td><b>Row</b></td><td><b>Column</b></td>
43886
- <td><b>vRow</b></td><td><b>vColumn</b></td>
43892
+ let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
43893
+ <td><b>Row</b></td><td><b>Column</b></td>
43894
+ <td><b>vRow</b></td><td><b>vColumn</b></td>
43887
43895
  </tr>`;
43888
43896
  for (const token of file.getTokens()) {
43889
43897
  const tStart = token.getStart();
@@ -53134,7 +53142,7 @@ class Registry {
53134
53142
  }
53135
53143
  static abaplintVersion() {
53136
53144
  // magic, see build script "version.sh"
53137
- return "2.113.56";
53145
+ return "2.113.57";
53138
53146
  }
53139
53147
  getDDICReferences() {
53140
53148
  return this.ddicReferences;
@@ -53453,10 +53461,10 @@ class SevenBitAscii {
53453
53461
  key: "7bit_ascii",
53454
53462
  title: "Check for 7bit ascii",
53455
53463
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53456
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53457
-
53458
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53459
-
53464
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53465
+
53466
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53467
+
53460
53468
  Checkes files with extensions ".abap" and ".asddls"`,
53461
53469
  tags: [_irule_1.RuleTag.SingleFile],
53462
53470
  badExample: `WRITE '뽑'.`,
@@ -53662,10 +53670,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53662
53670
  key: "abapdoc",
53663
53671
  title: "Check abapdoc",
53664
53672
  shortDescription: `Various checks regarding abapdoc.`,
53665
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53666
-
53667
- Plus class and interface definitions.
53668
-
53673
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53674
+
53675
+ Plus class and interface definitions.
53676
+
53669
53677
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53670
53678
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53671
53679
  };
@@ -53802,27 +53810,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53802
53810
  title: "Add test attributes for tests classes with test methods",
53803
53811
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53804
53812
  tags: [_irule_1.RuleTag.SingleFile],
53805
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53806
- PUBLIC SECTION.
53807
- PROTECTED SECTION.
53808
- PRIVATE SECTION.
53809
- METHODS test FOR TESTING RAISING cx_static_check.
53810
- ENDCLASS.
53811
-
53812
- CLASS ltcl_test1 IMPLEMENTATION.
53813
- METHOD test.
53814
- ENDMETHOD.
53813
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53814
+ PUBLIC SECTION.
53815
+ PROTECTED SECTION.
53816
+ PRIVATE SECTION.
53817
+ METHODS test FOR TESTING RAISING cx_static_check.
53818
+ ENDCLASS.
53819
+
53820
+ CLASS ltcl_test1 IMPLEMENTATION.
53821
+ METHOD test.
53822
+ ENDMETHOD.
53815
53823
  ENDCLASS.`,
53816
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53817
- PUBLIC SECTION.
53818
- PROTECTED SECTION.
53819
- PRIVATE SECTION.
53820
- METHODS test FOR TESTING RAISING cx_static_check.
53821
- ENDCLASS.
53822
-
53823
- CLASS ltcl_test2 IMPLEMENTATION.
53824
- METHOD test.
53825
- ENDMETHOD.
53824
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53825
+ PUBLIC SECTION.
53826
+ PROTECTED SECTION.
53827
+ PRIVATE SECTION.
53828
+ METHODS test FOR TESTING RAISING cx_static_check.
53829
+ ENDCLASS.
53830
+
53831
+ CLASS ltcl_test2 IMPLEMENTATION.
53832
+ METHOD test.
53833
+ ENDMETHOD.
53826
53834
  ENDCLASS.`,
53827
53835
  };
53828
53836
  }
@@ -53908,49 +53916,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
53908
53916
  key: "align_parameters",
53909
53917
  title: "Align Parameters",
53910
53918
  shortDescription: `Checks for vertially aligned parameters`,
53911
- extendedInformation: `Checks:
53912
- * function module calls
53913
- * method calls
53914
- * VALUE constructors
53915
- * NEW constructors
53916
- * RAISE EXCEPTION statements
53917
- * CREATE OBJECT statements
53918
- * RAISE EVENT statements
53919
-
53920
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53921
-
53922
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53923
-
53924
- If parameters are on the same row, no issues are reported, see
53919
+ extendedInformation: `Checks:
53920
+ * function module calls
53921
+ * method calls
53922
+ * VALUE constructors
53923
+ * NEW constructors
53924
+ * RAISE EXCEPTION statements
53925
+ * CREATE OBJECT statements
53926
+ * RAISE EVENT statements
53927
+
53928
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
53929
+
53930
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
53931
+
53932
+ If parameters are on the same row, no issues are reported, see
53925
53933
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
53926
53934
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
53927
- badExample: `CALL FUNCTION 'FOOBAR'
53928
- EXPORTING
53929
- foo = 2
53930
- parameter = 3.
53931
-
53932
- foobar( moo = 1
53933
- param = 1 ).
53934
-
53935
- foo = VALUE #(
53936
- foo = bar
53935
+ badExample: `CALL FUNCTION 'FOOBAR'
53936
+ EXPORTING
53937
+ foo = 2
53938
+ parameter = 3.
53939
+
53940
+ foobar( moo = 1
53941
+ param = 1 ).
53942
+
53943
+ foo = VALUE #(
53944
+ foo = bar
53937
53945
  moo = 2 ).`,
53938
- goodExample: `CALL FUNCTION 'FOOBAR'
53939
- EXPORTING
53940
- foo = 2
53941
- parameter = 3.
53942
-
53943
- foobar( moo = 1
53944
- param = 1 ).
53945
-
53946
- foo = VALUE #(
53947
- foo = bar
53948
- moo = 2 ).
53949
-
53950
- DATA(sdf) = VALUE type(
53951
- common_val = 2
53952
- another_common = 5
53953
- ( row_value = 4
53946
+ goodExample: `CALL FUNCTION 'FOOBAR'
53947
+ EXPORTING
53948
+ foo = 2
53949
+ parameter = 3.
53950
+
53951
+ foobar( moo = 1
53952
+ param = 1 ).
53953
+
53954
+ foo = VALUE #(
53955
+ foo = bar
53956
+ moo = 2 ).
53957
+
53958
+ DATA(sdf) = VALUE type(
53959
+ common_val = 2
53960
+ another_common = 5
53961
+ ( row_value = 4
53954
53962
  value_foo = 5 ) ).`,
53955
53963
  };
53956
53964
  }
@@ -54384,37 +54392,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
54384
54392
  key: "align_type_expressions",
54385
54393
  title: "Align TYPE expressions",
54386
54394
  shortDescription: `Align TYPE expressions in statements`,
54387
- extendedInformation: `
54388
- Currently works for METHODS + BEGIN OF
54389
-
54390
- If BEGIN OF has an INCLUDE TYPE its ignored
54391
-
54392
- Also note that clean ABAP does not recommend aligning TYPE clauses:
54395
+ extendedInformation: `
54396
+ Currently works for METHODS + BEGIN OF
54397
+
54398
+ If BEGIN OF has an INCLUDE TYPE its ignored
54399
+
54400
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54393
54401
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54394
54402
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
54395
- badExample: `
54396
- TYPES: BEGIN OF foo,
54397
- bar TYPE i,
54398
- foobar TYPE i,
54399
- END OF foo.
54400
-
54401
- INTERFACE lif.
54402
- METHODS bar
54403
- IMPORTING
54404
- foo TYPE i
54405
- foobar TYPE i.
54403
+ badExample: `
54404
+ TYPES: BEGIN OF foo,
54405
+ bar TYPE i,
54406
+ foobar TYPE i,
54407
+ END OF foo.
54408
+
54409
+ INTERFACE lif.
54410
+ METHODS bar
54411
+ IMPORTING
54412
+ foo TYPE i
54413
+ foobar TYPE i.
54406
54414
  ENDINTERFACE.`,
54407
- goodExample: `
54408
- TYPES: BEGIN OF foo,
54409
- bar TYPE i,
54410
- foobar TYPE i,
54411
- END OF foo.
54412
-
54413
- INTERFACE lif.
54414
- METHODS bar
54415
- IMPORTING
54416
- foo TYPE i
54417
- foobar TYPE i.
54415
+ goodExample: `
54416
+ TYPES: BEGIN OF foo,
54417
+ bar TYPE i,
54418
+ foobar TYPE i,
54419
+ END OF foo.
54420
+
54421
+ INTERFACE lif.
54422
+ METHODS bar
54423
+ IMPORTING
54424
+ foo TYPE i
54425
+ foobar TYPE i.
54418
54426
  ENDINTERFACE.`,
54419
54427
  };
54420
54428
  }
@@ -54693,16 +54701,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54693
54701
  return {
54694
54702
  key: "ambiguous_statement",
54695
54703
  title: "Check for ambigious statements",
54696
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54697
- Add "TABLE" keyword or "@" for escaping SQL variables
54698
-
54704
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54705
+ Add "TABLE" keyword or "@" for escaping SQL variables
54706
+
54699
54707
  Only works if the target version is 740sp05 or above`,
54700
54708
  tags: [_irule_1.RuleTag.SingleFile],
54701
- badExample: `DELETE foo FROM bar.
54709
+ badExample: `DELETE foo FROM bar.
54702
54710
  MODIFY foo FROM bar.`,
54703
- goodExample: `DELETE foo FROM @bar.
54704
- DELETE TABLE itab FROM 2.
54705
- MODIFY zfoo FROM @wa.
54711
+ goodExample: `DELETE foo FROM @bar.
54712
+ DELETE TABLE itab FROM 2.
54713
+ MODIFY zfoo FROM @wa.
54706
54714
  MODIFY TABLE foo FROM bar.`,
54707
54715
  };
54708
54716
  }
@@ -54807,16 +54815,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54807
54815
  key: "avoid_use",
54808
54816
  title: "Avoid use of certain statements",
54809
54817
  shortDescription: `Detects usage of certain statements.`,
54810
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54811
-
54812
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54813
-
54814
- STATICS: use CLASS-DATA instead
54815
-
54816
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54817
-
54818
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54819
-
54818
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54819
+
54820
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54821
+
54822
+ STATICS: use CLASS-DATA instead
54823
+
54824
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54825
+
54826
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54827
+
54820
54828
  BREAK points`,
54821
54829
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54822
54830
  };
@@ -54948,11 +54956,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
54948
54956
  title: "Check BEGIN END names",
54949
54957
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
54950
54958
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54951
- badExample: `DATA: BEGIN OF stru,
54952
- field TYPE i,
54959
+ badExample: `DATA: BEGIN OF stru,
54960
+ field TYPE i,
54953
54961
  END OF structure_not_the_same.`,
54954
- goodExample: `DATA: BEGIN OF stru,
54955
- field TYPE i,
54962
+ goodExample: `DATA: BEGIN OF stru,
54963
+ field TYPE i,
54956
54964
  END OF stru.`,
54957
54965
  };
54958
54966
  }
@@ -55049,20 +55057,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
55049
55057
  title: "BEGIN contains single INCLUDE",
55050
55058
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
55051
55059
  tags: [_irule_1.RuleTag.SingleFile],
55052
- badExample: `TYPES: BEGIN OF dummy1.
55053
- INCLUDE TYPE dselc.
55054
- TYPES: END OF dummy1.
55055
-
55056
- DATA BEGIN OF foo.
55057
- INCLUDE STRUCTURE syst.
55058
- DATA END OF foo.
55059
-
55060
- STATICS BEGIN OF bar.
55061
- INCLUDE STRUCTURE syst.
55060
+ badExample: `TYPES: BEGIN OF dummy1.
55061
+ INCLUDE TYPE dselc.
55062
+ TYPES: END OF dummy1.
55063
+
55064
+ DATA BEGIN OF foo.
55065
+ INCLUDE STRUCTURE syst.
55066
+ DATA END OF foo.
55067
+
55068
+ STATICS BEGIN OF bar.
55069
+ INCLUDE STRUCTURE syst.
55062
55070
  STATICS END OF bar.`,
55063
- goodExample: `DATA BEGIN OF foo.
55064
- DATA field TYPE i.
55065
- INCLUDE STRUCTURE dselc.
55071
+ goodExample: `DATA BEGIN OF foo.
55072
+ DATA field TYPE i.
55073
+ INCLUDE STRUCTURE dselc.
55066
55074
  DATA END OF foo.`,
55067
55075
  };
55068
55076
  }
@@ -55152,9 +55160,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
55152
55160
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
55153
55161
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55154
55162
  badExample: `CALL TRANSACTION 'FOO'.`,
55155
- goodExample: `TRY.
55156
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55157
- CATCH cx_sy_authorization_error.
55163
+ goodExample: `TRY.
55164
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55165
+ CATCH cx_sy_authorization_error.
55158
55166
  ENDTRY.`,
55159
55167
  };
55160
55168
  }
@@ -55219,10 +55227,10 @@ class CDSCommentStyle {
55219
55227
  key: "cds_comment_style",
55220
55228
  title: "CDS Comment Style",
55221
55229
  shortDescription: `Check for obsolete comment style`,
55222
- extendedInformation: `Check for obsolete comment style
55223
-
55224
- Comments starting with "--" are considered obsolete
55225
-
55230
+ extendedInformation: `Check for obsolete comment style
55231
+
55232
+ Comments starting with "--" are considered obsolete
55233
+
55226
55234
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
55227
55235
  tags: [_irule_1.RuleTag.SingleFile],
55228
55236
  badExample: "-- this is a comment",
@@ -55288,10 +55296,10 @@ class CDSLegacyView {
55288
55296
  key: "cds_legacy_view",
55289
55297
  title: "CDS Legacy View",
55290
55298
  shortDescription: `Identify CDS Legacy Views`,
55291
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55292
-
55293
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55294
-
55299
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55300
+
55301
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55302
+
55295
55303
  v755 and up`,
55296
55304
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
55297
55305
  };
@@ -55446,10 +55454,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55446
55454
  key: "chain_mainly_declarations",
55447
55455
  title: "Chain mainly declarations",
55448
55456
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55449
- extendedInformation: `
55450
- https://docs.abapopenchecks.org/checks/23/
55451
-
55452
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55457
+ extendedInformation: `
55458
+ https://docs.abapopenchecks.org/checks/23/
55459
+
55460
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55453
55461
  `,
55454
55462
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55455
55463
  badExample: `CALL METHOD: bar.`,
@@ -55625,17 +55633,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55625
55633
  title: "Change IF to CASE",
55626
55634
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55627
55635
  // eslint-disable-next-line max-len
55628
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55629
-
55636
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55637
+
55630
55638
  If the first comparison is a boolean compare, no issue is reported.`,
55631
55639
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55632
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55633
- ELSEIF l_fcat-fieldname = 'BAR'
55634
- OR l_fcat-fieldname = 'MOO'.
55640
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55641
+ ELSEIF l_fcat-fieldname = 'BAR'
55642
+ OR l_fcat-fieldname = 'MOO'.
55635
55643
  ENDIF.`,
55636
- goodExample: `CASE l_fcat-fieldname.
55637
- WHEN 'FOO'.
55638
- WHEN 'BAR' OR 'MOO'.
55644
+ goodExample: `CASE l_fcat-fieldname.
55645
+ WHEN 'FOO'.
55646
+ WHEN 'BAR' OR 'MOO'.
55639
55647
  ENDCASE.`,
55640
55648
  };
55641
55649
  }
@@ -55772,8 +55780,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55772
55780
  return {
55773
55781
  key: "check_abstract",
55774
55782
  title: "Check abstract methods and classes",
55775
- shortDescription: `Checks abstract methods and classes:
55776
- - class defined as abstract and final,
55783
+ shortDescription: `Checks abstract methods and classes:
55784
+ - class defined as abstract and final,
55777
55785
  - non-abstract class contains abstract methods`,
55778
55786
  extendedInformation: `If a class defines only constants, use an interface instead`,
55779
55787
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55854,11 +55862,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55854
55862
  return {
55855
55863
  key: "check_comments",
55856
55864
  title: "Check Comments",
55857
- shortDescription: `
55865
+ shortDescription: `
55858
55866
  Various checks for comment usage.`,
55859
- extendedInformation: `
55860
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55861
-
55867
+ extendedInformation: `
55868
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55869
+
55862
55870
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55863
55871
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55864
55872
  badExample: `WRITE 2. " descriptive comment`,
@@ -56020,9 +56028,9 @@ class CheckInclude {
56020
56028
  key: "check_include",
56021
56029
  title: "Check INCLUDEs",
56022
56030
  shortDescription: `Checks INCLUDE statements`,
56023
- extendedInformation: `
56024
- * Reports unused includes
56025
- * Errors if the includes are not found
56031
+ extendedInformation: `
56032
+ * Reports unused includes
56033
+ * Errors if the includes are not found
56026
56034
  * Error if including a main program`,
56027
56035
  tags: [_irule_1.RuleTag.Syntax],
56028
56036
  };
@@ -56098,14 +56106,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
56098
56106
  key: "check_subrc",
56099
56107
  title: "Check sy-subrc",
56100
56108
  shortDescription: `Check sy-subrc`,
56101
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56102
-
56103
- If sy-dbcnt is checked after database statements, it is considered okay.
56104
-
56105
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56106
-
56107
- If IS ASSIGNED is checked after assigning, it is considered okay.
56108
-
56109
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56110
+
56111
+ If sy-dbcnt is checked after database statements, it is considered okay.
56112
+
56113
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56114
+
56115
+ If IS ASSIGNED is checked after assigning, it is considered okay.
56116
+
56109
56117
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
56110
56118
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56111
56119
  pseudoComment: "EC CI_SUBRC",
@@ -56675,17 +56683,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56675
56683
  shortDescription: `Find overlapping classic exceptions`,
56676
56684
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56677
56685
  tags: [_irule_1.RuleTag.SingleFile],
56678
- badExample: `CALL FUNCTION 'SOMETHING'
56679
- EXCEPTIONS
56680
- system_failure = 1 MESSAGE lv_message
56681
- communication_failure = 1 MESSAGE lv_message
56682
- resource_failure = 1
56686
+ badExample: `CALL FUNCTION 'SOMETHING'
56687
+ EXCEPTIONS
56688
+ system_failure = 1 MESSAGE lv_message
56689
+ communication_failure = 1 MESSAGE lv_message
56690
+ resource_failure = 1
56683
56691
  OTHERS = 1.`,
56684
- goodExample: `CALL FUNCTION 'SOMETHING'
56685
- EXCEPTIONS
56686
- system_failure = 1 MESSAGE lv_message
56687
- communication_failure = 2 MESSAGE lv_message
56688
- resource_failure = 3
56692
+ goodExample: `CALL FUNCTION 'SOMETHING'
56693
+ EXCEPTIONS
56694
+ system_failure = 1 MESSAGE lv_message
56695
+ communication_failure = 2 MESSAGE lv_message
56696
+ resource_failure = 3
56689
56697
  OTHERS = 4.`,
56690
56698
  };
56691
56699
  }
@@ -56931,7 +56939,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
56931
56939
  key: "commented_code",
56932
56940
  title: "Find commented code",
56933
56941
  shortDescription: `Detects usage of commented out code.`,
56934
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56942
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
56935
56943
  https://docs.abapopenchecks.org/checks/14/`,
56936
56944
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
56937
56945
  badExample: `* WRITE 'hello world'.`,
@@ -57164,10 +57172,10 @@ class ConstructorVisibilityPublic {
57164
57172
  key: "constructor_visibility_public",
57165
57173
  title: "Check constructor visibility is public",
57166
57174
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
57167
- extendedInformation: `
57168
- This only applies to global classes.
57169
-
57170
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57175
+ extendedInformation: `
57176
+ This only applies to global classes.
57177
+
57178
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57171
57179
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
57172
57180
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57173
57181
  };
@@ -57242,8 +57250,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
57242
57250
  key: "contains_tab",
57243
57251
  title: "Code contains tab",
57244
57252
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
57245
- extendedInformation: `
57246
- https://docs.abapopenchecks.org/checks/09/
57253
+ extendedInformation: `
57254
+ https://docs.abapopenchecks.org/checks/09/
57247
57255
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
57248
57256
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57249
57257
  badExample: `\tWRITE 'hello world'.`,
@@ -57330,10 +57338,10 @@ class CyclicOO {
57330
57338
  key: "cyclic_oo",
57331
57339
  title: "Cyclic OO",
57332
57340
  shortDescription: `Finds cyclic/circular OO references`,
57333
- extendedInformation: `Runs for global INTF + CLAS objects
57334
-
57335
- Objects must be without syntax errors for this rule to take effect
57336
-
57341
+ extendedInformation: `Runs for global INTF + CLAS objects
57342
+
57343
+ Objects must be without syntax errors for this rule to take effect
57344
+
57337
57345
  References in testclass includes are ignored`,
57338
57346
  };
57339
57347
  }
@@ -57576,7 +57584,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57576
57584
  key: "dangerous_statement",
57577
57585
  title: "Dangerous statement",
57578
57586
  shortDescription: `Detects potentially dangerous statements`,
57579
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57587
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57580
57588
  dynamic SQL can potentially create SQL injection problems`,
57581
57589
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57582
57590
  };
@@ -57783,13 +57791,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57783
57791
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57784
57792
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57785
57793
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57786
- badExample: `FROM foo.
57787
- WRITE 'hello'.
57788
- DATA int TYPE i.
57794
+ badExample: `FROM foo.
57795
+ WRITE 'hello'.
57796
+ DATA int TYPE i.
57789
57797
  ENDFORM.`,
57790
- goodExample: `FROM foo.
57791
- DATA int TYPE i.
57792
- WRITE 'hello'.
57798
+ goodExample: `FROM foo.
57799
+ DATA int TYPE i.
57800
+ WRITE 'hello'.
57793
57801
  ENDFORM.`,
57794
57802
  };
57795
57803
  }
@@ -58328,39 +58336,39 @@ class Downport {
58328
58336
  key: "downport",
58329
58337
  title: "Downport statement",
58330
58338
  shortDescription: `Downport functionality`,
58331
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58332
- a higher level language version. If successful, various rules are applied to downport the statement.
58333
- Target downport version is always v702, thus rule is only enabled if target version is v702.
58334
-
58335
- Current rules:
58336
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58337
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58338
- * FIELD-SYMBOL() definitions are outlined
58339
- * CONV is outlined
58340
- * COND is outlined
58341
- * REDUCE is outlined
58342
- * SWITCH is outlined
58343
- * FILTER is outlined
58344
- * APPEND expression is outlined
58345
- * INSERT expression is outlined
58346
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58347
- * CAST changed to ?=
58348
- * LOOP AT method_call( ) is outlined
58349
- * VALUE # with structure fields
58350
- * VALUE # with internal table lines
58351
- * Table Expressions are outlined
58352
- * SELECT INTO @DATA definitions are outlined
58353
- * Some occurrences of string template formatting option ALPHA changed to function module call
58354
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58355
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58356
- * RAISE EXCEPTION ... MESSAGE
58357
- * Moving with +=, -=, /=, *=, &&= is expanded
58358
- * line_exists and line_index is downported to READ TABLE
58359
- * ENUMs, but does not nessesarily give the correct type and value
58360
- * MESSAGE with non simple source
58361
-
58362
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58363
-
58339
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58340
+ a higher level language version. If successful, various rules are applied to downport the statement.
58341
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
58342
+
58343
+ Current rules:
58344
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58345
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58346
+ * FIELD-SYMBOL() definitions are outlined
58347
+ * CONV is outlined
58348
+ * COND is outlined
58349
+ * REDUCE is outlined
58350
+ * SWITCH is outlined
58351
+ * FILTER is outlined
58352
+ * APPEND expression is outlined
58353
+ * INSERT expression is outlined
58354
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58355
+ * CAST changed to ?=
58356
+ * LOOP AT method_call( ) is outlined
58357
+ * VALUE # with structure fields
58358
+ * VALUE # with internal table lines
58359
+ * Table Expressions are outlined
58360
+ * SELECT INTO @DATA definitions are outlined
58361
+ * Some occurrences of string template formatting option ALPHA changed to function module call
58362
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58363
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58364
+ * RAISE EXCEPTION ... MESSAGE
58365
+ * Moving with +=, -=, /=, *=, &&= is expanded
58366
+ * line_exists and line_index is downported to READ TABLE
58367
+ * ENUMs, but does not nessesarily give the correct type and value
58368
+ * MESSAGE with non simple source
58369
+
58370
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58371
+
58364
58372
  Make sure to test the downported code, it might not always be completely correct.`,
58365
58373
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
58366
58374
  };
@@ -58938,10 +58946,10 @@ Make sure to test the downported code, it might not always be completely correct
58938
58946
  const fieldName = f.concatTokens();
58939
58947
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
58940
58948
  }
58941
- fieldDefinition = `DATA: BEGIN OF ${name},
58949
+ fieldDefinition = `DATA: BEGIN OF ${name},
58942
58950
  ${fieldDefinition}${indentation} END OF ${name}.`;
58943
58951
  }
58944
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58952
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
58945
58953
  ${indentation}`);
58946
58954
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
58947
58955
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59000,12 +59008,12 @@ ${indentation}`);
59000
59008
  }
59001
59009
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59002
59010
  const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
59003
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
59004
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
59005
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
59011
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
59012
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
59013
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
59006
59014
  ${indentation}`);
59007
59015
  if (fieldDefinitions === "") {
59008
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
59016
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
59009
59017
  ${indentation}`);
59010
59018
  }
59011
59019
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -59073,7 +59081,7 @@ ${indentation}`);
59073
59081
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59074
59082
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59075
59083
  const firstToken = high.getFirstToken();
59076
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59084
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59077
59085
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59078
59086
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59079
59087
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59127,7 +59135,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59127
59135
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59128
59136
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59129
59137
  const firstToken = high.getFirstToken();
59130
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59138
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59131
59139
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59132
59140
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59133
59141
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59169,14 +59177,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59169
59177
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59170
59178
  const firstToken = high.getFirstToken();
59171
59179
  // note that the tabix restore should be done before throwing the exception
59172
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59173
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59174
- ${indentation}${tabixBackup} = sy-tabix.
59175
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59176
- ${indentation}sy-tabix = ${tabixBackup}.
59177
- ${indentation}IF sy-subrc <> 0.
59178
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59179
- ${indentation}ENDIF.
59180
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59181
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59182
+ ${indentation}${tabixBackup} = sy-tabix.
59183
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59184
+ ${indentation}sy-tabix = ${tabixBackup}.
59185
+ ${indentation}IF sy-subrc <> 0.
59186
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59187
+ ${indentation}ENDIF.
59180
59188
  ${indentation}`);
59181
59189
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
59182
59190
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59233,7 +59241,7 @@ ${indentation}`);
59233
59241
  const className = classNames[0].concatTokens();
59234
59242
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59235
59243
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59236
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
59244
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
59237
59245
  ${indentation}CATCH ${className} INTO ${targetName}.`;
59238
59246
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
59239
59247
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -59395,16 +59403,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
59395
59403
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59396
59404
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59397
59405
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59398
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59399
- ${indentation}${uniqueName1}-msgid = ${id}.
59406
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59407
+ ${indentation}${uniqueName1}-msgid = ${id}.
59400
59408
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59401
59409
  if (withs.length > 0) {
59402
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59403
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59404
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59410
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59411
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59412
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59405
59413
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59406
59414
  }
59407
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59415
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59408
59416
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59409
59417
  if (withs.length > 0) {
59410
59418
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59516,10 +59524,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59516
59524
  let code = "";
59517
59525
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59518
59526
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59519
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59520
- IF sy-subrc <> 0.
59521
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59522
- ENDIF.
59527
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59528
+ IF sy-subrc <> 0.
59529
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59530
+ ENDIF.
59523
59531
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59524
59532
  }
59525
59533
  else {
@@ -59608,20 +59616,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59608
59616
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59609
59617
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59610
59618
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59611
- code += ` items LIKE ${loopSourceName},
59612
- END OF ${groupTargetName}type.
59613
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59614
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59619
+ code += ` items LIKE ${loopSourceName},
59620
+ END OF ${groupTargetName}type.
59621
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59622
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59615
59623
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59616
59624
  if (groupIndexName !== undefined) {
59617
59625
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59618
59626
  }
59619
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59627
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59620
59628
  IF sy-subrc = 0.\n`;
59621
59629
  if (groupCountName !== undefined) {
59622
59630
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59623
59631
  }
59624
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59632
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59625
59633
  ELSE.\n`;
59626
59634
  code += ` CLEAR ${uniqueName}.\n`;
59627
59635
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59642,8 +59650,8 @@ ELSE.\n`;
59642
59650
  }
59643
59651
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59644
59652
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59645
- code += `ENDIF.
59646
- ENDLOOP.
59653
+ code += `ENDIF.
59654
+ ENDLOOP.
59647
59655
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59648
59656
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59649
59657
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59815,7 +59823,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59815
59823
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59816
59824
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59817
59825
  // all ENUMS are char like?
59818
- let code = `TYPES ${enumName} TYPE string.
59826
+ let code = `TYPES ${enumName} TYPE string.
59819
59827
  CONSTANTS: BEGIN OF ${structureName},\n`;
59820
59828
  let count = 1;
59821
59829
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59859,14 +59867,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59859
59867
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59860
59868
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59861
59869
  // restore tabix before exeption
59862
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59863
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59864
- ${indentation}${tabixBackup} = sy-tabix.
59865
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59866
- ${indentation}sy-tabix = ${tabixBackup}.
59867
- ${indentation}IF sy-subrc <> 0.
59868
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59869
- ${indentation}ENDIF.
59870
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59871
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59872
+ ${indentation}${tabixBackup} = sy-tabix.
59873
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59874
+ ${indentation}sy-tabix = ${tabixBackup}.
59875
+ ${indentation}IF sy-subrc <> 0.
59876
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59877
+ ${indentation}ENDIF.
59870
59878
  ${indentation}${uniqueName}`;
59871
59879
  const start = target.getFirstToken().getStart();
59872
59880
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -59946,11 +59954,11 @@ ${indentation}${uniqueName}`;
59946
59954
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59947
59955
  const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59948
59956
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59949
- const code = `DATA ${uniqueName} TYPE string.
59950
- ${indentation}CALL FUNCTION '${functionName}'
59951
- ${indentation} EXPORTING
59952
- ${indentation} input = ${source}
59953
- ${indentation} IMPORTING
59957
+ const code = `DATA ${uniqueName} TYPE string.
59958
+ ${indentation}CALL FUNCTION '${functionName}'
59959
+ ${indentation} EXPORTING
59960
+ ${indentation} input = ${source}
59961
+ ${indentation} IMPORTING
59954
59962
  ${indentation} output = ${uniqueName}.\n`;
59955
59963
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
59956
59964
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -61262,12 +61270,12 @@ class EasyToFindMessages {
61262
61270
  key: "easy_to_find_messages",
61263
61271
  title: "Easy to find messages",
61264
61272
  shortDescription: `Make messages easy to find`,
61265
- extendedInformation: `All messages must be statically referenced exactly once
61266
-
61267
- Only MESSAGE and RAISE statments are counted as static references
61268
-
61269
- Also see rule "message_exists"
61270
-
61273
+ extendedInformation: `All messages must be statically referenced exactly once
61274
+
61275
+ Only MESSAGE and RAISE statments are counted as static references
61276
+
61277
+ Also see rule "message_exists"
61278
+
61271
61279
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
61272
61280
  tags: [_irule_1.RuleTag.Styleguide],
61273
61281
  };
@@ -61348,13 +61356,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
61348
61356
  shortDescription: `Empty selection screen or list processing event block`,
61349
61357
  extendedInformation: ``,
61350
61358
  tags: [_irule_1.RuleTag.SingleFile],
61351
- badExample: `
61352
- INITIALIZATION.
61353
- WRITE 'hello'.
61359
+ badExample: `
61360
+ INITIALIZATION.
61361
+ WRITE 'hello'.
61354
61362
  END-OF-SELECTION.`,
61355
- goodExample: `
61356
- START-OF-SELECTION.
61357
- PERFORM sdf.
61363
+ goodExample: `
61364
+ START-OF-SELECTION.
61365
+ PERFORM sdf.
61358
61366
  COMMIT WORK.`,
61359
61367
  };
61360
61368
  }
@@ -61446,8 +61454,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61446
61454
  key: "empty_line_in_statement",
61447
61455
  title: "Find empty lines in statements",
61448
61456
  shortDescription: `Checks that statements do not contain empty lines.`,
61449
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61450
-
61457
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61458
+
61451
61459
  https://docs.abapopenchecks.org/checks/41/`,
61452
61460
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61453
61461
  badExample: `WRITE\n\nhello.`,
@@ -61623,13 +61631,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61623
61631
  shortDescription: `Checks that the code does not contain empty blocks.`,
61624
61632
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61625
61633
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61626
- badExample: `IF foo = bar.
61627
- ENDIF.
61628
-
61629
- DO 2 TIMES.
61634
+ badExample: `IF foo = bar.
61635
+ ENDIF.
61636
+
61637
+ DO 2 TIMES.
61630
61638
  ENDDO.`,
61631
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61632
- ENDLOOP.
61639
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61640
+ ENDLOOP.
61633
61641
  result = xsdbool( sy-subrc = 0 ).`,
61634
61642
  };
61635
61643
  }
@@ -61771,10 +61779,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61771
61779
  return {
61772
61780
  key: "exit_or_check",
61773
61781
  title: "Find EXIT or CHECK outside loops",
61774
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61782
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61775
61783
  Use RETURN to leave procesing blocks instead.`,
61776
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61777
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61784
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61785
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61778
61786
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61779
61787
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61780
61788
  };
@@ -61857,12 +61865,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61857
61865
  key: "expand_macros",
61858
61866
  title: "Expand Macros",
61859
61867
  shortDescription: `Allows expanding macro calls with quick fixes`,
61860
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61861
-
61868
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61869
+
61862
61870
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61863
- badExample: `DEFINE _hello.
61864
- WRITE 'hello'.
61865
- END-OF-DEFINITION.
61871
+ badExample: `DEFINE _hello.
61872
+ WRITE 'hello'.
61873
+ END-OF-DEFINITION.
61866
61874
  _hello.`,
61867
61875
  goodExample: `WRITE 'hello'.`,
61868
61876
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -61949,7 +61957,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
61949
61957
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
61950
61958
  badExample: `call_method( EXPORTING foo = bar ).`,
61951
61959
  goodExample: `call_method( foo = bar ).`,
61952
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61960
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
61953
61961
  https://docs.abapopenchecks.org/checks/30/`,
61954
61962
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61955
61963
  };
@@ -62047,7 +62055,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
62047
62055
  key: "forbidden_identifier",
62048
62056
  title: "Forbidden Identifier",
62049
62057
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
62050
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
62058
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
62051
62059
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
62052
62060
  tags: [_irule_1.RuleTag.SingleFile],
62053
62061
  };
@@ -62289,8 +62297,8 @@ class ForbiddenVoidType {
62289
62297
  key: "forbidden_void_type",
62290
62298
  title: "Forbidden Void Types",
62291
62299
  shortDescription: `Avoid usage of specified void types.`,
62292
- extendedInformation: `Inspiration:
62293
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62300
+ extendedInformation: `Inspiration:
62301
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62294
62302
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
62295
62303
  };
62296
62304
  }
@@ -62533,9 +62541,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62533
62541
  key: "fully_type_itabs",
62534
62542
  title: "Fully type internal tables",
62535
62543
  shortDescription: `No implict table types or table keys`,
62536
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62544
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62537
62545
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
62538
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62546
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62539
62547
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62540
62548
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62541
62549
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62720,26 +62728,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62720
62728
  key: "functional_writing",
62721
62729
  title: "Use functional writing",
62722
62730
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62723
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62731
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62724
62732
  https://docs.abapopenchecks.org/checks/07/`,
62725
62733
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62726
- badExample: `CALL METHOD zcl_class=>method( ).
62727
- CALL METHOD cl_abap_typedescr=>describe_by_name
62728
- EXPORTING
62729
- p_name = 'NAME'
62730
- RECEIVING
62731
- p_descr_ref = lr_typedescr
62732
- EXCEPTIONS
62733
- type_not_found = 1
62734
+ badExample: `CALL METHOD zcl_class=>method( ).
62735
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62736
+ EXPORTING
62737
+ p_name = 'NAME'
62738
+ RECEIVING
62739
+ p_descr_ref = lr_typedescr
62740
+ EXCEPTIONS
62741
+ type_not_found = 1
62734
62742
  OTHERS = 2.`,
62735
- goodExample: `zcl_class=>method( ).
62736
- cl_abap_typedescr=>describe_by_name(
62737
- EXPORTING
62738
- p_name = 'NAME'
62739
- RECEIVING
62740
- p_descr_ref = lr_typedescr
62741
- EXCEPTIONS
62742
- type_not_found = 1
62743
+ goodExample: `zcl_class=>method( ).
62744
+ cl_abap_typedescr=>describe_by_name(
62745
+ EXPORTING
62746
+ p_name = 'NAME'
62747
+ RECEIVING
62748
+ p_descr_ref = lr_typedescr
62749
+ EXCEPTIONS
62750
+ type_not_found = 1
62743
62751
  OTHERS = 2 ).`,
62744
62752
  };
62745
62753
  }
@@ -62850,14 +62858,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62850
62858
  key: "global_class",
62851
62859
  title: "Global class checks",
62852
62860
  shortDescription: `Checks related to global classes`,
62853
- extendedInformation: `* global classes must be in own files
62854
-
62855
- * file names must match class name
62856
-
62857
- * file names must match interface name
62858
-
62859
- * global classes must be global definitions
62860
-
62861
+ extendedInformation: `* global classes must be in own files
62862
+
62863
+ * file names must match class name
62864
+
62865
+ * file names must match interface name
62866
+
62867
+ * global classes must be global definitions
62868
+
62861
62869
  * global interfaces must be global definitions`,
62862
62870
  tags: [_irule_1.RuleTag.Syntax],
62863
62871
  };
@@ -62956,21 +62964,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
62956
62964
  return {
62957
62965
  key: "identical_conditions",
62958
62966
  title: "Identical conditions",
62959
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62960
-
62967
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
62968
+
62961
62969
  Prerequsites: code is pretty printed with identical cAsE`,
62962
62970
  tags: [_irule_1.RuleTag.SingleFile],
62963
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
62964
- ENDIF.
62965
- CASE bar.
62966
- WHEN '1'.
62967
- WHEN 'A' OR '1'.
62971
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
62972
+ ENDIF.
62973
+ CASE bar.
62974
+ WHEN '1'.
62975
+ WHEN 'A' OR '1'.
62968
62976
  ENDCASE.`,
62969
- goodExample: `IF foo = bar OR 1 = a.
62970
- ENDIF.
62971
- CASE bar.
62972
- WHEN '1'.
62973
- WHEN 'A'.
62977
+ goodExample: `IF foo = bar OR 1 = a.
62978
+ ENDIF.
62979
+ CASE bar.
62980
+ WHEN '1'.
62981
+ WHEN 'A'.
62974
62982
  ENDCASE.`,
62975
62983
  };
62976
62984
  }
@@ -63104,23 +63112,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
63104
63112
  key: "identical_contents",
63105
63113
  title: "Identical contents",
63106
63114
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
63107
- extendedInformation: `
63108
- Prerequsites: code is pretty printed with identical cAsE
63109
-
63115
+ extendedInformation: `
63116
+ Prerequsites: code is pretty printed with identical cAsE
63117
+
63110
63118
  Chained statments are ignored`,
63111
63119
  tags: [_irule_1.RuleTag.SingleFile],
63112
- badExample: `IF foo = bar.
63113
- WRITE 'bar'.
63114
- WRITE 'world'.
63115
- ELSE.
63116
- WRITE 'foo'.
63117
- WRITE 'world'.
63120
+ badExample: `IF foo = bar.
63121
+ WRITE 'bar'.
63122
+ WRITE 'world'.
63123
+ ELSE.
63124
+ WRITE 'foo'.
63125
+ WRITE 'world'.
63118
63126
  ENDIF.`,
63119
- goodExample: `IF foo = bar.
63120
- WRITE 'bar'.
63121
- ELSE.
63122
- WRITE 'foo'.
63123
- ENDIF.
63127
+ goodExample: `IF foo = bar.
63128
+ WRITE 'bar'.
63129
+ ELSE.
63130
+ WRITE 'foo'.
63131
+ ENDIF.
63124
63132
  WRITE 'world'.`,
63125
63133
  };
63126
63134
  }
@@ -63228,12 +63236,12 @@ class IdenticalDescriptions {
63228
63236
  key: "identical_descriptions",
63229
63237
  title: "Identical descriptions",
63230
63238
  shortDescription: `Searches for objects with the same type and same description`,
63231
- extendedInformation: `Case insensitive
63232
-
63233
- Only checks the master language descriptions
63234
-
63235
- Dependencies are skipped
63236
-
63239
+ extendedInformation: `Case insensitive
63240
+
63241
+ Only checks the master language descriptions
63242
+
63243
+ Dependencies are skipped
63244
+
63237
63245
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
63238
63246
  tags: [],
63239
63247
  };
@@ -63407,43 +63415,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63407
63415
  key: "if_in_if",
63408
63416
  title: "IF in IF",
63409
63417
  shortDescription: `Detects nested ifs which can be refactored.`,
63410
- extendedInformation: `
63411
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
63412
-
63413
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63414
-
63415
- https://docs.abapopenchecks.org/checks/01/
63418
+ extendedInformation: `
63419
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63420
+
63421
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63422
+
63423
+ https://docs.abapopenchecks.org/checks/01/
63416
63424
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
63417
- badExample: `IF condition1.
63418
- IF condition2.
63419
- ...
63420
- ENDIF.
63421
- ENDIF.
63422
-
63423
- IF condition1.
63424
- ...
63425
- ELSE.
63426
- IF condition2.
63427
- ...
63428
- ENDIF.
63425
+ badExample: `IF condition1.
63426
+ IF condition2.
63427
+ ...
63428
+ ENDIF.
63429
+ ENDIF.
63430
+
63431
+ IF condition1.
63432
+ ...
63433
+ ELSE.
63434
+ IF condition2.
63435
+ ...
63436
+ ENDIF.
63429
63437
  ENDIF.`,
63430
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63431
- ...
63432
- ENDIF.
63433
-
63434
- IF condition1.
63435
- ...
63436
- ELSEIF condition2.
63437
- ...
63438
- ENDIF.
63439
-
63440
- CASE variable.
63441
- WHEN value1.
63442
- ...
63443
- WHEN value2.
63444
- IF condition2.
63445
- ...
63446
- ENDIF.
63438
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63439
+ ...
63440
+ ENDIF.
63441
+
63442
+ IF condition1.
63443
+ ...
63444
+ ELSEIF condition2.
63445
+ ...
63446
+ ENDIF.
63447
+
63448
+ CASE variable.
63449
+ WHEN value1.
63450
+ ...
63451
+ WHEN value2.
63452
+ IF condition2.
63453
+ ...
63454
+ ENDIF.
63447
63455
  ENDCASE.`,
63448
63456
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63449
63457
  };
@@ -63628,9 +63636,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63628
63636
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63629
63637
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63630
63638
  if (name === impl.identifier.getName().toUpperCase()) {
63631
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63632
- METHOD ${methodName.toLowerCase()}.
63633
- RETURN. " todo, implement method
63639
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63640
+ METHOD ${methodName.toLowerCase()}.
63641
+ RETURN. " todo, implement method
63634
63642
  ENDMETHOD.`);
63635
63643
  }
63636
63644
  }
@@ -63809,14 +63817,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63809
63817
  key: "implicit_start_of_selection",
63810
63818
  title: "Implicit START-OF-SELECTION",
63811
63819
  shortDescription: `Add explicit selection screen event handling`,
63812
- extendedInformation: `Only runs for executable programs
63813
-
63820
+ extendedInformation: `Only runs for executable programs
63821
+
63814
63822
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63815
63823
  tags: [_irule_1.RuleTag.SingleFile],
63816
- badExample: `REPORT zfoo.
63824
+ badExample: `REPORT zfoo.
63817
63825
  WRITE 'hello'.`,
63818
- goodExample: `
63819
- START-OF-SELECTION.
63826
+ goodExample: `
63827
+ START-OF-SELECTION.
63820
63828
  WRITE 'hello'.`,
63821
63829
  };
63822
63830
  }
@@ -63921,19 +63929,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
63921
63929
  key: "in_statement_indentation",
63922
63930
  title: "In-statement indentation",
63923
63931
  shortDescription: "Checks alignment within statements which span multiple lines.",
63924
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
63925
-
63926
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63932
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
63933
+
63934
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
63927
63935
  to distinguish them better from code within the block.`,
63928
- badExample: `IF 1 = 1
63929
- AND 2 = 2.
63930
- WRITE 'hello' &&
63931
- 'world'.
63936
+ badExample: `IF 1 = 1
63937
+ AND 2 = 2.
63938
+ WRITE 'hello' &&
63939
+ 'world'.
63932
63940
  ENDIF.`,
63933
- goodExample: `IF 1 = 1
63934
- AND 2 = 2.
63935
- WRITE 'hello' &&
63936
- 'world'.
63941
+ goodExample: `IF 1 = 1
63942
+ AND 2 = 2.
63943
+ WRITE 'hello' &&
63944
+ 'world'.
63937
63945
  ENDIF.`,
63938
63946
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63939
63947
  };
@@ -64056,23 +64064,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
64056
64064
  title: "Indentation",
64057
64065
  shortDescription: `Checks indentation`,
64058
64066
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64059
- badExample: `CLASS lcl DEFINITION.
64060
- PRIVATE SECTION.
64061
- METHODS constructor.
64062
- ENDCLASS.
64063
-
64064
- CLASS lcl IMPLEMENTATION.
64065
- METHOD constructor.
64066
- ENDMETHOD.
64067
+ badExample: `CLASS lcl DEFINITION.
64068
+ PRIVATE SECTION.
64069
+ METHODS constructor.
64070
+ ENDCLASS.
64071
+
64072
+ CLASS lcl IMPLEMENTATION.
64073
+ METHOD constructor.
64074
+ ENDMETHOD.
64067
64075
  ENDCLASS.`,
64068
- goodExample: `CLASS lcl DEFINITION.
64069
- PRIVATE SECTION.
64070
- METHODS constructor.
64071
- ENDCLASS.
64072
-
64073
- CLASS lcl IMPLEMENTATION.
64074
- METHOD constructor.
64075
- ENDMETHOD.
64076
+ goodExample: `CLASS lcl DEFINITION.
64077
+ PRIVATE SECTION.
64078
+ METHODS constructor.
64079
+ ENDCLASS.
64080
+
64081
+ CLASS lcl IMPLEMENTATION.
64082
+ METHOD constructor.
64083
+ ENDMETHOD.
64076
64084
  ENDCLASS.`,
64077
64085
  };
64078
64086
  }
@@ -64473,9 +64481,9 @@ class IntfReferencingClas {
64473
64481
  key: "intf_referencing_clas",
64474
64482
  title: "INTF referencing CLAS",
64475
64483
  shortDescription: `Interface contains references to class`,
64476
- extendedInformation: `Only global interfaces are checked.
64477
- Only first level references are checked.
64478
- Exception class references are ignored.
64484
+ extendedInformation: `Only global interfaces are checked.
64485
+ Only first level references are checked.
64486
+ Exception class references are ignored.
64479
64487
  Void references are ignored.`,
64480
64488
  };
64481
64489
  }
@@ -64560,9 +64568,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64560
64568
  title: "Invalid Table Index",
64561
64569
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64562
64570
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64563
- badExample: `DATA(first) = table[ 0 ].
64571
+ badExample: `DATA(first) = table[ 0 ].
64564
64572
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64565
- goodExample: `DATA(first) = table[ 1 ].
64573
+ goodExample: `DATA(first) = table[ 1 ].
64566
64574
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64567
64575
  };
64568
64576
  }
@@ -65163,8 +65171,8 @@ class LineBreakStyle {
65163
65171
  return {
65164
65172
  key: "line_break_style",
65165
65173
  title: "Makes sure line breaks are consistent in the ABAP code",
65166
- shortDescription: `Enforces LF as newlines in ABAP files
65167
-
65174
+ shortDescription: `Enforces LF as newlines in ABAP files
65175
+
65168
65176
  abapGit does not work with CRLF`,
65169
65177
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
65170
65178
  };
@@ -65233,7 +65241,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
65233
65241
  key: "line_length",
65234
65242
  title: "Line length",
65235
65243
  shortDescription: `Detects lines exceeding the provided maximum length.`,
65236
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65244
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65237
65245
  https://docs.abapopenchecks.org/checks/04/`,
65238
65246
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65239
65247
  };
@@ -65304,7 +65312,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
65304
65312
  key: "line_only_punc",
65305
65313
  title: "Line containing only punctuation",
65306
65314
  shortDescription: `Detects lines containing only punctuation.`,
65307
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65315
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65308
65316
  https://docs.abapopenchecks.org/checks/16/`,
65309
65317
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65310
65318
  badExample: "zcl_class=>method(\n).",
@@ -65567,15 +65575,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65567
65575
  return {
65568
65576
  key: "local_variable_names",
65569
65577
  title: "Local variable naming conventions",
65570
- shortDescription: `
65571
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65578
+ shortDescription: `
65579
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65572
65580
  Regexes are case-insensitive.`,
65573
65581
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65574
- badExample: `FORM bar.
65575
- DATA foo.
65582
+ badExample: `FORM bar.
65583
+ DATA foo.
65576
65584
  ENDFORM.`,
65577
- goodExample: `FORM bar.
65578
- DATA lv_foo.
65585
+ goodExample: `FORM bar.
65586
+ DATA lv_foo.
65579
65587
  ENDFORM.`,
65580
65588
  };
65581
65589
  }
@@ -65727,9 +65735,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65727
65735
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65728
65736
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65729
65737
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65730
- badExample: `DEFINE something.
65738
+ badExample: `DEFINE something.
65731
65739
  END-OF-DEFINITION.`,
65732
- goodExample: `DEFINE _something.
65740
+ goodExample: `DEFINE _something.
65733
65741
  END-OF-DEFINITION.`,
65734
65742
  };
65735
65743
  }
@@ -65802,10 +65810,10 @@ class MainFileContents {
65802
65810
  key: "main_file_contents",
65803
65811
  title: "Main file contents",
65804
65812
  shortDescription: `Checks related to report declarations.`,
65805
- extendedInformation: `Does not run if the target version is Cloud
65806
-
65807
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65808
- * TYPEs must begin with "TYPE-POOL <name>."
65813
+ extendedInformation: `Does not run if the target version is Cloud
65814
+
65815
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65816
+ * TYPEs must begin with "TYPE-POOL <name>."
65809
65817
  `,
65810
65818
  };
65811
65819
  }
@@ -65921,17 +65929,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
65921
65929
  title: "Too many parentheses",
65922
65930
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
65923
65931
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
65924
- badExample: `
65925
- IF ( destination IS INITIAL ).
65926
- ENDIF.
65927
- IF foo = boo AND ( bar = lar AND moo = loo ).
65928
- ENDIF.
65932
+ badExample: `
65933
+ IF ( destination IS INITIAL ).
65934
+ ENDIF.
65935
+ IF foo = boo AND ( bar = lar AND moo = loo ).
65936
+ ENDIF.
65929
65937
  `,
65930
- goodExample: `
65931
- IF destination IS INITIAL.
65932
- ENDIF.
65933
- IF foo = boo AND bar = lar AND moo = loo.
65934
- ENDIF.
65938
+ goodExample: `
65939
+ IF destination IS INITIAL.
65940
+ ENDIF.
65941
+ IF foo = boo AND bar = lar AND moo = loo.
65942
+ ENDIF.
65935
65943
  `,
65936
65944
  };
65937
65945
  }
@@ -66105,14 +66113,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
66105
66113
  title: "Max one method parameter definition per line",
66106
66114
  shortDescription: `Keep max one method parameter description per line`,
66107
66115
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
66108
- badExample: `
66109
- METHODS apps_scope_token
66110
- IMPORTING
66116
+ badExample: `
66117
+ METHODS apps_scope_token
66118
+ IMPORTING
66111
66119
  body TYPE bodyapps_scope_token client_id TYPE str.`,
66112
- goodExample: `
66113
- METHODS apps_scope_token
66114
- IMPORTING
66115
- body TYPE bodyapps_scope_token
66120
+ goodExample: `
66121
+ METHODS apps_scope_token
66122
+ IMPORTING
66123
+ body TYPE bodyapps_scope_token
66116
66124
  client_id TYPE str.`,
66117
66125
  };
66118
66126
  }
@@ -66177,11 +66185,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
66177
66185
  key: "max_one_statement",
66178
66186
  title: "Max one statement per line",
66179
66187
  shortDescription: `Checks that each line contains only a single statement.`,
66180
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66181
-
66182
- Does not report anything for chained statements.
66183
-
66184
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66188
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66189
+
66190
+ Does not report anything for chained statements.
66191
+
66192
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66185
66193
  https://docs.abapopenchecks.org/checks/11/`,
66186
66194
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66187
66195
  badExample: `WRITE foo. WRITE bar.`,
@@ -66519,8 +66527,8 @@ class MethodLength {
66519
66527
  key: "method_length",
66520
66528
  title: "Method/Form Length",
66521
66529
  shortDescription: `Checks relating to method/form length.`,
66522
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66523
-
66530
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66531
+
66524
66532
  Abstract methods without statements are considered okay.`,
66525
66533
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66526
66534
  };
@@ -66625,20 +66633,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66625
66633
  key: "method_overwrites_builtin",
66626
66634
  title: "Method name overwrites builtin function",
66627
66635
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66628
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66629
-
66630
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66631
-
66636
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66637
+
66638
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66639
+
66632
66640
  Interface method names are ignored`,
66633
66641
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66634
- badExample: `CLASS lcl DEFINITION.
66635
- PUBLIC SECTION.
66636
- METHODS matches.
66637
- ENDCLASS.
66638
-
66639
- CLASS lcl IMPLEMENTATION.
66640
- METHOD matches.
66641
- ENDMETHOD.
66642
+ badExample: `CLASS lcl DEFINITION.
66643
+ PUBLIC SECTION.
66644
+ METHODS matches.
66645
+ ENDCLASS.
66646
+
66647
+ CLASS lcl IMPLEMENTATION.
66648
+ METHOD matches.
66649
+ ENDMETHOD.
66642
66650
  ENDCLASS.`,
66643
66651
  };
66644
66652
  }
@@ -66829,12 +66837,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66829
66837
  // eslint-disable-next-line max-len
66830
66838
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66831
66839
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66832
- badExample: `CLASS lcl DEFINITION.
66833
- PUBLIC SECTION.
66834
- METHODS
66835
- foobar
66836
- EXPORTING foo TYPE i
66837
- RETURNING VALUE(rv_string) TYPE string.
66840
+ badExample: `CLASS lcl DEFINITION.
66841
+ PUBLIC SECTION.
66842
+ METHODS
66843
+ foobar
66844
+ EXPORTING foo TYPE i
66845
+ RETURNING VALUE(rv_string) TYPE string.
66838
66846
  ENDCLASS.`,
66839
66847
  };
66840
66848
  }
@@ -67214,7 +67222,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
67214
67222
  key: "nesting",
67215
67223
  title: "Check nesting depth",
67216
67224
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
67217
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67225
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67218
67226
  https://docs.abapopenchecks.org/checks/74/`,
67219
67227
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67220
67228
  };
@@ -67457,7 +67465,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67457
67465
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67458
67466
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67459
67467
  badExample: `var1 = var2 = var3.`,
67460
- goodExample: `var2 = var3.
67468
+ goodExample: `var2 = var3.
67461
67469
  var1 = var2.`,
67462
67470
  };
67463
67471
  }
@@ -67516,8 +67524,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67516
67524
  key: "no_external_form_calls",
67517
67525
  title: "No external FORM calls",
67518
67526
  shortDescription: `Detect external form calls`,
67519
- badExample: `PERFORM foo IN PROGRAM bar.
67520
-
67527
+ badExample: `PERFORM foo IN PROGRAM bar.
67528
+
67521
67529
  PERFORM foo(bar).`,
67522
67530
  tags: [_irule_1.RuleTag.SingleFile],
67523
67531
  };
@@ -67578,17 +67586,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67578
67586
  key: "no_inline_in_optional_branches",
67579
67587
  title: "Don't declare inline in optional branches",
67580
67588
  shortDescription: `Don't declare inline in optional branches`,
67581
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67582
-
67583
- Considered optional branches:
67584
- * inside IF/ELSEIF/ELSE
67585
- * inside LOOP
67586
- * inside WHILE
67587
- * inside CASE/WHEN, CASE TYPE OF
67588
- * inside DO
67589
- * inside SELECT loops
67590
-
67591
- Not considered optional branches:
67589
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67590
+
67591
+ Considered optional branches:
67592
+ * inside IF/ELSEIF/ELSE
67593
+ * inside LOOP
67594
+ * inside WHILE
67595
+ * inside CASE/WHEN, CASE TYPE OF
67596
+ * inside DO
67597
+ * inside SELECT loops
67598
+
67599
+ Not considered optional branches:
67592
67600
  * TRY/CATCH/CLEANUP`,
67593
67601
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67594
67602
  };
@@ -67688,12 +67696,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67688
67696
  key: "no_prefixes",
67689
67697
  title: "No Prefixes",
67690
67698
  shortDescription: `Dont use hungarian notation`,
67691
- extendedInformation: `
67692
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67693
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67694
-
67695
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67696
-
67699
+ extendedInformation: `
67700
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67701
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67702
+
67703
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67704
+
67697
67705
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67698
67706
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67699
67707
  badExample: `DATA lv_foo TYPE i.`,
@@ -67872,7 +67880,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67872
67880
  return {
67873
67881
  key: "no_public_attributes",
67874
67882
  title: "No public attributes",
67875
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67883
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67876
67884
  Exceptions are excluded from this rule.`,
67877
67885
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67878
67886
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -67973,13 +67981,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
67973
67981
  key: "no_yoda_conditions",
67974
67982
  title: "No Yoda conditions",
67975
67983
  shortDescription: `Finds Yoda conditions and reports issues`,
67976
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67977
-
67984
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
67985
+
67978
67986
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
67979
67987
  tags: [_irule_1.RuleTag.SingleFile],
67980
- badExample: `IF 0 <> sy-subrc.
67988
+ badExample: `IF 0 <> sy-subrc.
67981
67989
  ENDIF.`,
67982
- goodExample: `IF sy-subrc <> 0.
67990
+ goodExample: `IF sy-subrc <> 0.
67983
67991
  ENDIF.`,
67984
67992
  };
67985
67993
  }
@@ -68080,8 +68088,8 @@ class NROBConsistency {
68080
68088
  key: "nrob_consistency",
68081
68089
  title: "Number range consistency",
68082
68090
  shortDescription: `Consistency checks for number ranges`,
68083
- extendedInformation: `Issue reported if percentage warning is over 50%
68084
-
68091
+ extendedInformation: `Issue reported if percentage warning is over 50%
68092
+
68085
68093
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
68086
68094
  tags: [_irule_1.RuleTag.SingleFile],
68087
68095
  };
@@ -68358,58 +68366,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
68358
68366
  title: "Obsolete statements",
68359
68367
  shortDescription: `Checks for usages of certain obsolete statements`,
68360
68368
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68361
- extendedInformation: `
68362
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68363
-
68364
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68365
-
68366
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68367
-
68368
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68369
-
68370
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68371
-
68372
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68373
-
68374
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68375
-
68376
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68377
-
68378
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68379
-
68380
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68381
-
68382
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68383
-
68384
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68385
-
68386
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68387
-
68388
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68389
-
68390
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68391
- SELECT COUNT(*) is considered okay
68392
-
68393
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68394
-
68395
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68396
-
68397
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68398
-
68399
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68400
-
68401
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
68402
-
68369
+ extendedInformation: `
68370
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68371
+
68372
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68373
+
68374
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68375
+
68376
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68377
+
68378
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68379
+
68380
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68381
+
68382
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68383
+
68384
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68385
+
68386
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68387
+
68388
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68389
+
68390
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68391
+
68392
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68393
+
68394
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68395
+
68396
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68397
+
68398
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68399
+ SELECT COUNT(*) is considered okay
68400
+
68401
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68402
+
68403
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68404
+
68405
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68406
+
68407
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68408
+
68409
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68410
+
68403
68411
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
68404
- badExample: `REFRESH itab.
68405
-
68406
- COMPUTE foo = 2 + 2.
68407
-
68408
- MULTIPLY lv_foo BY 2.
68409
-
68410
- INTERFACE intf LOAD.
68411
-
68412
- IF foo IS SUPPLIED.
68412
+ badExample: `REFRESH itab.
68413
+
68414
+ COMPUTE foo = 2 + 2.
68415
+
68416
+ MULTIPLY lv_foo BY 2.
68417
+
68418
+ INTERFACE intf LOAD.
68419
+
68420
+ IF foo IS SUPPLIED.
68413
68421
  ENDIF.`,
68414
68422
  };
68415
68423
  }
@@ -68749,9 +68757,9 @@ class OmitParameterName {
68749
68757
  key: "omit_parameter_name",
68750
68758
  title: "Omit parameter name",
68751
68759
  shortDescription: `Omit the parameter name in single parameter calls`,
68752
- extendedInformation: `
68753
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68754
-
68760
+ extendedInformation: `
68761
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68762
+
68755
68763
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68756
68764
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68757
68765
  badExample: `method( param = 2 ).`,
@@ -68957,20 +68965,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
68957
68965
  shortDescription: `Omit RECEIVING`,
68958
68966
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
68959
68967
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68960
- badExample: `
68961
- upload_pack(
68962
- EXPORTING
68963
- io_client = lo_client
68964
- iv_url = iv_url
68965
- iv_deepen_level = iv_deepen_level
68966
- it_hashes = lt_hashes
68967
- RECEIVING
68968
+ badExample: `
68969
+ upload_pack(
68970
+ EXPORTING
68971
+ io_client = lo_client
68972
+ iv_url = iv_url
68973
+ iv_deepen_level = iv_deepen_level
68974
+ it_hashes = lt_hashes
68975
+ RECEIVING
68968
68976
  rt_objects = et_objects ).`,
68969
- goodExample: `
68970
- et_objects = upload_pack(
68971
- io_client = lo_client
68972
- iv_url = iv_url
68973
- iv_deepen_level = iv_deepen_level
68977
+ goodExample: `
68978
+ et_objects = upload_pack(
68979
+ io_client = lo_client
68980
+ iv_url = iv_url
68981
+ iv_deepen_level = iv_deepen_level
68974
68982
  it_hashes = lt_hashes ).`,
68975
68983
  };
68976
68984
  }
@@ -69034,8 +69042,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
69034
69042
  return {
69035
69043
  key: "parser_702_chaining",
69036
69044
  title: "Parser Error, bad chanining on 702",
69037
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
69038
- this rule finds these and reports errors.
69045
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
69046
+ this rule finds these and reports errors.
69039
69047
  Only active on target version 702 and below.`,
69040
69048
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69041
69049
  };
@@ -69115,8 +69123,8 @@ class ParserError {
69115
69123
  return {
69116
69124
  key: "parser_error",
69117
69125
  title: "Parser error",
69118
- shortDescription: `Checks for syntax not recognized by abaplint.
69119
-
69126
+ shortDescription: `Checks for syntax not recognized by abaplint.
69127
+
69120
69128
  See recognized syntax at https://syntax.abaplint.org`,
69121
69129
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69122
69130
  };
@@ -69201,7 +69209,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
69201
69209
  return {
69202
69210
  key: "parser_missing_space",
69203
69211
  title: "Parser Error, missing space",
69204
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69212
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69205
69213
  This rule makes sure the spaces are consistently required across the language.`,
69206
69214
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
69207
69215
  badExample: `IF ( foo = 'bar').`,
@@ -69624,25 +69632,25 @@ class PreferInline {
69624
69632
  key: "prefer_inline",
69625
69633
  title: "Prefer Inline Declarations",
69626
69634
  shortDescription: `Prefer inline to up-front declarations.`,
69627
- extendedInformation: `EXPERIMENTAL
69628
-
69629
- Activates if language version is v740sp02 or above.
69630
-
69631
- Variables must be local(METHOD or FORM).
69632
-
69633
- No generic or void typed variables. No syntax errors.
69634
-
69635
- First position used must be a full/pure write.
69636
-
69637
- Move statment is not a cast(?=)
69638
-
69635
+ extendedInformation: `EXPERIMENTAL
69636
+
69637
+ Activates if language version is v740sp02 or above.
69638
+
69639
+ Variables must be local(METHOD or FORM).
69640
+
69641
+ No generic or void typed variables. No syntax errors.
69642
+
69643
+ First position used must be a full/pure write.
69644
+
69645
+ Move statment is not a cast(?=)
69646
+
69639
69647
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69640
69648
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69641
- badExample: `DATA foo TYPE i.
69642
- foo = 2.
69643
- DATA percentage TYPE decfloat34.
69649
+ badExample: `DATA foo TYPE i.
69650
+ foo = 2.
69651
+ DATA percentage TYPE decfloat34.
69644
69652
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69645
- goodExample: `DATA(foo) = 2.
69653
+ goodExample: `DATA(foo) = 2.
69646
69654
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69647
69655
  };
69648
69656
  }
@@ -69856,18 +69864,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69856
69864
  key: "prefer_is_not",
69857
69865
  title: "Prefer IS NOT to NOT IS",
69858
69866
  shortDescription: `Prefer IS NOT to NOT IS`,
69859
- extendedInformation: `
69860
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69861
-
69867
+ extendedInformation: `
69868
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69869
+
69862
69870
  "if not is_valid( )." examples are skipped`,
69863
69871
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69864
- goodExample: `IF variable IS NOT INITIAL.
69865
- IF variable NP 'TODO*'.
69866
- IF variable <> 42.
69872
+ goodExample: `IF variable IS NOT INITIAL.
69873
+ IF variable NP 'TODO*'.
69874
+ IF variable <> 42.
69867
69875
  IF variable CO 'hello'.`,
69868
- badExample: `IF NOT variable IS INITIAL.
69869
- IF NOT variable CP 'TODO*'.
69870
- IF NOT variable = 42.
69876
+ badExample: `IF NOT variable IS INITIAL.
69877
+ IF NOT variable CP 'TODO*'.
69878
+ IF NOT variable = 42.
69871
69879
  IF NOT variable CA 'hello'.`,
69872
69880
  };
69873
69881
  }
@@ -70055,14 +70063,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
70055
70063
  key: "prefer_raise_exception_new",
70056
70064
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
70057
70065
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
70058
- extendedInformation: `
70059
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70060
-
70066
+ extendedInformation: `
70067
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70068
+
70061
70069
  From 752 and up`,
70062
70070
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
70063
70071
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
70064
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
70065
- EXPORTING
70072
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
70073
+ EXPORTING
70066
70074
  previous = exception.`,
70067
70075
  };
70068
70076
  }
@@ -70140,12 +70148,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
70140
70148
  key: "prefer_returning_to_exporting",
70141
70149
  title: "Prefer RETURNING to EXPORTING",
70142
70150
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
70143
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70151
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70144
70152
  https://docs.abapopenchecks.org/checks/44/`,
70145
70153
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70146
- badExample: `CLASS lcl DEFINITION.
70147
- PUBLIC SECTION.
70148
- METHODS test EXPORTING ev_foo TYPE i.
70154
+ badExample: `CLASS lcl DEFINITION.
70155
+ PUBLIC SECTION.
70156
+ METHODS test EXPORTING ev_foo TYPE i.
70149
70157
  ENDCLASS.`,
70150
70158
  };
70151
70159
  }
@@ -70241,8 +70249,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
70241
70249
  key: "prefer_xsdbool",
70242
70250
  title: "Prefer xsdbool over boolc",
70243
70251
  shortDescription: `Prefer xsdbool over boolc`,
70244
- extendedInformation: `Activates if language version is v740sp08 or above.
70245
-
70252
+ extendedInformation: `Activates if language version is v740sp08 or above.
70253
+
70246
70254
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
70247
70255
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70248
70256
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -70314,9 +70322,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
70314
70322
  title: "Preferred compare operator",
70315
70323
  shortDescription: `Configure undesired operator variants`,
70316
70324
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70317
- badExample: `IF foo EQ bar.
70325
+ badExample: `IF foo EQ bar.
70318
70326
  ENDIF.`,
70319
- goodExample: `IF foo = bar.
70327
+ goodExample: `IF foo = bar.
70320
70328
  ENDIF.`,
70321
70329
  };
70322
70330
  }
@@ -70540,26 +70548,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70540
70548
  key: "reduce_procedural_code",
70541
70549
  title: "Reduce procedural code",
70542
70550
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70543
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70544
-
70545
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70546
-
70551
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70552
+
70553
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70554
+
70547
70555
  Comments are not counted as statements.`,
70548
70556
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70549
- badExample: `FORM foo.
70550
- DATA lv_bar TYPE i.
70551
- lv_bar = 2 + 2.
70552
- IF lv_bar = 4.
70553
- WRITE 'hello world'.
70554
- ENDIF.
70555
- DATA lv_bar TYPE i.
70556
- lv_bar = 2 + 2.
70557
- IF lv_bar = 4.
70558
- WRITE 'hello world'.
70559
- ENDIF.
70557
+ badExample: `FORM foo.
70558
+ DATA lv_bar TYPE i.
70559
+ lv_bar = 2 + 2.
70560
+ IF lv_bar = 4.
70561
+ WRITE 'hello world'.
70562
+ ENDIF.
70563
+ DATA lv_bar TYPE i.
70564
+ lv_bar = 2 + 2.
70565
+ IF lv_bar = 4.
70566
+ WRITE 'hello world'.
70567
+ ENDIF.
70560
70568
  ENDFORM.`,
70561
- goodExample: `FORM foo.
70562
- NEW zcl_global_class( )->run_logic( ).
70569
+ goodExample: `FORM foo.
70570
+ NEW zcl_global_class( )->run_logic( ).
70563
70571
  ENDFORM.`,
70564
70572
  };
70565
70573
  }
@@ -70803,10 +70811,10 @@ class RemoveDescriptions {
70803
70811
  return {
70804
70812
  key: "remove_descriptions",
70805
70813
  title: "Remove descriptions",
70806
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70807
-
70808
- Class descriptions are required, see rule description_empty.
70809
-
70814
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70815
+
70816
+ Class descriptions are required, see rule description_empty.
70817
+
70810
70818
  Consider using ABAP Doc for documentation.`,
70811
70819
  tags: [],
70812
70820
  };
@@ -70931,14 +70939,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
70931
70939
  tags: [_irule_1.RuleTag.SingleFile],
70932
70940
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
70933
70941
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
70934
- badExample: `CALL FUNCTION 'ZRFC'
70942
+ badExample: `CALL FUNCTION 'ZRFC'
70935
70943
  DESTINATION lv_rfc.`,
70936
- goodExample: `CALL FUNCTION 'ZRFC'
70937
- DESTINATION lv_rfc
70938
- EXCEPTIONS
70939
- system_failure = 1 MESSAGE msg
70940
- communication_failure = 2 MESSAGE msg
70941
- resource_failure = 3
70944
+ goodExample: `CALL FUNCTION 'ZRFC'
70945
+ DESTINATION lv_rfc
70946
+ EXCEPTIONS
70947
+ system_failure = 1 MESSAGE msg
70948
+ communication_failure = 2 MESSAGE msg
70949
+ resource_failure = 3
70942
70950
  OTHERS = 4.`,
70943
70951
  };
70944
70952
  }
@@ -71022,11 +71030,11 @@ class SelectAddOrderBy {
71022
71030
  key: "select_add_order_by",
71023
71031
  title: "SELECT add ORDER BY",
71024
71032
  shortDescription: `SELECTs add ORDER BY clause`,
71025
- extendedInformation: `
71026
- This will make sure that the SELECT statement returns results in the same sequence on different databases
71027
-
71028
- add ORDER BY PRIMARY KEY if in doubt
71029
-
71033
+ extendedInformation: `
71034
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
71035
+
71036
+ add ORDER BY PRIMARY KEY if in doubt
71037
+
71030
71038
  If the target is a sorted/hashed table, no issue is reported`,
71031
71039
  tags: [_irule_1.RuleTag.SingleFile],
71032
71040
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -71157,14 +71165,14 @@ class SelectPerformance {
71157
71165
  key: "select_performance",
71158
71166
  title: "SELECT performance",
71159
71167
  shortDescription: `Various checks regarding SELECT performance.`,
71160
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71161
-
71168
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71169
+
71162
71170
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
71163
71171
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
71164
- badExample: `SELECT field1, field2 FROM table
71165
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71172
+ badExample: `SELECT field1, field2 FROM table
71173
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71166
71174
  ENDSELECT.`,
71167
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71175
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71168
71176
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
71169
71177
  };
71170
71178
  }
@@ -71278,8 +71286,8 @@ class SelectSingleFullKey {
71278
71286
  key: "select_single_full_key",
71279
71287
  title: "Detect SELECT SINGLE which are possibily not unique",
71280
71288
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
71281
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71282
-
71289
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71290
+
71283
71291
  If the statement contains a JOIN it is not checked`,
71284
71292
  pseudoComment: "EC CI_NOORDER",
71285
71293
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71707,8 +71715,8 @@ class SICFConsistency {
71707
71715
  key: "sicf_consistency",
71708
71716
  title: "SICF consistency",
71709
71717
  shortDescription: `Checks the validity of ICF services`,
71710
- extendedInformation: `* Class defined in handler must exist
71711
- * Class must not have any syntax errors
71718
+ extendedInformation: `* Class defined in handler must exist
71719
+ * Class must not have any syntax errors
71712
71720
  * Class must implement interface IF_HTTP_EXTENSION`,
71713
71721
  };
71714
71722
  }
@@ -71820,23 +71828,23 @@ class SlowParameterPassing {
71820
71828
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71821
71829
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71822
71830
  tags: [_irule_1.RuleTag.Performance],
71823
- badExample: `CLASS lcl DEFINITION.
71824
- PUBLIC SECTION.
71825
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71826
- ENDCLASS.
71827
- CLASS lcl IMPLEMENTATION.
71828
- METHOD bar.
71829
- WRITE sdf.
71830
- ENDMETHOD.
71831
+ badExample: `CLASS lcl DEFINITION.
71832
+ PUBLIC SECTION.
71833
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71834
+ ENDCLASS.
71835
+ CLASS lcl IMPLEMENTATION.
71836
+ METHOD bar.
71837
+ WRITE sdf.
71838
+ ENDMETHOD.
71831
71839
  ENDCLASS.`,
71832
- goodExample: `CLASS lcl DEFINITION.
71833
- PUBLIC SECTION.
71834
- METHODS bar IMPORTING sdf TYPE string.
71835
- ENDCLASS.
71836
- CLASS lcl IMPLEMENTATION.
71837
- METHOD bar.
71838
- WRITE sdf.
71839
- ENDMETHOD.
71840
+ goodExample: `CLASS lcl DEFINITION.
71841
+ PUBLIC SECTION.
71842
+ METHODS bar IMPORTING sdf TYPE string.
71843
+ ENDCLASS.
71844
+ CLASS lcl IMPLEMENTATION.
71845
+ METHOD bar.
71846
+ WRITE sdf.
71847
+ ENDMETHOD.
71840
71848
  ENDCLASS.`,
71841
71849
  };
71842
71850
  }
@@ -72093,8 +72101,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
72093
72101
  key: "space_before_dot",
72094
72102
  title: "Space before dot",
72095
72103
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
72096
- extendedInformation: `
72097
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72104
+ extendedInformation: `
72105
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72098
72106
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
72099
72107
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72100
72108
  badExample: `WRITE bar .`,
@@ -72280,12 +72288,12 @@ class SQLValueConversion {
72280
72288
  key: "sql_value_conversion",
72281
72289
  title: "Implicit SQL Value Conversion",
72282
72290
  shortDescription: `Ensure types match when selecting from database`,
72283
- extendedInformation: `
72284
- * Integer to CHAR conversion
72285
- * Integer to NUMC conversion
72286
- * NUMC to Integer conversion
72287
- * CHAR to Integer conversion
72288
- * Source field longer than database field, CHAR -> CHAR
72291
+ extendedInformation: `
72292
+ * Integer to CHAR conversion
72293
+ * Integer to NUMC conversion
72294
+ * NUMC to Integer conversion
72295
+ * CHAR to Integer conversion
72296
+ * Source field longer than database field, CHAR -> CHAR
72289
72297
  * Source field longer than database field, NUMC -> NUMC`,
72290
72298
  tags: [],
72291
72299
  };
@@ -72357,7 +72365,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
72357
72365
  key: "start_at_tab",
72358
72366
  title: "Start at tab",
72359
72367
  shortDescription: `Checks that statements start at tabstops.`,
72360
- extendedInformation: `Reports max 100 issues per file
72368
+ extendedInformation: `Reports max 100 issues per file
72361
72369
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
72362
72370
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72363
72371
  badExample: ` WRITE a.`,
@@ -72534,12 +72542,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72534
72542
  key: "strict_sql",
72535
72543
  title: "Strict SQL",
72536
72544
  shortDescription: `Strict SQL`,
72537
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72538
-
72539
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72540
-
72541
- Also see separate rule sql_escape_host_variables
72542
-
72545
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72546
+
72547
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72548
+
72549
+ Also see separate rule sql_escape_host_variables
72550
+
72543
72551
  Activates from v750 and up`,
72544
72552
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72545
72553
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72793,11 +72801,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72793
72801
  key: "sy_modification",
72794
72802
  title: "Modification of SY fields",
72795
72803
  shortDescription: `Finds modification of sy fields`,
72796
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72797
-
72804
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72805
+
72798
72806
  Changes to SY-TVAR* fields are not reported`,
72799
72807
  tags: [_irule_1.RuleTag.SingleFile],
72800
- badExample: `sy-uname = 2.
72808
+ badExample: `sy-uname = 2.
72801
72809
  sy = sy.`,
72802
72810
  };
72803
72811
  }
@@ -72859,8 +72867,8 @@ class TABLEnhancementCategory {
72859
72867
  key: "tabl_enhancement_category",
72860
72868
  title: "TABL enhancement category must be set",
72861
72869
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72862
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72863
-
72870
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72871
+
72864
72872
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72865
72873
  tags: [],
72866
72874
  };
@@ -72925,8 +72933,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
72925
72933
  shortDescription: `TABLES are always global, so declare them globally`,
72926
72934
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
72927
72935
  tags: [_irule_1.RuleTag.SingleFile],
72928
- badExample: `FORM foo.
72929
- TABLES t100.
72936
+ badExample: `FORM foo.
72937
+ TABLES t100.
72930
72938
  ENDFORM.`,
72931
72939
  goodExample: `TABLES t000.`,
72932
72940
  };
@@ -73054,9 +73062,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
73054
73062
  title: "Type FORM parameters",
73055
73063
  shortDescription: `Checks for untyped FORM parameters`,
73056
73064
  tags: [_irule_1.RuleTag.SingleFile],
73057
- badExample: `FORM foo USING bar.
73065
+ badExample: `FORM foo USING bar.
73058
73066
  ENDFORM.`,
73059
- goodExample: `FORM foo USING bar TYPE string.
73067
+ goodExample: `FORM foo USING bar TYPE string.
73060
73068
  ENDFORM.`,
73061
73069
  };
73062
73070
  }
@@ -73729,38 +73737,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73729
73737
  key: "unnecessary_pragma",
73730
73738
  title: "Unnecessary Pragma",
73731
73739
  shortDescription: `Finds pragmas which can be removed`,
73732
- extendedInformation: `* NO_HANDLER with handler
73733
-
73734
- * NEEDED without definition
73735
-
73736
- * NO_TEXT without texts
73737
-
73738
- * SUBRC_OK where sy-subrc is checked
73739
-
73740
+ extendedInformation: `* NO_HANDLER with handler
73741
+
73742
+ * NEEDED without definition
73743
+
73744
+ * NO_TEXT without texts
73745
+
73746
+ * SUBRC_OK where sy-subrc is checked
73747
+
73740
73748
  NO_HANDLER inside macros are not checked`,
73741
73749
  tags: [_irule_1.RuleTag.SingleFile],
73742
- badExample: `TRY.
73743
- ...
73744
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73745
- RETURN. " it has a handler
73746
- ENDTRY.
73747
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73748
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73749
- IF sy-subrc <> 0.
73750
+ badExample: `TRY.
73751
+ ...
73752
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73753
+ RETURN. " it has a handler
73754
+ ENDTRY.
73755
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73756
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73757
+ IF sy-subrc <> 0.
73750
73758
  ENDIF.`,
73751
- goodExample: `TRY.
73752
- ...
73753
- CATCH zcx_abapgit_exception.
73754
- RETURN.
73755
- ENDTRY.
73756
- MESSAGE w125(zbar) WITH c_foo INTO message.
73757
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73758
- IF sy-subrc <> 0.
73759
- ENDIF.
73760
-
73761
- DATA: BEGIN OF blah ##NEEDED,
73762
- test1 TYPE string,
73763
- test2 TYPE string,
73759
+ goodExample: `TRY.
73760
+ ...
73761
+ CATCH zcx_abapgit_exception.
73762
+ RETURN.
73763
+ ENDTRY.
73764
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73765
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73766
+ IF sy-subrc <> 0.
73767
+ ENDIF.
73768
+
73769
+ DATA: BEGIN OF blah ##NEEDED,
73770
+ test1 TYPE string,
73771
+ test2 TYPE string,
73764
73772
  END OF blah.`,
73765
73773
  };
73766
73774
  }
@@ -73927,18 +73935,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
73927
73935
  shortDescription: `Finds unnecessary RETURN statements`,
73928
73936
  extendedInformation: `Finds unnecessary RETURN statements`,
73929
73937
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
73930
- badExample: `FORM hello1.
73931
- WRITE 'world'.
73932
- RETURN.
73933
- ENDFORM.
73934
-
73935
- FORM foo.
73936
- IF 1 = 2.
73937
- RETURN.
73938
- ENDIF.
73938
+ badExample: `FORM hello1.
73939
+ WRITE 'world'.
73940
+ RETURN.
73941
+ ENDFORM.
73942
+
73943
+ FORM foo.
73944
+ IF 1 = 2.
73945
+ RETURN.
73946
+ ENDIF.
73939
73947
  ENDFORM.`,
73940
- goodExample: `FORM hello2.
73941
- WRITE 'world'.
73948
+ goodExample: `FORM hello2.
73949
+ WRITE 'world'.
73942
73950
  ENDFORM.`,
73943
73951
  };
73944
73952
  }
@@ -74289,13 +74297,13 @@ class UnusedMacros {
74289
74297
  title: "Unused macros",
74290
74298
  shortDescription: `Checks for unused macro definitions definitions`,
74291
74299
  tags: [_irule_1.RuleTag.Quickfix],
74292
- badExample: `DEFINE foobar1.
74293
- WRITE 'hello'.
74300
+ badExample: `DEFINE foobar1.
74301
+ WRITE 'hello'.
74294
74302
  END-OF-DEFINITION.`,
74295
- goodExample: `DEFINE foobar2.
74296
- WRITE 'hello'.
74297
- END-OF-DEFINITION.
74298
-
74303
+ goodExample: `DEFINE foobar2.
74304
+ WRITE 'hello'.
74305
+ END-OF-DEFINITION.
74306
+
74299
74307
  foobar2.`,
74300
74308
  };
74301
74309
  }
@@ -74407,18 +74415,18 @@ class UnusedMethods {
74407
74415
  key: "unused_methods",
74408
74416
  title: "Unused methods",
74409
74417
  shortDescription: `Checks for unused methods`,
74410
- extendedInformation: `Checks private and protected methods.
74411
-
74412
- Unused methods are not reported if the object contains parser or syntax errors.
74413
- Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74414
-
74415
- Skips:
74416
- * methods FOR TESTING
74417
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74418
- * class_constructor + constructor methods
74419
- * event handlers
74420
- * methods that are redefined
74421
- * INCLUDEs
74418
+ extendedInformation: `Checks private and protected methods.
74419
+
74420
+ Unused methods are not reported if the object contains parser or syntax errors.
74421
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74422
+
74423
+ Skips:
74424
+ * methods FOR TESTING
74425
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74426
+ * class_constructor + constructor methods
74427
+ * event handlers
74428
+ * methods that are redefined
74429
+ * INCLUDEs
74422
74430
  `,
74423
74431
  tags: [_irule_1.RuleTag.Quickfix],
74424
74432
  pragma: "##CALLED",
@@ -74894,23 +74902,23 @@ class UnusedVariables {
74894
74902
  key: "unused_variables",
74895
74903
  title: "Unused variables",
74896
74904
  shortDescription: `Checks for unused variables and constants`,
74897
- extendedInformation: `Skips event parameters.
74898
-
74899
- Note that this currently does not work if the source code uses macros.
74900
-
74901
- Unused variables are not reported if the object contains parser or syntax errors.
74902
-
74905
+ extendedInformation: `Skips event parameters.
74906
+
74907
+ Note that this currently does not work if the source code uses macros.
74908
+
74909
+ Unused variables are not reported if the object contains parser or syntax errors.
74910
+
74903
74911
  Errors found in INCLUDES are reported for the main program.`,
74904
74912
  tags: [_irule_1.RuleTag.Quickfix],
74905
74913
  pragma: "##NEEDED",
74906
74914
  pseudoComment: "EC NEEDED",
74907
- badExample: `DATA: BEGIN OF blah1,
74908
- test TYPE string,
74909
- test2 TYPE string,
74915
+ badExample: `DATA: BEGIN OF blah1,
74916
+ test TYPE string,
74917
+ test2 TYPE string,
74910
74918
  END OF blah1.`,
74911
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74912
- test TYPE string,
74913
- test2 TYPE string,
74919
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
74920
+ test TYPE string,
74921
+ test2 TYPE string,
74914
74922
  END OF blah2.`,
74915
74923
  };
74916
74924
  }
@@ -75129,15 +75137,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
75129
75137
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
75130
75138
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
75131
75139
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
75132
- badExample: `IF line IS INITIAL.
75133
- has_entries = abap_false.
75134
- ELSE.
75135
- has_entries = abap_true.
75136
- ENDIF.
75137
-
75140
+ badExample: `IF line IS INITIAL.
75141
+ has_entries = abap_false.
75142
+ ELSE.
75143
+ has_entries = abap_true.
75144
+ ENDIF.
75145
+
75138
75146
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
75139
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75140
-
75147
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75148
+
75141
75149
  DATA(fsdf) = xsdbool( foo <> bar ).`,
75142
75150
  };
75143
75151
  }
@@ -75255,15 +75263,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
75255
75263
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
75256
75264
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
75257
75265
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75258
- badExample: `INTERFACE lif.
75259
- METHODS load_data
75260
- EXCEPTIONS
75261
- invalid_parameter.
75266
+ badExample: `INTERFACE lif.
75267
+ METHODS load_data
75268
+ EXCEPTIONS
75269
+ invalid_parameter.
75262
75270
  ENDINTERFACE.`,
75263
- goodExample: `INTERFACE lif.
75264
- METHODS load_data
75265
- RAISING
75266
- cx_something.
75271
+ goodExample: `INTERFACE lif.
75272
+ METHODS load_data
75273
+ RAISING
75274
+ cx_something.
75267
75275
  ENDINTERFACE.`,
75268
75276
  };
75269
75277
  }
@@ -75323,15 +75331,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
75323
75331
  key: "use_line_exists",
75324
75332
  title: "Use line_exists",
75325
75333
  shortDescription: `Use line_exists, from 740sp02 and up`,
75326
- extendedInformation: `
75327
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75328
-
75334
+ extendedInformation: `
75335
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75336
+
75329
75337
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
75330
75338
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75331
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75332
- IF sy-subrc = 0.
75339
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75340
+ IF sy-subrc = 0.
75333
75341
  ENDIF.`,
75334
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75342
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75335
75343
  ENDIF.`,
75336
75344
  };
75337
75345
  }
@@ -75441,10 +75449,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75441
75449
  key: "use_new",
75442
75450
  title: "Use NEW",
75443
75451
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
75444
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75445
-
75446
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75447
-
75452
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75453
+
75454
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75455
+
75448
75456
  Applicable from v740sp02 and up`,
75449
75457
  badExample: `CREATE OBJECT ref.`,
75450
75458
  goodExample: `ref = NEW #( ).`,
@@ -75542,13 +75550,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75542
75550
  title: "WHEN OTHERS last",
75543
75551
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75544
75552
  tags: [_irule_1.RuleTag.SingleFile],
75545
- badExample: `CASE bar.
75546
- WHEN OTHERS.
75547
- WHEN 2.
75553
+ badExample: `CASE bar.
75554
+ WHEN OTHERS.
75555
+ WHEN 2.
75548
75556
  ENDCASE.`,
75549
- goodExample: `CASE bar.
75550
- WHEN 2.
75551
- WHEN OTHERS.
75557
+ goodExample: `CASE bar.
75558
+ WHEN 2.
75559
+ WHEN OTHERS.
75552
75560
  ENDCASE.`,
75553
75561
  };
75554
75562
  }