@abaplint/cli 2.113.24 → 2.113.26
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 +889 -866
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -7752,6 +7752,7 @@ class Source extends combi_1.Expression {
|
|
|
7752
7752
|
const method = (0, combi_1.seq)(_1.MethodCallChain, (0, combi_1.optPrio)((0, combi_1.altPrio)(attr, comp)), deref);
|
|
7753
7753
|
const rparen = (0, combi_1.tok)(tokens_1.WParenRightW);
|
|
7754
7754
|
const rparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
7755
|
+
const lparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW));
|
|
7755
7756
|
// paren used for eg. "( 2 + 1 ) * 4"
|
|
7756
7757
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), Source, rparen);
|
|
7757
7758
|
const after = (0, combi_1.seq)((0, combi_1.altPrio)("&", "&&", _1.ArithOperator), Source);
|
|
@@ -7759,7 +7760,7 @@ class Source extends combi_1.Expression {
|
|
|
7759
7760
|
const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlus), "BIT-NOT");
|
|
7760
7761
|
const old = (0, combi_1.seq)((0, combi_1.optPrio)(prefix), (0, combi_1.altPrio)(_1.Constant, _1.StringTemplate, text_element_1.TextElement, bool, method, (0, combi_1.seq)(_1.FieldChain, deref), paren), (0, combi_1.optPrio)(after));
|
|
7761
7762
|
const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)));
|
|
7762
|
-
const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer,
|
|
7763
|
+
const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, lparenNoSpace, _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
7763
7764
|
const swit = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("SWITCH", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.SwitchBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
7764
7765
|
const value = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("VALUE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ValueBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
7765
7766
|
const cond = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("COND", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CondBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
@@ -9325,8 +9326,8 @@ class TypeTable extends combi_1.Expression {
|
|
|
9325
9326
|
const generic = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE");
|
|
9326
9327
|
const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), _1.TypeName);
|
|
9327
9328
|
const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
|
|
9328
|
-
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
9329
|
-
const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
9329
|
+
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial), (0, combi_1.optPrio)("VALUE IS INITIAL"));
|
|
9330
|
+
const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial), (0, combi_1.optPrio)("VALUE IS INITIAL"));
|
|
9330
9331
|
// a maximum of 15 secondary table keys can be defined
|
|
9331
9332
|
// "WITH" is not allowed as a field name in keys
|
|
9332
9333
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
@@ -35173,13 +35174,13 @@ class FlowGraph {
|
|
|
35173
35174
|
this.label = label;
|
|
35174
35175
|
}
|
|
35175
35176
|
toDigraph() {
|
|
35176
|
-
return `digraph G {
|
|
35177
|
-
labelloc="t";
|
|
35178
|
-
label="${this.label}";
|
|
35179
|
-
graph [fontname = "helvetica"];
|
|
35180
|
-
node [fontname = "helvetica", shape="box"];
|
|
35181
|
-
edge [fontname = "helvetica"];
|
|
35182
|
-
${this.toTextEdges()}
|
|
35177
|
+
return `digraph G {
|
|
35178
|
+
labelloc="t";
|
|
35179
|
+
label="${this.label}";
|
|
35180
|
+
graph [fontname = "helvetica"];
|
|
35181
|
+
node [fontname = "helvetica", shape="box"];
|
|
35182
|
+
edge [fontname = "helvetica"];
|
|
35183
|
+
${this.toTextEdges()}
|
|
35183
35184
|
}`;
|
|
35184
35185
|
}
|
|
35185
35186
|
listSources(node) {
|
|
@@ -40702,8 +40703,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
|
|
|
40702
40703
|
const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
40703
40704
|
class CDSSource extends combi_1.Expression {
|
|
40704
40705
|
getRunnable() {
|
|
40705
|
-
|
|
40706
|
-
return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
|
|
40706
|
+
return (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSAs));
|
|
40707
40707
|
}
|
|
40708
40708
|
}
|
|
40709
40709
|
exports.CDSSource = CDSSource;
|
|
@@ -43451,13 +43451,13 @@ class Help {
|
|
|
43451
43451
|
/////////////////////////////////////////////////
|
|
43452
43452
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43453
43453
|
let content = "";
|
|
43454
|
-
content = `
|
|
43455
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43456
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43457
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43458
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43459
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43460
|
-
<hr>
|
|
43454
|
+
content = `
|
|
43455
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43456
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43457
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43458
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43459
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43460
|
+
<hr>
|
|
43461
43461
|
` +
|
|
43462
43462
|
"<tt>" + textDocument.uri + " (" +
|
|
43463
43463
|
(position.line + 1) + ", " +
|
|
@@ -46669,15 +46669,15 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
46669
46669
|
}
|
|
46670
46670
|
}
|
|
46671
46671
|
findSourcesAndRelations(tree) {
|
|
46672
|
-
var _a, _b, _c, _d, _e, _f;
|
|
46672
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
46673
46673
|
for (const e of tree.findAllExpressions(expressions_1.CDSSource)) {
|
|
46674
|
-
const name = e.
|
|
46675
|
-
const as = (
|
|
46674
|
+
const name = ((_a = e.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase().replace(/ /g, "")) || "ERROR";
|
|
46675
|
+
const as = (_c = (_b = e.findDirectExpression(expressions_1.CDSAs)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(expressions_1.CDSName)) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStr();
|
|
46676
46676
|
this.parsedData.sources.push({ name, as });
|
|
46677
46677
|
}
|
|
46678
46678
|
for (const e of tree.findAllExpressions(expressions_1.CDSRelation)) {
|
|
46679
46679
|
const name = e.getFirstToken().getStr();
|
|
46680
|
-
const as = (
|
|
46680
|
+
const as = (_e = (_d = e.findDirectExpression(expressions_1.CDSAs)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(expressions_1.CDSName)) === null || _e === void 0 ? void 0 : _e.getFirstToken().getStr();
|
|
46681
46681
|
this.parsedData.relations.push({ name, as });
|
|
46682
46682
|
}
|
|
46683
46683
|
for (const e of tree.findAllExpressions(expressions_1.CDSAssociation)) {
|
|
@@ -46686,7 +46686,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
46686
46686
|
continue;
|
|
46687
46687
|
}
|
|
46688
46688
|
const name = j.getFirstToken().getStr();
|
|
46689
|
-
const as = (
|
|
46689
|
+
const as = (_g = (_f = j.findDirectExpression(expressions_1.CDSAs)) === null || _f === void 0 ? void 0 : _f.findDirectExpression(expressions_1.CDSName)) === null || _g === void 0 ? void 0 : _g.getFirstToken().getStr();
|
|
46690
46690
|
this.parsedData.associations.push({
|
|
46691
46691
|
name: name || "ERROR",
|
|
46692
46692
|
as: as,
|
|
@@ -51464,6 +51464,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
51464
51464
|
length: length,
|
|
51465
51465
|
decimals: field.DECIMALS,
|
|
51466
51466
|
infoText: this.getName() + "-" + field.FIELDNAME,
|
|
51467
|
+
description: field.DDTEXT,
|
|
51467
51468
|
})
|
|
51468
51469
|
});
|
|
51469
51470
|
}
|
|
@@ -51541,6 +51542,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
51541
51542
|
GROUPNAME: field.GROUPNAME,
|
|
51542
51543
|
CHECKTABLE: field.CHECKTABLE,
|
|
51543
51544
|
REFTYPE: field.REFTYPE,
|
|
51545
|
+
DDTEXT: field.DDTEXT,
|
|
51544
51546
|
});
|
|
51545
51547
|
}
|
|
51546
51548
|
}
|
|
@@ -52050,6 +52052,19 @@ class View extends _abstract_object_1.AbstractObject {
|
|
|
52050
52052
|
}
|
|
52051
52053
|
return new Types.StructureType(components, this.getName());
|
|
52052
52054
|
}
|
|
52055
|
+
listKeys() {
|
|
52056
|
+
var _a;
|
|
52057
|
+
if (this.parsedData === undefined) {
|
|
52058
|
+
this.parseXML();
|
|
52059
|
+
}
|
|
52060
|
+
const ret = [];
|
|
52061
|
+
for (const p of ((_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.fields) || []) {
|
|
52062
|
+
if (p.KEYFLAG === "X") {
|
|
52063
|
+
ret.push(p.FIELDNAME);
|
|
52064
|
+
}
|
|
52065
|
+
}
|
|
52066
|
+
return ret;
|
|
52067
|
+
}
|
|
52053
52068
|
getDescription() {
|
|
52054
52069
|
var _a;
|
|
52055
52070
|
if (this.parsedData === undefined) {
|
|
@@ -52083,6 +52098,7 @@ class View extends _abstract_object_1.AbstractObject {
|
|
|
52083
52098
|
VIEWFIELD: field.VIEWFIELD,
|
|
52084
52099
|
TABNAME: field.TABNAME,
|
|
52085
52100
|
FIELDNAME: field.FIELDNAME,
|
|
52101
|
+
KEYFLAG: field.KEYFLAG,
|
|
52086
52102
|
});
|
|
52087
52103
|
}
|
|
52088
52104
|
const join = (_c = parsed.abapGit["asx:abap"]["asx:values"]) === null || _c === void 0 ? void 0 : _c.DD28J_TABLE;
|
|
@@ -52821,7 +52837,7 @@ class Registry {
|
|
|
52821
52837
|
}
|
|
52822
52838
|
static abaplintVersion() {
|
|
52823
52839
|
// magic, see build script "version.sh"
|
|
52824
|
-
return "2.113.
|
|
52840
|
+
return "2.113.26";
|
|
52825
52841
|
}
|
|
52826
52842
|
getDDICReferences() {
|
|
52827
52843
|
return this.ddicReferences;
|
|
@@ -53140,10 +53156,10 @@ class SevenBitAscii {
|
|
|
53140
53156
|
key: "7bit_ascii",
|
|
53141
53157
|
title: "Check for 7bit ascii",
|
|
53142
53158
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53143
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53144
|
-
|
|
53145
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53146
|
-
|
|
53159
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53160
|
+
|
|
53161
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53162
|
+
|
|
53147
53163
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53148
53164
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53149
53165
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53349,10 +53365,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53349
53365
|
key: "abapdoc",
|
|
53350
53366
|
title: "Check abapdoc",
|
|
53351
53367
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53352
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53353
|
-
|
|
53354
|
-
Plus class and interface definitions.
|
|
53355
|
-
|
|
53368
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53369
|
+
|
|
53370
|
+
Plus class and interface definitions.
|
|
53371
|
+
|
|
53356
53372
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53357
53373
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53358
53374
|
};
|
|
@@ -53489,27 +53505,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53489
53505
|
title: "Add test attributes for tests classes with test methods",
|
|
53490
53506
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53491
53507
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53492
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53493
|
-
PUBLIC SECTION.
|
|
53494
|
-
PROTECTED SECTION.
|
|
53495
|
-
PRIVATE SECTION.
|
|
53496
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53497
|
-
ENDCLASS.
|
|
53498
|
-
|
|
53499
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53500
|
-
METHOD test.
|
|
53501
|
-
ENDMETHOD.
|
|
53508
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53509
|
+
PUBLIC SECTION.
|
|
53510
|
+
PROTECTED SECTION.
|
|
53511
|
+
PRIVATE SECTION.
|
|
53512
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53513
|
+
ENDCLASS.
|
|
53514
|
+
|
|
53515
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53516
|
+
METHOD test.
|
|
53517
|
+
ENDMETHOD.
|
|
53502
53518
|
ENDCLASS.`,
|
|
53503
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53504
|
-
PUBLIC SECTION.
|
|
53505
|
-
PROTECTED SECTION.
|
|
53506
|
-
PRIVATE SECTION.
|
|
53507
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53508
|
-
ENDCLASS.
|
|
53509
|
-
|
|
53510
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53511
|
-
METHOD test.
|
|
53512
|
-
ENDMETHOD.
|
|
53519
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53520
|
+
PUBLIC SECTION.
|
|
53521
|
+
PROTECTED SECTION.
|
|
53522
|
+
PRIVATE SECTION.
|
|
53523
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53524
|
+
ENDCLASS.
|
|
53525
|
+
|
|
53526
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53527
|
+
METHOD test.
|
|
53528
|
+
ENDMETHOD.
|
|
53513
53529
|
ENDCLASS.`,
|
|
53514
53530
|
};
|
|
53515
53531
|
}
|
|
@@ -53595,49 +53611,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53595
53611
|
key: "align_parameters",
|
|
53596
53612
|
title: "Align Parameters",
|
|
53597
53613
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53598
|
-
extendedInformation: `Checks:
|
|
53599
|
-
* function module calls
|
|
53600
|
-
* method calls
|
|
53601
|
-
* VALUE constructors
|
|
53602
|
-
* NEW constructors
|
|
53603
|
-
* RAISE EXCEPTION statements
|
|
53604
|
-
* CREATE OBJECT statements
|
|
53605
|
-
* RAISE EVENT statements
|
|
53606
|
-
|
|
53607
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53608
|
-
|
|
53609
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53610
|
-
|
|
53611
|
-
If parameters are on the same row, no issues are reported, see
|
|
53614
|
+
extendedInformation: `Checks:
|
|
53615
|
+
* function module calls
|
|
53616
|
+
* method calls
|
|
53617
|
+
* VALUE constructors
|
|
53618
|
+
* NEW constructors
|
|
53619
|
+
* RAISE EXCEPTION statements
|
|
53620
|
+
* CREATE OBJECT statements
|
|
53621
|
+
* RAISE EVENT statements
|
|
53622
|
+
|
|
53623
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53624
|
+
|
|
53625
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53626
|
+
|
|
53627
|
+
If parameters are on the same row, no issues are reported, see
|
|
53612
53628
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53613
53629
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53614
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53615
|
-
EXPORTING
|
|
53616
|
-
foo = 2
|
|
53617
|
-
parameter = 3.
|
|
53618
|
-
|
|
53619
|
-
foobar( moo = 1
|
|
53620
|
-
param = 1 ).
|
|
53621
|
-
|
|
53622
|
-
foo = VALUE #(
|
|
53623
|
-
foo = bar
|
|
53630
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53631
|
+
EXPORTING
|
|
53632
|
+
foo = 2
|
|
53633
|
+
parameter = 3.
|
|
53634
|
+
|
|
53635
|
+
foobar( moo = 1
|
|
53636
|
+
param = 1 ).
|
|
53637
|
+
|
|
53638
|
+
foo = VALUE #(
|
|
53639
|
+
foo = bar
|
|
53624
53640
|
moo = 2 ).`,
|
|
53625
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53626
|
-
EXPORTING
|
|
53627
|
-
foo = 2
|
|
53628
|
-
parameter = 3.
|
|
53629
|
-
|
|
53630
|
-
foobar( moo = 1
|
|
53631
|
-
param = 1 ).
|
|
53632
|
-
|
|
53633
|
-
foo = VALUE #(
|
|
53634
|
-
foo = bar
|
|
53635
|
-
moo = 2 ).
|
|
53636
|
-
|
|
53637
|
-
DATA(sdf) = VALUE type(
|
|
53638
|
-
common_val = 2
|
|
53639
|
-
another_common = 5
|
|
53640
|
-
( row_value = 4
|
|
53641
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53642
|
+
EXPORTING
|
|
53643
|
+
foo = 2
|
|
53644
|
+
parameter = 3.
|
|
53645
|
+
|
|
53646
|
+
foobar( moo = 1
|
|
53647
|
+
param = 1 ).
|
|
53648
|
+
|
|
53649
|
+
foo = VALUE #(
|
|
53650
|
+
foo = bar
|
|
53651
|
+
moo = 2 ).
|
|
53652
|
+
|
|
53653
|
+
DATA(sdf) = VALUE type(
|
|
53654
|
+
common_val = 2
|
|
53655
|
+
another_common = 5
|
|
53656
|
+
( row_value = 4
|
|
53641
53657
|
value_foo = 5 ) ).`,
|
|
53642
53658
|
};
|
|
53643
53659
|
}
|
|
@@ -54071,37 +54087,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54071
54087
|
key: "align_type_expressions",
|
|
54072
54088
|
title: "Align TYPE expressions",
|
|
54073
54089
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54074
|
-
extendedInformation: `
|
|
54075
|
-
Currently works for METHODS + BEGIN OF
|
|
54076
|
-
|
|
54077
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54078
|
-
|
|
54079
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54090
|
+
extendedInformation: `
|
|
54091
|
+
Currently works for METHODS + BEGIN OF
|
|
54092
|
+
|
|
54093
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54094
|
+
|
|
54095
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54080
54096
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54081
54097
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54082
|
-
badExample: `
|
|
54083
|
-
TYPES: BEGIN OF foo,
|
|
54084
|
-
bar TYPE i,
|
|
54085
|
-
foobar TYPE i,
|
|
54086
|
-
END OF foo.
|
|
54087
|
-
|
|
54088
|
-
INTERFACE lif.
|
|
54089
|
-
METHODS bar
|
|
54090
|
-
IMPORTING
|
|
54091
|
-
foo TYPE i
|
|
54092
|
-
foobar TYPE i.
|
|
54098
|
+
badExample: `
|
|
54099
|
+
TYPES: BEGIN OF foo,
|
|
54100
|
+
bar TYPE i,
|
|
54101
|
+
foobar TYPE i,
|
|
54102
|
+
END OF foo.
|
|
54103
|
+
|
|
54104
|
+
INTERFACE lif.
|
|
54105
|
+
METHODS bar
|
|
54106
|
+
IMPORTING
|
|
54107
|
+
foo TYPE i
|
|
54108
|
+
foobar TYPE i.
|
|
54093
54109
|
ENDINTERFACE.`,
|
|
54094
|
-
goodExample: `
|
|
54095
|
-
TYPES: BEGIN OF foo,
|
|
54096
|
-
bar TYPE i,
|
|
54097
|
-
foobar TYPE i,
|
|
54098
|
-
END OF foo.
|
|
54099
|
-
|
|
54100
|
-
INTERFACE lif.
|
|
54101
|
-
METHODS bar
|
|
54102
|
-
IMPORTING
|
|
54103
|
-
foo TYPE i
|
|
54104
|
-
foobar TYPE i.
|
|
54110
|
+
goodExample: `
|
|
54111
|
+
TYPES: BEGIN OF foo,
|
|
54112
|
+
bar TYPE i,
|
|
54113
|
+
foobar TYPE i,
|
|
54114
|
+
END OF foo.
|
|
54115
|
+
|
|
54116
|
+
INTERFACE lif.
|
|
54117
|
+
METHODS bar
|
|
54118
|
+
IMPORTING
|
|
54119
|
+
foo TYPE i
|
|
54120
|
+
foobar TYPE i.
|
|
54105
54121
|
ENDINTERFACE.`,
|
|
54106
54122
|
};
|
|
54107
54123
|
}
|
|
@@ -54380,16 +54396,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54380
54396
|
return {
|
|
54381
54397
|
key: "ambiguous_statement",
|
|
54382
54398
|
title: "Check for ambigious statements",
|
|
54383
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54384
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54385
|
-
|
|
54399
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54400
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54401
|
+
|
|
54386
54402
|
Only works if the target version is 740sp05 or above`,
|
|
54387
54403
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54388
|
-
badExample: `DELETE foo FROM bar.
|
|
54404
|
+
badExample: `DELETE foo FROM bar.
|
|
54389
54405
|
MODIFY foo FROM bar.`,
|
|
54390
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54391
|
-
DELETE TABLE itab FROM 2.
|
|
54392
|
-
MODIFY zfoo FROM @wa.
|
|
54406
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54407
|
+
DELETE TABLE itab FROM 2.
|
|
54408
|
+
MODIFY zfoo FROM @wa.
|
|
54393
54409
|
MODIFY TABLE foo FROM bar.`,
|
|
54394
54410
|
};
|
|
54395
54411
|
}
|
|
@@ -54494,16 +54510,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54494
54510
|
key: "avoid_use",
|
|
54495
54511
|
title: "Avoid use of certain statements",
|
|
54496
54512
|
shortDescription: `Detects usage of certain statements.`,
|
|
54497
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54498
|
-
|
|
54499
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54500
|
-
|
|
54501
|
-
STATICS: use CLASS-DATA instead
|
|
54502
|
-
|
|
54503
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54504
|
-
|
|
54505
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54506
|
-
|
|
54513
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54514
|
+
|
|
54515
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54516
|
+
|
|
54517
|
+
STATICS: use CLASS-DATA instead
|
|
54518
|
+
|
|
54519
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54520
|
+
|
|
54521
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54522
|
+
|
|
54507
54523
|
BREAK points`,
|
|
54508
54524
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54509
54525
|
};
|
|
@@ -54635,11 +54651,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54635
54651
|
title: "Check BEGIN END names",
|
|
54636
54652
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54637
54653
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54638
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54639
|
-
field TYPE i,
|
|
54654
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54655
|
+
field TYPE i,
|
|
54640
54656
|
END OF structure_not_the_same.`,
|
|
54641
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54642
|
-
field TYPE i,
|
|
54657
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54658
|
+
field TYPE i,
|
|
54643
54659
|
END OF stru.`,
|
|
54644
54660
|
};
|
|
54645
54661
|
}
|
|
@@ -54736,20 +54752,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54736
54752
|
title: "BEGIN contains single INCLUDE",
|
|
54737
54753
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54738
54754
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54739
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54740
|
-
INCLUDE TYPE dselc.
|
|
54741
|
-
TYPES: END OF dummy1.
|
|
54742
|
-
|
|
54743
|
-
DATA BEGIN OF foo.
|
|
54744
|
-
INCLUDE STRUCTURE syst.
|
|
54745
|
-
DATA END OF foo.
|
|
54746
|
-
|
|
54747
|
-
STATICS BEGIN OF bar.
|
|
54748
|
-
INCLUDE STRUCTURE syst.
|
|
54755
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54756
|
+
INCLUDE TYPE dselc.
|
|
54757
|
+
TYPES: END OF dummy1.
|
|
54758
|
+
|
|
54759
|
+
DATA BEGIN OF foo.
|
|
54760
|
+
INCLUDE STRUCTURE syst.
|
|
54761
|
+
DATA END OF foo.
|
|
54762
|
+
|
|
54763
|
+
STATICS BEGIN OF bar.
|
|
54764
|
+
INCLUDE STRUCTURE syst.
|
|
54749
54765
|
STATICS END OF bar.`,
|
|
54750
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54751
|
-
DATA field TYPE i.
|
|
54752
|
-
INCLUDE STRUCTURE dselc.
|
|
54766
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54767
|
+
DATA field TYPE i.
|
|
54768
|
+
INCLUDE STRUCTURE dselc.
|
|
54753
54769
|
DATA END OF foo.`,
|
|
54754
54770
|
};
|
|
54755
54771
|
}
|
|
@@ -54839,9 +54855,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54839
54855
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54840
54856
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54841
54857
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54842
|
-
goodExample: `TRY.
|
|
54843
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54844
|
-
CATCH cx_sy_authorization_error.
|
|
54858
|
+
goodExample: `TRY.
|
|
54859
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54860
|
+
CATCH cx_sy_authorization_error.
|
|
54845
54861
|
ENDTRY.`,
|
|
54846
54862
|
};
|
|
54847
54863
|
}
|
|
@@ -54906,10 +54922,10 @@ class CDSCommentStyle {
|
|
|
54906
54922
|
key: "cds_comment_style",
|
|
54907
54923
|
title: "CDS Comment Style",
|
|
54908
54924
|
shortDescription: `Check for obsolete comment style`,
|
|
54909
|
-
extendedInformation: `Check for obsolete comment style
|
|
54910
|
-
|
|
54911
|
-
Comments starting with "--" are considered obsolete
|
|
54912
|
-
|
|
54925
|
+
extendedInformation: `Check for obsolete comment style
|
|
54926
|
+
|
|
54927
|
+
Comments starting with "--" are considered obsolete
|
|
54928
|
+
|
|
54913
54929
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54914
54930
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54915
54931
|
badExample: "-- this is a comment",
|
|
@@ -54975,10 +54991,10 @@ class CDSLegacyView {
|
|
|
54975
54991
|
key: "cds_legacy_view",
|
|
54976
54992
|
title: "CDS Legacy View",
|
|
54977
54993
|
shortDescription: `Identify CDS Legacy Views`,
|
|
54978
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54979
|
-
|
|
54980
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54981
|
-
|
|
54994
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54995
|
+
|
|
54996
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54997
|
+
|
|
54982
54998
|
v755 and up`,
|
|
54983
54999
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54984
55000
|
};
|
|
@@ -55133,10 +55149,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55133
55149
|
key: "chain_mainly_declarations",
|
|
55134
55150
|
title: "Chain mainly declarations",
|
|
55135
55151
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55136
|
-
extendedInformation: `
|
|
55137
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55138
|
-
|
|
55139
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55152
|
+
extendedInformation: `
|
|
55153
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55154
|
+
|
|
55155
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55140
55156
|
`,
|
|
55141
55157
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55142
55158
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55312,17 +55328,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55312
55328
|
title: "Change IF to CASE",
|
|
55313
55329
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55314
55330
|
// eslint-disable-next-line max-len
|
|
55315
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55316
|
-
|
|
55331
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55332
|
+
|
|
55317
55333
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55318
55334
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55319
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55320
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55321
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55335
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55336
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55337
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55322
55338
|
ENDIF.`,
|
|
55323
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55324
|
-
WHEN 'FOO'.
|
|
55325
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55339
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55340
|
+
WHEN 'FOO'.
|
|
55341
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55326
55342
|
ENDCASE.`,
|
|
55327
55343
|
};
|
|
55328
55344
|
}
|
|
@@ -55459,8 +55475,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55459
55475
|
return {
|
|
55460
55476
|
key: "check_abstract",
|
|
55461
55477
|
title: "Check abstract methods and classes",
|
|
55462
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55463
|
-
- class defined as abstract and final,
|
|
55478
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55479
|
+
- class defined as abstract and final,
|
|
55464
55480
|
- non-abstract class contains abstract methods`,
|
|
55465
55481
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55466
55482
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55541,11 +55557,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55541
55557
|
return {
|
|
55542
55558
|
key: "check_comments",
|
|
55543
55559
|
title: "Check Comments",
|
|
55544
|
-
shortDescription: `
|
|
55560
|
+
shortDescription: `
|
|
55545
55561
|
Various checks for comment usage.`,
|
|
55546
|
-
extendedInformation: `
|
|
55547
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55548
|
-
|
|
55562
|
+
extendedInformation: `
|
|
55563
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55564
|
+
|
|
55549
55565
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55550
55566
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55551
55567
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55707,9 +55723,9 @@ class CheckInclude {
|
|
|
55707
55723
|
key: "check_include",
|
|
55708
55724
|
title: "Check INCLUDEs",
|
|
55709
55725
|
shortDescription: `Checks INCLUDE statements`,
|
|
55710
|
-
extendedInformation: `
|
|
55711
|
-
* Reports unused includes
|
|
55712
|
-
* Errors if the includes are not found
|
|
55726
|
+
extendedInformation: `
|
|
55727
|
+
* Reports unused includes
|
|
55728
|
+
* Errors if the includes are not found
|
|
55713
55729
|
* Error if including a main program`,
|
|
55714
55730
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55715
55731
|
};
|
|
@@ -55785,14 +55801,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55785
55801
|
key: "check_subrc",
|
|
55786
55802
|
title: "Check sy-subrc",
|
|
55787
55803
|
shortDescription: `Check sy-subrc`,
|
|
55788
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55789
|
-
|
|
55790
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55791
|
-
|
|
55792
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55793
|
-
|
|
55794
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55795
|
-
|
|
55804
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55805
|
+
|
|
55806
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55807
|
+
|
|
55808
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55809
|
+
|
|
55810
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55811
|
+
|
|
55796
55812
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55797
55813
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55798
55814
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56362,17 +56378,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56362
56378
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56363
56379
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56364
56380
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56365
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56366
|
-
EXCEPTIONS
|
|
56367
|
-
system_failure = 1 MESSAGE lv_message
|
|
56368
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56369
|
-
resource_failure = 1
|
|
56381
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56382
|
+
EXCEPTIONS
|
|
56383
|
+
system_failure = 1 MESSAGE lv_message
|
|
56384
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56385
|
+
resource_failure = 1
|
|
56370
56386
|
OTHERS = 1.`,
|
|
56371
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56372
|
-
EXCEPTIONS
|
|
56373
|
-
system_failure = 1 MESSAGE lv_message
|
|
56374
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56375
|
-
resource_failure = 3
|
|
56387
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56388
|
+
EXCEPTIONS
|
|
56389
|
+
system_failure = 1 MESSAGE lv_message
|
|
56390
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56391
|
+
resource_failure = 3
|
|
56376
56392
|
OTHERS = 4.`,
|
|
56377
56393
|
};
|
|
56378
56394
|
}
|
|
@@ -56618,7 +56634,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56618
56634
|
key: "commented_code",
|
|
56619
56635
|
title: "Find commented code",
|
|
56620
56636
|
shortDescription: `Detects usage of commented out code.`,
|
|
56621
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56637
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56622
56638
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56623
56639
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56624
56640
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56851,10 +56867,10 @@ class ConstructorVisibilityPublic {
|
|
|
56851
56867
|
key: "constructor_visibility_public",
|
|
56852
56868
|
title: "Check constructor visibility is public",
|
|
56853
56869
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56854
|
-
extendedInformation: `
|
|
56855
|
-
This only applies to global classes.
|
|
56856
|
-
|
|
56857
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56870
|
+
extendedInformation: `
|
|
56871
|
+
This only applies to global classes.
|
|
56872
|
+
|
|
56873
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56858
56874
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56859
56875
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56860
56876
|
};
|
|
@@ -56929,8 +56945,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56929
56945
|
key: "contains_tab",
|
|
56930
56946
|
title: "Code contains tab",
|
|
56931
56947
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56932
|
-
extendedInformation: `
|
|
56933
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56948
|
+
extendedInformation: `
|
|
56949
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56934
56950
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56935
56951
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56936
56952
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57017,10 +57033,10 @@ class CyclicOO {
|
|
|
57017
57033
|
key: "cyclic_oo",
|
|
57018
57034
|
title: "Cyclic OO",
|
|
57019
57035
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57020
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57021
|
-
|
|
57022
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57023
|
-
|
|
57036
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57037
|
+
|
|
57038
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57039
|
+
|
|
57024
57040
|
References in testclass includes are ignored`,
|
|
57025
57041
|
};
|
|
57026
57042
|
}
|
|
@@ -57263,7 +57279,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57263
57279
|
key: "dangerous_statement",
|
|
57264
57280
|
title: "Dangerous statement",
|
|
57265
57281
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57266
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57282
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57267
57283
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57268
57284
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57269
57285
|
};
|
|
@@ -57470,13 +57486,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57470
57486
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57471
57487
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57472
57488
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57473
|
-
badExample: `FROM foo.
|
|
57474
|
-
WRITE 'hello'.
|
|
57475
|
-
DATA int TYPE i.
|
|
57489
|
+
badExample: `FROM foo.
|
|
57490
|
+
WRITE 'hello'.
|
|
57491
|
+
DATA int TYPE i.
|
|
57476
57492
|
ENDFORM.`,
|
|
57477
|
-
goodExample: `FROM foo.
|
|
57478
|
-
DATA int TYPE i.
|
|
57479
|
-
WRITE 'hello'.
|
|
57493
|
+
goodExample: `FROM foo.
|
|
57494
|
+
DATA int TYPE i.
|
|
57495
|
+
WRITE 'hello'.
|
|
57480
57496
|
ENDFORM.`,
|
|
57481
57497
|
};
|
|
57482
57498
|
}
|
|
@@ -58015,39 +58031,39 @@ class Downport {
|
|
|
58015
58031
|
key: "downport",
|
|
58016
58032
|
title: "Downport statement",
|
|
58017
58033
|
shortDescription: `Downport functionality`,
|
|
58018
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58019
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58020
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58021
|
-
|
|
58022
|
-
Current rules:
|
|
58023
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58024
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58025
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58026
|
-
* CONV is outlined
|
|
58027
|
-
* COND is outlined
|
|
58028
|
-
* REDUCE is outlined
|
|
58029
|
-
* SWITCH is outlined
|
|
58030
|
-
* FILTER is outlined
|
|
58031
|
-
* APPEND expression is outlined
|
|
58032
|
-
* INSERT expression is outlined
|
|
58033
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58034
|
-
* CAST changed to ?=
|
|
58035
|
-
* LOOP AT method_call( ) is outlined
|
|
58036
|
-
* VALUE # with structure fields
|
|
58037
|
-
* VALUE # with internal table lines
|
|
58038
|
-
* Table Expressions are outlined
|
|
58039
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58040
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58041
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58042
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58043
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58044
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58045
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58046
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58047
|
-
* MESSAGE with non simple source
|
|
58048
|
-
|
|
58049
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58050
|
-
|
|
58034
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58035
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58036
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58037
|
+
|
|
58038
|
+
Current rules:
|
|
58039
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58040
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58041
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58042
|
+
* CONV is outlined
|
|
58043
|
+
* COND is outlined
|
|
58044
|
+
* REDUCE is outlined
|
|
58045
|
+
* SWITCH is outlined
|
|
58046
|
+
* FILTER is outlined
|
|
58047
|
+
* APPEND expression is outlined
|
|
58048
|
+
* INSERT expression is outlined
|
|
58049
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58050
|
+
* CAST changed to ?=
|
|
58051
|
+
* LOOP AT method_call( ) is outlined
|
|
58052
|
+
* VALUE # with structure fields
|
|
58053
|
+
* VALUE # with internal table lines
|
|
58054
|
+
* Table Expressions are outlined
|
|
58055
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58056
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58057
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58058
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58059
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58060
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58061
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58062
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58063
|
+
* MESSAGE with non simple source
|
|
58064
|
+
|
|
58065
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58066
|
+
|
|
58051
58067
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58052
58068
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58053
58069
|
};
|
|
@@ -58625,10 +58641,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58625
58641
|
const fieldName = f.concatTokens();
|
|
58626
58642
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58627
58643
|
}
|
|
58628
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58644
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58629
58645
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58630
58646
|
}
|
|
58631
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58647
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58632
58648
|
${indentation}`);
|
|
58633
58649
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58634
58650
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58687,12 +58703,12 @@ ${indentation}`);
|
|
|
58687
58703
|
}
|
|
58688
58704
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58689
58705
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
58690
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58691
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58692
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58706
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58707
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58708
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58693
58709
|
${indentation}`);
|
|
58694
58710
|
if (fieldDefinitions === "") {
|
|
58695
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58711
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58696
58712
|
${indentation}`);
|
|
58697
58713
|
}
|
|
58698
58714
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58760,7 +58776,7 @@ ${indentation}`);
|
|
|
58760
58776
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58761
58777
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58762
58778
|
const firstToken = high.getFirstToken();
|
|
58763
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58779
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58764
58780
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58765
58781
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58766
58782
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58814,7 +58830,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58814
58830
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58815
58831
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58816
58832
|
const firstToken = high.getFirstToken();
|
|
58817
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58833
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58818
58834
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58819
58835
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58820
58836
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58856,14 +58872,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58856
58872
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58857
58873
|
const firstToken = high.getFirstToken();
|
|
58858
58874
|
// note that the tabix restore should be done before throwing the exception
|
|
58859
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58860
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58861
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58862
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58863
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58864
|
-
${indentation}IF sy-subrc <> 0.
|
|
58865
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58866
|
-
${indentation}ENDIF.
|
|
58875
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58876
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58877
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58878
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58879
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58880
|
+
${indentation}IF sy-subrc <> 0.
|
|
58881
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58882
|
+
${indentation}ENDIF.
|
|
58867
58883
|
${indentation}`);
|
|
58868
58884
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58869
58885
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58920,7 +58936,7 @@ ${indentation}`);
|
|
|
58920
58936
|
const className = classNames[0].concatTokens();
|
|
58921
58937
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58922
58938
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58923
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58939
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58924
58940
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58925
58941
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58926
58942
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59082,16 +59098,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59082
59098
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59083
59099
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59084
59100
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59085
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59086
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59101
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59102
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59087
59103
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59088
59104
|
if (withs.length > 0) {
|
|
59089
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59090
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59091
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59105
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59106
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59107
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59092
59108
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59093
59109
|
}
|
|
59094
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59110
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59095
59111
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59096
59112
|
if (withs.length > 0) {
|
|
59097
59113
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59203,10 +59219,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59203
59219
|
let code = "";
|
|
59204
59220
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59205
59221
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59206
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59207
|
-
IF sy-subrc <> 0.
|
|
59208
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59209
|
-
ENDIF.
|
|
59222
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59223
|
+
IF sy-subrc <> 0.
|
|
59224
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59225
|
+
ENDIF.
|
|
59210
59226
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59211
59227
|
}
|
|
59212
59228
|
else {
|
|
@@ -59295,20 +59311,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59295
59311
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59296
59312
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59297
59313
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59298
|
-
code += ` items LIKE ${loopSourceName},
|
|
59299
|
-
END OF ${groupTargetName}type.
|
|
59300
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59301
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59314
|
+
code += ` items LIKE ${loopSourceName},
|
|
59315
|
+
END OF ${groupTargetName}type.
|
|
59316
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59317
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59302
59318
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59303
59319
|
if (groupIndexName !== undefined) {
|
|
59304
59320
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59305
59321
|
}
|
|
59306
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59322
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59307
59323
|
IF sy-subrc = 0.\n`;
|
|
59308
59324
|
if (groupCountName !== undefined) {
|
|
59309
59325
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59310
59326
|
}
|
|
59311
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59327
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59312
59328
|
ELSE.\n`;
|
|
59313
59329
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59314
59330
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59329,8 +59345,8 @@ ELSE.\n`;
|
|
|
59329
59345
|
}
|
|
59330
59346
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59331
59347
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59332
|
-
code += `ENDIF.
|
|
59333
|
-
ENDLOOP.
|
|
59348
|
+
code += `ENDIF.
|
|
59349
|
+
ENDLOOP.
|
|
59334
59350
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59335
59351
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59336
59352
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59502,7 +59518,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59502
59518
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59503
59519
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59504
59520
|
// all ENUMS are char like?
|
|
59505
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59521
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59506
59522
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59507
59523
|
let count = 1;
|
|
59508
59524
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59546,14 +59562,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59546
59562
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59547
59563
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59548
59564
|
// restore tabix before exeption
|
|
59549
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59550
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59551
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59552
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59553
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59554
|
-
${indentation}IF sy-subrc <> 0.
|
|
59555
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59556
|
-
${indentation}ENDIF.
|
|
59565
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59566
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59567
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59568
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59569
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59570
|
+
${indentation}IF sy-subrc <> 0.
|
|
59571
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59572
|
+
${indentation}ENDIF.
|
|
59557
59573
|
${indentation}${uniqueName}`;
|
|
59558
59574
|
const start = target.getFirstToken().getStart();
|
|
59559
59575
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59608,21 +59624,17 @@ ${indentation}${uniqueName}`;
|
|
|
59608
59624
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, "= " + target + operator);
|
|
59609
59625
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Expand operator", this.getMetadata().key, this.conf.severity, fix);
|
|
59610
59626
|
}
|
|
59611
|
-
// must be very simple string templates, like "|{ ls_line-no ALPHA = IN }|"
|
|
59612
59627
|
stringTemplateAlpha(low, high, lowFile, highSyntax) {
|
|
59613
59628
|
var _a, _b;
|
|
59614
59629
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
59615
59630
|
return undefined;
|
|
59616
59631
|
}
|
|
59617
|
-
for (const child of high.findAllExpressionsRecursive(Expressions.
|
|
59618
|
-
const
|
|
59619
|
-
if (
|
|
59620
|
-
||
|
|
59621
|
-
|| templateTokens[2].getFirstToken().getStr() !== "}|") {
|
|
59632
|
+
for (const child of high.findAllExpressionsRecursive(Expressions.StringTemplateSource)) {
|
|
59633
|
+
const formatting = (_a = child.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
59634
|
+
if (formatting === undefined
|
|
59635
|
+
|| (formatting === null || formatting === void 0 ? void 0 : formatting.startsWith("ALPHA = ")) === false) {
|
|
59622
59636
|
continue;
|
|
59623
59637
|
}
|
|
59624
|
-
const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);
|
|
59625
|
-
const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
59626
59638
|
let functionName = "";
|
|
59627
59639
|
switch (formatting) {
|
|
59628
59640
|
case "ALPHA = IN":
|
|
@@ -59635,13 +59647,13 @@ ${indentation}${uniqueName}`;
|
|
|
59635
59647
|
return undefined;
|
|
59636
59648
|
}
|
|
59637
59649
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59638
|
-
const source = (_b =
|
|
59650
|
+
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59639
59651
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59640
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59641
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59642
|
-
${indentation} EXPORTING
|
|
59643
|
-
${indentation} input = ${source}
|
|
59644
|
-
${indentation} IMPORTING
|
|
59652
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59653
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59654
|
+
${indentation} EXPORTING
|
|
59655
|
+
${indentation} input = ${source}
|
|
59656
|
+
${indentation} IMPORTING
|
|
59645
59657
|
${indentation} output = ${uniqueName}.\n`;
|
|
59646
59658
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59647
59659
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60953,12 +60965,12 @@ class EasyToFindMessages {
|
|
|
60953
60965
|
key: "easy_to_find_messages",
|
|
60954
60966
|
title: "Easy to find messages",
|
|
60955
60967
|
shortDescription: `Make messages easy to find`,
|
|
60956
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60957
|
-
|
|
60958
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60959
|
-
|
|
60960
|
-
Also see rule "message_exists"
|
|
60961
|
-
|
|
60968
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60969
|
+
|
|
60970
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60971
|
+
|
|
60972
|
+
Also see rule "message_exists"
|
|
60973
|
+
|
|
60962
60974
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60963
60975
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60964
60976
|
};
|
|
@@ -61039,13 +61051,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61039
61051
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61040
61052
|
extendedInformation: ``,
|
|
61041
61053
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61042
|
-
badExample: `
|
|
61043
|
-
INITIALIZATION.
|
|
61044
|
-
WRITE 'hello'.
|
|
61054
|
+
badExample: `
|
|
61055
|
+
INITIALIZATION.
|
|
61056
|
+
WRITE 'hello'.
|
|
61045
61057
|
END-OF-SELECTION.`,
|
|
61046
|
-
goodExample: `
|
|
61047
|
-
START-OF-SELECTION.
|
|
61048
|
-
PERFORM sdf.
|
|
61058
|
+
goodExample: `
|
|
61059
|
+
START-OF-SELECTION.
|
|
61060
|
+
PERFORM sdf.
|
|
61049
61061
|
COMMIT WORK.`,
|
|
61050
61062
|
};
|
|
61051
61063
|
}
|
|
@@ -61137,8 +61149,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61137
61149
|
key: "empty_line_in_statement",
|
|
61138
61150
|
title: "Find empty lines in statements",
|
|
61139
61151
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61140
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61141
|
-
|
|
61152
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61153
|
+
|
|
61142
61154
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61143
61155
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61144
61156
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61314,13 +61326,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61314
61326
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61315
61327
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61316
61328
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61317
|
-
badExample: `IF foo = bar.
|
|
61318
|
-
ENDIF.
|
|
61319
|
-
|
|
61320
|
-
DO 2 TIMES.
|
|
61329
|
+
badExample: `IF foo = bar.
|
|
61330
|
+
ENDIF.
|
|
61331
|
+
|
|
61332
|
+
DO 2 TIMES.
|
|
61321
61333
|
ENDDO.`,
|
|
61322
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61323
|
-
ENDLOOP.
|
|
61334
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61335
|
+
ENDLOOP.
|
|
61324
61336
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61325
61337
|
};
|
|
61326
61338
|
}
|
|
@@ -61462,10 +61474,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61462
61474
|
return {
|
|
61463
61475
|
key: "exit_or_check",
|
|
61464
61476
|
title: "Find EXIT or CHECK outside loops",
|
|
61465
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61477
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61466
61478
|
Use RETURN to leave procesing blocks instead.`,
|
|
61467
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61468
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61479
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61480
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61469
61481
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61470
61482
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61471
61483
|
};
|
|
@@ -61548,12 +61560,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61548
61560
|
key: "expand_macros",
|
|
61549
61561
|
title: "Expand Macros",
|
|
61550
61562
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61551
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61552
|
-
|
|
61563
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61564
|
+
|
|
61553
61565
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61554
|
-
badExample: `DEFINE _hello.
|
|
61555
|
-
WRITE 'hello'.
|
|
61556
|
-
END-OF-DEFINITION.
|
|
61566
|
+
badExample: `DEFINE _hello.
|
|
61567
|
+
WRITE 'hello'.
|
|
61568
|
+
END-OF-DEFINITION.
|
|
61557
61569
|
_hello.`,
|
|
61558
61570
|
goodExample: `WRITE 'hello'.`,
|
|
61559
61571
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61640,7 +61652,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61640
61652
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61641
61653
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61642
61654
|
goodExample: `call_method( foo = bar ).`,
|
|
61643
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61655
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61644
61656
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61645
61657
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61646
61658
|
};
|
|
@@ -61738,7 +61750,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61738
61750
|
key: "forbidden_identifier",
|
|
61739
61751
|
title: "Forbidden Identifier",
|
|
61740
61752
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61741
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61753
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61742
61754
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61743
61755
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61744
61756
|
};
|
|
@@ -61980,8 +61992,8 @@ class ForbiddenVoidType {
|
|
|
61980
61992
|
key: "forbidden_void_type",
|
|
61981
61993
|
title: "Forbidden Void Types",
|
|
61982
61994
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61983
|
-
extendedInformation: `Inspiration:
|
|
61984
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61995
|
+
extendedInformation: `Inspiration:
|
|
61996
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61985
61997
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61986
61998
|
};
|
|
61987
61999
|
}
|
|
@@ -62224,9 +62236,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62224
62236
|
key: "fully_type_itabs",
|
|
62225
62237
|
title: "Fully type internal tables",
|
|
62226
62238
|
shortDescription: `No implict table types or table keys`,
|
|
62227
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62239
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62228
62240
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62229
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62241
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62230
62242
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62231
62243
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62232
62244
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62411,26 +62423,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62411
62423
|
key: "functional_writing",
|
|
62412
62424
|
title: "Use functional writing",
|
|
62413
62425
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62414
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62426
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62415
62427
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62416
62428
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62417
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62418
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62419
|
-
EXPORTING
|
|
62420
|
-
p_name = 'NAME'
|
|
62421
|
-
RECEIVING
|
|
62422
|
-
p_descr_ref = lr_typedescr
|
|
62423
|
-
EXCEPTIONS
|
|
62424
|
-
type_not_found = 1
|
|
62429
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62430
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62431
|
+
EXPORTING
|
|
62432
|
+
p_name = 'NAME'
|
|
62433
|
+
RECEIVING
|
|
62434
|
+
p_descr_ref = lr_typedescr
|
|
62435
|
+
EXCEPTIONS
|
|
62436
|
+
type_not_found = 1
|
|
62425
62437
|
OTHERS = 2.`,
|
|
62426
|
-
goodExample: `zcl_class=>method( ).
|
|
62427
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62428
|
-
EXPORTING
|
|
62429
|
-
p_name = 'NAME'
|
|
62430
|
-
RECEIVING
|
|
62431
|
-
p_descr_ref = lr_typedescr
|
|
62432
|
-
EXCEPTIONS
|
|
62433
|
-
type_not_found = 1
|
|
62438
|
+
goodExample: `zcl_class=>method( ).
|
|
62439
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62440
|
+
EXPORTING
|
|
62441
|
+
p_name = 'NAME'
|
|
62442
|
+
RECEIVING
|
|
62443
|
+
p_descr_ref = lr_typedescr
|
|
62444
|
+
EXCEPTIONS
|
|
62445
|
+
type_not_found = 1
|
|
62434
62446
|
OTHERS = 2 ).`,
|
|
62435
62447
|
};
|
|
62436
62448
|
}
|
|
@@ -62541,14 +62553,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62541
62553
|
key: "global_class",
|
|
62542
62554
|
title: "Global class checks",
|
|
62543
62555
|
shortDescription: `Checks related to global classes`,
|
|
62544
|
-
extendedInformation: `* global classes must be in own files
|
|
62545
|
-
|
|
62546
|
-
* file names must match class name
|
|
62547
|
-
|
|
62548
|
-
* file names must match interface name
|
|
62549
|
-
|
|
62550
|
-
* global classes must be global definitions
|
|
62551
|
-
|
|
62556
|
+
extendedInformation: `* global classes must be in own files
|
|
62557
|
+
|
|
62558
|
+
* file names must match class name
|
|
62559
|
+
|
|
62560
|
+
* file names must match interface name
|
|
62561
|
+
|
|
62562
|
+
* global classes must be global definitions
|
|
62563
|
+
|
|
62552
62564
|
* global interfaces must be global definitions`,
|
|
62553
62565
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62554
62566
|
};
|
|
@@ -62647,21 +62659,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62647
62659
|
return {
|
|
62648
62660
|
key: "identical_conditions",
|
|
62649
62661
|
title: "Identical conditions",
|
|
62650
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62651
|
-
|
|
62662
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62663
|
+
|
|
62652
62664
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62653
62665
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62654
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62655
|
-
ENDIF.
|
|
62656
|
-
CASE bar.
|
|
62657
|
-
WHEN '1'.
|
|
62658
|
-
WHEN 'A' OR '1'.
|
|
62666
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62667
|
+
ENDIF.
|
|
62668
|
+
CASE bar.
|
|
62669
|
+
WHEN '1'.
|
|
62670
|
+
WHEN 'A' OR '1'.
|
|
62659
62671
|
ENDCASE.`,
|
|
62660
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62661
|
-
ENDIF.
|
|
62662
|
-
CASE bar.
|
|
62663
|
-
WHEN '1'.
|
|
62664
|
-
WHEN 'A'.
|
|
62672
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62673
|
+
ENDIF.
|
|
62674
|
+
CASE bar.
|
|
62675
|
+
WHEN '1'.
|
|
62676
|
+
WHEN 'A'.
|
|
62665
62677
|
ENDCASE.`,
|
|
62666
62678
|
};
|
|
62667
62679
|
}
|
|
@@ -62795,23 +62807,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62795
62807
|
key: "identical_contents",
|
|
62796
62808
|
title: "Identical contents",
|
|
62797
62809
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62798
|
-
extendedInformation: `
|
|
62799
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62800
|
-
|
|
62810
|
+
extendedInformation: `
|
|
62811
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62812
|
+
|
|
62801
62813
|
Chained statments are ignored`,
|
|
62802
62814
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62803
|
-
badExample: `IF foo = bar.
|
|
62804
|
-
WRITE 'bar'.
|
|
62805
|
-
WRITE 'world'.
|
|
62806
|
-
ELSE.
|
|
62807
|
-
WRITE 'foo'.
|
|
62808
|
-
WRITE 'world'.
|
|
62815
|
+
badExample: `IF foo = bar.
|
|
62816
|
+
WRITE 'bar'.
|
|
62817
|
+
WRITE 'world'.
|
|
62818
|
+
ELSE.
|
|
62819
|
+
WRITE 'foo'.
|
|
62820
|
+
WRITE 'world'.
|
|
62809
62821
|
ENDIF.`,
|
|
62810
|
-
goodExample: `IF foo = bar.
|
|
62811
|
-
WRITE 'bar'.
|
|
62812
|
-
ELSE.
|
|
62813
|
-
WRITE 'foo'.
|
|
62814
|
-
ENDIF.
|
|
62822
|
+
goodExample: `IF foo = bar.
|
|
62823
|
+
WRITE 'bar'.
|
|
62824
|
+
ELSE.
|
|
62825
|
+
WRITE 'foo'.
|
|
62826
|
+
ENDIF.
|
|
62815
62827
|
WRITE 'world'.`,
|
|
62816
62828
|
};
|
|
62817
62829
|
}
|
|
@@ -62919,12 +62931,12 @@ class IdenticalDescriptions {
|
|
|
62919
62931
|
key: "identical_descriptions",
|
|
62920
62932
|
title: "Identical descriptions",
|
|
62921
62933
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62922
|
-
extendedInformation: `Case insensitive
|
|
62923
|
-
|
|
62924
|
-
Only checks the master language descriptions
|
|
62925
|
-
|
|
62926
|
-
Dependencies are skipped
|
|
62927
|
-
|
|
62934
|
+
extendedInformation: `Case insensitive
|
|
62935
|
+
|
|
62936
|
+
Only checks the master language descriptions
|
|
62937
|
+
|
|
62938
|
+
Dependencies are skipped
|
|
62939
|
+
|
|
62928
62940
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62929
62941
|
tags: [],
|
|
62930
62942
|
};
|
|
@@ -63098,43 +63110,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63098
63110
|
key: "if_in_if",
|
|
63099
63111
|
title: "IF in IF",
|
|
63100
63112
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63101
|
-
extendedInformation: `
|
|
63102
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63103
|
-
|
|
63104
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63105
|
-
|
|
63106
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63113
|
+
extendedInformation: `
|
|
63114
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63115
|
+
|
|
63116
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63117
|
+
|
|
63118
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63107
63119
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63108
|
-
badExample: `IF condition1.
|
|
63109
|
-
IF condition2.
|
|
63110
|
-
...
|
|
63111
|
-
ENDIF.
|
|
63112
|
-
ENDIF.
|
|
63113
|
-
|
|
63114
|
-
IF condition1.
|
|
63115
|
-
...
|
|
63116
|
-
ELSE.
|
|
63117
|
-
IF condition2.
|
|
63118
|
-
...
|
|
63119
|
-
ENDIF.
|
|
63120
|
+
badExample: `IF condition1.
|
|
63121
|
+
IF condition2.
|
|
63122
|
+
...
|
|
63123
|
+
ENDIF.
|
|
63124
|
+
ENDIF.
|
|
63125
|
+
|
|
63126
|
+
IF condition1.
|
|
63127
|
+
...
|
|
63128
|
+
ELSE.
|
|
63129
|
+
IF condition2.
|
|
63130
|
+
...
|
|
63131
|
+
ENDIF.
|
|
63120
63132
|
ENDIF.`,
|
|
63121
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63122
|
-
...
|
|
63123
|
-
ENDIF.
|
|
63124
|
-
|
|
63125
|
-
IF condition1.
|
|
63126
|
-
...
|
|
63127
|
-
ELSEIF condition2.
|
|
63128
|
-
...
|
|
63129
|
-
ENDIF.
|
|
63130
|
-
|
|
63131
|
-
CASE variable.
|
|
63132
|
-
WHEN value1.
|
|
63133
|
-
...
|
|
63134
|
-
WHEN value2.
|
|
63135
|
-
IF condition2.
|
|
63136
|
-
...
|
|
63137
|
-
ENDIF.
|
|
63133
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63134
|
+
...
|
|
63135
|
+
ENDIF.
|
|
63136
|
+
|
|
63137
|
+
IF condition1.
|
|
63138
|
+
...
|
|
63139
|
+
ELSEIF condition2.
|
|
63140
|
+
...
|
|
63141
|
+
ENDIF.
|
|
63142
|
+
|
|
63143
|
+
CASE variable.
|
|
63144
|
+
WHEN value1.
|
|
63145
|
+
...
|
|
63146
|
+
WHEN value2.
|
|
63147
|
+
IF condition2.
|
|
63148
|
+
...
|
|
63149
|
+
ENDIF.
|
|
63138
63150
|
ENDCASE.`,
|
|
63139
63151
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63140
63152
|
};
|
|
@@ -63319,9 +63331,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63319
63331
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63320
63332
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63321
63333
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63322
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63323
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63324
|
-
RETURN. " todo, implement method
|
|
63334
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63335
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63336
|
+
RETURN. " todo, implement method
|
|
63325
63337
|
ENDMETHOD.`);
|
|
63326
63338
|
}
|
|
63327
63339
|
}
|
|
@@ -63500,14 +63512,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63500
63512
|
key: "implicit_start_of_selection",
|
|
63501
63513
|
title: "Implicit START-OF-SELECTION",
|
|
63502
63514
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63503
|
-
extendedInformation: `Only runs for executable programs
|
|
63504
|
-
|
|
63515
|
+
extendedInformation: `Only runs for executable programs
|
|
63516
|
+
|
|
63505
63517
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63506
63518
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63507
|
-
badExample: `REPORT zfoo.
|
|
63519
|
+
badExample: `REPORT zfoo.
|
|
63508
63520
|
WRITE 'hello'.`,
|
|
63509
|
-
goodExample: `
|
|
63510
|
-
START-OF-SELECTION.
|
|
63521
|
+
goodExample: `
|
|
63522
|
+
START-OF-SELECTION.
|
|
63511
63523
|
WRITE 'hello'.`,
|
|
63512
63524
|
};
|
|
63513
63525
|
}
|
|
@@ -63612,19 +63624,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63612
63624
|
key: "in_statement_indentation",
|
|
63613
63625
|
title: "In-statement indentation",
|
|
63614
63626
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63615
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63616
|
-
|
|
63617
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63627
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63628
|
+
|
|
63629
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63618
63630
|
to distinguish them better from code within the block.`,
|
|
63619
|
-
badExample: `IF 1 = 1
|
|
63620
|
-
AND 2 = 2.
|
|
63621
|
-
WRITE 'hello' &&
|
|
63622
|
-
'world'.
|
|
63631
|
+
badExample: `IF 1 = 1
|
|
63632
|
+
AND 2 = 2.
|
|
63633
|
+
WRITE 'hello' &&
|
|
63634
|
+
'world'.
|
|
63623
63635
|
ENDIF.`,
|
|
63624
|
-
goodExample: `IF 1 = 1
|
|
63625
|
-
AND 2 = 2.
|
|
63626
|
-
WRITE 'hello' &&
|
|
63627
|
-
'world'.
|
|
63636
|
+
goodExample: `IF 1 = 1
|
|
63637
|
+
AND 2 = 2.
|
|
63638
|
+
WRITE 'hello' &&
|
|
63639
|
+
'world'.
|
|
63628
63640
|
ENDIF.`,
|
|
63629
63641
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63630
63642
|
};
|
|
@@ -63747,23 +63759,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63747
63759
|
title: "Indentation",
|
|
63748
63760
|
shortDescription: `Checks indentation`,
|
|
63749
63761
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63750
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63751
|
-
PRIVATE SECTION.
|
|
63752
|
-
METHODS constructor.
|
|
63753
|
-
ENDCLASS.
|
|
63754
|
-
|
|
63755
|
-
CLASS lcl IMPLEMENTATION.
|
|
63756
|
-
METHOD constructor.
|
|
63757
|
-
ENDMETHOD.
|
|
63762
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63763
|
+
PRIVATE SECTION.
|
|
63764
|
+
METHODS constructor.
|
|
63765
|
+
ENDCLASS.
|
|
63766
|
+
|
|
63767
|
+
CLASS lcl IMPLEMENTATION.
|
|
63768
|
+
METHOD constructor.
|
|
63769
|
+
ENDMETHOD.
|
|
63758
63770
|
ENDCLASS.`,
|
|
63759
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63760
|
-
PRIVATE SECTION.
|
|
63761
|
-
METHODS constructor.
|
|
63762
|
-
ENDCLASS.
|
|
63763
|
-
|
|
63764
|
-
CLASS lcl IMPLEMENTATION.
|
|
63765
|
-
METHOD constructor.
|
|
63766
|
-
ENDMETHOD.
|
|
63771
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63772
|
+
PRIVATE SECTION.
|
|
63773
|
+
METHODS constructor.
|
|
63774
|
+
ENDCLASS.
|
|
63775
|
+
|
|
63776
|
+
CLASS lcl IMPLEMENTATION.
|
|
63777
|
+
METHOD constructor.
|
|
63778
|
+
ENDMETHOD.
|
|
63767
63779
|
ENDCLASS.`,
|
|
63768
63780
|
};
|
|
63769
63781
|
}
|
|
@@ -64164,9 +64176,9 @@ class IntfReferencingClas {
|
|
|
64164
64176
|
key: "intf_referencing_clas",
|
|
64165
64177
|
title: "INTF referencing CLAS",
|
|
64166
64178
|
shortDescription: `Interface contains references to class`,
|
|
64167
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64168
|
-
Only first level references are checked.
|
|
64169
|
-
Exception class references are ignored.
|
|
64179
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64180
|
+
Only first level references are checked.
|
|
64181
|
+
Exception class references are ignored.
|
|
64170
64182
|
Void references are ignored.`,
|
|
64171
64183
|
};
|
|
64172
64184
|
}
|
|
@@ -64251,9 +64263,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64251
64263
|
title: "Invalid Table Index",
|
|
64252
64264
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64253
64265
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64254
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64266
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64255
64267
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64256
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64268
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64257
64269
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64258
64270
|
};
|
|
64259
64271
|
}
|
|
@@ -64854,8 +64866,8 @@ class LineBreakStyle {
|
|
|
64854
64866
|
return {
|
|
64855
64867
|
key: "line_break_style",
|
|
64856
64868
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64857
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64858
|
-
|
|
64869
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64870
|
+
|
|
64859
64871
|
abapGit does not work with CRLF`,
|
|
64860
64872
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64861
64873
|
};
|
|
@@ -64924,7 +64936,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64924
64936
|
key: "line_length",
|
|
64925
64937
|
title: "Line length",
|
|
64926
64938
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64927
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64939
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64928
64940
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64929
64941
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64930
64942
|
};
|
|
@@ -64995,7 +65007,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64995
65007
|
key: "line_only_punc",
|
|
64996
65008
|
title: "Line containing only punctuation",
|
|
64997
65009
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64998
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65010
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64999
65011
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65000
65012
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65001
65013
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65258,15 +65270,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65258
65270
|
return {
|
|
65259
65271
|
key: "local_variable_names",
|
|
65260
65272
|
title: "Local variable naming conventions",
|
|
65261
|
-
shortDescription: `
|
|
65262
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65273
|
+
shortDescription: `
|
|
65274
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65263
65275
|
Regexes are case-insensitive.`,
|
|
65264
65276
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65265
|
-
badExample: `FORM bar.
|
|
65266
|
-
DATA foo.
|
|
65277
|
+
badExample: `FORM bar.
|
|
65278
|
+
DATA foo.
|
|
65267
65279
|
ENDFORM.`,
|
|
65268
|
-
goodExample: `FORM bar.
|
|
65269
|
-
DATA lv_foo.
|
|
65280
|
+
goodExample: `FORM bar.
|
|
65281
|
+
DATA lv_foo.
|
|
65270
65282
|
ENDFORM.`,
|
|
65271
65283
|
};
|
|
65272
65284
|
}
|
|
@@ -65418,9 +65430,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65418
65430
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65419
65431
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65420
65432
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65421
|
-
badExample: `DEFINE something.
|
|
65433
|
+
badExample: `DEFINE something.
|
|
65422
65434
|
END-OF-DEFINITION.`,
|
|
65423
|
-
goodExample: `DEFINE _something.
|
|
65435
|
+
goodExample: `DEFINE _something.
|
|
65424
65436
|
END-OF-DEFINITION.`,
|
|
65425
65437
|
};
|
|
65426
65438
|
}
|
|
@@ -65493,10 +65505,10 @@ class MainFileContents {
|
|
|
65493
65505
|
key: "main_file_contents",
|
|
65494
65506
|
title: "Main file contents",
|
|
65495
65507
|
shortDescription: `Checks related to report declarations.`,
|
|
65496
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65497
|
-
|
|
65498
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65499
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65508
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65509
|
+
|
|
65510
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65511
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65500
65512
|
`,
|
|
65501
65513
|
};
|
|
65502
65514
|
}
|
|
@@ -65612,17 +65624,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65612
65624
|
title: "Too many parentheses",
|
|
65613
65625
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65614
65626
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65615
|
-
badExample: `
|
|
65616
|
-
IF ( destination IS INITIAL ).
|
|
65617
|
-
ENDIF.
|
|
65618
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65619
|
-
ENDIF.
|
|
65627
|
+
badExample: `
|
|
65628
|
+
IF ( destination IS INITIAL ).
|
|
65629
|
+
ENDIF.
|
|
65630
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65631
|
+
ENDIF.
|
|
65620
65632
|
`,
|
|
65621
|
-
goodExample: `
|
|
65622
|
-
IF destination IS INITIAL.
|
|
65623
|
-
ENDIF.
|
|
65624
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65625
|
-
ENDIF.
|
|
65633
|
+
goodExample: `
|
|
65634
|
+
IF destination IS INITIAL.
|
|
65635
|
+
ENDIF.
|
|
65636
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65637
|
+
ENDIF.
|
|
65626
65638
|
`,
|
|
65627
65639
|
};
|
|
65628
65640
|
}
|
|
@@ -65796,14 +65808,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65796
65808
|
title: "Max one method parameter definition per line",
|
|
65797
65809
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65798
65810
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65799
|
-
badExample: `
|
|
65800
|
-
METHODS apps_scope_token
|
|
65801
|
-
IMPORTING
|
|
65811
|
+
badExample: `
|
|
65812
|
+
METHODS apps_scope_token
|
|
65813
|
+
IMPORTING
|
|
65802
65814
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65803
|
-
goodExample: `
|
|
65804
|
-
METHODS apps_scope_token
|
|
65805
|
-
IMPORTING
|
|
65806
|
-
body TYPE bodyapps_scope_token
|
|
65815
|
+
goodExample: `
|
|
65816
|
+
METHODS apps_scope_token
|
|
65817
|
+
IMPORTING
|
|
65818
|
+
body TYPE bodyapps_scope_token
|
|
65807
65819
|
client_id TYPE str.`,
|
|
65808
65820
|
};
|
|
65809
65821
|
}
|
|
@@ -65868,11 +65880,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65868
65880
|
key: "max_one_statement",
|
|
65869
65881
|
title: "Max one statement per line",
|
|
65870
65882
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65871
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65872
|
-
|
|
65873
|
-
Does not report anything for chained statements.
|
|
65874
|
-
|
|
65875
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65883
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65884
|
+
|
|
65885
|
+
Does not report anything for chained statements.
|
|
65886
|
+
|
|
65887
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65876
65888
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65877
65889
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65878
65890
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66210,8 +66222,8 @@ class MethodLength {
|
|
|
66210
66222
|
key: "method_length",
|
|
66211
66223
|
title: "Method/Form Length",
|
|
66212
66224
|
shortDescription: `Checks relating to method/form length.`,
|
|
66213
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66214
|
-
|
|
66225
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66226
|
+
|
|
66215
66227
|
Abstract methods without statements are considered okay.`,
|
|
66216
66228
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66217
66229
|
};
|
|
@@ -66316,20 +66328,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66316
66328
|
key: "method_overwrites_builtin",
|
|
66317
66329
|
title: "Method name overwrites builtin function",
|
|
66318
66330
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66319
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66320
|
-
|
|
66321
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66322
|
-
|
|
66331
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66332
|
+
|
|
66333
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66334
|
+
|
|
66323
66335
|
Interface method names are ignored`,
|
|
66324
66336
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66325
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66326
|
-
PUBLIC SECTION.
|
|
66327
|
-
METHODS matches.
|
|
66328
|
-
ENDCLASS.
|
|
66329
|
-
|
|
66330
|
-
CLASS lcl IMPLEMENTATION.
|
|
66331
|
-
METHOD matches.
|
|
66332
|
-
ENDMETHOD.
|
|
66337
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66338
|
+
PUBLIC SECTION.
|
|
66339
|
+
METHODS matches.
|
|
66340
|
+
ENDCLASS.
|
|
66341
|
+
|
|
66342
|
+
CLASS lcl IMPLEMENTATION.
|
|
66343
|
+
METHOD matches.
|
|
66344
|
+
ENDMETHOD.
|
|
66333
66345
|
ENDCLASS.`,
|
|
66334
66346
|
};
|
|
66335
66347
|
}
|
|
@@ -66520,12 +66532,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66520
66532
|
// eslint-disable-next-line max-len
|
|
66521
66533
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66522
66534
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66523
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66524
|
-
PUBLIC SECTION.
|
|
66525
|
-
METHODS
|
|
66526
|
-
foobar
|
|
66527
|
-
EXPORTING foo TYPE i
|
|
66528
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66535
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66536
|
+
PUBLIC SECTION.
|
|
66537
|
+
METHODS
|
|
66538
|
+
foobar
|
|
66539
|
+
EXPORTING foo TYPE i
|
|
66540
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66529
66541
|
ENDCLASS.`,
|
|
66530
66542
|
};
|
|
66531
66543
|
}
|
|
@@ -66905,7 +66917,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66905
66917
|
key: "nesting",
|
|
66906
66918
|
title: "Check nesting depth",
|
|
66907
66919
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66908
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66920
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66909
66921
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66910
66922
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66911
66923
|
};
|
|
@@ -67148,7 +67160,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67148
67160
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67149
67161
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67150
67162
|
badExample: `var1 = var2 = var3.`,
|
|
67151
|
-
goodExample: `var2 = var3.
|
|
67163
|
+
goodExample: `var2 = var3.
|
|
67152
67164
|
var1 = var2.`,
|
|
67153
67165
|
};
|
|
67154
67166
|
}
|
|
@@ -67207,8 +67219,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67207
67219
|
key: "no_external_form_calls",
|
|
67208
67220
|
title: "No external FORM calls",
|
|
67209
67221
|
shortDescription: `Detect external form calls`,
|
|
67210
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67211
|
-
|
|
67222
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67223
|
+
|
|
67212
67224
|
PERFORM foo(bar).`,
|
|
67213
67225
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67214
67226
|
};
|
|
@@ -67269,17 +67281,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67269
67281
|
key: "no_inline_in_optional_branches",
|
|
67270
67282
|
title: "Don't declare inline in optional branches",
|
|
67271
67283
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67272
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67273
|
-
|
|
67274
|
-
Considered optional branches:
|
|
67275
|
-
* inside IF/ELSEIF/ELSE
|
|
67276
|
-
* inside LOOP
|
|
67277
|
-
* inside WHILE
|
|
67278
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67279
|
-
* inside DO
|
|
67280
|
-
* inside SELECT loops
|
|
67281
|
-
|
|
67282
|
-
Not considered optional branches:
|
|
67284
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67285
|
+
|
|
67286
|
+
Considered optional branches:
|
|
67287
|
+
* inside IF/ELSEIF/ELSE
|
|
67288
|
+
* inside LOOP
|
|
67289
|
+
* inside WHILE
|
|
67290
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67291
|
+
* inside DO
|
|
67292
|
+
* inside SELECT loops
|
|
67293
|
+
|
|
67294
|
+
Not considered optional branches:
|
|
67283
67295
|
* TRY/CATCH/CLEANUP`,
|
|
67284
67296
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67285
67297
|
};
|
|
@@ -67379,12 +67391,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67379
67391
|
key: "no_prefixes",
|
|
67380
67392
|
title: "No Prefixes",
|
|
67381
67393
|
shortDescription: `Dont use hungarian notation`,
|
|
67382
|
-
extendedInformation: `
|
|
67383
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67384
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67385
|
-
|
|
67386
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67387
|
-
|
|
67394
|
+
extendedInformation: `
|
|
67395
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67396
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67397
|
+
|
|
67398
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67399
|
+
|
|
67388
67400
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67389
67401
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67390
67402
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67563,7 +67575,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67563
67575
|
return {
|
|
67564
67576
|
key: "no_public_attributes",
|
|
67565
67577
|
title: "No public attributes",
|
|
67566
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67578
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67567
67579
|
Exceptions are excluded from this rule.`,
|
|
67568
67580
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67569
67581
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67664,13 +67676,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67664
67676
|
key: "no_yoda_conditions",
|
|
67665
67677
|
title: "No Yoda conditions",
|
|
67666
67678
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67667
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67668
|
-
|
|
67679
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67680
|
+
|
|
67669
67681
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67670
67682
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67671
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67683
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67672
67684
|
ENDIF.`,
|
|
67673
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67685
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67674
67686
|
ENDIF.`,
|
|
67675
67687
|
};
|
|
67676
67688
|
}
|
|
@@ -67771,8 +67783,8 @@ class NROBConsistency {
|
|
|
67771
67783
|
key: "nrob_consistency",
|
|
67772
67784
|
title: "Number range consistency",
|
|
67773
67785
|
shortDescription: `Consistency checks for number ranges`,
|
|
67774
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67775
|
-
|
|
67786
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67787
|
+
|
|
67776
67788
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67777
67789
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67778
67790
|
};
|
|
@@ -68049,58 +68061,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68049
68061
|
title: "Obsolete statements",
|
|
68050
68062
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68051
68063
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68052
|
-
extendedInformation: `
|
|
68053
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68054
|
-
|
|
68055
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68056
|
-
|
|
68057
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68058
|
-
|
|
68059
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68060
|
-
|
|
68061
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68062
|
-
|
|
68063
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68064
|
-
|
|
68065
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68066
|
-
|
|
68067
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68068
|
-
|
|
68069
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68070
|
-
|
|
68071
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68072
|
-
|
|
68073
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68074
|
-
|
|
68075
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68076
|
-
|
|
68077
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68078
|
-
|
|
68079
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68080
|
-
|
|
68081
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68082
|
-
SELECT COUNT(*) is considered okay
|
|
68083
|
-
|
|
68084
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68085
|
-
|
|
68086
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68087
|
-
|
|
68088
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68089
|
-
|
|
68090
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68091
|
-
|
|
68092
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68093
|
-
|
|
68064
|
+
extendedInformation: `
|
|
68065
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68066
|
+
|
|
68067
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68068
|
+
|
|
68069
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68070
|
+
|
|
68071
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68072
|
+
|
|
68073
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68074
|
+
|
|
68075
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68076
|
+
|
|
68077
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68078
|
+
|
|
68079
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68080
|
+
|
|
68081
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68082
|
+
|
|
68083
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68084
|
+
|
|
68085
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68086
|
+
|
|
68087
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68088
|
+
|
|
68089
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68090
|
+
|
|
68091
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68092
|
+
|
|
68093
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68094
|
+
SELECT COUNT(*) is considered okay
|
|
68095
|
+
|
|
68096
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68097
|
+
|
|
68098
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68099
|
+
|
|
68100
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68101
|
+
|
|
68102
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68103
|
+
|
|
68104
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68105
|
+
|
|
68094
68106
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68095
|
-
badExample: `REFRESH itab.
|
|
68096
|
-
|
|
68097
|
-
COMPUTE foo = 2 + 2.
|
|
68098
|
-
|
|
68099
|
-
MULTIPLY lv_foo BY 2.
|
|
68100
|
-
|
|
68101
|
-
INTERFACE intf LOAD.
|
|
68102
|
-
|
|
68103
|
-
IF foo IS SUPPLIED.
|
|
68107
|
+
badExample: `REFRESH itab.
|
|
68108
|
+
|
|
68109
|
+
COMPUTE foo = 2 + 2.
|
|
68110
|
+
|
|
68111
|
+
MULTIPLY lv_foo BY 2.
|
|
68112
|
+
|
|
68113
|
+
INTERFACE intf LOAD.
|
|
68114
|
+
|
|
68115
|
+
IF foo IS SUPPLIED.
|
|
68104
68116
|
ENDIF.`,
|
|
68105
68117
|
};
|
|
68106
68118
|
}
|
|
@@ -68440,9 +68452,9 @@ class OmitParameterName {
|
|
|
68440
68452
|
key: "omit_parameter_name",
|
|
68441
68453
|
title: "Omit parameter name",
|
|
68442
68454
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68443
|
-
extendedInformation: `
|
|
68444
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68445
|
-
|
|
68455
|
+
extendedInformation: `
|
|
68456
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68457
|
+
|
|
68446
68458
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68447
68459
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68448
68460
|
badExample: `method( param = 2 ).`,
|
|
@@ -68648,20 +68660,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68648
68660
|
shortDescription: `Omit RECEIVING`,
|
|
68649
68661
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68650
68662
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68651
|
-
badExample: `
|
|
68652
|
-
upload_pack(
|
|
68653
|
-
EXPORTING
|
|
68654
|
-
io_client = lo_client
|
|
68655
|
-
iv_url = iv_url
|
|
68656
|
-
iv_deepen_level = iv_deepen_level
|
|
68657
|
-
it_hashes = lt_hashes
|
|
68658
|
-
RECEIVING
|
|
68663
|
+
badExample: `
|
|
68664
|
+
upload_pack(
|
|
68665
|
+
EXPORTING
|
|
68666
|
+
io_client = lo_client
|
|
68667
|
+
iv_url = iv_url
|
|
68668
|
+
iv_deepen_level = iv_deepen_level
|
|
68669
|
+
it_hashes = lt_hashes
|
|
68670
|
+
RECEIVING
|
|
68659
68671
|
rt_objects = et_objects ).`,
|
|
68660
|
-
goodExample: `
|
|
68661
|
-
et_objects = upload_pack(
|
|
68662
|
-
io_client = lo_client
|
|
68663
|
-
iv_url = iv_url
|
|
68664
|
-
iv_deepen_level = iv_deepen_level
|
|
68672
|
+
goodExample: `
|
|
68673
|
+
et_objects = upload_pack(
|
|
68674
|
+
io_client = lo_client
|
|
68675
|
+
iv_url = iv_url
|
|
68676
|
+
iv_deepen_level = iv_deepen_level
|
|
68665
68677
|
it_hashes = lt_hashes ).`,
|
|
68666
68678
|
};
|
|
68667
68679
|
}
|
|
@@ -68725,8 +68737,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68725
68737
|
return {
|
|
68726
68738
|
key: "parser_702_chaining",
|
|
68727
68739
|
title: "Parser Error, bad chanining on 702",
|
|
68728
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68729
|
-
this rule finds these and reports errors.
|
|
68740
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68741
|
+
this rule finds these and reports errors.
|
|
68730
68742
|
Only active on target version 702 and below.`,
|
|
68731
68743
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68732
68744
|
};
|
|
@@ -68806,8 +68818,8 @@ class ParserError {
|
|
|
68806
68818
|
return {
|
|
68807
68819
|
key: "parser_error",
|
|
68808
68820
|
title: "Parser error",
|
|
68809
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68810
|
-
|
|
68821
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68822
|
+
|
|
68811
68823
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68812
68824
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68813
68825
|
};
|
|
@@ -68892,7 +68904,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68892
68904
|
return {
|
|
68893
68905
|
key: "parser_missing_space",
|
|
68894
68906
|
title: "Parser Error, missing space",
|
|
68895
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68907
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68896
68908
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68897
68909
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68898
68910
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69092,12 +69104,23 @@ This rule makes sure the spaces are consistently required across the language.`,
|
|
|
69092
69104
|
if (children.length < 2) {
|
|
69093
69105
|
return undefined;
|
|
69094
69106
|
}
|
|
69095
|
-
|
|
69096
|
-
|
|
69097
|
-
|
|
69098
|
-
|
|
69099
|
-
|
|
69100
|
-
|
|
69107
|
+
if (children.length >= 4
|
|
69108
|
+
&& children[0].getStr().toUpperCase() === "CONV") {
|
|
69109
|
+
const first = children[2];
|
|
69110
|
+
const second = children[3];
|
|
69111
|
+
if (first.getRow() === second.getRow()
|
|
69112
|
+
&& first.getCol() + 1 === second.getStart().getCol()) {
|
|
69113
|
+
return second.getStart();
|
|
69114
|
+
}
|
|
69115
|
+
}
|
|
69116
|
+
{
|
|
69117
|
+
const nextLast = children[children.length - 2];
|
|
69118
|
+
const last = children[children.length - 1];
|
|
69119
|
+
if (nextLast.getStr().startsWith("'")
|
|
69120
|
+
&& nextLast.getRow() === last.getRow()
|
|
69121
|
+
&& nextLast.getEnd().getCol() === last.getStart().getCol()) {
|
|
69122
|
+
return last.getEnd();
|
|
69123
|
+
}
|
|
69101
69124
|
}
|
|
69102
69125
|
return undefined;
|
|
69103
69126
|
}
|
|
@@ -69304,25 +69327,25 @@ class PreferInline {
|
|
|
69304
69327
|
key: "prefer_inline",
|
|
69305
69328
|
title: "Prefer Inline Declarations",
|
|
69306
69329
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69307
|
-
extendedInformation: `EXPERIMENTAL
|
|
69308
|
-
|
|
69309
|
-
Activates if language version is v740sp02 or above.
|
|
69310
|
-
|
|
69311
|
-
Variables must be local(METHOD or FORM).
|
|
69312
|
-
|
|
69313
|
-
No generic or void typed variables. No syntax errors.
|
|
69314
|
-
|
|
69315
|
-
First position used must be a full/pure write.
|
|
69316
|
-
|
|
69317
|
-
Move statment is not a cast(?=)
|
|
69318
|
-
|
|
69330
|
+
extendedInformation: `EXPERIMENTAL
|
|
69331
|
+
|
|
69332
|
+
Activates if language version is v740sp02 or above.
|
|
69333
|
+
|
|
69334
|
+
Variables must be local(METHOD or FORM).
|
|
69335
|
+
|
|
69336
|
+
No generic or void typed variables. No syntax errors.
|
|
69337
|
+
|
|
69338
|
+
First position used must be a full/pure write.
|
|
69339
|
+
|
|
69340
|
+
Move statment is not a cast(?=)
|
|
69341
|
+
|
|
69319
69342
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69320
69343
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69321
|
-
badExample: `DATA foo TYPE i.
|
|
69322
|
-
foo = 2.
|
|
69323
|
-
DATA percentage TYPE decfloat34.
|
|
69344
|
+
badExample: `DATA foo TYPE i.
|
|
69345
|
+
foo = 2.
|
|
69346
|
+
DATA percentage TYPE decfloat34.
|
|
69324
69347
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69325
|
-
goodExample: `DATA(foo) = 2.
|
|
69348
|
+
goodExample: `DATA(foo) = 2.
|
|
69326
69349
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69327
69350
|
};
|
|
69328
69351
|
}
|
|
@@ -69536,18 +69559,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69536
69559
|
key: "prefer_is_not",
|
|
69537
69560
|
title: "Prefer IS NOT to NOT IS",
|
|
69538
69561
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69539
|
-
extendedInformation: `
|
|
69540
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69541
|
-
|
|
69562
|
+
extendedInformation: `
|
|
69563
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69564
|
+
|
|
69542
69565
|
"if not is_valid( )." examples are skipped`,
|
|
69543
69566
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69544
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69545
|
-
IF variable NP 'TODO*'.
|
|
69546
|
-
IF variable <> 42.
|
|
69567
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69568
|
+
IF variable NP 'TODO*'.
|
|
69569
|
+
IF variable <> 42.
|
|
69547
69570
|
IF variable CO 'hello'.`,
|
|
69548
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69549
|
-
IF NOT variable CP 'TODO*'.
|
|
69550
|
-
IF NOT variable = 42.
|
|
69571
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69572
|
+
IF NOT variable CP 'TODO*'.
|
|
69573
|
+
IF NOT variable = 42.
|
|
69551
69574
|
IF NOT variable CA 'hello'.`,
|
|
69552
69575
|
};
|
|
69553
69576
|
}
|
|
@@ -69735,14 +69758,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69735
69758
|
key: "prefer_raise_exception_new",
|
|
69736
69759
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69737
69760
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69738
|
-
extendedInformation: `
|
|
69739
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69740
|
-
|
|
69761
|
+
extendedInformation: `
|
|
69762
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69763
|
+
|
|
69741
69764
|
From 752 and up`,
|
|
69742
69765
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69743
69766
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69744
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69745
|
-
EXPORTING
|
|
69767
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69768
|
+
EXPORTING
|
|
69746
69769
|
previous = exception.`,
|
|
69747
69770
|
};
|
|
69748
69771
|
}
|
|
@@ -69820,12 +69843,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69820
69843
|
key: "prefer_returning_to_exporting",
|
|
69821
69844
|
title: "Prefer RETURNING to EXPORTING",
|
|
69822
69845
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69823
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69846
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69824
69847
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69825
69848
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69826
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69827
|
-
PUBLIC SECTION.
|
|
69828
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69849
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69850
|
+
PUBLIC SECTION.
|
|
69851
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69829
69852
|
ENDCLASS.`,
|
|
69830
69853
|
};
|
|
69831
69854
|
}
|
|
@@ -69921,8 +69944,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69921
69944
|
key: "prefer_xsdbool",
|
|
69922
69945
|
title: "Prefer xsdbool over boolc",
|
|
69923
69946
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69924
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69925
|
-
|
|
69947
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69948
|
+
|
|
69926
69949
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69927
69950
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69928
69951
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69994,9 +70017,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69994
70017
|
title: "Preferred compare operator",
|
|
69995
70018
|
shortDescription: `Configure undesired operator variants`,
|
|
69996
70019
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69997
|
-
badExample: `IF foo EQ bar.
|
|
70020
|
+
badExample: `IF foo EQ bar.
|
|
69998
70021
|
ENDIF.`,
|
|
69999
|
-
goodExample: `IF foo = bar.
|
|
70022
|
+
goodExample: `IF foo = bar.
|
|
70000
70023
|
ENDIF.`,
|
|
70001
70024
|
};
|
|
70002
70025
|
}
|
|
@@ -70220,26 +70243,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70220
70243
|
key: "reduce_procedural_code",
|
|
70221
70244
|
title: "Reduce procedural code",
|
|
70222
70245
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70223
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70224
|
-
|
|
70225
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70226
|
-
|
|
70246
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70247
|
+
|
|
70248
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70249
|
+
|
|
70227
70250
|
Comments are not counted as statements.`,
|
|
70228
70251
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70229
|
-
badExample: `FORM foo.
|
|
70230
|
-
DATA lv_bar TYPE i.
|
|
70231
|
-
lv_bar = 2 + 2.
|
|
70232
|
-
IF lv_bar = 4.
|
|
70233
|
-
WRITE 'hello world'.
|
|
70234
|
-
ENDIF.
|
|
70235
|
-
DATA lv_bar TYPE i.
|
|
70236
|
-
lv_bar = 2 + 2.
|
|
70237
|
-
IF lv_bar = 4.
|
|
70238
|
-
WRITE 'hello world'.
|
|
70239
|
-
ENDIF.
|
|
70252
|
+
badExample: `FORM foo.
|
|
70253
|
+
DATA lv_bar TYPE i.
|
|
70254
|
+
lv_bar = 2 + 2.
|
|
70255
|
+
IF lv_bar = 4.
|
|
70256
|
+
WRITE 'hello world'.
|
|
70257
|
+
ENDIF.
|
|
70258
|
+
DATA lv_bar TYPE i.
|
|
70259
|
+
lv_bar = 2 + 2.
|
|
70260
|
+
IF lv_bar = 4.
|
|
70261
|
+
WRITE 'hello world'.
|
|
70262
|
+
ENDIF.
|
|
70240
70263
|
ENDFORM.`,
|
|
70241
|
-
goodExample: `FORM foo.
|
|
70242
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70264
|
+
goodExample: `FORM foo.
|
|
70265
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70243
70266
|
ENDFORM.`,
|
|
70244
70267
|
};
|
|
70245
70268
|
}
|
|
@@ -70483,10 +70506,10 @@ class RemoveDescriptions {
|
|
|
70483
70506
|
return {
|
|
70484
70507
|
key: "remove_descriptions",
|
|
70485
70508
|
title: "Remove descriptions",
|
|
70486
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70487
|
-
|
|
70488
|
-
Class descriptions are required, see rule description_empty.
|
|
70489
|
-
|
|
70509
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70510
|
+
|
|
70511
|
+
Class descriptions are required, see rule description_empty.
|
|
70512
|
+
|
|
70490
70513
|
Consider using ABAP Doc for documentation.`,
|
|
70491
70514
|
tags: [],
|
|
70492
70515
|
};
|
|
@@ -70611,14 +70634,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70611
70634
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70612
70635
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70613
70636
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70614
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70637
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70615
70638
|
DESTINATION lv_rfc.`,
|
|
70616
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70617
|
-
DESTINATION lv_rfc
|
|
70618
|
-
EXCEPTIONS
|
|
70619
|
-
system_failure = 1 MESSAGE msg
|
|
70620
|
-
communication_failure = 2 MESSAGE msg
|
|
70621
|
-
resource_failure = 3
|
|
70639
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70640
|
+
DESTINATION lv_rfc
|
|
70641
|
+
EXCEPTIONS
|
|
70642
|
+
system_failure = 1 MESSAGE msg
|
|
70643
|
+
communication_failure = 2 MESSAGE msg
|
|
70644
|
+
resource_failure = 3
|
|
70622
70645
|
OTHERS = 4.`,
|
|
70623
70646
|
};
|
|
70624
70647
|
}
|
|
@@ -70702,11 +70725,11 @@ class SelectAddOrderBy {
|
|
|
70702
70725
|
key: "select_add_order_by",
|
|
70703
70726
|
title: "SELECT add ORDER BY",
|
|
70704
70727
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70705
|
-
extendedInformation: `
|
|
70706
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70707
|
-
|
|
70708
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70709
|
-
|
|
70728
|
+
extendedInformation: `
|
|
70729
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70730
|
+
|
|
70731
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70732
|
+
|
|
70710
70733
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70711
70734
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70712
70735
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70837,14 +70860,14 @@ class SelectPerformance {
|
|
|
70837
70860
|
key: "select_performance",
|
|
70838
70861
|
title: "SELECT performance",
|
|
70839
70862
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70840
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70841
|
-
|
|
70863
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70864
|
+
|
|
70842
70865
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70843
70866
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70844
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70845
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70867
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70868
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70846
70869
|
ENDSELECT.`,
|
|
70847
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70870
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70848
70871
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70849
70872
|
};
|
|
70850
70873
|
}
|
|
@@ -70958,8 +70981,8 @@ class SelectSingleFullKey {
|
|
|
70958
70981
|
key: "select_single_full_key",
|
|
70959
70982
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70960
70983
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70961
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70962
|
-
|
|
70984
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70985
|
+
|
|
70963
70986
|
If the statement contains a JOIN it is not checked`,
|
|
70964
70987
|
pseudoComment: "EC CI_NOORDER",
|
|
70965
70988
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71383,8 +71406,8 @@ class SICFConsistency {
|
|
|
71383
71406
|
key: "sicf_consistency",
|
|
71384
71407
|
title: "SICF consistency",
|
|
71385
71408
|
shortDescription: `Checks the validity of ICF services`,
|
|
71386
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71387
|
-
* Class must not have any syntax errors
|
|
71409
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71410
|
+
* Class must not have any syntax errors
|
|
71388
71411
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71389
71412
|
};
|
|
71390
71413
|
}
|
|
@@ -71496,23 +71519,23 @@ class SlowParameterPassing {
|
|
|
71496
71519
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71497
71520
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71498
71521
|
tags: [_irule_1.RuleTag.Performance],
|
|
71499
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71500
|
-
PUBLIC SECTION.
|
|
71501
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71502
|
-
ENDCLASS.
|
|
71503
|
-
CLASS lcl IMPLEMENTATION.
|
|
71504
|
-
METHOD bar.
|
|
71505
|
-
WRITE sdf.
|
|
71506
|
-
ENDMETHOD.
|
|
71522
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71523
|
+
PUBLIC SECTION.
|
|
71524
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71525
|
+
ENDCLASS.
|
|
71526
|
+
CLASS lcl IMPLEMENTATION.
|
|
71527
|
+
METHOD bar.
|
|
71528
|
+
WRITE sdf.
|
|
71529
|
+
ENDMETHOD.
|
|
71507
71530
|
ENDCLASS.`,
|
|
71508
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71509
|
-
PUBLIC SECTION.
|
|
71510
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71511
|
-
ENDCLASS.
|
|
71512
|
-
CLASS lcl IMPLEMENTATION.
|
|
71513
|
-
METHOD bar.
|
|
71514
|
-
WRITE sdf.
|
|
71515
|
-
ENDMETHOD.
|
|
71531
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71532
|
+
PUBLIC SECTION.
|
|
71533
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71534
|
+
ENDCLASS.
|
|
71535
|
+
CLASS lcl IMPLEMENTATION.
|
|
71536
|
+
METHOD bar.
|
|
71537
|
+
WRITE sdf.
|
|
71538
|
+
ENDMETHOD.
|
|
71516
71539
|
ENDCLASS.`,
|
|
71517
71540
|
};
|
|
71518
71541
|
}
|
|
@@ -71769,8 +71792,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71769
71792
|
key: "space_before_dot",
|
|
71770
71793
|
title: "Space before dot",
|
|
71771
71794
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71772
|
-
extendedInformation: `
|
|
71773
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71795
|
+
extendedInformation: `
|
|
71796
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71774
71797
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71775
71798
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71776
71799
|
badExample: `WRITE bar .`,
|
|
@@ -71956,12 +71979,12 @@ class SQLValueConversion {
|
|
|
71956
71979
|
key: "sql_value_conversion",
|
|
71957
71980
|
title: "Implicit SQL Value Conversion",
|
|
71958
71981
|
shortDescription: `Ensure types match when selecting from database`,
|
|
71959
|
-
extendedInformation: `
|
|
71960
|
-
* Integer to CHAR conversion
|
|
71961
|
-
* Integer to NUMC conversion
|
|
71962
|
-
* NUMC to Integer conversion
|
|
71963
|
-
* CHAR to Integer conversion
|
|
71964
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
71982
|
+
extendedInformation: `
|
|
71983
|
+
* Integer to CHAR conversion
|
|
71984
|
+
* Integer to NUMC conversion
|
|
71985
|
+
* NUMC to Integer conversion
|
|
71986
|
+
* CHAR to Integer conversion
|
|
71987
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71965
71988
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71966
71989
|
tags: [],
|
|
71967
71990
|
};
|
|
@@ -72033,7 +72056,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72033
72056
|
key: "start_at_tab",
|
|
72034
72057
|
title: "Start at tab",
|
|
72035
72058
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72036
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72059
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72037
72060
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72038
72061
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72039
72062
|
badExample: ` WRITE a.`,
|
|
@@ -72210,12 +72233,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72210
72233
|
key: "strict_sql",
|
|
72211
72234
|
title: "Strict SQL",
|
|
72212
72235
|
shortDescription: `Strict SQL`,
|
|
72213
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72214
|
-
|
|
72215
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72216
|
-
|
|
72217
|
-
Also see separate rule sql_escape_host_variables
|
|
72218
|
-
|
|
72236
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72237
|
+
|
|
72238
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72239
|
+
|
|
72240
|
+
Also see separate rule sql_escape_host_variables
|
|
72241
|
+
|
|
72219
72242
|
Activates from v750 and up`,
|
|
72220
72243
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72221
72244
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72469,11 +72492,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72469
72492
|
key: "sy_modification",
|
|
72470
72493
|
title: "Modification of SY fields",
|
|
72471
72494
|
shortDescription: `Finds modification of sy fields`,
|
|
72472
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72473
|
-
|
|
72495
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72496
|
+
|
|
72474
72497
|
Changes to SY-TVAR* fields are not reported`,
|
|
72475
72498
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72476
|
-
badExample: `sy-uname = 2.
|
|
72499
|
+
badExample: `sy-uname = 2.
|
|
72477
72500
|
sy = sy.`,
|
|
72478
72501
|
};
|
|
72479
72502
|
}
|
|
@@ -72535,8 +72558,8 @@ class TABLEnhancementCategory {
|
|
|
72535
72558
|
key: "tabl_enhancement_category",
|
|
72536
72559
|
title: "TABL enhancement category must be set",
|
|
72537
72560
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72538
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72539
|
-
|
|
72561
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72562
|
+
|
|
72540
72563
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72541
72564
|
tags: [],
|
|
72542
72565
|
};
|
|
@@ -72601,8 +72624,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72601
72624
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72602
72625
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72603
72626
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72604
|
-
badExample: `FORM foo.
|
|
72605
|
-
TABLES t100.
|
|
72627
|
+
badExample: `FORM foo.
|
|
72628
|
+
TABLES t100.
|
|
72606
72629
|
ENDFORM.`,
|
|
72607
72630
|
goodExample: `TABLES t000.`,
|
|
72608
72631
|
};
|
|
@@ -72730,9 +72753,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72730
72753
|
title: "Type FORM parameters",
|
|
72731
72754
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72732
72755
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72733
|
-
badExample: `FORM foo USING bar.
|
|
72756
|
+
badExample: `FORM foo USING bar.
|
|
72734
72757
|
ENDFORM.`,
|
|
72735
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72758
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72736
72759
|
ENDFORM.`,
|
|
72737
72760
|
};
|
|
72738
72761
|
}
|
|
@@ -73405,38 +73428,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73405
73428
|
key: "unnecessary_pragma",
|
|
73406
73429
|
title: "Unnecessary Pragma",
|
|
73407
73430
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73408
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73409
|
-
|
|
73410
|
-
* NEEDED without definition
|
|
73411
|
-
|
|
73412
|
-
* NO_TEXT without texts
|
|
73413
|
-
|
|
73414
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73415
|
-
|
|
73431
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73432
|
+
|
|
73433
|
+
* NEEDED without definition
|
|
73434
|
+
|
|
73435
|
+
* NO_TEXT without texts
|
|
73436
|
+
|
|
73437
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73438
|
+
|
|
73416
73439
|
NO_HANDLER inside macros are not checked`,
|
|
73417
73440
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73418
|
-
badExample: `TRY.
|
|
73419
|
-
...
|
|
73420
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73421
|
-
RETURN. " it has a handler
|
|
73422
|
-
ENDTRY.
|
|
73423
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73424
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73425
|
-
IF sy-subrc <> 0.
|
|
73441
|
+
badExample: `TRY.
|
|
73442
|
+
...
|
|
73443
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73444
|
+
RETURN. " it has a handler
|
|
73445
|
+
ENDTRY.
|
|
73446
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73447
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73448
|
+
IF sy-subrc <> 0.
|
|
73426
73449
|
ENDIF.`,
|
|
73427
|
-
goodExample: `TRY.
|
|
73428
|
-
...
|
|
73429
|
-
CATCH zcx_abapgit_exception.
|
|
73430
|
-
RETURN.
|
|
73431
|
-
ENDTRY.
|
|
73432
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73433
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73434
|
-
IF sy-subrc <> 0.
|
|
73435
|
-
ENDIF.
|
|
73436
|
-
|
|
73437
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73438
|
-
test1 TYPE string,
|
|
73439
|
-
test2 TYPE string,
|
|
73450
|
+
goodExample: `TRY.
|
|
73451
|
+
...
|
|
73452
|
+
CATCH zcx_abapgit_exception.
|
|
73453
|
+
RETURN.
|
|
73454
|
+
ENDTRY.
|
|
73455
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73456
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73457
|
+
IF sy-subrc <> 0.
|
|
73458
|
+
ENDIF.
|
|
73459
|
+
|
|
73460
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73461
|
+
test1 TYPE string,
|
|
73462
|
+
test2 TYPE string,
|
|
73440
73463
|
END OF blah.`,
|
|
73441
73464
|
};
|
|
73442
73465
|
}
|
|
@@ -73603,18 +73626,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73603
73626
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73604
73627
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73605
73628
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73606
|
-
badExample: `FORM hello1.
|
|
73607
|
-
WRITE 'world'.
|
|
73608
|
-
RETURN.
|
|
73609
|
-
ENDFORM.
|
|
73610
|
-
|
|
73611
|
-
FORM foo.
|
|
73612
|
-
IF 1 = 2.
|
|
73613
|
-
RETURN.
|
|
73614
|
-
ENDIF.
|
|
73629
|
+
badExample: `FORM hello1.
|
|
73630
|
+
WRITE 'world'.
|
|
73631
|
+
RETURN.
|
|
73632
|
+
ENDFORM.
|
|
73633
|
+
|
|
73634
|
+
FORM foo.
|
|
73635
|
+
IF 1 = 2.
|
|
73636
|
+
RETURN.
|
|
73637
|
+
ENDIF.
|
|
73615
73638
|
ENDFORM.`,
|
|
73616
|
-
goodExample: `FORM hello2.
|
|
73617
|
-
WRITE 'world'.
|
|
73639
|
+
goodExample: `FORM hello2.
|
|
73640
|
+
WRITE 'world'.
|
|
73618
73641
|
ENDFORM.`,
|
|
73619
73642
|
};
|
|
73620
73643
|
}
|
|
@@ -73965,13 +73988,13 @@ class UnusedMacros {
|
|
|
73965
73988
|
title: "Unused macros",
|
|
73966
73989
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73967
73990
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73968
|
-
badExample: `DEFINE foobar1.
|
|
73969
|
-
WRITE 'hello'.
|
|
73991
|
+
badExample: `DEFINE foobar1.
|
|
73992
|
+
WRITE 'hello'.
|
|
73970
73993
|
END-OF-DEFINITION.`,
|
|
73971
|
-
goodExample: `DEFINE foobar2.
|
|
73972
|
-
WRITE 'hello'.
|
|
73973
|
-
END-OF-DEFINITION.
|
|
73974
|
-
|
|
73994
|
+
goodExample: `DEFINE foobar2.
|
|
73995
|
+
WRITE 'hello'.
|
|
73996
|
+
END-OF-DEFINITION.
|
|
73997
|
+
|
|
73975
73998
|
foobar2.`,
|
|
73976
73999
|
};
|
|
73977
74000
|
}
|
|
@@ -74083,18 +74106,18 @@ class UnusedMethods {
|
|
|
74083
74106
|
key: "unused_methods",
|
|
74084
74107
|
title: "Unused methods",
|
|
74085
74108
|
shortDescription: `Checks for unused methods`,
|
|
74086
|
-
extendedInformation: `Checks private and protected methods.
|
|
74087
|
-
|
|
74088
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74089
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74090
|
-
|
|
74091
|
-
Skips:
|
|
74092
|
-
* methods FOR TESTING
|
|
74093
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74094
|
-
* class_constructor + constructor methods
|
|
74095
|
-
* event handlers
|
|
74096
|
-
* methods that are redefined
|
|
74097
|
-
* INCLUDEs
|
|
74109
|
+
extendedInformation: `Checks private and protected methods.
|
|
74110
|
+
|
|
74111
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74112
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74113
|
+
|
|
74114
|
+
Skips:
|
|
74115
|
+
* methods FOR TESTING
|
|
74116
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74117
|
+
* class_constructor + constructor methods
|
|
74118
|
+
* event handlers
|
|
74119
|
+
* methods that are redefined
|
|
74120
|
+
* INCLUDEs
|
|
74098
74121
|
`,
|
|
74099
74122
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74100
74123
|
pragma: "##CALLED",
|
|
@@ -74570,23 +74593,23 @@ class UnusedVariables {
|
|
|
74570
74593
|
key: "unused_variables",
|
|
74571
74594
|
title: "Unused variables",
|
|
74572
74595
|
shortDescription: `Checks for unused variables and constants`,
|
|
74573
|
-
extendedInformation: `Skips event parameters.
|
|
74574
|
-
|
|
74575
|
-
Note that this currently does not work if the source code uses macros.
|
|
74576
|
-
|
|
74577
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74578
|
-
|
|
74596
|
+
extendedInformation: `Skips event parameters.
|
|
74597
|
+
|
|
74598
|
+
Note that this currently does not work if the source code uses macros.
|
|
74599
|
+
|
|
74600
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74601
|
+
|
|
74579
74602
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74580
74603
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74581
74604
|
pragma: "##NEEDED",
|
|
74582
74605
|
pseudoComment: "EC NEEDED",
|
|
74583
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74584
|
-
test TYPE string,
|
|
74585
|
-
test2 TYPE string,
|
|
74606
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74607
|
+
test TYPE string,
|
|
74608
|
+
test2 TYPE string,
|
|
74586
74609
|
END OF blah1.`,
|
|
74587
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74588
|
-
test TYPE string,
|
|
74589
|
-
test2 TYPE string,
|
|
74610
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74611
|
+
test TYPE string,
|
|
74612
|
+
test2 TYPE string,
|
|
74590
74613
|
END OF blah2.`,
|
|
74591
74614
|
};
|
|
74592
74615
|
}
|
|
@@ -74805,15 +74828,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74805
74828
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74806
74829
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74807
74830
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74808
|
-
badExample: `IF line IS INITIAL.
|
|
74809
|
-
has_entries = abap_false.
|
|
74810
|
-
ELSE.
|
|
74811
|
-
has_entries = abap_true.
|
|
74812
|
-
ENDIF.
|
|
74813
|
-
|
|
74831
|
+
badExample: `IF line IS INITIAL.
|
|
74832
|
+
has_entries = abap_false.
|
|
74833
|
+
ELSE.
|
|
74834
|
+
has_entries = abap_true.
|
|
74835
|
+
ENDIF.
|
|
74836
|
+
|
|
74814
74837
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74815
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74816
|
-
|
|
74838
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74839
|
+
|
|
74817
74840
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74818
74841
|
};
|
|
74819
74842
|
}
|
|
@@ -74931,15 +74954,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74931
74954
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74932
74955
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74933
74956
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74934
|
-
badExample: `INTERFACE lif.
|
|
74935
|
-
METHODS load_data
|
|
74936
|
-
EXCEPTIONS
|
|
74937
|
-
invalid_parameter.
|
|
74957
|
+
badExample: `INTERFACE lif.
|
|
74958
|
+
METHODS load_data
|
|
74959
|
+
EXCEPTIONS
|
|
74960
|
+
invalid_parameter.
|
|
74938
74961
|
ENDINTERFACE.`,
|
|
74939
|
-
goodExample: `INTERFACE lif.
|
|
74940
|
-
METHODS load_data
|
|
74941
|
-
RAISING
|
|
74942
|
-
cx_something.
|
|
74962
|
+
goodExample: `INTERFACE lif.
|
|
74963
|
+
METHODS load_data
|
|
74964
|
+
RAISING
|
|
74965
|
+
cx_something.
|
|
74943
74966
|
ENDINTERFACE.`,
|
|
74944
74967
|
};
|
|
74945
74968
|
}
|
|
@@ -74999,15 +75022,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74999
75022
|
key: "use_line_exists",
|
|
75000
75023
|
title: "Use line_exists",
|
|
75001
75024
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75002
|
-
extendedInformation: `
|
|
75003
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75004
|
-
|
|
75025
|
+
extendedInformation: `
|
|
75026
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75027
|
+
|
|
75005
75028
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75006
75029
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75007
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75008
|
-
IF sy-subrc = 0.
|
|
75030
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75031
|
+
IF sy-subrc = 0.
|
|
75009
75032
|
ENDIF.`,
|
|
75010
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75033
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75011
75034
|
ENDIF.`,
|
|
75012
75035
|
};
|
|
75013
75036
|
}
|
|
@@ -75117,10 +75140,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75117
75140
|
key: "use_new",
|
|
75118
75141
|
title: "Use NEW",
|
|
75119
75142
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75120
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75121
|
-
|
|
75122
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75123
|
-
|
|
75143
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75144
|
+
|
|
75145
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75146
|
+
|
|
75124
75147
|
Applicable from v740sp02 and up`,
|
|
75125
75148
|
badExample: `CREATE OBJECT ref.`,
|
|
75126
75149
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75218,13 +75241,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75218
75241
|
title: "WHEN OTHERS last",
|
|
75219
75242
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75220
75243
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75221
|
-
badExample: `CASE bar.
|
|
75222
|
-
WHEN OTHERS.
|
|
75223
|
-
WHEN 2.
|
|
75244
|
+
badExample: `CASE bar.
|
|
75245
|
+
WHEN OTHERS.
|
|
75246
|
+
WHEN 2.
|
|
75224
75247
|
ENDCASE.`,
|
|
75225
|
-
goodExample: `CASE bar.
|
|
75226
|
-
WHEN 2.
|
|
75227
|
-
WHEN OTHERS.
|
|
75248
|
+
goodExample: `CASE bar.
|
|
75249
|
+
WHEN 2.
|
|
75250
|
+
WHEN OTHERS.
|
|
75228
75251
|
ENDCASE.`,
|
|
75229
75252
|
};
|
|
75230
75253
|
}
|