@abaplint/cli 2.105.15 → 2.105.17

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 +775 -704
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -7196,7 +7196,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
7196
7196
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
7197
7197
  class RaiseWith extends combi_1.Expression {
7198
7198
  getRunnable() {
7199
- const wit = (0, combi_1.seq)("WITH", _1.Source, (0, combi_1.opt)(_1.Source), (0, combi_1.opt)(_1.Source), (0, combi_1.opt)(_1.Source));
7199
+ const wit = (0, combi_1.seq)("WITH", _1.SimpleSource3, (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3));
7200
7200
  return wit;
7201
7201
  }
7202
7202
  }
@@ -26009,7 +26009,7 @@ class MethodSource {
26009
26009
  && first.get() instanceof Expressions.Dynamic
26010
26010
  && first instanceof nodes_1.ExpressionNode
26011
26011
  && ((_b = children[0]) === null || _b === void 0 ? void 0 : _b.concatTokens()) === "=>") {
26012
- const name = (_c = first.findDirectExpression(Expressions.Constant)) === null || _c === void 0 ? void 0 : _c.concatTokens().replace(/'/g, "");
26012
+ const name = (_c = first.findDirectExpression(Expressions.Constant)) === null || _c === void 0 ? void 0 : _c.concatTokens().replace(/'/g, "").replace(/`/g, "");
26013
26013
  if (name !== undefined && scope.findClassDefinition(name) === undefined) {
26014
26014
  throw new Error(`Class "${name}" not found/released`);
26015
26015
  }
@@ -26283,7 +26283,7 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
26283
26283
  const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
26284
26284
  class RaiseWith {
26285
26285
  runSyntax(node, scope, filename) {
26286
- for (const f of node.findDirectExpressions(Expressions.Source)) {
26286
+ for (const f of node.findDirectExpressions(Expressions.SimpleSource3)) {
26287
26287
  new source_1.Source().runSyntax(f, scope, filename);
26288
26288
  }
26289
26289
  }
@@ -30959,13 +30959,33 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_module
30959
30959
  const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
30960
30960
  const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
30961
30961
  const component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js");
30962
+ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
30962
30963
  class ModifyInternal {
30963
30964
  runSyntax(node, scope, filename) {
30964
30965
  for (const s of node.findDirectExpressions(Expressions.Source)) {
30965
30966
  new source_1.Source().runSyntax(s, scope, filename);
30966
30967
  }
30967
- for (const t of node.findDirectExpressions(Expressions.Target)) {
30968
- new target_1.Target().runSyntax(t, scope, filename);
30968
+ // there is only one
30969
+ const targetExpression = node.findFirstExpression(Expressions.Target);
30970
+ if (targetExpression) {
30971
+ // it might be a dynamic target
30972
+ const targetType = new target_1.Target().runSyntax(targetExpression, scope, filename);
30973
+ if (targetType instanceof basic_1.VoidType
30974
+ || targetType instanceof basic_1.AnyType
30975
+ || targetType instanceof basic_1.UnknownType) {
30976
+ // ok
30977
+ }
30978
+ else if (targetType instanceof basic_1.TableType) {
30979
+ if (node.findDirectTokenByText("TABLE")
30980
+ && node.findDirectTokenByText("INDEX")
30981
+ && targetType.isWithHeader() === false) {
30982
+ // MODIFY TABLE INDEX
30983
+ throw new Error("Table does not have header line");
30984
+ }
30985
+ }
30986
+ else {
30987
+ throw new Error("Not an internal table");
30988
+ }
30969
30989
  }
30970
30990
  const target = node.findDirectExpression(Expressions.FSTarget);
30971
30991
  if (target) {
@@ -31203,6 +31223,9 @@ class Parameter {
31203
31223
  if (nameToken && nameToken.getStr().length > 8) {
31204
31224
  throw new Error("Parameter name too long, " + nameToken.getStr());
31205
31225
  }
31226
+ if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
31227
+ throw new Error("RADIOBUTTON and LENGTH not possible together");
31228
+ }
31206
31229
  const bfound = new basic_types_1.BasicTypes(filename, scope).parseType(node);
31207
31230
  if (nameToken && bfound) {
31208
31231
  scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, bfound));
@@ -34146,13 +34169,13 @@ class FlowGraph {
34146
34169
  this.label = label;
34147
34170
  }
34148
34171
  toDigraph() {
34149
- return `digraph G {
34150
- labelloc="t";
34151
- label="${this.label}";
34152
- graph [fontname = "helvetica"];
34153
- node [fontname = "helvetica", shape="box"];
34154
- edge [fontname = "helvetica"];
34155
- ${this.toTextEdges()}
34172
+ return `digraph G {
34173
+ labelloc="t";
34174
+ label="${this.label}";
34175
+ graph [fontname = "helvetica"];
34176
+ node [fontname = "helvetica", shape="box"];
34177
+ edge [fontname = "helvetica"];
34178
+ ${this.toTextEdges()}
34156
34179
  }`;
34157
34180
  }
34158
34181
  listSources(node) {
@@ -34519,6 +34542,32 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
34519
34542
  }
34520
34543
  throw new Error("ExpressionNode, getFirstToken, no children");
34521
34544
  }
34545
+ concatTokensWithLinebreaks() {
34546
+ let str = "";
34547
+ let prev;
34548
+ for (const token of this.getTokens()) {
34549
+ if (token instanceof tokens_1.Pragma) {
34550
+ continue;
34551
+ }
34552
+ if (str === "") {
34553
+ str = token.getStr();
34554
+ }
34555
+ else if (prev && prev.getStr().length + prev.getCol() === token.getCol()
34556
+ && prev.getRow() === token.getRow()) {
34557
+ str = str + token.getStr();
34558
+ }
34559
+ else {
34560
+ if (prev && prev.getRow() !== token.getRow()) {
34561
+ str = str + "\n" + token.getStr();
34562
+ }
34563
+ else {
34564
+ str = str + " " + token.getStr();
34565
+ }
34566
+ }
34567
+ prev = token;
34568
+ }
34569
+ return str;
34570
+ }
34522
34571
  concatTokens() {
34523
34572
  let str = "";
34524
34573
  let prev;
@@ -39747,7 +39796,12 @@ class Config {
39747
39796
  return this.config;
39748
39797
  }
39749
39798
  readByKey(rule, key) {
39750
- return this.config["rules"][rule] ? this.config["rules"][rule][key] : undefined;
39799
+ if (this.config["rules"]) {
39800
+ return this.config["rules"][rule] ? this.config["rules"][rule][key] : undefined;
39801
+ }
39802
+ else {
39803
+ return undefined;
39804
+ }
39751
39805
  }
39752
39806
  readByRule(rule) {
39753
39807
  return this.config["rules"][rule];
@@ -42159,13 +42213,13 @@ class Help {
42159
42213
  /////////////////////////////////////////////////
42160
42214
  static dumpABAP(file, reg, textDocument, position) {
42161
42215
  let content = "";
42162
- content = `
42163
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
42164
- <a href="#_statements" rel="no-refresh">Statements</a> |
42165
- <a href="#_structure" rel="no-refresh">Structure</a> |
42166
- <a href="#_files" rel="no-refresh">Files</a> |
42167
- <a href="#_info" rel="no-refresh">Info Dump</a>
42168
- <hr>
42216
+ content = `
42217
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
42218
+ <a href="#_statements" rel="no-refresh">Statements</a> |
42219
+ <a href="#_structure" rel="no-refresh">Structure</a> |
42220
+ <a href="#_files" rel="no-refresh">Files</a> |
42221
+ <a href="#_info" rel="no-refresh">Info Dump</a>
42222
+ <hr>
42169
42223
  ` +
42170
42224
  "<tt>" + textDocument.uri + " (" +
42171
42225
  (position.line + 1) + ", " +
@@ -51162,7 +51216,7 @@ class Registry {
51162
51216
  }
51163
51217
  static abaplintVersion() {
51164
51218
  // magic, see build script "version.sh"
51165
- return "2.105.15";
51219
+ return "2.105.17";
51166
51220
  }
51167
51221
  getDDICReferences() {
51168
51222
  return this.ddicReferences;
@@ -51478,10 +51532,10 @@ class SevenBitAscii {
51478
51532
  key: "7bit_ascii",
51479
51533
  title: "Check for 7bit ascii",
51480
51534
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
51481
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51482
-
51483
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51484
-
51535
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51536
+
51537
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51538
+
51485
51539
  Checkes files with extensions ".abap" and ".asddls"`,
51486
51540
  tags: [_irule_1.RuleTag.SingleFile],
51487
51541
  };
@@ -51685,10 +51739,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
51685
51739
  key: "abapdoc",
51686
51740
  title: "Check abapdoc",
51687
51741
  shortDescription: `Various checks regarding abapdoc.`,
51688
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51689
-
51690
- Plus class and interface definitions.
51691
-
51742
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51743
+
51744
+ Plus class and interface definitions.
51745
+
51692
51746
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
51693
51747
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
51694
51748
  };
@@ -51826,49 +51880,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
51826
51880
  key: "align_parameters",
51827
51881
  title: "Align Parameters",
51828
51882
  shortDescription: `Checks for vertially aligned parameters`,
51829
- extendedInformation: `Checks:
51830
- * function module calls
51831
- * method calls
51832
- * VALUE constructors
51833
- * NEW constructors
51834
- * RAISE EXCEPTION statements
51835
- * CREATE OBJECT statements
51836
- * RAISE EVENT statements
51837
-
51838
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51839
-
51840
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51841
-
51842
- If parameters are on the same row, no issues are reported, see
51883
+ extendedInformation: `Checks:
51884
+ * function module calls
51885
+ * method calls
51886
+ * VALUE constructors
51887
+ * NEW constructors
51888
+ * RAISE EXCEPTION statements
51889
+ * CREATE OBJECT statements
51890
+ * RAISE EVENT statements
51891
+
51892
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51893
+
51894
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51895
+
51896
+ If parameters are on the same row, no issues are reported, see
51843
51897
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
51844
51898
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
51845
- badExample: `CALL FUNCTION 'FOOBAR'
51846
- EXPORTING
51847
- foo = 2
51848
- parameter = 3.
51849
-
51850
- foobar( moo = 1
51851
- param = 1 ).
51852
-
51853
- foo = VALUE #(
51854
- foo = bar
51899
+ badExample: `CALL FUNCTION 'FOOBAR'
51900
+ EXPORTING
51901
+ foo = 2
51902
+ parameter = 3.
51903
+
51904
+ foobar( moo = 1
51905
+ param = 1 ).
51906
+
51907
+ foo = VALUE #(
51908
+ foo = bar
51855
51909
  moo = 2 ).`,
51856
- goodExample: `CALL FUNCTION 'FOOBAR'
51857
- EXPORTING
51858
- foo = 2
51859
- parameter = 3.
51860
-
51861
- foobar( moo = 1
51862
- param = 1 ).
51863
-
51864
- foo = VALUE #(
51865
- foo = bar
51866
- moo = 2 ).
51867
-
51868
- DATA(sdf) = VALUE type(
51869
- common_val = 2
51870
- another_common = 5
51871
- ( row_value = 4
51910
+ goodExample: `CALL FUNCTION 'FOOBAR'
51911
+ EXPORTING
51912
+ foo = 2
51913
+ parameter = 3.
51914
+
51915
+ foobar( moo = 1
51916
+ param = 1 ).
51917
+
51918
+ foo = VALUE #(
51919
+ foo = bar
51920
+ moo = 2 ).
51921
+
51922
+ DATA(sdf) = VALUE type(
51923
+ common_val = 2
51924
+ another_common = 5
51925
+ ( row_value = 4
51872
51926
  value_foo = 5 ) ).`,
51873
51927
  };
51874
51928
  }
@@ -52344,15 +52398,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
52344
52398
  return {
52345
52399
  key: "ambiguous_statement",
52346
52400
  title: "Check for ambigious statements",
52347
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52348
- Add "TABLE" keyword or "@" for escaping SQL variables
52349
-
52401
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52402
+ Add "TABLE" keyword or "@" for escaping SQL variables
52403
+
52350
52404
  Only works if the target version is 740sp05 or above`,
52351
52405
  tags: [_irule_1.RuleTag.SingleFile],
52352
- badExample: `DELETE foo FROM bar.
52406
+ badExample: `DELETE foo FROM bar.
52353
52407
  MODIFY foo FROM bar.`,
52354
- goodExample: `DELETE foo FROM @bar.
52355
- MODIFY TABLE foo FROM bar.
52408
+ goodExample: `DELETE foo FROM @bar.
52409
+ MODIFY TABLE foo FROM bar.
52356
52410
  MODIFY zfoo FROM @wa.`,
52357
52411
  };
52358
52412
  }
@@ -52422,6 +52476,7 @@ const expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions *
52422
52476
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
52423
52477
  const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
52424
52478
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
52479
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
52425
52480
  class AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {
52426
52481
  constructor() {
52427
52482
  super(...arguments);
@@ -52431,11 +52486,11 @@ class AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {
52431
52486
  this.define = true;
52432
52487
  /** Detects statics */
52433
52488
  this.statics = true;
52434
- /** Detects DEFAULT KEY definitions, from version v740sp02 and up */
52489
+ /** Detects DEFAULT KEY definitions, from version v740sp02 and up. Use pseudo comment DEFAULT_KEY to ignore */
52435
52490
  this.defaultKey = true;
52436
52491
  /** Detects BREAK and BREAK-POINTS */
52437
52492
  this.break = true;
52438
- /** Detects TEST SEAMS */
52493
+ /** Detects TEST SEAMS. Use pseudo comment TEST_SEAM_USAGE to ignore */
52439
52494
  this.testSeams = true;
52440
52495
  /** Detects DESCRIBE TABLE LINES, use lines() instead */
52441
52496
  this.describeLines = true;
@@ -52456,16 +52511,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
52456
52511
  key: "avoid_use",
52457
52512
  title: "Avoid use of certain statements",
52458
52513
  shortDescription: `Detects usage of certain statements.`,
52459
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52460
-
52461
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52462
-
52463
- STATICS: use CLASS-DATA instead
52464
-
52465
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52466
-
52467
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52468
-
52514
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52515
+
52516
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52517
+
52518
+ STATICS: use CLASS-DATA instead
52519
+
52520
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52521
+
52522
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52523
+
52469
52524
  BREAK points`,
52470
52525
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
52471
52526
  };
@@ -52483,7 +52538,9 @@ BREAK points`,
52483
52538
  var _a;
52484
52539
  const issues = [];
52485
52540
  let isStaticsBlock = false;
52486
- for (const statementNode of file.getStatements()) {
52541
+ const statements = file.getStatements();
52542
+ for (let i = 0; i < statements.length; i++) {
52543
+ const statementNode = statements[i];
52487
52544
  const statement = statementNode.get();
52488
52545
  let message = undefined;
52489
52546
  let fix = undefined;
@@ -52511,6 +52568,10 @@ BREAK points`,
52511
52568
  message = "EXPORT TO DATABASE";
52512
52569
  }
52513
52570
  else if (this.conf.testSeams && statement instanceof Statements.TestSeam) {
52571
+ const next = statements[i + 1];
52572
+ if ((next === null || next === void 0 ? void 0 : next.get()) instanceof _statement_1.Comment && next.concatTokens().includes("EC TEST_SEAM_USAGE")) {
52573
+ continue;
52574
+ }
52514
52575
  message = "TEST-SEAM";
52515
52576
  }
52516
52577
  else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {
@@ -52530,6 +52591,10 @@ BREAK points`,
52530
52591
  const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);
52531
52592
  const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText("DEFAULT");
52532
52593
  if (tt && token) {
52594
+ const next = statements[i + 1];
52595
+ if ((next === null || next === void 0 ? void 0 : next.get()) instanceof _statement_1.Comment && next.concatTokens().includes("EC DEFAULT_KEY")) {
52596
+ continue;
52597
+ }
52533
52598
  message = "DEFAULT KEY";
52534
52599
  issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));
52535
52600
  }
@@ -52586,11 +52651,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
52586
52651
  title: "Check BEGIN END names",
52587
52652
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
52588
52653
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
52589
- badExample: `DATA: BEGIN OF stru,
52590
- field TYPE i,
52654
+ badExample: `DATA: BEGIN OF stru,
52655
+ field TYPE i,
52591
52656
  END OF structure_not_the_same.`,
52592
- goodExample: `DATA: BEGIN OF stru,
52593
- field TYPE i,
52657
+ goodExample: `DATA: BEGIN OF stru,
52658
+ field TYPE i,
52594
52659
  END OF stru.`,
52595
52660
  };
52596
52661
  }
@@ -52683,19 +52748,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
52683
52748
  title: "BEGIN contains single INCLUDE",
52684
52749
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
52685
52750
  tags: [_irule_1.RuleTag.SingleFile],
52686
- badExample: `TYPES: BEGIN OF dummy1.
52687
- INCLUDE TYPE dselc.
52688
- TYPES: END OF dummy1.
52689
-
52690
- DATA BEGIN OF foo.
52691
- INCLUDE STRUCTURE syst.
52692
- DATA END OF foo.
52693
-
52694
- STATICS BEGIN OF bar.
52695
- INCLUDE STRUCTURE syst.
52751
+ badExample: `TYPES: BEGIN OF dummy1.
52752
+ INCLUDE TYPE dselc.
52753
+ TYPES: END OF dummy1.
52754
+
52755
+ DATA BEGIN OF foo.
52756
+ INCLUDE STRUCTURE syst.
52757
+ DATA END OF foo.
52758
+
52759
+ STATICS BEGIN OF bar.
52760
+ INCLUDE STRUCTURE syst.
52696
52761
  STATICS END OF bar.`,
52697
- goodExample: `DATA BEGIN OF foo.
52698
- INCLUDE STRUCTURE dselc.
52762
+ goodExample: `DATA BEGIN OF foo.
52763
+ INCLUDE STRUCTURE dselc.
52699
52764
  DATA END OF foo.`,
52700
52765
  };
52701
52766
  }
@@ -52785,9 +52850,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
52785
52850
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
52786
52851
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
52787
52852
  badExample: `CALL TRANSACTION 'FOO'.`,
52788
- goodExample: `TRY.
52789
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52790
- CATCH cx_sy_authorization_error.
52853
+ goodExample: `TRY.
52854
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52855
+ CATCH cx_sy_authorization_error.
52791
52856
  ENDTRY.`,
52792
52857
  };
52793
52858
  }
@@ -52852,10 +52917,10 @@ class CDSCommentStyle {
52852
52917
  key: "cds_comment_style",
52853
52918
  title: "CDS Comment Style",
52854
52919
  shortDescription: `Check for obsolete comment style`,
52855
- extendedInformation: `Check for obsolete comment style
52856
-
52857
- Comments starting with "--" are considered obsolete
52858
-
52920
+ extendedInformation: `Check for obsolete comment style
52921
+
52922
+ Comments starting with "--" are considered obsolete
52923
+
52859
52924
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
52860
52925
  tags: [_irule_1.RuleTag.SingleFile],
52861
52926
  badExample: "-- this is a comment",
@@ -52922,10 +52987,10 @@ class CDSLegacyView {
52922
52987
  title: "CDS Legacy View",
52923
52988
  shortDescription: `Identify CDS Legacy Views`,
52924
52989
  // eslint-disable-next-line max-len
52925
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52926
-
52927
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52928
-
52990
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52991
+
52992
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52993
+
52929
52994
  v755 and up`,
52930
52995
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
52931
52996
  };
@@ -53080,10 +53145,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
53080
53145
  key: "chain_mainly_declarations",
53081
53146
  title: "Chain mainly declarations",
53082
53147
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
53083
- extendedInformation: `
53084
- https://docs.abapopenchecks.org/checks/23/
53085
-
53086
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53148
+ extendedInformation: `
53149
+ https://docs.abapopenchecks.org/checks/23/
53150
+
53151
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53087
53152
  `,
53088
53153
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53089
53154
  badExample: `CALL METHOD: bar.`,
@@ -53259,17 +53324,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
53259
53324
  title: "Change IF to CASE",
53260
53325
  shortDescription: `Finds IF constructs that can be changed to CASE`,
53261
53326
  // eslint-disable-next-line max-len
53262
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53263
-
53327
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53328
+
53264
53329
  If the first comparison is a boolean compare, no issue is reported.`,
53265
53330
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53266
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
53267
- ELSEIF l_fcat-fieldname = 'BAR'
53268
- OR l_fcat-fieldname = 'MOO'.
53331
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
53332
+ ELSEIF l_fcat-fieldname = 'BAR'
53333
+ OR l_fcat-fieldname = 'MOO'.
53269
53334
  ENDIF.`,
53270
- goodExample: `CASE l_fcat-fieldname.
53271
- WHEN 'FOO'.
53272
- WHEN 'BAR' OR 'MOO'.
53335
+ goodExample: `CASE l_fcat-fieldname.
53336
+ WHEN 'FOO'.
53337
+ WHEN 'BAR' OR 'MOO'.
53273
53338
  ENDCASE.`,
53274
53339
  };
53275
53340
  }
@@ -53406,8 +53471,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
53406
53471
  return {
53407
53472
  key: "check_abstract",
53408
53473
  title: "Check abstract methods and classes",
53409
- shortDescription: `Checks abstract methods and classes:
53410
- - class defined as abstract and final,
53474
+ shortDescription: `Checks abstract methods and classes:
53475
+ - class defined as abstract and final,
53411
53476
  - non-abstract class contains abstract methods`,
53412
53477
  extendedInformation: `If a class defines only constants, use an interface instead`,
53413
53478
  tags: [_irule_1.RuleTag.SingleFile],
@@ -53488,11 +53553,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
53488
53553
  return {
53489
53554
  key: "check_comments",
53490
53555
  title: "Check Comments",
53491
- shortDescription: `
53556
+ shortDescription: `
53492
53557
  Various checks for comment usage.`,
53493
- extendedInformation: `
53494
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53495
-
53558
+ extendedInformation: `
53559
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53560
+
53496
53561
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
53497
53562
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53498
53563
  badExample: `WRITE 2. " descriptive comment`,
@@ -53654,9 +53719,9 @@ class CheckInclude {
53654
53719
  key: "check_include",
53655
53720
  title: "Check INCLUDEs",
53656
53721
  shortDescription: `Checks INCLUDE statements`,
53657
- extendedInformation: `
53658
- * Reports unused includes
53659
- * Errors if the includes are not found
53722
+ extendedInformation: `
53723
+ * Reports unused includes
53724
+ * Errors if the includes are not found
53660
53725
  * Error if including a main program`,
53661
53726
  tags: [_irule_1.RuleTag.Syntax],
53662
53727
  };
@@ -53731,14 +53796,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
53731
53796
  key: "check_subrc",
53732
53797
  title: "Check sy-subrc",
53733
53798
  shortDescription: `Check sy-subrc`,
53734
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53735
-
53736
- If sy-dbcnt is checked after database statements, it is considered okay.
53737
-
53738
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53739
-
53740
- If IS ASSIGNED is checked after assigning, it is considered okay.
53741
-
53799
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53800
+
53801
+ If sy-dbcnt is checked after database statements, it is considered okay.
53802
+
53803
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53804
+
53805
+ If IS ASSIGNED is checked after assigning, it is considered okay.
53806
+
53742
53807
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
53743
53808
  tags: [_irule_1.RuleTag.SingleFile],
53744
53809
  pseudoComment: "EC CI_SUBRC",
@@ -54291,17 +54356,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
54291
54356
  shortDescription: `Find overlapping classic exceptions`,
54292
54357
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
54293
54358
  tags: [_irule_1.RuleTag.SingleFile],
54294
- badExample: `CALL FUNCTION 'SOMETHING'
54295
- EXCEPTIONS
54296
- system_failure = 1 MESSAGE lv_message
54297
- communication_failure = 1 MESSAGE lv_message
54298
- resource_failure = 1
54359
+ badExample: `CALL FUNCTION 'SOMETHING'
54360
+ EXCEPTIONS
54361
+ system_failure = 1 MESSAGE lv_message
54362
+ communication_failure = 1 MESSAGE lv_message
54363
+ resource_failure = 1
54299
54364
  OTHERS = 1.`,
54300
- goodExample: `CALL FUNCTION 'SOMETHING'
54301
- EXCEPTIONS
54302
- system_failure = 1 MESSAGE lv_message
54303
- communication_failure = 2 MESSAGE lv_message
54304
- resource_failure = 3
54365
+ goodExample: `CALL FUNCTION 'SOMETHING'
54366
+ EXCEPTIONS
54367
+ system_failure = 1 MESSAGE lv_message
54368
+ communication_failure = 2 MESSAGE lv_message
54369
+ resource_failure = 3
54305
54370
  OTHERS = 4.`,
54306
54371
  };
54307
54372
  }
@@ -54547,7 +54612,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
54547
54612
  key: "commented_code",
54548
54613
  title: "Find commented code",
54549
54614
  shortDescription: `Detects usage of commented out code.`,
54550
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54615
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54551
54616
  https://docs.abapopenchecks.org/checks/14/`,
54552
54617
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54553
54618
  };
@@ -54779,10 +54844,10 @@ class ConstructorVisibilityPublic {
54779
54844
  key: "constructor_visibility_public",
54780
54845
  title: "Check constructor visibility is public",
54781
54846
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
54782
- extendedInformation: `
54783
- This only applies to global classes.
54784
-
54785
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54847
+ extendedInformation: `
54848
+ This only applies to global classes.
54849
+
54850
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54786
54851
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
54787
54852
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54788
54853
  };
@@ -54857,8 +54922,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
54857
54922
  key: "contains_tab",
54858
54923
  title: "Code contains tab",
54859
54924
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
54860
- extendedInformation: `
54861
- https://docs.abapopenchecks.org/checks/09/
54925
+ extendedInformation: `
54926
+ https://docs.abapopenchecks.org/checks/09/
54862
54927
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
54863
54928
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54864
54929
  };
@@ -54943,10 +55008,10 @@ class CyclicOO {
54943
55008
  key: "cyclic_oo",
54944
55009
  title: "Cyclic OO",
54945
55010
  shortDescription: `Finds cyclic OO references`,
54946
- extendedInformation: `Runs for global INTF + CLAS objects
54947
-
54948
- Objects must be without syntax errors for this rule to take effect
54949
-
55011
+ extendedInformation: `Runs for global INTF + CLAS objects
55012
+
55013
+ Objects must be without syntax errors for this rule to take effect
55014
+
54950
55015
  References in testclass includes are ignored`,
54951
55016
  };
54952
55017
  }
@@ -55188,7 +55253,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
55188
55253
  key: "dangerous_statement",
55189
55254
  title: "Dangerous statement",
55190
55255
  shortDescription: `Detects potentially dangerous statements`,
55191
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55256
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55192
55257
  dynamic SQL can potentially create SQL injection problems`,
55193
55258
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55194
55259
  };
@@ -55392,13 +55457,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
55392
55457
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
55393
55458
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
55394
55459
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55395
- badExample: `FROM foo.
55396
- WRITE 'hello'.
55397
- DATA int TYPE i.
55460
+ badExample: `FROM foo.
55461
+ WRITE 'hello'.
55462
+ DATA int TYPE i.
55398
55463
  ENDFORM.`,
55399
- goodExample: `FROM foo.
55400
- DATA int TYPE i.
55401
- WRITE 'hello'.
55464
+ goodExample: `FROM foo.
55465
+ DATA int TYPE i.
55466
+ WRITE 'hello'.
55402
55467
  ENDFORM.`,
55403
55468
  };
55404
55469
  }
@@ -55934,39 +55999,39 @@ class Downport {
55934
55999
  key: "downport",
55935
56000
  title: "Downport statement",
55936
56001
  shortDescription: `Downport functionality`,
55937
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
55938
- a higher level language version. If successful, various rules are applied to downport the statement.
55939
- Target downport version is always v702, thus rule is only enabled if target version is v702.
55940
-
55941
- Current rules:
55942
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
55943
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
55944
- * FIELD-SYMBOL() definitions are outlined
55945
- * CONV is outlined
55946
- * COND is outlined
55947
- * REDUCE is outlined
55948
- * SWITCH is outlined
55949
- * FILTER is outlined
55950
- * APPEND expression is outlined
55951
- * INSERT expression is outlined
55952
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
55953
- * CAST changed to ?=
55954
- * LOOP AT method_call( ) is outlined
55955
- * VALUE # with structure fields
55956
- * VALUE # with internal table lines
55957
- * Table Expressions are outlined
55958
- * SELECT INTO @DATA definitions are outlined
55959
- * Some occurrences of string template formatting option ALPHA changed to function module call
55960
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
55961
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
55962
- * RAISE EXCEPTION ... MESSAGE
55963
- * Moving with +=, -=, /=, *=, &&= is expanded
55964
- * line_exists and line_index is downported to READ TABLE
55965
- * ENUMs, but does not nessesarily give the correct type and value
55966
- * MESSAGE with non simple source
55967
-
55968
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
55969
-
56002
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
56003
+ a higher level language version. If successful, various rules are applied to downport the statement.
56004
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
56005
+
56006
+ Current rules:
56007
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
56008
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
56009
+ * FIELD-SYMBOL() definitions are outlined
56010
+ * CONV is outlined
56011
+ * COND is outlined
56012
+ * REDUCE is outlined
56013
+ * SWITCH is outlined
56014
+ * FILTER is outlined
56015
+ * APPEND expression is outlined
56016
+ * INSERT expression is outlined
56017
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
56018
+ * CAST changed to ?=
56019
+ * LOOP AT method_call( ) is outlined
56020
+ * VALUE # with structure fields
56021
+ * VALUE # with internal table lines
56022
+ * Table Expressions are outlined
56023
+ * SELECT INTO @DATA definitions are outlined
56024
+ * Some occurrences of string template formatting option ALPHA changed to function module call
56025
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
56026
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
56027
+ * RAISE EXCEPTION ... MESSAGE
56028
+ * Moving with +=, -=, /=, *=, &&= is expanded
56029
+ * line_exists and line_index is downported to READ TABLE
56030
+ * ENUMs, but does not nessesarily give the correct type and value
56031
+ * MESSAGE with non simple source
56032
+
56033
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
56034
+
55970
56035
  Make sure to test the downported code, it might not always be completely correct.`,
55971
56036
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
55972
56037
  };
@@ -56540,10 +56605,10 @@ Make sure to test the downported code, it might not always be completely correct
56540
56605
  const fieldName = f.concatTokens();
56541
56606
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
56542
56607
  }
56543
- fieldDefinition = `DATA: BEGIN OF ${name},
56608
+ fieldDefinition = `DATA: BEGIN OF ${name},
56544
56609
  ${fieldDefinition}${indentation} END OF ${name}.`;
56545
56610
  }
56546
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56611
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56547
56612
  ${indentation}`);
56548
56613
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
56549
56614
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56587,12 +56652,12 @@ ${indentation}`);
56587
56652
  }
