@abaplint/cli 2.105.5 → 2.105.6

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
  }
@@ -34094,13 +34103,13 @@ class FlowGraph {
34094
34103
  this.label = label;
34095
34104
  }
34096
34105
  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()}
34106
+ return `digraph G {
34107
+ labelloc="t";
34108
+ label="${this.label}";
34109
+ graph [fontname = "helvetica"];
34110
+ node [fontname = "helvetica", shape="box"];
34111
+ edge [fontname = "helvetica"];
34112
+ ${this.toTextEdges()}
34104
34113
  }`;
34105
34114
  }
34106
34115
  listSources(node) {
@@ -42104,13 +42113,13 @@ class Help {
42104
42113
  /////////////////////////////////////////////////
42105
42114
  static dumpABAP(file, reg, textDocument, position) {
42106
42115
  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>
42116
+ content = `
42117
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
42118
+ <a href="#_statements" rel="no-refresh">Statements</a> |
42119
+ <a href="#_structure" rel="no-refresh">Structure</a> |
42120
+ <a href="#_files" rel="no-refresh">Files</a> |
42121
+ <a href="#_info" rel="no-refresh">Info Dump</a>
42122
+ <hr>
42114
42123
  ` +
42115
42124
  "<tt>" + textDocument.uri + " (" +
42116
42125
  (position.line + 1) + ", " +
@@ -47321,6 +47330,7 @@ class NeptuneAPI extends _abstract_object_1.AbstractObject {
47321
47330
  return {
47322
47331
  maxLength: 100,
47323
47332
  allowNamespace: true,
47333
+ customRegex: /.*/i,
47324
47334
  };
47325
47335
  }
47326
47336
  getDescription() {
@@ -51096,7 +51106,7 @@ class Registry {
51096
51106
  }
51097
51107
  static abaplintVersion() {
51098
51108
  // magic, see build script "version.sh"
51099
- return "2.105.5";
51109
+ return "2.105.6";
51100
51110
  }
51101
51111
  getDDICReferences() {
51102
51112
  return this.ddicReferences;
@@ -51412,10 +51422,10 @@ class SevenBitAscii {
51412
51422
  key: "7bit_ascii",
51413
51423
  title: "Check for 7bit ascii",
51414
51424
  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
-
51425
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
51426
+
51427
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
51428
+
51419
51429
  Checkes files with extensions ".abap" and ".asddls"`,
51420
51430
  tags: [_irule_1.RuleTag.SingleFile],
51421
51431
  };
@@ -51604,6 +51614,8 @@ class AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {
51604
51614
  this.checkLocal = false;
51605
51615
  this.classDefinition = false;
51606
51616
  this.interfaceDefinition = false;
51617
+ /** Ignores classes flagged as FOR TESTING */
51618
+ this.ignoreTestClasses = true;
51607
51619
  }
51608
51620
  }
51609
51621
  exports.AbapdocConf = AbapdocConf;
@@ -51617,10 +51629,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
51617
51629
  key: "abapdoc",
51618
51630
  title: "Check abapdoc",
51619
51631
  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
-
51632
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
51633
+
51634
+ Plus class and interface definitions.
51635
+
51624
51636
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
51625
51637
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
51626
51638
  };
@@ -51643,8 +51655,11 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
51643
51655
  if (this.conf.checkLocal === false && classDef.isLocal === true) {
51644
51656
  continue;
51645
51657
  }
51658
+ if (this.conf.ignoreTestClasses === true && classDef.isForTesting === true) {
51659
+ continue;
51660
+ }
51646
51661
  methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));
51647
- if (this.getConfig().classDefinition === true) {
51662
+ if (this.conf.classDefinition === true) {
51648
51663
  const previousRow = classDef.identifier.getStart().getRow() - 2;
51649
51664
  if (((_a = rows[previousRow]) === null || _a === void 0 ? void 0 : _a.trim().substring(0, 2)) !== "\"!") {
51650
51665
  const message = "Missing ABAP Doc for class " + classDef.identifier.getToken().getStr();
@@ -51658,7 +51673,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
51658
51673
  continue;
51659
51674
  }
51660
51675
  methods = methods.concat(interfaceDef.methods);
51661
- if (this.getConfig().interfaceDefinition === true) {
51676
+ if (this.conf.interfaceDefinition === true) {
51662
51677
  const previousRow = interfaceDef.identifier.getStart().getRow() - 2;
51663
51678
  if (((_b = rows[previousRow]) === null || _b === void 0 ? void 0 : _b.trim().substring(0, 2)) !== "\"!") {
51664
51679
  const message = "Missing ABAP Doc for interface " + interfaceDef.identifier.getToken().getStr();
@@ -51755,49 +51770,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
51755
51770
  key: "align_parameters",
51756
51771
  title: "Align Parameters",
51757
51772
  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
51773
+ extendedInformation: `Checks:
51774
+ * function module calls
51775
+ * method calls
51776
+ * VALUE constructors
51777
+ * NEW constructors
51778
+ * RAISE EXCEPTION statements
51779
+ * CREATE OBJECT statements
51780
+ * RAISE EVENT statements
51781
+
51782
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
51783
+
51784
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
51785
+
51786
+ If parameters are on the same row, no issues are reported, see
51772
51787
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
51773
51788
  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
51789
+ badExample: `CALL FUNCTION 'FOOBAR'
51790
+ EXPORTING
51791
+ foo = 2
51792
+ parameter = 3.
51793
+
51794
+ foobar( moo = 1
51795
+ param = 1 ).
51796
+
51797
+ foo = VALUE #(
51798
+ foo = bar
51784
51799
  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
51800
+ goodExample: `CALL FUNCTION 'FOOBAR'
51801
+ EXPORTING
51802
+ foo = 2
51803
+ parameter = 3.
51804
+
51805
+ foobar( moo = 1
51806
+ param = 1 ).
51807
+
51808
+ foo = VALUE #(
51809
+ foo = bar
51810
+ moo = 2 ).
51811
+
51812
+ DATA(sdf) = VALUE type(
51813
+ common_val = 2
51814
+ another_common = 5
51815
+ ( row_value = 4
51801
51816
  value_foo = 5 ) ).`,
51802
51817
  };
51803
51818
  }
@@ -52122,6 +52137,7 @@ exports.AllowedObjectNaming = exports.AllowedObjectNamingConf = void 0;
52122
52137
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
52123
52138
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
52124
52139
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
52140
+ const NAME_REGEX = /^(\/[A-Z_\d]{3,8}\/)?[A-Z_\d<> ]+$/i;
52125
52141
  class AllowedObjectNamingConf extends _basic_rule_config_1.BasicRuleConfig {
52126
52142
  }
52127
52143
  exports.AllowedObjectNamingConf = AllowedObjectNamingConf;
@@ -52161,7 +52177,7 @@ class AllowedObjectNaming {
52161
52177
  message = "Name not allowed";
52162
52178
  }
52163
52179
  }
52164
- else if (name.match(/^(\/[A-Z_\d]{3,8}\/)?[A-Z_\d<> ]+$/i) === null) {
52180
+ else if (name.match(NAME_REGEX) === null) {
52165
52181
  message = "Name not allowed";
52166
52182
  }
52167
52183
  if (message.length > 0) {
@@ -52272,15 +52288,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
52272
52288
  return {
52273
52289
  key: "ambiguous_statement",
52274
52290
  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
-
52291
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
52292
+ Add "TABLE" keyword or "@" for escaping SQL variables
52293
+
52278
52294
  Only works if the target version is 740sp05 or above`,
52279
52295
  tags: [_irule_1.RuleTag.SingleFile],
52280
- badExample: `DELETE foo FROM bar.
52296
+ badExample: `DELETE foo FROM bar.
52281
52297
  MODIFY foo FROM bar.`,
52282
- goodExample: `DELETE foo FROM @bar.
52283
- MODIFY TABLE foo FROM bar.
52298
+ goodExample: `DELETE foo FROM @bar.
52299
+ MODIFY TABLE foo FROM bar.
52284
52300
  MODIFY zfoo FROM @wa.`,
52285
52301
  };
52286
52302
  }
@@ -52384,16 +52400,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
52384
52400
  key: "avoid_use",
52385
52401
  title: "Avoid use of certain statements",
52386
52402
  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
-
52403
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
52404
+
52405
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
52406
+
52407
+ STATICS: use CLASS-DATA instead
52408
+
52409
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
52410
+
52411
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
52412
+
52397
52413
  BREAK points`,
52398
52414
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
52399
52415
  };
@@ -52514,11 +52530,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
52514
52530
  title: "Check BEGIN END names",
52515
52531
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
52516
52532
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
52517
- badExample: `DATA: BEGIN OF stru,
52518
- field TYPE i,
52533
+ badExample: `DATA: BEGIN OF stru,
52534
+ field TYPE i,
52519
52535
  END OF structure_not_the_same.`,
52520
- goodExample: `DATA: BEGIN OF stru,
52521
- field TYPE i,
52536
+ goodExample: `DATA: BEGIN OF stru,
52537
+ field TYPE i,
52522
52538
  END OF stru.`,
52523
52539
  };
52524
52540
  }
@@ -52611,19 +52627,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
52611
52627
  title: "BEGIN contains single INCLUDE",
52612
52628
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
52613
52629
  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.
52630
+ badExample: `TYPES: BEGIN OF dummy1.
52631
+ INCLUDE TYPE dselc.
52632
+ TYPES: END OF dummy1.
52633
+
52634
+ DATA BEGIN OF foo.
52635
+ INCLUDE STRUCTURE syst.
52636
+ DATA END OF foo.
52637
+
52638
+ STATICS BEGIN OF bar.
52639
+ INCLUDE STRUCTURE syst.
52624
52640
  STATICS END OF bar.`,
52625
- goodExample: `DATA BEGIN OF foo.
52626
- INCLUDE STRUCTURE dselc.
52641
+ goodExample: `DATA BEGIN OF foo.
52642
+ INCLUDE STRUCTURE dselc.
52627
52643
  DATA END OF foo.`,
52628
52644
  };
52629
52645
  }
@@ -52713,9 +52729,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
52713
52729
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
52714
52730
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
52715
52731
  badExample: `CALL TRANSACTION 'FOO'.`,
52716
- goodExample: `TRY.
52717
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52718
- CATCH cx_sy_authorization_error.
52732
+ goodExample: `TRY.
52733
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
52734
+ CATCH cx_sy_authorization_error.
52719
52735
  ENDTRY.`,
52720
52736
  };
52721
52737
  }
@@ -52780,10 +52796,10 @@ class CDSCommentStyle {
52780
52796
  key: "cds_comment_style",
52781
52797
  title: "CDS Comment Style",
52782
52798
  shortDescription: `Check for obsolete comment style`,
52783
- extendedInformation: `Check for obsolete comment style
52784
-
52785
- Comments starting with "--" are considered obsolete
52786
-
52799
+ extendedInformation: `Check for obsolete comment style
52800
+
52801
+ Comments starting with "--" are considered obsolete
52802
+
52787
52803
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
52788
52804
  tags: [_irule_1.RuleTag.SingleFile],
52789
52805
  badExample: "-- this is a comment",
@@ -52850,10 +52866,10 @@ class CDSLegacyView {
52850
52866
  title: "CDS Legacy View",
52851
52867
  shortDescription: `Identify CDS Legacy Views`,
52852
52868
  // 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
-
52869
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
52870
+
52871
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
52872
+
52857
52873
  v755 and up`,
52858
52874
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
52859
52875
  };
