@abaplint/cli 2.113.67 → 2.113.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +4 -4
  2. package/abaplint +2 -2
  3. package/build/cli.js +963 -913
  4. package/package.json +63 -63
package/build/cli.js CHANGED
@@ -9861,8 +9861,13 @@ class StatementParser {
9861
9861
  || type instanceof Statements.EndMethod) {
9862
9862
  sql = false;
9863
9863
  }
9864
- else if (!(type instanceof _statement_1.Comment)) {
9864
+ else {
9865
9865
  wa.statements[i] = new nodes_1.StatementNode(new _statement_1.NativeSQL()).setChildren(this.tokensToNodes(statement.getTokens()));
9866
+ if (statement.concatTokens().toUpperCase().endsWith("ENDMETHOD.")) {
9867
+ // yea, this is not completely correct
9868
+ wa.statements[i] = new nodes_1.StatementNode(new Statements.EndMethod()).setChildren(this.tokensToNodes(statement.getTokens()));
9869
+ sql = false;
9870
+ }
9866
9871
  }
9867
9872
  }
9868
9873
  }
@@ -13588,7 +13593,9 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
13588
13593
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
13589
13594
  class GetPermissions {
13590
13595
  getMatcher() {
13591
- const s = (0, combi_1.seq)("GET PERMISSIONS ONLY GLOBAL AUTHORIZATION ENTITY", expressions_1.SimpleName, "REQUEST", expressions_1.Source, "RESULT", expressions_1.Target, "FAILED", expressions_1.Target, "REPORTED", expressions_1.Target);
13596
+ const type = (0, combi_1.altPrio)("GLOBAL AUTHORIZATION", "INSTANCE");
13597
+ const from = (0, combi_1.seq)("FROM", expressions_1.Source);
13598
+ const s = (0, combi_1.seq)("GET PERMISSIONS ONLY", type, "ENTITY", expressions_1.SimpleName, (0, combi_1.optPrio)(from), "REQUEST", expressions_1.Source, "RESULT", expressions_1.Target, "FAILED", expressions_1.Target, "REPORTED", expressions_1.Target);
13592
13599
  return (0, combi_1.ver)(version_1.Version.v754, s);
13593
13600
  }
13594
13601
  }
@@ -14754,7 +14761,7 @@ class MethodDef {
14754
14761
  const parameters = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("FINAL", def, expressions_1.Abstract)), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefChanging), (0, combi_1.optPrio)(expressions_1.MethodDefReturning), (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));
14755
14762
  const testing = (0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), "FOR TESTING", (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));
14756
14763
  // todo, this is only from version something
14757
- const tableFunction = (0, combi_1.seq)("TABLE FUNCTION", (0, combi_1.regex)(/^\w+?$/));
14764
+ const tableFunction = (0, combi_1.seq)("TABLE FUNCTION", expressions_1.NamespaceSimpleName);
14758
14765
  // todo, this is only from version something
14759
14766
  const ddl = "DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED";
14760
14767
  const result = (0, combi_1.seq)("RESULT", expressions_1.MethodParamName);
@@ -14849,7 +14856,7 @@ class ModifyEntities {
14849
14856
  const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
14850
14857
  const from = (0, combi_1.seq)("FROM", expressions_1.Source);
14851
14858
  const execute = (0, combi_1.seq)("EXECUTE", expressions_1.NamespaceSimpleName);
14852
- const entities = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, operation, (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported)));
14859
+ const entities = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plusPrio)((0, combi_1.seq)("ENTITY", expressions_1.SimpleName, operation)), (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported)));
14853
14860
  const entity = (0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, execute, from, mapped, failed, reported);
14854
14861
  return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity)));
14855
14862
  }
@@ -22588,6 +22595,7 @@ var ReferenceType;
22588
22595
  ReferenceType["TableVoidReference"] = "Table (Void)";
22589
22596
  ReferenceType["MethodReference"] = "Method";
22590
22597
  ReferenceType["BuiltinMethodReference"] = "Builtin Method";
22598
+ ReferenceType["ConstructorReference"] = "Constructor Reference";
22591
22599
  ReferenceType["MethodImplementationReference"] = "Method Implementation";
22592
22600
  ReferenceType["TypeReference"] = "Type";
22593
22601
  ReferenceType["BuiltinTypeReference"] = "Builtin Type";