56588
56653
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56589
56654
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
56590
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56591
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56592
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56655
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56656
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56657
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56593
56658
  ${indentation}`);
56594
56659
  if (fieldDefinitions === "") {
56595
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56660
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56596
56661
  ${indentation}`);
56597
56662
  }
56598
56663
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -56660,7 +56725,7 @@ ${indentation}`);
56660
56725
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56661
56726
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56662
56727
  const firstToken = high.getFirstToken();
56663
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56728
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56664
56729
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56665
56730
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56666
56731
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56698,7 +56763,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56698
56763
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56699
56764
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56700
56765
  const firstToken = high.getFirstToken();
56701
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56766
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56702
56767
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56703
56768
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56704
56769
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56740,14 +56805,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56740
56805
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56741
56806
  const firstToken = high.getFirstToken();
56742
56807
  // note that the tabix restore should be done before throwing the exception
56743
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56744
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56745
- ${indentation}${tabixBackup} = sy-tabix.
56746
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56747
- ${indentation}sy-tabix = ${tabixBackup}.
56748
- ${indentation}IF sy-subrc <> 0.
56749
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56750
- ${indentation}ENDIF.
56808
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56809
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56810
+ ${indentation}${tabixBackup} = sy-tabix.
56811
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56812
+ ${indentation}sy-tabix = ${tabixBackup}.
56813
+ ${indentation}IF sy-subrc <> 0.
56814
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56815
+ ${indentation}ENDIF.
56751
56816
  ${indentation}`);