@@ -53008,10 +53024,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
53008
53024
  key: "chain_mainly_declarations",
53009
53025
  title: "Chain mainly declarations",
53010
53026
  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
53027
+ extendedInformation: `
53028
+ https://docs.abapopenchecks.org/checks/23/
53029
+
53030
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
53015
53031
  `,
53016
53032
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
53017
53033
  badExample: `CALL METHOD: bar.`,
@@ -53187,17 +53203,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
53187
53203
  title: "Change IF to CASE",
53188
53204
  shortDescription: `Finds IF constructs that can be changed to CASE`,
53189
53205
  // 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
-
53206
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
53207
+
53192
53208
  If the first comparison is a boolean compare, no issue is reported.`,
53193
53209
  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'.
53210
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
53211
+ ELSEIF l_fcat-fieldname = 'BAR'
53212
+ OR l_fcat-fieldname = 'MOO'.
53197
53213
  ENDIF.`,
53198
- goodExample: `CASE l_fcat-fieldname.
53199
- WHEN 'FOO'.
53200
- WHEN 'BAR' OR 'MOO'.
53214
+ goodExample: `CASE l_fcat-fieldname.
53215
+ WHEN 'FOO'.
53216
+ WHEN 'BAR' OR 'MOO'.
53201
53217
  ENDCASE.`,
53202
53218
  };
53203
53219
  }
@@ -53334,8 +53350,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
53334
53350
  return {
53335
53351
  key: "check_abstract",
53336
53352
  title: "Check abstract methods and classes",
53337
- shortDescription: `Checks abstract methods and classes:
53338
- - class defined as abstract and final,
53353
+ shortDescription: `Checks abstract methods and classes:
53354
+ - class defined as abstract and final,
53339
53355
  - non-abstract class contains abstract methods`,
53340
53356
  extendedInformation: `If a class defines only constants, use an interface instead`,
53341
53357
  tags: [_irule_1.RuleTag.SingleFile],
@@ -53416,11 +53432,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
53416
53432
  return {
53417
53433
  key: "check_comments",
53418
53434
  title: "Check Comments",
53419
- shortDescription: `
53435
+ shortDescription: `
53420
53436
  Various checks for comment usage.`,
53421
- extendedInformation: `
53422
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53423
-
53437
+ extendedInformation: `
53438
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
53439
+
53424
53440
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
53425
53441
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
53426
53442
  badExample: `WRITE 2. " descriptive comment`,
@@ -53582,9 +53598,9 @@ class CheckInclude {
53582
53598
  key: "check_include",
53583
53599
  title: "Check INCLUDEs",
53584
53600
  shortDescription: `Checks INCLUDE statements`,
53585
- extendedInformation: `
53586
- * Reports unused includes
53587
- * Errors if the includes are not found
53601
+ extendedInformation: `
53602
+ * Reports unused includes
53603
+ * Errors if the includes are not found
53588
53604
  * Error if including a main program`,
53589
53605
  tags: [_irule_1.RuleTag.Syntax],
53590
53606
  };
@@ -53659,14 +53675,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
53659
53675
  key: "check_subrc",
53660
53676
  title: "Check sy-subrc",
53661
53677
  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
-
53678
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
53679
+
53680
+ If sy-dbcnt is checked after database statements, it is considered okay.
53681
+
53682
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
53683
+
53684
+ If IS ASSIGNED is checked after assigning, it is considered okay.
53685
+
53670
53686
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
53671
53687
  tags: [_irule_1.RuleTag.SingleFile],
53672
53688
  pseudoComment: "EC CI_SUBRC",
@@ -54219,17 +54235,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
54219
54235
  shortDescription: `Find overlapping classic exceptions`,
54220
54236
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
54221
54237
  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
54238
+ badExample: `CALL FUNCTION 'SOMETHING'
54239
+ EXCEPTIONS
54240
+ system_failure = 1 MESSAGE lv_message
54241
+ communication_failure = 1 MESSAGE lv_message
54242
+ resource_failure = 1
54227
54243
  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
54244
+ goodExample: `CALL FUNCTION 'SOMETHING'
54245
+ EXCEPTIONS
54246
+ system_failure = 1 MESSAGE lv_message
54247
+ communication_failure = 2 MESSAGE lv_message
54248
+ resource_failure = 3
54233
54249
  OTHERS = 4.`,
54234
54250
  };
54235
54251
  }
@@ -54475,7 +54491,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
54475
54491
  key: "commented_code",
54476
54492
  title: "Find commented code",
54477
54493
  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
54494
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
54479
54495
  https://docs.abapopenchecks.org/checks/14/`,
54480
54496
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
54481
54497
  };