@@ -26763,6 +26771,7 @@ class NewObject {
26763
26771
  const clas = input.scope.findClassDefinition(targetType.getIdentifierName());
26764
26772
  if (clas) {
26765
26773
  input.scope.addReference(typeToken, clas, _reference_1.ReferenceType.InferredType, input.filename);
26774
+ input.scope.addReference(typeToken, clas, _reference_1.ReferenceType.ConstructorReference, input.filename);
26766
26775
  }
26767
26776
  else {
26768
26777
  const intf = input.scope.findInterfaceDefinition(targetType.getIdentifierName());
@@ -26789,6 +26798,7 @@ class NewObject {
26789
26798
  const objDefinition = input.scope.findObjectDefinition(typeName);
26790
26799
  if (objDefinition) {
26791
26800
  input.scope.addReference(typeToken, objDefinition, _reference_1.ReferenceType.ObjectOrientedReference, input.filename);
26801
+ input.scope.addReference(typeToken, objDefinition, _reference_1.ReferenceType.ConstructorReference, input.filename);
26792
26802
  const objref = new basic_1.ObjectReferenceType(objDefinition);
26793
26803
  const clas = input.scope.findClassDefinition(objref.getIdentifierName());
26794
26804
  if ((clas === null || clas === void 0 ? void 0 : clas.isAbstract()) === true) {
@@ -30214,6 +30224,7 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
30214
30224
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
30215
30225
  class CreateObject {
30216
30226
  runSyntax(node, input) {
30227
+ var _a;
30217
30228
  let cdef = undefined;
30218
30229
  // CREATE OBJECT, TYPE
30219
30230
  const type = node.findExpressionAfterToken("TYPE");
@@ -30223,6 +30234,7 @@ class CreateObject {
30223
30234
  cdef = input.scope.findClassDefinition(name);
30224
30235
  if (cdef) {
30225
30236
  input.scope.addReference(token, cdef, _reference_1.ReferenceType.ObjectOrientedReference, input.filename);
30237
+ input.scope.addReference(token, cdef, _reference_1.ReferenceType.ConstructorReference, input.filename);
30226
30238
  if (cdef.isAbstract() === true) {
30227
30239
  const message = cdef.getName() + " is abstract, cannot be instantiated";
30228
30240
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
@@ -30242,60 +30254,61 @@ class CreateObject {
30242
30254
  for (const s of node.findDirectExpressions(Expressions.Source)) {
30243
30255
  new source_1.Source().runSyntax(s, input);
30244
30256
  }
30245
- let first = true;
30246
- for (const t of node.findAllExpressions(Expressions.Target)) {
30257
+ for (const t of ((_a = node.findDirectExpression(Expressions.ParameterListExceptions)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Target)) || []) {
30258
+ new target_1.Target().runSyntax(t, input);
30259
+ }
30260
+ const t = node.findDirectExpression(Expressions.Target);
30261
+ if (t) {
30247
30262
  const found = new target_1.Target().runSyntax(t, input);
30248
- if (first === true) {
30249
- first = false;
30250
- if (found instanceof basic_1.VoidType) {
30251
- continue;
30252
- }
30253
- else if (found instanceof basic_1.UnknownType) {
30254
- const message = "Target type unknown, " + t.concatTokens();
30263
+ if (found instanceof basic_1.VoidType) {
30264
+ // do nothing
30265
+ }
30266
+ else if (found instanceof basic_1.UnknownType) {
30267
+ const message = "Target type unknown, " + t.concatTokens();
30268
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30269
+ return;
30270
+ }
30271
+ else if (!(found instanceof basic_1.ObjectReferenceType)
30272
+ && !(found instanceof basic_1.AnyType)
30273
+ && !(found instanceof basic_1.DataType)
30274
+ && !(found instanceof basic_1.GenericObjectReferenceType)) {
30275
+ const message = "Target must be an object reference, " + t.concatTokens();
30276
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30277
+ return;
30278
+ }
30279
+ else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {
30280
+ const message = "Generic type, cannot be instantiated";
30281
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30282
+ return;
30283
+ }
30284
+ else if (found instanceof basic_1.ObjectReferenceType) {
30285
+ const id = found.getIdentifier();
30286
+ if (id instanceof types_1.InterfaceDefinition && type === undefined) {
30287
+ const message = "Interface reference, cannot be instantiated";
30255
30288
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30256
30289
  return;
30257
30290
  }
30258
- else if (!(found instanceof basic_1.ObjectReferenceType)
30259
- && !(found instanceof basic_1.AnyType)
30260
- && !(found instanceof basic_1.DataType)
30261
- && !(found instanceof basic_1.GenericObjectReferenceType)) {
30262
- const message = "Target must be an object reference, " + t.concatTokens();
30291
+ else if (found instanceof basic_1.ObjectReferenceType
30292
+ && type === undefined
30293
+ && input.scope.findInterfaceDefinition(found.getQualifiedName())) {
30294
+ const message = "Interface reference, cannot be instantiated";
30263
30295
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30264
30296
  return;
30265
30297
  }
30266
- else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {
30267
- const message = "Generic type, cannot be instantiated";
30298
+ else if (id instanceof types_1.ClassDefinition && cdef === undefined) {
30299
+ cdef = id;
30300
+ }
30301
+ if (type === undefined && id instanceof types_1.ClassDefinition && id.isAbstract() === true) {
30302
+ const message = id.getName() + " is abstract, cannot be instantiated";
30268
30303
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30269
30304
  return;
30270
30305
  }
30271
- else if (found instanceof basic_1.ObjectReferenceType) {
30272
- const id = found.getIdentifier();
30273
- if (id instanceof types_1.InterfaceDefinition && type === undefined) {
30274
- const message = "Interface reference, cannot be instantiated";
30275
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30276
- return;
30277
- }
30278
- else if (found instanceof basic_1.ObjectReferenceType
30279
- && type === undefined
30280
- && input.scope.findInterfaceDefinition(found.getQualifiedName())) {
30281
- const message = "Interface reference, cannot be instantiated";
30282
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30283
- return;
30284
- }
30285
- else if (id instanceof types_1.ClassDefinition && cdef === undefined) {
30286
- cdef = id;
30287
- }
30288
- if (type === undefined && id instanceof types_1.ClassDefinition && id.isAbstract() === true) {
30289
- const message = id.getName() + " is abstract, cannot be instantiated";
30290
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30291
- return;
30292
- }
30293
- }
30294
30306
  }
30295
30307
  }
30296
30308
  for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
30297
30309
  new dynamic_1.Dynamic().runSyntax(t, input);
30298
30310
  }
30311
+ input.scope.addReference(t === null || t === void 0 ? void 0 : t.getFirstToken(), cdef, _reference_1.ReferenceType.ConstructorReference, input.filename);
30299
30312
  this.validateParameters(cdef, node, input);
30300
30313
  }
30301
30314
  validateParameters(cdef, node, input) {
@@ -35390,13 +35403,13 @@ class FlowGraph {
35390
35403
  this.label = label;
35391
35404
  }
35392
35405
  toDigraph() {
35393
- return `digraph G {
35394
- labelloc="t";
35395
- label="${this.label}";
35396
- graph [fontname = "helvetica"];
35397
- node [fontname = "helvetica", shape="box"];
35398
- edge [fontname = "helvetica"];
35399
- ${this.toTextEdges()}
35406
+ return `digraph G {
35407
+ labelloc="t";
35408
+ label="${this.label}";
35409
+ graph [fontname = "helvetica"];
35410
+ node [fontname = "helvetica", shape="box"];
35411
+ edge [fontname = "helvetica"];
35412
+ ${this.toTextEdges()}
35400
35413
  }`;
35401
35414
  }
35402
35415
  listSources(node) {
@@ -43816,13 +43829,13 @@ class Help {
43816
43829
  /////////////////////////////////////////////////
43817
43830
  static dumpABAP(file, reg, textDocument, position) {
43818
43831
  let content = "";
43819
- content = `
43820
- <a href="#_tokens" rel="no-refresh">Tokens</a> |
43821
- <a href="#_statements" rel="no-refresh">Statements</a> |
43822
- <a href="#_structure" rel="no-refresh">Structure</a> |
43823
- <a href="#_files" rel="no-refresh">Files</a> |
43824
- <a href="#_info" rel="no-refresh">Info Dump</a>
43825
- <hr>
43832
+ content = `
43833
+ <a href="#_tokens" rel="no-refresh">Tokens</a> |
43834
+ <a href="#_statements" rel="no-refresh">Statements</a> |
43835
+ <a href="#_structure" rel="no-refresh">Structure</a> |
43836
+ <a href="#_files" rel="no-refresh">Files</a> |
43837
+ <a href="#_info" rel="no-refresh">Info Dump</a>
43838
+ <hr>
43826
43839
  ` +
43827
43840
  "<tt>" + textDocument.uri + " (" +
43828
43841
  (position.line + 1) + ", " +
@@ -43977,9 +43990,9 @@ class Help {
43977
43990
  return ret + "</ul>";
43978
43991
  }
43979
43992
  static tokens(file) {
43980
- let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
43981
- <td><b>Row</b></td><td><b>Column</b></td>
43982
- <td><b>vRow</b></td><td><b>vColumn</b></td>
43993
+ let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
43994
+ <td><b>Row</b></td><td><b>Column</b></td>
43995
+ <td><b>vRow</b></td><td><b>vColumn</b></td>
43983
43996
  </tr>`;
43984
43997
  for (const token of file.getTokens()) {
43985
43998
  const tStart = token.getStart();
@@ -51139,6 +51152,9 @@ class RenamerHelper {
51139
51152
  let ret = [];
51140
51153
  if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {
51141
51154
  for (const r of node.getData().references) {
51155
+ if (r.referenceType === __1.ReferenceType.ConstructorReference) {
51156
+ continue;
51157
+ }
51142
51158
  if (((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.equals(identifier))
51143
51159
  && r.referenceType !== __1.ReferenceType.InferredType
51144
51160
  && !(r.position.getStart() instanceof virtual_position_1.VirtualPosition)) {
@@ -53234,7 +53250,7 @@ class Registry {
53234
53250
  }
53235
53251
  static abaplintVersion() {
53236
53252
  // magic, see build script "version.sh"
53237
- return "2.113.67";
53253
+ return "2.113.69";
53238
53254
  }
53239
53255
  getDDICReferences() {
53240
53256
  return this.ddicReferences;
@@ -53553,10 +53569,10 @@ class SevenBitAscii {
53553
53569
  key: "7bit_ascii",
53554
53570
  title: "Check for 7bit ascii",
53555
53571
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
53556
- extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53557
-
53558
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53559
-
53572
+ extendedInformation: `https://docs.abapopenchecks.org/checks/05/
53573
+
53574
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
53575
+
53560
53576
  Checkes files with extensions ".abap" and ".asddls"`,
53561
53577
  tags: [_irule_1.RuleTag.SingleFile],
53562
53578
  badExample: `WRITE '뽑'.`,
@@ -53762,10 +53778,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
53762
53778
  key: "abapdoc",
53763
53779
  title: "Check abapdoc",
53764
53780
  shortDescription: `Various checks regarding abapdoc.`,
53765
- extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53766
-
53767
- Plus class and interface definitions.
53768
-
53781
+ extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
53782
+
53783
+ Plus class and interface definitions.
53784
+
53769
53785
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
53770
53786
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
53771
53787
  };
@@ -53902,27 +53918,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
53902
53918
  title: "Add test attributes for tests classes with test methods",
53903
53919
  shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
53904
53920
  tags: [_irule_1.RuleTag.SingleFile],
53905
- badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53906
- PUBLIC SECTION.
53907
- PROTECTED SECTION.
53908
- PRIVATE SECTION.
53909
- METHODS test FOR TESTING RAISING cx_static_check.
53910
- ENDCLASS.
53911
-
53912
- CLASS ltcl_test1 IMPLEMENTATION.
53913
- METHOD test.
53914
- ENDMETHOD.
53921
+ badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
53922
+ PUBLIC SECTION.
53923
+ PROTECTED SECTION.
53924
+ PRIVATE SECTION.
53925
+ METHODS test FOR TESTING RAISING cx_static_check.
53926
+ ENDCLASS.
53927
+
53928
+ CLASS ltcl_test1 IMPLEMENTATION.
53929
+ METHOD test.
53930
+ ENDMETHOD.
53915
53931
  ENDCLASS.`,
53916
- goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53917
- PUBLIC SECTION.
53918
- PROTECTED SECTION.
53919
- PRIVATE SECTION.
53920
- METHODS test FOR TESTING RAISING cx_static_check.
53921
- ENDCLASS.
53922
-
53923
- CLASS ltcl_test2 IMPLEMENTATION.
53924
- METHOD test.
53925
- ENDMETHOD.
53932
+ goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
53933
+ PUBLIC SECTION.
53934
+ PROTECTED SECTION.
53935
+ PRIVATE SECTION.
53936
+ METHODS test FOR TESTING RAISING cx_static_check.
53937
+ ENDCLASS.
53938
+
53939
+ CLASS ltcl_test2 IMPLEMENTATION.
53940
+ METHOD test.
53941
+ ENDMETHOD.
53926
53942
  ENDCLASS.`,
53927
53943
  };
53928
53944
  }
@@ -54008,49 +54024,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
54008
54024
  key: "align_parameters",
54009
54025
  title: "Align Parameters",
54010
54026
  shortDescription: `Checks for vertially aligned parameters`,
54011
- extendedInformation: `Checks:
54012
- * function module calls
54013
- * method calls
54014
- * VALUE constructors
54015
- * NEW constructors
54016
- * RAISE EXCEPTION statements
54017
- * CREATE OBJECT statements
54018
- * RAISE EVENT statements
54019
-
54020
- https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
54021
-
54022
- Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
54023
-
54024
- If parameters are on the same row, no issues are reported, see
54027
+ extendedInformation: `Checks:
54028
+ * function module calls
54029
+ * method calls
54030
+ * VALUE constructors
54031
+ * NEW constructors
54032
+ * RAISE EXCEPTION statements
54033
+ * CREATE OBJECT statements
54034
+ * RAISE EVENT statements
54035
+
54036
+ https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
54037
+
54038
+ Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
54039
+
54040
+ If parameters are on the same row, no issues are reported, see
54025
54041
  https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
54026
54042
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
54027
- badExample: `CALL FUNCTION 'FOOBAR'
54028
- EXPORTING
54029
- foo = 2
54030
- parameter = 3.
54031
-
54032
- foobar( moo = 1
54033
- param = 1 ).
54034
-
54035
- foo = VALUE #(
54036
- foo = bar
54043
+ badExample: `CALL FUNCTION 'FOOBAR'
54044
+ EXPORTING
54045
+ foo = 2
54046
+ parameter = 3.
54047
+
54048
+ foobar( moo = 1
54049
+ param = 1 ).
54050
+
54051
+ foo = VALUE #(
54052
+ foo = bar
54037
54053
  moo = 2 ).`,
54038
- goodExample: `CALL FUNCTION 'FOOBAR'
54039
- EXPORTING
54040
- foo = 2
54041
- parameter = 3.
54042
-
54043
- foobar( moo = 1
54044
- param = 1 ).
54045
-
54046
- foo = VALUE #(
54047
- foo = bar
54048
- moo = 2 ).
54049
-
54050
- DATA(sdf) = VALUE type(
54051
- common_val = 2
54052
- another_common = 5
54053
- ( row_value = 4
54054
+ goodExample: `CALL FUNCTION 'FOOBAR'
54055
+ EXPORTING
54056
+ foo = 2
54057
+ parameter = 3.
54058
+
54059
+ foobar( moo = 1
54060
+ param = 1 ).
54061
+
54062
+ foo = VALUE #(
54063
+ foo = bar
54064
+ moo = 2 ).
54065
+
54066
+ DATA(sdf) = VALUE type(
54067
+ common_val = 2
54068
+ another_common = 5
54069
+ ( row_value = 4
54054
54070
  value_foo = 5 ) ).`,
54055
54071
  };
54056
54072
  }
@@ -54484,37 +54500,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
54484
54500
  key: "align_type_expressions",
54485
54501
  title: "Align TYPE expressions",
54486
54502
  shortDescription: `Align TYPE expressions in statements`,
54487
- extendedInformation: `
54488
- Currently works for METHODS + BEGIN OF
54489
-
54490
- If BEGIN OF has an INCLUDE TYPE its ignored
54491
-
54492
- Also note that clean ABAP does not recommend aligning TYPE clauses:
54503
+ extendedInformation: `
54504
+ Currently works for METHODS + BEGIN OF
54505
+
54506
+ If BEGIN OF has an INCLUDE TYPE its ignored
54507
+
54508
+ Also note that clean ABAP does not recommend aligning TYPE clauses:
54493
54509
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
54494
54510
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
54495
- badExample: `
54496
- TYPES: BEGIN OF foo,
54497
- bar TYPE i,
54498
- foobar TYPE i,
54499
- END OF foo.
54500
-
54501
- INTERFACE lif.
54502
- METHODS bar
54503
- IMPORTING
54504
- foo TYPE i
54505
- foobar TYPE i.
54511
+ badExample: `
54512
+ TYPES: BEGIN OF foo,
54513
+ bar TYPE i,
54514
+ foobar TYPE i,
54515
+ END OF foo.
54516
+
54517
+ INTERFACE lif.
54518
+ METHODS bar
54519
+ IMPORTING
54520
+ foo TYPE i
54521
+ foobar TYPE i.
54506
54522
  ENDINTERFACE.`,
54507
- goodExample: `
54508
- TYPES: BEGIN OF foo,
54509
- bar TYPE i,
54510
- foobar TYPE i,
54511
- END OF foo.
54512
-
54513
- INTERFACE lif.
54514
- METHODS bar
54515
- IMPORTING
54516
- foo TYPE i
54517
- foobar TYPE i.
54523
+ goodExample: `
54524
+ TYPES: BEGIN OF foo,
54525
+ bar TYPE i,
54526
+ foobar TYPE i,
54527
+ END OF foo.
54528
+
54529
+ INTERFACE lif.
54530
+ METHODS bar
54531
+ IMPORTING
54532
+ foo TYPE i
54533
+ foobar TYPE i.
54518
54534
  ENDINTERFACE.`,
54519
54535
  };
54520
54536
  }
@@ -54793,16 +54809,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
54793
54809
  return {
54794
54810
  key: "ambiguous_statement",
54795
54811
  title: "Check for ambigious statements",
54796
- shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54797
- Add "TABLE" keyword or "@" for escaping SQL variables
54798
-
54812
+ shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
54813
+ Add "TABLE" keyword or "@" for escaping SQL variables
54814
+
54799
54815
  Only works if the target version is 740sp05 or above`,
54800
54816
  tags: [_irule_1.RuleTag.SingleFile],
54801
- badExample: `DELETE foo FROM bar.
54817
+ badExample: `DELETE foo FROM bar.
54802
54818
  MODIFY foo FROM bar.`,
54803
- goodExample: `DELETE foo FROM @bar.
54804
- DELETE TABLE itab FROM 2.
54805
- MODIFY zfoo FROM @wa.
54819
+ goodExample: `DELETE foo FROM @bar.
54820
+ DELETE TABLE itab FROM 2.
54821
+ MODIFY zfoo FROM @wa.
54806
54822
  MODIFY TABLE foo FROM bar.`,
54807
54823
  };
54808
54824
  }
@@ -54907,16 +54923,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
54907
54923
  key: "avoid_use",
54908
54924
  title: "Avoid use of certain statements",
54909
54925
  shortDescription: `Detects usage of certain statements.`,
54910
- extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54911
-
54912
- Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54913
-
54914
- STATICS: use CLASS-DATA instead
54915
-
54916
- DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54917
-
54918
- TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54919
-
54926
+ extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
54927
+
54928
+ Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
54929
+
54930
+ STATICS: use CLASS-DATA instead
54931
+
54932
+ DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
54933
+
54934
+ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
54935
+
54920
54936
  BREAK points`,
54921
54937
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
54922
54938
  };
@@ -55048,11 +55064,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
55048
55064
  title: "Check BEGIN END names",
55049
55065
  shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
55050
55066
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
55051
- badExample: `DATA: BEGIN OF stru,
55052
- field TYPE i,
55067
+ badExample: `DATA: BEGIN OF stru,
55068
+ field TYPE i,
55053
55069
  END OF structure_not_the_same.`,
55054
- goodExample: `DATA: BEGIN OF stru,
55055
- field TYPE i,
55070
+ goodExample: `DATA: BEGIN OF stru,
55071
+ field TYPE i,
55056
55072
  END OF stru.`,
55057
55073
  };
55058
55074
  }
@@ -55149,20 +55165,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
55149
55165
  title: "BEGIN contains single INCLUDE",
55150
55166
  shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
55151
55167
  tags: [_irule_1.RuleTag.SingleFile],
55152
- badExample: `TYPES: BEGIN OF dummy1.
55153
- INCLUDE TYPE dselc.
55154
- TYPES: END OF dummy1.
55155
-
55156
- DATA BEGIN OF foo.
55157
- INCLUDE STRUCTURE syst.
55158
- DATA END OF foo.
55159
-
55160
- STATICS BEGIN OF bar.
55161
- INCLUDE STRUCTURE syst.
55168
+ badExample: `TYPES: BEGIN OF dummy1.
55169
+ INCLUDE TYPE dselc.
55170
+ TYPES: END OF dummy1.
55171
+
55172
+ DATA BEGIN OF foo.
55173
+ INCLUDE STRUCTURE syst.
55174
+ DATA END OF foo.
55175
+
55176
+ STATICS BEGIN OF bar.
55177
+ INCLUDE STRUCTURE syst.
55162
55178
  STATICS END OF bar.`,
55163
- goodExample: `DATA BEGIN OF foo.
55164
- DATA field TYPE i.
55165
- INCLUDE STRUCTURE dselc.
55179
+ goodExample: `DATA BEGIN OF foo.
55180
+ DATA field TYPE i.
55181
+ INCLUDE STRUCTURE dselc.
55166
55182
  DATA END OF foo.`,
55167
55183
  };
55168
55184
  }
@@ -55252,9 +55268,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
55252
55268
  extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
55253
55269
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
55254
55270
  badExample: `CALL TRANSACTION 'FOO'.`,
55255
- goodExample: `TRY.
55256
- CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55257
- CATCH cx_sy_authorization_error.
55271
+ goodExample: `TRY.
55272
+ CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
55273
+ CATCH cx_sy_authorization_error.
55258
55274
  ENDTRY.`,
55259
55275
  };
55260
55276
  }
@@ -55319,10 +55335,10 @@ class CDSCommentStyle {
55319
55335
  key: "cds_comment_style",
55320
55336
  title: "CDS Comment Style",
55321
55337
  shortDescription: `Check for obsolete comment style`,
55322
- extendedInformation: `Check for obsolete comment style
55323
-
55324
- Comments starting with "--" are considered obsolete
55325
-
55338
+ extendedInformation: `Check for obsolete comment style
55339
+
55340
+ Comments starting with "--" are considered obsolete
55341
+
55326
55342
  https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
55327
55343
  tags: [_irule_1.RuleTag.SingleFile],
55328
55344
  badExample: "-- this is a comment",
@@ -55388,10 +55404,10 @@ class CDSLegacyView {
55388
55404
  key: "cds_legacy_view",
55389
55405
  title: "CDS Legacy View",
55390
55406
  shortDescription: `Identify CDS Legacy Views`,
55391
- extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55392
-
55393
- https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55394
-
55407
+ extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
55408
+
55409
+ https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
55410
+
55395
55411
  v755 and up`,
55396
55412
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
55397
55413
  };
@@ -55546,10 +55562,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
55546
55562
  key: "chain_mainly_declarations",
55547
55563
  title: "Chain mainly declarations",
55548
55564
  shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
55549
- extendedInformation: `
55550
- https://docs.abapopenchecks.org/checks/23/
55551
-
55552
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55565
+ extendedInformation: `
55566
+ https://docs.abapopenchecks.org/checks/23/
55567
+
55568
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
55553
55569
  `,
55554
55570
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
55555
55571
  badExample: `CALL METHOD: bar.`,
@@ -55725,17 +55741,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
55725
55741
  title: "Change IF to CASE",
55726
55742
  shortDescription: `Finds IF constructs that can be changed to CASE`,
55727
55743
  // eslint-disable-next-line max-len
55728
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55729
-
55744
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
55745
+
55730
55746
  If the first comparison is a boolean compare, no issue is reported.`,
55731
55747
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
55732
- badExample: `IF l_fcat-fieldname EQ 'FOO'.
55733
- ELSEIF l_fcat-fieldname = 'BAR'
55734
- OR l_fcat-fieldname = 'MOO'.
55748
+ badExample: `IF l_fcat-fieldname EQ 'FOO'.
55749
+ ELSEIF l_fcat-fieldname = 'BAR'
55750
+ OR l_fcat-fieldname = 'MOO'.
55735
55751
  ENDIF.`,
55736
- goodExample: `CASE l_fcat-fieldname.
55737
- WHEN 'FOO'.
55738
- WHEN 'BAR' OR 'MOO'.
55752
+ goodExample: `CASE l_fcat-fieldname.
55753
+ WHEN 'FOO'.
55754
+ WHEN 'BAR' OR 'MOO'.
55739
55755
  ENDCASE.`,
55740
55756
  };
55741
55757
  }
@@ -55872,8 +55888,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
55872
55888
  return {
55873
55889
  key: "check_abstract",
55874
55890
  title: "Check abstract methods and classes",
55875
- shortDescription: `Checks abstract methods and classes:
55876
- - class defined as abstract and final,
55891
+ shortDescription: `Checks abstract methods and classes:
55892
+ - class defined as abstract and final,
55877
55893
  - non-abstract class contains abstract methods`,
55878
55894
  extendedInformation: `If a class defines only constants, use an interface instead`,
55879
55895
  tags: [_irule_1.RuleTag.SingleFile],
@@ -55954,11 +55970,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
55954
55970
  return {
55955
55971
  key: "check_comments",
55956
55972
  title: "Check Comments",
55957
- shortDescription: `
55973
+ shortDescription: `
55958
55974
  Various checks for comment usage.`,
55959
- extendedInformation: `
55960
- Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55961
-
55975
+ extendedInformation: `
55976
+ Detects end of line comments. Comments starting with "#EC" or "##" are ignored
55977
+
55962
55978
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
55963
55979
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
55964
55980
  badExample: `WRITE 2. " descriptive comment`,
@@ -56120,9 +56136,9 @@ class CheckInclude {
56120
56136
  key: "check_include",
56121
56137
  title: "Check INCLUDEs",
56122
56138
  shortDescription: `Checks INCLUDE statements`,
56123
- extendedInformation: `
56124
- * Reports unused includes
56125
- * Errors if the includes are not found
56139
+ extendedInformation: `
56140
+ * Reports unused includes
56141
+ * Errors if the includes are not found
56126
56142
  * Error if including a main program`,
56127
56143
  tags: [_irule_1.RuleTag.Syntax],
56128
56144
  };
@@ -56198,14 +56214,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
56198
56214
  key: "check_subrc",
56199
56215
  title: "Check sy-subrc",
56200
56216
  shortDescription: `Check sy-subrc`,
56201
- extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56202
-
56203
- If sy-dbcnt is checked after database statements, it is considered okay.
56204
-
56205
- "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56206
-
56207
- If IS ASSIGNED is checked after assigning, it is considered okay.
56208
-
56217
+ extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
56218
+
56219
+ If sy-dbcnt is checked after database statements, it is considered okay.
56220
+
56221
+ "SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
56222
+
56223
+ If IS ASSIGNED is checked after assigning, it is considered okay.
56224
+
56209
56225
  FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
56210
56226
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
56211
56227
  pseudoComment: "EC CI_SUBRC",
@@ -56775,17 +56791,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
56775
56791
  shortDescription: `Find overlapping classic exceptions`,
56776
56792
  extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
56777
56793
  tags: [_irule_1.RuleTag.SingleFile],
56778
- badExample: `CALL FUNCTION 'SOMETHING'
56779
- EXCEPTIONS
56780
- system_failure = 1 MESSAGE lv_message
56781
- communication_failure = 1 MESSAGE lv_message
56782
- resource_failure = 1
56794
+ badExample: `CALL FUNCTION 'SOMETHING'
56795
+ EXCEPTIONS
56796
+ system_failure = 1 MESSAGE lv_message
56797
+ communication_failure = 1 MESSAGE lv_message
56798
+ resource_failure = 1
56783
56799
  OTHERS = 1.`,
56784
- goodExample: `CALL FUNCTION 'SOMETHING'
56785
- EXCEPTIONS
56786
- system_failure = 1 MESSAGE lv_message
56787
- communication_failure = 2 MESSAGE lv_message
56788
- resource_failure = 3
56800
+ goodExample: `CALL FUNCTION 'SOMETHING'
56801
+ EXCEPTIONS
56802
+ system_failure = 1 MESSAGE lv_message
56803
+ communication_failure = 2 MESSAGE lv_message
56804
+ resource_failure = 3
56789
56805
  OTHERS = 4.`,
56790
56806
  };
56791
56807
  }
@@ -56941,6 +56957,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
56941
56957
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
56942
56958
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
56943
56959
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
56960
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
56944
56961
  class ColonMissingSpaceConf extends _basic_rule_config_1.BasicRuleConfig {
56945
56962
  }
56946
56963
  exports.ColonMissingSpaceConf = ColonMissingSpaceConf;
@@ -56970,18 +56987,29 @@ class ColonMissingSpace extends _abap_rule_1.ABAPRule {
56970
56987
  }
56971
56988
  runParsed(file) {
56972
56989
  const issues = [];
56973
- const tokens = file.getTokens();
56974
- for (let i = 0; i < tokens.length; i++) {
56975
- const token = tokens[i];
56976
- if (token.getStr() === ":"
56977
- && tokens[i + 1] !== undefined
56978
- && tokens[i + 1].getRow() === token.getRow()
56979
- && tokens[i + 1].getCol() === token.getCol() + 1) {
56980
- const start = token.getStart();
56981
- const end = new position_1.Position(start.getRow(), start.getCol() + 1);
56982
- const fix = edit_helper_1.EditHelper.insertAt(file, end, " ");
56983
- const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
56984
- issues.push(issue);
56990
+ for (const statement of file.getStatements()) {
56991
+ const colon = statement.getColon();
56992
+ if (colon === undefined
56993
+ || statement.get() instanceof _statement_1.NativeSQL
56994
+ || statement.get() instanceof _statement_1.Comment) {
56995
+ continue;
56996
+ }
56997
+ // todo: this can be more smart, performance wise
56998
+ const tokens = [...statement.getTokens()];
56999
+ tokens.push(colon);
57000
+ tokens.sort((a, b) => a.getStart().isAfter(b.getStart()) ? 1 : -1);
57001
+ for (let i = 0; i < tokens.length; i++) {
57002
+ const token = tokens[i];
57003
+ if (token.getStr() === ":"
57004
+ && tokens[i + 1] !== undefined
57005
+ && tokens[i + 1].getRow() === token.getRow()
57006
+ && tokens[i + 1].getCol() === token.getCol() + 1) {
57007
+ const start = token.getStart();
57008
+ const end = new position_1.Position(start.getRow(), start.getCol() + 1);
57009
+ const fix = edit_helper_1.EditHelper.insertAt(file, end, " ");
57010
+ const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
57011
+ issues.push(issue);
57012
+ }
56985
57013
  }
56986
57014
  }
56987
57015
  return issues;
@@ -57031,7 +57059,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
57031
57059
  key: "commented_code",
57032
57060
  title: "Find commented code",
57033
57061
  shortDescription: `Detects usage of commented out code.`,
57034
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
57062
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
57035
57063
  https://docs.abapopenchecks.org/checks/14/`,
57036
57064
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
57037
57065
  badExample: `* WRITE 'hello world'.`,
@@ -57264,10 +57292,10 @@ class ConstructorVisibilityPublic {
57264
57292
  key: "constructor_visibility_public",
57265
57293
  title: "Check constructor visibility is public",
57266
57294
  shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
57267
- extendedInformation: `
57268
- This only applies to global classes.
57269
-
57270
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57295
+ extendedInformation: `
57296
+ This only applies to global classes.
57297
+
57298
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
57271
57299
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
57272
57300
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57273
57301
  };
@@ -57342,8 +57370,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
57342
57370
  key: "contains_tab",
57343
57371
  title: "Code contains tab",
57344
57372
  shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
57345
- extendedInformation: `
57346
- https://docs.abapopenchecks.org/checks/09/
57373
+ extendedInformation: `
57374
+ https://docs.abapopenchecks.org/checks/09/
57347
57375
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
57348
57376
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57349
57377
  badExample: `\tWRITE 'hello world'.`,
@@ -57430,10 +57458,10 @@ class CyclicOO {
57430
57458
  key: "cyclic_oo",
57431
57459
  title: "Cyclic OO",
57432
57460
  shortDescription: `Finds cyclic/circular OO references`,
57433
- extendedInformation: `Runs for global INTF + CLAS objects
57434
-
57435
- Objects must be without syntax errors for this rule to take effect
57436
-
57461
+ extendedInformation: `Runs for global INTF + CLAS objects
57462
+
57463
+ Objects must be without syntax errors for this rule to take effect
57464
+
57437
57465
  References in testclass includes are ignored`,
57438
57466
  };
57439
57467
  }
@@ -57676,7 +57704,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
57676
57704
  key: "dangerous_statement",
57677
57705
  title: "Dangerous statement",
57678
57706
  shortDescription: `Detects potentially dangerous statements`,
57679
- extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57707
+ extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
57680
57708
  dynamic SQL can potentially create SQL injection problems`,
57681
57709
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
57682
57710
  };
@@ -57883,13 +57911,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
57883
57911
  shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
57884
57912
  extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
57885
57913
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
57886
- badExample: `FROM foo.
57887
- WRITE 'hello'.
57888
- DATA int TYPE i.
57914
+ badExample: `FROM foo.
57915
+ WRITE 'hello'.
57916
+ DATA int TYPE i.
57889
57917
  ENDFORM.`,
57890
- goodExample: `FROM foo.
57891
- DATA int TYPE i.
57892
- WRITE 'hello'.
57918
+ goodExample: `FROM foo.
57919
+ DATA int TYPE i.
57920
+ WRITE 'hello'.
57893
57921
  ENDFORM.`,
57894
57922
  };
57895
57923
  }
@@ -58164,6 +58192,9 @@ class DoubleSpace extends _abap_rule_1.ABAPRule {
58164
58192
  runParsed(file) {
58165
58193
  let issues = [];
58166
58194
  for (const s of file.getStatements()) {
58195
+ if (s.get() instanceof _statement_1.NativeSQL) {
58196
+ continue;
58197
+ }
58167
58198
  if (this.conf.keywords === true
58168
58199
  && !(s.get() instanceof _statement_1.Unknown)
58169
58200
  && !(s.get() instanceof statements_1.MethodDef)
@@ -58428,39 +58459,39 @@ class Downport {
58428
58459
  key: "downport",
58429
58460
  title: "Downport statement",
58430
58461
  shortDescription: `Downport functionality`,
58431
- extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58432
- a higher level language version. If successful, various rules are applied to downport the statement.
58433
- Target downport version is always v702, thus rule is only enabled if target version is v702.
58434
-
58435
- Current rules:
58436
- * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58437
- * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58438
- * FIELD-SYMBOL() definitions are outlined
58439
- * CONV is outlined
58440
- * COND is outlined
58441
- * REDUCE is outlined
58442
- * SWITCH is outlined
58443
- * FILTER is outlined
58444
- * APPEND expression is outlined
58445
- * INSERT expression is outlined
58446
- * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58447
- * CAST changed to ?=
58448
- * LOOP AT method_call( ) is outlined
58449
- * VALUE # with structure fields
58450
- * VALUE # with internal table lines
58451
- * Table Expressions are outlined
58452
- * SELECT INTO @DATA definitions are outlined
58453
- * Some occurrences of string template formatting option ALPHA changed to function module call
58454
- * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58455
- * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58456
- * RAISE EXCEPTION ... MESSAGE
58457
- * Moving with +=, -=, /=, *=, &&= is expanded
58458
- * line_exists and line_index is downported to READ TABLE
58459
- * ENUMs, but does not nessesarily give the correct type and value
58460
- * MESSAGE with non simple source
58461
-
58462
- Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58463
-
58462
+ extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
58463
+ a higher level language version. If successful, various rules are applied to downport the statement.
58464
+ Target downport version is always v702, thus rule is only enabled if target version is v702.
58465
+
58466
+ Current rules:
58467
+ * NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
58468
+ * DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
58469
+ * FIELD-SYMBOL() definitions are outlined
58470
+ * CONV is outlined
58471
+ * COND is outlined
58472
+ * REDUCE is outlined
58473
+ * SWITCH is outlined
58474
+ * FILTER is outlined
58475
+ * APPEND expression is outlined
58476
+ * INSERT expression is outlined
58477
+ * EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
58478
+ * CAST changed to ?=
58479
+ * LOOP AT method_call( ) is outlined
58480
+ * VALUE # with structure fields
58481
+ * VALUE # with internal table lines
58482
+ * Table Expressions are outlined
58483
+ * SELECT INTO @DATA definitions are outlined
58484
+ * Some occurrences of string template formatting option ALPHA changed to function module call
58485
+ * SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
58486
+ * PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
58487
+ * RAISE EXCEPTION ... MESSAGE
58488
+ * Moving with +=, -=, /=, *=, &&= is expanded
58489
+ * line_exists and line_index is downported to READ TABLE
58490
+ * ENUMs, but does not nessesarily give the correct type and value
58491
+ * MESSAGE with non simple source
58492
+
58493
+ Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
58494
+
58464
58495
  Make sure to test the downported code, it might not always be completely correct.`,
58465
58496
  tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
58466
58497
  };
@@ -59038,10 +59069,10 @@ Make sure to test the downported code, it might not always be completely correct
59038
59069
  const fieldName = f.concatTokens();
59039
59070
  fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
59040
59071
  }
59041
- fieldDefinition = `DATA: BEGIN OF ${name},
59072
+ fieldDefinition = `DATA: BEGIN OF ${name},
59042
59073
  ${fieldDefinition}${indentation} END OF ${name}.`;
59043
59074
  }
59044
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
59075
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
59045
59076
  ${indentation}`);
59046
59077
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
59047
59078
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59100,12 +59131,12 @@ ${indentation}`);
59100
59131
  }
59101
59132
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59102
59133
  const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
59103
- let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
59104
- ${fieldDefinitions}${indentation} END OF ${uniqueName}.
59105
- ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
59134
+ let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
59135
+ ${fieldDefinitions}${indentation} END OF ${uniqueName}.
59136
+ ${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
59106
59137
  ${indentation}`);
59107
59138
  if (fieldDefinitions === "") {
59108
- fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
59139
+ fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
59109
59140
  ${indentation}`);
59110
59141
  }
59111
59142
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
@@ -59173,7 +59204,7 @@ ${indentation}`);
59173
59204
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59174
59205
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59175
59206
  const firstToken = high.getFirstToken();
59176
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59207
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59177
59208
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59178
59209
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59179
59210
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59227,7 +59258,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59227
59258
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59228
59259
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59229
59260
  const firstToken = high.getFirstToken();
59230
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59261
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
59231
59262
  ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59232
59263
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
59233
59264
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59269,14 +59300,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
59269
59300
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59270
59301
  const firstToken = high.getFirstToken();
59271
59302
  // note that the tabix restore should be done before throwing the exception
59272
- const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59273
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59274
- ${indentation}${tabixBackup} = sy-tabix.
59275
- ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59276
- ${indentation}sy-tabix = ${tabixBackup}.
59277
- ${indentation}IF sy-subrc <> 0.
59278
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59279
- ${indentation}ENDIF.
59303
+ const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
59304
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59305
+ ${indentation}${tabixBackup} = sy-tabix.
59306
+ ${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
59307
+ ${indentation}sy-tabix = ${tabixBackup}.
59308
+ ${indentation}IF sy-subrc <> 0.
59309
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59310
+ ${indentation}ENDIF.
59280
59311
  ${indentation}`);
59281
59312
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
59282
59313
  const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
@@ -59333,7 +59364,7 @@ ${indentation}`);
59333
59364
  const className = classNames[0].concatTokens();
59334
59365
  const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
59335
59366
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59336
- const code = ` DATA ${targetName} TYPE REF TO ${className}.
59367
+ const code = ` DATA ${targetName} TYPE REF TO ${className}.
59337
59368
  ${indentation}CATCH ${className} INTO ${targetName}.`;
59338
59369
  const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
59339
59370
  return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
@@ -59495,16 +59526,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
59495
59526
  const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59496
59527
  const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59497
59528
  const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
59498
- let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59499
- ${indentation}${uniqueName1}-msgid = ${id}.
59529
+ let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
59530
+ ${indentation}${uniqueName1}-msgid = ${id}.
59500
59531
  ${indentation}${uniqueName1}-msgno = ${number}.\n`;
59501
59532
  if (withs.length > 0) {
59502
- abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59503
- ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59504
- ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59533
+ abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
59534
+ ${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
59535
+ ${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
59505
59536
  ${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
59506
59537
  }
59507
- abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59538
+ abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
59508
59539
  ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
59509
59540
  if (withs.length > 0) {
59510
59541
  abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
@@ -59616,10 +59647,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
59616
59647
  let code = "";
59617
59648
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
59618
59649
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59619
- code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59620
- IF sy-subrc <> 0.
59621
- RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59622
- ENDIF.
59650
+ code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
59651
+ IF sy-subrc <> 0.
59652
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59653
+ ENDIF.
59623
59654
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59624
59655
  }
59625
59656
  else {
@@ -59708,20 +59739,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
59708
59739
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59709
59740
  const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59710
59741
  const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59711
- code += ` items LIKE ${loopSourceName},
59712
- END OF ${groupTargetName}type.
59713
- DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59714
- DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59742
+ code += ` items LIKE ${loopSourceName},
59743
+ END OF ${groupTargetName}type.
59744
+ DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
59745
+ DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
59715
59746
  LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
59716
59747
  if (groupIndexName !== undefined) {
59717
59748
  code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
59718
59749
  }
59719
- code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59750
+ code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
59720
59751
  IF sy-subrc = 0.\n`;
59721
59752
  if (groupCountName !== undefined) {
59722
59753
  code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
59723
59754
  }
59724
- code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59755
+ code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
59725
59756
  ELSE.\n`;
59726
59757
  code += ` CLEAR ${uniqueName}.\n`;
59727
59758
  for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
@@ -59742,8 +59773,8 @@ ELSE.\n`;
59742
59773
  }
59743
59774
  code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
59744
59775
  code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
59745
- code += `ENDIF.
59746
- ENDLOOP.
59776
+ code += `ENDIF.
59777
+ ENDLOOP.
59747
59778
  LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59748
59779
  let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
59749
59780
  for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
@@ -59915,7 +59946,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
59915
59946
  const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
59916
59947
  const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
59917
59948
  // all ENUMS are char like?
59918
- let code = `TYPES ${enumName} TYPE string.
59949
+ let code = `TYPES ${enumName} TYPE string.
59919
59950
  CONSTANTS: BEGIN OF ${structureName},\n`;
59920
59951
  let count = 1;
59921
59952
  for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
@@ -59959,14 +59990,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
59959
59990
  const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
59960
59991
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
59961
59992
  // restore tabix before exeption
59962
- const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59963
- ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59964
- ${indentation}${tabixBackup} = sy-tabix.
59965
- ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59966
- ${indentation}sy-tabix = ${tabixBackup}.
59967
- ${indentation}IF sy-subrc <> 0.
59968
- ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
59969
- ${indentation}ENDIF.
59993
+ const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
59994
+ ${indentation}DATA ${tabixBackup} LIKE sy-tabix.
59995
+ ${indentation}${tabixBackup} = sy-tabix.
59996
+ ${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
59997
+ ${indentation}sy-tabix = ${tabixBackup}.
59998
+ ${indentation}IF sy-subrc <> 0.
59999
+ ${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
60000
+ ${indentation}ENDIF.
59970
60001
  ${indentation}${uniqueName}`;
59971
60002
  const start = target.getFirstToken().getStart();
59972
60003
  const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
@@ -60046,11 +60077,11 @@ ${indentation}${uniqueName}`;
60046
60077
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
60047
60078
  const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
60048
60079
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
60049
- const code = `DATA ${uniqueName} TYPE string.
60050
- ${indentation}CALL FUNCTION '${functionName}'
60051
- ${indentation} EXPORTING
60052
- ${indentation} input = ${source}
60053
- ${indentation} IMPORTING
60080
+ const code = `DATA ${uniqueName} TYPE string.
60081
+ ${indentation}CALL FUNCTION '${functionName}'
60082
+ ${indentation} EXPORTING
60083
+ ${indentation} input = ${source}
60084
+ ${indentation} IMPORTING
60054
60085
  ${indentation} output = ${uniqueName}.\n`;
60055
60086
  const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
60056
60087
  const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
@@ -61362,12 +61393,12 @@ class EasyToFindMessages {
61362
61393
  key: "easy_to_find_messages",
61363
61394
  title: "Easy to find messages",
61364
61395
  shortDescription: `Make messages easy to find`,
61365
- extendedInformation: `All messages must be statically referenced exactly once
61366
-
61367
- Only MESSAGE and RAISE statments are counted as static references
61368
-
61369
- Also see rule "message_exists"
61370
-
61396
+ extendedInformation: `All messages must be statically referenced exactly once
61397
+
61398
+ Only MESSAGE and RAISE statments are counted as static references
61399
+
61400
+ Also see rule "message_exists"
61401
+
61371
61402
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
61372
61403
  tags: [_irule_1.RuleTag.Styleguide],
61373
61404
  };
@@ -61448,13 +61479,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
61448
61479
  shortDescription: `Empty selection screen or list processing event block`,
61449
61480
  extendedInformation: ``,
61450
61481
  tags: [_irule_1.RuleTag.SingleFile],
61451
- badExample: `
61452
- INITIALIZATION.
61453
- WRITE 'hello'.
61482
+ badExample: `
61483
+ INITIALIZATION.
61484
+ WRITE 'hello'.
61454
61485
  END-OF-SELECTION.`,
61455
- goodExample: `
61456
- START-OF-SELECTION.
61457
- PERFORM sdf.
61486
+ goodExample: `
61487
+ START-OF-SELECTION.
61488
+ PERFORM sdf.
61458
61489
  COMMIT WORK.`,
61459
61490
  };
61460
61491
  }
@@ -61546,8 +61577,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
61546
61577
  key: "empty_line_in_statement",
61547
61578
  title: "Find empty lines in statements",
61548
61579
  shortDescription: `Checks that statements do not contain empty lines.`,
61549
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61550
-
61580
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
61581
+
61551
61582
  https://docs.abapopenchecks.org/checks/41/`,
61552
61583
  tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
61553
61584
  badExample: `WRITE\n\nhello.`,
@@ -61723,13 +61754,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
61723
61754
  shortDescription: `Checks that the code does not contain empty blocks.`,
61724
61755
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
61725
61756
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
61726
- badExample: `IF foo = bar.
61727
- ENDIF.
61728
-
61729
- DO 2 TIMES.
61757
+ badExample: `IF foo = bar.
61758
+ ENDIF.
61759
+
61760
+ DO 2 TIMES.
61730
61761
  ENDDO.`,
61731
- goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61732
- ENDLOOP.
61762
+ goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
61763
+ ENDLOOP.
61733
61764
  result = xsdbool( sy-subrc = 0 ).`,
61734
61765
  };
61735
61766
  }
@@ -61871,10 +61902,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
61871
61902
  return {
61872
61903
  key: "exit_or_check",
61873
61904
  title: "Find EXIT or CHECK outside loops",
61874
- shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61905
+ shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
61875
61906
  Use RETURN to leave procesing blocks instead.`,
61876
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61877
- https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61907
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
61908
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
61878
61909
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
61879
61910
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
61880
61911
  };
@@ -61957,12 +61988,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
61957
61988
  key: "expand_macros",
61958
61989
  title: "Expand Macros",
61959
61990
  shortDescription: `Allows expanding macro calls with quick fixes`,
61960
- extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61961
-
61991
+ extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
61992
+
61962
61993
  Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
61963
- badExample: `DEFINE _hello.
61964
- WRITE 'hello'.
61965
- END-OF-DEFINITION.
61994
+ badExample: `DEFINE _hello.
61995
+ WRITE 'hello'.
61996
+ END-OF-DEFINITION.
61966
61997
  _hello.`,
61967
61998
  goodExample: `WRITE 'hello'.`,
61968
61999
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
@@ -62049,7 +62080,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
62049
62080
  shortDescription: `Detects EXPORTING statements which can be omitted.`,
62050
62081
  badExample: `call_method( EXPORTING foo = bar ).`,
62051
62082
  goodExample: `call_method( foo = bar ).`,
62052
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
62083
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
62053
62084
  https://docs.abapopenchecks.org/checks/30/`,
62054
62085
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62055
62086
  };
@@ -62147,7 +62178,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
62147
62178
  key: "forbidden_identifier",
62148
62179
  title: "Forbidden Identifier",
62149
62180
  shortDescription: `Forbid use of specified identifiers, list of regex.`,
62150
- extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
62181
+ extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
62151
62182
  https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
62152
62183
  tags: [_irule_1.RuleTag.SingleFile],
62153
62184
  };
@@ -62389,8 +62420,8 @@ class ForbiddenVoidType {
62389
62420
  key: "forbidden_void_type",
62390
62421
  title: "Forbidden Void Types",
62391
62422
  shortDescription: `Avoid usage of specified void types.`,
62392
- extendedInformation: `Inspiration:
62393
- BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62423
+ extendedInformation: `Inspiration:
62424
+ BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
62394
62425
  DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
62395
62426
  };
62396
62427
  }
@@ -62633,9 +62664,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
62633
62664
  key: "fully_type_itabs",
62634
62665
  title: "Fully type internal tables",
62635
62666
  shortDescription: `No implict table types or table keys`,
62636
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62667
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
62637
62668
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
62638
- badExample: `DATA lt_foo TYPE TABLE OF ty.
62669
+ badExample: `DATA lt_foo TYPE TABLE OF ty.
62639
62670
  DATA lt_bar TYPE STANDARD TABLE OF ty.`,
62640
62671
  goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
62641
62672
  tags: [_irule_1.RuleTag.SingleFile],
@@ -62820,26 +62851,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
62820
62851
  key: "functional_writing",
62821
62852
  title: "Use functional writing",
62822
62853
  shortDescription: `Detects usage of call method when functional style calls can be used.`,
62823
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62854
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
62824
62855
  https://docs.abapopenchecks.org/checks/07/`,
62825
62856
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62826
- badExample: `CALL METHOD zcl_class=>method( ).
62827
- CALL METHOD cl_abap_typedescr=>describe_by_name
62828
- EXPORTING
62829
- p_name = 'NAME'
62830
- RECEIVING
62831
- p_descr_ref = lr_typedescr
62832
- EXCEPTIONS
62833
- type_not_found = 1
62857
+ badExample: `CALL METHOD zcl_class=>method( ).
62858
+ CALL METHOD cl_abap_typedescr=>describe_by_name
62859
+ EXPORTING
62860
+ p_name = 'NAME'
62861
+ RECEIVING
62862
+ p_descr_ref = lr_typedescr
62863
+ EXCEPTIONS
62864
+ type_not_found = 1
62834
62865
  OTHERS = 2.`,
62835
- goodExample: `zcl_class=>method( ).
62836
- cl_abap_typedescr=>describe_by_name(
62837
- EXPORTING
62838
- p_name = 'NAME'
62839
- RECEIVING
62840
- p_descr_ref = lr_typedescr
62841
- EXCEPTIONS
62842
- type_not_found = 1
62866
+ goodExample: `zcl_class=>method( ).
62867
+ cl_abap_typedescr=>describe_by_name(
62868
+ EXPORTING
62869
+ p_name = 'NAME'
62870
+ RECEIVING
62871
+ p_descr_ref = lr_typedescr
62872
+ EXCEPTIONS
62873
+ type_not_found = 1
62843
62874
  OTHERS = 2 ).`,
62844
62875
  };
62845
62876
  }
@@ -62950,14 +62981,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
62950
62981
  key: "global_class",
62951
62982
  title: "Global class checks",
62952
62983
  shortDescription: `Checks related to global classes`,
62953
- extendedInformation: `* global classes must be in own files
62954
-
62955
- * file names must match class name
62956
-
62957
- * file names must match interface name
62958
-
62959
- * global classes must be global definitions
62960
-
62984
+ extendedInformation: `* global classes must be in own files
62985
+
62986
+ * file names must match class name
62987
+
62988
+ * file names must match interface name
62989
+
62990
+ * global classes must be global definitions
62991
+
62961
62992
  * global interfaces must be global definitions`,
62962
62993
  tags: [_irule_1.RuleTag.Syntax],
62963
62994
  };
@@ -63056,21 +63087,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
63056
63087
  return {
63057
63088
  key: "identical_conditions",
63058
63089
  title: "Identical conditions",
63059
- shortDescription: `Find identical conditions in IF + CASE + WHILE etc
63060
-
63090
+ shortDescription: `Find identical conditions in IF + CASE + WHILE etc
63091
+
63061
63092
  Prerequsites: code is pretty printed with identical cAsE`,
63062
63093
  tags: [_irule_1.RuleTag.SingleFile],
63063
- badExample: `IF foo = bar OR 1 = a OR foo = bar.
63064
- ENDIF.
63065
- CASE bar.
63066
- WHEN '1'.
63067
- WHEN 'A' OR '1'.
63094
+ badExample: `IF foo = bar OR 1 = a OR foo = bar.
63095
+ ENDIF.
63096
+ CASE bar.
63097
+ WHEN '1'.
63098
+ WHEN 'A' OR '1'.
63068
63099
  ENDCASE.`,
63069
- goodExample: `IF foo = bar OR 1 = a.
63070
- ENDIF.
63071
- CASE bar.
63072
- WHEN '1'.
63073
- WHEN 'A'.
63100
+ goodExample: `IF foo = bar OR 1 = a.
63101
+ ENDIF.
63102
+ CASE bar.
63103
+ WHEN '1'.
63104
+ WHEN 'A'.
63074
63105
  ENDCASE.`,
63075
63106
  };
63076
63107
  }
@@ -63204,23 +63235,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
63204
63235
  key: "identical_contents",
63205
63236
  title: "Identical contents",
63206
63237
  shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
63207
- extendedInformation: `
63208
- Prerequsites: code is pretty printed with identical cAsE
63209
-
63238
+ extendedInformation: `
63239
+ Prerequsites: code is pretty printed with identical cAsE
63240
+
63210
63241
  Chained statments are ignored`,
63211
63242
  tags: [_irule_1.RuleTag.SingleFile],
63212
- badExample: `IF foo = bar.
63213
- WRITE 'bar'.
63214
- WRITE 'world'.
63215
- ELSE.
63216
- WRITE 'foo'.
63217
- WRITE 'world'.
63243
+ badExample: `IF foo = bar.
63244
+ WRITE 'bar'.
63245
+ WRITE 'world'.
63246
+ ELSE.
63247
+ WRITE 'foo'.
63248
+ WRITE 'world'.
63218
63249
  ENDIF.`,
63219
- goodExample: `IF foo = bar.
63220
- WRITE 'bar'.
63221
- ELSE.
63222
- WRITE 'foo'.
63223
- ENDIF.
63250
+ goodExample: `IF foo = bar.
63251
+ WRITE 'bar'.
63252
+ ELSE.
63253
+ WRITE 'foo'.
63254
+ ENDIF.
63224
63255
  WRITE 'world'.`,
63225
63256
  };
63226
63257
  }
@@ -63328,12 +63359,12 @@ class IdenticalDescriptions {
63328
63359
  key: "identical_descriptions",
63329
63360
  title: "Identical descriptions",
63330
63361
  shortDescription: `Searches for objects with the same type and same description`,
63331
- extendedInformation: `Case insensitive
63332
-
63333
- Only checks the master language descriptions
63334
-
63335
- Dependencies are skipped
63336
-
63362
+ extendedInformation: `Case insensitive
63363
+
63364
+ Only checks the master language descriptions
63365
+
63366
+ Dependencies are skipped
63367
+
63337
63368
  Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
63338
63369
  tags: [],
63339
63370
  };
@@ -63507,43 +63538,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
63507
63538
  key: "if_in_if",
63508
63539
  title: "IF in IF",
63509
63540
  shortDescription: `Detects nested ifs which can be refactored.`,
63510
- extendedInformation: `
63511
- Directly nested IFs without ELSE can be refactored to a single condition using AND.
63512
-
63513
- ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63514
-
63515
- https://docs.abapopenchecks.org/checks/01/
63541
+ extendedInformation: `
63542
+ Directly nested IFs without ELSE can be refactored to a single condition using AND.
63543
+
63544
+ ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
63545
+
63546
+ https://docs.abapopenchecks.org/checks/01/
63516
63547
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
63517
- badExample: `IF condition1.
63518
- IF condition2.
63519
- ...
63520
- ENDIF.
63521
- ENDIF.
63522
-
63523
- IF condition1.
63524
- ...
63525
- ELSE.
63526
- IF condition2.
63527
- ...
63528
- ENDIF.
63548
+ badExample: `IF condition1.
63549
+ IF condition2.
63550
+ ...
63551
+ ENDIF.
63552
+ ENDIF.
63553
+
63554
+ IF condition1.
63555
+ ...
63556
+ ELSE.
63557
+ IF condition2.
63558
+ ...
63559
+ ENDIF.
63529
63560
  ENDIF.`,
63530
- goodExample: `IF ( condition1 ) AND ( condition2 ).
63531
- ...
63532
- ENDIF.
63533
-
63534
- IF condition1.
63535
- ...
63536
- ELSEIF condition2.
63537
- ...
63538
- ENDIF.
63539
-
63540
- CASE variable.
63541
- WHEN value1.
63542
- ...
63543
- WHEN value2.
63544
- IF condition2.
63545
- ...
63546
- ENDIF.
63561
+ goodExample: `IF ( condition1 ) AND ( condition2 ).
63562
+ ...
63563
+ ENDIF.
63564
+
63565
+ IF condition1.
63566
+ ...
63567
+ ELSEIF condition2.
63568
+ ...
63569
+ ENDIF.
63570
+
63571
+ CASE variable.
63572
+ WHEN value1.
63573
+ ...
63574
+ WHEN value2.
63575
+ IF condition2.
63576
+ ...
63577
+ ENDIF.
63547
63578
  ENDCASE.`,
63548
63579
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63549
63580
  };
@@ -63728,9 +63759,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
63728
63759
  for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
63729
63760
  const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
63730
63761
  if (name === impl.identifier.getName().toUpperCase()) {
63731
- return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63732
- METHOD ${methodName.toLowerCase()}.
63733
- RETURN. " todo, implement method
63762
+ return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
63763
+ METHOD ${methodName.toLowerCase()}.
63764
+ RETURN. " todo, implement method
63734
63765
  ENDMETHOD.`);
63735
63766
  }
63736
63767
  }
@@ -63909,14 +63940,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
63909
63940
  key: "implicit_start_of_selection",
63910
63941
  title: "Implicit START-OF-SELECTION",
63911
63942
  shortDescription: `Add explicit selection screen event handling`,
63912
- extendedInformation: `Only runs for executable programs
63913
-
63943
+ extendedInformation: `Only runs for executable programs
63944
+
63914
63945
  https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
63915
63946
  tags: [_irule_1.RuleTag.SingleFile],
63916
- badExample: `REPORT zfoo.
63947
+ badExample: `REPORT zfoo.
63917
63948
  WRITE 'hello'.`,
63918
- goodExample: `
63919
- START-OF-SELECTION.
63949
+ goodExample: `
63950
+ START-OF-SELECTION.
63920
63951
  WRITE 'hello'.`,
63921
63952
  };
