@abaplint/cli 2.113.68 → 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.
- package/README.md +4 -4
- package/abaplint +2 -2
- package/build/cli.js +957 -912
- 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
|
|
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
|
|
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
|
}
|
|
@@ -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
|
-
|
|
30246
|
-
|
|
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 (
|
|
30249
|
-
|
|
30250
|
-
|
|
30251
|
-
|
|
30252
|
-
|
|
30253
|
-
|
|
30254
|
-
|
|
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 (
|
|
30259
|
-
&&
|
|
30260
|
-
&&
|
|
30261
|
-
|
|
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 (
|
|
30267
|
-
|
|
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.
|
|
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
|
|
56974
|
-
|
|
56975
|
-
|
|
56976
|
-
|
|
56977
|
-
|
|
56978
|
-
|
|
56979
|
-
|
|
56980
|
-
|
|
56981
|
-
|
|
56982
|
-
|
|
56983
|
-
|
|
56984
|
-
|
|
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
|
};
|
|
@@ -64157,23 +64188,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
64157
64188
|
title: "Indentation",
|
|
64158
64189
|
shortDescription: `Checks indentation`,
|
|
64159
64190
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64160
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64161
|
-
PRIVATE SECTION.
|
|
64162
|
-
METHODS constructor.
|
|
64163
|
-
ENDCLASS.
|
|
64164
|
-
|
|
64165
|
-
CLASS lcl IMPLEMENTATION.
|
|
64166
|
-
METHOD constructor.
|
|
64167
|
-
ENDMETHOD.
|
|
64191
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64192
|
+
PRIVATE SECTION.
|
|
64193
|
+
METHODS constructor.
|
|
64194
|
+
ENDCLASS.
|
|
64195
|
+
|
|
64196
|
+
CLASS lcl IMPLEMENTATION.
|
|
64197
|
+
METHOD constructor.
|
|
64198
|
+
ENDMETHOD.
|
|
64168
64199
|
ENDCLASS.`,
|
|
64169
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
64170
|
-
PRIVATE SECTION.
|
|
64171
|
-
METHODS constructor.
|
|
64172
|
-
ENDCLASS.
|
|
64173
|
-
|
|
64174
|
-
CLASS lcl IMPLEMENTATION.
|
|
64175
|
-
METHOD constructor.
|
|
64176
|
-
ENDMETHOD.
|
|
64200
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
64201
|
+
PRIVATE SECTION.
|
|
64202
|
+
METHODS constructor.
|
|
64203
|
+
ENDCLASS.
|
|
64204
|
+
|
|
64205
|
+
CLASS lcl IMPLEMENTATION.
|
|
64206
|
+
METHOD constructor.
|
|
64207
|
+
ENDMETHOD.
|
|
64177
64208
|
ENDCLASS.`,
|
|
64178
64209
|
};
|
|
64179
64210
|
}
|
|
@@ -64577,9 +64608,9 @@ class IntfReferencingClas {
|
|
|
64577
64608
|
key: "intf_referencing_clas",
|
|
64578
64609
|
title: "INTF referencing CLAS",
|
|
64579
64610
|
shortDescription: `Interface contains references to class`,
|
|
64580
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64581
|
-
Only first level references are checked.
|
|
64582
|
-
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.
|
|
64583
64614
|
Void references are ignored.`,
|
|
64584
64615
|
};
|
|
64585
64616
|
}
|
|
@@ -64664,9 +64695,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64664
64695
|
title: "Invalid Table Index",
|
|
64665
64696
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64666
64697
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64667
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64698
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64668
64699
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64669
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64700
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64670
64701
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64671
64702
|
};
|
|
64672
64703
|
}
|
|
@@ -65268,8 +65299,8 @@ class LineBreakStyle {
|
|
|
65268
65299
|
return {
|
|
65269
65300
|
key: "line_break_style",
|
|
65270
65301
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65271
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65272
|
-
|
|
65302
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65303
|
+
|
|
65273
65304
|
abapGit does not work with CRLF`,
|
|
65274
65305
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65275
65306
|
};
|
|
@@ -65338,7 +65369,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65338
65369
|
key: "line_length",
|
|
65339
65370
|
title: "Line length",
|
|
65340
65371
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65341
|
-
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
|
|
65342
65373
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65343
65374
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65344
65375
|
};
|
|
@@ -65409,7 +65440,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65409
65440
|
key: "line_only_punc",
|
|
65410
65441
|
title: "Line containing only punctuation",
|
|
65411
65442
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65412
|
-
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
|
|
65413
65444
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65414
65445
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65415
65446
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65672,15 +65703,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65672
65703
|
return {
|
|
65673
65704
|
key: "local_variable_names",
|
|
65674
65705
|
title: "Local variable naming conventions",
|
|
65675
|
-
shortDescription: `
|
|
65676
|
-
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.
|
|
65677
65708
|
Regexes are case-insensitive.`,
|
|
65678
65709
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65679
|
-
badExample: `FORM bar.
|
|
65680
|
-
DATA foo.
|
|
65710
|
+
badExample: `FORM bar.
|
|
65711
|
+
DATA foo.
|
|
65681
65712
|
ENDFORM.`,
|
|
65682
|
-
goodExample: `FORM bar.
|
|
65683
|
-
DATA lv_foo.
|
|
65713
|
+
goodExample: `FORM bar.
|
|
65714
|
+
DATA lv_foo.
|
|
65684
65715
|
ENDFORM.`,
|
|
65685
65716
|
};
|
|
65686
65717
|
}
|
|
@@ -65832,9 +65863,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65832
65863
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65833
65864
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65834
65865
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65835
|
-
badExample: `DEFINE something.
|
|
65866
|
+
badExample: `DEFINE something.
|
|
65836
65867
|
END-OF-DEFINITION.`,
|
|
65837
|
-
goodExample: `DEFINE _something.
|
|
65868
|
+
goodExample: `DEFINE _something.
|
|
65838
65869
|
END-OF-DEFINITION.`,
|
|
65839
65870
|
};
|
|
65840
65871
|
}
|
|
@@ -65907,10 +65938,10 @@ class MainFileContents {
|
|
|
65907
65938
|
key: "main_file_contents",
|
|
65908
65939
|
title: "Main file contents",
|
|
65909
65940
|
shortDescription: `Checks related to report declarations.`,
|
|
65910
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65911
|
-
|
|
65912
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65913
|
-
* 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>."
|
|
65914
65945
|
`,
|
|
65915
65946
|
};
|
|
65916
65947
|
}
|
|
@@ -66026,17 +66057,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
66026
66057
|
title: "Too many parentheses",
|
|
66027
66058
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
66028
66059
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
66029
|
-
badExample: `
|
|
66030
|
-
IF ( destination IS INITIAL ).
|
|
66031
|
-
ENDIF.
|
|
66032
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66033
|
-
ENDIF.
|
|
66060
|
+
badExample: `
|
|
66061
|
+
IF ( destination IS INITIAL ).
|
|
66062
|
+
ENDIF.
|
|
66063
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66064
|
+
ENDIF.
|
|
66034
66065
|
`,
|
|
66035
|
-
goodExample: `
|
|
66036
|
-
IF destination IS INITIAL.
|
|
66037
|
-
ENDIF.
|
|
66038
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
66039
|
-
ENDIF.
|
|
66066
|
+
goodExample: `
|
|
66067
|
+
IF destination IS INITIAL.
|
|
66068
|
+
ENDIF.
|
|
66069
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
66070
|
+
ENDIF.
|
|
66040
66071
|
`,
|
|
66041
66072
|
};
|
|
66042
66073
|
}
|
|
@@ -66210,14 +66241,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66210
66241
|
title: "Max one method parameter definition per line",
|
|
66211
66242
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66212
66243
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66213
|
-
badExample: `
|
|
66214
|
-
METHODS apps_scope_token
|
|
66215
|
-
IMPORTING
|
|
66244
|
+
badExample: `
|
|
66245
|
+
METHODS apps_scope_token
|
|
66246
|
+
IMPORTING
|
|
66216
66247
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66217
|
-
goodExample: `
|
|
66218
|
-
METHODS apps_scope_token
|
|
66219
|
-
IMPORTING
|
|
66220
|
-
body TYPE bodyapps_scope_token
|
|
66248
|
+
goodExample: `
|
|
66249
|
+
METHODS apps_scope_token
|
|
66250
|
+
IMPORTING
|
|
66251
|
+
body TYPE bodyapps_scope_token
|
|
66221
66252
|
client_id TYPE str.`,
|
|
66222
66253
|
};
|
|
66223
66254
|
}
|
|
@@ -66282,11 +66313,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66282
66313
|
key: "max_one_statement",
|
|
66283
66314
|
title: "Max one statement per line",
|
|
66284
66315
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66285
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66286
|
-
|
|
66287
|
-
Does not report anything for chained statements.
|
|
66288
|
-
|
|
66289
|
-
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
|
|
66290
66321
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66291
66322
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66292
66323
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66624,8 +66655,8 @@ class MethodLength {
|
|
|
66624
66655
|
key: "method_length",
|
|
66625
66656
|
title: "Method/Form Length",
|
|
66626
66657
|
shortDescription: `Checks relating to method/form length.`,
|
|
66627
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66628
|
-
|
|
66658
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66659
|
+
|
|
66629
66660
|
Abstract methods without statements are considered okay.`,
|
|
66630
66661
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66631
66662
|
};
|
|
@@ -66730,20 +66761,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66730
66761
|
key: "method_overwrites_builtin",
|
|
66731
66762
|
title: "Method name overwrites builtin function",
|
|
66732
66763
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66733
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66734
|
-
|
|
66735
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66736
|
-
|
|
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
|
+
|
|
66737
66768
|
Interface method names are ignored`,
|
|
66738
66769
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66739
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66740
|
-
PUBLIC SECTION.
|
|
66741
|
-
METHODS matches.
|
|
66742
|
-
ENDCLASS.
|
|
66743
|
-
|
|
66744
|
-
CLASS lcl IMPLEMENTATION.
|
|
66745
|
-
METHOD matches.
|
|
66746
|
-
ENDMETHOD.
|
|
66770
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66771
|
+
PUBLIC SECTION.
|
|
66772
|
+
METHODS matches.
|
|
66773
|
+
ENDCLASS.
|
|
66774
|
+
|
|
66775
|
+
CLASS lcl IMPLEMENTATION.
|
|
66776
|
+
METHOD matches.
|
|
66777
|
+
ENDMETHOD.
|
|
66747
66778
|
ENDCLASS.`,
|
|
66748
66779
|
};
|
|
66749
66780
|
}
|
|
@@ -66934,12 +66965,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66934
66965
|
// eslint-disable-next-line max-len
|
|
66935
66966
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66936
66967
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66937
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66938
|
-
PUBLIC SECTION.
|
|
66939
|
-
METHODS
|
|
66940
|
-
foobar
|
|
66941
|
-
EXPORTING foo TYPE i
|
|
66942
|
-
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.
|
|
66943
66974
|
ENDCLASS.`,
|
|
66944
66975
|
};
|
|
66945
66976
|
}
|
|
@@ -67319,7 +67350,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67319
67350
|
key: "nesting",
|
|
67320
67351
|
title: "Check nesting depth",
|
|
67321
67352
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67322
|
-
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
|
|
67323
67354
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67324
67355
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67325
67356
|
};
|
|
@@ -67562,7 +67593,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67562
67593
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67563
67594
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67564
67595
|
badExample: `var1 = var2 = var3.`,
|
|
67565
|
-
goodExample: `var2 = var3.
|
|
67596
|
+
goodExample: `var2 = var3.
|
|
67566
67597
|
var1 = var2.`,
|
|
67567
67598
|
};
|
|
67568
67599
|
}
|
|
@@ -67621,8 +67652,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67621
67652
|
key: "no_external_form_calls",
|
|
67622
67653
|
title: "No external FORM calls",
|
|
67623
67654
|
shortDescription: `Detect external form calls`,
|
|
67624
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67625
|
-
|
|
67655
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67656
|
+
|
|
67626
67657
|
PERFORM foo(bar).`,
|
|
67627
67658
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67628
67659
|
};
|
|
@@ -67683,17 +67714,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67683
67714
|
key: "no_inline_in_optional_branches",
|
|
67684
67715
|
title: "Don't declare inline in optional branches",
|
|
67685
67716
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67686
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67687
|
-
|
|
67688
|
-
Considered optional branches:
|
|
67689
|
-
* inside IF/ELSEIF/ELSE
|
|
67690
|
-
* inside LOOP
|
|
67691
|
-
* inside WHILE
|
|
67692
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67693
|
-
* inside DO
|
|
67694
|
-
* inside SELECT loops
|
|
67695
|
-
|
|
67696
|
-
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:
|
|
67697
67728
|
* TRY/CATCH/CLEANUP`,
|
|
67698
67729
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67699
67730
|
};
|
|
@@ -67793,12 +67824,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67793
67824
|
key: "no_prefixes",
|
|
67794
67825
|
title: "No Prefixes",
|
|
67795
67826
|
shortDescription: `Dont use hungarian notation`,
|
|
67796
|
-
extendedInformation: `
|
|
67797
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67798
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67799
|
-
|
|
67800
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67801
|
-
|
|
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
|
+
|
|
67802
67833
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67803
67834
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67804
67835
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67977,7 +68008,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67977
68008
|
return {
|
|
67978
68009
|
key: "no_public_attributes",
|
|
67979
68010
|
title: "No public attributes",
|
|
67980
|
-
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.
|
|
67981
68012
|
Exceptions are excluded from this rule.`,
|
|
67982
68013
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67983
68014
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -68078,13 +68109,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
68078
68109
|
key: "no_yoda_conditions",
|
|
68079
68110
|
title: "No Yoda conditions",
|
|
68080
68111
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
68081
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68082
|
-
|
|
68112
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68113
|
+
|
|
68083
68114
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
68084
68115
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68085
|
-
badExample: `IF 0 <> sy-subrc.
|
|
68116
|
+
badExample: `IF 0 <> sy-subrc.
|
|
68086
68117
|
ENDIF.`,
|
|
68087
|
-
goodExample: `IF sy-subrc <> 0.
|
|
68118
|
+
goodExample: `IF sy-subrc <> 0.
|
|
68088
68119
|
ENDIF.`,
|
|
68089
68120
|
};
|
|
68090
68121
|
}
|
|
@@ -68185,8 +68216,8 @@ class NROBConsistency {
|
|
|
68185
68216
|
key: "nrob_consistency",
|
|
68186
68217
|
title: "Number range consistency",
|
|
68187
68218
|
shortDescription: `Consistency checks for number ranges`,
|
|
68188
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68189
|
-
|
|
68219
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68220
|
+
|
|
68190
68221
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
68191
68222
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68192
68223
|
};
|
|
@@ -68463,58 +68494,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68463
68494
|
title: "Obsolete statements",
|
|
68464
68495
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68465
68496
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68466
|
-
extendedInformation: `
|
|
68467
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68468
|
-
|
|
68469
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68470
|
-
|
|
68471
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68472
|
-
|
|
68473
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68474
|
-
|
|
68475
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68476
|
-
|
|
68477
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68478
|
-
|
|
68479
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68480
|
-
|
|
68481
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68482
|
-
|
|
68483
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68484
|
-
|
|
68485
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68486
|
-
|
|
68487
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68488
|
-
|
|
68489
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68490
|
-
|
|
68491
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68492
|
-
|
|
68493
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68494
|
-
|
|
68495
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68496
|
-
SELECT COUNT(*) is considered okay
|
|
68497
|
-
|
|
68498
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68499
|
-
|
|
68500
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68501
|
-
|
|
68502
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68503
|
-
|
|
68504
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68505
|
-
|
|
68506
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68507
|
-
|
|
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
|
+
|
|
68508
68539
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68509
|
-
badExample: `REFRESH itab.
|
|
68510
|
-
|
|
68511
|
-
COMPUTE foo = 2 + 2.
|
|
68512
|
-
|
|
68513
|
-
MULTIPLY lv_foo BY 2.
|
|
68514
|
-
|
|
68515
|
-
INTERFACE intf LOAD.
|
|
68516
|
-
|
|
68517
|
-
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.
|
|
68518
68549
|
ENDIF.`,
|
|
68519
68550
|
};
|
|
68520
68551
|
}
|
|
@@ -68854,9 +68885,9 @@ class OmitParameterName {
|
|
|
68854
68885
|
key: "omit_parameter_name",
|
|
68855
68886
|
title: "Omit parameter name",
|
|
68856
68887
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68857
|
-
extendedInformation: `
|
|
68858
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68859
|
-
|
|
68888
|
+
extendedInformation: `
|
|
68889
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68890
|
+
|
|
68860
68891
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68861
68892
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68862
68893
|
badExample: `method( param = 2 ).`,
|
|
@@ -69062,20 +69093,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
69062
69093
|
shortDescription: `Omit RECEIVING`,
|
|
69063
69094
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
69064
69095
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69065
|
-
badExample: `
|
|
69066
|
-
upload_pack(
|
|
69067
|
-
EXPORTING
|
|
69068
|
-
io_client = lo_client
|
|
69069
|
-
iv_url = iv_url
|
|
69070
|
-
iv_deepen_level = iv_deepen_level
|
|
69071
|
-
it_hashes = lt_hashes
|
|
69072
|
-
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
|
|
69073
69104
|
rt_objects = et_objects ).`,
|
|
69074
|
-
goodExample: `
|
|
69075
|
-
et_objects = upload_pack(
|
|
69076
|
-
io_client = lo_client
|
|
69077
|
-
iv_url = iv_url
|
|
69078
|
-
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
|
|
69079
69110
|
it_hashes = lt_hashes ).`,
|
|
69080
69111
|
};
|
|
69081
69112
|
}
|
|
@@ -69139,8 +69170,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
69139
69170
|
return {
|
|
69140
69171
|
key: "parser_702_chaining",
|
|
69141
69172
|
title: "Parser Error, bad chanining on 702",
|
|
69142
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69143
|
-
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.
|
|
69144
69175
|
Only active on target version 702 and below.`,
|
|
69145
69176
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69146
69177
|
};
|
|
@@ -69220,8 +69251,8 @@ class ParserError {
|
|
|
69220
69251
|
return {
|
|
69221
69252
|
key: "parser_error",
|
|
69222
69253
|
title: "Parser error",
|
|
69223
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69224
|
-
|
|
69254
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69255
|
+
|
|
69225
69256
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69226
69257
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69227
69258
|
};
|
|
@@ -69306,7 +69337,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69306
69337
|
return {
|
|
69307
69338
|
key: "parser_missing_space",
|
|
69308
69339
|
title: "Parser Error, missing space",
|
|
69309
|
-
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.
|
|
69310
69341
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69311
69342
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69312
69343
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69729,25 +69760,25 @@ class PreferInline {
|
|
|
69729
69760
|
key: "prefer_inline",
|
|
69730
69761
|
title: "Prefer Inline Declarations",
|
|
69731
69762
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69732
|
-
extendedInformation: `EXPERIMENTAL
|
|
69733
|
-
|
|
69734
|
-
Activates if language version is v740sp02 or above.
|
|
69735
|
-
|
|
69736
|
-
Variables must be local(METHOD or FORM).
|
|
69737
|
-
|
|
69738
|
-
No generic or void typed variables. No syntax errors.
|
|
69739
|
-
|
|
69740
|
-
First position used must be a full/pure write.
|
|
69741
|
-
|
|
69742
|
-
Move statment is not a cast(?=)
|
|
69743
|
-
|
|
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
|
+
|
|
69744
69775
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69745
69776
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69746
|
-
badExample: `DATA foo TYPE i.
|
|
69747
|
-
foo = 2.
|
|
69748
|
-
DATA percentage TYPE decfloat34.
|
|
69777
|
+
badExample: `DATA foo TYPE i.
|
|
69778
|
+
foo = 2.
|
|
69779
|
+
DATA percentage TYPE decfloat34.
|
|
69749
69780
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69750
|
-
goodExample: `DATA(foo) = 2.
|
|
69781
|
+
goodExample: `DATA(foo) = 2.
|
|
69751
69782
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69752
69783
|
};
|
|
69753
69784
|
}
|
|
@@ -69961,18 +69992,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69961
69992
|
key: "prefer_is_not",
|
|
69962
69993
|
title: "Prefer IS NOT to NOT IS",
|
|
69963
69994
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69964
|
-
extendedInformation: `
|
|
69965
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69966
|
-
|
|
69995
|
+
extendedInformation: `
|
|
69996
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69997
|
+
|
|
69967
69998
|
"if not is_valid( )." examples are skipped`,
|
|
69968
69999
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69969
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69970
|
-
IF variable NP 'TODO*'.
|
|
69971
|
-
IF variable <> 42.
|
|
70000
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
70001
|
+
IF variable NP 'TODO*'.
|
|
70002
|
+
IF variable <> 42.
|
|
69972
70003
|
IF variable CO 'hello'.`,
|
|
69973
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69974
|
-
IF NOT variable CP 'TODO*'.
|
|
69975
|
-
IF NOT variable = 42.
|
|
70004
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
70005
|
+
IF NOT variable CP 'TODO*'.
|
|
70006
|
+
IF NOT variable = 42.
|
|
69976
70007
|
IF NOT variable CA 'hello'.`,
|
|
69977
70008
|
};
|
|
69978
70009
|
}
|
|
@@ -70160,14 +70191,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
70160
70191
|
key: "prefer_raise_exception_new",
|
|
70161
70192
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
70162
70193
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
70163
|
-
extendedInformation: `
|
|
70164
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70165
|
-
|
|
70194
|
+
extendedInformation: `
|
|
70195
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70196
|
+
|
|
70166
70197
|
From 752 and up`,
|
|
70167
70198
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
70168
70199
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
70169
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70170
|
-
EXPORTING
|
|
70200
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70201
|
+
EXPORTING
|
|
70171
70202
|
previous = exception.`,
|
|
70172
70203
|
};
|
|
70173
70204
|
}
|
|
@@ -70245,12 +70276,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70245
70276
|
key: "prefer_returning_to_exporting",
|
|
70246
70277
|
title: "Prefer RETURNING to EXPORTING",
|
|
70247
70278
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70248
|
-
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
|
|
70249
70280
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70250
70281
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70251
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70252
|
-
PUBLIC SECTION.
|
|
70253
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70282
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70283
|
+
PUBLIC SECTION.
|
|
70284
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70254
70285
|
ENDCLASS.`,
|
|
70255
70286
|
};
|
|
70256
70287
|
}
|
|
@@ -70346,8 +70377,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70346
70377
|
key: "prefer_xsdbool",
|
|
70347
70378
|
title: "Prefer xsdbool over boolc",
|
|
70348
70379
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70349
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70350
|
-
|
|
70380
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70381
|
+
|
|
70351
70382
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70352
70383
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70353
70384
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70419,9 +70450,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70419
70450
|
title: "Preferred compare operator",
|
|
70420
70451
|
shortDescription: `Configure undesired operator variants`,
|
|
70421
70452
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70422
|
-
badExample: `IF foo EQ bar.
|
|
70453
|
+
badExample: `IF foo EQ bar.
|
|
70423
70454
|
ENDIF.`,
|
|
70424
|
-
goodExample: `IF foo = bar.
|
|
70455
|
+
goodExample: `IF foo = bar.
|
|
70425
70456
|
ENDIF.`,
|
|
70426
70457
|
};
|
|
70427
70458
|
}
|
|
@@ -70645,26 +70676,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70645
70676
|
key: "reduce_procedural_code",
|
|
70646
70677
|
title: "Reduce procedural code",
|
|
70647
70678
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70648
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70649
|
-
|
|
70650
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70651
|
-
|
|
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
|
+
|
|
70652
70683
|
Comments are not counted as statements.`,
|
|
70653
70684
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70654
|
-
badExample: `FORM foo.
|
|
70655
|
-
DATA lv_bar TYPE i.
|
|
70656
|
-
lv_bar = 2 + 2.
|
|
70657
|
-
IF lv_bar = 4.
|
|
70658
|
-
WRITE 'hello world'.
|
|
70659
|
-
ENDIF.
|
|
70660
|
-
DATA lv_bar TYPE i.
|
|
70661
|
-
lv_bar = 2 + 2.
|
|
70662
|
-
IF lv_bar = 4.
|
|
70663
|
-
WRITE 'hello world'.
|
|
70664
|
-
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.
|
|
70665
70696
|
ENDFORM.`,
|
|
70666
|
-
goodExample: `FORM foo.
|
|
70667
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70697
|
+
goodExample: `FORM foo.
|
|
70698
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70668
70699
|
ENDFORM.`,
|
|
70669
70700
|
};
|
|
70670
70701
|
}
|
|
@@ -70908,10 +70939,10 @@ class RemoveDescriptions {
|
|
|
70908
70939
|
return {
|
|
70909
70940
|
key: "remove_descriptions",
|
|
70910
70941
|
title: "Remove descriptions",
|
|
70911
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70912
|
-
|
|
70913
|
-
Class descriptions are required, see rule description_empty.
|
|
70914
|
-
|
|
70942
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70943
|
+
|
|
70944
|
+
Class descriptions are required, see rule description_empty.
|
|
70945
|
+
|
|
70915
70946
|
Consider using ABAP Doc for documentation.`,
|
|
70916
70947
|
tags: [],
|
|
70917
70948
|
};
|
|
@@ -71036,14 +71067,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
71036
71067
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71037
71068
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
71038
71069
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
71039
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
71070
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
71040
71071
|
DESTINATION lv_rfc.`,
|
|
71041
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71042
|
-
DESTINATION lv_rfc
|
|
71043
|
-
EXCEPTIONS
|
|
71044
|
-
system_failure = 1 MESSAGE msg
|
|
71045
|
-
communication_failure = 2 MESSAGE msg
|
|
71046
|
-
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
|
|
71047
71078
|
OTHERS = 4.`,
|
|
71048
71079
|
};
|
|
71049
71080
|
}
|
|
@@ -71127,11 +71158,11 @@ class SelectAddOrderBy {
|
|
|
71127
71158
|
key: "select_add_order_by",
|
|
71128
71159
|
title: "SELECT add ORDER BY",
|
|
71129
71160
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
71130
|
-
extendedInformation: `
|
|
71131
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71132
|
-
|
|
71133
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
71134
|
-
|
|
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
|
+
|
|
71135
71166
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
71136
71167
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71137
71168
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71262,14 +71293,14 @@ class SelectPerformance {
|
|
|
71262
71293
|
key: "select_performance",
|
|
71263
71294
|
title: "SELECT performance",
|
|
71264
71295
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71265
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71266
|
-
|
|
71296
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71297
|
+
|
|
71267
71298
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71268
71299
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71269
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71270
|
-
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.
|
|
71271
71302
|
ENDSELECT.`,
|
|
71272
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71303
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71273
71304
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71274
71305
|
};
|
|
71275
71306
|
}
|
|
@@ -71383,8 +71414,8 @@ class SelectSingleFullKey {
|
|
|
71383
71414
|
key: "select_single_full_key",
|
|
71384
71415
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71385
71416
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71386
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71387
|
-
|
|
71417
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71418
|
+
|
|
71388
71419
|
If the statement contains a JOIN it is not checked`,
|
|
71389
71420
|
pseudoComment: "EC CI_NOORDER",
|
|
71390
71421
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71812,8 +71843,8 @@ class SICFConsistency {
|
|
|
71812
71843
|
key: "sicf_consistency",
|
|
71813
71844
|
title: "SICF consistency",
|
|
71814
71845
|
shortDescription: `Checks the validity of ICF services`,
|
|
71815
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71816
|
-
* Class must not have any syntax errors
|
|
71846
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71847
|
+
* Class must not have any syntax errors
|
|
71817
71848
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71818
71849
|
};
|
|
71819
71850
|
}
|
|
@@ -71925,23 +71956,23 @@ class SlowParameterPassing {
|
|
|
71925
71956
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71926
71957
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71927
71958
|
tags: [_irule_1.RuleTag.Performance],
|
|
71928
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71929
|
-
PUBLIC SECTION.
|
|
71930
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71931
|
-
ENDCLASS.
|
|
71932
|
-
CLASS lcl IMPLEMENTATION.
|
|
71933
|
-
METHOD bar.
|
|
71934
|
-
WRITE sdf.
|
|
71935
|
-
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.
|
|
71936
71967
|
ENDCLASS.`,
|
|
71937
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71938
|
-
PUBLIC SECTION.
|
|
71939
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71940
|
-
ENDCLASS.
|
|
71941
|
-
CLASS lcl IMPLEMENTATION.
|
|
71942
|
-
METHOD bar.
|
|
71943
|
-
WRITE sdf.
|
|
71944
|
-
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.
|
|
71945
71976
|
ENDCLASS.`,
|
|
71946
71977
|
};
|
|
71947
71978
|
}
|
|
@@ -72105,6 +72136,8 @@ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/co
|
|
|
72105
72136
|
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
72106
72137
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
72107
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");
|
|
72108
72141
|
class SpaceBeforeColonConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
72109
72142
|
}
|
|
72110
72143
|
exports.SpaceBeforeColonConf = SpaceBeforeColonConf;
|
|
@@ -72135,22 +72168,34 @@ class SpaceBeforeColon extends _abap_rule_1.ABAPRule {
|
|
|
72135
72168
|
}
|
|
72136
72169
|
runParsed(file) {
|
|
72137
72170
|
const issues = [];
|
|
72138
|
-
|
|
72139
|
-
|
|
72140
|
-
if (
|
|
72141
|
-
|
|
72142
|
-
|
|
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;
|
|
72143
72177
|
}
|
|
72144
|
-
|
|
72145
|
-
|
|
72146
|
-
|
|
72147
|
-
|
|
72148
|
-
|
|
72149
|
-
|
|
72150
|
-
|
|
72151
|
-
|
|
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;
|
|
72152
72198
|
}
|
|
72153
|
-
prev = token;
|
|
72154
72199
|
}
|
|
72155
72200
|
return issues;
|
|
72156
72201
|
}
|
|
@@ -72198,8 +72243,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
72198
72243
|
key: "space_before_dot",
|
|
72199
72244
|
title: "Space before dot",
|
|
72200
72245
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
72201
|
-
extendedInformation: `
|
|
72202
|
-
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
|
|
72203
72248
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
72204
72249
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72205
72250
|
badExample: `WRITE bar .`,
|
|
@@ -72385,12 +72430,12 @@ class SQLValueConversion {
|
|
|
72385
72430
|
key: "sql_value_conversion",
|
|
72386
72431
|
title: "Implicit SQL Value Conversion",
|
|
72387
72432
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72388
|
-
extendedInformation: `
|
|
72389
|
-
* Integer to CHAR conversion
|
|
72390
|
-
* Integer to NUMC conversion
|
|
72391
|
-
* NUMC to Integer conversion
|
|
72392
|
-
* CHAR to Integer conversion
|
|
72393
|
-
* 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
|
|
72394
72439
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72395
72440
|
tags: [],
|
|
72396
72441
|
};
|
|
@@ -72462,7 +72507,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72462
72507
|
key: "start_at_tab",
|
|
72463
72508
|
title: "Start at tab",
|
|
72464
72509
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72465
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72510
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72466
72511
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72467
72512
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72468
72513
|
badExample: ` WRITE a.`,
|
|
@@ -72639,12 +72684,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72639
72684
|
key: "strict_sql",
|
|
72640
72685
|
title: "Strict SQL",
|
|
72641
72686
|
shortDescription: `Strict SQL`,
|
|
72642
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72643
|
-
|
|
72644
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72645
|
-
|
|
72646
|
-
Also see separate rule sql_escape_host_variables
|
|
72647
|
-
|
|
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
|
+
|
|
72648
72693
|
Activates from v750 and up`,
|
|
72649
72694
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72650
72695
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72898,11 +72943,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72898
72943
|
key: "sy_modification",
|
|
72899
72944
|
title: "Modification of SY fields",
|
|
72900
72945
|
shortDescription: `Finds modification of sy fields`,
|
|
72901
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72902
|
-
|
|
72946
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72947
|
+
|
|
72903
72948
|
Changes to SY-TVAR* fields are not reported`,
|
|
72904
72949
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72905
|
-
badExample: `sy-uname = 2.
|
|
72950
|
+
badExample: `sy-uname = 2.
|
|
72906
72951
|
sy = sy.`,
|
|
72907
72952
|
};
|
|
72908
72953
|
}
|
|
@@ -72964,8 +73009,8 @@ class TABLEnhancementCategory {
|
|
|
72964
73009
|
key: "tabl_enhancement_category",
|
|
72965
73010
|
title: "TABL enhancement category must be set",
|
|
72966
73011
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72967
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72968
|
-
|
|
73012
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73013
|
+
|
|
72969
73014
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72970
73015
|
tags: [],
|
|
72971
73016
|
};
|
|
@@ -73030,8 +73075,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
73030
73075
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
73031
73076
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
73032
73077
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73033
|
-
badExample: `FORM foo.
|
|
73034
|
-
TABLES t100.
|
|
73078
|
+
badExample: `FORM foo.
|
|
73079
|
+
TABLES t100.
|
|
73035
73080
|
ENDFORM.`,
|
|
73036
73081
|
goodExample: `TABLES t000.`,
|
|
73037
73082
|
};
|
|
@@ -73159,9 +73204,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
73159
73204
|
title: "Type FORM parameters",
|
|
73160
73205
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
73161
73206
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73162
|
-
badExample: `FORM foo USING bar.
|
|
73207
|
+
badExample: `FORM foo USING bar.
|
|
73163
73208
|
ENDFORM.`,
|
|
73164
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
73209
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
73165
73210
|
ENDFORM.`,
|
|
73166
73211
|
};
|
|
73167
73212
|
}
|
|
@@ -73834,38 +73879,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73834
73879
|
key: "unnecessary_pragma",
|
|
73835
73880
|
title: "Unnecessary Pragma",
|
|
73836
73881
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73837
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73838
|
-
|
|
73839
|
-
* NEEDED without definition
|
|
73840
|
-
|
|
73841
|
-
* NO_TEXT without texts
|
|
73842
|
-
|
|
73843
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73844
|
-
|
|
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
|
+
|
|
73845
73890
|
NO_HANDLER inside macros are not checked`,
|
|
73846
73891
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73847
|
-
badExample: `TRY.
|
|
73848
|
-
...
|
|
73849
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73850
|
-
RETURN. " it has a handler
|
|
73851
|
-
ENDTRY.
|
|
73852
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73853
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73854
|
-
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.
|
|
73855
73900
|
ENDIF.`,
|
|
73856
|
-
goodExample: `TRY.
|
|
73857
|
-
...
|
|
73858
|
-
CATCH zcx_abapgit_exception.
|
|
73859
|
-
RETURN.
|
|
73860
|
-
ENDTRY.
|
|
73861
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73862
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73863
|
-
IF sy-subrc <> 0.
|
|
73864
|
-
ENDIF.
|
|
73865
|
-
|
|
73866
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73867
|
-
test1 TYPE string,
|
|
73868
|
-
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,
|
|
73869
73914
|
END OF blah.`,
|
|
73870
73915
|
};
|
|
73871
73916
|
}
|
|
@@ -74032,18 +74077,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
74032
74077
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
74033
74078
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
74034
74079
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
74035
|
-
badExample: `FORM hello1.
|
|
74036
|
-
WRITE 'world'.
|
|
74037
|
-
RETURN.
|
|
74038
|
-
ENDFORM.
|
|
74039
|
-
|
|
74040
|
-
FORM foo.
|
|
74041
|
-
IF 1 = 2.
|
|
74042
|
-
RETURN.
|
|
74043
|
-
ENDIF.
|
|
74080
|
+
badExample: `FORM hello1.
|
|
74081
|
+
WRITE 'world'.
|
|
74082
|
+
RETURN.
|
|
74083
|
+
ENDFORM.
|
|
74084
|
+
|
|
74085
|
+
FORM foo.
|
|
74086
|
+
IF 1 = 2.
|
|
74087
|
+
RETURN.
|
|
74088
|
+
ENDIF.
|
|
74044
74089
|
ENDFORM.`,
|
|
74045
|
-
goodExample: `FORM hello2.
|
|
74046
|
-
WRITE 'world'.
|
|
74090
|
+
goodExample: `FORM hello2.
|
|
74091
|
+
WRITE 'world'.
|
|
74047
74092
|
ENDFORM.`,
|
|
74048
74093
|
};
|
|
74049
74094
|
}
|
|
@@ -74394,13 +74439,13 @@ class UnusedMacros {
|
|
|
74394
74439
|
title: "Unused macros",
|
|
74395
74440
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74396
74441
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74397
|
-
badExample: `DEFINE foobar1.
|
|
74398
|
-
WRITE 'hello'.
|
|
74442
|
+
badExample: `DEFINE foobar1.
|
|
74443
|
+
WRITE 'hello'.
|
|
74399
74444
|
END-OF-DEFINITION.`,
|
|
74400
|
-
goodExample: `DEFINE foobar2.
|
|
74401
|
-
WRITE 'hello'.
|
|
74402
|
-
END-OF-DEFINITION.
|
|
74403
|
-
|
|
74445
|
+
goodExample: `DEFINE foobar2.
|
|
74446
|
+
WRITE 'hello'.
|
|
74447
|
+
END-OF-DEFINITION.
|
|
74448
|
+
|
|
74404
74449
|
foobar2.`,
|
|
74405
74450
|
};
|
|
74406
74451
|
}
|
|
@@ -74512,18 +74557,18 @@ class UnusedMethods {
|
|
|
74512
74557
|
key: "unused_methods",
|
|
74513
74558
|
title: "Unused methods",
|
|
74514
74559
|
shortDescription: `Checks for unused methods`,
|
|
74515
|
-
extendedInformation: `Checks private and protected methods.
|
|
74516
|
-
|
|
74517
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74518
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74519
|
-
|
|
74520
|
-
Skips:
|
|
74521
|
-
* methods FOR TESTING
|
|
74522
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74523
|
-
* class_constructor + constructor methods
|
|
74524
|
-
* event handlers
|
|
74525
|
-
* methods that are redefined
|
|
74526
|
-
* 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
|
|
74527
74572
|
`,
|
|
74528
74573
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74529
74574
|
pragma: "##CALLED",
|
|
@@ -74999,23 +75044,23 @@ class UnusedVariables {
|
|
|
74999
75044
|
key: "unused_variables",
|
|
75000
75045
|
title: "Unused variables",
|
|
75001
75046
|
shortDescription: `Checks for unused variables and constants`,
|
|
75002
|
-
extendedInformation: `Skips event parameters.
|
|
75003
|
-
|
|
75004
|
-
Note that this currently does not work if the source code uses macros.
|
|
75005
|
-
|
|
75006
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75007
|
-
|
|
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
|
+
|
|
75008
75053
|
Errors found in INCLUDES are reported for the main program.`,
|
|
75009
75054
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75010
75055
|
pragma: "##NEEDED",
|
|
75011
75056
|
pseudoComment: "EC NEEDED",
|
|
75012
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
75013
|
-
test TYPE string,
|
|
75014
|
-
test2 TYPE string,
|
|
75057
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
75058
|
+
test TYPE string,
|
|
75059
|
+
test2 TYPE string,
|
|
75015
75060
|
END OF blah1.`,
|
|
75016
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75017
|
-
test TYPE string,
|
|
75018
|
-
test2 TYPE string,
|
|
75061
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75062
|
+
test TYPE string,
|
|
75063
|
+
test2 TYPE string,
|
|
75019
75064
|
END OF blah2.`,
|
|
75020
75065
|
};
|
|
75021
75066
|
}
|
|
@@ -75234,15 +75279,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75234
75279
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75235
75280
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75236
75281
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75237
|
-
badExample: `IF line IS INITIAL.
|
|
75238
|
-
has_entries = abap_false.
|
|
75239
|
-
ELSE.
|
|
75240
|
-
has_entries = abap_true.
|
|
75241
|
-
ENDIF.
|
|
75242
|
-
|
|
75282
|
+
badExample: `IF line IS INITIAL.
|
|
75283
|
+
has_entries = abap_false.
|
|
75284
|
+
ELSE.
|
|
75285
|
+
has_entries = abap_true.
|
|
75286
|
+
ENDIF.
|
|
75287
|
+
|
|
75243
75288
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75244
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75245
|
-
|
|
75289
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75290
|
+
|
|
75246
75291
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75247
75292
|
};
|
|
75248
75293
|
}
|
|
@@ -75360,15 +75405,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75360
75405
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75361
75406
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75362
75407
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75363
|
-
badExample: `INTERFACE lif.
|
|
75364
|
-
METHODS load_data
|
|
75365
|
-
EXCEPTIONS
|
|
75366
|
-
invalid_parameter.
|
|
75408
|
+
badExample: `INTERFACE lif.
|
|
75409
|
+
METHODS load_data
|
|
75410
|
+
EXCEPTIONS
|
|
75411
|
+
invalid_parameter.
|
|
75367
75412
|
ENDINTERFACE.`,
|
|
75368
|
-
goodExample: `INTERFACE lif.
|
|
75369
|
-
METHODS load_data
|
|
75370
|
-
RAISING
|
|
75371
|
-
cx_something.
|
|
75413
|
+
goodExample: `INTERFACE lif.
|
|
75414
|
+
METHODS load_data
|
|
75415
|
+
RAISING
|
|
75416
|
+
cx_something.
|
|
75372
75417
|
ENDINTERFACE.`,
|
|
75373
75418
|
};
|
|
75374
75419
|
}
|
|
@@ -75428,15 +75473,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75428
75473
|
key: "use_line_exists",
|
|
75429
75474
|
title: "Use line_exists",
|
|
75430
75475
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75431
|
-
extendedInformation: `
|
|
75432
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75433
|
-
|
|
75476
|
+
extendedInformation: `
|
|
75477
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75478
|
+
|
|
75434
75479
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75435
75480
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75436
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75437
|
-
IF sy-subrc = 0.
|
|
75481
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75482
|
+
IF sy-subrc = 0.
|
|
75438
75483
|
ENDIF.`,
|
|
75439
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75484
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75440
75485
|
ENDIF.`,
|
|
75441
75486
|
};
|
|
75442
75487
|
}
|
|
@@ -75546,10 +75591,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75546
75591
|
key: "use_new",
|
|
75547
75592
|
title: "Use NEW",
|
|
75548
75593
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75549
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75550
|
-
|
|
75551
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75552
|
-
|
|
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
|
+
|
|
75553
75598
|
Applicable from v740sp02 and up`,
|
|
75554
75599
|
badExample: `CREATE OBJECT ref.`,
|
|
75555
75600
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75647,13 +75692,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75647
75692
|
title: "WHEN OTHERS last",
|
|
75648
75693
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75649
75694
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75650
|
-
badExample: `CASE bar.
|
|
75651
|
-
WHEN OTHERS.
|
|
75652
|
-
WHEN 2.
|
|
75695
|
+
badExample: `CASE bar.
|
|
75696
|
+
WHEN OTHERS.
|
|
75697
|
+
WHEN 2.
|
|
75653
75698
|
ENDCASE.`,
|
|
75654
|
-
goodExample: `CASE bar.
|
|
75655
|
-
WHEN 2.
|
|
75656
|
-
WHEN OTHERS.
|
|
75699
|
+
goodExample: `CASE bar.
|
|
75700
|
+
WHEN 2.
|
|
75701
|
+
WHEN OTHERS.
|
|
75657
75702
|
ENDCASE.`,
|
|
75658
75703
|
};
|
|
75659
75704
|
}
|