@@ -54707,10 +54723,10 @@ class ConstructorVisibilityPublic {
54707
54723
  key: "constructor_visibility_public",
54708
54724
  title: "Check constructor visibility is public",
54709
54725
  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
54726
+ extendedInformation: `
54727
+ This only applies to global classes.
54728
+
54729
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
54714
54730
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
54715
54731
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54716
54732
  };
@@ -54785,8 +54801,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
54785
54801
  key: "contains_tab",
54786
54802
  title: "Code contains tab",
54787
54803
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
54788
- extendedInformation: `
54789
- https://docs.abapopenchecks.org/checks/09/
54804
+ extendedInformation: `
54805
+ https://docs.abapopenchecks.org/checks/09/
54790
54806
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
54791
54807
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54792
54808
  };
@@ -54871,10 +54887,10 @@ class CyclicOO {
54871
54887
  key: "cyclic_oo",
54872
54888
  title: "Cyclic OO",
54873
54889
  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
-
54890
+ extendedInformation: `Runs for global INTF + CLAS objects
54891
+
54892
+ Objects must be without syntax errors for this rule to take effect
54893
+
54878
54894
  References in testclass includes are ignored`,
54879
54895
  };
54880
54896
  }
@@ -55116,7 +55132,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
55116
55132
  key: "dangerous_statement",
55117
55133
  title: "Dangerous statement",
55118
55134
  shortDescription: `Detects potentially dangerous statements`,
55119
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55135
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
55120
55136
  dynamic SQL can potentially create SQL injection problems`,
55121
55137
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55122
55138
  };
@@ -55320,13 +55336,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
55320
55336
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
55321
55337
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
55322
55338
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55323
- badExample: `FROM foo.
55324
- WRITE 'hello'.
55325
- DATA int TYPE i.
55339
+ badExample: `FROM foo.
55340
+ WRITE 'hello'.
55341
+ DATA int TYPE i.
55326
55342
  ENDFORM.`,
55327
- goodExample: `FROM foo.
55328
- DATA int TYPE i.
55329
- WRITE 'hello'.
55343
+ goodExample: `FROM foo.
55344
+ DATA int TYPE i.
55345
+ WRITE 'hello'.
55330
55346
  ENDFORM.`,
55331
55347
  };
55332
55348
  }
@@ -55862,39 +55878,39 @@ class Downport {
55862
55878
  key: "downport",
55863
55879
  title: "Downport statement",
55864
55880
  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
-
55881
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
55882
+ a higher level language version. If successful, various rules are applied to downport the statement.
55883
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
55884
+
55885
+ Current rules:
55886
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
55887
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
55888
+ * FIELD-SYMBOL() definitions are outlined
55889
+ * CONV is outlined
55890
+ * COND is outlined
55891
+ * REDUCE is outlined
55892
+ * SWITCH is outlined
55893
+ * FILTER is outlined
55894
+ * APPEND expression is outlined
55895
+ * INSERT expression is outlined
55896
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
55897
+ * CAST changed to ?=
55898
+ * LOOP AT method_call( ) is outlined
55899
+ * VALUE # with structure fields
55900
+ * VALUE # with internal table lines
55901
+ * Table Expressions are outlined
55902
+ * SELECT INTO @DATA definitions are outlined
55903
+ * Some occurrences of string template formatting option ALPHA changed to function module call
55904
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
55905
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
55906
+ * RAISE EXCEPTION ... MESSAGE
55907
+ * Moving with +=, -=, /=, *=, &&= is expanded
55908
+ * line_exists and line_index is downported to READ TABLE
55909
+ * ENUMs, but does not nessesarily give the correct type and value
55910
+ * MESSAGE with non simple source
55911
+
55912
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
55913
+
55898
55914
  Make sure to test the downported code, it might not always be completely correct.`,
55899
55915
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
55900
55916
  };
@@ -56468,10 +56484,10 @@ Make sure to test the downported code, it might not always be completely correct
56468
56484
  const fieldName = f.concatTokens();
56469
56485
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
56470
56486
  }
56471
- fieldDefinition = `DATA: BEGIN OF ${name},
56487
+ fieldDefinition = `DATA: BEGIN OF ${name},
56472
56488
  ${fieldDefinition}${indentation} END OF ${name}.`;
56473
56489
  }
56474
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56490
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
56475
56491
  ${indentation}`);
56476
56492
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
56477
56493
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56515,12 +56531,12 @@ ${indentation}`);
56515
56531
  }
56516
56532
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56517
56533
  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.
56534
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
56535
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
56536
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
56521
56537
  ${indentation}`);
56522
56538
  if (fieldDefinitions === "") {
56523
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56539
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
56524
56540
  ${indentation}`);
56525
56541
  }
56526
56542
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -56588,7 +56604,7 @@ ${indentation}`);
56588
56604
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56589
56605
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56590
56606
  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()}.
56607
+ 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
56608
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56593
56609
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56594
56610
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56626,7 +56642,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56626
56642
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56627
56643
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56628
56644
  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()}.
56645
+ 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
56646
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56631
56647
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
56632
56648
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56668,14 +56684,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
56668
56684
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
56669
56685
  const firstToken = high.getFirstToken();
56670
56686
  // 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.
56687
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
56688
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
56689
+ ${indentation}${tabixBackup} = sy-tabix.
56690
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
56691
+ ${indentation}sy-tabix = ${tabixBackup}.
56692
+ ${indentation}IF sy-subrc <> 0.
56693
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
56694
+ ${indentation}ENDIF.
56679
56695
  ${indentation}`);
56680
56696
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
56681
56697
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -56732,7 +56748,7 @@ ${indentation}`);
56732
56748
  const className = classNames[0].concatTokens();
56733
56749
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
56734
56750
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56735
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
56751
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
56736
56752
  ${indentation}CATCH ${className} INTO ${targetName}.`;
56737
56753
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
56738
56754
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -56894,16 +56910,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
56894
56910
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56895
56911
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
56896
56912
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
56897
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56898
- ${indentation}${uniqueName1}-msgid = ${id}.
56913
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
56914
+ ${indentation}${uniqueName1}-msgid = ${id}.
56899
56915
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
56900
56916
  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'.
56917
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
56918
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
56919
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
56904
56920
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
56905
56921
  }
56906
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56922
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
56907
56923
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
56908
56924
  if (withs.length > 0) {
56909
56925
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -57015,10 +57031,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
57015
57031
  let code = "";
57016
57032
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
57017
57033
  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.
57034
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
57035
+ IF sy-subrc <> 0.
57036
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57037
+ ENDIF.
57022
57038
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57023
57039
  }
57024
57040
  else {
@@ -57094,20 +57110,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
57094
57110
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57095
57111
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57096
57112
  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.
57113
+ code += ` items LIKE ${loopSourceName},
57114
+ END OF ${groupTargetName}type.
57115
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
57116
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
57101
57117
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
57102
57118
  if (groupIndexName !== undefined) {
57103
57119
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
57104
57120
  }
57105
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57121
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
57106
57122
  IF sy-subrc = 0.\n`;
57107
57123
  if (groupCountName !== undefined) {
57108
57124
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
57109
57125
  }
57110
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57126
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
57111
57127
  ELSE.\n`;
57112
57128
  code += ` CLEAR ${uniqueName}.\n`;
57113
57129
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -57128,8 +57144,8 @@ ELSE.\n`;
57128
57144
  }
57129
57145
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
57130
57146
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
57131
- code += `ENDIF.
57132
- ENDLOOP.
57147
+ code += `ENDIF.
57148
+ ENDLOOP.
57133
57149
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57134
57150
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
57135
57151
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -57297,7 +57313,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
57297
57313
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
57298
57314
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
57299
57315
  // all ENUMS are char like?
57300
- let code = `TYPES ${enumName} TYPE string.
57316
+ let code = `TYPES ${enumName} TYPE string.
57301
57317
  CONSTANTS: BEGIN OF ${structureName},\n`;
57302
57318
  let count = 1;
57303
57319
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -57341,14 +57357,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
57341
57357
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
57342
57358
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57343
57359
  // 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.
57360
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
57361
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
57362
+ ${indentation}${tabixBackup} = sy-tabix.
57363
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
57364
+ ${indentation}sy-tabix = ${tabixBackup}.
57365
+ ${indentation}IF sy-subrc <> 0.
57366
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
57367
+ ${indentation}ENDIF.
57352
57368
  ${indentation}${uniqueName}`;