56752
56817
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
56753
56818
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56804,7 +56869,7 @@ ${indentation}`);
56804
56869
  const className = classNames[0].concatTokens();
56805
56870
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
56806
56871
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56807
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
56872
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
56808
56873
  ${indentation}CATCH ${className} INTO ${targetName}.`;
56809
56874
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
56810
56875
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -56961,21 +57026,21 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
56961
57026
  }
56962
57027
  startToken = node.getFirstToken();
56963
57028
  }
56964
- const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.Source)) || [];
57029
+ const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource3)) || [];
56965
57030
  const className = ((_g = node.findDirectExpression(Expressions.ClassName)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "ERROR";
56966
57031
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56967
57032
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56968
57033
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56969
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56970
- ${indentation}${uniqueName1}-msgid = ${id}.
57034
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
57035
+ ${indentation}${uniqueName1}-msgid = ${id}.
56971
57036
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
56972
57037
  if (withs.length > 0) {
56973
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
56974
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
56975
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
57038
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
57039
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
57040
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
56976
57041
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
56977
57042
  }
56978
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
57043
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56979
57044
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
56980
57045
  if (withs.length > 0) {
56981
57046
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -57087,10 +57152,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
57087
57152
  let code = "";
57088
57153
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
57089
57154
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57090
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57091
- IF sy-subrc <> 0.
57092
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57093
- ENDIF.
57155
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57156
+ IF sy-subrc <> 0.
57157
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57158
+ ENDIF.
57094
57159
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57095
57160
  }
57096
57161
  else {
@@ -57166,20 +57231,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57166
57231
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57167
57232
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57168
57233
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57169
- code += ` items LIKE ${loopSourceName},
57170
- END OF ${groupTargetName}type.
57171
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57172
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57234
+ code += ` items LIKE ${loopSourceName},
57235
+ END OF ${groupTargetName}type.
57236
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57237
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57173
57238
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
57174
57239
  if (groupIndexName !== undefined) {
57175
57240
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
57176
57241
  }
57177
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57242
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57178
57243
  IF sy-subrc = 0.\n`;
57179
57244
  if (groupCountName !== undefined) {
57180
57245
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
57181
57246
  }
57182
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57247
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57183
57248
  ELSE.\n`;
57184
57249
  code += ` CLEAR ${uniqueName}.\n`;
57185
57250
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -57200,8 +57265,8 @@ ELSE.\n`;
57200
57265
  }
57201
57266
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
57202
57267
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
57203
- code += `ENDIF.
57204
- ENDLOOP.
57268
+ code += `ENDIF.
57269
+ ENDLOOP.
57205
57270
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57206
57271
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
57207
57272
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -57349,7 +57414,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57349
57414
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57350
57415
  let code = `CLEAR ${target.concatTokens()}.\n`;
57351
57416
  for (const fieldAssignment of fieldAssignments) {
57352
- code += indentation + target.concatTokens() + "-" + fieldAssignment.concatTokens() + `.\n`;
57417
+ code += indentation + target.concatTokens() + "-" + fieldAssignment.concatTokensWithLinebreaks() + `.\n`;
57353
57418
  }
57354
57419
  code = code.trimEnd();
57355
57420
  const start = high.getFirstToken().getStart();
@@ -57373,7 +57438,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57373
57438
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
57374
57439
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
57375
57440
  // all ENUMS are char like?
57376
- let code = `TYPES ${enumName} TYPE string.
57441
+ let code = `TYPES ${enumName} TYPE string.
57377
57442
  CONSTANTS: BEGIN OF ${structureName},\n`;
57378
57443
  let count = 1;
57379
57444
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -57417,14 +57482,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
57417
57482
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57418
57483
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57419
57484
  // restore tabix before exeption
57420
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57421
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57422
- ${indentation}${tabixBackup} = sy-tabix.
57423
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57424
- ${indentation}sy-tabix = ${tabixBackup}.
57425
- ${indentation}IF sy-subrc <> 0.
57426
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57427
- ${indentation}ENDIF.
57485
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57486
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57487
+ ${indentation}${tabixBackup} = sy-tabix.
57488
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57489
+ ${indentation}sy-tabix = ${tabixBackup}.
57490
+ ${indentation}IF sy-subrc <> 0.
57491
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57492
+ ${indentation}ENDIF.
57428
57493
  ${indentation}${uniqueName}`;
57429
57494
  const start = target.getFirstToken().getStart();
57430
57495
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -57508,11 +57573,11 @@ ${indentation}${uniqueName}`;
57508
57573
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57509
57574
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57510
57575
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57511
- const code = `DATA ${uniqueName} TYPE string.
57512
- ${indentation}CALL FUNCTION '${functionName}'
57513
- ${indentation} EXPORTING
57514
- ${indentation} input = ${source}
57515
- ${indentation} IMPORTING
57576
+ const code = `DATA ${uniqueName} TYPE string.
57577
+ ${indentation}CALL FUNCTION '${functionName}'
57578
+ ${indentation} EXPORTING
57579
+ ${indentation} input = ${source}
57580
+ ${indentation} IMPORTING
57516
57581
  ${indentation} output = ${uniqueName}.\n`;
57517
57582
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
57518
57583
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -58824,12 +58889,12 @@ class EasyToFindMessages {
58824
58889
  key: "easy_to_find_messages",
58825
58890
  title: "Easy to find messages",
58826
58891
  shortDescription: `Make messages easy to find`,
58827
- extendedInformation: `All messages must be statically referenced exactly once
58828
-
58829
- Only MESSAGE and RAISE statments are counted as static references
58830
-
58831
- Also see rule "message_exists"
58832
-
58892
+ extendedInformation: `All messages must be statically referenced exactly once
58893
+
58894
+ Only MESSAGE and RAISE statments are counted as static references
58895
+
58896
+ Also see rule "message_exists"
58897
+
58833
58898
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
58834
58899
  tags: [_irule_1.RuleTag.Styleguide],
58835
58900
  };
@@ -58914,8 +58979,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
58914
58979
  key: "empty_line_in_statement",
58915
58980
  title: "Find empty lines in statements",
58916
58981
  shortDescription: `Checks that statements do not contain empty lines.`,
58917
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58918
-
58982
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58983
+
58919
58984
  https://docs.abapopenchecks.org/checks/41/`,
58920
58985
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
58921
58986
  badExample: `WRITE\n\nhello.`,
@@ -59207,10 +59272,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
59207
59272
  return {
59208
59273
  key: "exit_or_check",
59209
59274
  title: "Find EXIT or CHECK outside loops",
59210
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59275
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59211
59276
  Use RETURN to leave procesing blocks instead.`,
59212
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59213
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59277
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59278
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59214
59279
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
59215
59280
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
59216
59281
  };
@@ -59293,12 +59358,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
59293
59358
  key: "expand_macros",
59294
59359
  title: "Expand Macros",
59295
59360
  shortDescription: `Allows expanding macro calls with quick fixes`,
59296
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59297
-
59361
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59362
+
59298
59363
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
59299
- badExample: `DEFINE _hello.
59300
- WRITE 'hello'.
59301
- END-OF-DEFINITION.
59364
+ badExample: `DEFINE _hello.
59365
+ WRITE 'hello'.
59366
+ END-OF-DEFINITION.
59302
59367
  _hello.`,
59303
59368
  goodExample: `WRITE 'hello'.`,
59304
59369
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -59385,7 +59450,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
59385
59450
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
59386
59451
  badExample: `call_method( EXPORTING foo = bar ).`,
59387
59452
  goodExample: `call_method( foo = bar ).`,
59388
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59453
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59389
59454
  https://docs.abapopenchecks.org/checks/30/`,
59390
59455
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59391
59456
  };
@@ -59483,7 +59548,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
59483
59548
  key: "forbidden_identifier",
59484
59549
  title: "Forbidden Identifier",
59485
59550
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
59486
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59551
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59487
59552
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
59488
59553
  tags: [_irule_1.RuleTag.SingleFile],
59489
59554
  };
@@ -59725,8 +59790,8 @@ class ForbiddenVoidType {
59725
59790
  key: "forbidden_void_type",
59726
59791
  title: "Forbidden Void Types",
59727
59792
  shortDescription: `Avoid usage of specified void types.`,
59728
- extendedInformation: `Inspiration:
59729
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59793
+ extendedInformation: `Inspiration:
59794
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59730
59795
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
59731
59796
  };
59732
59797
  }
@@ -59969,7 +60034,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
59969
60034
  key: "fully_type_itabs",
59970
60035
  title: "Fully type internal tables",
59971
60036
  shortDescription: `No implict table types or table keys`,
59972
- badExample: `DATA lt_foo TYPE TABLE OF ty.
60037
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
59973
60038
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
59974
60039
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
59975
60040
  tags: [_irule_1.RuleTag.SingleFile],
@@ -60154,26 +60219,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
60154
60219
  key: "functional_writing",
60155
60220
  title: "Use functional writing",
60156
60221
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
60157
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60222
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60158
60223
  https://docs.abapopenchecks.org/checks/07/`,
60159
60224
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
60160
- badExample: `CALL METHOD zcl_class=>method( ).
60161
- CALL METHOD cl_abap_typedescr=>describe_by_name
60162
- EXPORTING
60163
- p_name = 'NAME'
60164
- RECEIVING
60165
- p_descr_ref = lr_typedescr
60166
- EXCEPTIONS
60167
- type_not_found = 1
60225
+ badExample: `CALL METHOD zcl_class=>method( ).
60226
+ CALL METHOD cl_abap_typedescr=>describe_by_name
60227
+ EXPORTING
60228
+ p_name = 'NAME'
60229
+ RECEIVING
60230
+ p_descr_ref = lr_typedescr
60231
+ EXCEPTIONS
60232
+ type_not_found = 1
60168
60233
  OTHERS = 2.`,
60169
- goodExample: `zcl_class=>method( ).
60170
- cl_abap_typedescr=>describe_by_name(
60171
- EXPORTING
60172
- p_name = 'NAME'
60173
- RECEIVING
60174
- p_descr_ref = lr_typedescr
60175
- EXCEPTIONS
60176
- type_not_found = 1
60234
+ goodExample: `zcl_class=>method( ).
60235
+ cl_abap_typedescr=>describe_by_name(
60236
+ EXPORTING
60237
+ p_name = 'NAME'
60238
+ RECEIVING
60239
+ p_descr_ref = lr_typedescr
60240
+ EXCEPTIONS
60241
+ type_not_found = 1
60177
60242
  OTHERS = 2 ).`,
60178
60243
  };
60179
60244
  }
