@abaplint/cli 2.110.2 → 2.110.4

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 +821 -816
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -7921,9 +7921,10 @@ class SQLCase extends combi_1.Expression {
7921
7921
  getRunnable() {
7922
7922
  const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
7923
7923
  const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
7924
- const when = (0, combi_1.seq)("WHEN", (0, combi_1.alt)(constant_1.Constant, sql_cond_1.SQLCond), "THEN", (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource), (0, combi_1.starPrio)(sub));
7925
- const els = (0, combi_1.seq)("ELSE", sql_source_1.SQLSource);
7926
- return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.plus)(when), (0, combi_1.optPrio)(els), "END"));
7924
+ const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource);
7925
+ const when = (0, combi_1.seq)("WHEN", (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant), "THEN", sourc, (0, combi_1.starPrio)(sub));
7926
+ const els = (0, combi_1.seq)("ELSE", sourc);
7927
+ return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"));
7927
7928
  }
7928
7929
  }
7929
7930
  exports.SQLCase = SQLCase;
@@ -8317,21 +8318,22 @@ const sql_aggregation_1 = __webpack_require__(/*! ./sql_aggregation */ "./node_m
8317
8318
  class SQLFunction extends combi_1.Expression {
8318
8319
  getRunnable() {
8319
8320
  const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
8320
- const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.alt)(simple_source3_1.SimpleSource3, paren)));
8321
- const param = (0, combi_1.alt)(sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, SQLFunction, constant_1.Constant, sql_aggregation_1.SQLAggregation, at);
8321
+ const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, paren)));
8322
+ const param = (0, combi_1.altPrio)(SQLFunction, sql_aggregation_1.SQLAggregation, sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, constant_1.Constant, at);
8322
8323
  const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), "FLTP", "NUMC", "INT8");