57353
57369
  const start = target.getFirstToken().getStart();
57354
57370
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -57432,11 +57448,11 @@ ${indentation}${uniqueName}`;
57432
57448
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
57433
57449
  const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
57434
57450
  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
57451
+ const code = `DATA ${uniqueName} TYPE string.
57452
+ ${indentation}CALL FUNCTION '${functionName}'
57453
+ ${indentation} EXPORTING
57454
+ ${indentation} input = ${source}
57455
+ ${indentation} IMPORTING
57440
57456
  ${indentation} output = ${uniqueName}.\n`;
57441
57457
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
57442
57458
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -58748,12 +58764,12 @@ class EasyToFindMessages {
58748
58764
  key: "easy_to_find_messages",
58749
58765
  title: "Easy to find messages",
58750
58766
  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
-
58767
+ extendedInformation: `All messages must be statically referenced exactly once
58768
+
58769
+ Only MESSAGE and RAISE statments are counted as static references
58770
+
58771
+ Also see rule "message_exists"
58772
+
58757
58773
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
58758
58774
  tags: [_irule_1.RuleTag.Styleguide],
58759
58775
  };
@@ -58838,8 +58854,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
58838
58854
  key: "empty_line_in_statement",
58839
58855
  title: "Find empty lines in statements",
58840
58856
  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
-
58857
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
58858
+
58843
58859
  https://docs.abapopenchecks.org/checks/41/`,
58844
58860
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
58845
58861
  badExample: `WRITE\n\nhello.`,
@@ -59131,10 +59147,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
59131
59147
  return {
59132
59148
  key: "exit_or_check",
59133
59149
  title: "Find EXIT or CHECK outside loops",
59134
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59150
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
59135
59151
  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
59152
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
59153
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
59138
59154
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
59139
59155
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
59140
59156
  };
@@ -59217,12 +59233,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
59217
59233
  key: "expand_macros",
59218
59234
  title: "Expand Macros",
59219
59235
  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
-
59236
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
59237
+
59222
59238
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
59223
- badExample: `DEFINE _hello.
59224
- WRITE 'hello'.
59225
- END-OF-DEFINITION.
59239
+ badExample: `DEFINE _hello.
59240
+ WRITE 'hello'.
59241
+ END-OF-DEFINITION.
59226
59242
  _hello.`,
59227
59243
  goodExample: `WRITE 'hello'.`,
59228
59244
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -59309,7 +59325,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
59309
59325
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
59310
59326
  badExample: `call_method( EXPORTING foo = bar ).`,
59311
59327
  goodExample: `call_method( foo = bar ).`,
59312
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59328
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
59313
59329
  https://docs.abapopenchecks.org/checks/30/`,
59314
59330
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
59315
59331
  };
@@ -59407,7 +59423,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
59407
59423
  key: "forbidden_identifier",
59408
59424
  title: "Forbidden Identifier",
59409
59425
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
59410
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59426
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
59411
59427
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
59412
59428
  tags: [_irule_1.RuleTag.SingleFile],
59413
59429
  };
@@ -59649,8 +59665,8 @@ class ForbiddenVoidType {
59649
59665
  key: "forbidden_void_type",
59650
59666
  title: "Forbidden Void Types",
59651
59667
  shortDescription: `Avoid usage of specified void types.`,
59652
- extendedInformation: `Inspiration:
59653
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59668
+ extendedInformation: `Inspiration:
59669
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
59654
59670
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
59655
59671
  };
59656
59672
  }
@@ -59893,7 +59909,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
59893
59909
  key: "fully_type_itabs",
59894
59910
  title: "Fully type internal tables",
59895
59911
  shortDescription: `No implict table types or table keys`,
59896
- badExample: `DATA lt_foo TYPE TABLE OF ty.
59912
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
59897
59913
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
59898
59914
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
59899
59915
  tags: [_irule_1.RuleTag.SingleFile],
@@ -60078,26 +60094,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
60078
60094
  key: "functional_writing",
60079
60095
  title: "Use functional writing",
60080
60096
  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
60097
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
60082
60098
  https://docs.abapopenchecks.org/checks/07/`,
60083
60099
  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
60100
+ badExample: `CALL METHOD zcl_class=>method( ).
60101
+ CALL METHOD cl_abap_typedescr=>describe_by_name
60102
+ EXPORTING
60103
+ p_name = 'NAME'
60104
+ RECEIVING
60105
+ p_descr_ref = lr_typedescr
60106
+ EXCEPTIONS
60107
+ type_not_found = 1
60092
60108
  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
60109
+ goodExample: `zcl_class=>method( ).
60110
+ cl_abap_typedescr=>describe_by_name(
60111
+ EXPORTING
60112
+ p_name = 'NAME'
60113
+ RECEIVING
60114
+ p_descr_ref = lr_typedescr
60115
+ EXCEPTIONS
60116
+ type_not_found = 1
60101
60117
  OTHERS = 2 ).`,
60102
60118
  };
60103
60119
  }
@@ -60208,14 +60224,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
60208
60224
  key: "global_class",
60209
60225
  title: "Global class checks",
60210
60226
  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
-
60227
+ extendedInformation: `* global classes must be in own files
60228
+
60229
+ * file names must match class name
60230
+
60231
+ * file names must match interface name
60232
+
60233
+ * global classes must be global definitions
60234
+
60219
60235
  * global interfaces must be global definitions`,
60220
60236
  tags: [_irule_1.RuleTag.Syntax],
60221
60237
  };
@@ -60298,8 +60314,8 @@ class Conditions {
60298
60314
  push(e) {
60299
60315
  this.arr.push(e.concatTokens());
60300
60316
  }
60301
- hasDuplicates() {
60302
- return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));
60317
+ findFirstDuplicate() {
60318
+ return this.arr.find(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));
60303
60319
  }
60304
60320
  }
60305
60321
  class IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {
@@ -60314,8 +60330,8 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
60314
60330
  return {
60315
60331
  key: "identical_conditions",
60316
60332
  title: "Identical conditions",
60317
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60318
-
60333
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
60334
+
60319
60335
  Prerequsites: code is pretty printed with identical cAsE`,
60320
60336
  tags: [_irule_1.RuleTag.SingleFile],
60321
60337
  };
@@ -60358,8 +60374,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60358
60374
  return [];
60359
60375
  }
60360
60376
  }
60361
- if (conditions.hasDuplicates()) {
60362
- const message = "Identical conditions";
60377
+ const duplicate = conditions.findFirstDuplicate();
60378
+ if (duplicate) {
60379
+ const message = "Identical conditions: " + duplicate;
60363
60380
  const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
60364
60381
  return [issue];
60365
60382
  }
@@ -60382,8 +60399,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60382
60399
  conditions.push(c);
60383
60400
  }
60384
60401
  }
60385
- if (conditions.hasDuplicates()) {
60386
- const message = "Identical conditions";
60402
+ const duplicate = conditions.findFirstDuplicate();
60403
+ if (duplicate) {
60404
+ const message = "Identical conditions: " + duplicate;
60387
60405
  const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);
60388
60406
  return [issue];
60389
60407
  }
@@ -60404,8 +60422,9 @@ Prerequsites: code is pretty printed with identical cAsE`,
60404
60422
  conditions.push(s);
60405
60423
  }
60406
60424
  }
60407
- if (conditions.hasDuplicates()) {
60408
- const message = "Identical conditions";
60425
+ const duplicate = conditions.findFirstDuplicate();
60426
+ if (duplicate) {
60427
+ const message = "Identical conditions: " + duplicate;
60409
60428
  const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);
60410
60429
  return [issue];
60411
60430
  }
@@ -60446,23 +60465,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
60446
60465
  key: "identical_contents",
60447
60466
  title: "Identical contents",
60448
60467
  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
-
60468
+ extendedInformation: `
60469
+ Prerequsites: code is pretty printed with identical cAsE
60470
+
60452
60471
  Chained statments are ignored`,
60453
60472
  tags: [_irule_1.RuleTag.SingleFile],
60454
- badExample: `IF foo = bar.
60455
- WRITE 'bar'.
60456
- WRITE 'world'.
60457
- ELSE.
60458
- WRITE 'foo'.
60459
- WRITE 'world'.
60473
+ badExample: `IF foo = bar.
60474
+ WRITE 'bar'.
60475
+ WRITE 'world'.
60476
+ ELSE.
60477
+ WRITE 'foo'.
60478
+ WRITE 'world'.
60460
60479
  ENDIF.`,
