@abaplint/cli 2.105.5 → 2.105.7

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.
package/build/cli.js CHANGED
@@ -931,7 +931,7 @@ async function loadDependencies(config, compress, bar, base) {
931
931
  function displayHelp() {
932
932
  // follow https://docopt.org conventions,
933
933
  return "Usage:\n" +
934
- " abaplint [<abaplint.json> -f <format> -c --outformat <format> --outfile <file> --fix] \n" +
934
+ " abaplint [<abaplint.json> -f <format> -c --outformat <format> --outfile <file> --fix --file <file>] \n" +
935
935
  " abaplint -h | --help show this help\n" +
936
936
  " abaplint -v | --version show version\n" +
937
937
  " abaplint -d | --default show default configuration\n" +
@@ -943,7 +943,8 @@ function displayHelp() {
943
943
  " --fix apply quick fixes to files\n" +
944
944
  " --rename rename object according to rules in abaplint.json\n" +
945
945
  " -p output performance information\n" +
946
- " -c compress files in memory\n";
946
+ " -c compress files in memory\n" +
947
+ " --file input file, glob format\n";
947
948
  }
948
949
  function out(issues, length, arg) {
949
950
  const output = _format_1.Formatter.format(issues, arg.format, length);
@@ -986,7 +987,9 @@ async function run(arg) {
986
987
  if (config.get().global.files === undefined) {
987
988
  throw "Error: Update abaplint configuration file to latest format";
988
989
  }
989
- const files = file_operations_1.FileOperations.loadFileNames(base + config.get().global.files);
990
+ const files = (arg.file)
991
+ ? file_operations_1.FileOperations.loadFileNames(base + arg.file)
992
+ : file_operations_1.FileOperations.loadFileNames(base + config.get().global.files);
990
993
  loaded = await file_operations_1.FileOperations.loadFiles(arg.compress, files, progress);
991
994
  deps = await loadDependencies(config, arg.compress, progress, base);
992
995
  reg = new core_1.Registry(config);
@@ -26134,6 +26137,12 @@ class NewObject {
26134
26137
  if (clas) {
26135
26138
  scope.addReference(typeToken, clas, _reference_1.ReferenceType.InferredType, filename);
26136
26139
  }
26140
+ else {
26141
+ const intf = scope.findInterfaceDefinition(targetType.getIdentifierName());
26142
+ if (intf) {
26143
+ throw new Error(intf.getName() + " is an interface, cannot be instantiated");
26144
+ }
26145
+ }
26137
26146
  ret = targetType;
26138
26147
  if ((clas === null || clas === void 0 ? void 0 : clas.isAbstract()) === true) {
26139
26148
  throw new Error(clas.getName() + " is abstract, cannot be instantiated");
@@ -28248,9 +28257,9 @@ class Assign {
28248
28257
  const thirdAssign = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren()[2];
28249
28258
  if ((secondAssign === null || secondAssign === void 0 ? void 0 : secondAssign.concatTokens()) === "=>" && firstAssign && (thirdAssign === null || thirdAssign === void 0 ? void 0 : thirdAssign.get()) instanceof Expressions.Dynamic) {
28250
28259
  const name = firstAssign.concatTokens();
28251
- const found = scope.findObjectDefinition(name) === undefined || scope.findVariable(name);
28252
- if (found === undefined && scope.getDDIC().inErrorNamespace(name)) {
28253
- throw new Error(secondAssign.concatTokens() + " not found");
28260
+ const found = scope.findClassDefinition(name) || scope.findVariable(name);
28261
+ if (found === undefined && scope.getDDIC().inErrorNamespace(name) && name.startsWith("(") === false) {
28262
+ throw new Error(name + " not found, dynamic");
28254
28263
  }
28255
28264
  sourceType = new basic_1.VoidType("Dynamic");
28256
28265
  }
@@ -28994,7 +29003,7 @@ class Concatenate {
28994
29003
  }
28995
29004
  else if (target) {
28996
29005
  const type = new target_1.Target().runSyntax(target, scope, filename);
28997
- const compatible = byteMode ? new _type_utils_1.TypeUtils(scope).isHexLike(type) : new _type_utils_1.TypeUtils(scope).isCharLike(type);
29006
+ const compatible = byteMode ? new _type_utils_1.TypeUtils(scope).isHexLike(type) : new _type_utils_1.TypeUtils(scope).isCharLikeStrict(type);
28998
29007
  if (compatible === false) {
28999
29008
  throw new Error("Target type not compatible");
29000
29009
  }
@@ -29008,7 +29017,7 @@ class Concatenate {
29008
29017
  linesMode = false;
29009
29018
  continue;
29010
29019
  }
29011
- const compatible = byteMode ? new _type_utils_1.TypeUtils(scope).isHexLike(type) : new _type_utils_1.TypeUtils(scope).isCharLike(type);
29020
+ const compatible = byteMode ? new _type_utils_1.TypeUtils(scope).isHexLike(type) : new _type_utils_1.TypeUtils(scope).isCharLikeStrict(type);
29012
29021
  if (compatible === false) {
29013
29022
  throw new Error("Source type not compatible");
29014
29023
  }
@@ -29355,11 +29364,14 @@ class CreateObject {
29355
29364
  }
29356
29365
  const source = p.findDirectExpression(Expressions.Source);
29357
29366
  const sourceType = new source_1.Source().runSyntax(source, scope, filename);
29367
+ const calculated = (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.MethodCallChain)) !== undefined
29368
+ || (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.StringTemplate)) !== undefined
29369
+ || (source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.ArithOperator)) !== undefined;
29358
29370
  const found = allImporting === null || allImporting === void 0 ? void 0 : allImporting.find(p => p.getName().toUpperCase() === name);
29359
29371
  if (found === undefined) {
29360
29372
  throw new Error(`constructor parameter "${name}" does not exist`);
29361
29373
  }
29362
- else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, found.getType()) === false) {
29374
+ else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, found.getType(), calculated) === false) {
29363
29375
  throw new Error(`constructor parameter "${name}" type not compatible`);
29364
29376
  }
29365
29377
  requiredImporting.delete(name);
@@ -34094,13 +34106,13 @@ class FlowGraph {
34094
34106
  this.label = label;
34095
34107
  }
34096
34108
  toDigraph() {
34097
- return `digraph G {
34098
- labelloc="t";
34099
- label="${this.label}";
34100
- graph [fontname = "helvetica"];
34101
- node [fontname = "helvetica", shape="box"];
34102
- edge [fontname = "helvetica"];
34103
- ${this.toTextEdges()}
34109
+ return `digraph G {
34110
+ labelloc="t";
34111
+ label="${this.label}";
34112
+ graph [fontname = "helvetica"];
34113
+ node [fontname = "helvetica", shape="box"];
34114
+ edge [fontname = "helvetica"];
34115
+ ${this.toTextEdges()}
34104
34116
  }`;
34105
34117
  }
34106
34118
  listSources(node) {
@@ -42104,13 +42116,13 @@ class Help {
42104
42116
  /////////////////////////////////////////////////
42105
42117
  static dumpABAP(file, reg, textDocument, position) {
42106
42118
  let content = "";
42107
- content = `
42108
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
42109
- <a href="#_statements" rel="no-refresh">Statements</a> |
42110
- <a href="#_structure" rel="no-refresh">Structure</a> |
42111
- <a href="#_files" rel="no-refresh">Files</a> |
42112
- <a href="#_info" rel="no-refresh">Info Dump</a>
42113
- <hr>
42119
+ content = `
42120
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
42121
+ <a href="#_statements" rel="no-refresh">Statements</a> |
42122
+ <a href="#_structure" rel="no-refresh">Structure</a> |
42123
+ <a href="#_files" rel="no-refresh">Files</a> |
42124
+ <a href="#_info" rel="no-refresh">Info Dump</a>
42125
+ <hr>
42114
42126
  ` +
42115
42127
  "<tt>" + textDocument.uri + " (" +
42116
42128
  (position.line + 1) + ", " +
@@ -47321,6 +47333,7 @@ class NeptuneAPI extends _abstract_object_1.AbstractObject {
47321
47333
  return {
47322
47334
  maxLength: 100,
47323
47335
  allowNamespace: true,
47336
+ customRegex: /.*/i,
47324
47337
  };
47325
47338
  }
47326
47339
  getDescription() {
@@ -51096,7 +51109,7 @@ class Registry {
51096
51109
  }
51097
51110
  static abaplintVersion() {
51098
51111
  // magic, see build script "version.sh"
51099
- return "2.105.5";
51112
+ return "2.105.7";
51100
51113
  }
51101
51114
  getDDICReferences() {
51102
51115
  return this.ddicReferences;
@@ -51412,10 +51425,10 @@ class SevenBitAscii {
51412
51425
  key: "7bit_ascii",
51413
51426
  title: "Check for 7bit ascii",
51414
51427
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
51415
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51416
-
51417
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51418
-
51428
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51429
+
51430
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51431
+
51419
51432
  Checkes files with extensions ".abap" and ".asddls"`,
51420
51433
  tags: [_irule_1.RuleTag.SingleFile],
51421
51434
  };
@@ -51604,6 +51617,8 @@ class AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {
51604
51617
  this.checkLocal = false;
51605
51618
  this.classDefinition = false;
51606
51619
  this.interfaceDefinition = false;
51620
+ /** Ignores classes flagged as FOR TESTING */
51621
+ this.ignoreTestClasses = true;
51607
51622
  }
51608
51623
  }
51609
51624
  exports.AbapdocConf = AbapdocConf;
@@ -51617,10 +51632,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
51617
51632
  key: "abapdoc",
51618
51633
  title: "Check abapdoc",
51619
51634
  shortDescription: `Various checks regarding abapdoc.`,
51620
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51621
-
51622
- Plus class and interface definitions.
51623
-
51635
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51636
+
51637
+ Plus class and interface definitions.
51638
+
51624
51639
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
51625
51640
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
51626
51641
  };
@@ -51643,8 +51658,11 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
51643
51658
  if (this.conf.checkLocal === false && classDef.isLocal === true) {
51644
51659
  continue;
51645
51660
  }
51661
+ if (this.conf.ignoreTestClasses === true && classDef.isForTesting === true) {
51662
+ continue;
51663
+ }
51646
51664
  methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));
51647
- if (this.getConfig().classDefinition === true) {
51665
+ if (this.conf.classDefinition === true) {
51648
51666
  const previousRow = classDef.identifier.getStart().getRow() - 2;
51649
51667
  if (((_a = rows[previousRow]) === null || _a === void 0 ? void 0 : _a.trim().substring(0, 2)) !== "\"!") {
51650
51668
  const message = "Missing ABAP Doc for class " + classDef.identifier.getToken().getStr();
@@ -51658,7 +51676,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
51658
51676
  continue;
51659
51677
  }
51660
51678
  methods = methods.concat(interfaceDef.methods);
51661
- if (this.getConfig().interfaceDefinition === true) {
51679
+ if (this.conf.interfaceDefinition === true) {
51662
51680
  const previousRow = interfaceDef.identifier.getStart().getRow() - 2;
51663
51681
  if (((_b = rows[previousRow]) === null || _b === void 0 ? void 0 : _b.trim().substring(0, 2)) !== "\"!") {
51664
51682
  const message = "Missing ABAP Doc for interface " + interfaceDef.identifier.getToken().getStr();
@@ -51755,49 +51773,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
51755
51773
  key: "align_parameters",
51756
51774
  title: "Align Parameters",
51757
51775
  shortDescription: `Checks for vertially aligned parameters`,
51758
- extendedInformation: `Checks:
51759
- * function module calls
51760
- * method calls
51761
- * VALUE constructors
51762
- * NEW constructors
51763
- * RAISE EXCEPTION statements
51764
- * CREATE OBJECT statements
51765
- * RAISE EVENT statements
51766
-
51767
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51768
-
51769
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51770
-
51771
- If parameters are on the same row, no issues are reported, see
51776
+ extendedInformation: `Checks:
51777
+ * function module calls
51778
+ * method calls
51779
+ * VALUE constructors
51780
+ * NEW constructors
51781
+ * RAISE EXCEPTION statements
51782
+ * CREATE OBJECT statements
51783
+ * RAISE EVENT statements
51784
+
51785
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51786
+
51787
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51788
+
51789
+ If parameters are on the same row, no issues are reported, see
51772
51790
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
51773
51791
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
51774
- badExample: `CALL FUNCTION 'FOOBAR'
51775
- EXPORTING
51776
- foo = 2
51777
- parameter = 3.
51778
-
51779
- foobar( moo = 1
51780
- param = 1 ).
51781
-
51782
- foo = VALUE #(
51783
- foo = bar
51792
+ badExample: `CALL FUNCTION 'FOOBAR'
51793
+ EXPORTING
51794
+ foo = 2
51795
+ parameter = 3.
51796
+
51797
+ foobar( moo = 1
51798
+ param = 1 ).
51799
+
51800
+ foo = VALUE #(
51801
+ foo = bar
51784
51802
  moo = 2 ).`,
51785
- goodExample: `CALL FUNCTION 'FOOBAR'
51786
- EXPORTING
51787
- foo = 2
51788
- parameter = 3.
51789
-
51790
- foobar( moo = 1
51791
- param = 1 ).
51792
-
51793
- foo = VALUE #(
51794
- foo = bar
51795
- moo = 2 ).
51796
-
51797
- DATA(sdf) = VALUE type(
51798
- common_val = 2
51799
- another_common = 5
51800
- ( row_value = 4
51803
+ goodExample: `CALL FUNCTION 'FOOBAR'
51804
+ EXPORTING
51805
+ foo = 2
51806
+ parameter = 3.
51807
+
51808
+ foobar( moo = 1
51809
+ param = 1 ).
51810
+
51811
+ foo = VALUE #(
51812
+ foo = bar
51813
+ moo = 2 ).
51814
+
51815
+ DATA(sdf) = VALUE type(
51816
+ common_val = 2
51817
+ another_common = 5
51818
+ ( row_value = 4
51801
51819
  value_foo = 5 ) ).`,
51802
51820
  };
51803
51821
  }
@@ -52122,6 +52140,7 @@ exports.AllowedObjectNaming = exports.AllowedObjectNamingConf = void 0;
52122
52140
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
52123
52141
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
52124
52142
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
52143
+ const NAME_REGEX = /^(\/[A-Z_\d]{3,8}\/)?[A-Z_\d<> ]+$/i;
52125
52144
  class AllowedObjectNamingConf extends _basic_rule_config_1.BasicRuleConfig {
52126
52145
  }
52127
52146
  exports.AllowedObjectNamingConf = AllowedObjectNamingConf;
@@ -52161,7 +52180,7 @@ class AllowedObjectNaming {
52161
52180
  message = "Name not allowed";
52162
52181
  }
52163
52182
  }
52164
- else if (name.match(/^(\/[A-Z_\d]{3,8}\/)?[A-Z_\d<> ]+$/i) === null) {
52183
+ else if (name.match(NAME_REGEX) === null) {
52165
52184
  message = "Name not allowed";
52166
52185
  }
52167
52186
  if (message.length > 0) {
@@ -52272,15 +52291,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
52272
52291
  return {
52273
52292
  key: "ambiguous_statement",
52274
52293
  title: "Check for ambigious statements",
52275
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52276
- Add "TABLE" keyword or "@" for escaping SQL variables
52277
-
52294
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52295
+ Add "TABLE" keyword or "@" for escaping SQL variables
52296
+
52278
52297
  Only works if the target version is 740sp05 or above`,
52279
52298
  tags: [_irule_1.RuleTag.SingleFile],
52280
- badExample: `DELETE foo FROM bar.
52299
+ badExample: `DELETE foo FROM bar.
52281
52300
  MODIFY foo FROM bar.`,
52282
- goodExample: `DELETE foo FROM @bar.
52283
- MODIFY TABLE foo FROM bar.
52301
+ goodExample: `DELETE foo FROM @bar.
52302
+ MODIFY TABLE foo FROM bar.
52284
52303
  MODIFY zfoo FROM @wa.`,
52285
52304
  };
52286
52305
  }
@@ -52384,16 +52403,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
52384
52403
  key: "avoid_use",
52385
52404
  title: "Avoid use of certain statements",
52386
52405
  shortDescription: `Detects usage of certain statements.`,
52387
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52388
-
52389
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52390
-
52391
- STATICS: use CLASS-DATA instead
52392
-
52393
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52394
-
52395
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52396
-
52406
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52407
+
52408
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52409
+
52410
+ STATICS: use CLASS-DATA instead
52411
+
52412
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52413
+
52414
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52415
+
52397
52416
  BREAK points`,
52398
52417
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
52399
52418
  };
@@ -52514,11 +52533,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
52514
52533
  title: "Check BEGIN END names",
52515
52534
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
52516
52535
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
52517
- badExample: `DATA: BEGIN OF stru,
52518
- field TYPE i,
52536
+ badExample: `DATA: BEGIN OF stru,
52537
+ field TYPE i,
52519
52538
  END OF structure_not_the_same.`,
52520
- goodExample: `DATA: BEGIN OF stru,
52521
- field TYPE i,
52539
+ goodExample: `DATA: BEGIN OF stru,
52540
+ field TYPE i,
52522
52541
  END OF stru.`,
52523
52542
  };
52524
52543
  }
@@ -52611,19 +52630,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
52611
52630
  title: "BEGIN contains single INCLUDE",
52612
52631
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
52613
52632
  tags: [_irule_1.RuleTag.SingleFile],
52614
- badExample: `TYPES: BEGIN OF dummy1.
52615
- INCLUDE TYPE dselc.
52616
- TYPES: END OF dummy1.
52617
-
52618
- DATA BEGIN OF foo.
52619
- INCLUDE STRUCTURE syst.
52620
- DATA END OF foo.
52621
-
52622
- STATICS BEGIN OF bar.
52623
- INCLUDE STRUCTURE syst.
52633
+ badExample: `TYPES: BEGIN OF dummy1.
52634
+ INCLUDE TYPE dselc.
52635
+ TYPES: END OF dummy1.
52636
+
52637
+ DATA BEGIN OF foo.
52638
+ INCLUDE STRUCTURE syst.
52639
+ DATA END OF foo.
52640
+
52641
+ STATICS BEGIN OF bar.
52642
+ INCLUDE STRUCTURE syst.
52624
52643
  STATICS END OF bar.`,
52625
- goodExample: `DATA BEGIN OF foo.
52626
- INCLUDE STRUCTURE dselc.
52644
+ goodExample: `DATA BEGIN OF foo.
52645
+ INCLUDE STRUCTURE dselc.
52627
52646
  DATA END OF foo.`,
52628
52647
  };
52629
52648
  }
@@ -52713,9 +52732,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
52713
52732
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
52714
52733
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
52715
52734
  badExample: `CALL TRANSACTION 'FOO'.`,
52716
- goodExample: `TRY.
52717
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52718
- CATCH cx_sy_authorization_error.
52735
+ goodExample: `TRY.
52736
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52737
+ CATCH cx_sy_authorization_error.
52719
52738
  ENDTRY.`,
52720
52739
  };
52721
52740
  }
@@ -52780,10 +52799,10 @@ class CDSCommentStyle {
52780
52799
  key: "cds_comment_style",
52781
52800
  title: "CDS Comment Style",
52782
52801
  shortDescription: `Check for obsolete comment style`,
52783
- extendedInformation: `Check for obsolete comment style
52784
-
52785
- Comments starting with "--" are considered obsolete
52786
-
52802
+ extendedInformation: `Check for obsolete comment style
52803
+
52804
+ Comments starting with "--" are considered obsolete
52805
+
52787
52806
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
52788
52807
  tags: [_irule_1.RuleTag.SingleFile],
52789
52808
  badExample: "-- this is a comment",
@@ -52850,10 +52869,10 @@ class CDSLegacyView {
52850
52869
  title: "CDS Legacy View",
52851
52870
  shortDescription: `Identify CDS Legacy Views`,
52852
52871
  // eslint-disable-next-line max-len
52853
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52854
-
52855
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52856
-
52872
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52873
+
52874
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52875
+
52857
52876
  v755 and up`,
52858
52877
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
52859
52878
  };
@@ -53008,10 +53027,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
53008
53027
  key: "chain_mainly_declarations",
53009
53028
  title: "Chain mainly declarations",
53010
53029
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
53011
- extendedInformation: `
53012
- https://docs.abapopenchecks.org/checks/23/
53013
-
53014
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53030
+ extendedInformation: `
53031
+ https://docs.abapopenchecks.org/checks/23/
53032
+
53033
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53015
53034
  `,
53016
53035
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53017
53036
  badExample: `CALL METHOD: bar.`,
@@ -53187,17 +53206,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
53187
53206
  title: "Change IF to CASE",
53188
53207
  shortDescription: `Finds IF constructs that can be changed to CASE`,
53189
53208
  // eslint-disable-next-line max-len
53190
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53191
-
53209
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53210
+
53192
53211
  If the first comparison is a boolean compare, no issue is reported.`,
53193
53212
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53194
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
53195
- ELSEIF l_fcat-fieldname = 'BAR'
53196
- OR l_fcat-fieldname = 'MOO'.
53213
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
53214
+ ELSEIF l_fcat-fieldname = 'BAR'
53215
+ OR l_fcat-fieldname = 'MOO'.
53197
53216
  ENDIF.`,
53198
- goodExample: `CASE l_fcat-fieldname.
53199
- WHEN 'FOO'.
53200
- WHEN 'BAR' OR 'MOO'.
53217
+ goodExample: `CASE l_fcat-fieldname.
53218
+ WHEN 'FOO'.
53219
+ WHEN 'BAR' OR 'MOO'.
53201
53220
  ENDCASE.`,
53202
53221
  };
53203
53222
  }
@@ -53334,8 +53353,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
53334
53353
  return {
53335
53354
  key: "check_abstract",
53336
53355
  title: "Check abstract methods and classes",
53337
- shortDescription: `Checks abstract methods and classes:
53338
- - class defined as abstract and final,
53356
+ shortDescription: `Checks abstract methods and classes:
53357
+ - class defined as abstract and final,
53339
53358
  - non-abstract class contains abstract methods`,
53340
53359
  extendedInformation: `If a class defines only constants, use an interface instead`,
53341
53360
  tags: [_irule_1.RuleTag.SingleFile],
@@ -53416,11 +53435,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
53416
53435
  return {
53417
53436
  key: "check_comments",
53418
53437
  title: "Check Comments",
53419
- shortDescription: `
53438
+ shortDescription: `
53420
53439
  Various checks for comment usage.`,
53421
- extendedInformation: `
53422
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53423
-
53440
+ extendedInformation: `
53441
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53442
+
53424
53443
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
53425
53444
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53426
53445
  badExample: `WRITE 2. " descriptive comment`,
@@ -53582,9 +53601,9 @@ class CheckInclude {
53582
53601
  key: "check_include",
53583
53602
  title: "Check INCLUDEs",
53584
53603
  shortDescription: `Checks INCLUDE statements`,
53585
- extendedInformation: `
53586
- * Reports unused includes
53587
- * Errors if the includes are not found
53604
+ extendedInformation: `
53605
+ * Reports unused includes
53606
+ * Errors if the includes are not found
53588
53607
  * Error if including a main program`,
53589
53608
  tags: [_irule_1.RuleTag.Syntax],
53590
53609
  };
@@ -53659,14 +53678,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
53659
53678
  key: "check_subrc",
53660
53679
  title: "Check sy-subrc",
53661
53680
  shortDescription: `Check sy-subrc`,
53662
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53663
-
53664
- If sy-dbcnt is checked after database statements, it is considered okay.
53665
-
53666
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53667
-
53668
- If IS ASSIGNED is checked after assigning, it is considered okay.
53669
-
53681
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53682
+
53683
+ If sy-dbcnt is checked after database statements, it is considered okay.
53684
+
53685
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53686
+
53687
+ If IS ASSIGNED is checked after assigning, it is considered okay.
53688
+
53670
53689
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
53671
53690
  tags: [_irule_1.RuleTag.SingleFile],
53672
53691
  pseudoComment: "EC CI_SUBRC",
@@ -54219,17 +54238,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
54219
54238
  shortDescription: `Find overlapping classic exceptions`,
54220
54239
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
54221
54240
  tags: [_irule_1.RuleTag.SingleFile],
54222
- badExample: `CALL FUNCTION 'SOMETHING'
54223
- EXCEPTIONS
54224
- system_failure = 1 MESSAGE lv_message
54225
- communication_failure = 1 MESSAGE lv_message
54226
- resource_failure = 1
54241
+ badExample: `CALL FUNCTION 'SOMETHING'
54242
+ EXCEPTIONS
54243
+ system_failure = 1 MESSAGE lv_message
54244
+ communication_failure = 1 MESSAGE lv_message
54245
+ resource_failure = 1
54227
54246
  OTHERS = 1.`,
54228
- goodExample: `CALL FUNCTION 'SOMETHING'
54229
- EXCEPTIONS
54230
- system_failure = 1 MESSAGE lv_message
54231
- communication_failure = 2 MESSAGE lv_message
54232
- resource_failure = 3
54247
+ goodExample: `CALL FUNCTION 'SOMETHING'
54248
+ EXCEPTIONS
54249
+ system_failure = 1 MESSAGE lv_message
54250
+ communication_failure = 2 MESSAGE lv_message
54251
+ resource_failure = 3
54233
54252
  OTHERS = 4.`,
54234
54253
  };
54235
54254
  }
@@ -54475,7 +54494,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
54475
54494
  key: "commented_code",
54476
54495
  title: "Find commented code",
54477
54496
  shortDescription: `Detects usage of commented out code.`,
54478
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54497
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54479
54498
  https://docs.abapopenchecks.org/checks/14/`,
54480
54499
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54481
54500
  };
@@ -54707,10 +54726,10 @@ class ConstructorVisibilityPublic {
54707
54726
  key: "constructor_visibility_public",
54708
54727
  title: "Check constructor visibility is public",
54709
54728
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
54710
- extendedInformation: `
54711
- This only applies to global classes.
54712
-
54713
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54729
+ extendedInformation: `
54730
+ This only applies to global classes.
54731
+
54732
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54714
54733
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
54715
54734
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54716
54735
  };
@@ -54785,8 +54804,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
54785
54804
  key: "contains_tab",
54786
54805
  title: "Code contains tab",
54787
54806
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
54788
- extendedInformation: `
54789
- https://docs.abapopenchecks.org/checks/09/
54807
+ extendedInformation: `
54808
+ https://docs.abapopenchecks.org/checks/09/
54790
54809
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
54791
54810
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54792
54811
  };
@@ -54871,10 +54890,10 @@ class CyclicOO {
54871
54890
  key: "cyclic_oo",
54872
54891
  title: "Cyclic OO",
54873
54892
  shortDescription: `Finds cyclic OO references`,
54874
- extendedInformation: `Runs for global INTF + CLAS objects
54875
-
54876
- Objects must be without syntax errors for this rule to take effect
54877
-
54893
+ extendedInformation: `Runs for global INTF + CLAS objects
54894
+
54895
+ Objects must be without syntax errors for this rule to take effect
54896
+
54878
54897
  References in testclass includes are ignored`,
54879
54898
  };
54880
54899
  }
@@ -55116,7 +55135,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
55116
55135
  key: "dangerous_statement",
55117
55136
  title: "Dangerous statement",
55118
55137
  shortDescription: `Detects potentially dangerous statements`,
55119
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55138
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55120
55139
  dynamic SQL can potentially create SQL injection problems`,
55121
55140
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55122
55141
  };
@@ -55320,13 +55339,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
55320
55339
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
55321
55340
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
55322
55341
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55323
- badExample: `FROM foo.
55324
- WRITE 'hello'.
55325
- DATA int TYPE i.
55342
+ badExample: `FROM foo.
55343
+ WRITE 'hello'.
55344
+ DATA int TYPE i.
55326
55345
  ENDFORM.`,
55327
- goodExample: `FROM foo.
55328
- DATA int TYPE i.
55329
- WRITE 'hello'.
55346
+ goodExample: `FROM foo.
55347
+ DATA int TYPE i.
55348
+ WRITE 'hello'.
55330
55349
  ENDFORM.`,
55331
55350
  };
55332
55351
  }
@@ -55862,39 +55881,39 @@ class Downport {
55862
55881
  key: "downport",
55863
55882
  title: "Downport statement",
55864
55883
  shortDescription: `Downport functionality`,
55865
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
55866
- a higher level language version. If successful, various rules are applied to downport the statement.
55867
- Target downport version is always v702, thus rule is only enabled if target version is v702.
55868
-
55869
- Current rules:
55870
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
55871
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
55872
- * FIELD-SYMBOL() definitions are outlined
55873
- * CONV is outlined
55874
- * COND is outlined
55875
- * REDUCE is outlined
55876
- * SWITCH is outlined
55877
- * FILTER is outlined
55878
- * APPEND expression is outlined
55879
- * INSERT expression is outlined
55880
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
55881
- * CAST changed to ?=
55882
- * LOOP AT method_call( ) is outlined
55883
- * VALUE # with structure fields
55884
- * VALUE # with internal table lines
55885
- * Table Expressions are outlined
55886
- * SELECT INTO @DATA definitions are outlined
55887
- * Some occurrences of string template formatting option ALPHA changed to function module call
55888
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
55889
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
55890
- * RAISE EXCEPTION ... MESSAGE
55891
- * Moving with +=, -=, /=, *=, &&= is expanded
55892
- * line_exists and line_index is downported to READ TABLE
55893
- * ENUMs, but does not nessesarily give the correct type and value
55894
- * MESSAGE with non simple source
55895
-
55896
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
55897
-
55884
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
55885
+ a higher level language version. If successful, various rules are applied to downport the statement.
55886
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
55887
+
55888
+ Current rules:
55889
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
55890
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
55891
+ * FIELD-SYMBOL() definitions are outlined
55892
+ * CONV is outlined
55893
+ * COND is outlined
55894
+ * REDUCE is outlined
55895
+ * SWITCH is outlined
55896
+ * FILTER is outlined
55897
+ * APPEND expression is outlined
55898
+ * INSERT expression is outlined
55899
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
55900
+ * CAST changed to ?=
55901
+ * LOOP AT method_call( ) is outlined
55902
+ * VALUE # with structure fields
55903
+ * VALUE # with internal table lines
55904
+ * Table Expressions are outlined
55905
+ * SELECT INTO @DATA definitions are outlined
55906
+ * Some occurrences of string template formatting option ALPHA changed to function module call
55907
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
55908
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
55909
+ * RAISE EXCEPTION ... MESSAGE
55910
+ * Moving with +=, -=, /=, *=, &&= is expanded
55911
+ * line_exists and line_index is downported to READ TABLE
55912
+ * ENUMs, but does not nessesarily give the correct type and value
55913
+ * MESSAGE with non simple source
55914
+
55915
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
55916
+
55898
55917
  Make sure to test the downported code, it might not always be completely correct.`,
55899
55918
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
55900
55919
  };
@@ -56468,10 +56487,10 @@ Make sure to test the downported code, it might not always be completely correct
56468
56487
  const fieldName = f.concatTokens();
56469
56488
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
56470
56489
  }
56471
- fieldDefinition = `DATA: BEGIN OF ${name},
56490
+ fieldDefinition = `DATA: BEGIN OF ${name},
56472
56491
  ${fieldDefinition}${indentation} END OF ${name}.`;
56473
56492
  }
56474
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56493
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56475
56494
  ${indentation}`);
56476
56495
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
56477
56496
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56515,12 +56534,12 @@ ${indentation}`);
56515
56534
  }