63922
63953
  }
@@ -64021,19 +64052,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
64021
64052
  key: "in_statement_indentation",
64022
64053
  title: "In-statement indentation",
64023
64054
  shortDescription: "Checks alignment within statements which span multiple lines.",
64024
- extendedInformation: `Lines following the first line should be indented once (2 spaces).
64025
-
64026
- For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
64055
+ extendedInformation: `Lines following the first line should be indented once (2 spaces).
64056
+
64057
+ For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
64027
64058
  to distinguish them better from code within the block.`,
64028
- badExample: `IF 1 = 1
64029
- AND 2 = 2.
64030
- WRITE 'hello' &&
64031
- 'world'.
64059
+ badExample: `IF 1 = 1
64060
+ AND 2 = 2.
64061
+ WRITE 'hello' &&
64062
+ 'world'.
64032
64063
  ENDIF.`,
64033
- goodExample: `IF 1 = 1
64034
- AND 2 = 2.
64035
- WRITE 'hello' &&
64036
- 'world'.
64064
+ goodExample: `IF 1 = 1
64065
+ AND 2 = 2.
64066
+ WRITE 'hello' &&
64067
+ 'world'.
64037
64068
  ENDIF.`,
64038
64069
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64039
64070
  };
@@ -64130,6 +64161,7 @@ const ddic_1 = __webpack_require__(/*! ../ddic */ "./node_modules/@abaplint/core
64130
64161
  const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
64131
64162
  const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
64132
64163
  const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
64164
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
64133
64165
  class IndentationConf extends _basic_rule_config_1.BasicRuleConfig {
64134
64166
  constructor() {
64135
64167
  super(...arguments);
@@ -64156,23 +64188,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
64156
64188
  title: "Indentation",
64157
64189
  shortDescription: `Checks indentation`,
64158
64190
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
64159
- badExample: `CLASS lcl DEFINITION.
64160
- PRIVATE SECTION.
64161
- METHODS constructor.
64162
- ENDCLASS.
64163
-
64164
- CLASS lcl IMPLEMENTATION.
64165
- METHOD constructor.
64166
- ENDMETHOD.
64191
+ badExample: `CLASS lcl DEFINITION.
64192
+ PRIVATE SECTION.
64193
+ METHODS constructor.
64194
+ ENDCLASS.
64195
+
64196
+ CLASS lcl IMPLEMENTATION.
64197
+ METHOD constructor.
64198
+ ENDMETHOD.
64167
64199
  ENDCLASS.`,