60461
- goodExample: `IF foo = bar.
60462
- WRITE 'bar'.
60463
- ELSE.
60464
- WRITE 'foo'.
60465
- ENDIF.
60480
+ goodExample: `IF foo = bar.
60481
+ WRITE 'bar'.
60482
+ ELSE.
60483
+ WRITE 'foo'.
60484
+ ENDIF.
60466
60485
  WRITE 'world'.`,
60467
60486
  };
60468
60487
  }
@@ -60565,12 +60584,12 @@ class IdenticalDescriptions {
60565
60584
  key: "identical_descriptions",
60566
60585
  title: "Identical descriptions",
60567
60586
  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
-
60587
+ extendedInformation: `Case insensitive
60588
+
60589
+ Only checks the master language descriptions
60590
+
60591
+ Dependencies are skipped
60592
+
60574
60593
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
60575
60594
  tags: [],
60576
60595
  };
@@ -60744,43 +60763,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
60744
60763
  key: "if_in_if",
60745
60764
  title: "IF in IF",
60746
60765
  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/
60766
+ extendedInformation: `
60767
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
60768
+
60769
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
60770
+
60771
+ https://docs.abapopenchecks.org/checks/01/
60753
60772
  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.
60773
+ badExample: `IF condition1.
60774
+ IF condition2.
60775
+ ...
60776
+ ENDIF.
60777
+ ENDIF.
60778
+
60779
+ IF condition1.
60780
+ ...
60781
+ ELSE.
60782
+ IF condition2.
60783
+ ...
60784
+ ENDIF.
60766
60785
  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.
60786
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
60787
+ ...
60788
+ ENDIF.
60789
+
60790
+ IF condition1.
60791
+ ...
60792
+ ELSEIF condition2.
60793
+ ...
60794
+ ENDIF.
60795
+
60796
+ CASE variable.
60797
+ WHEN value1.
60798
+ ...
60799
+ WHEN value2.
60800
+ IF condition2.
60801
+ ...
60802
+ ENDIF.
60784
60803
  ENDCASE.`,
60785
60804
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
60786
60805
  };
@@ -60965,9 +60984,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
60965
60984
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
60966
60985
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
60967
60986
  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
60987
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
60988
+ METHOD ${methodName.toLowerCase()}.
60989
+ RETURN. " todo, implement method
60971
60990
  ENDMETHOD.`);
60972
60991
  }
60973
60992
  }
@@ -61155,19 +61174,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
61155
61174
  key: "in_statement_indentation",
61156
61175
  title: "In-statement indentation",
61157
61176
  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)
61177
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
61178
+
61179
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
61161
61180
  to distinguish them better from code within the block.`,
61162
- badExample: `IF 1 = 1
61163
- AND 2 = 2.
61164
- WRITE 'hello' &&
61165
- 'world'.
61181
+ badExample: `IF 1 = 1
61182
+ AND 2 = 2.
61183
+ WRITE 'hello' &&
61184
+ 'world'.
61166
61185
  ENDIF.`,
61167
- goodExample: `IF 1 = 1
61168
- AND 2 = 2.
61169
- WRITE 'hello' &&
61170
- 'world'.
61186
+ goodExample: `IF 1 = 1
61187
+ AND 2 = 2.
61188
+ WRITE 'hello' &&
61189
+ 'world'.
61171
61190
  ENDIF.`,
61172
61191
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61173
61192
  };
@@ -61672,9 +61691,9 @@ class IntfReferencingClas {
61672
61691
  key: "intf_referencing_clas",
61673
61692
  title: "INTF referencing CLAS",
61674
61693
  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.
61694
+ extendedInformation: `Only global interfaces are checked.
61695
+ Only first level references are checked.
61696
+ Exception class references are ignored.
61678
61697
  Void references are ignored.`,
61679
61698
  };
61680
61699
  }
@@ -62269,8 +62288,8 @@ class LineBreakStyle {
62269
62288
  return {
62270
62289
  key: "line_break_style",
62271
62290
  title: "Makes sure line breaks are consistent in the ABAP code",
62272
- shortDescription: `Enforces LF as newlines in ABAP files
62273
-
62291
+ shortDescription: `Enforces LF as newlines in ABAP files
62292
+
62274
62293
  abapGit does not work with CRLF`,
62275
62294
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
62276
62295
  };
@@ -62339,7 +62358,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
62339
62358
  key: "line_length",
62340
62359
  title: "Line length",
62341
62360
  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
62361
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
62343
62362
  https://docs.abapopenchecks.org/checks/04/`,
62344
62363
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
62345
62364
  };
@@ -62410,7 +62429,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
62410
62429
  key: "line_only_punc",
62411
62430
  title: "Line containing only punctuation",
62412
62431
  shortDescription: `Detects lines containing only punctuation.`,
62413
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62432
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
62414
62433
  https://docs.abapopenchecks.org/checks/16/`,
62415
62434
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62416
62435
  badExample: "zcl_class=>method(\n).",
@@ -62670,8 +62689,8 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
62670
62689
  return {
62671
62690
  key: "local_variable_names",
62672
62691
  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.
62692
+ shortDescription: `
62693
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
62675
62694
  Regexes are case-insensitive.`,
62676
62695
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
62677
62696
  };
@@ -62818,10 +62837,10 @@ class MainFileContents {
62818
62837
  key: "main_file_contents",
62819
62838
  title: "Main file contents",
62820
62839
  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>."
62840
+ extendedInformation: `Does not run if the target version is Cloud
62841
+
62842
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
62843
+ * TYPEs must begin with "TYPE-POOL <name>."
62825
62844
  `,
62826
62845
  };
62827
62846
  }
@@ -62937,17 +62956,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
62937
62956
  title: "Too many parentheses",
62938
62957
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
62939
62958
  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.
62959
+ badExample: `
62960
+ IF ( destination IS INITIAL ).
62961
+ ENDIF.
62962
+ IF foo = boo AND ( bar = lar AND moo = loo ).
62963
+ ENDIF.
62945
62964
  `,
62946
- goodExample: `
62947
- IF destination IS INITIAL.
62948
- ENDIF.
62949
- IF foo = boo AND bar = lar AND moo = loo.
62950
- ENDIF.
62965
+ goodExample: `
62966
+ IF destination IS INITIAL.
62967
+ ENDIF.
62968
+ IF foo = boo AND bar = lar AND moo = loo.
62969
+ ENDIF.
62951
62970
  `,
62952
62971
  };
62953
62972
  }
@@ -63121,14 +63140,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
63121
63140
  title: "Max one method parameter definition per line",
63122
63141
  shortDescription: `Keep max one method parameter description per line`,
63123
63142
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
63124
- badExample: `
63125
- METHODS apps_scope_token
63126
- IMPORTING
63143
+ badExample: `
63144
+ METHODS apps_scope_token
63145
+ IMPORTING
63127
63146
  body TYPE bodyapps_scope_token client_id TYPE str.`,
63128
- goodExample: `
63129
- METHODS apps_scope_token
63130
- IMPORTING
63131
- body TYPE bodyapps_scope_token
63147
+ goodExample: `
63148
+ METHODS apps_scope_token
63149
+ IMPORTING
63150
+ body TYPE bodyapps_scope_token
63132
63151
  client_id TYPE str.`,
63133
63152
  };
63134
63153
  }
@@ -63193,11 +63212,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
63193
63212
  key: "max_one_statement",
63194
63213
  title: "Max one statement per line",
63195
63214
  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
63215
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
63216
+
63217
+ Does not report anything for chained statements.
63218
+
63219
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
63201
63220
  https://docs.abapopenchecks.org/checks/11/`,
63202
63221
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
63203
63222
  badExample: `WRITE foo. WRITE bar.`,