56516
56535
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56517
56536
  const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
56518
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56519
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56520
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56537
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56538
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56539
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56521
56540
  ${indentation}`);
56522
56541
  if (fieldDefinitions === "") {
56523
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56542
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56524
56543
  ${indentation}`);
56525
56544
  }
56526
56545
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -56588,7 +56607,7 @@ ${indentation}`);
56588
56607
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56589
56608
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56590
56609
  const firstToken = high.getFirstToken();
56591
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56610
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56592
56611
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56593
56612
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56594
56613
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56626,7 +56645,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56626
56645
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56627
56646
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56628
56647
  const firstToken = high.getFirstToken();
56629
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56648
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
56630
56649
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56631
56650
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56632
56651
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56668,14 +56687,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56668
56687
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56669
56688
  const firstToken = high.getFirstToken();
56670
56689
  // note that the tabix restore should be done before throwing the exception
56671
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56672
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56673
- ${indentation}${tabixBackup} = sy-tabix.
56674
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56675
- ${indentation}sy-tabix = ${tabixBackup}.
56676
- ${indentation}IF sy-subrc <> 0.
56677
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56678
- ${indentation}ENDIF.
56690
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56691
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56692
+ ${indentation}${tabixBackup} = sy-tabix.
56693
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56694
+ ${indentation}sy-tabix = ${tabixBackup}.
56695
+ ${indentation}IF sy-subrc <> 0.
56696
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56697
+ ${indentation}ENDIF.
56679
56698
  ${indentation}`);