@@ -60284,14 +60349,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
60284
60349
  key: "global_class",
60285
60350
  title: "Global class checks",
60286
60351
  shortDescription: `Checks related to global classes`,
60287
- extendedInformation: `* global classes must be in own files
60288
-
60289
- * file names must match class name
60290
-
60291
- * file names must match interface name
60292
-
60293
- * global classes must be global definitions
60294
-
60352
+ extendedInformation: `* global classes must be in own files
60353
+
60354
+ * file names must match class name
60355
+
60356
+ * file names must match interface name
60357
+
60358
+ * global classes must be global definitions
60359
+
60295
60360
  * global interfaces must be global definitions`,
60296
60361
  tags: [_irule_1.RuleTag.Syntax],
60297
60362
  };
@@ -60390,8 +60455,8 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
60390
60455
  return {
60391
60456
  key: "identical_conditions",
60392
60457
  title: "Identical conditions",
60393
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60394
-
60458
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60459
+
60395
60460
  Prerequsites: code is pretty printed with identical cAsE`,
60396
60461
  tags: [_irule_1.RuleTag.SingleFile],
60397
60462
  };
@@ -60525,23 +60590,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
60525
60590
  key: "identical_contents",
60526
60591
  title: "Identical contents",
60527
60592
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
60528
- extendedInformation: `
60529
- Prerequsites: code is pretty printed with identical cAsE
60530
-
60593
+ extendedInformation: `
60594
+ Prerequsites: code is pretty printed with identical cAsE
60595
+
60531
60596
  Chained statments are ignored`,
60532
60597
  tags: [_irule_1.RuleTag.SingleFile],
60533
- badExample: `IF foo = bar.
60534
- WRITE 'bar'.
60535
- WRITE 'world'.
60536
- ELSE.
60537
- WRITE 'foo'.
60538
- WRITE 'world'.
60598
+ badExample: `IF foo = bar.
60599
+ WRITE 'bar'.
60600
+ WRITE 'world'.
60601
+ ELSE.
60602
+ WRITE 'foo'.
60603
+ WRITE 'world'.
60539
60604
  ENDIF.`,