@@ -63534,8 +63553,8 @@ class MethodLength {
63534
63553
  key: "method_length",
63535
63554
  title: "Method/Form Length",
63536
63555
  shortDescription: `Checks relating to method/form length.`,
63537
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63538
-
63556
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
63557
+
63539
63558
  Abstract methods without statements are considered okay.`,
63540
63559
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
63541
63560
  };
@@ -63634,10 +63653,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
63634
63653
  key: "method_overwrites_builtin",
63635
63654
  title: "Method name overwrites builtin function",
63636
63655
  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
-
63656
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
63657
+
63658
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
63659
+
63641
63660
  Interface method names are ignored`,
63642
63661
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
63643
63662
  };
@@ -64207,7 +64226,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
64207
64226
  key: "nesting",
64208
64227
  title: "Check nesting depth",
64209
64228
  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
64229
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
64211
64230
  https://docs.abapopenchecks.org/checks/74/`,
64212
64231
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64213
64232
  };
@@ -64450,7 +64469,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
64450
64469
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
64451
64470
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64452
64471
  badExample: `var1 = var2 = var3.`,
64453
- goodExample: `var2 = var3.
64472
+ goodExample: `var2 = var3.
64454
64473
  var1 = var2.`,
64455
64474
  };
64456
64475
  }
@@ -64509,8 +64528,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
64509
64528
  key: "no_external_form_calls",
64510
64529
  title: "No external FORM calls",
64511
64530
  shortDescription: `Detect external form calls`,
64512
- badExample: `PERFORM foo IN PROGRAM bar.
64513
-
64531
+ badExample: `PERFORM foo IN PROGRAM bar.
64532
+
64514
64533
  PERFORM foo(bar).`,
64515
64534
  tags: [_irule_1.RuleTag.SingleFile],
64516
64535
  };
@@ -64571,17 +64590,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
64571
64590
  key: "no_inline_in_optional_branches",
64572
64591
  title: "Don't declare inline in optional branches",
64573
64592
  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:
64593
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
64594
+
64595
+ Considered optional branches:
64596
+ * inside IF/ELSEIF/ELSE
64597
+ * inside LOOP
64598
+ * inside WHILE
64599
+ * inside CASE/WHEN, CASE TYPE OF
64600
+ * inside DO
64601
+ * inside SELECT loops
64602
+
64603
+ Not considered optional branches:
64585
64604
  * TRY/CATCH/CLEANUP`,
64586
64605
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
64587
64606
  };
@@ -64680,12 +64699,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
64680
64699
  key: "no_prefixes",
64681
64700
  title: "No Prefixes",
64682
64701
  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
-
64702
+ extendedInformation: `
64703
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
64704
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
64705
+
64706
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
64707
+
64689
64708
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
64690
64709
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
64691
64710
  badExample: `DATA lv_foo TYPE i.`,
@@ -64858,7 +64877,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
64858
64877
  return {
64859
64878
  key: "no_public_attributes",
64860
64879
  title: "No public attributes",
64861
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
64880
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
64862
64881
  Exceptions are excluded from this rule.`,
64863
64882
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
64864
64883
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -64959,13 +64978,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
64959
64978
  key: "no_yoda_conditions",
64960
64979
  title: "No Yoda conditions",
64961
64980
  shortDescription: `Finds Yoda conditions and reports issues`,
64962
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
64963
-
64981
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
64982
+
64964
64983
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
64965
64984
  tags: [_irule_1.RuleTag.SingleFile],
64966
- badExample: `IF 0 <> sy-subrc.
64985
+ badExample: `IF 0 <> sy-subrc.
64967
64986
  ENDIF.`,
64968
- goodExample: `IF sy-subrc <> 0.
64987
+ goodExample: `IF sy-subrc <> 0.
64969
64988
  ENDIF.`,
64970
64989
  };
64971
64990
  }
@@ -65066,8 +65085,8 @@ class NROBConsistency {
65066
65085
  key: "nrob_consistency",
65067
65086
  title: "Number range consistency",
65068
65087
  shortDescription: `Consistency checks for number ranges`,
65069
- extendedInformation: `Issue reported if percentage warning is over 50%
65070
-
65088
+ extendedInformation: `Issue reported if percentage warning is over 50%
65089
+
65071
65090
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
65072
65091
  tags: [_irule_1.RuleTag.SingleFile],
65073
65092
  };
@@ -65344,58 +65363,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
65344
65363
  title: "Obsolete statements",
65345
65364
  shortDescription: `Checks for usages of certain obsolete statements`,
65346
65365
  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
-
65366
+ extendedInformation: `
65367
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
65368
+
65369
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
65370
+
65371
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
65372
+
65373
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
65374
+
65375
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
65376
+
65377
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
65378
+
65379
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65380
+
65381
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
65382
+
65383
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
65384
+
65385
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
65386
+
65387
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
65388
+
65389
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
65390
+
65391
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
65392
+
65393
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
65394
+
65395
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
65396
+ SELECT COUNT(*) is considered okay
65397
+
65398
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
65399
+
65400
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
65401
+
65402
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
65403
+
65404
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
65405
+
65406
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
65407
+
65389
65408
  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.
65409
+ badExample: `REFRESH itab.
65410
+
65411
+ COMPUTE foo = 2 + 2.
65412
+
65413
+ MULTIPLY lv_foo BY 2.
65414
+
65415
+ INTERFACE intf LOAD.
65416
+
65417
+ IF foo IS SUPPLIED.
65399
65418
  ENDIF.`,
65400
65419
  };
65401
65420
  }
@@ -65735,9 +65754,9 @@ class OmitParameterName {
65735
65754
  key: "omit_parameter_name",
65736
65755
  title: "Omit parameter name",
65737
65756
  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
-
65757
+ extendedInformation: `
65758
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
65759
+
65741
65760
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
65742
65761
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
65743
65762
  badExample: `method( param = 2 ).`,
@@ -65943,20 +65962,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
65943
65962
  shortDescription: `Omit RECEIVING`,
65944
65963
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
65945
65964
  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
65965
+ badExample: `
65966
+ upload_pack(
65967
+ EXPORTING
65968
+ io_client = lo_client
65969
+ iv_url = iv_url
65970
+ iv_deepen_level = iv_deepen_level
65971
+ it_hashes = lt_hashes
65972
+ RECEIVING
65954
65973
  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
65974
+ goodExample: `
65975
+ et_objects = upload_pack(
65976
+ io_client = lo_client
65977
+ iv_url = iv_url
65978
+ iv_deepen_level = iv_deepen_level
65960
65979
  it_hashes = lt_hashes ).`,
65961
65980
  };
65962
65981
  }
@@ -66020,8 +66039,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
66020
66039
  return {
66021
66040
  key: "parser_702_chaining",
66022
66041
  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.
66042
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
66043
+ this rule finds these and reports errors.
66025
66044
  Only active on target version 702 and below.`,
66026
66045
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66027
66046
  };
@@ -66101,8 +66120,8 @@ class ParserError {
66101
66120
  return {
66102
66121
  key: "parser_error",
66103
66122
  title: "Parser error",
66104
- shortDescription: `Checks for syntax not recognized by abaplint.
66105
-
66123
+ shortDescription: `Checks for syntax not recognized by abaplint.
66124
+
66106
66125
  See recognized syntax at https://syntax.abaplint.org`,
66107
66126
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
66108
66127
  };
@@ -66187,7 +66206,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
66187
66206
  return {
66188
66207
  key: "parser_missing_space",
66189
66208
  title: "Parser Error, missing space",
66190
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66209
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
66191
66210
  This rule makes sure the spaces are consistently required across the language.`,
66192
66211
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
66193
66212
  badExample: `IF ( foo = 'bar').`,
@@ -66599,25 +66618,25 @@ class PreferInline {
66599
66618
  key: "prefer_inline",
66600
66619
  title: "Prefer Inline Declarations",
66601
66620
  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
-
66621
+ extendedInformation: `EXPERIMENTAL
66622
+
66623
+ Activates if language version is v740sp02 or above.
66624
+
66625
+ Variables must be local(METHOD or FORM).
66626
+
66627
+ No generic or void typed variables. No syntax errors.
66628
+
66629
+ First position used must be a full/pure write.
66630
+
66631
+ Move statment is not a cast(?=)
66632
+
66614
66633
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
66615
66634
  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.
66635
+ badExample: `DATA foo TYPE i.
66636
+ foo = 2.
66637
+ DATA percentage TYPE decfloat34.
66619
66638
  percentage = ( comment_number / abs_statement_number ) * 100.`,
66620
- goodExample: `DATA(foo) = 2.
66639
+ goodExample: `DATA(foo) = 2.
66621
66640
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
66622
66641
  };