56680
56699
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
56681
56700
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56732,7 +56751,7 @@ ${indentation}`);
56732
56751
  const className = classNames[0].concatTokens();
56733
56752
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
56734
56753
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56735
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
56754
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
56736
56755
  ${indentation}CATCH ${className} INTO ${targetName}.`;
56737
56756
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
56738
56757
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -56894,16 +56913,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
56894
56913
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56895
56914
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56896
56915
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56897
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56898
- ${indentation}${uniqueName1}-msgid = ${id}.
56916
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56917
+ ${indentation}${uniqueName1}-msgid = ${id}.
56899
56918
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
56900
56919
  if (withs.length > 0) {
56901
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
56902
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
56903
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
56920
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
56921
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
56922
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
56904
56923
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
56905
56924
  }
56906
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56925
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56907
56926
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
56908
56927
  if (withs.length > 0) {
56909
56928
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -57015,10 +57034,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
57015
57034
  let code = "";
57016
57035
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
57017
57036
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57018
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57019
- IF sy-subrc <> 0.
57020
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57021
- ENDIF.
57037
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57038
+ IF sy-subrc <> 0.
57039
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57040
+ ENDIF.
57022
57041
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57023
57042
  }
57024
57043
  else {
@@ -57094,20 +57113,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57094
57113
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57095
57114
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57096
57115
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57097
- code += ` items LIKE ${loopSourceName},
57098
- END OF ${groupTargetName}type.
57099
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57100
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57116
+ code += ` items LIKE ${loopSourceName},
57117
+ END OF ${groupTargetName}type.
57118
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57119
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57101
57120
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
57102
57121
  if (groupIndexName !== undefined) {
57103
57122
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
57104
57123
  }
57105
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57124
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57106
57125
  IF sy-subrc = 0.\n`;
57107
57126
  if (groupCountName !== undefined) {
57108
57127
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
57109
57128
  }
57110
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57129
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57111
57130
  ELSE.\n`;
57112
57131
  code += ` CLEAR ${uniqueName}.\n`;
57113
57132
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -57128,8 +57147,8 @@ ELSE.\n`;
57128
57147
  }
57129
57148
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
57130
57149
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
57131
- code += `ENDIF.
57132
- ENDLOOP.
57150
+ code += `ENDIF.
57151
+ ENDLOOP.
57133
57152
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57134
57153
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
57135
57154
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -57297,7 +57316,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57297
57316
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
57298
57317
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
57299
57318
  // all ENUMS are char like?
57300
- let code = `TYPES ${enumName} TYPE string.
57319
+ let code = `TYPES ${enumName} TYPE string.
57301
57320
  CONSTANTS: BEGIN OF ${structureName},\n`;
57302
57321
  let count = 1;
57303
57322
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -57341,14 +57360,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
57341
57360
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57342
57361
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57343
57362
  // restore tabix before exeption
57344
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57345
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57346
- ${indentation}${tabixBackup} = sy-tabix.
57347
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57348
- ${indentation}sy-tabix = ${tabixBackup}.
57349
- ${indentation}IF sy-subrc <> 0.
57350
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57351
- ${indentation}ENDIF.
57363
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57364
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57365
+ ${indentation}${tabixBackup} = sy-tabix.
57366
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57367
+ ${indentation}sy-tabix = ${tabixBackup}.
57368
+ ${indentation}IF sy-subrc <> 0.
57369
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57370
+ ${indentation}ENDIF.
57352
57371
  ${indentation}${uniqueName}`;
57353
57372
  const start = target.getFirstToken().getStart();
57354
57373
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -57432,11 +57451,11 @@ ${indentation}${uniqueName}`;
57432
57451
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57433
57452
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57434
57453
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57435
- const code = `DATA ${uniqueName} TYPE string.
57436
- ${indentation}CALL FUNCTION '${functionName}'
57437
- ${indentation} EXPORTING
57438
- ${indentation} input = ${source}
57439
- ${indentation} IMPORTING
57454
+ const code = `DATA ${uniqueName} TYPE string.
57455
+ ${indentation}CALL FUNCTION '${functionName}'
57456
+ ${indentation} EXPORTING
57457
+ ${indentation} input = ${source}
57458
+ ${indentation} IMPORTING
57440
57459
  ${indentation} output = ${uniqueName}.\n`;
57441
57460
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
57442
57461
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -58748,12 +58767,12 @@ class EasyToFindMessages {
58748
58767
  key: "easy_to_find_messages",
58749
58768
  title: "Easy to find messages",
58750
58769
  shortDescription: `Make messages easy to find`,
58751
- extendedInformation: `All messages must be statically referenced exactly once
58752
-
58753
- Only MESSAGE and RAISE statments are counted as static references
58754
-
58755
- Also see rule "message_exists"
58756
-
58770
+ extendedInformation: `All messages must be statically referenced exactly once
58771
+
58772
+ Only MESSAGE and RAISE statments are counted as static references
58773
+
58774
+ Also see rule "message_exists"
58775
+
58757
58776
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
58758
58777
  tags: [_irule_1.RuleTag.Styleguide],
58759
58778
  };
@@ -58838,8 +58857,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
58838
58857
  key: "empty_line_in_statement",
58839
58858
  title: "Find empty lines in statements",
58840
58859
  shortDescription: `Checks that statements do not contain empty lines.`,
58841
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58842
-
58860
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58861
+
58843
58862
  https://docs.abapopenchecks.org/checks/41/`,
58844
58863
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
58845
58864
  badExample: `WRITE\n\nhello.`,
@@ -59131,10 +59150,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
59131
59150
  return {
59132
59151
  key: "exit_or_check",
59133
59152
  title: "Find EXIT or CHECK outside loops",
59134
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59153
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59135
59154
  Use RETURN to leave procesing blocks instead.`,
59136
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59137
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59155
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59156
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59138
59157
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
59139
59158
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
59140
59159
  };
@@ -59217,12 +59236,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
59217
59236
  key: "expand_macros",
59218
59237
  title: "Expand Macros",
59219
59238
  shortDescription: `Allows expanding macro calls with quick fixes`,
59220
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59221
-
59239
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59240
+
59222
59241
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
59223
- badExample: `DEFINE _hello.
59224
- WRITE 'hello'.
59225
- END-OF-DEFINITION.
59242
+ badExample: `DEFINE _hello.
59243
+ WRITE 'hello'.
59244
+ END-OF-DEFINITION.
59226
59245
  _hello.`,
59227
59246
  goodExample: `WRITE 'hello'.`,
59228
59247
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -59309,7 +59328,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
59309
59328
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
59310
59329
  badExample: `call_method( EXPORTING foo = bar ).`,
59311
59330
  goodExample: `call_method( foo = bar ).`,
59312
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59331
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59313
59332
  https://docs.abapopenchecks.org/checks/30/`,
59314
59333
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59315
59334
  };
@@ -59407,7 +59426,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
59407
59426
  key: "forbidden_identifier",
59408
59427
  title: "Forbidden Identifier",
59409
59428
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
59410
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59429
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59411
59430
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
59412
59431
  tags: [_irule_1.RuleTag.SingleFile],
59413
59432
  };