64168
- goodExample: `CLASS lcl DEFINITION.
64169
- PRIVATE SECTION.
64170
- METHODS constructor.
64171
- ENDCLASS.
64172
-
64173
- CLASS lcl IMPLEMENTATION.
64174
- METHOD constructor.
64175
- ENDMETHOD.
64200
+ goodExample: `CLASS lcl DEFINITION.
64201
+ PRIVATE SECTION.
64202
+ METHODS constructor.
64203
+ ENDCLASS.
64204
+
64205
+ CLASS lcl IMPLEMENTATION.
64206
+ METHOD constructor.
64207
+ ENDMETHOD.
64176
64208
  ENDCLASS.`,
64177
64209
  };
64178
64210
  }
@@ -64241,6 +64273,9 @@ ENDCLASS.`,
64241
64273
  continue;
64242
64274
  }
64243
64275
  }
64276
+ if (statement.get() instanceof _statement_1.NativeSQL) {
64277
+ continue;
64278
+ }
64244
64279
  // only apply for the first statement in a chain
64245
64280
  if (statement.getColon() !== undefined
64246
64281
  && (previous === null || previous === void 0 ? void 0 : previous.getColon()) !== undefined
@@ -64573,9 +64608,9 @@ class IntfReferencingClas {
64573
64608
  key: "intf_referencing_clas",
64574
64609
  title: "INTF referencing CLAS",
64575
64610
  shortDescription: `Interface contains references to class`,
64576
- extendedInformation: `Only global interfaces are checked.
64577
- Only first level references are checked.
64578
- Exception class references are ignored.
64611
+ extendedInformation: `Only global interfaces are checked.
64612
+ Only first level references are checked.
64613
+ Exception class references are ignored.
64579
64614
  Void references are ignored.`,
64580
64615
  };
64581
64616
  }
@@ -64660,9 +64695,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
64660
64695
  title: "Invalid Table Index",
64661
64696
  shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
64662
64697
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
64663
- badExample: `DATA(first) = table[ 0 ].
64698
+ badExample: `DATA(first) = table[ 0 ].
64664
64699
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
64665
- goodExample: `DATA(first) = table[ 1 ].
64700
+ goodExample: `DATA(first) = table[ 1 ].
64666
64701
  READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
64667
64702
  };
64668
64703
  }
@@ -64935,6 +64970,7 @@ class Skip {
64935
64970
  skipStatement(statement) {
64936
64971
  const get = statement.get();
64937
64972
  if (get instanceof _statement_1.Unknown
64973
+ || get instanceof _statement_1.NativeSQL
64938
64974
  || get instanceof _statement_1.MacroContent
64939
64975
  || get instanceof _statement_1.MacroCall
64940
64976
  || statement.getFirstToken().getStart() instanceof virtual_position_1.VirtualPosition
@@ -65263,8 +65299,8 @@ class LineBreakStyle {
65263
65299
  return {
65264
65300
  key: "line_break_style",
65265
65301
  title: "Makes sure line breaks are consistent in the ABAP code",
65266
- shortDescription: `Enforces LF as newlines in ABAP files
65267
-
65302
+ shortDescription: `Enforces LF as newlines in ABAP files
65303
+
65268
65304
  abapGit does not work with CRLF`,
65269
65305
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
65270
65306
  };
@@ -65333,7 +65369,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
65333
65369
  key: "line_length",
65334
65370
  title: "Line length",
65335
65371
  shortDescription: `Detects lines exceeding the provided maximum length.`,
65336
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65372
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
65337
65373
  https://docs.abapopenchecks.org/checks/04/`,
65338
65374
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
65339
65375
  };