60540
- goodExample: `IF foo = bar.
60541
- WRITE 'bar'.
60542
- ELSE.
60543
- WRITE 'foo'.
60544
- ENDIF.
60605
+ goodExample: `IF foo = bar.
60606
+ WRITE 'bar'.
60607
+ ELSE.
60608
+ WRITE 'foo'.
60609
+ ENDIF.
60545
60610
  WRITE 'world'.`,
60546
60611
  };
60547
60612
  }
@@ -60644,12 +60709,12 @@ class IdenticalDescriptions {
60644
60709
  key: "identical_descriptions",
60645
60710
  title: "Identical descriptions",
60646
60711
  shortDescription: `Searches for objects with the same type and same description`,
60647
- extendedInformation: `Case insensitive
60648
-
60649
- Only checks the master language descriptions
60650
-
60651
- Dependencies are skipped
60652
-
60712
+ extendedInformation: `Case insensitive
60713
+
60714
+ Only checks the master language descriptions
60715
+
60716
+ Dependencies are skipped
60717
+
60653
60718
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
60654
60719
  tags: [],
60655
60720
  };
@@ -60823,43 +60888,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
60823
60888
  key: "if_in_if",
60824
60889
  title: "IF in IF",
60825
60890
  shortDescription: `Detects nested ifs which can be refactored.`,
60826
- extendedInformation: `
60827
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
60828
-
60829
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60830
-
60831
- https://docs.abapopenchecks.org/checks/01/
60891
+ extendedInformation: `
60892
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
60893
+
60894
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60895
+
60896
+ https://docs.abapopenchecks.org/checks/01/
60832
60897
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
60833
- badExample: `IF condition1.
60834
- IF condition2.
60835
- ...
60836
- ENDIF.
60837
- ENDIF.
60838
-
60839
- IF condition1.
60840
- ...
60841
- ELSE.
60842
- IF condition2.
60843
- ...
60844
- ENDIF.
60898
+ badExample: `IF condition1.
60899
+ IF condition2.
60900
+ ...
60901
+ ENDIF.
60902
+ ENDIF.
60903
+
60904
+ IF condition1.
60905
+ ...
60906
+ ELSE.
60907
+ IF condition2.
60908
+ ...
60909
+ ENDIF.
60845
60910
  ENDIF.`,
60846
- goodExample: `IF ( condition1 ) AND ( condition2 ).
60847
- ...
60848
- ENDIF.
60849
-
60850
- IF condition1.
60851
- ...
60852
- ELSEIF condition2.
60853
- ...
60854
- ENDIF.
60855
-
60856
- CASE variable.
60857
- WHEN value1.
60858
- ...
60859
- WHEN value2.
60860
- IF condition2.
60861
- ...
60862
- ENDIF.
60911
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
60912
+ ...
60913
+ ENDIF.
60914
+
60915
+ IF condition1.
60916
+ ...
60917
+ ELSEIF condition2.
60918
+ ...
60919
+ ENDIF.
60920
+
60921
+ CASE variable.
60922
+ WHEN value1.
60923
+ ...
60924
+ WHEN value2.
60925
+ IF condition2.
60926
+ ...
60927
+ ENDIF.
60863
60928
  ENDCASE.`,
60864
60929
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60865
60930
  };
@@ -61044,9 +61109,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
61044
61109
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
61045
61110
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
61046
61111
  if (name === impl.identifier.getName().toUpperCase()) {
61047
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61048
- METHOD ${methodName.toLowerCase()}.
61049
- RETURN. " todo, implement method
61112
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
61113
+ METHOD ${methodName.toLowerCase()}.
61114
+ RETURN. " todo, implement method
61050
61115
  ENDMETHOD.`);
61051
61116
  }
61052
61117
  }
@@ -61234,19 +61299,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
61234
61299
  key: "in_statement_indentation",
61235
61300
  title: "In-statement indentation",
61236
61301
  shortDescription: "Checks alignment within statements which span multiple lines.",
61237
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
61238
-
61239
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61302
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
61303
+
61304
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61240
61305
  to distinguish them better from code within the block.`,
61241
- badExample: `IF 1 = 1
61242
- AND 2 = 2.
61243
- WRITE 'hello' &&
61244
- 'world'.
61306
+ badExample: `IF 1 = 1
61307
+ AND 2 = 2.
61308
+ WRITE 'hello' &&
61309
+ 'world'.
61245
61310
  ENDIF.`,
61246
- goodExample: `IF 1 = 1
61247
- AND 2 = 2.
61248
- WRITE 'hello' &&
61249
- 'world'.
61311
+ goodExample: `IF 1 = 1
61312
+ AND 2 = 2.
61313
+ WRITE 'hello' &&
61314
+ 'world'.
61250
61315
  ENDIF.`,
61251
61316
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61252
61317
  };
@@ -61751,9 +61816,9 @@ class IntfReferencingClas {
61751
61816
  key: "intf_referencing_clas",
61752
61817
  title: "INTF referencing CLAS",
61753
61818
  shortDescription: `Interface contains references to class`,
61754
- extendedInformation: `Only global interfaces are checked.
61755
- Only first level references are checked.
61756
- Exception class references are ignored.
61819
+ extendedInformation: `Only global interfaces are checked.
61820
+ Only first level references are checked.
61821
+ Exception class references are ignored.
61757
61822
  Void references are ignored.`,
61758
61823
  };
61759
61824
  }
@@ -62348,8 +62413,8 @@ class LineBreakStyle {
62348
62413
  return {
62349
62414
  key: "line_break_style",
62350
62415
  title: "Makes sure line breaks are consistent in the ABAP code",
62351
- shortDescription: `Enforces LF as newlines in ABAP files
62352
-
62416
+ shortDescription: `Enforces LF as newlines in ABAP files
62417
+
62353
62418
  abapGit does not work with CRLF`,
62354
62419
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
62355
62420
  };
@@ -62418,7 +62483,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
62418
62483
  key: "line_length",
62419
62484
  title: "Line length",
62420
62485
  shortDescription: `Detects lines exceeding the provided maximum length.`,
62421
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62486
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62422
62487
  https://docs.abapopenchecks.org/checks/04/`,
62423
62488
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
62424
62489
  };
@@ -62489,7 +62554,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
62489
62554
  key: "line_only_punc",
62490
62555
  title: "Line containing only punctuation",
62491
62556
  shortDescription: `Detects lines containing only punctuation.`,
62492
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62557
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62493
62558
  https://docs.abapopenchecks.org/checks/16/`,
62494
62559
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62495
62560
  badExample: "zcl_class=>method(\n).",
@@ -62749,8 +62814,8 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
62749
62814
  return {
62750
62815
  key: "local_variable_names",
62751
62816
  title: "Local variable naming conventions",
62752
- shortDescription: `
62753
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62817
+ shortDescription: `
62818
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62754
62819
  Regexes are case-insensitive.`,
62755
62820
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
62756
62821
  };
@@ -62897,10 +62962,10 @@ class MainFileContents {
62897
62962
  key: "main_file_contents",
62898
62963
  title: "Main file contents",
62899
62964
  shortDescription: `Checks related to report declarations.`,
62900
- extendedInformation: `Does not run if the target version is Cloud
62901
-
62902
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62903
- * TYPEs must begin with "TYPE-POOL <name>."
62965
+ extendedInformation: `Does not run if the target version is Cloud
62966
+
62967
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62968
+ * TYPEs must begin with "TYPE-POOL <name>."
62904
62969
  `,
62905
62970
  };
62906
62971
  }
@@ -63016,17 +63081,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
63016
63081
  title: "Too many parentheses",
63017
63082
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
63018
63083
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63019
- badExample: `
63020
- IF ( destination IS INITIAL ).
63021
- ENDIF.
63022
- IF foo = boo AND ( bar = lar AND moo = loo ).
63023
- ENDIF.
63084
+ badExample: `
63085
+ IF ( destination IS INITIAL ).
63086
+ ENDIF.
63087
+ IF foo = boo AND ( bar = lar AND moo = loo ).
63088
+ ENDIF.
63024
63089
  `,
63025
- goodExample: `
63026
- IF destination IS INITIAL.
63027
- ENDIF.
63028
- IF foo = boo AND bar = lar AND moo = loo.
63029
- ENDIF.
63090
+ goodExample: `
63091
+ IF destination IS INITIAL.
63092
+ ENDIF.
63093
+ IF foo = boo AND bar = lar AND moo = loo.
63094
+ ENDIF.
63030
63095
  `,
63031
63096
  };
63032
63097
  }
@@ -63200,14 +63265,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
63200
63265
  title: "Max one method parameter definition per line",
63201
63266
  shortDescription: `Keep max one method parameter description per line`,
63202
63267
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
63203
- badExample: `
63204
- METHODS apps_scope_token
63205
- IMPORTING
63268
+ badExample: `
63269
+ METHODS apps_scope_token
63270
+ IMPORTING
63206
63271
  body TYPE bodyapps_scope_token client_id TYPE str.`,
63207
- goodExample: `
63208
- METHODS apps_scope_token
63209
- IMPORTING
63210
- body TYPE bodyapps_scope_token
63272
+ goodExample: `
63273
+ METHODS apps_scope_token
63274
+ IMPORTING
63275
+ body TYPE bodyapps_scope_token
63211
63276
  client_id TYPE str.`,
63212
63277
  };
63213
63278
  }
@@ -63272,11 +63337,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
63272
63337
  key: "max_one_statement",
63273
63338
  title: "Max one statement per line",
63274
63339
  shortDescription: `Checks that each line contains only a single statement.`,
63275
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63276
-
63277
- Does not report anything for chained statements.
63278
-
63279
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63340
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63341
+
63342
+ Does not report anything for chained statements.
63343
+
63344
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63280
63345
  https://docs.abapopenchecks.org/checks/11/`,