@@ -59649,8 +59668,8 @@ class ForbiddenVoidType {
59649
59668
  key: "forbidden_void_type",
59650
59669
  title: "Forbidden Void Types",
59651
59670
  shortDescription: `Avoid usage of specified void types.`,
59652
- extendedInformation: `Inspiration:
59653
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59671
+ extendedInformation: `Inspiration:
59672
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59654
59673
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
59655
59674
  };
59656
59675
  }
@@ -59893,7 +59912,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
59893
59912
  key: "fully_type_itabs",
59894
59913
  title: "Fully type internal tables",
59895
59914
  shortDescription: `No implict table types or table keys`,
59896
- badExample: `DATA lt_foo TYPE TABLE OF ty.
59915
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
59897
59916
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
59898
59917
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
59899
59918
  tags: [_irule_1.RuleTag.SingleFile],
@@ -60078,26 +60097,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
60078
60097
  key: "functional_writing",
60079
60098
  title: "Use functional writing",
60080
60099
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
60081
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60100
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60082
60101
  https://docs.abapopenchecks.org/checks/07/`,
60083
60102
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
60084
- badExample: `CALL METHOD zcl_class=>method( ).
60085
- CALL METHOD cl_abap_typedescr=>describe_by_name
60086
- EXPORTING
60087
- p_name = 'NAME'
60088
- RECEIVING
60089
- p_descr_ref = lr_typedescr
60090
- EXCEPTIONS
60091
- type_not_found = 1
60103
+ badExample: `CALL METHOD zcl_class=>method( ).
60104
+ CALL METHOD cl_abap_typedescr=>describe_by_name
60105
+ EXPORTING
60106
+ p_name = 'NAME'
60107
+ RECEIVING
60108
+ p_descr_ref = lr_typedescr
60109
+ EXCEPTIONS
60110
+ type_not_found = 1
60092
60111
  OTHERS = 2.`,
60093
- goodExample: `zcl_class=>method( ).
60094
- cl_abap_typedescr=>describe_by_name(
60095
- EXPORTING
60096
- p_name = 'NAME'
60097
- RECEIVING
60098
- p_descr_ref = lr_typedescr
60099
- EXCEPTIONS
60100
- type_not_found = 1
60112
+ goodExample: `zcl_class=>method( ).
60113
+ cl_abap_typedescr=>describe_by_name(
60114
+ EXPORTING
60115
+ p_name = 'NAME'
60116
+ RECEIVING
60117
+ p_descr_ref = lr_typedescr
60118
+ EXCEPTIONS
60119
+ type_not_found = 1
60101
60120
  OTHERS = 2 ).`,
60102
60121
  };
60103
60122
  }
@@ -60208,14 +60227,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
60208
60227
  key: "global_class",
60209
60228
  title: "Global class checks",
60210
60229
  shortDescription: `Checks related to global classes`,
60211
- extendedInformation: `* global classes must be in own files
60212
-
60213
- * file names must match class name
60214
-
60215
- * file names must match interface name
60216
-
60217
- * global classes must be global definitions
60218
-
60230
+ extendedInformation: `* global classes must be in own files
60231
+
60232
+ * file names must match class name
60233
+
60234
+ * file names must match interface name
60235
+
60236
+ * global classes must be global definitions
60237
+
60219
60238
  * global interfaces must be global definitions`,
60220
60239
  tags: [_irule_1.RuleTag.Syntax],
60221
60240
  };
@@ -60298,8 +60317,8 @@ class Conditions {
60298
60317
  push(e) {
60299
60318
  this.arr.push(e.concatTokens());
60300
60319
  }
60301
- hasDuplicates() {
60302
- return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));
60320
+ findFirstDuplicate() {
60321
+ return this.arr.find(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));
60303
60322
  }
60304
60323
  }
60305
60324
  class IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {
@@ -60314,8 +60333,8 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
60314
60333
  return {
60315
60334
  key: "identical_conditions",
60316
60335
  title: "Identical conditions",
60317
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60318
-
60336
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60337
+
60319
60338
  Prerequsites: code is pretty printed with identical cAsE`,