@@ -65404,7 +65440,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
65404
65440
  key: "line_only_punc",
65405
65441
  title: "Line containing only punctuation",
65406
65442
  shortDescription: `Detects lines containing only punctuation.`,
65407
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65443
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
65408
65444
  https://docs.abapopenchecks.org/checks/16/`,
65409
65445
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
65410
65446
  badExample: "zcl_class=>method(\n).",
@@ -65667,15 +65703,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
65667
65703
  return {
65668
65704
  key: "local_variable_names",
65669
65705
  title: "Local variable naming conventions",
65670
- shortDescription: `
65671
- Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65706
+ shortDescription: `
65707
+ Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
65672
65708
  Regexes are case-insensitive.`,
65673
65709
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65674
- badExample: `FORM bar.
65675
- DATA foo.
65710
+ badExample: `FORM bar.
65711
+ DATA foo.
65676
65712
  ENDFORM.`,
65677
- goodExample: `FORM bar.
65678
- DATA lv_foo.
65713
+ goodExample: `FORM bar.
65714
+ DATA lv_foo.
65679
65715
  ENDFORM.`,
65680
65716
  };
65681
65717
  }
@@ -65827,9 +65863,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
65827
65863
  shortDescription: `Allows you to enforce a pattern for macro definitions`,
65828
65864
  extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
65829
65865
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
65830
- badExample: `DEFINE something.
65866
+ badExample: `DEFINE something.
65831
65867
  END-OF-DEFINITION.`,
65832
- goodExample: `DEFINE _something.
65868
+ goodExample: `DEFINE _something.
65833
65869
  END-OF-DEFINITION.`,
65834
65870
  };
65835
65871
  }
@@ -65902,10 +65938,10 @@ class MainFileContents {
65902
65938
  key: "main_file_contents",
65903
65939
  title: "Main file contents",
65904
65940
  shortDescription: `Checks related to report declarations.`,
65905
- extendedInformation: `Does not run if the target version is Cloud
65906
-
65907
- * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65908
- * TYPEs must begin with "TYPE-POOL <name>."
65941
+ extendedInformation: `Does not run if the target version is Cloud
65942
+
65943
+ * PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
65944
+ * TYPEs must begin with "TYPE-POOL <name>."
65909
65945
  `,
65910
65946
  };