63281
63346
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63282
63347
  badExample: `WRITE foo. WRITE bar.`,
@@ -63581,6 +63646,7 @@ exports.MethodImplementedTwice = MethodImplementedTwice;
63581
63646
  Object.defineProperty(exports, "__esModule", ({ value: true }));
63582
63647
  exports.MethodLength = exports.MethodLengthConf = void 0;
63583
63648
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
63649
+ const Objects = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
63584
63650
  const method_length_stats_1 = __webpack_require__(/*! ../utils/method_length_stats */ "./node_modules/@abaplint/core/build/src/utils/method_length_stats.js");
63585
63651
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
63586
63652
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
@@ -63613,8 +63679,8 @@ class MethodLength {
63613
63679
  key: "method_length",
63614
63680
  title: "Method/Form Length",
63615
63681
  shortDescription: `Checks relating to method/form length.`,
63616
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63617
-
63682
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63683
+
63618
63684
  Abstract methods without statements are considered okay.`,
63619
63685
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63620
63686
  };
@@ -63642,6 +63708,12 @@ Abstract methods without statements are considered okay.`,
63642
63708
  return this;
63643
63709
  }
63644
63710
  run(obj) {
63711
+ var _a;
63712
+ if (this.conf.ignoreTestClasses === true
63713
+ && obj instanceof Objects.Class
63714
+ && ((_a = obj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.isForTesting) === true) {
63715
+ return [];
63716
+ }
63645
63717
  const methodStats = method_length_stats_1.MethodLengthStats.run(obj);
63646
63718
  const methodIssues = this.check(methodStats, "METHOD");
63647
63719
  let formIssues = [];
@@ -63713,10 +63785,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
63713
63785
  key: "method_overwrites_builtin",
63714
63786
  title: "Method name overwrites builtin function",
63715
63787
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
63716
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63717
-
63718
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63719
-
63788
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63789
+
63790
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63791
+
63720
63792
  Interface method names are ignored`,
63721
63793
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
63722
63794
  };
@@ -64286,7 +64358,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
64286
64358
  key: "nesting",
64287
64359
  title: "Check nesting depth",
64288
64360
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
64289
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64361
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64290
64362
  https://docs.abapopenchecks.org/checks/74/`,
64291
64363
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64292
64364
  };
@@ -64529,7 +64601,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
64529
64601
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
64530
64602
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64531
64603
  badExample: `var1 = var2 = var3.`,
64532
- goodExample: `var2 = var3.
64604
+ goodExample: `var2 = var3.
64533
64605
  var1 = var2.`,
64534
64606
  };
64535
64607
  }
@@ -64588,8 +64660,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
64588
64660
  key: "no_external_form_calls",
64589
64661
  title: "No external FORM calls",
64590
64662
  shortDescription: `Detect external form calls`,
64591
- badExample: `PERFORM foo IN PROGRAM bar.
64592
-
64663
+ badExample: `PERFORM foo IN PROGRAM bar.
64664
+
64593
64665
  PERFORM foo(bar).`,
64594
64666
  tags: [_irule_1.RuleTag.SingleFile],
64595
64667
  };
@@ -64650,17 +64722,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
64650
64722
  key: "no_inline_in_optional_branches",
64651
64723
  title: "Don't declare inline in optional branches",
64652
64724
  shortDescription: `Don't declare inline in optional branches`,
64653
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64654
-
64655
- Considered optional branches:
64656
- * inside IF/ELSEIF/ELSE
64657
- * inside LOOP
64658
- * inside WHILE
64659
- * inside CASE/WHEN, CASE TYPE OF
64660
- * inside DO
64661
- * inside SELECT loops
64662
-
64663
- Not considered optional branches:
64725
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64726
+
64727
+ Considered optional branches:
64728
+ * inside IF/ELSEIF/ELSE
64729
+ * inside LOOP
64730
+ * inside WHILE
64731
+ * inside CASE/WHEN, CASE TYPE OF
64732
+ * inside DO
64733
+ * inside SELECT loops
64734
+
64735
+ Not considered optional branches:
64664
64736
  * TRY/CATCH/CLEANUP`,
64665
64737
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64666
64738
  };
@@ -64759,12 +64831,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
64759
64831
  key: "no_prefixes",
64760
64832
  title: "No Prefixes",
64761
64833
  shortDescription: `Dont use hungarian notation`,
64762
- extendedInformation: `
64763
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64764
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
64765
-
64766
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64767
-
64834
+ extendedInformation: `
64835
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64836
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
64837
+
64838
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64839
+
64768
64840
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
64769
64841
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64770
64842
  badExample: `DATA lv_foo TYPE i.`,
@@ -64937,7 +65009,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
64937
65009
  return {
64938
65010
  key: "no_public_attributes",
64939
65011
  title: "No public attributes",
64940
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
65012
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
64941
65013
  Exceptions are excluded from this rule.`,
64942
65014
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
64943
65015
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -65038,13 +65110,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
65038
65110
  key: "no_yoda_conditions",
65039
65111
  title: "No Yoda conditions",
65040
65112
  shortDescription: `Finds Yoda conditions and reports issues`,
65041
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65042
-
65113
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
65114
+
65043
65115
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
65044
65116
  tags: [_irule_1.RuleTag.SingleFile],
65045
- badExample: `IF 0 <> sy-subrc.
65117
+ badExample: `IF 0 <> sy-subrc.
65046
65118
  ENDIF.`,
65047
- goodExample: `IF sy-subrc <> 0.
65119
+ goodExample: `IF sy-subrc <> 0.
65048
65120
  ENDIF.`,
65049
65121
  };
65050
65122
  }
@@ -65145,8 +65217,8 @@ class NROBConsistency {
65145
65217
  key: "nrob_consistency",
65146
65218
  title: "Number range consistency",
65147
65219
  shortDescription: `Consistency checks for number ranges`,
65148
- extendedInformation: `Issue reported if percentage warning is over 50%
65149
-
65220
+ extendedInformation: `Issue reported if percentage warning is over 50%
65221
+
65150
65222
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
65151
65223
  tags: [_irule_1.RuleTag.SingleFile],
65152
65224
  };
@@ -65423,58 +65495,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
65423
65495
  title: "Obsolete statements",
65424
65496
  shortDescription: `Checks for usages of certain obsolete statements`,
65425
65497
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65426
- extendedInformation: `
65427
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65428
-
65429
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65430
-
65431
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65432
-
65433
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65434
-
65435
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65436
-
65437
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65438
-
65439
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65440
-
65441
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65442
-
65443
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65444
-
65445
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65446
-
65447
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65448
-
65449
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65450
-
65451
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65452
-
65453
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65454
-
65455
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65456
- SELECT COUNT(*) is considered okay
65457
-
65458
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65459
-
65460
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65461
-
65462
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65463
-
65464
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65465
-
65466
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
65467
-
65498
+ extendedInformation: `
65499
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65500
+
65501
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65502
+
65503
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65504
+
65505
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65506
+
65507
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65508
+
65509
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65510
+
65511
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65512
+
65513
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65514
+
65515
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65516
+
65517
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65518
+
65519
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65520
+
65521
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65522
+
65523
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65524
+
65525
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65526
+
65527
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65528
+ SELECT COUNT(*) is considered okay
65529
+
65530
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65531
+
65532
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65533
+
65534
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65535
+
65536
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65537
+
65538
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
65539
+
65468
65540
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
65469
- badExample: `REFRESH itab.
65470
-
65471
- COMPUTE foo = 2 + 2.
65472
-
65473
- MULTIPLY lv_foo BY 2.
65474
-
65475
- INTERFACE intf LOAD.
65476
-
65477
- IF foo IS SUPPLIED.
65541
+ badExample: `REFRESH itab.
65542
+
65543
+ COMPUTE foo = 2 + 2.
65544
+
65545
+ MULTIPLY lv_foo BY 2.
65546
+
65547
+ INTERFACE intf LOAD.
65548
+
65549
+ IF foo IS SUPPLIED.
65478
65550
  ENDIF.`,
65479
65551
  };
65480
65552
  }
@@ -65814,9 +65886,9 @@ class OmitParameterName {
65814
65886
  key: "omit_parameter_name",
65815
65887
  title: "Omit parameter name",
65816
65888
  shortDescription: `Omit the parameter name in single parameter calls`,
65817
- extendedInformation: `
65818
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65819
-
65889
+ extendedInformation: `
65890
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65891
+
65820
65892
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
65821
65893
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65822
65894
  badExample: `method( param = 2 ).`,
@@ -66022,20 +66094,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
66022
66094
  shortDescription: `Omit RECEIVING`,
66023
66095
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
66024
66096
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66025
- badExample: `
66026
- upload_pack(
66027
- EXPORTING
66028
- io_client = lo_client
66029
- iv_url = iv_url
66030
- iv_deepen_level = iv_deepen_level
66031
- it_hashes = lt_hashes
66032
- RECEIVING
66097
+ badExample: `
66098
+ upload_pack(
66099
+ EXPORTING
66100
+ io_client = lo_client
66101
+ iv_url = iv_url
66102
+ iv_deepen_level = iv_deepen_level
66103
+ it_hashes = lt_hashes
66104
+ RECEIVING
66033
66105
  rt_objects = et_objects ).`,
66034
- goodExample: `
66035
- et_objects = upload_pack(
66036
- io_client = lo_client
66037
- iv_url = iv_url
66038
- iv_deepen_level = iv_deepen_level
66106
+ goodExample: `
66107
+ et_objects = upload_pack(
66108
+ io_client = lo_client
66109
+ iv_url = iv_url
66110
+ iv_deepen_level = iv_deepen_level
66039
66111
  it_hashes = lt_hashes ).`,
66040
66112
  };
66041
66113
  }
@@ -66099,8 +66171,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
66099
66171
  return {
66100
66172
  key: "parser_702_chaining",
66101
66173
  title: "Parser Error, bad chanining on 702",
66102
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66103
- this rule finds these and reports errors.
66174
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66175
+ this rule finds these and reports errors.
66104
66176
  Only active on target version 702 and below.`,
66105
66177
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66106
66178
  };