8324
+ const commaParam = (0, combi_1.seq)(",", param);
8323
8325
  const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("abs", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8324
8326
  const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("cast", (0, combi_1.tok)(tokens_1.ParenLeftW), param, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
8325
8327
  const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("ceil", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8326
- const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("coalesce", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8327
- const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("concat", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8328
- const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("div", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8328
+ const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("coalesce", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.optPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
8329
+ const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("concat", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
8330
+ const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("div", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
8329
8331
  const floor = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("floor", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8330
8332
  const length = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("length", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8331
8333
  const lower = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("lower", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8332
- const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8333
- const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8334
- const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param, ",", param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8334
+ const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
8335
+ const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
8336
+ const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
8335
8337
  const upper = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("upper", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
8336
8338
  const uuid = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("uuid", (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)));
8337
8339
  return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round);
@@ -34466,13 +34468,13 @@ class FlowGraph {
34466
34468
  this.label = label;
34467
34469
  }
34468
34470
  toDigraph() {
34469
- return `digraph G {
34470
- labelloc="t";
34471
- label="${this.label}";
34472
- graph [fontname = "helvetica"];
34473
- node [fontname = "helvetica", shape="box"];
34474
- edge [fontname = "helvetica"];
34475
- ${this.toTextEdges()}
34471
+ return `digraph G {
34472
+ labelloc="t";
34473
+ label="${this.label}";
34474
+ graph [fontname = "helvetica"];
34475
+ node [fontname = "helvetica", shape="box"];
34476
+ edge [fontname = "helvetica"];
34477
+ ${this.toTextEdges()}
34476
34478
  }`;
34477
34479
  }
34478
34480
  listSources(node) {
@@ -41347,8 +41349,8 @@ exports.MemoryFile = MemoryFile;
41347
41349
  "use strict";
41348
41350
 
41349
41351
  Object.defineProperty(exports, "__esModule", ({ value: true }));
41350
- exports.Info = exports.Diagnostics = exports.Rename = exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
41351
- exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = void 0;
41352
+ exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
41353
+ exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = void 0;
41352
41354
  const issue_1 = __webpack_require__(/*! ./issue */ "./node_modules/@abaplint/core/build/src/issue.js");
41353
41355
  Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
41354
41356
  const config_1 = __webpack_require__(/*! ./config */ "./node_modules/@abaplint/core/build/src/config.js");
@@ -41416,6 +41418,9 @@ const _statement_1 = __webpack_require__(/*! ./abap/2_statements/statements/_sta
41416
41418
  Object.defineProperty(exports, "Empty", ({ enumerable: true, get: function () { return _statement_1.Empty; } }));
41417
41419
  Object.defineProperty(exports, "Unknown", ({ enumerable: true, get: function () { return _statement_1.Unknown; } }));
41418
41420
  Object.defineProperty(exports, "Comment", ({ enumerable: true, get: function () { return _statement_1.Comment; } }));
41421
+ Object.defineProperty(exports, "MacroCall", ({ enumerable: true, get: function () { return _statement_1.MacroCall; } }));
41422
+ Object.defineProperty(exports, "MacroContent", ({ enumerable: true, get: function () { return _statement_1.MacroContent; } }));
41423
+ Object.defineProperty(exports, "NativeSQL", ({ enumerable: true, get: function () { return _statement_1.NativeSQL; } }));
41419
41424
  const edit_helper_1 = __webpack_require__(/*! ./edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
41420
41425
  Object.defineProperty(exports, "applyEditSingle", ({ enumerable: true, get: function () { return edit_helper_1.applyEditSingle; } }));
41421
41426
  Object.defineProperty(exports, "applyEditList", ({ enumerable: true, get: function () { return edit_helper_1.applyEditList; } }));
@@ -42568,13 +42573,13 @@ class Help {
42568
42573
  /////////////////////////////////////////////////
42569
42574
  static dumpABAP(file, reg, textDocument, position) {
42570
42575
  let content = "";
42571
- content = `
42572
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
42573
- <a href="#_statements" rel="no-refresh">Statements</a> |
42574
- <a href="#_structure" rel="no-refresh">Structure</a> |
42575
- <a href="#_files" rel="no-refresh">Files</a> |
42576
- <a href="#_info" rel="no-refresh">Info Dump</a>
42577
- <hr>
42576
+ content = `
42577
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
42578
+ <a href="#_statements" rel="no-refresh">Statements</a> |
42579
+ <a href="#_structure" rel="no-refresh">Structure</a> |
42580
+ <a href="#_files" rel="no-refresh">Files</a> |
42581
+ <a href="#_info" rel="no-refresh">Info Dump</a>
42582
+ <hr>
42578
42583
  ` +
42579
42584
  "<tt>" + textDocument.uri + " (" +
42580
42585
  (position.line + 1) + ", " +
@@ -51776,7 +51781,7 @@ class Registry {
51776
51781
  }
51777
51782
  static abaplintVersion() {
51778
51783
  // magic, see build script "version.sh"
51779
- return "2.110.2";
51784
+ return "2.110.4";
51780
51785
  }
51781
51786
  getDDICReferences() {
51782
51787
  return this.ddicReferences;
@@ -52095,10 +52100,10 @@ class SevenBitAscii {
52095
52100
  key: "7bit_ascii",
52096
52101
  title: "Check for 7bit ascii",
52097
52102
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
52098
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
52099
-
52100
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
52101
-
52103
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
52104
+
52105
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
52106
+
52102
52107
  Checkes files with extensions ".abap" and ".asddls"`,
52103
52108
  tags: [_irule_1.RuleTag.SingleFile],
52104
52109
  badExample: `WRITE '뽑'.`,
@@ -52304,10 +52309,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
52304
52309
  key: "abapdoc",
52305
52310
  title: "Check abapdoc",
52306
52311
  shortDescription: `Various checks regarding abapdoc.`,
52307
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
52308
-
52309
- Plus class and interface definitions.
52310
-
52312
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
52313
+
52314
+ Plus class and interface definitions.
52315
+
52311
52316
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
52312
52317
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
52313
52318
  };
@@ -52445,49 +52450,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
52445
52450
  key: "align_parameters",
52446
52451
  title: "Align Parameters",
52447
52452
  shortDescription: `Checks for vertially aligned parameters`,
52448
- extendedInformation: `Checks:
52449
- * function module calls
52450
- * method calls
52451
- * VALUE constructors
52452
- * NEW constructors
52453
- * RAISE EXCEPTION statements
52454
- * CREATE OBJECT statements
52455
- * RAISE EVENT statements
52456
-
52457
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
52458
-
52459
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
52460
-
52461
- If parameters are on the same row, no issues are reported, see
52453
+ extendedInformation: `Checks:
52454
+ * function module calls
52455
+ * method calls
52456
+ * VALUE constructors
52457
+ * NEW constructors
52458
+ * RAISE EXCEPTION statements
52459
+ * CREATE OBJECT statements
52460
+ * RAISE EVENT statements
52461
+
52462
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
52463
+
52464
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
52465
+
52466
+ If parameters are on the same row, no issues are reported, see
52462
52467
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
52463
52468
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
52464
- badExample: `CALL FUNCTION 'FOOBAR'
52465
- EXPORTING
52466
- foo = 2
52467
- parameter = 3.
52468
-
52469
- foobar( moo = 1
52470
- param = 1 ).
52471
-
52472
- foo = VALUE #(
52473
- foo = bar
52469
+ badExample: `CALL FUNCTION 'FOOBAR'
52470
+ EXPORTING
52471
+ foo = 2
52472
+ parameter = 3.
52473
+
52474
+ foobar( moo = 1
52475
+ param = 1 ).
52476
+
52477
+ foo = VALUE #(
52478
+ foo = bar
52474
52479
  moo = 2 ).`,
52475
- goodExample: `CALL FUNCTION 'FOOBAR'
52476
- EXPORTING
52477
- foo = 2
52478
- parameter = 3.
52479
-
52480
- foobar( moo = 1
52481
- param = 1 ).
52482
-
52483
- foo = VALUE #(
52484
- foo = bar
52485
- moo = 2 ).
52486
-
52487
- DATA(sdf) = VALUE type(
52488
- common_val = 2
52489
- another_common = 5
52490
- ( row_value = 4
52480
+ goodExample: `CALL FUNCTION 'FOOBAR'
52481
+ EXPORTING
52482
+ foo = 2
52483
+ parameter = 3.
52484
+
52485
+ foobar( moo = 1
52486
+ param = 1 ).
52487
+
52488
+ foo = VALUE #(
52489
+ foo = bar
52490
+ moo = 2 ).
52491
+
52492
+ DATA(sdf) = VALUE type(
52493
+ common_val = 2
52494
+ another_common = 5
52495
+ ( row_value = 4
52491
52496
  value_foo = 5 ) ).`,
52492
52497
  };
52493
52498
  }
@@ -52921,37 +52926,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
52921
52926
  key: "align_type_expressions",
52922
52927
  title: "Align TYPE expressions",
52923
52928
  shortDescription: `Align TYPE expressions in statements`,
52924
- extendedInformation: `
52925
- Currently works for METHODS + BEGIN OF
52926
-
52927
- If BEGIN OF has an INCLUDE TYPE its ignored
52928
-
52929
- Also note that clean ABAP does not recommend aligning TYPE clauses:
52929
+ extendedInformation: `
52930
+ Currently works for METHODS + BEGIN OF
52931
+
52932
+ If BEGIN OF has an INCLUDE TYPE its ignored
52933
+
52934
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
52930
52935
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
52931
52936
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
52932
- badExample: `
52933
- TYPES: BEGIN OF foo,
52934
- bar TYPE i,
52935
- foobar TYPE i,
52936
- END OF foo.
52937
-
52938
- INTERFACE lif.
52939
- METHODS bar
52940
- IMPORTING
52941
- foo TYPE i
52942
- foobar TYPE i.
52937
+ badExample: `
52938
+ TYPES: BEGIN OF foo,
52939
+ bar TYPE i,
52940
+ foobar TYPE i,
52941
+ END OF foo.
52942
+
52943
+ INTERFACE lif.
52944
+ METHODS bar
52945
+ IMPORTING
52946
+ foo TYPE i
52947
+ foobar TYPE i.
52943
52948
  ENDINTERFACE.`,
52944
- goodExample: `
52945
- TYPES: BEGIN OF foo,
52946
- bar TYPE i,
52947
- foobar TYPE i,
52948
- END OF foo.
52949
-
52950
- INTERFACE lif.
52951
- METHODS bar
52952
- IMPORTING
52953
- foo TYPE i
52954
- foobar TYPE i.
52949
+ goodExample: `
52950
+ TYPES: BEGIN OF foo,
52951
+ bar TYPE i,
52952
+ foobar TYPE i,
52953
+ END OF foo.
52954
+
52955
+ INTERFACE lif.
52956
+ METHODS bar
52957
+ IMPORTING
52958
+ foo TYPE i
52959
+ foobar TYPE i.
52955
52960
  ENDINTERFACE.`,
52956
52961
  };
52957
52962
  }
@@ -53230,15 +53235,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
53230
53235
  return {
53231
53236
  key: "ambiguous_statement",
53232
53237
  title: "Check for ambigious statements",
53233
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
53234
- Add "TABLE" keyword or "@" for escaping SQL variables
53235
-
53238
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
53239
+ Add "TABLE" keyword or "@" for escaping SQL variables
53240
+
53236
53241
  Only works if the target version is 740sp05 or above`,
53237
53242
  tags: [_irule_1.RuleTag.SingleFile],
53238
- badExample: `DELETE foo FROM bar.
53243
+ badExample: `DELETE foo FROM bar.
53239
53244
  MODIFY foo FROM bar.`,
53240
- goodExample: `DELETE foo FROM @bar.
53241
- MODIFY TABLE foo FROM bar.
53245
+ goodExample: `DELETE foo FROM @bar.
53246
+ MODIFY TABLE foo FROM bar.
53242
53247
  MODIFY zfoo FROM @wa.`,
53243
53248
  };
53244
53249
  }
@@ -53343,16 +53348,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
53343
53348
  key: "avoid_use",
53344
53349
  title: "Avoid use of certain statements",
53345
53350
  shortDescription: `Detects usage of certain statements.`,
53346
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
53347
-
53348
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
53349
-
53350
- STATICS: use CLASS-DATA instead
53351
-
53352
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
53353
-
53354
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
53355
-
53351
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
53352
+
53353
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
53354
+
53355
+ STATICS: use CLASS-DATA instead
53356
+
53357
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
53358
+
53359
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
53360
+
53356
53361
  BREAK points`,
53357
53362
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53358
53363
  };
@@ -53484,11 +53489,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
53484
53489
  title: "Check BEGIN END names",
53485
53490
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
53486
53491
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
53487
- badExample: `DATA: BEGIN OF stru,
53488
- field TYPE i,
53492
+ badExample: `DATA: BEGIN OF stru,
53493
+ field TYPE i,
53489
53494
  END OF structure_not_the_same.`,
53490
- goodExample: `DATA: BEGIN OF stru,
53491
- field TYPE i,
53495
+ goodExample: `DATA: BEGIN OF stru,
53496
+ field TYPE i,
53492
53497
  END OF stru.`,
53493
53498
  };
53494
53499
  }
@@ -53585,20 +53590,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
53585
53590
  title: "BEGIN contains single INCLUDE",
53586
53591
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
53587
53592
  tags: [_irule_1.RuleTag.SingleFile],
53588
- badExample: `TYPES: BEGIN OF dummy1.
53589
- INCLUDE TYPE dselc.
53590
- TYPES: END OF dummy1.
53591
-
53592
- DATA BEGIN OF foo.
53593
- INCLUDE STRUCTURE syst.
53594
- DATA END OF foo.
53595
-
53596
- STATICS BEGIN OF bar.
53597
- INCLUDE STRUCTURE syst.
53593
+ badExample: `TYPES: BEGIN OF dummy1.
53594
+ INCLUDE TYPE dselc.
53595
+ TYPES: END OF dummy1.
53596
+
53597
+ DATA BEGIN OF foo.
53598
+ INCLUDE STRUCTURE syst.
53599
+ DATA END OF foo.
53600
+
53601
+ STATICS BEGIN OF bar.
53602
+ INCLUDE STRUCTURE syst.
53598
53603
  STATICS END OF bar.`,
53599
- goodExample: `DATA BEGIN OF foo.
53600
- DATA field TYPE i.
53601
- INCLUDE STRUCTURE dselc.
53604
+ goodExample: `DATA BEGIN OF foo.
53605
+ DATA field TYPE i.
53606
+ INCLUDE STRUCTURE dselc.
53602
53607
  DATA END OF foo.`,
53603
53608
  };
53604
53609
  }
@@ -53688,9 +53693,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
53688
53693
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
53689
53694
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
53690
53695
  badExample: `CALL TRANSACTION 'FOO'.`,
53691
- goodExample: `TRY.
53692
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
53693
- CATCH cx_sy_authorization_error.
53696
+ goodExample: `TRY.
53697
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
53698
+ CATCH cx_sy_authorization_error.
53694
53699
  ENDTRY.`,
53695
53700
  };
53696
53701
  }
@@ -53755,10 +53760,10 @@ class CDSCommentStyle {
53755
53760
  key: "cds_comment_style",
53756
53761
  title: "CDS Comment Style",
53757
53762
  shortDescription: `Check for obsolete comment style`,
53758
- extendedInformation: `Check for obsolete comment style
53759
-
53760
- Comments starting with "--" are considered obsolete
53761
-
53763
+ extendedInformation: `Check for obsolete comment style
53764
+
53765
+ Comments starting with "--" are considered obsolete
53766
+
53762
53767
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
53763
53768
  tags: [_irule_1.RuleTag.SingleFile],
53764
53769
  badExample: "-- this is a comment",
@@ -53825,10 +53830,10 @@ class CDSLegacyView {
53825
53830
  title: "CDS Legacy View",
53826
53831
  shortDescription: `Identify CDS Legacy Views`,
53827
53832
  // eslint-disable-next-line max-len
53828
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
53829
-
53830
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
53831
-
53833
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
53834
+
53835
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
53836
+
53832
53837
  v755 and up`,
53833
53838
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
53834
53839
  };
@@ -53983,10 +53988,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
53983
53988
  key: "chain_mainly_declarations",
53984
53989
  title: "Chain mainly declarations",
53985
53990
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
53986
- extendedInformation: `
53987
- https://docs.abapopenchecks.org/checks/23/
53988
-
53989
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53991
+ extendedInformation: `
53992
+ https://docs.abapopenchecks.org/checks/23/
53993
+
53994
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53990
53995
  `,
53991
53996
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53992
53997
  badExample: `CALL METHOD: bar.`,
@@ -54162,17 +54167,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
54162
54167
  title: "Change IF to CASE",
54163
54168
  shortDescription: `Finds IF constructs that can be changed to CASE`,
54164
54169
  // eslint-disable-next-line max-len
54165
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
54166
-
54170
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
54171
+
54167
54172
  If the first comparison is a boolean compare, no issue is reported.`,
54168
54173
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
54169
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
54170
- ELSEIF l_fcat-fieldname = 'BAR'
54171
- OR l_fcat-fieldname = 'MOO'.
54174
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
54175
+ ELSEIF l_fcat-fieldname = 'BAR'
54176
+ OR l_fcat-fieldname = 'MOO'.
54172
54177
  ENDIF.`,
54173
- goodExample: `CASE l_fcat-fieldname.
54174
- WHEN 'FOO'.
54175
- WHEN 'BAR' OR 'MOO'.
54178
+ goodExample: `CASE l_fcat-fieldname.
54179
+ WHEN 'FOO'.
54180
+ WHEN 'BAR' OR 'MOO'.
54176
54181
  ENDCASE.`,
54177
54182
  };
54178
54183
  }
@@ -54309,8 +54314,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
54309
54314
  return {
54310
54315
  key: "check_abstract",
54311
54316
  title: "Check abstract methods and classes",
54312
- shortDescription: `Checks abstract methods and classes:
54313
- - class defined as abstract and final,
54317
+ shortDescription: `Checks abstract methods and classes:
54318
+ - class defined as abstract and final,
54314
54319
  - non-abstract class contains abstract methods`,
54315
54320
  extendedInformation: `If a class defines only constants, use an interface instead`,
54316
54321
  tags: [_irule_1.RuleTag.SingleFile],
@@ -54391,11 +54396,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
54391
54396
  return {
54392
54397
  key: "check_comments",
54393
54398
  title: "Check Comments",
54394
- shortDescription: `
54399
+ shortDescription: `
54395
54400
  Various checks for comment usage.`,
54396
- extendedInformation: `
54397
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
54398
-
54401
+ extendedInformation: `
54402
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
54403
+
54399
54404
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
54400
54405
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54401
54406
  badExample: `WRITE 2. " descriptive comment`,
@@ -54557,9 +54562,9 @@ class CheckInclude {
54557
54562
  key: "check_include",
54558
54563
  title: "Check INCLUDEs",
54559
54564
  shortDescription: `Checks INCLUDE statements`,
54560
- extendedInformation: `
54561
- * Reports unused includes
54562
- * Errors if the includes are not found
54565
+ extendedInformation: `
54566
+ * Reports unused includes
54567
+ * Errors if the includes are not found
54563
54568
  * Error if including a main program`,
54564
54569
  tags: [_irule_1.RuleTag.Syntax],
54565
54570
  };
@@ -54635,14 +54640,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
54635
54640
  key: "check_subrc",
54636
54641
  title: "Check sy-subrc",
54637
54642
  shortDescription: `Check sy-subrc`,
54638
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
54639
-
54640
- If sy-dbcnt is checked after database statements, it is considered okay.
54641
-
54642
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
54643
-
54644
- If IS ASSIGNED is checked after assigning, it is considered okay.
54645
-
54643
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
54644
+
54645
+ If sy-dbcnt is checked after database statements, it is considered okay.
54646
+
54647
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
54648
+
54649
+ If IS ASSIGNED is checked after assigning, it is considered okay.
54650
+
54646
54651
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
54647
54652
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
54648
54653
  pseudoComment: "EC CI_SUBRC",
@@ -55211,17 +55216,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
55211
55216
  shortDescription: `Find overlapping classic exceptions`,
55212
55217
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
55213
55218
  tags: [_irule_1.RuleTag.SingleFile],
55214
- badExample: `CALL FUNCTION 'SOMETHING'
55215
- EXCEPTIONS
55216
- system_failure = 1 MESSAGE lv_message
55217
- communication_failure = 1 MESSAGE lv_message
55218
- resource_failure = 1
55219
+ badExample: `CALL FUNCTION 'SOMETHING'
55220
+ EXCEPTIONS
55221
+ system_failure = 1 MESSAGE lv_message
55222
+ communication_failure = 1 MESSAGE lv_message
55223
+ resource_failure = 1
55219
55224
  OTHERS = 1.`,
55220
- goodExample: `CALL FUNCTION 'SOMETHING'
55221
- EXCEPTIONS
55222
- system_failure = 1 MESSAGE lv_message
55223
- communication_failure = 2 MESSAGE lv_message
55224
- resource_failure = 3
55225
+ goodExample: `CALL FUNCTION 'SOMETHING'
55226
+ EXCEPTIONS
55227
+ system_failure = 1 MESSAGE lv_message
55228
+ communication_failure = 2 MESSAGE lv_message
55229
+ resource_failure = 3
55225
55230
  OTHERS = 4.`,
55226
55231
  };
55227
55232
  }
@@ -55467,7 +55472,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
55467
55472
  key: "commented_code",
55468
55473
  title: "Find commented code",
55469
55474
  shortDescription: `Detects usage of commented out code.`,
55470
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
55475
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
55471
55476
  https://docs.abapopenchecks.org/checks/14/`,
55472
55477
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
55473
55478
  badExample: `* WRITE 'hello world'.`,
@@ -55700,10 +55705,10 @@ class ConstructorVisibilityPublic {
55700
55705
  key: "constructor_visibility_public",
55701
55706
  title: "Check constructor visibility is public",
55702
55707
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
55703
- extendedInformation: `
55704
- This only applies to global classes.
55705
-
55706
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
55708
+ extendedInformation: `
55709
+ This only applies to global classes.
55710
+
55711
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
55707
55712
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
55708
55713
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55709
55714
  };
@@ -55778,8 +55783,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
55778
55783
  key: "contains_tab",
55779
55784
  title: "Code contains tab",
55780
55785
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
55781
- extendedInformation: `
55782
- https://docs.abapopenchecks.org/checks/09/
55786
+ extendedInformation: `
55787
+ https://docs.abapopenchecks.org/checks/09/
55783
55788
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
55784
55789
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55785
55790
  badExample: `\tWRITE 'hello world'.`,
@@ -55866,10 +55871,10 @@ class CyclicOO {
55866
55871
  key: "cyclic_oo",
55867
55872
  title: "Cyclic OO",
55868
55873
  shortDescription: `Finds cyclic OO references`,
55869
- extendedInformation: `Runs for global INTF + CLAS objects
55870
-
55871
- Objects must be without syntax errors for this rule to take effect
55872
-
55874
+ extendedInformation: `Runs for global INTF + CLAS objects
55875
+
55876
+ Objects must be without syntax errors for this rule to take effect
55877
+
55873
55878
  References in testclass includes are ignored`,
55874
55879
  };
55875
55880
  }
@@ -56111,7 +56116,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
56111
56116
  key: "dangerous_statement",
56112
56117
  title: "Dangerous statement",
56113
56118
  shortDescription: `Detects potentially dangerous statements`,
56114
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
56119
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
56115
56120
  dynamic SQL can potentially create SQL injection problems`,
56116
56121
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
56117
56122
  };
@@ -56315,13 +56320,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
56315
56320
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
56316
56321
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
56317
56322
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56318
- badExample: `FROM foo.
56319
- WRITE 'hello'.
56320
- DATA int TYPE i.
56323
+ badExample: `FROM foo.
56324
+ WRITE 'hello'.
56325
+ DATA int TYPE i.
56321
56326
  ENDFORM.`,
56322
- goodExample: `FROM foo.
56323
- DATA int TYPE i.
56324
- WRITE 'hello'.
56327
+ goodExample: `FROM foo.
56328
+ DATA int TYPE i.
56329
+ WRITE 'hello'.
56325
56330
  ENDFORM.`,
56326
56331
  };
56327
56332
  }
@@ -56857,39 +56862,39 @@ class Downport {
56857
56862
  key: "downport",
56858
56863
  title: "Downport statement",
56859
56864
  shortDescription: `Downport functionality`,
56860
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56861
- a higher level language version. If successful, various rules are applied to downport the statement.
56862
- Target downport version is always v702, thus rule is only enabled if target version is v702.
56863
-
56864
- Current rules:
56865
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56866
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56867
- * FIELD-SYMBOL() definitions are outlined
56868
- * CONV is outlined
56869
- * COND is outlined
56870
- * REDUCE is outlined
56871
- * SWITCH is outlined
56872
- * FILTER is outlined
56873
- * APPEND expression is outlined
56874
- * INSERT expression is outlined
56875
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56876
- * CAST changed to ?=
56877
- * LOOP AT method_call( ) is outlined
56878
- * VALUE # with structure fields
56879
- * VALUE # with internal table lines
56880
- * Table Expressions are outlined
56881
- * SELECT INTO @DATA definitions are outlined
56882
- * Some occurrences of string template formatting option ALPHA changed to function module call
56883
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56884
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56885
- * RAISE EXCEPTION ... MESSAGE
56886
- * Moving with +=, -=, /=, *=, &&= is expanded
56887
- * line_exists and line_index is downported to READ TABLE
56888
- * ENUMs, but does not nessesarily give the correct type and value
56889
- * MESSAGE with non simple source
56890
-
56891
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56892
-
56865
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56866
+ a higher level language version. If successful, various rules are applied to downport the statement.
56867
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
56868
+
56869
+ Current rules:
56870
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56871
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56872
+ * FIELD-SYMBOL() definitions are outlined
56873
+ * CONV is outlined
56874
+ * COND is outlined
56875
+ * REDUCE is outlined
56876
+ * SWITCH is outlined
56877
+ * FILTER is outlined
56878
+ * APPEND expression is outlined
56879
+ * INSERT expression is outlined
56880
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56881
+ * CAST changed to ?=
56882
+ * LOOP AT method_call( ) is outlined
56883
+ * VALUE # with structure fields
56884
+ * VALUE # with internal table lines
56885
+ * Table Expressions are outlined
56886
+ * SELECT INTO @DATA definitions are outlined
56887
+ * Some occurrences of string template formatting option ALPHA changed to function module call
56888
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56889
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56890
+ * RAISE EXCEPTION ... MESSAGE
56891
+ * Moving with +=, -=, /=, *=, &&= is expanded
56892
+ * line_exists and line_index is downported to READ TABLE
56893
+ * ENUMs, but does not nessesarily give the correct type and value
56894
+ * MESSAGE with non simple source
56895
+
56896
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56897
+
56893
56898
  Make sure to test the downported code, it might not always be completely correct.`,
56894
56899
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
56895
56900
  };
@@ -57467,10 +57472,10 @@ Make sure to test the downported code, it might not always be completely correct
57467
57472
  const fieldName = f.concatTokens();
57468
57473
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
57469
57474
  }
57470
- fieldDefinition = `DATA: BEGIN OF ${name},
57475
+ fieldDefinition = `DATA: BEGIN OF ${name},
57471
57476
  ${fieldDefinition}${indentation} END OF ${name}.`;
57472
57477
  }
57473
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
57478
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
57474
57479
  ${indentation}`);
57475
57480
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
57476
57481
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57514,12 +57519,12 @@ ${indentation}`);
57514
57519
  }
57515
57520
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57516
57521
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
57517
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
57518
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
57519
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
57522
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
57523
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
57524
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
57520
57525
  ${indentation}`);
57521
57526
  if (fieldDefinitions === "") {
57522
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
57527
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
57523
57528
  ${indentation}`);
57524
57529
  }
57525
57530
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -57587,7 +57592,7 @@ ${indentation}`);
57587
57592
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57588
57593
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57589
57594
  const firstToken = high.getFirstToken();
57590
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57595
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57591
57596
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57592
57597
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
57593
57598
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57641,7 +57646,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57641
57646
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57642
57647
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57643
57648
  const firstToken = high.getFirstToken();
57644
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57649
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
57645
57650
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57646
57651
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
57647
57652
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57683,14 +57688,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
57683
57688
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57684
57689
  const firstToken = high.getFirstToken();
57685
57690
  // note that the tabix restore should be done before throwing the exception
57686
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
57687
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57688
- ${indentation}${tabixBackup} = sy-tabix.
57689
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
57690
- ${indentation}sy-tabix = ${tabixBackup}.
57691
- ${indentation}IF sy-subrc <> 0.
57692
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57693
- ${indentation}ENDIF.
57691
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
57692
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57693
+ ${indentation}${tabixBackup} = sy-tabix.
57694
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
57695
+ ${indentation}sy-tabix = ${tabixBackup}.
57696
+ ${indentation}IF sy-subrc <> 0.
57697
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57698
+ ${indentation}ENDIF.
57694
57699
  ${indentation}`);
57695
57700
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
57696
57701
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -57747,7 +57752,7 @@ ${indentation}`);
57747
57752
  const className = classNames[0].concatTokens();
57748
57753
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57749
57754
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
57750
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
57755
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
57751
57756
  ${indentation}CATCH ${className} INTO ${targetName}.`;
57752
57757
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
57753
57758
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -57909,16 +57914,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
57909
57914
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57910
57915
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57911
57916
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
57912
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57913
- ${indentation}${uniqueName1}-msgid = ${id}.
57917
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57918
+ ${indentation}${uniqueName1}-msgid = ${id}.
57914
57919
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
57915
57920
  if (withs.length > 0) {
57916
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57917
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57918
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57921
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57922
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57923
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57919
57924
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
57920
57925
  }
57921
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57926
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57922
57927
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
57923
57928
  if (withs.length > 0) {
57924
57929
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -58030,10 +58035,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
58030
58035
  let code = "";
58031
58036
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
58032
58037
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58033
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
58034
- IF sy-subrc <> 0.
58035
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58036
- ENDIF.
58038
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
58039
+ IF sy-subrc <> 0.
58040
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58041
+ ENDIF.
58037
58042
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
58038
58043
  }
58039
58044
  else {
@@ -58122,20 +58127,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
58122
58127
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58123
58128
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58124
58129
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58125
- code += ` items LIKE ${loopSourceName},
58126
- END OF ${groupTargetName}type.
58127
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
58128
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
58130
+ code += ` items LIKE ${loopSourceName},
58131
+ END OF ${groupTargetName}type.
58132
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
58133
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
58129
58134
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
58130
58135
  if (groupIndexName !== undefined) {
58131
58136
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
58132
58137
  }
58133
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
58138
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
58134
58139
  IF sy-subrc = 0.\n`;
58135
58140
  if (groupCountName !== undefined) {
58136
58141
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
58137
58142
  }
58138
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
58143
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
58139
58144
  ELSE.\n`;
58140
58145
  code += ` CLEAR ${uniqueName}.\n`;
58141
58146
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -58156,8 +58161,8 @@ ELSE.\n`;
58156
58161
  }
58157
58162
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
58158
58163
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
58159
- code += `ENDIF.
58160
- ENDLOOP.
58164
+ code += `ENDIF.
58165
+ ENDLOOP.
58161
58166
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
58162
58167
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
58163
58168
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -58329,7 +58334,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
58329
58334
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
58330
58335
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
58331
58336
  // all ENUMS are char like?
58332
- let code = `TYPES ${enumName} TYPE string.
58337
+ let code = `TYPES ${enumName} TYPE string.
58333
58338
  CONSTANTS: BEGIN OF ${structureName},\n`;
58334
58339
  let count = 1;
58335
58340
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -58373,14 +58378,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
58373
58378
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58374
58379
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58375
58380
  // restore tabix before exeption
58376
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
58377
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58378
- ${indentation}${tabixBackup} = sy-tabix.
58379
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
58380
- ${indentation}sy-tabix = ${tabixBackup}.
58381
- ${indentation}IF sy-subrc <> 0.
58382
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58383
- ${indentation}ENDIF.
58381
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
58382
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
58383
+ ${indentation}${tabixBackup} = sy-tabix.
58384
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
58385
+ ${indentation}sy-tabix = ${tabixBackup}.
58386
+ ${indentation}IF sy-subrc <> 0.
58387
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
58388
+ ${indentation}ENDIF.
58384
58389
  ${indentation}${uniqueName}`;
58385
58390
  const start = target.getFirstToken().getStart();
58386
58391
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -58464,11 +58469,11 @@ ${indentation}${uniqueName}`;
58464
58469
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
58465
58470
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
58466
58471
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
58467
- const code = `DATA ${uniqueName} TYPE string.
58468
- ${indentation}CALL FUNCTION '${functionName}'
58469
- ${indentation} EXPORTING
58470
- ${indentation} input = ${source}
58471
- ${indentation} IMPORTING
58472
+ const code = `DATA ${uniqueName} TYPE string.
58473
+ ${indentation}CALL FUNCTION '${functionName}'
58474
+ ${indentation} EXPORTING
58475
+ ${indentation} input = ${source}
58476
+ ${indentation} IMPORTING
58472
58477
  ${indentation} output = ${uniqueName}.\n`;
58473
58478
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
58474
58479
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -59780,12 +59785,12 @@ class EasyToFindMessages {
59780
59785
  key: "easy_to_find_messages",
59781
59786
  title: "Easy to find messages",
59782
59787
  shortDescription: `Make messages easy to find`,
59783
- extendedInformation: `All messages must be statically referenced exactly once
59784
-
59785
- Only MESSAGE and RAISE statments are counted as static references
59786
-
59787
- Also see rule "message_exists"
59788
-
59788
+ extendedInformation: `All messages must be statically referenced exactly once
59789
+
59790
+ Only MESSAGE and RAISE statments are counted as static references
59791
+
59792
+ Also see rule "message_exists"
59793
+
59789
59794
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
59790
59795
  tags: [_irule_1.RuleTag.Styleguide],
59791
59796
  };
@@ -59870,8 +59875,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
59870
59875
  key: "empty_line_in_statement",
59871
59876
  title: "Find empty lines in statements",
59872
59877
  shortDescription: `Checks that statements do not contain empty lines.`,
59873
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
59874
-
59878
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
59879
+
59875
59880
  https://docs.abapopenchecks.org/checks/41/`,
59876
59881
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
59877
59882
  badExample: `WRITE\n\nhello.`,
@@ -60047,13 +60052,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
60047
60052
  shortDescription: `Checks that the code does not contain empty blocks.`,
60048
60053
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
60049
60054
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
60050
- badExample: `IF foo = bar.
60051
- ENDIF.
60052
-
60053
- DO 2 TIMES.
60055
+ badExample: `IF foo = bar.
60056
+ ENDIF.
60057
+
60058
+ DO 2 TIMES.
60054
60059
  ENDDO.`,
60055
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
60056
- ENDLOOP.
60060
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
60061
+ ENDLOOP.
60057
60062
  result = xsdbool( sy-subrc = 0 ).`,
60058
60063
  };
60059
60064
  }
@@ -60195,10 +60200,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
60195
60200
  return {
60196
60201
  key: "exit_or_check",
60197
60202
  title: "Find EXIT or CHECK outside loops",
60198
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
60203
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
60199
60204
  Use RETURN to leave procesing blocks instead.`,
60200
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
60201
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
60205
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
60206
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
60202
60207
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
60203
60208
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60204
60209
  };
@@ -60281,12 +60286,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
60281
60286
  key: "expand_macros",
60282
60287
  title: "Expand Macros",
60283
60288
  shortDescription: `Allows expanding macro calls with quick fixes`,
60284
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
60285
-
60289
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
60290
+
60286
60291
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
60287
- badExample: `DEFINE _hello.
60288
- WRITE 'hello'.
60289
- END-OF-DEFINITION.
60292
+ badExample: `DEFINE _hello.
60293
+ WRITE 'hello'.
60294
+ END-OF-DEFINITION.
60290
60295
  _hello.`,
60291
60296
  goodExample: `WRITE 'hello'.`,
60292
60297
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -60373,7 +60378,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
60373
60378
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
60374
60379
  badExample: `call_method( EXPORTING foo = bar ).`,
60375
60380
  goodExample: `call_method( foo = bar ).`,
60376
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
60381
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
60377
60382
  https://docs.abapopenchecks.org/checks/30/`,
60378
60383
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
60379
60384
  };
@@ -60471,7 +60476,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
60471
60476
  key: "forbidden_identifier",
60472
60477
  title: "Forbidden Identifier",
60473
60478
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
60474
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
60479
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
60475
60480
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
60476
60481
  tags: [_irule_1.RuleTag.SingleFile],
60477
60482
  };
@@ -60713,8 +60718,8 @@ class ForbiddenVoidType {
60713
60718
  key: "forbidden_void_type",
60714
60719
  title: "Forbidden Void Types",
60715
60720
  shortDescription: `Avoid usage of specified void types.`,
60716
- extendedInformation: `Inspiration:
60717
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
60721
+ extendedInformation: `Inspiration:
60722
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
60718
60723
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
60719
60724
  };
60720
60725
  }
@@ -60957,7 +60962,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
60957
60962
  key: "fully_type_itabs",
60958
60963
  title: "Fully type internal tables",
60959
60964
  shortDescription: `No implict table types or table keys`,
60960
- badExample: `DATA lt_foo TYPE TABLE OF ty.
60965
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
60961
60966
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
60962
60967
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
60963
60968
  tags: [_irule_1.RuleTag.SingleFile],
@@ -61142,26 +61147,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
61142
61147
  key: "functional_writing",
61143
61148
  title: "Use functional writing",
61144
61149
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
61145
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
61150
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
61146
61151
  https://docs.abapopenchecks.org/checks/07/`,
61147
61152
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61148
- badExample: `CALL METHOD zcl_class=>method( ).
61149
- CALL METHOD cl_abap_typedescr=>describe_by_name
61150
- EXPORTING
61151
- p_name = 'NAME'
61152
- RECEIVING
61153
- p_descr_ref = lr_typedescr
61154
- EXCEPTIONS
61155
- type_not_found = 1
61153
+ badExample: `CALL METHOD zcl_class=>method( ).
61154
+ CALL METHOD cl_abap_typedescr=>describe_by_name
61155
+ EXPORTING
61156
+ p_name = 'NAME'
61157
+ RECEIVING
61158
+ p_descr_ref = lr_typedescr
61159
+ EXCEPTIONS
61160
+ type_not_found = 1
61156
61161
  OTHERS = 2.`,
61157
- goodExample: `zcl_class=>method( ).
61158
- cl_abap_typedescr=>describe_by_name(
61159
- EXPORTING
61160
- p_name = 'NAME'
61161
- RECEIVING
61162
- p_descr_ref = lr_typedescr
61163
- EXCEPTIONS
61164
- type_not_found = 1
61162
+ goodExample: `zcl_class=>method( ).
61163
+ cl_abap_typedescr=>describe_by_name(
61164
+ EXPORTING
61165
+ p_name = 'NAME'
61166
+ RECEIVING
61167
+ p_descr_ref = lr_typedescr
61168
+ EXCEPTIONS
61169
+ type_not_found = 1
61165
61170
  OTHERS = 2 ).`,
61166
61171
  };
61167
61172
  }
@@ -61272,14 +61277,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
61272
61277
  key: "global_class",
61273
61278
  title: "Global class checks",
61274
61279
  shortDescription: `Checks related to global classes`,
61275
- extendedInformation: `* global classes must be in own files
61276
-
61277
- * file names must match class name
61278
-
61279
- * file names must match interface name
61280
-
61281
- * global classes must be global definitions
61282
-
61280
+ extendedInformation: `* global classes must be in own files
61281
+
61282
+ * file names must match class name
61283
+
61284
+ * file names must match interface name
61285
+
61286
+ * global classes must be global definitions
61287
+
61283
61288
  * global interfaces must be global definitions`,
61284
61289
  tags: [_irule_1.RuleTag.Syntax],
61285
61290
  };
@@ -61378,21 +61383,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
61378
61383
  return {
61379
61384
  key: "identical_conditions",
61380
61385
  title: "Identical conditions",
61381
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
61382
-
61386
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
61387
+
61383
61388
  Prerequsites: code is pretty printed with identical cAsE`,
61384
61389
  tags: [_irule_1.RuleTag.SingleFile],
61385
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
61386
- ENDIF.
61387
- CASE bar.
61388
- WHEN '1'.
61389
- WHEN 'A' OR '1'.
61390
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
61391
+ ENDIF.
61392
+ CASE bar.
61393
+ WHEN '1'.
61394
+ WHEN 'A' OR '1'.
61390
61395
  ENDCASE.`,
61391
- goodExample: `IF foo = bar OR 1 = a.
61392
- ENDIF.
61393
- CASE bar.
61394
- WHEN '1'.
61395
- WHEN 'A'.
61396
+ goodExample: `IF foo = bar OR 1 = a.
61397
+ ENDIF.
61398
+ CASE bar.
61399
+ WHEN '1'.
61400
+ WHEN 'A'.
61396
61401
  ENDCASE.`,
61397
61402
  };
61398
61403
  }