65911
65947
  }
@@ -66021,17 +66057,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
66021
66057
  title: "Too many parentheses",
66022
66058
  shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
66023
66059
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
66024
- badExample: `
66025
- IF ( destination IS INITIAL ).
66026
- ENDIF.
66027
- IF foo = boo AND ( bar = lar AND moo = loo ).
66028
- ENDIF.
66060
+ badExample: `
66061
+ IF ( destination IS INITIAL ).
66062
+ ENDIF.
66063
+ IF foo = boo AND ( bar = lar AND moo = loo ).
66064
+ ENDIF.
66029
66065
  `,
66030
- goodExample: `
66031
- IF destination IS INITIAL.
66032
- ENDIF.
66033
- IF foo = boo AND bar = lar AND moo = loo.
66034
- ENDIF.
66066
+ goodExample: `
66067
+ IF destination IS INITIAL.
66068
+ ENDIF.
66069
+ IF foo = boo AND bar = lar AND moo = loo.
66070
+ ENDIF.
66035
66071
  `,
66036
66072
  };
66037
66073
  }
@@ -66205,14 +66241,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
66205
66241
  title: "Max one method parameter definition per line",
66206
66242
  shortDescription: `Keep max one method parameter description per line`,
66207
66243
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
66208
- badExample: `
66209
- METHODS apps_scope_token
66210
- IMPORTING
66244
+ badExample: `
66245
+ METHODS apps_scope_token
66246
+ IMPORTING
66211
66247
  body TYPE bodyapps_scope_token client_id TYPE str.`,
66212
- goodExample: `
66213
- METHODS apps_scope_token
66214
- IMPORTING
66215
- body TYPE bodyapps_scope_token
66248
+ goodExample: `
66249
+ METHODS apps_scope_token
66250
+ IMPORTING
66251
+ body TYPE bodyapps_scope_token
66216
66252
  client_id TYPE str.`,
66217
66253
  };
66218
66254
  }
@@ -66277,11 +66313,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
66277
66313
  key: "max_one_statement",
66278
66314
  title: "Max one statement per line",
66279
66315
  shortDescription: `Checks that each line contains only a single statement.`,
66280
- extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66281
-
66282
- Does not report anything for chained statements.
66283
-
66284
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66316
+ extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
66317
+
66318
+ Does not report anything for chained statements.
66319
+
66320
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
66285
66321
  https://docs.abapopenchecks.org/checks/11/`,
66286
66322
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
66287
66323
  badExample: `WRITE foo. WRITE bar.`,
@@ -66619,8 +66655,8 @@ class MethodLength {
66619
66655
  key: "method_length",
66620
66656
  title: "Method/Form Length",
66621
66657
  shortDescription: `Checks relating to method/form length.`,
66622
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66623
-
66658
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
66659
+
66624
66660
  Abstract methods without statements are considered okay.`,
66625
66661
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66626
66662
  };
@@ -66725,20 +66761,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
66725
66761
  key: "method_overwrites_builtin",
66726
66762
  title: "Method name overwrites builtin function",
66727
66763
  shortDescription: `Checks Method names that overwrite builtin SAP functions`,
66728
- extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66729
-
66730
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66731
-
66764
+ extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
66765
+
66766
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
66767
+
66732
66768
  Interface method names are ignored`,
66733
66769
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66734
- badExample: `CLASS lcl DEFINITION.
66735
- PUBLIC SECTION.
66736
- METHODS matches.
66737
- ENDCLASS.
66738
-
66739
- CLASS lcl IMPLEMENTATION.
66740
- METHOD matches.
66741
- ENDMETHOD.
66770
+ badExample: `CLASS lcl DEFINITION.
66771
+ PUBLIC SECTION.
66772
+ METHODS matches.
66773
+ ENDCLASS.
66774
+
66775
+ CLASS lcl IMPLEMENTATION.
66776
+ METHOD matches.
66777
+ ENDMETHOD.
66742
66778
  ENDCLASS.`,
66743
66779
  };
66744
66780
  }
@@ -66929,12 +66965,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
66929
66965
  // eslint-disable-next-line max-len
66930
66966
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
66931
66967
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
66932
- badExample: `CLASS lcl DEFINITION.
66933
- PUBLIC SECTION.
66934
- METHODS
66935
- foobar
66936
- EXPORTING foo TYPE i
66937
- RETURNING VALUE(rv_string) TYPE string.
66968
+ badExample: `CLASS lcl DEFINITION.
66969
+ PUBLIC SECTION.
66970
+ METHODS
66971
+ foobar
66972
+ EXPORTING foo TYPE i
66973
+ RETURNING VALUE(rv_string) TYPE string.
66938
66974
  ENDCLASS.`,
66939
66975
  };
66940
66976
  }
@@ -67314,7 +67350,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
67314
67350
  key: "nesting",
67315
67351
  title: "Check nesting depth",
67316
67352
  shortDescription: `Checks for methods exceeding a maximum nesting depth`,
67317
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67353
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
67318
67354
  https://docs.abapopenchecks.org/checks/74/`,
67319
67355
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67320
67356
  };
@@ -67557,7 +67593,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
67557
67593
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
67558
67594
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67559
67595
  badExample: `var1 = var2 = var3.`,
67560
- goodExample: `var2 = var3.
67596
+ goodExample: `var2 = var3.
67561
67597
  var1 = var2.`,
67562
67598
  };
67563
67599
  }
@@ -67616,8 +67652,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
67616
67652
  key: "no_external_form_calls",
67617
67653
  title: "No external FORM calls",
67618
67654
  shortDescription: `Detect external form calls`,
67619
- badExample: `PERFORM foo IN PROGRAM bar.
67620
-
67655
+ badExample: `PERFORM foo IN PROGRAM bar.
67656
+
67621
67657
  PERFORM foo(bar).`,
67622
67658
  tags: [_irule_1.RuleTag.SingleFile],
67623
67659
  };
@@ -67678,17 +67714,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
67678
67714
  key: "no_inline_in_optional_branches",
67679
67715
  title: "Don't declare inline in optional branches",
67680
67716
  shortDescription: `Don't declare inline in optional branches`,
67681
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67682
-
67683
- Considered optional branches:
67684
- * inside IF/ELSEIF/ELSE
67685
- * inside LOOP
67686
- * inside WHILE
67687
- * inside CASE/WHEN, CASE TYPE OF
67688
- * inside DO
67689
- * inside SELECT loops
67690
-
67691
- Not considered optional branches:
67717
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
67718
+
67719
+ Considered optional branches:
67720
+ * inside IF/ELSEIF/ELSE
67721
+ * inside LOOP
67722
+ * inside WHILE
67723
+ * inside CASE/WHEN, CASE TYPE OF
67724
+ * inside DO
67725
+ * inside SELECT loops
67726
+
67727
+ Not considered optional branches:
67692
67728
  * TRY/CATCH/CLEANUP`,
67693
67729
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
67694
67730
  };
@@ -67788,12 +67824,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
67788
67824
  key: "no_prefixes",
67789
67825
  title: "No Prefixes",
67790
67826
  shortDescription: `Dont use hungarian notation`,
67791
- extendedInformation: `
67792
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67793
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
67794
-
67795
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67796
-
67827
+ extendedInformation: `
67828
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
67829
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
67830
+
67831
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
67832
+
67797
67833
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
67798
67834
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
67799
67835
  badExample: `DATA lv_foo TYPE i.`,
@@ -67972,7 +68008,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
67972
68008
  return {
67973
68009
  key: "no_public_attributes",
67974
68010
  title: "No public attributes",
67975
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
68011
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
67976
68012
  Exceptions are excluded from this rule.`,
67977
68013
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
67978
68014
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
@@ -68073,13 +68109,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
68073
68109
  key: "no_yoda_conditions",
68074
68110
  title: "No Yoda conditions",
68075
68111
  shortDescription: `Finds Yoda conditions and reports issues`,
68076
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
68077
-
68112
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
68113
+
68078
68114
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
68079
68115
  tags: [_irule_1.RuleTag.SingleFile],
68080
- badExample: `IF 0 <> sy-subrc.
68116
+ badExample: `IF 0 <> sy-subrc.
68081
68117
  ENDIF.`,
68082
- goodExample: `IF sy-subrc <> 0.
68118
+ goodExample: `IF sy-subrc <> 0.
68083
68119
  ENDIF.`,
68084
68120
  };
68085
68121
  }
@@ -68180,8 +68216,8 @@ class NROBConsistency {
68180
68216
  key: "nrob_consistency",
68181
68217
  title: "Number range consistency",
68182
68218
  shortDescription: `Consistency checks for number ranges`,
68183
- extendedInformation: `Issue reported if percentage warning is over 50%
68184
-
68219
+ extendedInformation: `Issue reported if percentage warning is over 50%
68220
+
68185
68221
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
68186
68222
  tags: [_irule_1.RuleTag.SingleFile],
68187
68223
  };
@@ -68458,58 +68494,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
68458
68494
  title: "Obsolete statements",
68459
68495
  shortDescription: `Checks for usages of certain obsolete statements`,
68460
68496
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68461
- extendedInformation: `
68462
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68463
-
68464
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68465
-
68466
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68467
-
68468
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68469
-
68470
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68471
-
68472
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68473
-
68474
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68475
-
68476
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68477
-
68478
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68479
-
68480
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68481
-
68482
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68483
-
68484
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68485
-
68486
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68487
-
68488
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68489
-
68490
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68491
- SELECT COUNT(*) is considered okay
68492
-
68493
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68494
-
68495
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68496
-
68497
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68498
-
68499
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68500
-
68501
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
68502
-
68497
+ extendedInformation: `
68498
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
68499
+
68500
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
68501
+
68502
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
68503
+
68504
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
68505
+
68506
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
68507
+
68508
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
68509
+
68510
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68511
+
68512
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
68513
+
68514
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
68515
+
68516
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
68517
+
68518
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
68519
+
68520
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
68521
+
68522
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
68523
+
68524
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
68525
+
68526
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
68527
+ SELECT COUNT(*) is considered okay
68528
+
68529
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
68530
+
68531
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
68532
+
68533
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
68534
+
68535
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
68536
+
68537
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
68538
+
68503
68539
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
68504
- badExample: `REFRESH itab.
68505
-
68506
- COMPUTE foo = 2 + 2.
68507
-
68508
- MULTIPLY lv_foo BY 2.
68509
-
68510
- INTERFACE intf LOAD.
68511
-
68512
- IF foo IS SUPPLIED.
68540
+ badExample: `REFRESH itab.
68541
+
68542
+ COMPUTE foo = 2 + 2.
68543
+
68544
+ MULTIPLY lv_foo BY 2.
68545
+
68546
+ INTERFACE intf LOAD.
68547
+
68548
+ IF foo IS SUPPLIED.
68513
68549
  ENDIF.`,
68514
68550
  };
68515
68551
  }
@@ -68849,9 +68885,9 @@ class OmitParameterName {
68849
68885
  key: "omit_parameter_name",
68850
68886
  title: "Omit parameter name",
68851
68887
  shortDescription: `Omit the parameter name in single parameter calls`,
68852
- extendedInformation: `
68853
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68854
-
68888
+ extendedInformation: `
68889
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
68890
+
68855
68891
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
68856
68892
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
68857
68893
  badExample: `method( param = 2 ).`,
@@ -69057,20 +69093,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
69057
69093
  shortDescription: `Omit RECEIVING`,
69058
69094
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
69059
69095
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
69060
- badExample: `
69061
- upload_pack(
69062
- EXPORTING
69063
- io_client = lo_client
69064
- iv_url = iv_url
69065
- iv_deepen_level = iv_deepen_level
69066
- it_hashes = lt_hashes
69067
- RECEIVING
69096
+ badExample: `
69097
+ upload_pack(
69098
+ EXPORTING
69099
+ io_client = lo_client
69100
+ iv_url = iv_url
69101
+ iv_deepen_level = iv_deepen_level
69102
+ it_hashes = lt_hashes
69103
+ RECEIVING
69068
69104
  rt_objects = et_objects ).`,
69069
- goodExample: `
69070
- et_objects = upload_pack(
69071
- io_client = lo_client
69072
- iv_url = iv_url
69073
- iv_deepen_level = iv_deepen_level
69105
+ goodExample: `
69106
+ et_objects = upload_pack(
69107
+ io_client = lo_client
69108
+ iv_url = iv_url
69109
+ iv_deepen_level = iv_deepen_level
69074
69110
  it_hashes = lt_hashes ).`,
69075
69111
  };
69076
69112
  }
@@ -69134,8 +69170,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
69134
69170
  return {
69135
69171
  key: "parser_702_chaining",
69136
69172
  title: "Parser Error, bad chanining on 702",
69137
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
69138
- this rule finds these and reports errors.
69173
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
69174
+ this rule finds these and reports errors.
69139
69175
  Only active on target version 702 and below.`,
69140
69176
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69141
69177
  };