@@ -66180,8 +66252,8 @@ class ParserError {
66180
66252
  return {
66181
66253
  key: "parser_error",
66182
66254
  title: "Parser error",
66183
- shortDescription: `Checks for syntax not recognized by abaplint.
66184
-
66255
+ shortDescription: `Checks for syntax not recognized by abaplint.
66256
+
66185
66257
  See recognized syntax at https://syntax.abaplint.org`,
66186
66258
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66187
66259
  };
@@ -66266,7 +66338,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
66266
66338
  return {
66267
66339
  key: "parser_missing_space",
66268
66340
  title: "Parser Error, missing space",
66269
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66341
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66270
66342
  This rule makes sure the spaces are consistently required across the language.`,
66271
66343
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
66272
66344
  badExample: `IF ( foo = 'bar').`,
@@ -66678,25 +66750,25 @@ class PreferInline {
66678
66750
  key: "prefer_inline",
66679
66751
  title: "Prefer Inline Declarations",
66680
66752
  shortDescription: `Prefer inline to up-front declarations.`,
66681
- extendedInformation: `EXPERIMENTAL
66682
-
66683
- Activates if language version is v740sp02 or above.
66684
-
66685
- Variables must be local(METHOD or FORM).
66686
-
66687
- No generic or void typed variables. No syntax errors.
66688
-
66689
- First position used must be a full/pure write.
66690
-
66691
- Move statment is not a cast(?=)
66692
-
66753
+ extendedInformation: `EXPERIMENTAL
66754
+
66755
+ Activates if language version is v740sp02 or above.
66756
+
66757
+ Variables must be local(METHOD or FORM).
66758
+
66759
+ No generic or void typed variables. No syntax errors.
66760
+
66761
+ First position used must be a full/pure write.
66762
+
66763
+ Move statment is not a cast(?=)
66764
+
66693
66765
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
66694
66766
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
66695
- badExample: `DATA foo TYPE i.
66696
- foo = 2.
66697
- DATA percentage TYPE decfloat34.
66767
+ badExample: `DATA foo TYPE i.
66768
+ foo = 2.
66769
+ DATA percentage TYPE decfloat34.
66698
66770
  percentage = ( comment_number / abs_statement_number ) * 100.`,
66699
- goodExample: `DATA(foo) = 2.
66771
+ goodExample: `DATA(foo) = 2.
66700
66772
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
66701
66773
  };
66702
66774
  }
@@ -66910,18 +66982,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
66910
66982
  key: "prefer_is_not",
66911
66983
  title: "Prefer IS NOT to NOT IS",
66912
66984
  shortDescription: `Prefer IS NOT to NOT IS`,
66913
- extendedInformation: `
66914
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66915
-
66985
+ extendedInformation: `
66986
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66987
+
66916
66988
  "if not is_valid( )." examples are skipped`,
66917
66989
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66918
- goodExample: `IF variable IS NOT INITIAL.
66919
- IF variable NP 'TODO*'.
66920
- IF variable <> 42.
66990
+ goodExample: `IF variable IS NOT INITIAL.
66991
+ IF variable NP 'TODO*'.
66992
+ IF variable <> 42.
66921
66993
  IF variable CO 'hello'.`,
66922
- badExample: `IF NOT variable IS INITIAL.
66923
- IF NOT variable CP 'TODO*'.
66924
- IF NOT variable = 42.
66994
+ badExample: `IF NOT variable IS INITIAL.
66995
+ IF NOT variable CP 'TODO*'.
66996
+ IF NOT variable = 42.
66925
66997
  IF NOT variable CA 'hello'.`,
66926
66998
  };
66927
66999
  }
@@ -67109,14 +67181,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
67109
67181
  key: "prefer_raise_exception_new",
67110
67182
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
67111
67183
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
67112
- extendedInformation: `
67113
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67114
-
67184
+ extendedInformation: `
67185
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67186
+
67115
67187
  From 752 and up`,
67116
67188
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
67117
67189
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
67118
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
67119
- EXPORTING
67190
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
67191
+ EXPORTING
67120
67192
  previous = exception.`,
67121
67193
  };
67122
67194
  }
@@ -67194,7 +67266,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
67194
67266
  key: "prefer_returning_to_exporting",
67195
67267
  title: "Prefer RETURNING to EXPORTING",
67196
67268
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
67197
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67269
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67198
67270
  https://docs.abapopenchecks.org/checks/44/`,
67199
67271
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67200
67272
  };
@@ -67291,8 +67363,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
67291
67363
  key: "prefer_xsdbool",
67292
67364
  title: "Prefer xsdbool over boolc",
67293
67365
  shortDescription: `Prefer xsdbool over boolc`,
67294
- extendedInformation: `Activates if language version is v740sp08 or above.
67295
-
67366
+ extendedInformation: `Activates if language version is v740sp08 or above.
67367
+
67296
67368
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
67297
67369
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
67298
67370
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -67586,26 +67658,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
67586
67658
  key: "reduce_procedural_code",
67587
67659
  title: "Reduce procedural code",
67588
67660
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
67589
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67590
-
67591
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67592
-
67661
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67662
+
67663
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67664
+
67593
67665
  Comments are not counted as statements.`,
67594
67666
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67595
- badExample: `FORM foo.
67596
- DATA lv_bar TYPE i.
67597
- lv_bar = 2 + 2.
67598
- IF lv_bar = 4.
67599
- WRITE 'hello world'.
67600
- ENDIF.
67601
- DATA lv_bar TYPE i.
67602
- lv_bar = 2 + 2.
67603
- IF lv_bar = 4.
67604
- WRITE 'hello world'.
67605
- ENDIF.
67667
+ badExample: `FORM foo.
67668
+ DATA lv_bar TYPE i.
67669
+ lv_bar = 2 + 2.
67670
+ IF lv_bar = 4.
67671
+ WRITE 'hello world'.
67672
+ ENDIF.
67673
+ DATA lv_bar TYPE i.
67674
+ lv_bar = 2 + 2.
67675
+ IF lv_bar = 4.
67676
+ WRITE 'hello world'.
67677
+ ENDIF.
67606
67678
  ENDFORM.`,
67607
- goodExample: `FORM foo.
67608
- NEW zcl_global_class( )->run_logic( ).
67679
+ goodExample: `FORM foo.
67680
+ NEW zcl_global_class( )->run_logic( ).
67609
67681
  ENDFORM.`,
67610
67682
  };
67611
67683
  }
@@ -67849,10 +67921,10 @@ class RemoveDescriptions {
67849
67921
  return {
67850
67922
  key: "remove_descriptions",
67851
67923
  title: "Remove descriptions",
67852
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67853
-
67854
- Class descriptions are required, see rule description_empty.
67855
-
67924
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67925
+
67926
+ Class descriptions are required, see rule description_empty.
67927
+
67856
67928
  Consider using ABAP Doc for documentation.`,
67857
67929
  tags: [],
67858
67930
  };
@@ -67977,16 +68049,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
67977
68049
  tags: [_irule_1.RuleTag.SingleFile],
67978
68050
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
67979
68051
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
67980
- badExample: `
67981
- CALL FUNCTION 'ZRFC'
68052
+ badExample: `
68053
+ CALL FUNCTION 'ZRFC'
67982
68054
  DESTINATION lv_rfc.`,
67983
- goodExample: `
67984
- CALL FUNCTION 'ZRFC'
67985
- DESTINATION lv_rfc
67986
- EXCEPTIONS
67987
- system_failure = 1 MESSAGE msg
67988
- communication_failure = 2 MESSAGE msg
67989
- resource_failure = 3
68055
+ goodExample: `
68056
+ CALL FUNCTION 'ZRFC'
68057
+ DESTINATION lv_rfc
68058
+ EXCEPTIONS
68059
+ system_failure = 1 MESSAGE msg
68060
+ communication_failure = 2 MESSAGE msg
68061
+ resource_failure = 3
67990
68062
  OTHERS = 4.`,
67991
68063
  };
67992
68064
  }
@@ -68070,11 +68142,11 @@ class SelectAddOrderBy {
68070
68142
  key: "select_add_order_by",
68071
68143
  title: "SELECT add ORDER BY",
68072
68144
  shortDescription: `SELECTs add ORDER BY clause`,
68073
- extendedInformation: `
68074
- This will make sure that the SELECT statement returns results in the same sequence on different databases
68075
-
68076
- add ORDER BY PRIMARY KEY if in doubt
68077
-
68145
+ extendedInformation: `
68146
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
68147
+
68148
+ add ORDER BY PRIMARY KEY if in doubt
68149
+
68078
68150
  If the target is a sorted/hashed table, no issue is reported`,
68079
68151
  tags: [_irule_1.RuleTag.SingleFile],
68080
68152
  };
@@ -68203,14 +68275,14 @@ class SelectPerformance {
68203
68275
  key: "select_performance",
68204
68276
  title: "SELECT performance",
68205
68277
  shortDescription: `Various checks regarding SELECT performance.`,
68206
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68207
-
68278
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68279
+
68208
68280
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
68209
68281
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
68210
- badExample: `SELECT field1, field2 FROM table
68211
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68282
+ badExample: `SELECT field1, field2 FROM table
68283
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68212
68284
  ENDSELECT.`,
68213
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68285
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68214
68286
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
68215
68287
  };
68216
68288
  }
@@ -68322,8 +68394,8 @@ class SelectSingleFullKey {
68322
68394
  key: "select_single_full_key",
68323
68395
  title: "Detect SELECT SINGLE which are possibily not unique",
68324
68396
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
68325
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68326
-
68397
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68398
+
68327
68399
  If the statement contains a JOIN it is not checked`,
68328
68400
  pseudoComment: "EC CI_NOORDER",
68329
68401
  tags: [],
@@ -68740,8 +68812,8 @@ class SICFConsistency {
68740
68812
  key: "sicf_consistency",
68741
68813
  title: "SICF consistency",
68742
68814
  shortDescription: `Checks the validity of ICF services`,
68743
- extendedInformation: `* Class defined in handler must exist
68744
- * Class must not have any syntax errors
68815
+ extendedInformation: `* Class defined in handler must exist
68816
+ * Class must not have any syntax errors
68745
68817
  * Class must implement interface IF_HTTP_EXTENSION`,
68746
68818
  };
68747
68819
  }
@@ -69108,8 +69180,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
69108
69180
  key: "space_before_dot",
69109
69181
  title: "Space before dot",
69110
69182
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
69111
- extendedInformation: `
69112
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69183
+ extendedInformation: `
69184
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69113
69185
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
69114
69186
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69115
69187
  badExample: `WRITE bar .`,
@@ -69295,12 +69367,12 @@ class SQLValueConversion {
69295
69367
  key: "sql_value_conversion",
69296
69368
  title: "Implicit SQL Value Conversion",
69297
69369
  shortDescription: `Ensure types match when selecting from database`,
69298
- extendedInformation: `
69299
- * Integer to CHAR conversion
69300
- * Integer to NUMC conversion
69301
- * NUMC to Integer conversion
69302
- * CHAR to Integer conversion
69303
- * Source field longer than database field, CHAR -> CHAR
69370
+ extendedInformation: `
69371
+ * Integer to CHAR conversion
69372
+ * Integer to NUMC conversion
69373
+ * NUMC to Integer conversion
69374
+ * CHAR to Integer conversion
69375
+ * Source field longer than database field, CHAR -> CHAR
69304
69376
  * Source field longer than database field, NUMC -> NUMC`,
69305
69377
  tags: [],
69306
69378
  };
@@ -69372,7 +69444,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
69372
69444
  key: "start_at_tab",
69373
69445
  title: "Start at tab",
69374
69446
  shortDescription: `Checks that statements start at tabstops.`,
69375
- extendedInformation: `Reports max 100 issues per file
69447
+ extendedInformation: `Reports max 100 issues per file
69376
69448
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
69377
69449
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69378
69450
  badExample: ` WRITE a.`,
@@ -69549,12 +69621,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
69549
69621
  key: "strict_sql",
69550
69622
  title: "Strict SQL",
69551
69623
  shortDescription: `Strict SQL`,
69552
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69553
-
69554
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69555
-
69556
- Also see separate rule sql_escape_host_variables
69557
-
69624
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69625
+
69626
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69627
+
69628
+ Also see separate rule sql_escape_host_variables
69629
+
69558
69630
  Activates from v750 and up`,
69559
69631
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
69560
69632
  };