@@ -61526,23 +61531,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
61526
61531
  key: "identical_contents",
61527
61532
  title: "Identical contents",
61528
61533
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
61529
- extendedInformation: `
61530
- Prerequsites: code is pretty printed with identical cAsE
61531
-
61534
+ extendedInformation: `
61535
+ Prerequsites: code is pretty printed with identical cAsE
61536
+
61532
61537
  Chained statments are ignored`,
61533
61538
  tags: [_irule_1.RuleTag.SingleFile],
61534
- badExample: `IF foo = bar.
61535
- WRITE 'bar'.
61536
- WRITE 'world'.
61537
- ELSE.
61538
- WRITE 'foo'.
61539
- WRITE 'world'.
61539
+ badExample: `IF foo = bar.
61540
+ WRITE 'bar'.
61541
+ WRITE 'world'.
61542
+ ELSE.
61543
+ WRITE 'foo'.
61544
+ WRITE 'world'.
61540
61545
  ENDIF.`,
61541
- goodExample: `IF foo = bar.
61542
- WRITE 'bar'.
61543
- ELSE.
61544
- WRITE 'foo'.
61545
- ENDIF.
61546
+ goodExample: `IF foo = bar.
61547
+ WRITE 'bar'.
61548
+ ELSE.
61549
+ WRITE 'foo'.
61550
+ ENDIF.
61546
61551
  WRITE 'world'.`,
61547
61552
  };
61548
61553
  }
@@ -61650,12 +61655,12 @@ class IdenticalDescriptions {
61650
61655
  key: "identical_descriptions",
61651
61656
  title: "Identical descriptions",
61652
61657
  shortDescription: `Searches for objects with the same type and same description`,
61653
- extendedInformation: `Case insensitive
61654
-
61655
- Only checks the master language descriptions
61656
-
61657
- Dependencies are skipped
61658
-
61658
+ extendedInformation: `Case insensitive
61659
+
61660
+ Only checks the master language descriptions
61661
+
61662
+ Dependencies are skipped
61663
+
61659
61664
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
61660
61665
  tags: [],
61661
61666
  };
@@ -61829,43 +61834,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
61829
61834
  key: "if_in_if",
61830
61835
  title: "IF in IF",
61831
61836
  shortDescription: `Detects nested ifs which can be refactored.`,
61832
- extendedInformation: `
61833
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
61834
-
61835
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
61836
-
61837
- https://docs.abapopenchecks.org/checks/01/
61837
+ extendedInformation: `
61838
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
61839
+
61840
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
61841
+
61842
+ https://docs.abapopenchecks.org/checks/01/
61838
61843
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
61839
- badExample: `IF condition1.
61840
- IF condition2.
61841
- ...
61842
- ENDIF.
61843
- ENDIF.
61844
-
61845
- IF condition1.
61846
- ...
61847
- ELSE.
61848
- IF condition2.
61849
- ...
61850
- ENDIF.
61844
+ badExample: `IF condition1.
61845
+ IF condition2.
61846
+ ...
61847
+ ENDIF.
61848
+ ENDIF.
61849
+
61850
+ IF condition1.
61851
+ ...
61852
+ ELSE.
61853
+ IF condition2.
61854
+ ...
61855
+ ENDIF.
61851
61856
  ENDIF.`,