60320
60339
  tags: [_irule_1.RuleTag.SingleFile],
60321
60340
  };
@@ -60358,8 +60377,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60358
60377
  return [];
60359
60378
  }
60360
60379
  }
60361
- if (conditions.hasDuplicates()) {
60362
- const message = "Identical conditions";
60380
+ const duplicate = conditions.findFirstDuplicate();
60381
+ if (duplicate) {
60382
+ const message = "Identical conditions: " + duplicate;
60363
60383
  const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
60364
60384
  return [issue];
60365
60385
  }
@@ -60382,8 +60402,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60382
60402
  conditions.push(c);
60383
60403
  }
60384
60404
  }
60385
- if (conditions.hasDuplicates()) {
60386
- const message = "Identical conditions";
60405
+ const duplicate = conditions.findFirstDuplicate();
60406
+ if (duplicate) {
60407
+ const message = "Identical conditions: " + duplicate;
60387
60408
  const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);
60388
60409
  return [issue];
60389
60410
  }
@@ -60404,8 +60425,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60404
60425
  conditions.push(s);
60405
60426
  }
60406
60427
  }
60407
- if (conditions.hasDuplicates()) {
60408
- const message = "Identical conditions";
60428
+ const duplicate = conditions.findFirstDuplicate();
60429
+ if (duplicate) {
60430
+ const message = "Identical conditions: " + duplicate;
60409
60431
  const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);
60410
60432
  return [issue];
60411
60433
  }
@@ -60446,23 +60468,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
60446
60468
  key: "identical_contents",
60447
60469
  title: "Identical contents",
60448
60470
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
60449
- extendedInformation: `
60450
- Prerequsites: code is pretty printed with identical cAsE
60451
-
60471
+ extendedInformation: `
60472
+ Prerequsites: code is pretty printed with identical cAsE
60473
+
60452
60474
  Chained statments are ignored`,
60453
60475
  tags: [_irule_1.RuleTag.SingleFile],
60454
- badExample: `IF foo = bar.
60455
- WRITE 'bar'.
60456
- WRITE 'world'.
60457
- ELSE.
60458
- WRITE 'foo'.
60459
- WRITE 'world'.
60476
+ badExample: `IF foo = bar.
60477
+ WRITE 'bar'.
60478
+ WRITE 'world'.
60479
+ ELSE.
60480
+ WRITE 'foo'.
60481
+ WRITE 'world'.
60460
60482
  ENDIF.`,
60461
- goodExample: `IF foo = bar.
60462
- WRITE 'bar'.
60463
- ELSE.
60464
- WRITE 'foo'.
60465
- ENDIF.
60483
+ goodExample: `IF foo = bar.
60484
+ WRITE 'bar'.
60485
+ ELSE.
60486
+ WRITE 'foo'.
60487
+ ENDIF.
60466
60488
  WRITE 'world'.`,
60467
60489
  };
60468
60490
  }
@@ -60565,12 +60587,12 @@ class IdenticalDescriptions {
60565
60587
  key: "identical_descriptions",
60566
60588
  title: "Identical descriptions",
60567
60589
  shortDescription: `Searches for objects with the same type and same description`,
60568
- extendedInformation: `Case insensitive
60569
-
60570
- Only checks the master language descriptions
60571
-
60572
- Dependencies are skipped
60573
-
60590
+ extendedInformation: `Case insensitive
60591
+
60592
+ Only checks the master language descriptions
60593
+
60594
+ Dependencies are skipped
60595
+
60574
60596
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
60575
60597
  tags: [],
60576
60598
  };
@@ -60744,43 +60766,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
60744
60766
  key: "if_in_if",
60745
60767
  title: "IF in IF",
60746
60768
  shortDescription: `Detects nested ifs which can be refactored.`,
60747
- extendedInformation: `
60748
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
60749
-
60750
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60751
-
60752
- https://docs.abapopenchecks.org/checks/01/
60769
+ extendedInformation: `
60770
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
60771
+
60772
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60773
+
60774
+ https://docs.abapopenchecks.org/checks/01/
60753
60775
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
60754
- badExample: `IF condition1.
60755
- IF condition2.
60756
- ...
60757
- ENDIF.
60758
- ENDIF.
60759
-
60760
- IF condition1.
60761
- ...
60762
- ELSE.
60763
- IF condition2.
60764
- ...
60765
- ENDIF.
60776
+ badExample: `IF condition1.
60777
+ IF condition2.
60778
+ ...
60779
+ ENDIF.
60780
+ ENDIF.
60781
+
60782
+ IF condition1.
60783
+ ...
60784
+ ELSE.
60785
+ IF condition2.
60786
+ ...
60787
+ ENDIF.
60766
60788
  ENDIF.`,
60767
- goodExample: `IF ( condition1 ) AND ( condition2 ).
60768
- ...
60769
- ENDIF.
60770
-
60771
- IF condition1.
60772
- ...
60773
- ELSEIF condition2.
60774
- ...
60775
- ENDIF.
60776
-
60777
- CASE variable.
60778
- WHEN value1.
60779
- ...
60780
- WHEN value2.
60781
- IF condition2.
60782
- ...
60783
- ENDIF.
60789
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
60790
+ ...
60791
+ ENDIF.
60792
+
60793
+ IF condition1.
60794
+ ...
60795
+ ELSEIF condition2.
60796
+ ...
60797
+ ENDIF.
60798
+
60799
+ CASE variable.
60800
+ WHEN value1.
60801
+ ...
60802
+ WHEN value2.
60803
+ IF condition2.
60804
+ ...
60805
+ ENDIF.
60784
60806
  ENDCASE.`,
60785
60807
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60786
60808
  };
@@ -60965,9 +60987,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
60965
60987
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
60966
60988
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
60967
60989
  if (name === impl.identifier.getName().toUpperCase()) {
60968
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
60969
- METHOD ${methodName.toLowerCase()}.
60970
- RETURN. " todo, implement method
60990
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
60991
+ METHOD ${methodName.toLowerCase()}.
60992
+ RETURN. " todo, implement method
60971
60993
  ENDMETHOD.`);
60972
60994
  }
60973
60995
  }
@@ -61155,19 +61177,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
61155
61177
  key: "in_statement_indentation",
61156
61178
  title: "In-statement indentation",
61157
61179
  shortDescription: "Checks alignment within statements which span multiple lines.",
61158
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
61159
-
61160
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61180
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
61181
+
61182
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61161
61183
  to distinguish them better from code within the block.`,
61162
- badExample: `IF 1 = 1
61163
- AND 2 = 2.
61164
- WRITE 'hello' &&
61165
- 'world'.
61184
+ badExample: `IF 1 = 1
61185
+ AND 2 = 2.
61186
+ WRITE 'hello' &&
61187
+ 'world'.
61166
61188
  ENDIF.`,
61167
- goodExample: `IF 1 = 1
61168
- AND 2 = 2.
61169
- WRITE 'hello' &&
61170
- 'world'.
61189
+ goodExample: `IF 1 = 1
61190
+ AND 2 = 2.
61191
+ WRITE 'hello' &&
61192
+ 'world'.
61171
61193
  ENDIF.`,
61172
61194
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61173
61195
  };
@@ -61672,9 +61694,9 @@ class IntfReferencingClas {
61672
61694
  key: "intf_referencing_clas",
61673
61695
  title: "INTF referencing CLAS",
61674
61696
  shortDescription: `Interface contains references to class`,
61675
- extendedInformation: `Only global interfaces are checked.
61676
- Only first level references are checked.
61677
- Exception class references are ignored.
61697
+ extendedInformation: `Only global interfaces are checked.
61698
+ Only first level references are checked.
61699
+ Exception class references are ignored.
61678
61700
  Void references are ignored.`,
61679
61701
  };
61680
61702
  }
@@ -62269,8 +62291,8 @@ class LineBreakStyle {
62269
62291
  return {
62270
62292
  key: "line_break_style",
62271
62293
  title: "Makes sure line breaks are consistent in the ABAP code",
62272
- shortDescription: `Enforces LF as newlines in ABAP files
62273
-
62294
+ shortDescription: `Enforces LF as newlines in ABAP files
62295
+
62274
62296
  abapGit does not work with CRLF`,
62275
62297
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
62276
62298
  };
@@ -62339,7 +62361,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
62339
62361
  key: "line_length",
62340
62362
  title: "Line length",
62341
62363
  shortDescription: `Detects lines exceeding the provided maximum length.`,
62342
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62364
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62343
62365
  https://docs.abapopenchecks.org/checks/04/`,
62344
62366
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
62345
62367
  };
@@ -62410,7 +62432,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
62410
62432
  key: "line_only_punc",
62411
62433
  title: "Line containing only punctuation",
62412
62434
  shortDescription: `Detects lines containing only punctuation.`,
62413
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62435
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62414
62436
  https://docs.abapopenchecks.org/checks/16/`,
62415
62437
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62416
62438
  badExample: "zcl_class=>method(\n).",
@@ -62670,8 +62692,8 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
62670
62692
  return {
62671
62693
  key: "local_variable_names",
62672
62694
  title: "Local variable naming conventions",
62673
- shortDescription: `
62674
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62695
+ shortDescription: `
62696
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62675
62697
  Regexes are case-insensitive.`,
62676
62698
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
62677
62699
  };
@@ -62818,10 +62840,10 @@ class MainFileContents {
62818
62840
  key: "main_file_contents",
62819
62841
  title: "Main file contents",
62820
62842
  shortDescription: `Checks related to report declarations.`,
62821
- extendedInformation: `Does not run if the target version is Cloud
62822
-
62823
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62824
- * TYPEs must begin with "TYPE-POOL <name>."
62843
+ extendedInformation: `Does not run if the target version is Cloud
62844
+
62845
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62846
+ * TYPEs must begin with "TYPE-POOL <name>."
62825
62847
  `,
62826
62848
  };
62827
62849
  }
@@ -62937,17 +62959,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
62937
62959
  title: "Too many parentheses",
62938
62960
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
62939
62961
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
62940
- badExample: `
62941
- IF ( destination IS INITIAL ).
62942
- ENDIF.
62943
- IF foo = boo AND ( bar = lar AND moo = loo ).
62944
- ENDIF.
62962
+ badExample: `
62963
+ IF ( destination IS INITIAL ).
62964
+ ENDIF.
62965
+ IF foo = boo AND ( bar = lar AND moo = loo ).
62966
+ ENDIF.
62945
62967
  `,
62946
- goodExample: `
62947
- IF destination IS INITIAL.
62948
- ENDIF.
62949
- IF foo = boo AND bar = lar AND moo = loo.
62950
- ENDIF.
62968
+ goodExample: `
62969
+ IF destination IS INITIAL.
62970
+ ENDIF.
62971
+ IF foo = boo AND bar = lar AND moo = loo.
62972
+ ENDIF.
62951
62973
  `,