@@ -69806,11 +69878,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
69806
69878
  key: "sy_modification",
69807
69879
  title: "Modification of SY fields",
69808
69880
  shortDescription: `Finds modification of sy fields`,
69809
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69810
-
69881
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69882
+
69811
69883
  Changes to SY-TVAR* fields are not reported`,
69812
69884
  tags: [_irule_1.RuleTag.SingleFile],
69813
- badExample: `sy-uname = 2.
69885
+ badExample: `sy-uname = 2.
69814
69886
  sy = sy.`,
69815
69887
  };
69816
69888
  }
@@ -69872,8 +69944,8 @@ class TABLEnhancementCategory {
69872
69944
  key: "tabl_enhancement_category",
69873
69945
  title: "TABL enhancement category must be set",
69874
69946
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
69875
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69876
-
69947
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69948
+
69877
69949
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
69878
69950
  tags: [],
69879
69951
  };
@@ -70001,9 +70073,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
70001
70073
  title: "Type FORM parameters",
70002
70074
  shortDescription: `Checks for untyped FORM parameters`,
70003
70075
  tags: [_irule_1.RuleTag.SingleFile],
70004
- badExample: `FORM foo USING bar.
70076
+ badExample: `FORM foo USING bar.
70005
70077
  ENDFORM.`,
70006
- goodExample: `FORM foo USING bar TYPE string.
70078
+ goodExample: `FORM foo USING bar TYPE string.
70007
70079
  ENDFORM.`,
70008
70080
  };
70009
70081
  }
@@ -70673,38 +70745,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
70673
70745
  key: "unnecessary_pragma",
70674
70746
  title: "Unnecessary Pragma",
70675
70747
  shortDescription: `Finds pragmas which can be removed`,
70676
- extendedInformation: `* NO_HANDLER with handler
70677
-
70678
- * NEEDED without definition
70679
-
70680
- * NO_TEXT without texts
70681
-
70682
- * SUBRC_OK where sy-subrc is checked
70683
-
70748
+ extendedInformation: `* NO_HANDLER with handler
70749
+
70750
+ * NEEDED without definition
70751
+
70752
+ * NO_TEXT without texts
70753
+
70754
+ * SUBRC_OK where sy-subrc is checked
70755
+
70684
70756
  NO_HANDLER inside macros are not checked`,
70685
70757
  tags: [_irule_1.RuleTag.SingleFile],
70686
- badExample: `TRY.
70687
- ...
70688
- CATCH zcx_abapgit_exception ##NO_HANDLER.
70689
- RETURN. " it has a handler
70690
- ENDTRY.
70691
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70692
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70693
- IF sy-subrc <> 0.
70758
+ badExample: `TRY.
70759
+ ...
70760
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
70761
+ RETURN. " it has a handler
70762
+ ENDTRY.
70763
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70764
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70765
+ IF sy-subrc <> 0.
70694
70766
  ENDIF.`,
70695
- goodExample: `TRY.
70696
- ...
70697
- CATCH zcx_abapgit_exception.
70698
- RETURN.
70699
- ENDTRY.
70700
- MESSAGE w125(zbar) WITH c_foo INTO message.
70701
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70702
- IF sy-subrc <> 0.
70703
- ENDIF.
70704
-
70705
- DATA: BEGIN OF blah ##NEEDED,
70706
- test1 TYPE string,
70707
- test2 TYPE string,
70767
+ goodExample: `TRY.
70768
+ ...
70769
+ CATCH zcx_abapgit_exception.
70770
+ RETURN.
70771
+ ENDTRY.
70772
+ MESSAGE w125(zbar) WITH c_foo INTO message.
70773
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70774
+ IF sy-subrc <> 0.
70775
+ ENDIF.
70776
+
70777
+ DATA: BEGIN OF blah ##NEEDED,
70778
+ test1 TYPE string,
70779
+ test2 TYPE string,
70708
70780
  END OF blah.`,
70709
70781
  };
70710
70782
  }
@@ -70862,18 +70934,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
70862
70934
  shortDescription: `Finds unnecessary RETURN statements`,
70863
70935
  extendedInformation: `Finds unnecessary RETURN statements`,
70864
70936
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70865
- badExample: `FORM hello1.
70866
- WRITE 'world'.
70867
- RETURN.
70868
- ENDFORM.
70869
-
70870
- FORM foo.
70871
- IF 1 = 2.
70872
- RETURN.
70873
- ENDIF.
70937
+ badExample: `FORM hello1.
70938
+ WRITE 'world'.
70939
+ RETURN.
70940
+ ENDFORM.
70941
+
70942
+ FORM foo.
70943
+ IF 1 = 2.
70944
+ RETURN.
70945
+ ENDIF.
70874
70946
  ENDFORM.`,
70875
- goodExample: `FORM hello2.
70876
- WRITE 'world'.
70947
+ goodExample: `FORM hello2.
70948
+ WRITE 'world'.
70877
70949
  ENDFORM.`,
70878
70950
  };
70879
70951
  }
@@ -71240,17 +71312,17 @@ class UnusedMethods {
71240
71312
  key: "unused_methods",
71241
71313
  title: "Unused methods",
71242
71314
  shortDescription: `Checks for unused methods`,
71243
- extendedInformation: `Checks private and protected methods.
71244
-
71245
- Unused methods are not reported if the object contains parser or syntax errors.
71246
-
71247
- Skips:
71248
- * methods FOR TESTING
71249
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71250
- * class_constructor + constructor methods
71251
- * event handlers
71252
- * methods that are redefined
71253
- * INCLUDEs
71315
+ extendedInformation: `Checks private and protected methods.
71316
+
71317
+ Unused methods are not reported if the object contains parser or syntax errors.
71318
+
71319
+ Skips:
71320
+ * methods FOR TESTING
71321
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71322
+ * class_constructor + constructor methods
71323
+ * event handlers
71324
+ * methods that are redefined
71325
+ * INCLUDEs
71254
71326
  `,
71255
71327
  tags: [],
71256
71328
  pragma: "##CALLED",
@@ -71640,23 +71712,23 @@ class UnusedVariables {
71640
71712
  key: "unused_variables",
71641
71713
  title: "Unused variables",
71642
71714
  shortDescription: `Checks for unused variables and constants`,
71643
- extendedInformation: `Skips event parameters.
71644
-
71645
- Note that this currently does not work if the source code uses macros.
71646
-
71647
- Unused variables are not reported if the object contains parser or syntax errors.
71648
-
71715
+ extendedInformation: `Skips event parameters.
71716
+
71717
+ Note that this currently does not work if the source code uses macros.
71718
+
71719
+ Unused variables are not reported if the object contains parser or syntax errors.
71720
+
71649
71721
  Errors found in INCLUDES are reported for the main program.`,
71650
71722
  tags: [_irule_1.RuleTag.Quickfix],
71651
71723
  pragma: "##NEEDED",
71652
71724
  pseudoComment: "EC NEEDED",
71653
- badExample: `DATA: BEGIN OF blah1,
71654
- test TYPE string,
71655
- test2 TYPE string,
71725
+ badExample: `DATA: BEGIN OF blah1,
71726
+ test TYPE string,
71727
+ test2 TYPE string,
71656
71728
  END OF blah1.`,
71657
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71658
- test TYPE string,
71659
- test2 TYPE string,
71729
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71730
+ test TYPE string,
71731
+ test2 TYPE string,
71660
71732
  END OF blah2.`,
71661
71733
  };
71662
71734
  }
@@ -71875,15 +71947,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
71875
71947
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
71876
71948
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
71877
71949
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
71878
- badExample: `IF line IS INITIAL.
71879
- has_entries = abap_false.
71880
- ELSE.
71881
- has_entries = abap_true.
71882
- ENDIF.
71883
-
71950
+ badExample: `IF line IS INITIAL.
71951
+ has_entries = abap_false.
71952
+ ELSE.
71953
+ has_entries = abap_true.
71954
+ ENDIF.
71955
+
71884
71956
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
71885
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71886
-
71957
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71958
+
71887
71959
  DATA(fsdf) = xsdbool( foo <> bar ).`,
71888
71960
  };
71889
71961
  }
@@ -72059,15 +72131,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
72059
72131
  key: "use_line_exists",
72060
72132
  title: "Use line_exists",
72061
72133
  shortDescription: `Use line_exists, from 740sp02 and up`,
72062
- extendedInformation: `
72063
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72064
-
72134
+ extendedInformation: `
72135
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72136
+
72065
72137
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
72066
72138
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72067
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72068
- IF sy-subrc = 0.
72139
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72140
+ IF sy-subrc = 0.
72069
72141
  ENDIF.`,
72070
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72142
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72071
72143
  ENDIF.`,
72072
72144
  };
72073
72145
  }
@@ -72177,10 +72249,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
72177
72249
  key: "use_new",
72178
72250
  title: "Use NEW",
72179
72251
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
72180
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72181
-
72182
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72183
-
72252
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72253
+
72254
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72255
+
72184
72256
  Applicable from v740sp02 and up`,
72185
72257
  badExample: `CREATE OBJECT ref.`,
72186
72258
  goodExample: `ref = NEW #( ).`,
@@ -72278,13 +72350,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
72278
72350
  title: "WHEN OTHERS last",
72279
72351
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
72280
72352
  tags: [_irule_1.RuleTag.SingleFile],
72281
- badExample: `CASE bar.
72282
- WHEN OTHERS.
72283
- WHEN 2.
72353
+ badExample: `CASE bar.
72354
+ WHEN OTHERS.
72355
+ WHEN 2.
72284
72356
  ENDCASE.`,
72285
- goodExample: `CASE bar.
72286
- WHEN 2.
72287
- WHEN OTHERS.
72357
+ goodExample: `CASE bar.
72358
+ WHEN 2.
72359
+ WHEN OTHERS.
72288
72360
  ENDCASE.`,
72289
72361
  };
72290
72362
  }
@@ -75117,14 +75189,13 @@ const parseXml = function(xmlData) {
75117
75189
 
75118
75190
  textData = this.saveTextToParentTag(textData, currentNode, jPath);
75119
75191
 
75192
+ let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
75193
+ if(val == undefined) val = "";
75194
+
75120
75195
  //cdata should be set even if it is 0 length string
75121
75196
  if(this.options.cdataPropName){
75122
- // let val = this.parseTextData(tagExp, this.options.cdataPropName, jPath + "." + this.options.cdataPropName, true, false, true);
75123
- // if(!val) val = "";
75124
75197
  currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]);
75125
75198
  }else{
75126
- let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);
75127
- if(val == undefined) val = "";
75128
75199
  currentNode.add(this.options.textNodeName, val);
75129
75200
  }
75130
75201