61852
- goodExample: `IF ( condition1 ) AND ( condition2 ).
61853
- ...
61854
- ENDIF.
61855
-
61856
- IF condition1.
61857
- ...
61858
- ELSEIF condition2.
61859
- ...
61860
- ENDIF.
61861
-
61862
- CASE variable.
61863
- WHEN value1.
61864
- ...
61865
- WHEN value2.
61866
- IF condition2.
61867
- ...
61868
- ENDIF.
61857
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
61858
+ ...
61859
+ ENDIF.
61860
+
61861
+ IF condition1.
61862
+ ...
61863
+ ELSEIF condition2.
61864
+ ...
61865
+ ENDIF.
61866
+
61867
+ CASE variable.
61868
+ WHEN value1.
61869
+ ...
61870
+ WHEN value2.
61871
+ IF condition2.
61872
+ ...
61873
+ ENDIF.
61869
61874
  ENDCASE.`,
61870
61875
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61871
61876
  };
@@ -62050,9 +62055,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
62050
62055
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
62051
62056
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
62052
62057
  if (name === impl.identifier.getName().toUpperCase()) {
62053
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
62054
- METHOD ${methodName.toLowerCase()}.
62055
- RETURN. " todo, implement method
62058
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
62059
+ METHOD ${methodName.toLowerCase()}.
62060
+ RETURN. " todo, implement method
62056
62061
  ENDMETHOD.`);
62057
62062
  }
62058
62063
  }
@@ -62240,19 +62245,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
62240
62245
  key: "in_statement_indentation",
62241
62246
  title: "In-statement indentation",
62242
62247
  shortDescription: "Checks alignment within statements which span multiple lines.",
62243
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
62244
-
62245
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
62248
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
62249
+
62250
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
62246
62251
  to distinguish them better from code within the block.`,
62247
- badExample: `IF 1 = 1
62248
- AND 2 = 2.
62249
- WRITE 'hello' &&
62250
- 'world'.
62252
+ badExample: `IF 1 = 1
62253
+ AND 2 = 2.
62254
+ WRITE 'hello' &&
62255
+ 'world'.
62251
62256
  ENDIF.`,
62252
- goodExample: `IF 1 = 1
62253
- AND 2 = 2.
62254
- WRITE 'hello' &&
62255
- 'world'.
62257
+ goodExample: `IF 1 = 1
62258
+ AND 2 = 2.
62259
+ WRITE 'hello' &&
62260
+ 'world'.
62256
62261
  ENDIF.`,
62257
62262
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62258
62263
  };