66623
66642
  }
@@ -66831,18 +66850,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
66831
66850
  key: "prefer_is_not",
66832
66851
  title: "Prefer IS NOT to NOT IS",
66833
66852
  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
-
66853
+ extendedInformation: `
66854
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
66855
+
66837
66856
  "if not is_valid( )." examples are skipped`,
66838
66857
  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.
66858
+ goodExample: `IF variable IS NOT INITIAL.
66859
+ IF variable NP 'TODO*'.
66860
+ IF variable <> 42.
66842
66861
  IF variable CO 'hello'.`,
66843
- badExample: `IF NOT variable IS INITIAL.
66844
- IF NOT variable CP 'TODO*'.
66845
- IF NOT variable = 42.
66862
+ badExample: `IF NOT variable IS INITIAL.
66863
+ IF NOT variable CP 'TODO*'.
66864
+ IF NOT variable = 42.
66846
66865
  IF NOT variable CA 'hello'.`,
66847
66866
  };
66848
66867
  }
@@ -67030,14 +67049,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
67030
67049
  key: "prefer_raise_exception_new",
67031
67050
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
67032
67051
  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
-
67052
+ extendedInformation: `
67053
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
67054
+
67036
67055
  From 752 and up`,
67037
67056
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
67038
67057
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
67039
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
67040
- EXPORTING
67058
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
67059
+ EXPORTING
67041
67060
  previous = exception.`,
67042
67061
  };
67043
67062
  }
@@ -67115,7 +67134,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
67115
67134
  key: "prefer_returning_to_exporting",
67116
67135
  title: "Prefer RETURNING to EXPORTING",
67117
67136
  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
67137
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
67119
67138
  https://docs.abapopenchecks.org/checks/44/`,
67120
67139
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67121
67140
  };
@@ -67212,8 +67231,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
67212
67231
  key: "prefer_xsdbool",
67213
67232
  title: "Prefer xsdbool over boolc",
67214
67233
  shortDescription: `Prefer xsdbool over boolc`,
67215
- extendedInformation: `Activates if language version is v740sp08 or above.
67216
-
67234
+ extendedInformation: `Activates if language version is v740sp08 or above.
67235
+
67217
67236
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
67218
67237
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
67219
67238
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -67507,26 +67526,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
67507
67526
  key: "reduce_procedural_code",
67508
67527
  title: "Reduce procedural code",
67509
67528
  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
-
67529
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
67530
+
67531
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
67532
+
67514
67533
  Comments are not counted as statements.`,
67515
67534
  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.
67535
+ badExample: `FORM foo.
67536
+ DATA lv_bar TYPE i.
67537
+ lv_bar = 2 + 2.
67538
+ IF lv_bar = 4.
67539
+ WRITE 'hello world'.
67540
+ ENDIF.
67541
+ DATA lv_bar TYPE i.
67542
+ lv_bar = 2 + 2.
67543
+ IF lv_bar = 4.
67544
+ WRITE 'hello world'.
67545
+ ENDIF.
67527
67546
  ENDFORM.`,
67528
- goodExample: `FORM foo.
67529
- NEW zcl_global_class( )->run_logic( ).
67547
+ goodExample: `FORM foo.
67548
+ NEW zcl_global_class( )->run_logic( ).
67530
67549
  ENDFORM.`,
67531
67550
  };
67532
67551
  }