@@ -69215,8 +69251,8 @@ class ParserError {
69215
69251
  return {
69216
69252
  key: "parser_error",
69217
69253
  title: "Parser error",
69218
- shortDescription: `Checks for syntax not recognized by abaplint.
69219
-
69254
+ shortDescription: `Checks for syntax not recognized by abaplint.
69255
+
69220
69256
  See recognized syntax at https://syntax.abaplint.org`,
69221
69257
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
69222
69258
  };
@@ -69301,7 +69337,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
69301
69337
  return {
69302
69338
  key: "parser_missing_space",
69303
69339
  title: "Parser Error, missing space",
69304
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69340
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
69305
69341
  This rule makes sure the spaces are consistently required across the language.`,
69306
69342
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
69307
69343
  badExample: `IF ( foo = 'bar').`,
@@ -69724,25 +69760,25 @@ class PreferInline {
69724
69760
  key: "prefer_inline",
69725
69761
  title: "Prefer Inline Declarations",
69726
69762
  shortDescription: `Prefer inline to up-front declarations.`,
69727
- extendedInformation: `EXPERIMENTAL
69728
-
69729
- Activates if language version is v740sp02 or above.
69730
-
69731
- Variables must be local(METHOD or FORM).
69732
-
69733
- No generic or void typed variables. No syntax errors.
69734
-
69735
- First position used must be a full/pure write.
69736
-
69737
- Move statment is not a cast(?=)
69738
-
69763
+ extendedInformation: `EXPERIMENTAL
69764
+
69765
+ Activates if language version is v740sp02 or above.
69766
+
69767
+ Variables must be local(METHOD or FORM).
69768
+
69769
+ No generic or void typed variables. No syntax errors.
69770
+
69771
+ First position used must be a full/pure write.
69772
+
69773
+ Move statment is not a cast(?=)
69774
+
69739
69775
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
69740
69776
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
69741
- badExample: `DATA foo TYPE i.
69742
- foo = 2.
69743
- DATA percentage TYPE decfloat34.
69777
+ badExample: `DATA foo TYPE i.
69778
+ foo = 2.
69779
+ DATA percentage TYPE decfloat34.
69744
69780
  percentage = ( comment_number / abs_statement_number ) * 100.`,
69745
- goodExample: `DATA(foo) = 2.
69781
+ goodExample: `DATA(foo) = 2.
69746
69782
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
69747
69783
  };
69748
69784
  }
@@ -69956,18 +69992,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
69956
69992
  key: "prefer_is_not",
69957
69993
  title: "Prefer IS NOT to NOT IS",
69958
69994
  shortDescription: `Prefer IS NOT to NOT IS`,
69959
- extendedInformation: `
69960
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69961
-
69995
+ extendedInformation: `
69996
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
69997
+
69962
69998
  "if not is_valid( )." examples are skipped`,
69963
69999
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
69964
- goodExample: `IF variable IS NOT INITIAL.
69965
- IF variable NP 'TODO*'.
69966
- IF variable <> 42.
70000
+ goodExample: `IF variable IS NOT INITIAL.
70001
+ IF variable NP 'TODO*'.
70002
+ IF variable <> 42.
69967
70003
  IF variable CO 'hello'.`,
69968
- badExample: `IF NOT variable IS INITIAL.
69969
- IF NOT variable CP 'TODO*'.
69970
- IF NOT variable = 42.
70004
+ badExample: `IF NOT variable IS INITIAL.
70005
+ IF NOT variable CP 'TODO*'.
70006
+ IF NOT variable = 42.
69971
70007
  IF NOT variable CA 'hello'.`,
69972
70008
  };
69973
70009
  }
@@ -70155,14 +70191,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
70155
70191
  key: "prefer_raise_exception_new",
70156
70192
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
70157
70193
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
70158
- extendedInformation: `
70159
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70160
-
70194
+ extendedInformation: `
70195
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
70196
+
70161
70197
  From 752 and up`,
70162
70198
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
70163
70199
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
70164
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
70165
- EXPORTING
70200
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
70201
+ EXPORTING
70166
70202
  previous = exception.`,
70167
70203
  };
70168
70204
  }
@@ -70240,12 +70276,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
70240
70276
  key: "prefer_returning_to_exporting",
70241
70277
  title: "Prefer RETURNING to EXPORTING",
70242
70278
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
70243
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70279
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
70244
70280
  https://docs.abapopenchecks.org/checks/44/`,
70245
70281
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70246
- badExample: `CLASS lcl DEFINITION.
70247
- PUBLIC SECTION.
70248
- METHODS test EXPORTING ev_foo TYPE i.
70282
+ badExample: `CLASS lcl DEFINITION.
70283
+ PUBLIC SECTION.
70284
+ METHODS test EXPORTING ev_foo TYPE i.
70249
70285
  ENDCLASS.`,
70250
70286
  };
70251
70287
  }
@@ -70341,8 +70377,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
70341
70377
  key: "prefer_xsdbool",
70342
70378
  title: "Prefer xsdbool over boolc",
70343
70379
  shortDescription: `Prefer xsdbool over boolc`,
70344
- extendedInformation: `Activates if language version is v740sp08 or above.
70345
-
70380
+ extendedInformation: `Activates if language version is v740sp08 or above.
70381
+
70346
70382
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
70347
70383
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70348
70384
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -70414,9 +70450,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
70414
70450
  title: "Preferred compare operator",
70415
70451
  shortDescription: `Configure undesired operator variants`,
70416
70452
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
70417
- badExample: `IF foo EQ bar.
70453
+ badExample: `IF foo EQ bar.
70418
70454
  ENDIF.`,
70419
- goodExample: `IF foo = bar.
70455
+ goodExample: `IF foo = bar.
70420
70456
  ENDIF.`,
70421
70457
  };
70422
70458
  }
@@ -70640,26 +70676,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
70640
70676
  key: "reduce_procedural_code",
70641
70677
  title: "Reduce procedural code",
70642
70678
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
70643
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70644
-
70645
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70646
-
70679
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
70680
+
70681
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
70682
+
70647
70683
  Comments are not counted as statements.`,
70648
70684
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
70649
- badExample: `FORM foo.
70650
- DATA lv_bar TYPE i.
70651
- lv_bar = 2 + 2.
70652
- IF lv_bar = 4.
70653
- WRITE 'hello world'.
70654
- ENDIF.
70655
- DATA lv_bar TYPE i.
70656
- lv_bar = 2 + 2.
70657
- IF lv_bar = 4.
70658
- WRITE 'hello world'.
70659
- ENDIF.
70685
+ badExample: `FORM foo.
70686
+ DATA lv_bar TYPE i.
70687
+ lv_bar = 2 + 2.
70688
+ IF lv_bar = 4.
70689
+ WRITE 'hello world'.
70690
+ ENDIF.
70691
+ DATA lv_bar TYPE i.
70692
+ lv_bar = 2 + 2.
70693
+ IF lv_bar = 4.
70694
+ WRITE 'hello world'.
70695
+ ENDIF.
70660
70696
  ENDFORM.`,
70661
- goodExample: `FORM foo.
70662
- NEW zcl_global_class( )->run_logic( ).
70697
+ goodExample: `FORM foo.
70698
+ NEW zcl_global_class( )->run_logic( ).
70663
70699
  ENDFORM.`,
70664
70700
  };
70665
70701
  }
@@ -70903,10 +70939,10 @@ class RemoveDescriptions {
70903
70939
  return {
70904
70940
  key: "remove_descriptions",
70905
70941
  title: "Remove descriptions",
70906
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70907
-
70908
- Class descriptions are required, see rule description_empty.
70909
-
70942
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
70943
+
70944
+ Class descriptions are required, see rule description_empty.
70945
+
70910
70946
  Consider using ABAP Doc for documentation.`,
70911
70947
  tags: [],
70912
70948
  };
@@ -71031,14 +71067,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
71031
71067
  tags: [_irule_1.RuleTag.SingleFile],
71032
71068
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
71033
71069
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
71034
- badExample: `CALL FUNCTION 'ZRFC'
71070
+ badExample: `CALL FUNCTION 'ZRFC'
71035
71071
  DESTINATION lv_rfc.`,
71036
- goodExample: `CALL FUNCTION 'ZRFC'
71037
- DESTINATION lv_rfc
71038
- EXCEPTIONS
71039
- system_failure = 1 MESSAGE msg
71040
- communication_failure = 2 MESSAGE msg
71041
- resource_failure = 3
71072
+ goodExample: `CALL FUNCTION 'ZRFC'
71073
+ DESTINATION lv_rfc
71074
+ EXCEPTIONS
71075
+ system_failure = 1 MESSAGE msg
71076
+ communication_failure = 2 MESSAGE msg
71077
+ resource_failure = 3
71042
71078
  OTHERS = 4.`,
71043
71079
  };
71044
71080
  }
@@ -71122,11 +71158,11 @@ class SelectAddOrderBy {
71122
71158
  key: "select_add_order_by",
71123
71159
  title: "SELECT add ORDER BY",
71124
71160
  shortDescription: `SELECTs add ORDER BY clause`,
71125
- extendedInformation: `
71126
- This will make sure that the SELECT statement returns results in the same sequence on different databases
71127
-
71128
- add ORDER BY PRIMARY KEY if in doubt
71129
-
71161
+ extendedInformation: `
71162
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
71163
+
71164
+ add ORDER BY PRIMARY KEY if in doubt
71165
+
71130
71166
  If the target is a sorted/hashed table, no issue is reported`,
71131
71167
  tags: [_irule_1.RuleTag.SingleFile],
71132
71168
  badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
@@ -71257,14 +71293,14 @@ class SelectPerformance {
71257
71293
  key: "select_performance",
71258
71294
  title: "SELECT performance",
71259
71295
  shortDescription: `Various checks regarding SELECT performance.`,
71260
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71261
-
71296
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
71297
+
71262
71298
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
71263
71299
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
71264
- badExample: `SELECT field1, field2 FROM table
71265
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71300
+ badExample: `SELECT field1, field2 FROM table
71301
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
71266
71302
  ENDSELECT.`,
71267
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71303
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
71268
71304
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
71269
71305
  };
71270
71306
  }
@@ -71378,8 +71414,8 @@ class SelectSingleFullKey {
71378
71414
  key: "select_single_full_key",
71379
71415
  title: "Detect SELECT SINGLE which are possibily not unique",
71380
71416
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
71381
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71382
-
71417
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
71418
+
71383
71419
  If the statement contains a JOIN it is not checked`,
71384
71420
  pseudoComment: "EC CI_NOORDER",
71385
71421
  tags: [_irule_1.RuleTag.Quickfix],
@@ -71807,8 +71843,8 @@ class SICFConsistency {
71807
71843
  key: "sicf_consistency",
71808
71844
  title: "SICF consistency",
71809
71845
  shortDescription: `Checks the validity of ICF services`,
71810
- extendedInformation: `* Class defined in handler must exist
71811
- * Class must not have any syntax errors
71846
+ extendedInformation: `* Class defined in handler must exist
71847
+ * Class must not have any syntax errors
71812
71848
  * Class must implement interface IF_HTTP_EXTENSION`,
71813
71849
  };
71814
71850
  }
@@ -71920,23 +71956,23 @@ class SlowParameterPassing {
71920
71956
  shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
71921
71957
  extendedInformation: `Method parameters defined in interfaces is not checked`,
71922
71958
  tags: [_irule_1.RuleTag.Performance],
71923
- badExample: `CLASS lcl DEFINITION.
71924
- PUBLIC SECTION.
71925
- METHODS bar IMPORTING VALUE(sdf) TYPE string.
71926
- ENDCLASS.
71927
- CLASS lcl IMPLEMENTATION.
71928
- METHOD bar.
71929
- WRITE sdf.
71930
- ENDMETHOD.
71959
+ badExample: `CLASS lcl DEFINITION.
71960
+ PUBLIC SECTION.
71961
+ METHODS bar IMPORTING VALUE(sdf) TYPE string.
71962
+ ENDCLASS.
71963
+ CLASS lcl IMPLEMENTATION.
71964
+ METHOD bar.
71965
+ WRITE sdf.
71966
+ ENDMETHOD.
71931
71967
  ENDCLASS.`,
71932
- goodExample: `CLASS lcl DEFINITION.
71933
- PUBLIC SECTION.
71934
- METHODS bar IMPORTING sdf TYPE string.
71935
- ENDCLASS.
71936
- CLASS lcl IMPLEMENTATION.
71937
- METHOD bar.
71938
- WRITE sdf.
71939
- ENDMETHOD.
71968
+ goodExample: `CLASS lcl DEFINITION.
71969
+ PUBLIC SECTION.
71970
+ METHODS bar IMPORTING sdf TYPE string.
71971
+ ENDCLASS.
71972
+ CLASS lcl IMPLEMENTATION.
71973
+ METHOD bar.
71974
+ WRITE sdf.
71975
+ ENDMETHOD.
71940
71976
  ENDCLASS.`,
71941
71977
  };
71942
71978
  }
@@ -72100,6 +72136,8 @@ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/co
72100
72136
  const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
72101
72137
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
72102
72138
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
72139
+ const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
72140
+ const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
72103
72141
  class SpaceBeforeColonConf extends _basic_rule_config_1.BasicRuleConfig {
72104
72142
  }
72105
72143
  exports.SpaceBeforeColonConf = SpaceBeforeColonConf;
@@ -72130,22 +72168,34 @@ class SpaceBeforeColon extends _abap_rule_1.ABAPRule {
72130
72168
  }
72131
72169
  runParsed(file) {
72132
72170
  const issues = [];
72133
- let prev = file.getTokens()[0];
72134
- for (const token of file.getTokens()) {
72135
- if (token.getStr() === ":" && !prev) {
72136
- const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);
72137
- issues.push(issue);
72171
+ for (const statement of file.getStatements()) {
72172
+ const colon = statement.getColon();
72173
+ if (colon === undefined
72174
+ || statement.get() instanceof _statement_1.NativeSQL
72175
+ || statement.get() instanceof tokens_1.Comment) {
72176
+ continue;
72138
72177
  }
72139
- else if (token.getStr() === ":"
72140
- && prev.getRow() === token.getRow()
72141
- && prev.getCol() + prev.getStr().length < token.getCol()) {
72142
- const start = new position_1.Position(token.getRow(), prev.getEnd().getCol());
72143
- const end = new position_1.Position(token.getRow(), token.getStart().getCol());
72144
- const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);
72145
- const issue = issue_1.Issue.atRowRange(file, start.getRow(), start.getCol(), end.getCol(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
72146
- issues.push(issue);
72178
+ // todo: this can be more smart, performance wise
72179
+ const tokens = [...statement.getTokens()];
72180
+ tokens.push(colon);
72181
+ tokens.sort((a, b) => a.getStart().isAfter(b.getStart()) ? 1 : -1);
72182
+ let prev = tokens[0];
72183
+ for (const token of tokens) {
72184
+ if (token.getStr() === ":" && !prev) {
72185
+ const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);
72186
+ issues.push(issue);
72187
+ }
72188
+ else if (token.getStr() === ":"
72189
+ && prev.getRow() === token.getRow()
72190
+ && prev.getCol() + prev.getStr().length < token.getCol()) {
72191
+ const start = new position_1.Position(token.getRow(), prev.getEnd().getCol());
72192
+ const end = new position_1.Position(token.getRow(), token.getStart().getCol());
72193
+ const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);
72194
+ const issue = issue_1.Issue.atRowRange(file, start.getRow(), start.getCol(), end.getCol(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
72195
+ issues.push(issue);
72196
+ }
72197
+ prev = token;
72147
72198
  }
72148
- prev = token;
72149
72199
  }
72150
72200
  return issues;
72151
72201
  }
@@ -72193,8 +72243,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
72193
72243
  key: "space_before_dot",
72194
72244
  title: "Space before dot",
72195
72245
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
72196
- extendedInformation: `
72197
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72246
+ extendedInformation: `
72247
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
72198
72248
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
72199
72249
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72200
72250
  badExample: `WRITE bar .`,
@@ -72380,12 +72430,12 @@ class SQLValueConversion {
72380
72430
  key: "sql_value_conversion",
72381
72431
  title: "Implicit SQL Value Conversion",
72382
72432
  shortDescription: `Ensure types match when selecting from database`,
72383
- extendedInformation: `
72384
- * Integer to CHAR conversion
72385
- * Integer to NUMC conversion
72386
- * NUMC to Integer conversion
72387
- * CHAR to Integer conversion
72388
- * Source field longer than database field, CHAR -> CHAR
72433
+ extendedInformation: `
72434
+ * Integer to CHAR conversion
72435
+ * Integer to NUMC conversion
72436
+ * NUMC to Integer conversion
72437
+ * CHAR to Integer conversion
72438
+ * Source field longer than database field, CHAR -> CHAR
72389
72439
  * Source field longer than database field, NUMC -> NUMC`,
72390
72440
  tags: [],
72391
72441
  };
@@ -72457,7 +72507,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
72457
72507
  key: "start_at_tab",
72458
72508
  title: "Start at tab",
72459
72509
  shortDescription: `Checks that statements start at tabstops.`,
72460
- extendedInformation: `Reports max 100 issues per file
72510
+ extendedInformation: `Reports max 100 issues per file
72461
72511
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
72462
72512
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
72463
72513
  badExample: ` WRITE a.`,
@@ -72634,12 +72684,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
72634
72684
  key: "strict_sql",
72635
72685
  title: "Strict SQL",
72636
72686
  shortDescription: `Strict SQL`,
72637
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72638
-
72639
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72640
-
72641
- Also see separate rule sql_escape_host_variables
72642
-
72687
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
72688
+
72689
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
72690
+
72691
+ Also see separate rule sql_escape_host_variables
72692
+
72643
72693
  Activates from v750 and up`,
72644
72694
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
72645
72695
  badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
@@ -72893,11 +72943,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
72893
72943
  key: "sy_modification",
72894
72944
  title: "Modification of SY fields",
72895
72945
  shortDescription: `Finds modification of sy fields`,
72896
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72897
-
72946
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
72947
+
72898
72948
  Changes to SY-TVAR* fields are not reported`,
72899
72949
  tags: [_irule_1.RuleTag.SingleFile],
72900
- badExample: `sy-uname = 2.
72950
+ badExample: `sy-uname = 2.
72901
72951
  sy = sy.`,
72902
72952
  };
72903
72953
  }
@@ -72959,8 +73009,8 @@ class TABLEnhancementCategory {
72959
73009
  key: "tabl_enhancement_category",
72960
73010
  title: "TABL enhancement category must be set",
72961
73011
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
72962
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
72963
-
73012
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
73013
+
72964
73014
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
72965
73015
  tags: [],
72966
73016
  };
@@ -73025,8 +73075,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
73025
73075
  shortDescription: `TABLES are always global, so declare them globally`,
73026
73076
  extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
73027
73077
  tags: [_irule_1.RuleTag.SingleFile],
73028
- badExample: `FORM foo.
73029
- TABLES t100.
73078
+ badExample: `FORM foo.
73079
+ TABLES t100.
73030
73080
  ENDFORM.`,
73031
73081
  goodExample: `TABLES t000.`,
73032
73082
  };
@@ -73154,9 +73204,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
73154
73204
  title: "Type FORM parameters",
73155
73205
  shortDescription: `Checks for untyped FORM parameters`,
73156
73206
  tags: [_irule_1.RuleTag.SingleFile],
73157
- badExample: `FORM foo USING bar.
73207
+ badExample: `FORM foo USING bar.
73158
73208
  ENDFORM.`,
73159
- goodExample: `FORM foo USING bar TYPE string.
73209
+ goodExample: `FORM foo USING bar TYPE string.
73160
73210
  ENDFORM.`,
73161
73211
  };
73162
73212
  }