@@ -62375,23 +62380,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
62375
62380
  title: "Indentation",
62376
62381
  shortDescription: `Checks indentation`,
62377
62382
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62378
- badExample: `CLASS lcl DEFINITION.
62379
- PRIVATE SECTION.
62380
- METHODS constructor.
62381
- ENDCLASS.
62382
-
62383
- CLASS lcl IMPLEMENTATION.
62384
- METHOD constructor.
62385
- ENDMETHOD.
62383
+ badExample: `CLASS lcl DEFINITION.
62384
+ PRIVATE SECTION.
62385
+ METHODS constructor.
62386
+ ENDCLASS.
62387
+
62388
+ CLASS lcl IMPLEMENTATION.
62389
+ METHOD constructor.
62390
+ ENDMETHOD.
62386
62391
  ENDCLASS.`,
62387
- goodExample: `CLASS lcl DEFINITION.
62388
- PRIVATE SECTION.
62389
- METHODS constructor.
62390
- ENDCLASS.
62391
-
62392
- CLASS lcl IMPLEMENTATION.
62393
- METHOD constructor.
62394
- ENDMETHOD.
62392
+ goodExample: `CLASS lcl DEFINITION.
62393
+ PRIVATE SECTION.
62394
+ METHODS constructor.
62395
+ ENDCLASS.
62396
+
62397
+ CLASS lcl IMPLEMENTATION.
62398
+ METHOD constructor.
62399
+ ENDMETHOD.
62395
62400
  ENDCLASS.`,
62396
62401
  };
62397
62402
  }
@@ -62780,9 +62785,9 @@ class IntfReferencingClas {
62780
62785
  key: "intf_referencing_clas",
62781
62786
  title: "INTF referencing CLAS",
62782
62787
  shortDescription: `Interface contains references to class`,
62783
- extendedInformation: `Only global interfaces are checked.
62784
- Only first level references are checked.
62785
- Exception class references are ignored.
62788
+ extendedInformation: `Only global interfaces are checked.
62789
+ Only first level references are checked.
62790
+ Exception class references are ignored.
62786
62791
  Void references are ignored.`,
62787
62792
  };
62788
62793
  }
@@ -62867,9 +62872,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
62867
62872
  title: "Invalid Table Index",
62868
62873
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
62869
62874
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62870
- badExample: `DATA(first) = table[ 0 ].
62875
+ badExample: `DATA(first) = table[ 0 ].
62871
62876
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
62872
- goodExample: `DATA(first) = table[ 1 ].
62877
+ goodExample: `DATA(first) = table[ 1 ].
62873
62878
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
62874
62879
  };
62875
62880
  }
@@ -63470,8 +63475,8 @@ class LineBreakStyle {
63470
63475
  return {
63471
63476
  key: "line_break_style",
63472
63477
  title: "Makes sure line breaks are consistent in the ABAP code",
63473
- shortDescription: `Enforces LF as newlines in ABAP files
63474
-
63478
+ shortDescription: `Enforces LF as newlines in ABAP files
63479
+
63475
63480
  abapGit does not work with CRLF`,
63476
63481
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
63477
63482
  };
@@ -63540,7 +63545,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
63540
63545
  key: "line_length",
63541
63546
  title: "Line length",
63542
63547
  shortDescription: `Detects lines exceeding the provided maximum length.`,
63543
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
63548
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
63544
63549
  https://docs.abapopenchecks.org/checks/04/`,
63545
63550
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63546
63551
  };
@@ -63611,7 +63616,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
63611
63616
  key: "line_only_punc",
63612
63617
  title: "Line containing only punctuation",
63613
63618
  shortDescription: `Detects lines containing only punctuation.`,
63614
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
63619
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
63615
63620
  https://docs.abapopenchecks.org/checks/16/`,
63616
63621
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63617
63622
  badExample: "zcl_class=>method(\n).",
@@ -63871,15 +63876,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
63871
63876
  return {
63872
63877
  key: "local_variable_names",
63873
63878
  title: "Local variable naming conventions",
63874
- shortDescription: `
63875
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
63879
+ shortDescription: `
63880
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
63876
63881
  Regexes are case-insensitive.`,
63877
63882
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
63878
- badExample: `FORM bar.
63879
- DATA foo.
63883
+ badExample: `FORM bar.
63884
+ DATA foo.
63880
63885
  ENDFORM.`,
63881
- goodExample: `FORM bar.
63882
- DATA lv_foo.
63886
+ goodExample: `FORM bar.
63887
+ DATA lv_foo.
63883
63888
  ENDFORM.`,
63884
63889
  };
63885
63890
  }
@@ -64102,10 +64107,10 @@ class MainFileContents {
64102
64107
  key: "main_file_contents",
64103
64108
  title: "Main file contents",
64104
64109
  shortDescription: `Checks related to report declarations.`,
64105
- extendedInformation: `Does not run if the target version is Cloud
64106
-
64107
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
64108
- * TYPEs must begin with "TYPE-POOL <name>."
64110
+ extendedInformation: `Does not run if the target version is Cloud
64111
+
64112
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
64113
+ * TYPEs must begin with "TYPE-POOL <name>."
64109
64114
  `,
64110
64115
  };
64111
64116
  }
@@ -64221,17 +64226,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
64221
64226
  title: "Too many parentheses",
64222
64227
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
64223
64228
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64224
- badExample: `
64225
- IF ( destination IS INITIAL ).
64226
- ENDIF.
64227
- IF foo = boo AND ( bar = lar AND moo = loo ).
64228
- ENDIF.
64229
+ badExample: `
64230
+ IF ( destination IS INITIAL ).
64231
+ ENDIF.
64232
+ IF foo = boo AND ( bar = lar AND moo = loo ).
64233
+ ENDIF.
64229
64234
  `,
64230
- goodExample: `
64231
- IF destination IS INITIAL.
64232
- ENDIF.
64233
- IF foo = boo AND bar = lar AND moo = loo.
64234
- ENDIF.
64235
+ goodExample: `
64236
+ IF destination IS INITIAL.
64237
+ ENDIF.
64238
+ IF foo = boo AND bar = lar AND moo = loo.
64239
+ ENDIF.
64235
64240
  `,
64236
64241
  };
64237
64242
  }
@@ -64405,14 +64410,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
64405
64410
  title: "Max one method parameter definition per line",
64406
64411
  shortDescription: `Keep max one method parameter description per line`,
64407
64412
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
64408
- badExample: `
64409
- METHODS apps_scope_token
64410
- IMPORTING
64413
+ badExample: `
64414
+ METHODS apps_scope_token
64415
+ IMPORTING
64411
64416
  body TYPE bodyapps_scope_token client_id TYPE str.`,
64412
- goodExample: `
64413
- METHODS apps_scope_token
64414
- IMPORTING
64415
- body TYPE bodyapps_scope_token
64417
+ goodExample: `
64418
+ METHODS apps_scope_token
64419
+ IMPORTING
64420
+ body TYPE bodyapps_scope_token
64416
64421
  client_id TYPE str.`,
64417
64422
  };
64418
64423
  }
@@ -64477,11 +64482,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
64477
64482
  key: "max_one_statement",
64478
64483
  title: "Max one statement per line",
64479
64484
  shortDescription: `Checks that each line contains only a single statement.`,
64480
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
64481
-
64482
- Does not report anything for chained statements.
64483
-
64484
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
64485
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
64486
+
64487
+ Does not report anything for chained statements.
64488
+
64489
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
64485
64490
  https://docs.abapopenchecks.org/checks/11/`,
64486
64491
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64487
64492
  badExample: `WRITE foo. WRITE bar.`,
@@ -64819,8 +64824,8 @@ class MethodLength {
64819
64824
  key: "method_length",
64820
64825
  title: "Method/Form Length",
64821
64826
  shortDescription: `Checks relating to method/form length.`,
64822
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
64823
-
64827
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
64828
+
64824
64829
  Abstract methods without statements are considered okay.`,
64825
64830
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64826
64831
  };
@@ -64925,20 +64930,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
64925
64930
  key: "method_overwrites_builtin",
64926
64931
  title: "Method name overwrites builtin function",
64927
64932
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
64928
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
64929
-
64930
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
64931
-
64933
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
64934
+
64935
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
64936
+
64932
64937
  Interface method names are ignored`,
64933
64938
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64934
- badExample: `CLASS lcl DEFINITION.
64935
- PUBLIC SECTION.
64936
- METHODS matches.
64937
- ENDCLASS.
64938
-
64939
- CLASS lcl IMPLEMENTATION.
64940
- METHOD matches.
64941
- ENDMETHOD.
64939
+ badExample: `CLASS lcl DEFINITION.
64940
+ PUBLIC SECTION.
64941
+ METHODS matches.
64942
+ ENDCLASS.
64943
+
64944
+ CLASS lcl IMPLEMENTATION.
64945
+ METHOD matches.
64946
+ ENDMETHOD.
64942
64947
  ENDCLASS.`,
64943
64948
  };
64944
64949
  }
@@ -65129,12 +65134,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
65129
65134
  // eslint-disable-next-line max-len
65130
65135
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
65131
65136
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65132
- badExample: `CLASS lcl DEFINITION.
65133
- PUBLIC SECTION.
65134
- METHODS
65135
- foobar
65136
- EXPORTING foo TYPE i
65137
- RETURNING VALUE(rv_string) TYPE string.
65137
+ badExample: `CLASS lcl DEFINITION.
65138
+ PUBLIC SECTION.
65139
+ METHODS
65140
+ foobar
65141
+ EXPORTING foo TYPE i
65142
+ RETURNING VALUE(rv_string) TYPE string.
65138
65143
  ENDCLASS.`,
65139
65144
  };