62952
62974
  };
62953
62975
  }
@@ -63121,14 +63143,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
63121
63143
  title: "Max one method parameter definition per line",
63122
63144
  shortDescription: `Keep max one method parameter description per line`,
63123
63145
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
63124
- badExample: `
63125
- METHODS apps_scope_token
63126
- IMPORTING
63146
+ badExample: `
63147
+ METHODS apps_scope_token
63148
+ IMPORTING
63127
63149
  body TYPE bodyapps_scope_token client_id TYPE str.`,
63128
- goodExample: `
63129
- METHODS apps_scope_token
63130
- IMPORTING
63131
- body TYPE bodyapps_scope_token
63150
+ goodExample: `
63151
+ METHODS apps_scope_token
63152
+ IMPORTING
63153
+ body TYPE bodyapps_scope_token
63132
63154
  client_id TYPE str.`,
63133
63155
  };
63134
63156
  }
@@ -63193,11 +63215,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
63193
63215
  key: "max_one_statement",
63194
63216
  title: "Max one statement per line",
63195
63217
  shortDescription: `Checks that each line contains only a single statement.`,
63196
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63197
-
63198
- Does not report anything for chained statements.
63199
-
63200
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63218
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63219
+
63220
+ Does not report anything for chained statements.
63221
+
63222
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63201
63223
  https://docs.abapopenchecks.org/checks/11/`,
63202
63224
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63203
63225
  badExample: `WRITE foo. WRITE bar.`,
@@ -63534,8 +63556,8 @@ class MethodLength {
63534
63556
  key: "method_length",
63535
63557
  title: "Method/Form Length",
63536
63558
  shortDescription: `Checks relating to method/form length.`,
63537
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63538
-
63559
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63560
+
63539
63561
  Abstract methods without statements are considered okay.`,
63540
63562
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63541
63563
  };
@@ -63634,10 +63656,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
63634
63656
  key: "method_overwrites_builtin",
63635
63657
  title: "Method name overwrites builtin function",
63636
63658
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
63637
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63638
-
63639
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63640
-
63659
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63660
+
63661
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63662
+
63641
63663
  Interface method names are ignored`,
63642
63664
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
63643
63665
  };
@@ -64207,7 +64229,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
64207
64229
  key: "nesting",
64208
64230
  title: "Check nesting depth",
64209
64231
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
64210
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64232
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64211
64233
  https://docs.abapopenchecks.org/checks/74/`,
64212
64234
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64213
64235
  };
@@ -64450,7 +64472,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
64450
64472
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
64451
64473
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64452
64474
  badExample: `var1 = var2 = var3.`,
64453
- goodExample: `var2 = var3.
64475
+ goodExample: `var2 = var3.
64454
64476
  var1 = var2.`,
64455
64477
  };
64456
64478
  }
@@ -64509,8 +64531,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
64509
64531
  key: "no_external_form_calls",
64510
64532
  title: "No external FORM calls",
64511
64533
  shortDescription: `Detect external form calls`,
64512
- badExample: `PERFORM foo IN PROGRAM bar.
64513
-
64534
+ badExample: `PERFORM foo IN PROGRAM bar.
64535
+
64514
64536
  PERFORM foo(bar).`,
64515
64537
  tags: [_irule_1.RuleTag.SingleFile],
64516
64538
  };
@@ -64571,17 +64593,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
64571
64593
  key: "no_inline_in_optional_branches",
64572
64594
  title: "Don't declare inline in optional branches",
64573
64595
  shortDescription: `Don't declare inline in optional branches`,
64574
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64575
-
64576
- Considered optional branches:
64577
- * inside IF/ELSEIF/ELSE
64578
- * inside LOOP
64579
- * inside WHILE
64580
- * inside CASE/WHEN, CASE TYPE OF
64581
- * inside DO
64582
- * inside SELECT loops
64583
-
64584
- Not considered optional branches:
64596
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64597
+
64598
+ Considered optional branches:
64599
+ * inside IF/ELSEIF/ELSE
64600
+ * inside LOOP
64601
+ * inside WHILE
64602
+ * inside CASE/WHEN, CASE TYPE OF
64603
+ * inside DO
64604
+ * inside SELECT loops
64605
+
64606
+ Not considered optional branches:
64585
64607
  * TRY/CATCH/CLEANUP`,
64586
64608
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64587
64609
  };
@@ -64680,12 +64702,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
64680
64702
  key: "no_prefixes",
64681
64703
  title: "No Prefixes",
64682
64704
  shortDescription: `Dont use hungarian notation`,
64683
- extendedInformation: `
64684
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64685
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
64686
-
64687
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64688
-
64705
+ extendedInformation: `
64706
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64707
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
64708
+
64709
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64710
+
64689
64711
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
64690
64712
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64691
64713
  badExample: `DATA lv_foo TYPE i.`,
@@ -64858,7 +64880,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
64858
64880
  return {
64859
64881
  key: "no_public_attributes",
64860
64882
  title: "No public attributes",
64861
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
64883
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
64862
64884
  Exceptions are excluded from this rule.`,
64863
64885
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
64864
64886
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -64959,13 +64981,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
64959
64981
  key: "no_yoda_conditions",
64960
64982
  title: "No Yoda conditions",
64961
64983
  shortDescription: `Finds Yoda conditions and reports issues`,
64962
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
64963
-
64984
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
64985
+
64964
64986
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
64965
64987
  tags: [_irule_1.RuleTag.SingleFile],
64966
- badExample: `IF 0 <> sy-subrc.
64988
+ badExample: `IF 0 <> sy-subrc.
64967
64989
  ENDIF.`,
64968
- goodExample: `IF sy-subrc <> 0.
64990
+ goodExample: `IF sy-subrc <> 0.
64969
64991
  ENDIF.`,
64970
64992
  };
64971
64993
  }
@@ -65066,8 +65088,8 @@ class NROBConsistency {
65066
65088
  key: "nrob_consistency",
65067
65089
  title: "Number range consistency",
65068
65090
  shortDescription: `Consistency checks for number ranges`,
65069
- extendedInformation: `Issue reported if percentage warning is over 50%
65070
-
65091
+ extendedInformation: `Issue reported if percentage warning is over 50%
65092
+
65071
65093
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
65072
65094
  tags: [_irule_1.RuleTag.SingleFile],
65073
65095
  };
@@ -65344,58 +65366,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
65344
65366
  title: "Obsolete statements",
65345
65367
  shortDescription: `Checks for usages of certain obsolete statements`,
65346
65368
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65347
- extendedInformation: `
65348
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65349
-
65350
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65351
-
65352
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65353
-
65354
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65355
-
65356
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65357
-
65358
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65359
-
65360
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65361
-
65362
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65363
-
65364
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65365
-
65366
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65367
-
65368
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65369
-
65370
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65371
-
65372
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65373
-
65374
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65375
-
65376
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65377
- SELECT COUNT(*) is considered okay
65378
-
65379
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65380
-
65381
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65382
-
65383
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65384
-
65385
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65386
-
65387
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
65388
-
65369
+ extendedInformation: `
65370
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65371
+
65372
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65373
+
65374
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65375
+
65376
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65377
+
65378
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65379
+
65380
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65381
+
65382
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65383
+
65384
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65385
+
65386
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65387
+
65388
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65389
+
65390
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65391
+
65392
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65393
+
65394
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65395
+
65396
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65397
+
65398
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65399
+ SELECT COUNT(*) is considered okay
65400
+
65401
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65402
+
65403
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65404
+
65405
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65406
+
65407
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65408
+
65409
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
65410
+
65389
65411
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
65390
- badExample: `REFRESH itab.
65391
-
65392
- COMPUTE foo = 2 + 2.
65393
-
65394
- MULTIPLY lv_foo BY 2.
65395
-
65396
- INTERFACE intf LOAD.
65397
-
65398
- IF foo IS SUPPLIED.
65412
+ badExample: `REFRESH itab.
65413
+
65414
+ COMPUTE foo = 2 + 2.
65415
+
65416
+ MULTIPLY lv_foo BY 2.
65417
+
65418
+ INTERFACE intf LOAD.
65419
+
65420
+ IF foo IS SUPPLIED.
65399
65421
  ENDIF.`,
65400
65422
  };
65401
65423
  }
@@ -65735,9 +65757,9 @@ class OmitParameterName {
65735
65757
  key: "omit_parameter_name",
65736
65758
  title: "Omit parameter name",
65737
65759
  shortDescription: `Omit the parameter name in single parameter calls`,
65738
- extendedInformation: `
65739
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65740
-
65760
+ extendedInformation: `
65761
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65762
+
65741
65763
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
65742
65764
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65743
65765
  badExample: `method( param = 2 ).`,
@@ -65943,20 +65965,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
65943
65965
  shortDescription: `Omit RECEIVING`,
65944
65966
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
65945
65967
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65946
- badExample: `
65947
- upload_pack(
65948
- EXPORTING
65949
- io_client = lo_client
65950
- iv_url = iv_url
65951
- iv_deepen_level = iv_deepen_level
65952
- it_hashes = lt_hashes
65953
- RECEIVING
65968
+ badExample: `
65969
+ upload_pack(
65970
+ EXPORTING
65971
+ io_client = lo_client
65972
+ iv_url = iv_url
65973
+ iv_deepen_level = iv_deepen_level
65974
+ it_hashes = lt_hashes
65975
+ RECEIVING
65954
65976
  rt_objects = et_objects ).`,
65955
- goodExample: `
65956
- et_objects = upload_pack(
65957
- io_client = lo_client
65958
- iv_url = iv_url
65959
- iv_deepen_level = iv_deepen_level
65977
+ goodExample: `
65978
+ et_objects = upload_pack(
65979
+ io_client = lo_client
65980
+ iv_url = iv_url
65981
+ iv_deepen_level = iv_deepen_level
65960
65982
  it_hashes = lt_hashes ).`,
65961
65983
  };
65962
65984
  }
@@ -66020,8 +66042,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
66020
66042
  return {
66021
66043
  key: "parser_702_chaining",
66022
66044
  title: "Parser Error, bad chanining on 702",
66023
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66024
- this rule finds these and reports errors.
66045
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66046
+ this rule finds these and reports errors.
66025
66047
  Only active on target version 702 and below.`,
66026
66048
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66027
66049
  };