@@ -67770,10 +67789,10 @@ class RemoveDescriptions {
67770
67789
  return {
67771
67790
  key: "remove_descriptions",
67772
67791
  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
-
67792
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
67793
+
67794
+ Class descriptions are required, see rule description_empty.
67795
+
67777
67796
  Consider using ABAP Doc for documentation.`,
67778
67797
  tags: [],
67779
67798
  };
@@ -67898,16 +67917,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
67898
67917
  tags: [_irule_1.RuleTag.SingleFile],
67899
67918
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
67900
67919
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
67901
- badExample: `
67902
- CALL FUNCTION 'ZRFC'
67920
+ badExample: `
67921
+ CALL FUNCTION 'ZRFC'
67903
67922
  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
67923
+ goodExample: `
67924
+ CALL FUNCTION 'ZRFC'
67925
+ DESTINATION lv_rfc
67926
+ EXCEPTIONS
67927
+ system_failure = 1 MESSAGE msg
67928
+ communication_failure = 2 MESSAGE msg
67929
+ resource_failure = 3
67911
67930
  OTHERS = 4.`,
67912
67931
  };
67913
67932
  }
@@ -67991,11 +68010,11 @@ class SelectAddOrderBy {
67991
68010
  key: "select_add_order_by",
67992
68011
  title: "SELECT add ORDER BY",
67993
68012
  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
-
68013
+ extendedInformation: `
68014
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
68015
+
68016
+ add ORDER BY PRIMARY KEY if in doubt
68017
+
67999
68018
  If the target is a sorted/hashed table, no issue is reported`,
68000
68019
  tags: [_irule_1.RuleTag.SingleFile],
68001
68020
  };
@@ -68124,14 +68143,14 @@ class SelectPerformance {
68124
68143
  key: "select_performance",
68125
68144
  title: "SELECT performance",
68126
68145
  shortDescription: `Various checks regarding SELECT performance.`,
68127
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68128
-
68146
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
68147
+
68129
68148
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
68130
68149
  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.
68150
+ badExample: `SELECT field1, field2 FROM table
68151
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
68133
68152
  ENDSELECT.`,
68134
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68153
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
68135
68154
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
68136
68155
  };
68137
68156
  }
@@ -68243,8 +68262,8 @@ class SelectSingleFullKey {
68243
68262
  key: "select_single_full_key",
68244
68263
  title: "Detect SELECT SINGLE which are possibily not unique",
68245
68264
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
68246
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68247
-
68265
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
68266
+
68248
68267
  If the statement contains a JOIN it is not checked`,
68249
68268
  pseudoComment: "EC CI_NOORDER",
68250
68269
  tags: [],
@@ -68661,8 +68680,8 @@ class SICFConsistency {
68661
68680
  key: "sicf_consistency",
68662
68681
  title: "SICF consistency",
68663
68682
  shortDescription: `Checks the validity of ICF services`,
68664
- extendedInformation: `* Class defined in handler must exist
68665
- * Class must not have any syntax errors
68683
+ extendedInformation: `* Class defined in handler must exist
68684
+ * Class must not have any syntax errors
68666
68685
  * Class must implement interface IF_HTTP_EXTENSION`,
68667
68686
  };
68668
68687
  }
@@ -69029,8 +69048,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
69029
69048
  key: "space_before_dot",
69030
69049
  title: "Space before dot",
69031
69050
  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
69051
+ extendedInformation: `
69052
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
69034
69053
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
69035
69054
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69036
69055
  badExample: `WRITE bar .`,
@@ -69216,12 +69235,12 @@ class SQLValueConversion {
69216
69235
  key: "sql_value_conversion",
69217
69236
  title: "Implicit SQL Value Conversion",
69218
69237
  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
69238
+ extendedInformation: `
69239
+ * Integer to CHAR conversion
69240
+ * Integer to NUMC conversion
69241
+ * NUMC to Integer conversion
69242
+ * CHAR to Integer conversion
69243
+ * Source field longer than database field, CHAR -> CHAR
69225
69244
  * Source field longer than database field, NUMC -> NUMC`,
69226
69245
  tags: [],
69227
69246
  };
@@ -69293,7 +69312,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
69293
69312
  key: "start_at_tab",
69294
69313
  title: "Start at tab",
69295
69314
  shortDescription: `Checks that statements start at tabstops.`,
69296
- extendedInformation: `Reports max 100 issues per file
69315
+ extendedInformation: `Reports max 100 issues per file
69297
69316
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
69298
69317
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69299
69318
  badExample: ` WRITE a.`,
@@ -69470,12 +69489,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
69470
69489
  key: "strict_sql",
69471
69490
  title: "Strict SQL",
69472
69491
  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
-
69492
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
69493
+
69494
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
69495
+
69496
+ Also see separate rule sql_escape_host_variables
69497
+
69479
69498
  Activates from v750 and up`,
69480
69499
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
69481
69500
  };
@@ -69727,11 +69746,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
69727
69746
  key: "sy_modification",
69728
69747
  title: "Modification of SY fields",
69729
69748
  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
-
69749
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
69750
+
69732
69751
  Changes to SY-TVAR* fields are not reported`,
69733
69752
  tags: [_irule_1.RuleTag.SingleFile],
69734
- badExample: `sy-uname = 2.
69753
+ badExample: `sy-uname = 2.
69735
69754
  sy = sy.`,
69736
69755
  };
69737
69756
  }
@@ -69793,8 +69812,8 @@ class TABLEnhancementCategory {
69793
69812
  key: "tabl_enhancement_category",
69794
69813
  title: "TABL enhancement category must be set",
69795
69814
  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
-
69815
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
69816
+
69798
69817
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
69799
69818
  tags: [],
69800
69819
  };
@@ -69922,9 +69941,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
69922
69941
  title: "Type FORM parameters",
69923
69942
  shortDescription: `Checks for untyped FORM parameters`,
69924
69943
  tags: [_irule_1.RuleTag.SingleFile],
69925
- badExample: `FORM foo USING bar.
69944
+ badExample: `FORM foo USING bar.
69926
69945
  ENDFORM.`,
69927
- goodExample: `FORM foo USING bar TYPE string.
69946
+ goodExample: `FORM foo USING bar TYPE string.
69928
69947
  ENDFORM.`,
69929
69948
  };
69930
69949
  }
@@ -70590,38 +70609,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
70590
70609
  key: "unnecessary_pragma",
70591
70610
  title: "Unnecessary Pragma",
70592
70611
  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
-
70612
+ extendedInformation: `* NO_HANDLER with handler
70613
+
70614
+ * NEEDED without definition
70615
+
70616
+ * NO_TEXT without texts
70617
+
70618
+ * SUBRC_OK where sy-subrc is checked
70619
+
70601
70620
  NO_HANDLER inside macros are not checked`,
70602
70621
  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.
70622
+ badExample: `TRY.
70623
+ ...
70624
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
70625
+ RETURN. " it has a handler
70626
+ ENDTRY.
70627
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
70628
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
70629
+ IF sy-subrc <> 0.
70611
70630
  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,
70631
+ goodExample: `TRY.
70632
+ ...
70633
+ CATCH zcx_abapgit_exception.
70634
+ RETURN.
70635
+ ENDTRY.
70636
+ MESSAGE w125(zbar) WITH c_foo INTO message.
70637
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
70638
+ IF sy-subrc <> 0.
70639
+ ENDIF.
70640
+
70641
+ DATA: BEGIN OF blah ##NEEDED,
70642
+ test1 TYPE string,
70643
+ test2 TYPE string,
70625
70644
  END OF blah.`,
70626
70645
  };
70627
70646
  }
@@ -70779,18 +70798,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
70779
70798
  shortDescription: `Finds unnecessary RETURN statements`,
70780
70799
  extendedInformation: `Finds unnecessary RETURN statements`,
70781
70800
  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.
70801
+ badExample: `FORM hello1.
70802
+ WRITE 'world'.
70803
+ RETURN.
70804
+ ENDFORM.
70805
+
70806
+ FORM foo.
70807
+ IF 1 = 2.
70808
+ RETURN.
70809
+ ENDIF.
70791
70810
  ENDFORM.`,
70792
- goodExample: `FORM hello2.
70793
- WRITE 'world'.
70811
+ goodExample: `FORM hello2.
70812
+ WRITE 'world'.
70794
70813
  ENDFORM.`,
70795
70814
  };
70796
70815
  }
@@ -71157,17 +71176,17 @@ class UnusedMethods {
71157
71176
  key: "unused_methods",
71158
71177
  title: "Unused methods",
71159
71178
  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
71179
+ extendedInformation: `Checks private and protected methods.
71180
+
71181
+ Unused methods are not reported if the object contains parser or syntax errors.
71182
+
71183
+ Skips:
71184
+ * methods FOR TESTING
71185
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
71186
+ * class_constructor + constructor methods
71187
+ * event handlers
71188
+ * methods that are redefined
71189
+ * INCLUDEs
71171
71190
  `,
71172
71191
  tags: [],
71173
71192
  pragma: "##CALLED",
@@ -71557,23 +71576,23 @@ class UnusedVariables {
71557
71576
  key: "unused_variables",
71558
71577
  title: "Unused variables",
71559
71578
  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
-
71579
+ extendedInformation: `Skips event parameters.
71580
+
71581
+ Note that this currently does not work if the source code uses macros.
71582
+
71583
+ Unused variables are not reported if the object contains parser or syntax errors.
71584
+
71566
71585
  Errors found in INCLUDES are reported for the main program.`,
71567
71586
  tags: [_irule_1.RuleTag.Quickfix],
71568
71587
  pragma: "##NEEDED",
71569
71588
  pseudoComment: "EC NEEDED",
71570
- badExample: `DATA: BEGIN OF blah1,
71571
- test TYPE string,
71572
- test2 TYPE string,
71589
+ badExample: `DATA: BEGIN OF blah1,
71590
+ test TYPE string,
71591
+ test2 TYPE string,
71573
71592
  END OF blah1.`,
71574
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71575
- test TYPE string,
71576
- test2 TYPE string,
71593
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
71594
+ test TYPE string,
71595
+ test2 TYPE string,
71577
71596
  END OF blah2.`,
71578
71597
  };
71579
71598
  }
@@ -71792,15 +71811,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
71792
71811
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
71793
71812
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
71794
71813
  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
-
71814
+ badExample: `IF line IS INITIAL.
71815
+ has_entries = abap_false.
71816
+ ELSE.
71817
+ has_entries = abap_true.
71818
+ ENDIF.
71819
+
71801
71820
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
71802
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71803
-
71821
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
71822
+
71804
71823
  DATA(fsdf) = xsdbool( foo <> bar ).`,
71805
71824
  };
71806
71825
  }
@@ -71976,15 +71995,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
71976
71995
  key: "use_line_exists",
71977
71996
  title: "Use line_exists",
71978
71997
  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
-
71998
+ extendedInformation: `
71999
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
72000
+
71982
72001
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
71983
72002
  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.
72003
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
72004
+ IF sy-subrc = 0.
71986
72005
  ENDIF.`,
71987
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
72006
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
71988
72007
  ENDIF.`,
71989
72008
  };
71990
72009
  }
@@ -72094,10 +72113,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
72094
72113
  key: "use_new",
72095
72114
  title: "Use NEW",
72096
72115
  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
-
72116
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
72117
+
72118
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
72119
+
72101
72120
  Applicable from v740sp02 and up`,
72102
72121
  badExample: `CREATE OBJECT ref.`,
72103
72122
  goodExample: `ref = NEW #( ).`,
@@ -72195,13 +72214,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
72195
72214
  title: "WHEN OTHERS last",
72196
72215
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
72197
72216
  tags: [_irule_1.RuleTag.SingleFile],
72198
- badExample: `CASE bar.
72199
- WHEN OTHERS.
72200
- WHEN 2.
72217
+ badExample: `CASE bar.
72218
+ WHEN OTHERS.
72219
+ WHEN 2.
72201
72220
  ENDCASE.`,
72202
- goodExample: `CASE bar.
72203
- WHEN 2.
72204
- WHEN OTHERS.
72221
+ goodExample: `CASE bar.
72222
+ WHEN 2.
72223
+ WHEN OTHERS.
72205
72224
  ENDCASE.`,
72206
72225
  };
72207
72226
  }
@@ -86548,6 +86567,7 @@ const arg = {
86548
86567
  runRename: parsed["rename"],
86549
86568
  outFormat: parsed["outformat"],
86550
86569
  outFile: parsed["outfile"],
86570
+ file: parsed["file"],
86551
86571
  };
86552
86572
  (0, _1.run)(arg).then(({ output, issues }) => {
86553
86573
  if (output.length > 0) {