65140
65145
  }
@@ -65514,7 +65519,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
65514
65519
  key: "nesting",
65515
65520
  title: "Check nesting depth",
65516
65521
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
65517
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
65522
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
65518
65523
  https://docs.abapopenchecks.org/checks/74/`,
65519
65524
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65520
65525
  };
@@ -65757,7 +65762,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
65757
65762
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
65758
65763
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
65759
65764
  badExample: `var1 = var2 = var3.`,
65760
- goodExample: `var2 = var3.
65765
+ goodExample: `var2 = var3.
65761
65766
  var1 = var2.`,
65762
65767
  };
65763
65768
  }
@@ -65816,8 +65821,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
65816
65821
  key: "no_external_form_calls",
65817
65822
  title: "No external FORM calls",
65818
65823
  shortDescription: `Detect external form calls`,
65819
- badExample: `PERFORM foo IN PROGRAM bar.
65820
-
65824
+ badExample: `PERFORM foo IN PROGRAM bar.
65825
+
65821
65826
  PERFORM foo(bar).`,
65822
65827
  tags: [_irule_1.RuleTag.SingleFile],
65823
65828
  };
@@ -65878,17 +65883,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
65878
65883
  key: "no_inline_in_optional_branches",
65879
65884
  title: "Don't declare inline in optional branches",
65880
65885
  shortDescription: `Don't declare inline in optional branches`,
65881
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
65882
-
65883
- Considered optional branches:
65884
- * inside IF/ELSEIF/ELSE
65885
- * inside LOOP
65886
- * inside WHILE
65887
- * inside CASE/WHEN, CASE TYPE OF
65888
- * inside DO
65889
- * inside SELECT loops
65890
-
65891
- Not considered optional branches:
65886
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
65887
+
65888
+ Considered optional branches:
65889
+ * inside IF/ELSEIF/ELSE
65890
+ * inside LOOP
65891
+ * inside WHILE
65892
+ * inside CASE/WHEN, CASE TYPE OF
65893
+ * inside DO
65894
+ * inside SELECT loops
65895
+
65896
+ Not considered optional branches:
65892
65897
  * TRY/CATCH/CLEANUP`,
65893
65898
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65894
65899
  };
@@ -65988,12 +65993,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
65988
65993
  key: "no_prefixes",
65989
65994
  title: "No Prefixes",
65990
65995
  shortDescription: `Dont use hungarian notation`,
65991
- extendedInformation: `
65992
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
65993
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
65994
-
65995
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
65996
-
65996
+ extendedInformation: `
65997
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
65998
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
65999
+
66000
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
66001
+
65997
66002
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
65998
66003
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
65999
66004
  badExample: `DATA lv_foo TYPE i.`,
@@ -66172,7 +66177,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
66172
66177
  return {
66173
66178
  key: "no_public_attributes",
66174
66179
  title: "No public attributes",
66175
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
66180
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
66176
66181
  Exceptions are excluded from this rule.`,
66177
66182
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
66178
66183
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -66273,13 +66278,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
66273
66278
  key: "no_yoda_conditions",
66274
66279
  title: "No Yoda conditions",
66275
66280
  shortDescription: `Finds Yoda conditions and reports issues`,
66276
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
66277
-
66281
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
66282
+
66278
66283
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
66279
66284
  tags: [_irule_1.RuleTag.SingleFile],
66280
- badExample: `IF 0 <> sy-subrc.
66285
+ badExample: `IF 0 <> sy-subrc.
66281
66286
  ENDIF.`,
66282
- goodExample: `IF sy-subrc <> 0.
66287
+ goodExample: `IF sy-subrc <> 0.
66283
66288
  ENDIF.`,
66284
66289
  };
66285
66290
  }
@@ -66380,8 +66385,8 @@ class NROBConsistency {
66380
66385
  key: "nrob_consistency",
66381
66386
  title: "Number range consistency",
66382
66387
  shortDescription: `Consistency checks for number ranges`,
66383
- extendedInformation: `Issue reported if percentage warning is over 50%
66384
-
66388
+ extendedInformation: `Issue reported if percentage warning is over 50%
66389
+
66385
66390
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
66386
66391
  tags: [_irule_1.RuleTag.SingleFile],
66387
66392
  };
@@ -66658,58 +66663,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
66658
66663
  title: "Obsolete statements",
66659
66664
  shortDescription: `Checks for usages of certain obsolete statements`,
66660
66665
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
66661
- extendedInformation: `
66662
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
66663
-
66664
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
66665
-
66666
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
66667
-
66668
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
66669
-
66670
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
66671
-
66672
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
66673
-
66674
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66675
-
66676
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66677
-
66678
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
66679
-
66680
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
66681
-
66682
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
66683
-
66684
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
66685
-
66686
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
66687
-
66688
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
66689
-
66690
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
66691
- SELECT COUNT(*) is considered okay
66692
-
66693
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
66694
-
66695
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
66696
-
66697
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
66698
-
66699
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
66700
-
66701
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
66702
-
66666
+ extendedInformation: `
66667
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
66668
+
66669
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
66670
+
66671
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
66672
+
66673
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
66674
+
66675
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
66676
+
66677
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
66678
+
66679
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66680
+
66681
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
66682
+
66683
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
66684
+
66685
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
66686
+
66687
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
66688
+
66689
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
66690
+
66691
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
66692
+
66693
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
66694
+
66695
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
66696
+ SELECT COUNT(*) is considered okay
66697
+
66698
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
66699
+
66700
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
66701
+
66702
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
66703
+
66704
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
66705
+
66706
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
66707
+
66703
66708
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
66704
- badExample: `REFRESH itab.
66705
-
66706
- COMPUTE foo = 2 + 2.
66707
-
66708
- MULTIPLY lv_foo BY 2.
66709
-
66710
- INTERFACE intf LOAD.
66711
-
66712
- IF foo IS SUPPLIED.
66709
+ badExample: `REFRESH itab.
66710
+
66711
+ COMPUTE foo = 2 + 2.
66712
+
66713
+ MULTIPLY lv_foo BY 2.
66714
+
66715
+ INTERFACE intf LOAD.
66716
+
66717
+ IF foo IS SUPPLIED.
66713
66718
  ENDIF.`,
66714
66719
  };
66715
66720
  }
@@ -67049,9 +67054,9 @@ class OmitParameterName {
67049
67054
  key: "omit_parameter_name",
67050
67055
  title: "Omit parameter name",
67051
67056
  shortDescription: `Omit the parameter name in single parameter calls`,
67052
- extendedInformation: `
67053
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
67054
-
67057
+ extendedInformation: `
67058
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
67059
+
67055
67060
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
67056
67061
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
67057
67062
  badExample: `method( param = 2 ).`,
@@ -67257,20 +67262,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
67257
67262
  shortDescription: `Omit RECEIVING`,
67258
67263
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
67259
67264
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67260
- badExample: `
67261
- upload_pack(
67262
- EXPORTING
67263
- io_client = lo_client
67264
- iv_url = iv_url
67265
- iv_deepen_level = iv_deepen_level
67266
- it_hashes = lt_hashes
67267
- RECEIVING
67265
+ badExample: `
67266
+ upload_pack(
67267
+ EXPORTING
67268
+ io_client = lo_client
67269
+ iv_url = iv_url
67270
+ iv_deepen_level = iv_deepen_level
67271
+ it_hashes = lt_hashes
67272
+ RECEIVING
67268
67273
  rt_objects = et_objects ).`,
67269
- goodExample: `
67270
- et_objects = upload_pack(
67271
- io_client = lo_client
67272
- iv_url = iv_url
67273
- iv_deepen_level = iv_deepen_level
67274
+ goodExample: `
67275
+ et_objects = upload_pack(
67276
+ io_client = lo_client
67277
+ iv_url = iv_url
67278
+ iv_deepen_level = iv_deepen_level
67274
67279
  it_hashes = lt_hashes ).`,
67275
67280
  };
67276
67281
  }
@@ -67334,8 +67339,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
67334
67339
  return {
67335
67340
  key: "parser_702_chaining",
67336
67341
  title: "Parser Error, bad chanining on 702",
67337
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
67338
- this rule finds these and reports errors.
67342
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
67343
+ this rule finds these and reports errors.
67339
67344
  Only active on target version 702 and below.`,
67340
67345
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
67341
67346
  };
@@ -67415,8 +67420,8 @@ class ParserError {
67415
67420
  return {
67416
67421
  key: "parser_error",
67417
67422
  title: "Parser error",
67418
- shortDescription: `Checks for syntax not recognized by abaplint.
67419
-
67423
+ shortDescription: `Checks for syntax not recognized by abaplint.
67424
+
67420
67425
  See recognized syntax at https://syntax.abaplint.org`,
67421
67426
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
67422
67427
  };
@@ -67501,7 +67506,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
67501
67506
  return {
67502
67507
  key: "parser_missing_space",
67503
67508
  title: "Parser Error, missing space",
67504
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
67509
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
67505
67510
  This rule makes sure the spaces are consistently required across the language.`,
67506
67511
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
67507
67512
  badExample: `IF ( foo = 'bar').`,
@@ -67913,25 +67918,25 @@ class PreferInline {
67913
67918
  key: "prefer_inline",
67914
67919
  title: "Prefer Inline Declarations",
67915
67920
  shortDescription: `Prefer inline to up-front declarations.`,
67916
- extendedInformation: `EXPERIMENTAL
67917
-
67918
- Activates if language version is v740sp02 or above.
67919
-
67920
- Variables must be local(METHOD or FORM).
67921
-
67922
- No generic or void typed variables. No syntax errors.
67923
-
67924
- First position used must be a full/pure write.
67925
-
67926
- Move statment is not a cast(?=)
67927
-
67921
+ extendedInformation: `EXPERIMENTAL
67922
+
67923
+ Activates if language version is v740sp02 or above.
67924
+
67925
+ Variables must be local(METHOD or FORM).
67926
+
67927
+ No generic or void typed variables. No syntax errors.
67928
+
67929
+ First position used must be a full/pure write.
67930
+
67931
+ Move statment is not a cast(?=)
67932
+
67928
67933
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
67929
67934
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
67930
- badExample: `DATA foo TYPE i.
67931
- foo = 2.
67932
- DATA percentage TYPE decfloat34.
67935
+ badExample: `DATA foo TYPE i.
67936
+ foo = 2.
67937
+ DATA percentage TYPE decfloat34.
67933
67938
  percentage = ( comment_number / abs_statement_number ) * 100.`,
67934
- goodExample: `DATA(foo) = 2.
67939
+ goodExample: `DATA(foo) = 2.
67935
67940
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
67936
67941
  };
67937
67942
  }
@@ -68145,18 +68150,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
68145
68150
  key: "prefer_is_not",
68146
68151
  title: "Prefer IS NOT to NOT IS",
68147
68152
  shortDescription: `Prefer IS NOT to NOT IS`,
68148
- extendedInformation: `
68149
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
68150
-
68153
+ extendedInformation: `
68154
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
68155
+
68151
68156
  "if not is_valid( )." examples are skipped`,
68152
68157
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
68153
- goodExample: `IF variable IS NOT INITIAL.
68154
- IF variable NP 'TODO*'.
68155
- IF variable <> 42.
68158
+ goodExample: `IF variable IS NOT INITIAL.
68159
+ IF variable NP 'TODO*'.
68160
+ IF variable <> 42.
68156
68161
  IF variable CO 'hello'.`,