@@ -66101,8 +66123,8 @@ class ParserError {
66101
66123
  return {
66102
66124
  key: "parser_error",
66103
66125
  title: "Parser error",
66104
- shortDescription: `Checks for syntax not recognized by abaplint.
66105
-
66126
+ shortDescription: `Checks for syntax not recognized by abaplint.
66127
+
66106
66128
  See recognized syntax at https://syntax.abaplint.org`,
66107
66129
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66108
66130
  };
@@ -66187,7 +66209,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
66187
66209
  return {
66188
66210
  key: "parser_missing_space",
66189
66211
  title: "Parser Error, missing space",
66190
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66212
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66191
66213
  This rule makes sure the spaces are consistently required across the language.`,
66192
66214
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
66193
66215
  badExample: `IF ( foo = 'bar').`,
@@ -66599,25 +66621,25 @@ class PreferInline {
66599
66621
  key: "prefer_inline",
66600
66622
  title: "Prefer Inline Declarations",
66601
66623
  shortDescription: `Prefer inline to up-front declarations.`,
66602
- extendedInformation: `EXPERIMENTAL
66603
-
66604
- Activates if language version is v740sp02 or above.
66605
-
66606
- Variables must be local(METHOD or FORM).
66607
-
66608
- No generic or void typed variables. No syntax errors.
66609
-
66610
- First position used must be a full/pure write.
66611
-
66612
- Move statment is not a cast(?=)
66613
-
66624
+ extendedInformation: `EXPERIMENTAL
66625
+
66626
+ Activates if language version is v740sp02 or above.
66627
+
66628
+ Variables must be local(METHOD or FORM).
66629
+
66630
+ No generic or void typed variables. No syntax errors.
66631
+
66632
+ First position used must be a full/pure write.
66633
+
66634
+ Move statment is not a cast(?=)
66635
+
66614
66636
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
66615
66637
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
66616
- badExample: `DATA foo TYPE i.
66617
- foo = 2.
66618
- DATA percentage TYPE decfloat34.
66638
+ badExample: `DATA foo TYPE i.
66639
+ foo = 2.
66640
+ DATA percentage TYPE decfloat34.
66619
66641
  percentage = ( comment_number / abs_statement_number ) * 100.`,
66620
- goodExample: `DATA(foo) = 2.
66642
+ goodExample: `DATA(foo) = 2.
66621
66643
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
66622
66644
  };
66623
66645
  }
@@ -66831,18 +66853,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
66831
66853
  key: "prefer_is_not",
66832
66854
  title: "Prefer IS NOT to NOT IS",
66833
66855
  shortDescription: `Prefer IS NOT to NOT IS`,
66834
- extendedInformation: `
66835
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66836
-
66856
+ extendedInformation: `
66857
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66858
+
66837
66859
  "if not is_valid( )." examples are skipped`,
66838
66860
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66839
- goodExample: `IF variable IS NOT INITIAL.
66840
- IF variable NP 'TODO*'.
66841
- IF variable <> 42.
66861
+ goodExample: `IF variable IS NOT INITIAL.
66862
+ IF variable NP 'TODO*'.
66863
+ IF variable <> 42.
66842
66864
  IF variable CO 'hello'.`,
66843
- badExample: `IF NOT variable IS INITIAL.
66844
- IF NOT variable CP 'TODO*'.
66845
- IF NOT variable = 42.
66865
+ badExample: `IF NOT variable IS INITIAL.
66866
+ IF NOT variable CP 'TODO*'.
66867
+ IF NOT variable = 42.
66846
66868
  IF NOT variable CA 'hello'.`,
66847
66869
  };
66848
66870
  }
@@ -67030,14 +67052,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
67030
67052
  key: "prefer_raise_exception_new",
67031
67053
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
67032
67054
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
67033
- extendedInformation: `
67034
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67035
-
67055
+ extendedInformation: `
67056
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67057
+
67036
67058
  From 752 and up`,
67037
67059
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
67038
67060
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
67039
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
67040
- EXPORTING
67061
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
67062
+ EXPORTING
67041
67063
  previous = exception.`,
67042
67064
  };
67043
67065
  }
@@ -67115,7 +67137,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
67115
67137
  key: "prefer_returning_to_exporting",
67116
67138
  title: "Prefer RETURNING to EXPORTING",
67117
67139
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
67118
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67140
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67119
67141
  https://docs.abapopenchecks.org/checks/44/`,
67120
67142
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67121
67143
  };
@@ -67212,8 +67234,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
67212
67234
  key: "prefer_xsdbool",
67213
67235
  title: "Prefer xsdbool over boolc",
67214
67236
  shortDescription: `Prefer xsdbool over boolc`,
67215
- extendedInformation: `Activates if language version is v740sp08 or above.
67216
-
67237
+ extendedInformation: `Activates if language version is v740sp08 or above.
67238
+
67217
67239
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
67218
67240
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
67219
67241
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -67507,26 +67529,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
67507
67529
  key: "reduce_procedural_code",
67508
67530
  title: "Reduce procedural code",
67509
67531
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
67510
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67511
-
67512
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67513
-
67532
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67533
+
67534
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67535
+
67514
67536
  Comments are not counted as statements.`,
67515
67537
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67516
- badExample: `FORM foo.
67517
- DATA lv_bar TYPE i.
67518
- lv_bar = 2 + 2.
67519
- IF lv_bar = 4.
67520
- WRITE 'hello world'.
67521
- ENDIF.
67522
- DATA lv_bar TYPE i.
67523
- lv_bar = 2 + 2.
67524
- IF lv_bar = 4.
67525
- WRITE 'hello world'.
67526
- ENDIF.
67538
+ badExample: `FORM foo.
67539
+ DATA lv_bar TYPE i.
67540
+ lv_bar = 2 + 2.
67541
+ IF lv_bar = 4.
67542
+ WRITE 'hello world'.
67543
+ ENDIF.
67544
+ DATA lv_bar TYPE i.
67545
+ lv_bar = 2 + 2.
67546
+ IF lv_bar = 4.
67547
+ WRITE 'hello world'.
67548
+ ENDIF.
67527
67549
  ENDFORM.`,
67528
- goodExample: `FORM foo.
67529
- NEW zcl_global_class( )->run_logic( ).
67550
+ goodExample: `FORM foo.
67551
+ NEW zcl_global_class( )->run_logic( ).
67530
67552
  ENDFORM.`,
67531
67553
  };
67532
67554
  }
@@ -67770,10 +67792,10 @@ class RemoveDescriptions {
67770
67792
  return {
67771
67793
  key: "remove_descriptions",
67772
67794
  title: "Remove descriptions",
67773
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67774
-
67775
- Class descriptions are required, see rule description_empty.
67776
-
67795
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67796
+
67797
+ Class descriptions are required, see rule description_empty.
67798
+
67777
67799
  Consider using ABAP Doc for documentation.`,
67778
67800
  tags: [],
67779
67801
  };
@@ -67898,16 +67920,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
67898
67920
  tags: [_irule_1.RuleTag.SingleFile],
67899
67921
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
67900
67922
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
67901
- badExample: `
67902
- CALL FUNCTION 'ZRFC'
67923
+ badExample: `
67924
+ CALL FUNCTION 'ZRFC'
67903
67925
  DESTINATION lv_rfc.`,
67904
- goodExample: `
67905
- CALL FUNCTION 'ZRFC'
67906
- DESTINATION lv_rfc
67907
- EXCEPTIONS
67908
- system_failure = 1 MESSAGE msg
67909
- communication_failure = 2 MESSAGE msg
67910
- resource_failure = 3
67926
+ goodExample: `
67927
+ CALL FUNCTION 'ZRFC'
67928
+ DESTINATION lv_rfc
67929
+ EXCEPTIONS
67930
+ system_failure = 1 MESSAGE msg
67931
+ communication_failure = 2 MESSAGE msg
67932
+ resource_failure = 3
67911
67933
  OTHERS = 4.`,
67912
67934
  };
67913
67935
  }
@@ -67991,11 +68013,11 @@ class SelectAddOrderBy {
67991
68013
  key: "select_add_order_by",
67992
68014
  title: "SELECT add ORDER BY",
67993
68015
  shortDescription: `SELECTs add ORDER BY clause`,
67994
- extendedInformation: `
67995
- This will make sure that the SELECT statement returns results in the same sequence on different databases
67996
-
67997
- add ORDER BY PRIMARY KEY if in doubt
67998
-
68016
+ extendedInformation: `
68017
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
68018
+
68019
+ add ORDER BY PRIMARY KEY if in doubt
68020
+
67999
68021
  If the target is a sorted/hashed table, no issue is reported`,
68000
68022
  tags: [_irule_1.RuleTag.SingleFile],
68001
68023
  };
@@ -68124,14 +68146,14 @@ class SelectPerformance {
68124
68146
  key: "select_performance",
68125
68147
  title: "SELECT performance",
68126
68148
  shortDescription: `Various checks regarding SELECT performance.`,
68127
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68128
-
68149
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68150
+
68129
68151
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
68130
68152
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
68131
- badExample: `SELECT field1, field2 FROM table
68132
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68153
+ badExample: `SELECT field1, field2 FROM table
68154
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68133
68155
  ENDSELECT.`,
68134
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68156
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68135
68157
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
68136
68158
  };
68137
68159
  }
@@ -68243,8 +68265,8 @@ class SelectSingleFullKey {
68243
68265
  key: "select_single_full_key",
68244
68266
  title: "Detect SELECT SINGLE which are possibily not unique",
68245
68267
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
68246
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68247
-
68268
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68269
+
68248
68270
  If the statement contains a JOIN it is not checked`,
68249
68271
  pseudoComment: "EC CI_NOORDER",
68250
68272
  tags: [],
@@ -68661,8 +68683,8 @@ class SICFConsistency {
68661
68683
  key: "sicf_consistency",
68662
68684
  title: "SICF consistency",
68663
68685
  shortDescription: `Checks the validity of ICF services`,
68664
- extendedInformation: `* Class defined in handler must exist
68665
- * Class must not have any syntax errors
68686
+ extendedInformation: `* Class defined in handler must exist
68687
+ * Class must not have any syntax errors
68666
68688
  * Class must implement interface IF_HTTP_EXTENSION`,
68667
68689
  };
68668
68690
  }
@@ -69029,8 +69051,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
69029
69051
  key: "space_before_dot",
69030
69052
  title: "Space before dot",
69031
69053
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
69032
- extendedInformation: `
69033
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69054
+ extendedInformation: `
69055
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69034
69056
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
69035
69057
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69036
69058
  badExample: `WRITE bar .`,
@@ -69216,12 +69238,12 @@ class SQLValueConversion {
69216
69238
  key: "sql_value_conversion",
69217
69239
  title: "Implicit SQL Value Conversion",
69218
69240
  shortDescription: `Ensure types match when selecting from database`,
69219
- extendedInformation: `
69220
- * Integer to CHAR conversion
69221
- * Integer to NUMC conversion
69222
- * NUMC to Integer conversion
69223
- * CHAR to Integer conversion
69224
- * Source field longer than database field, CHAR -> CHAR
69241
+ extendedInformation: `
69242
+ * Integer to CHAR conversion
69243
+ * Integer to NUMC conversion
69244
+ * NUMC to Integer conversion
69245
+ * CHAR to Integer conversion
69246
+ * Source field longer than database field, CHAR -> CHAR
69225
69247
  * Source field longer than database field, NUMC -> NUMC`,
69226
69248
  tags: [],
69227
69249
  };
@@ -69293,7 +69315,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
69293
69315
  key: "start_at_tab",
69294
69316
  title: "Start at tab",
69295
69317
  shortDescription: `Checks that statements start at tabstops.`,
69296
- extendedInformation: `Reports max 100 issues per file
69318
+ extendedInformation: `Reports max 100 issues per file
69297
69319
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
69298
69320
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69299
69321
  badExample: ` WRITE a.`,
@@ -69470,12 +69492,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
69470
69492
  key: "strict_sql",
69471
69493
  title: "Strict SQL",
69472
69494
  shortDescription: `Strict SQL`,
69473
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69474
-
69475
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69476
-
69477
- Also see separate rule sql_escape_host_variables
69478
-
69495
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69496
+
69497
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69498
+
69499
+ Also see separate rule sql_escape_host_variables
69500
+
69479
69501
  Activates from v750 and up`,
69480
69502
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
69481
69503
  };