@@ -73829,38 +73879,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
73829
73879
  key: "unnecessary_pragma",
73830
73880
  title: "Unnecessary Pragma",
73831
73881
  shortDescription: `Finds pragmas which can be removed`,
73832
- extendedInformation: `* NO_HANDLER with handler
73833
-
73834
- * NEEDED without definition
73835
-
73836
- * NO_TEXT without texts
73837
-
73838
- * SUBRC_OK where sy-subrc is checked
73839
-
73882
+ extendedInformation: `* NO_HANDLER with handler
73883
+
73884
+ * NEEDED without definition
73885
+
73886
+ * NO_TEXT without texts
73887
+
73888
+ * SUBRC_OK where sy-subrc is checked
73889
+
73840
73890
  NO_HANDLER inside macros are not checked`,
73841
73891
  tags: [_irule_1.RuleTag.SingleFile],
73842
- badExample: `TRY.
73843
- ...
73844
- CATCH zcx_abapgit_exception ##NO_HANDLER.
73845
- RETURN. " it has a handler
73846
- ENDTRY.
73847
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73848
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73849
- IF sy-subrc <> 0.
73892
+ badExample: `TRY.
73893
+ ...
73894
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
73895
+ RETURN. " it has a handler
73896
+ ENDTRY.
73897
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
73898
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
73899
+ IF sy-subrc <> 0.
73850
73900
  ENDIF.`,
73851
- goodExample: `TRY.
73852
- ...
73853
- CATCH zcx_abapgit_exception.
73854
- RETURN.
73855
- ENDTRY.
73856
- MESSAGE w125(zbar) WITH c_foo INTO message.
73857
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73858
- IF sy-subrc <> 0.
73859
- ENDIF.
73860
-
73861
- DATA: BEGIN OF blah ##NEEDED,
73862
- test1 TYPE string,
73863
- test2 TYPE string,
73901
+ goodExample: `TRY.
73902
+ ...
73903
+ CATCH zcx_abapgit_exception.
73904
+ RETURN.
73905
+ ENDTRY.
73906
+ MESSAGE w125(zbar) WITH c_foo INTO message.
73907
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
73908
+ IF sy-subrc <> 0.
73909
+ ENDIF.
73910
+
73911
+ DATA: BEGIN OF blah ##NEEDED,
73912
+ test1 TYPE string,
73913
+ test2 TYPE string,
73864
73914
  END OF blah.`,
73865
73915
  };
73866
73916
  }
@@ -74027,18 +74077,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
74027
74077
  shortDescription: `Finds unnecessary RETURN statements`,
74028
74078
  extendedInformation: `Finds unnecessary RETURN statements`,
74029
74079
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
74030
- badExample: `FORM hello1.
74031
- WRITE 'world'.
74032
- RETURN.
74033
- ENDFORM.
74034
-
74035
- FORM foo.
74036
- IF 1 = 2.
74037
- RETURN.
74038
- ENDIF.
74080
+ badExample: `FORM hello1.
74081
+ WRITE 'world'.
74082
+ RETURN.
74083
+ ENDFORM.
74084
+
74085
+ FORM foo.
74086
+ IF 1 = 2.
74087
+ RETURN.
74088
+ ENDIF.
74039
74089
  ENDFORM.`,
74040
- goodExample: `FORM hello2.
74041
- WRITE 'world'.
74090
+ goodExample: `FORM hello2.
74091
+ WRITE 'world'.
74042
74092
  ENDFORM.`,
74043
74093
  };
74044
74094
  }
@@ -74389,13 +74439,13 @@ class UnusedMacros {
74389
74439
  title: "Unused macros",
74390
74440
  shortDescription: `Checks for unused macro definitions definitions`,
74391
74441
  tags: [_irule_1.RuleTag.Quickfix],
74392
- badExample: `DEFINE foobar1.
74393
- WRITE 'hello'.
74442
+ badExample: `DEFINE foobar1.
74443
+ WRITE 'hello'.
74394
74444
  END-OF-DEFINITION.`,
74395
- goodExample: `DEFINE foobar2.
74396
- WRITE 'hello'.
74397
- END-OF-DEFINITION.
74398
-
74445
+ goodExample: `DEFINE foobar2.
74446
+ WRITE 'hello'.
74447
+ END-OF-DEFINITION.
74448
+
74399
74449
  foobar2.`,
74400
74450
  };
74401
74451
  }
@@ -74507,18 +74557,18 @@ class UnusedMethods {
74507
74557
  key: "unused_methods",
74508
74558
  title: "Unused methods",
74509
74559
  shortDescription: `Checks for unused methods`,
74510
- extendedInformation: `Checks private and protected methods.
74511
-
74512
- Unused methods are not reported if the object contains parser or syntax errors.
74513
- Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74514
-
74515
- Skips:
74516
- * methods FOR TESTING
74517
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74518
- * class_constructor + constructor methods
74519
- * event handlers
74520
- * methods that are redefined
74521
- * INCLUDEs
74560
+ extendedInformation: `Checks private and protected methods.
74561
+
74562
+ Unused methods are not reported if the object contains parser or syntax errors.
74563
+ Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
74564
+
74565
+ Skips:
74566
+ * methods FOR TESTING
74567
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
74568
+ * class_constructor + constructor methods
74569
+ * event handlers
74570
+ * methods that are redefined
74571
+ * INCLUDEs
74522
74572
  `,
74523
74573
  tags: [_irule_1.RuleTag.Quickfix],
74524
74574
  pragma: "##CALLED",
@@ -74994,23 +75044,23 @@ class UnusedVariables {
74994
75044
  key: "unused_variables",
74995
75045
  title: "Unused variables",
74996
75046
  shortDescription: `Checks for unused variables and constants`,
74997
- extendedInformation: `Skips event parameters.
74998
-
74999
- Note that this currently does not work if the source code uses macros.
75000
-
75001
- Unused variables are not reported if the object contains parser or syntax errors.
75002
-
75047
+ extendedInformation: `Skips event parameters.
75048
+
75049
+ Note that this currently does not work if the source code uses macros.
75050
+
75051
+ Unused variables are not reported if the object contains parser or syntax errors.
75052
+
75003
75053
  Errors found in INCLUDES are reported for the main program.`,
75004
75054
  tags: [_irule_1.RuleTag.Quickfix],
75005
75055
  pragma: "##NEEDED",
75006
75056
  pseudoComment: "EC NEEDED",
75007
- badExample: `DATA: BEGIN OF blah1,
75008
- test TYPE string,
75009
- test2 TYPE string,
75057
+ badExample: `DATA: BEGIN OF blah1,
75058
+ test TYPE string,
75059
+ test2 TYPE string,
75010
75060
  END OF blah1.`,
75011
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
75012
- test TYPE string,
75013
- test2 TYPE string,
75061
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
75062
+ test TYPE string,
75063
+ test2 TYPE string,
75014
75064
  END OF blah2.`,
75015
75065
  };
75016
75066
  }
@@ -75229,15 +75279,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
75229
75279
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
75230
75280
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
75231
75281
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
75232
- badExample: `IF line IS INITIAL.
75233
- has_entries = abap_false.
75234
- ELSE.
75235
- has_entries = abap_true.
75236
- ENDIF.
75237
-
75282
+ badExample: `IF line IS INITIAL.
75283
+ has_entries = abap_false.
75284
+ ELSE.
75285
+ has_entries = abap_true.
75286
+ ENDIF.
75287
+
75238
75288
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
75239
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75240
-
75289
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
75290
+
75241
75291
  DATA(fsdf) = xsdbool( foo <> bar ).`,
75242
75292
  };
75243
75293
  }
@@ -75355,15 +75405,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
75355
75405
  shortDescription: `Use class based exceptions, checks interface and class definitions`,
75356
75406
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
75357
75407
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75358
- badExample: `INTERFACE lif.
75359
- METHODS load_data
75360
- EXCEPTIONS
75361
- invalid_parameter.
75408
+ badExample: `INTERFACE lif.
75409
+ METHODS load_data
75410
+ EXCEPTIONS
75411
+ invalid_parameter.
75362
75412
  ENDINTERFACE.`,
75363
- goodExample: `INTERFACE lif.
75364
- METHODS load_data
75365
- RAISING
75366
- cx_something.
75413
+ goodExample: `INTERFACE lif.
75414
+ METHODS load_data
75415
+ RAISING
75416
+ cx_something.
75367
75417
  ENDINTERFACE.`,
75368
75418
  };
75369
75419
  }
@@ -75423,15 +75473,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
75423
75473
  key: "use_line_exists",
75424
75474
  title: "Use line_exists",
75425
75475
  shortDescription: `Use line_exists, from 740sp02 and up`,
75426
- extendedInformation: `
75427
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75428
-
75476
+ extendedInformation: `
75477
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
75478
+
75429
75479
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
75430
75480
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
75431
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75432
- IF sy-subrc = 0.
75481
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
75482
+ IF sy-subrc = 0.
75433
75483
  ENDIF.`,
75434
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75484
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
75435
75485
  ENDIF.`,
75436
75486
  };
75437
75487
  }
@@ -75541,10 +75591,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
75541
75591
  key: "use_new",
75542
75592
  title: "Use NEW",
75543
75593
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
75544
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75545
-
75546
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75547
-
75594
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
75595
+
75596
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
75597
+
75548
75598
  Applicable from v740sp02 and up`,
75549
75599
  badExample: `CREATE OBJECT ref.`,
75550
75600
  goodExample: `ref = NEW #( ).`,
@@ -75642,13 +75692,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
75642
75692
  title: "WHEN OTHERS last",
75643
75693
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
75644
75694
  tags: [_irule_1.RuleTag.SingleFile],
75645
- badExample: `CASE bar.
75646
- WHEN OTHERS.
75647
- WHEN 2.
75695
+ badExample: `CASE bar.
75696
+ WHEN OTHERS.
75697
+ WHEN 2.
75648
75698
  ENDCASE.`,
75649
- goodExample: `CASE bar.
75650
- WHEN 2.
75651
- WHEN OTHERS.
75699
+ goodExample: `CASE bar.
75700
+ WHEN 2.
75701
+ WHEN OTHERS.
75652
75702
  ENDCASE.`,
75653
75703
  };
75654
75704
  }