68157
- badExample: `IF NOT variable IS INITIAL.
68158
- IF NOT variable CP 'TODO*'.
68159
- IF NOT variable = 42.
68162
+ badExample: `IF NOT variable IS INITIAL.
68163
+ IF NOT variable CP 'TODO*'.
68164
+ IF NOT variable = 42.
68160
68165
  IF NOT variable CA 'hello'.`,
68161
68166
  };
68162
68167
  }
@@ -68344,14 +68349,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
68344
68349
  key: "prefer_raise_exception_new",
68345
68350
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
68346
68351
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
68347
- extendedInformation: `
68348
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
68349
-
68352
+ extendedInformation: `
68353
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
68354
+
68350
68355
  From 752 and up`,
68351
68356
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
68352
68357
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
68353
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
68354
- EXPORTING
68358
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
68359
+ EXPORTING
68355
68360
  previous = exception.`,
68356
68361
  };
68357
68362
  }
@@ -68429,12 +68434,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
68429
68434
  key: "prefer_returning_to_exporting",
68430
68435
  title: "Prefer RETURNING to EXPORTING",
68431
68436
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
68432
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
68437
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
68433
68438
  https://docs.abapopenchecks.org/checks/44/`,
68434
68439
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
68435
- badExample: `CLASS lcl DEFINITION.
68436
- PUBLIC SECTION.
68437
- METHODS test EXPORTING ev_foo TYPE i.
68440
+ badExample: `CLASS lcl DEFINITION.
68441
+ PUBLIC SECTION.
68442
+ METHODS test EXPORTING ev_foo TYPE i.
68438
68443
  ENDCLASS.`,
68439
68444
  };
68440
68445
  }
@@ -68530,8 +68535,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
68530
68535
  key: "prefer_xsdbool",
68531
68536
  title: "Prefer xsdbool over boolc",
68532
68537
  shortDescription: `Prefer xsdbool over boolc`,
68533
- extendedInformation: `Activates if language version is v740sp08 or above.
68534
-
68538
+ extendedInformation: `Activates if language version is v740sp08 or above.
68539
+
68535
68540
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
68536
68541
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
68537
68542
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -68603,9 +68608,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
68603
68608
  title: "Preferred compare operator",
68604
68609
  shortDescription: `Configure undesired operator variants`,
68605
68610
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
68606
- badExample: `IF foo EQ bar.
68611
+ badExample: `IF foo EQ bar.
68607
68612
  ENDIF.`,
68608
- goodExample: `IF foo = bar.
68613
+ goodExample: `IF foo = bar.
68609
68614
  ENDIF.`,
68610
68615
  };
68611
68616
  }
@@ -68829,26 +68834,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
68829
68834
  key: "reduce_procedural_code",
68830
68835
  title: "Reduce procedural code",
68831
68836
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
68832
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
68833
-
68834
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
68835
-
68837
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
68838
+
68839
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
68840
+
68836
68841
  Comments are not counted as statements.`,
68837
68842
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
68838
- badExample: `FORM foo.
68839
- DATA lv_bar TYPE i.
68840
- lv_bar = 2 + 2.
68841
- IF lv_bar = 4.
68842
- WRITE 'hello world'.
68843
- ENDIF.
68844
- DATA lv_bar TYPE i.
68845
- lv_bar = 2 + 2.
68846
- IF lv_bar = 4.
68847
- WRITE 'hello world'.
68848
- ENDIF.
68843
+ badExample: `FORM foo.
68844
+ DATA lv_bar TYPE i.
68845
+ lv_bar = 2 + 2.
68846
+ IF lv_bar = 4.
68847
+ WRITE 'hello world'.
68848
+ ENDIF.
68849
+ DATA lv_bar TYPE i.
68850
+ lv_bar = 2 + 2.
68851
+ IF lv_bar = 4.
68852
+ WRITE 'hello world'.
68853
+ ENDIF.
68849
68854
  ENDFORM.`,
68850
- goodExample: `FORM foo.
68851
- NEW zcl_global_class( )->run_logic( ).
68855
+ goodExample: `FORM foo.
68856
+ NEW zcl_global_class( )->run_logic( ).
68852
68857
  ENDFORM.`,
68853
68858
  };
68854
68859
  }
@@ -69092,10 +69097,10 @@ class RemoveDescriptions {
69092
69097
  return {
69093
69098
  key: "remove_descriptions",
69094
69099
  title: "Remove descriptions",
69095
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
69096
-
69097
- Class descriptions are required, see rule description_empty.
69098
-
69100
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
69101
+
69102
+ Class descriptions are required, see rule description_empty.
69103
+
69099
69104
  Consider using ABAP Doc for documentation.`,
69100
69105
  tags: [],
69101
69106
  };
@@ -69220,14 +69225,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
69220
69225
  tags: [_irule_1.RuleTag.SingleFile],
69221
69226
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
69222
69227
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
69223
- badExample: `CALL FUNCTION 'ZRFC'
69228
+ badExample: `CALL FUNCTION 'ZRFC'
69224
69229
  DESTINATION lv_rfc.`,
69225
- goodExample: `CALL FUNCTION 'ZRFC'
69226
- DESTINATION lv_rfc
69227
- EXCEPTIONS
69228
- system_failure = 1 MESSAGE msg
69229
- communication_failure = 2 MESSAGE msg
69230
- resource_failure = 3
69230
+ goodExample: `CALL FUNCTION 'ZRFC'
69231
+ DESTINATION lv_rfc
69232
+ EXCEPTIONS
69233
+ system_failure = 1 MESSAGE msg
69234
+ communication_failure = 2 MESSAGE msg
69235
+ resource_failure = 3
69231
69236
  OTHERS = 4.`,
69232
69237
  };
69233
69238
  }
@@ -69311,11 +69316,11 @@ class SelectAddOrderBy {
69311
69316
  key: "select_add_order_by",
69312
69317
  title: "SELECT add ORDER BY",
69313
69318
  shortDescription: `SELECTs add ORDER BY clause`,
69314
- extendedInformation: `
69315
- This will make sure that the SELECT statement returns results in the same sequence on different databases
69316
-
69317
- add ORDER BY PRIMARY KEY if in doubt
69318
-
69319
+ extendedInformation: `
69320
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
69321
+
69322
+ add ORDER BY PRIMARY KEY if in doubt
69323
+
69319
69324
  If the target is a sorted/hashed table, no issue is reported`,
69320
69325
  tags: [_irule_1.RuleTag.SingleFile],
69321
69326
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -69446,14 +69451,14 @@ class SelectPerformance {
69446
69451
  key: "select_performance",
69447
69452
  title: "SELECT performance",
69448
69453
  shortDescription: `Various checks regarding SELECT performance.`,
69449
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
69450
-
69454
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
69455
+
69451
69456
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
69452
69457
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
69453
- badExample: `SELECT field1, field2 FROM table
69454
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
69458
+ badExample: `SELECT field1, field2 FROM table
69459
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
69455
69460
  ENDSELECT.`,
69456
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
69461
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
69457
69462
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
69458
69463
  };
69459
69464
  }
@@ -69567,8 +69572,8 @@ class SelectSingleFullKey {
69567
69572
  key: "select_single_full_key",
69568
69573
  title: "Detect SELECT SINGLE which are possibily not unique",
69569
69574
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
69570
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
69571
-
69575
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
69576
+
69572
69577
  If the statement contains a JOIN it is not checked`,
69573
69578
  pseudoComment: "EC CI_NOORDER",
69574
69579
  tags: [_irule_1.RuleTag.Quickfix],
@@ -69992,8 +69997,8 @@ class SICFConsistency {
69992
69997
  key: "sicf_consistency",
69993
69998
  title: "SICF consistency",
69994
69999
  shortDescription: `Checks the validity of ICF services`,
69995
- extendedInformation: `* Class defined in handler must exist
69996
- * Class must not have any syntax errors
70000
+ extendedInformation: `* Class defined in handler must exist
70001
+ * Class must not have any syntax errors
69997
70002
  * Class must implement interface IF_HTTP_EXTENSION`,
69998
70003
  };
69999
70004
  }
@@ -70105,23 +70110,23 @@ class SlowParameterPassing {
70105
70110
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
70106
70111
  extendedInformation: `Method parameters defined in interfaces is not checked`,
70107
70112
  tags: [_irule_1.RuleTag.Performance],
70108
- badExample: `CLASS lcl DEFINITION.
70109
- PUBLIC SECTION.
70110
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
70111
- ENDCLASS.
70112
- CLASS lcl IMPLEMENTATION.
70113
- METHOD bar.
70114
- WRITE sdf.
70115
- ENDMETHOD.
70113
+ badExample: `CLASS lcl DEFINITION.
70114
+ PUBLIC SECTION.
70115
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
70116
+ ENDCLASS.
70117
+ CLASS lcl IMPLEMENTATION.
70118
+ METHOD bar.
70119
+ WRITE sdf.
70120
+ ENDMETHOD.
70116
70121
  ENDCLASS.`,
70117
- goodExample: `CLASS lcl DEFINITION.
70118
- PUBLIC SECTION.
70119
- METHODS bar IMPORTING sdf TYPE string.
70120
- ENDCLASS.
70121
- CLASS lcl IMPLEMENTATION.
70122
- METHOD bar.
70123
- WRITE sdf.
70124
- ENDMETHOD.
70122
+ goodExample: `CLASS lcl DEFINITION.
70123
+ PUBLIC SECTION.
70124
+ METHODS bar IMPORTING sdf TYPE string.
70125
+ ENDCLASS.
70126
+ CLASS lcl IMPLEMENTATION.
70127
+ METHOD bar.
70128
+ WRITE sdf.
70129
+ ENDMETHOD.
70125
70130
  ENDCLASS.`,
70126
70131
  };
70127
70132
  }
@@ -70378,8 +70383,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
70378
70383
  key: "space_before_dot",
70379
70384
  title: "Space before dot",
70380
70385
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
70381
- extendedInformation: `
70382
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
70386
+ extendedInformation: `
70387
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
70383
70388
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
70384
70389
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70385
70390
  badExample: `WRITE bar .`,
@@ -70565,12 +70570,12 @@ class SQLValueConversion {
70565
70570
  key: "sql_value_conversion",
70566
70571
  title: "Implicit SQL Value Conversion",
70567
70572
  shortDescription: `Ensure types match when selecting from database`,
70568
- extendedInformation: `
70569
- * Integer to CHAR conversion
70570
- * Integer to NUMC conversion
70571
- * NUMC to Integer conversion
70572
- * CHAR to Integer conversion
70573
- * Source field longer than database field, CHAR -> CHAR
70573
+ extendedInformation: `
70574
+ * Integer to CHAR conversion
70575
+ * Integer to NUMC conversion
70576
+ * NUMC to Integer conversion
70577
+ * CHAR to Integer conversion
70578
+ * Source field longer than database field, CHAR -> CHAR
70574
70579
  * Source field longer than database field, NUMC -> NUMC`,
70575
70580
  tags: [],
70576
70581
  };
@@ -70642,7 +70647,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
70642
70647
  key: "start_at_tab",
70643
70648
  title: "Start at tab",
70644
70649
  shortDescription: `Checks that statements start at tabstops.`,
70645
- extendedInformation: `Reports max 100 issues per file
70650
+ extendedInformation: `Reports max 100 issues per file
70646
70651
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
70647
70652
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70648
70653
  badExample: ` WRITE a.`,
@@ -70819,12 +70824,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
70819
70824
  key: "strict_sql",
70820
70825
  title: "Strict SQL",
70821
70826
  shortDescription: `Strict SQL`,
70822
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
70823
-
70824
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
70825
-
70826
- Also see separate rule sql_escape_host_variables
70827
-
70827
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
70828
+
70829
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
70830
+
70831
+ Also see separate rule sql_escape_host_variables
70832
+
70828
70833
  Activates from v750 and up`,
70829
70834
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
70830
70835
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -71078,11 +71083,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
71078
71083
  key: "sy_modification",
71079
71084
  title: "Modification of SY fields",
71080
71085
  shortDescription: `Finds modification of sy fields`,
71081
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
71082
-
71086
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
71087
+
71083
71088
  Changes to SY-TVAR* fields are not reported`,
71084
71089
  tags: [_irule_1.RuleTag.SingleFile],
71085
- badExample: `sy-uname = 2.
71090
+ badExample: `sy-uname = 2.
71086
71091
  sy = sy.`,
71087
71092
  };
71088
71093
  }
@@ -71144,8 +71149,8 @@ class TABLEnhancementCategory {
71144
71149
  key: "tabl_enhancement_category",
71145
71150
  title: "TABL enhancement category must be set",
71146
71151
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
71147
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
71148
-
71152
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
71153
+
71149
71154
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
71150
71155
  tags: [],
71151
71156
  };
@@ -71273,9 +71278,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
71273
71278
  title: "Type FORM parameters",
71274
71279
  shortDescription: `Checks for untyped FORM parameters`,
71275
71280
  tags: [_irule_1.RuleTag.SingleFile],
71276
- badExample: `FORM foo USING bar.
71281
+ badExample: `FORM foo USING bar.
71277
71282
  ENDFORM.`,
71278
- goodExample: `FORM foo USING bar TYPE string.
71283
+ goodExample: `FORM foo USING bar TYPE string.
71279
71284
  ENDFORM.`,
71280
71285
  };
71281
71286
  }
@@ -71948,38 +71953,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
71948
71953
  key: "unnecessary_pragma",
71949
71954
  title: "Unnecessary Pragma",
71950
71955
  shortDescription: `Finds pragmas which can be removed`,
71951
- extendedInformation: `* NO_HANDLER with handler
71952
-
71953
- * NEEDED without definition
71954
-
71955
- * NO_TEXT without texts
71956
-
71957
- * SUBRC_OK where sy-subrc is checked
71958
-
71956
+ extendedInformation: `* NO_HANDLER with handler
71957
+
71958
+ * NEEDED without definition
71959
+
71960
+ * NO_TEXT without texts
71961
+
71962
+ * SUBRC_OK where sy-subrc is checked
71963
+
71959
71964
  NO_HANDLER inside macros are not checked`,
71960
71965
  tags: [_irule_1.RuleTag.SingleFile],
71961
- badExample: `TRY.
71962
- ...
71963
- CATCH zcx_abapgit_exception ##NO_HANDLER.
71964
- RETURN. " it has a handler
71965
- ENDTRY.
71966
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
71967
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
71968
- IF sy-subrc <> 0.
71966
+ badExample: `TRY.
71967
+ ...
71968
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
71969
+ RETURN. " it has a handler
71970
+ ENDTRY.
71971
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
71972
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
71973
+ IF sy-subrc <> 0.
71969
71974
  ENDIF.`,
71970
- goodExample: `TRY.
71971
- ...
71972
- CATCH zcx_abapgit_exception.
71973
- RETURN.
71974
- ENDTRY.
71975
- MESSAGE w125(zbar) WITH c_foo INTO message.
71976
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
71977
- IF sy-subrc <> 0.
71978
- ENDIF.
71979
-
71980
- DATA: BEGIN OF blah ##NEEDED,
71981
- test1 TYPE string,
71982
- test2 TYPE string,
71975
+ goodExample: `TRY.
71976
+ ...
71977
+ CATCH zcx_abapgit_exception.
71978
+ RETURN.
71979
+ ENDTRY.
71980
+ MESSAGE w125(zbar) WITH c_foo INTO message.
71981
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
71982
+ IF sy-subrc <> 0.
71983
+ ENDIF.
71984
+
71985
+ DATA: BEGIN OF blah ##NEEDED,
71986
+ test1 TYPE string,
71987
+ test2 TYPE string,
71983
71988
  END OF blah.`,
71984
71989
  };
71985
71990
  }
@@ -72146,18 +72151,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
72146
72151
  shortDescription: `Finds unnecessary RETURN statements`,
72147
72152
  extendedInformation: `Finds unnecessary RETURN statements`,
72148
72153
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
72149
- badExample: `FORM hello1.
72150
- WRITE 'world'.
72151
- RETURN.
72152
- ENDFORM.
72153
-
72154
- FORM foo.
72155
- IF 1 = 2.
72156
- RETURN.
72157
- ENDIF.
72154
+ badExample: `FORM hello1.
72155
+ WRITE 'world'.
72156
+ RETURN.
72157
+ ENDFORM.
72158
+
72159
+ FORM foo.
72160
+ IF 1 = 2.
72161
+ RETURN.
72162
+ ENDIF.
72158
72163
  ENDFORM.`,
72159
- goodExample: `FORM hello2.
72160
- WRITE 'world'.
72164
+ goodExample: `FORM hello2.
72165
+ WRITE 'world'.
72161
72166
  ENDFORM.`,
72162
72167
  };