@@ -69727,11 +69749,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
69727
69749
  key: "sy_modification",
69728
69750
  title: "Modification of SY fields",
69729
69751
  shortDescription: `Finds modification of sy fields`,
69730
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69731
-
69752
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69753
+
69732
69754
  Changes to SY-TVAR* fields are not reported`,
69733
69755
  tags: [_irule_1.RuleTag.SingleFile],
69734
- badExample: `sy-uname = 2.
69756
+ badExample: `sy-uname = 2.
69735
69757
  sy = sy.`,
69736
69758
  };
69737
69759
  }
@@ -69793,8 +69815,8 @@ class TABLEnhancementCategory {
69793
69815
  key: "tabl_enhancement_category",
69794
69816
  title: "TABL enhancement category must be set",
69795
69817
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
69796
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69797
-
69818
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69819
+
69798
69820
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
69799
69821
  tags: [],
69800
69822
  };
@@ -69922,9 +69944,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
69922
69944
  title: "Type FORM parameters",
69923
69945
  shortDescription: `Checks for untyped FORM parameters`,
69924
69946
  tags: [_irule_1.RuleTag.SingleFile],
69925
- badExample: `FORM foo USING bar.
69947
+ badExample: `FORM foo USING bar.
69926
69948
  ENDFORM.`,
69927
- goodExample: `FORM foo USING bar TYPE string.
69949
+ goodExample: `FORM foo USING bar TYPE string.
69928
69950
  ENDFORM.`,
69929
69951
  };
69930
69952
  }
@@ -70590,38 +70612,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
70590
70612
  key: "unnecessary_pragma",
70591
70613
  title: "Unnecessary Pragma",
70592
70614
  shortDescription: `Finds pragmas which can be removed`,
70593
- extendedInformation: `* NO_HANDLER with handler
70594
-
70595
- * NEEDED without definition
70596
-
70597
- * NO_TEXT without texts
70598
-
70599
- * SUBRC_OK where sy-subrc is checked
70600
-
70615
+ extendedInformation: `* NO_HANDLER with handler
70616
+
70617
+ * NEEDED without definition
70618
+
70619
+ * NO_TEXT without texts
70620
+
70621
+ * SUBRC_OK where sy-subrc is checked
70622
+
70601
70623
  NO_HANDLER inside macros are not checked`,
70602
70624
  tags: [_irule_1.RuleTag.SingleFile],
70603
- badExample: `TRY.
70604
- ...
70605
- CATCH zcx_abapgit_exception ##NO_HANDLER.
70606
- RETURN. " it has a handler
70607
- ENDTRY.
70608
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70609
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70610
- IF sy-subrc <> 0.
70625
+ badExample: `TRY.
70626
+ ...
70627
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
70628
+ RETURN. " it has a handler
70629
+ ENDTRY.
70630
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70631
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70632
+ IF sy-subrc <> 0.
70611
70633
  ENDIF.`,
70612
- goodExample: `TRY.
70613
- ...
70614
- CATCH zcx_abapgit_exception.
70615
- RETURN.
70616
- ENDTRY.
70617
- MESSAGE w125(zbar) WITH c_foo INTO message.
70618
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70619
- IF sy-subrc <> 0.
70620
- ENDIF.
70621
-
70622
- DATA: BEGIN OF blah ##NEEDED,
70623
- test1 TYPE string,
70624
- test2 TYPE string,
70634
+ goodExample: `TRY.
70635
+ ...
70636
+ CATCH zcx_abapgit_exception.
70637
+ RETURN.
70638
+ ENDTRY.
70639
+ MESSAGE w125(zbar) WITH c_foo INTO message.
70640
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70641
+ IF sy-subrc <> 0.
70642
+ ENDIF.
70643
+
70644
+ DATA: BEGIN OF blah ##NEEDED,
70645
+ test1 TYPE string,
70646
+ test2 TYPE string,
70625
70647
  END OF blah.`,
70626
70648
  };
70627
70649
  }
@@ -70779,18 +70801,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
70779
70801
  shortDescription: `Finds unnecessary RETURN statements`,
70780
70802
  extendedInformation: `Finds unnecessary RETURN statements`,
70781
70803
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70782
- badExample: `FORM hello1.
70783
- WRITE 'world'.
70784
- RETURN.
70785
- ENDFORM.
70786
-
70787
- FORM foo.
70788
- IF 1 = 2.
70789
- RETURN.
70790
- ENDIF.
70804
+ badExample: `FORM hello1.
70805
+ WRITE 'world'.
70806
+ RETURN.
70807
+ ENDFORM.
70808
+
70809
+ FORM foo.
70810
+ IF 1 = 2.
70811
+ RETURN.
70812
+ ENDIF.
70791
70813
  ENDFORM.`,
70792
- goodExample: `FORM hello2.
70793
- WRITE 'world'.
70814
+ goodExample: `FORM hello2.
70815
+ WRITE 'world'.
70794
70816
  ENDFORM.`,
70795
70817
  };
70796
70818
  }
@@ -71157,17 +71179,17 @@ class UnusedMethods {
71157
71179
  key: "unused_methods",
71158
71180
  title: "Unused methods",
71159
71181
  shortDescription: `Checks for unused methods`,
71160
- extendedInformation: `Checks private and protected methods.
71161
-
71162
- Unused methods are not reported if the object contains parser or syntax errors.
71163
-
71164
- Skips:
71165
- * methods FOR TESTING
71166
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71167
- * class_constructor + constructor methods
71168
- * event handlers
71169
- * methods that are redefined
71170
- * INCLUDEs
71182
+ extendedInformation: `Checks private and protected methods.
71183
+
71184
+ Unused methods are not reported if the object contains parser or syntax errors.
71185
+
71186
+ Skips:
71187
+ * methods FOR TESTING
71188
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71189
+ * class_constructor + constructor methods
71190
+ * event handlers
71191
+ * methods that are redefined
71192
+ * INCLUDEs
71171
71193
  `,
71172
71194
  tags: [],
71173
71195
  pragma: "##CALLED",
@@ -71557,23 +71579,23 @@ class UnusedVariables {
71557
71579
  key: "unused_variables",
71558
71580
  title: "Unused variables",
71559
71581
  shortDescription: `Checks for unused variables and constants`,
71560
- extendedInformation: `Skips event parameters.
71561
-
71562
- Note that this currently does not work if the source code uses macros.
71563
-
71564
- Unused variables are not reported if the object contains parser or syntax errors.
71565
-
71582
+ extendedInformation: `Skips event parameters.
71583
+
71584
+ Note that this currently does not work if the source code uses macros.
71585
+
71586
+ Unused variables are not reported if the object contains parser or syntax errors.
71587
+
71566
71588
  Errors found in INCLUDES are reported for the main program.`,
71567
71589
  tags: [_irule_1.RuleTag.Quickfix],
71568
71590
  pragma: "##NEEDED",
71569
71591
  pseudoComment: "EC NEEDED",
71570
- badExample: `DATA: BEGIN OF blah1,
71571
- test TYPE string,
71572
- test2 TYPE string,
71592
+ badExample: `DATA: BEGIN OF blah1,
71593
+ test TYPE string,
71594
+ test2 TYPE string,
71573
71595
  END OF blah1.`,
71574
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71575
- test TYPE string,
71576
- test2 TYPE string,
71596
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71597
+ test TYPE string,
71598
+ test2 TYPE string,
71577
71599
  END OF blah2.`,
71578
71600
  };
71579
71601
  }
@@ -71792,15 +71814,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
71792
71814
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
71793
71815
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
71794
71816
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
71795
- badExample: `IF line IS INITIAL.
71796
- has_entries = abap_false.
71797
- ELSE.
71798
- has_entries = abap_true.
71799
- ENDIF.
71800
-
71817
+ badExample: `IF line IS INITIAL.
71818
+ has_entries = abap_false.
71819
+ ELSE.
71820
+ has_entries = abap_true.
71821
+ ENDIF.
71822
+
71801
71823
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
71802
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71803
-
71824
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71825
+
71804
71826
  DATA(fsdf) = xsdbool( foo <> bar ).`,
71805
71827
  };
71806
71828
  }
@@ -71976,15 +71998,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
71976
71998
  key: "use_line_exists",
71977
71999
  title: "Use line_exists",
71978
72000
  shortDescription: `Use line_exists, from 740sp02 and up`,
71979
- extendedInformation: `
71980
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
71981
-
72001
+ extendedInformation: `
72002
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72003
+
71982
72004
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
71983
72005
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
71984
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
71985
- IF sy-subrc = 0.
72006
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72007
+ IF sy-subrc = 0.
71986
72008
  ENDIF.`,
71987
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72009
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
71988
72010
  ENDIF.`,
71989
72011
  };
71990
72012
  }
@@ -72094,10 +72116,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
72094
72116
  key: "use_new",
72095
72117
  title: "Use NEW",
72096
72118
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
72097
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72098
-
72099
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72100
-
72119
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72120
+
72121
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72122
+
72101
72123
  Applicable from v740sp02 and up`,
72102
72124
  badExample: `CREATE OBJECT ref.`,
72103
72125
  goodExample: `ref = NEW #( ).`,
@@ -72195,13 +72217,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
72195
72217
  title: "WHEN OTHERS last",
72196
72218
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
72197
72219
  tags: [_irule_1.RuleTag.SingleFile],
72198
- badExample: `CASE bar.
72199
- WHEN OTHERS.
72200
- WHEN 2.
72220
+ badExample: `CASE bar.
72221
+ WHEN OTHERS.
72222
+ WHEN 2.
72201
72223
  ENDCASE.`,
72202
- goodExample: `CASE bar.
72203
- WHEN 2.
72204
- WHEN OTHERS.
72224
+ goodExample: `CASE bar.
72225
+ WHEN 2.
72226
+ WHEN OTHERS.
72205
72227
  ENDCASE.`,
72206
72228
  };
72207
72229
  }
@@ -86548,6 +86570,7 @@ const arg = {
86548
86570
  runRename: parsed["rename"],
86549
86571
  outFormat: parsed["outformat"],
86550
86572
  outFile: parsed["outfile"],
86573
+ file: parsed["file"],
86551
86574
  };
86552
86575
  (0, _1.run)(arg).then(({ output, issues }) => {
86553
86576
  if (output.length > 0) {