72163
72168
  }
@@ -72508,13 +72513,13 @@ class UnusedMacros {
72508
72513
  title: "Unused macros",
72509
72514
  shortDescription: `Checks for unused macro definitions definitions`,
72510
72515
  tags: [_irule_1.RuleTag.Quickfix],
72511
- badExample: `DEFINE foobar1.
72512
- WRITE 'hello'.
72516
+ badExample: `DEFINE foobar1.
72517
+ WRITE 'hello'.
72513
72518
  END-OF-DEFINITION.`,
72514
- goodExample: `DEFINE foobar2.
72515
- WRITE 'hello'.
72516
- END-OF-DEFINITION.
72517
-
72519
+ goodExample: `DEFINE foobar2.
72520
+ WRITE 'hello'.
72521
+ END-OF-DEFINITION.
72522
+
72518
72523
  foobar2.`,
72519
72524
  };
72520
72525
  }
@@ -72622,17 +72627,17 @@ class UnusedMethods {
72622
72627
  key: "unused_methods",
72623
72628
  title: "Unused methods",
72624
72629
  shortDescription: `Checks for unused methods`,
72625
- extendedInformation: `Checks private and protected methods.
72626
-
72627
- Unused methods are not reported if the object contains parser or syntax errors.
72628
-
72629
- Skips:
72630
- * methods FOR TESTING
72631
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
72632
- * class_constructor + constructor methods
72633
- * event handlers
72634
- * methods that are redefined
72635
- * INCLUDEs
72630
+ extendedInformation: `Checks private and protected methods.
72631
+
72632
+ Unused methods are not reported if the object contains parser or syntax errors.
72633
+
72634
+ Skips:
72635
+ * methods FOR TESTING
72636
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
72637
+ * class_constructor + constructor methods
72638
+ * event handlers
72639
+ * methods that are redefined
72640
+ * INCLUDEs
72636
72641
  `,
72637
72642
  tags: [],
72638
72643
  pragma: "##CALLED",
@@ -73066,23 +73071,23 @@ class UnusedVariables {
73066
73071
  key: "unused_variables",
73067
73072
  title: "Unused variables",
73068
73073
  shortDescription: `Checks for unused variables and constants`,
73069
- extendedInformation: `Skips event parameters.
73070
-
73071
- Note that this currently does not work if the source code uses macros.
73072
-
73073
- Unused variables are not reported if the object contains parser or syntax errors.
73074
-
73074
+ extendedInformation: `Skips event parameters.
73075
+
73076
+ Note that this currently does not work if the source code uses macros.
73077
+
73078
+ Unused variables are not reported if the object contains parser or syntax errors.
73079
+
73075
73080
  Errors found in INCLUDES are reported for the main program.`,
73076
73081
  tags: [_irule_1.RuleTag.Quickfix],
73077
73082
  pragma: "##NEEDED",
73078
73083
  pseudoComment: "EC NEEDED",
73079
- badExample: `DATA: BEGIN OF blah1,
73080
- test TYPE string,
73081
- test2 TYPE string,
73084
+ badExample: `DATA: BEGIN OF blah1,
73085
+ test TYPE string,
73086
+ test2 TYPE string,
73082
73087
  END OF blah1.`,
73083
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
73084
- test TYPE string,
73085
- test2 TYPE string,
73088
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
73089
+ test TYPE string,
73090
+ test2 TYPE string,
73086
73091
  END OF blah2.`,
73087
73092
  };
73088
73093
  }
@@ -73301,15 +73306,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
73301
73306
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
73302
73307
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
73303
73308
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
73304
- badExample: `IF line IS INITIAL.
73305
- has_entries = abap_false.
73306
- ELSE.
73307
- has_entries = abap_true.
73308
- ENDIF.
73309
-
73309
+ badExample: `IF line IS INITIAL.
73310
+ has_entries = abap_false.
73311
+ ELSE.
73312
+ has_entries = abap_true.
73313
+ ENDIF.
73314
+
73310
73315
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
73311
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
73312
-
73316
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
73317
+
73313
73318
  DATA(fsdf) = xsdbool( foo <> bar ).`,
73314
73319
  };
73315
73320
  }
@@ -73427,15 +73432,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
73427
73432
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
73428
73433
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
73429
73434
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
73430
- badExample: `INTERFACE lif.
73431
- METHODS load_data
73432
- EXCEPTIONS
73433
- invalid_parameter.
73435
+ badExample: `INTERFACE lif.
73436
+ METHODS load_data
73437
+ EXCEPTIONS
73438
+ invalid_parameter.
73434
73439
  ENDINTERFACE.`,
73435
- goodExample: `INTERFACE lif.
73436
- METHODS load_data
73437
- RAISING
73438
- cx_something.
73440
+ goodExample: `INTERFACE lif.
73441
+ METHODS load_data
73442
+ RAISING
73443
+ cx_something.
73439
73444
  ENDINTERFACE.`,
73440
73445
  };
73441
73446
  }
@@ -73495,15 +73500,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
73495
73500
  key: "use_line_exists",
73496
73501
  title: "Use line_exists",
73497
73502
  shortDescription: `Use line_exists, from 740sp02 and up`,
73498
- extendedInformation: `
73499
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
73500
-
73503
+ extendedInformation: `
73504
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
73505
+
73501
73506
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
73502
73507
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
73503
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
73504
- IF sy-subrc = 0.
73508
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
73509
+ IF sy-subrc = 0.
73505
73510
  ENDIF.`,
73506
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
73511
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
73507
73512
  ENDIF.`,
73508
73513
  };
73509
73514
  }
@@ -73613,10 +73618,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
73613
73618
  key: "use_new",
73614
73619
  title: "Use NEW",
73615
73620
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
73616
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
73617
-
73618
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
73619
-
73621
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
73622
+
73623
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
73624
+
73620
73625
  Applicable from v740sp02 and up`,
73621
73626
  badExample: `CREATE OBJECT ref.`,
73622
73627
  goodExample: `ref = NEW #( ).`,
@@ -73714,13 +73719,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
73714
73719
  title: "WHEN OTHERS last",
73715
73720
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
73716
73721
  tags: [_irule_1.RuleTag.SingleFile],
73717
- badExample: `CASE bar.
73718
- WHEN OTHERS.
73719
- WHEN 2.
73722
+ badExample: `CASE bar.
73723
+ WHEN OTHERS.
73724
+ WHEN 2.
73720
73725
  ENDCASE.`,
73721
- goodExample: `CASE bar.
73722
- WHEN 2.
73723
- WHEN OTHERS.
73726
+ goodExample: `CASE bar.
73727
+ WHEN 2.
73728
+ WHEN OTHERS.
73724
73729
  ENDCASE.`,
73725
73730
  };
73726
73731
  }