@abaplint/cli 2.113.24 → 2.113.25
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 +873 -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,
|
|
@@ -52821,7 +52821,7 @@ class Registry {
|
|
|
52821
52821
|
}
|
|
52822
52822
|
static abaplintVersion() {
|
|
52823
52823
|
// magic, see build script "version.sh"
|
|
52824
|
-
return "2.113.
|
|
52824
|
+
return "2.113.25";
|
|
52825
52825
|
}
|
|
52826
52826
|
getDDICReferences() {
|
|
52827
52827
|
return this.ddicReferences;
|
|
@@ -53140,10 +53140,10 @@ class SevenBitAscii {
|
|
|
53140
53140
|
key: "7bit_ascii",
|
|
53141
53141
|
title: "Check for 7bit ascii",
|
|
53142
53142
|
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
|
-
|
|
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
|
+
|
|
53147
53147
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53148
53148
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53149
53149
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53349,10 +53349,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53349
53349
|
key: "abapdoc",
|
|
53350
53350
|
title: "Check abapdoc",
|
|
53351
53351
|
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
|
-
|
|
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
|
+
|
|
53356
53356
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53357
53357
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53358
53358
|
};
|
|
@@ -53489,27 +53489,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53489
53489
|
title: "Add test attributes for tests classes with test methods",
|
|
53490
53490
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53491
53491
|
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.
|
|
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.
|
|
53502
53502
|
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.
|
|
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.
|
|
53513
53513
|
ENDCLASS.`,
|
|
53514
53514
|
};
|
|
53515
53515
|
}
|
|
@@ -53595,49 +53595,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53595
53595
|
key: "align_parameters",
|
|
53596
53596
|
title: "Align Parameters",
|
|
53597
53597
|
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
|
|
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
|
|
53612
53612
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53613
53613
|
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
|
|
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
|
|
53624
53624
|
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
|
|
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
53641
|
value_foo = 5 ) ).`,
|
|
53642
53642
|
};
|
|
53643
53643
|
}
|
|
@@ -54071,37 +54071,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54071
54071
|
key: "align_type_expressions",
|
|
54072
54072
|
title: "Align TYPE expressions",
|
|
54073
54073
|
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:
|
|
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:
|
|
54080
54080
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54081
54081
|
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.
|
|
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.
|
|
54093
54093
|
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.
|
|
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.
|
|
54105
54105
|
ENDINTERFACE.`,
|
|
54106
54106
|
};
|
|
54107
54107
|
}
|
|
@@ -54380,16 +54380,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54380
54380
|
return {
|
|
54381
54381
|
key: "ambiguous_statement",
|
|
54382
54382
|
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
|
-
|
|
54383
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54384
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54385
|
+
|
|
54386
54386
|
Only works if the target version is 740sp05 or above`,
|
|
54387
54387
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54388
|
-
badExample: `DELETE foo FROM bar.
|
|
54388
|
+
badExample: `DELETE foo FROM bar.
|
|
54389
54389
|
MODIFY foo FROM bar.`,
|
|
54390
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54391
|
-
DELETE TABLE itab FROM 2.
|
|
54392
|
-
MODIFY zfoo FROM @wa.
|
|
54390
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54391
|
+
DELETE TABLE itab FROM 2.
|
|
54392
|
+
MODIFY zfoo FROM @wa.
|
|
54393
54393
|
MODIFY TABLE foo FROM bar.`,
|
|
54394
54394
|
};
|
|
54395
54395
|
}
|
|
@@ -54494,16 +54494,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54494
54494
|
key: "avoid_use",
|
|
54495
54495
|
title: "Avoid use of certain statements",
|
|
54496
54496
|
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
|
-
|
|
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
|
+
|
|
54507
54507
|
BREAK points`,
|
|
54508
54508
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54509
54509
|
};
|
|
@@ -54635,11 +54635,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54635
54635
|
title: "Check BEGIN END names",
|
|
54636
54636
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54637
54637
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54638
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54639
|
-
field TYPE i,
|
|
54638
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54639
|
+
field TYPE i,
|
|
54640
54640
|
END OF structure_not_the_same.`,
|
|
54641
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54642
|
-
field TYPE i,
|
|
54641
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54642
|
+
field TYPE i,
|
|
54643
54643
|
END OF stru.`,
|
|
54644
54644
|
};
|
|
54645
54645
|
}
|
|
@@ -54736,20 +54736,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54736
54736
|
title: "BEGIN contains single INCLUDE",
|
|
54737
54737
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54738
54738
|
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.
|
|
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.
|
|
54749
54749
|
STATICS END OF bar.`,
|
|
54750
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54751
|
-
DATA field TYPE i.
|
|
54752
|
-
INCLUDE STRUCTURE dselc.
|
|
54750
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54751
|
+
DATA field TYPE i.
|
|
54752
|
+
INCLUDE STRUCTURE dselc.
|
|
54753
54753
|
DATA END OF foo.`,
|
|
54754
54754
|
};
|
|
54755
54755
|
}
|
|
@@ -54839,9 +54839,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54839
54839
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54840
54840
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54841
54841
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54842
|
-
goodExample: `TRY.
|
|
54843
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54844
|
-
CATCH cx_sy_authorization_error.
|
|
54842
|
+
goodExample: `TRY.
|
|
54843
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54844
|
+
CATCH cx_sy_authorization_error.
|
|
54845
54845
|
ENDTRY.`,
|
|
54846
54846
|
};
|
|
54847
54847
|
}
|
|
@@ -54906,10 +54906,10 @@ class CDSCommentStyle {
|
|
|
54906
54906
|
key: "cds_comment_style",
|
|
54907
54907
|
title: "CDS Comment Style",
|
|
54908
54908
|
shortDescription: `Check for obsolete comment style`,
|
|
54909
|
-
extendedInformation: `Check for obsolete comment style
|
|
54910
|
-
|
|
54911
|
-
Comments starting with "--" are considered obsolete
|
|
54912
|
-
|
|
54909
|
+
extendedInformation: `Check for obsolete comment style
|
|
54910
|
+
|
|
54911
|
+
Comments starting with "--" are considered obsolete
|
|
54912
|
+
|
|
54913
54913
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54914
54914
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54915
54915
|
badExample: "-- this is a comment",
|
|
@@ -54975,10 +54975,10 @@ class CDSLegacyView {
|
|
|
54975
54975
|
key: "cds_legacy_view",
|
|
54976
54976
|
title: "CDS Legacy View",
|
|
54977
54977
|
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
|
-
|
|
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
|
+
|
|
54982
54982
|
v755 and up`,
|
|
54983
54983
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54984
54984
|
};
|
|
@@ -55133,10 +55133,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55133
55133
|
key: "chain_mainly_declarations",
|
|
55134
55134
|
title: "Chain mainly declarations",
|
|
55135
55135
|
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
|
|
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
|
|
55140
55140
|
`,
|
|
55141
55141
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55142
55142
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55312,17 +55312,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55312
55312
|
title: "Change IF to CASE",
|
|
55313
55313
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55314
55314
|
// 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
|
-
|
|
55315
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55316
|
+
|
|
55317
55317
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55318
55318
|
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'.
|
|
55319
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55320
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55321
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55322
55322
|
ENDIF.`,
|
|
55323
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55324
|
-
WHEN 'FOO'.
|
|
55325
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55323
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55324
|
+
WHEN 'FOO'.
|
|
55325
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55326
55326
|
ENDCASE.`,
|
|
55327
55327
|
};
|
|
55328
55328
|
}
|
|
@@ -55459,8 +55459,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55459
55459
|
return {
|
|
55460
55460
|
key: "check_abstract",
|
|
55461
55461
|
title: "Check abstract methods and classes",
|
|
55462
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55463
|
-
- class defined as abstract and final,
|
|
55462
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55463
|
+
- class defined as abstract and final,
|
|
55464
55464
|
- non-abstract class contains abstract methods`,
|
|
55465
55465
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55466
55466
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55541,11 +55541,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55541
55541
|
return {
|
|
55542
55542
|
key: "check_comments",
|
|
55543
55543
|
title: "Check Comments",
|
|
55544
|
-
shortDescription: `
|
|
55544
|
+
shortDescription: `
|
|
55545
55545
|
Various checks for comment usage.`,
|
|
55546
|
-
extendedInformation: `
|
|
55547
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55548
|
-
|
|
55546
|
+
extendedInformation: `
|
|
55547
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55548
|
+
|
|
55549
55549
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55550
55550
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55551
55551
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55707,9 +55707,9 @@ class CheckInclude {
|
|
|
55707
55707
|
key: "check_include",
|
|
55708
55708
|
title: "Check INCLUDEs",
|
|
55709
55709
|
shortDescription: `Checks INCLUDE statements`,
|
|
55710
|
-
extendedInformation: `
|
|
55711
|
-
* Reports unused includes
|
|
55712
|
-
* Errors if the includes are not found
|
|
55710
|
+
extendedInformation: `
|
|
55711
|
+
* Reports unused includes
|
|
55712
|
+
* Errors if the includes are not found
|
|
55713
55713
|
* Error if including a main program`,
|
|
55714
55714
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55715
55715
|
};
|
|
@@ -55785,14 +55785,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55785
55785
|
key: "check_subrc",
|
|
55786
55786
|
title: "Check sy-subrc",
|
|
55787
55787
|
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
|
-
|
|
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
|
+
|
|
55796
55796
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55797
55797
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55798
55798
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56362,17 +56362,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56362
56362
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56363
56363
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56364
56364
|
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
|
|
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
|
|
56370
56370
|
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
|
|
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
|
|
56376
56376
|
OTHERS = 4.`,
|
|
56377
56377
|
};
|
|
56378
56378
|
}
|
|
@@ -56618,7 +56618,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56618
56618
|
key: "commented_code",
|
|
56619
56619
|
title: "Find commented code",
|
|
56620
56620
|
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
|
|
56621
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56622
56622
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56623
56623
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56624
56624
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56851,10 +56851,10 @@ class ConstructorVisibilityPublic {
|
|
|
56851
56851
|
key: "constructor_visibility_public",
|
|
56852
56852
|
title: "Check constructor visibility is public",
|
|
56853
56853
|
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
|
|
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
|
|
56858
56858
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56859
56859
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56860
56860
|
};
|
|
@@ -56929,8 +56929,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56929
56929
|
key: "contains_tab",
|
|
56930
56930
|
title: "Code contains tab",
|
|
56931
56931
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56932
|
-
extendedInformation: `
|
|
56933
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56932
|
+
extendedInformation: `
|
|
56933
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56934
56934
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56935
56935
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56936
56936
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57017,10 +57017,10 @@ class CyclicOO {
|
|
|
57017
57017
|
key: "cyclic_oo",
|
|
57018
57018
|
title: "Cyclic OO",
|
|
57019
57019
|
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
|
-
|
|
57020
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57021
|
+
|
|
57022
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57023
|
+
|
|
57024
57024
|
References in testclass includes are ignored`,
|
|
57025
57025
|
};
|
|
57026
57026
|
}
|
|
@@ -57263,7 +57263,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57263
57263
|
key: "dangerous_statement",
|
|
57264
57264
|
title: "Dangerous statement",
|
|
57265
57265
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57266
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57266
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57267
57267
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57268
57268
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57269
57269
|
};
|
|
@@ -57470,13 +57470,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57470
57470
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57471
57471
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57472
57472
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57473
|
-
badExample: `FROM foo.
|
|
57474
|
-
WRITE 'hello'.
|
|
57475
|
-
DATA int TYPE i.
|
|
57473
|
+
badExample: `FROM foo.
|
|
57474
|
+
WRITE 'hello'.
|
|
57475
|
+
DATA int TYPE i.
|
|
57476
57476
|
ENDFORM.`,
|
|
57477
|
-
goodExample: `FROM foo.
|
|
57478
|
-
DATA int TYPE i.
|
|
57479
|
-
WRITE 'hello'.
|
|
57477
|
+
goodExample: `FROM foo.
|
|
57478
|
+
DATA int TYPE i.
|
|
57479
|
+
WRITE 'hello'.
|
|
57480
57480
|
ENDFORM.`,
|
|
57481
57481
|
};
|
|
57482
57482
|
}
|
|
@@ -58015,39 +58015,39 @@ class Downport {
|
|
|
58015
58015
|
key: "downport",
|
|
58016
58016
|
title: "Downport statement",
|
|
58017
58017
|
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
|
-
|
|
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
|
+
|
|
58051
58051
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58052
58052
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58053
58053
|
};
|
|
@@ -58625,10 +58625,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58625
58625
|
const fieldName = f.concatTokens();
|
|
58626
58626
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58627
58627
|
}
|
|
58628
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58628
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58629
58629
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58630
58630
|
}
|
|
58631
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58631
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58632
58632
|
${indentation}`);
|
|
58633
58633
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58634
58634
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58687,12 +58687,12 @@ ${indentation}`);
|
|
|
58687
58687
|
}
|
|
58688
58688
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58689
58689
|
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.
|
|
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.
|
|
58693
58693
|
${indentation}`);
|
|
58694
58694
|
if (fieldDefinitions === "") {
|
|
58695
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58695
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58696
58696
|
${indentation}`);
|
|
58697
58697
|
}
|
|
58698
58698
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58760,7 +58760,7 @@ ${indentation}`);
|
|
|
58760
58760
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58761
58761
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58762
58762
|
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()}.
|
|
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()}.
|
|
58764
58764
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58765
58765
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58766
58766
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58814,7 +58814,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58814
58814
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58815
58815
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58816
58816
|
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()}.
|
|
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()}.
|
|
58818
58818
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58819
58819
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58820
58820
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58856,14 +58856,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58856
58856
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58857
58857
|
const firstToken = high.getFirstToken();
|
|
58858
58858
|
// 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.
|
|
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.
|
|
58867
58867
|
${indentation}`);
|
|
58868
58868
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58869
58869
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58920,7 +58920,7 @@ ${indentation}`);
|
|
|
58920
58920
|
const className = classNames[0].concatTokens();
|
|
58921
58921
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58922
58922
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58923
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58923
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58924
58924
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58925
58925
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58926
58926
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59082,16 +59082,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59082
59082
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59083
59083
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59084
59084
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59085
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59086
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59085
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59086
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59087
59087
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59088
59088
|
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'.
|
|
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'.
|
|
59092
59092
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59093
59093
|
}
|
|
59094
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59094
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59095
59095
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59096
59096
|
if (withs.length > 0) {
|
|
59097
59097
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59203,10 +59203,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59203
59203
|
let code = "";
|
|
59204
59204
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59205
59205
|
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.
|
|
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.
|
|
59210
59210
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59211
59211
|
}
|
|
59212
59212
|
else {
|
|
@@ -59295,20 +59295,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59295
59295
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59296
59296
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59297
59297
|
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.
|
|
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.
|
|
59302
59302
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59303
59303
|
if (groupIndexName !== undefined) {
|
|
59304
59304
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59305
59305
|
}
|
|
59306
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59306
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59307
59307
|
IF sy-subrc = 0.\n`;
|
|
59308
59308
|
if (groupCountName !== undefined) {
|
|
59309
59309
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59310
59310
|
}
|
|
59311
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59311
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59312
59312
|
ELSE.\n`;
|
|
59313
59313
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59314
59314
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59329,8 +59329,8 @@ ELSE.\n`;
|
|
|
59329
59329
|
}
|
|
59330
59330
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59331
59331
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59332
|
-
code += `ENDIF.
|
|
59333
|
-
ENDLOOP.
|
|
59332
|
+
code += `ENDIF.
|
|
59333
|
+
ENDLOOP.
|
|
59334
59334
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59335
59335
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59336
59336
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59502,7 +59502,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59502
59502
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59503
59503
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59504
59504
|
// all ENUMS are char like?
|
|
59505
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59505
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59506
59506
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59507
59507
|
let count = 1;
|
|
59508
59508
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59546,14 +59546,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59546
59546
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59547
59547
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59548
59548
|
// 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.
|
|
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.
|
|
59557
59557
|
${indentation}${uniqueName}`;
|
|
59558
59558
|
const start = target.getFirstToken().getStart();
|
|
59559
59559
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59608,21 +59608,17 @@ ${indentation}${uniqueName}`;
|
|
|
59608
59608
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, "= " + target + operator);
|
|
59609
59609
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Expand operator", this.getMetadata().key, this.conf.severity, fix);
|
|
59610
59610
|
}
|
|
59611
|
-
// must be very simple string templates, like "|{ ls_line-no ALPHA = IN }|"
|
|
59612
59611
|
stringTemplateAlpha(low, high, lowFile, highSyntax) {
|
|
59613
59612
|
var _a, _b;
|
|
59614
59613
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
59615
59614
|
return undefined;
|
|
59616
59615
|
}
|
|
59617
|
-
for (const child of high.findAllExpressionsRecursive(Expressions.
|
|
59618
|
-
const
|
|
59619
|
-
if (
|
|
59620
|
-
||
|
|
59621
|
-
|| templateTokens[2].getFirstToken().getStr() !== "}|") {
|
|
59616
|
+
for (const child of high.findAllExpressionsRecursive(Expressions.StringTemplateSource)) {
|
|
59617
|
+
const formatting = (_a = child.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
59618
|
+
if (formatting === undefined
|
|
59619
|
+
|| (formatting === null || formatting === void 0 ? void 0 : formatting.startsWith("ALPHA = ")) === false) {
|
|
59622
59620
|
continue;
|
|
59623
59621
|
}
|
|
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
59622
|
let functionName = "";
|
|
59627
59623
|
switch (formatting) {
|
|
59628
59624
|
case "ALPHA = IN":
|
|
@@ -59635,13 +59631,13 @@ ${indentation}${uniqueName}`;
|
|
|
59635
59631
|
return undefined;
|
|
59636
59632
|
}
|
|
59637
59633
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59638
|
-
const source = (_b =
|
|
59634
|
+
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59639
59635
|
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
|
|
59636
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59637
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59638
|
+
${indentation} EXPORTING
|
|
59639
|
+
${indentation} input = ${source}
|
|
59640
|
+
${indentation} IMPORTING
|
|
59645
59641
|
${indentation} output = ${uniqueName}.\n`;
|
|
59646
59642
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59647
59643
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60953,12 +60949,12 @@ class EasyToFindMessages {
|
|
|
60953
60949
|
key: "easy_to_find_messages",
|
|
60954
60950
|
title: "Easy to find messages",
|
|
60955
60951
|
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
|
-
|
|
60952
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60953
|
+
|
|
60954
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60955
|
+
|
|
60956
|
+
Also see rule "message_exists"
|
|
60957
|
+
|
|
60962
60958
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60963
60959
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60964
60960
|
};
|
|
@@ -61039,13 +61035,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61039
61035
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61040
61036
|
extendedInformation: ``,
|
|
61041
61037
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61042
|
-
badExample: `
|
|
61043
|
-
INITIALIZATION.
|
|
61044
|
-
WRITE 'hello'.
|
|
61038
|
+
badExample: `
|
|
61039
|
+
INITIALIZATION.
|
|
61040
|
+
WRITE 'hello'.
|
|
61045
61041
|
END-OF-SELECTION.`,
|
|
61046
|
-
goodExample: `
|
|
61047
|
-
START-OF-SELECTION.
|
|
61048
|
-
PERFORM sdf.
|
|
61042
|
+
goodExample: `
|
|
61043
|
+
START-OF-SELECTION.
|
|
61044
|
+
PERFORM sdf.
|
|
61049
61045
|
COMMIT WORK.`,
|
|
61050
61046
|
};
|
|
61051
61047
|
}
|
|
@@ -61137,8 +61133,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61137
61133
|
key: "empty_line_in_statement",
|
|
61138
61134
|
title: "Find empty lines in statements",
|
|
61139
61135
|
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
|
-
|
|
61136
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61137
|
+
|
|
61142
61138
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61143
61139
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61144
61140
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61314,13 +61310,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61314
61310
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61315
61311
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61316
61312
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61317
|
-
badExample: `IF foo = bar.
|
|
61318
|
-
ENDIF.
|
|
61319
|
-
|
|
61320
|
-
DO 2 TIMES.
|
|
61313
|
+
badExample: `IF foo = bar.
|
|
61314
|
+
ENDIF.
|
|
61315
|
+
|
|
61316
|
+
DO 2 TIMES.
|
|
61321
61317
|
ENDDO.`,
|
|
61322
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61323
|
-
ENDLOOP.
|
|
61318
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61319
|
+
ENDLOOP.
|
|
61324
61320
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61325
61321
|
};
|
|
61326
61322
|
}
|
|
@@ -61462,10 +61458,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61462
61458
|
return {
|
|
61463
61459
|
key: "exit_or_check",
|
|
61464
61460
|
title: "Find EXIT or CHECK outside loops",
|
|
61465
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61461
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61466
61462
|
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
|
|
61463
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61464
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61469
61465
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61470
61466
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61471
61467
|
};
|
|
@@ -61548,12 +61544,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61548
61544
|
key: "expand_macros",
|
|
61549
61545
|
title: "Expand Macros",
|
|
61550
61546
|
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
|
-
|
|
61547
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61548
|
+
|
|
61553
61549
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61554
|
-
badExample: `DEFINE _hello.
|
|
61555
|
-
WRITE 'hello'.
|
|
61556
|
-
END-OF-DEFINITION.
|
|
61550
|
+
badExample: `DEFINE _hello.
|
|
61551
|
+
WRITE 'hello'.
|
|
61552
|
+
END-OF-DEFINITION.
|
|
61557
61553
|
_hello.`,
|
|
61558
61554
|
goodExample: `WRITE 'hello'.`,
|
|
61559
61555
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61640,7 +61636,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61640
61636
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61641
61637
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61642
61638
|
goodExample: `call_method( foo = bar ).`,
|
|
61643
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61639
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61644
61640
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61645
61641
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61646
61642
|
};
|
|
@@ -61738,7 +61734,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61738
61734
|
key: "forbidden_identifier",
|
|
61739
61735
|
title: "Forbidden Identifier",
|
|
61740
61736
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61741
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61737
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61742
61738
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61743
61739
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61744
61740
|
};
|
|
@@ -61980,8 +61976,8 @@ class ForbiddenVoidType {
|
|
|
61980
61976
|
key: "forbidden_void_type",
|
|
61981
61977
|
title: "Forbidden Void Types",
|
|
61982
61978
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61983
|
-
extendedInformation: `Inspiration:
|
|
61984
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61979
|
+
extendedInformation: `Inspiration:
|
|
61980
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61985
61981
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61986
61982
|
};
|
|
61987
61983
|
}
|
|
@@ -62224,9 +62220,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62224
62220
|
key: "fully_type_itabs",
|
|
62225
62221
|
title: "Fully type internal tables",
|
|
62226
62222
|
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
|
|
62223
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62228
62224
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62229
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62225
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62230
62226
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62231
62227
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62232
62228
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62411,26 +62407,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62411
62407
|
key: "functional_writing",
|
|
62412
62408
|
title: "Use functional writing",
|
|
62413
62409
|
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
|
|
62410
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62415
62411
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62416
62412
|
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
|
|
62413
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62414
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62415
|
+
EXPORTING
|
|
62416
|
+
p_name = 'NAME'
|
|
62417
|
+
RECEIVING
|
|
62418
|
+
p_descr_ref = lr_typedescr
|
|
62419
|
+
EXCEPTIONS
|
|
62420
|
+
type_not_found = 1
|
|
62425
62421
|
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
|
|
62422
|
+
goodExample: `zcl_class=>method( ).
|
|
62423
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62424
|
+
EXPORTING
|
|
62425
|
+
p_name = 'NAME'
|
|
62426
|
+
RECEIVING
|
|
62427
|
+
p_descr_ref = lr_typedescr
|
|
62428
|
+
EXCEPTIONS
|
|
62429
|
+
type_not_found = 1
|
|
62434
62430
|
OTHERS = 2 ).`,
|
|
62435
62431
|
};
|
|
62436
62432
|
}
|
|
@@ -62541,14 +62537,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62541
62537
|
key: "global_class",
|
|
62542
62538
|
title: "Global class checks",
|
|
62543
62539
|
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
|
-
|
|
62540
|
+
extendedInformation: `* global classes must be in own files
|
|
62541
|
+
|
|
62542
|
+
* file names must match class name
|
|
62543
|
+
|
|
62544
|
+
* file names must match interface name
|
|
62545
|
+
|
|
62546
|
+
* global classes must be global definitions
|
|
62547
|
+
|
|
62552
62548
|
* global interfaces must be global definitions`,
|
|
62553
62549
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62554
62550
|
};
|
|
@@ -62647,21 +62643,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62647
62643
|
return {
|
|
62648
62644
|
key: "identical_conditions",
|
|
62649
62645
|
title: "Identical conditions",
|
|
62650
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62651
|
-
|
|
62646
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62647
|
+
|
|
62652
62648
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62653
62649
|
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'.
|
|
62650
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62651
|
+
ENDIF.
|
|
62652
|
+
CASE bar.
|
|
62653
|
+
WHEN '1'.
|
|
62654
|
+
WHEN 'A' OR '1'.
|
|
62659
62655
|
ENDCASE.`,
|
|
62660
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62661
|
-
ENDIF.
|
|
62662
|
-
CASE bar.
|
|
62663
|
-
WHEN '1'.
|
|
62664
|
-
WHEN 'A'.
|
|
62656
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62657
|
+
ENDIF.
|
|
62658
|
+
CASE bar.
|
|
62659
|
+
WHEN '1'.
|
|
62660
|
+
WHEN 'A'.
|
|
62665
62661
|
ENDCASE.`,
|
|
62666
62662
|
};
|
|
62667
62663
|
}
|
|
@@ -62795,23 +62791,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62795
62791
|
key: "identical_contents",
|
|
62796
62792
|
title: "Identical contents",
|
|
62797
62793
|
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
|
-
|
|
62794
|
+
extendedInformation: `
|
|
62795
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62796
|
+
|
|
62801
62797
|
Chained statments are ignored`,
|
|
62802
62798
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62803
|
-
badExample: `IF foo = bar.
|
|
62804
|
-
WRITE 'bar'.
|
|
62805
|
-
WRITE 'world'.
|
|
62806
|
-
ELSE.
|
|
62807
|
-
WRITE 'foo'.
|
|
62808
|
-
WRITE 'world'.
|
|
62799
|
+
badExample: `IF foo = bar.
|
|
62800
|
+
WRITE 'bar'.
|
|
62801
|
+
WRITE 'world'.
|
|
62802
|
+
ELSE.
|
|
62803
|
+
WRITE 'foo'.
|
|
62804
|
+
WRITE 'world'.
|
|
62809
62805
|
ENDIF.`,
|
|
62810
|
-
goodExample: `IF foo = bar.
|
|
62811
|
-
WRITE 'bar'.
|
|
62812
|
-
ELSE.
|
|
62813
|
-
WRITE 'foo'.
|
|
62814
|
-
ENDIF.
|
|
62806
|
+
goodExample: `IF foo = bar.
|
|
62807
|
+
WRITE 'bar'.
|
|
62808
|
+
ELSE.
|
|
62809
|
+
WRITE 'foo'.
|
|
62810
|
+
ENDIF.
|
|
62815
62811
|
WRITE 'world'.`,
|
|
62816
62812
|
};
|
|
62817
62813
|
}
|
|
@@ -62919,12 +62915,12 @@ class IdenticalDescriptions {
|
|
|
62919
62915
|
key: "identical_descriptions",
|
|
62920
62916
|
title: "Identical descriptions",
|
|
62921
62917
|
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
|
-
|
|
62918
|
+
extendedInformation: `Case insensitive
|
|
62919
|
+
|
|
62920
|
+
Only checks the master language descriptions
|
|
62921
|
+
|
|
62922
|
+
Dependencies are skipped
|
|
62923
|
+
|
|
62928
62924
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62929
62925
|
tags: [],
|
|
62930
62926
|
};
|
|
@@ -63098,43 +63094,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63098
63094
|
key: "if_in_if",
|
|
63099
63095
|
title: "IF in IF",
|
|
63100
63096
|
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/
|
|
63097
|
+
extendedInformation: `
|
|
63098
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63099
|
+
|
|
63100
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63101
|
+
|
|
63102
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63107
63103
|
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.
|
|
63104
|
+
badExample: `IF condition1.
|
|
63105
|
+
IF condition2.
|
|
63106
|
+
...
|
|
63107
|
+
ENDIF.
|
|
63108
|
+
ENDIF.
|
|
63109
|
+
|
|
63110
|
+
IF condition1.
|
|
63111
|
+
...
|
|
63112
|
+
ELSE.
|
|
63113
|
+
IF condition2.
|
|
63114
|
+
...
|
|
63115
|
+
ENDIF.
|
|
63120
63116
|
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.
|
|
63117
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63118
|
+
...
|
|
63119
|
+
ENDIF.
|
|
63120
|
+
|
|
63121
|
+
IF condition1.
|
|
63122
|
+
...
|
|
63123
|
+
ELSEIF condition2.
|
|
63124
|
+
...
|
|
63125
|
+
ENDIF.
|
|
63126
|
+
|
|
63127
|
+
CASE variable.
|
|
63128
|
+
WHEN value1.
|
|
63129
|
+
...
|
|
63130
|
+
WHEN value2.
|
|
63131
|
+
IF condition2.
|
|
63132
|
+
...
|
|
63133
|
+
ENDIF.
|
|
63138
63134
|
ENDCASE.`,
|
|
63139
63135
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63140
63136
|
};
|
|
@@ -63319,9 +63315,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63319
63315
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63320
63316
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63321
63317
|
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
|
|
63318
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63319
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63320
|
+
RETURN. " todo, implement method
|
|
63325
63321
|
ENDMETHOD.`);
|
|
63326
63322
|
}
|
|
63327
63323
|
}
|
|
@@ -63500,14 +63496,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63500
63496
|
key: "implicit_start_of_selection",
|
|
63501
63497
|
title: "Implicit START-OF-SELECTION",
|
|
63502
63498
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63503
|
-
extendedInformation: `Only runs for executable programs
|
|
63504
|
-
|
|
63499
|
+
extendedInformation: `Only runs for executable programs
|
|
63500
|
+
|
|
63505
63501
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63506
63502
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63507
|
-
badExample: `REPORT zfoo.
|
|
63503
|
+
badExample: `REPORT zfoo.
|
|
63508
63504
|
WRITE 'hello'.`,
|
|
63509
|
-
goodExample: `
|
|
63510
|
-
START-OF-SELECTION.
|
|
63505
|
+
goodExample: `
|
|
63506
|
+
START-OF-SELECTION.
|
|
63511
63507
|
WRITE 'hello'.`,
|
|
63512
63508
|
};
|
|
63513
63509
|
}
|
|
@@ -63612,19 +63608,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63612
63608
|
key: "in_statement_indentation",
|
|
63613
63609
|
title: "In-statement indentation",
|
|
63614
63610
|
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)
|
|
63611
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63612
|
+
|
|
63613
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63618
63614
|
to distinguish them better from code within the block.`,
|
|
63619
|
-
badExample: `IF 1 = 1
|
|
63620
|
-
AND 2 = 2.
|
|
63621
|
-
WRITE 'hello' &&
|
|
63622
|
-
'world'.
|
|
63615
|
+
badExample: `IF 1 = 1
|
|
63616
|
+
AND 2 = 2.
|
|
63617
|
+
WRITE 'hello' &&
|
|
63618
|
+
'world'.
|
|
63623
63619
|
ENDIF.`,
|
|
63624
|
-
goodExample: `IF 1 = 1
|
|
63625
|
-
AND 2 = 2.
|
|
63626
|
-
WRITE 'hello' &&
|
|
63627
|
-
'world'.
|
|
63620
|
+
goodExample: `IF 1 = 1
|
|
63621
|
+
AND 2 = 2.
|
|
63622
|
+
WRITE 'hello' &&
|
|
63623
|
+
'world'.
|
|
63628
63624
|
ENDIF.`,
|
|
63629
63625
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63630
63626
|
};
|
|
@@ -63747,23 +63743,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63747
63743
|
title: "Indentation",
|
|
63748
63744
|
shortDescription: `Checks indentation`,
|
|
63749
63745
|
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.
|
|
63746
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63747
|
+
PRIVATE SECTION.
|
|
63748
|
+
METHODS constructor.
|
|
63749
|
+
ENDCLASS.
|
|
63750
|
+
|
|
63751
|
+
CLASS lcl IMPLEMENTATION.
|
|
63752
|
+
METHOD constructor.
|
|
63753
|
+
ENDMETHOD.
|
|
63758
63754
|
ENDCLASS.`,
|
|
63759
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63760
|
-
PRIVATE SECTION.
|
|
63761
|
-
METHODS constructor.
|
|
63762
|
-
ENDCLASS.
|
|
63763
|
-
|
|
63764
|
-
CLASS lcl IMPLEMENTATION.
|
|
63765
|
-
METHOD constructor.
|
|
63766
|
-
ENDMETHOD.
|
|
63755
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63756
|
+
PRIVATE SECTION.
|
|
63757
|
+
METHODS constructor.
|
|
63758
|
+
ENDCLASS.
|
|
63759
|
+
|
|
63760
|
+
CLASS lcl IMPLEMENTATION.
|
|
63761
|
+
METHOD constructor.
|
|
63762
|
+
ENDMETHOD.
|
|
63767
63763
|
ENDCLASS.`,
|
|
63768
63764
|
};
|
|
63769
63765
|
}
|
|
@@ -64164,9 +64160,9 @@ class IntfReferencingClas {
|
|
|
64164
64160
|
key: "intf_referencing_clas",
|
|
64165
64161
|
title: "INTF referencing CLAS",
|
|
64166
64162
|
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.
|
|
64163
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64164
|
+
Only first level references are checked.
|
|
64165
|
+
Exception class references are ignored.
|
|
64170
64166
|
Void references are ignored.`,
|
|
64171
64167
|
};
|
|
64172
64168
|
}
|
|
@@ -64251,9 +64247,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64251
64247
|
title: "Invalid Table Index",
|
|
64252
64248
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64253
64249
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64254
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64250
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64255
64251
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64256
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64252
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64257
64253
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64258
64254
|
};
|
|
64259
64255
|
}
|
|
@@ -64854,8 +64850,8 @@ class LineBreakStyle {
|
|
|
64854
64850
|
return {
|
|
64855
64851
|
key: "line_break_style",
|
|
64856
64852
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64857
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64858
|
-
|
|
64853
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64854
|
+
|
|
64859
64855
|
abapGit does not work with CRLF`,
|
|
64860
64856
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64861
64857
|
};
|
|
@@ -64924,7 +64920,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64924
64920
|
key: "line_length",
|
|
64925
64921
|
title: "Line length",
|
|
64926
64922
|
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
|
|
64923
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64928
64924
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64929
64925
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64930
64926
|
};
|
|
@@ -64995,7 +64991,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64995
64991
|
key: "line_only_punc",
|
|
64996
64992
|
title: "Line containing only punctuation",
|
|
64997
64993
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64998
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64994
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64999
64995
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65000
64996
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65001
64997
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65258,15 +65254,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65258
65254
|
return {
|
|
65259
65255
|
key: "local_variable_names",
|
|
65260
65256
|
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.
|
|
65257
|
+
shortDescription: `
|
|
65258
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65263
65259
|
Regexes are case-insensitive.`,
|
|
65264
65260
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65265
|
-
badExample: `FORM bar.
|
|
65266
|
-
DATA foo.
|
|
65261
|
+
badExample: `FORM bar.
|
|
65262
|
+
DATA foo.
|
|
65267
65263
|
ENDFORM.`,
|
|
65268
|
-
goodExample: `FORM bar.
|
|
65269
|
-
DATA lv_foo.
|
|
65264
|
+
goodExample: `FORM bar.
|
|
65265
|
+
DATA lv_foo.
|
|
65270
65266
|
ENDFORM.`,
|
|
65271
65267
|
};
|
|
65272
65268
|
}
|
|
@@ -65418,9 +65414,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65418
65414
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65419
65415
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65420
65416
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65421
|
-
badExample: `DEFINE something.
|
|
65417
|
+
badExample: `DEFINE something.
|
|
65422
65418
|
END-OF-DEFINITION.`,
|
|
65423
|
-
goodExample: `DEFINE _something.
|
|
65419
|
+
goodExample: `DEFINE _something.
|
|
65424
65420
|
END-OF-DEFINITION.`,
|
|
65425
65421
|
};
|
|
65426
65422
|
}
|
|
@@ -65493,10 +65489,10 @@ class MainFileContents {
|
|
|
65493
65489
|
key: "main_file_contents",
|
|
65494
65490
|
title: "Main file contents",
|
|
65495
65491
|
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>."
|
|
65492
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65493
|
+
|
|
65494
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65495
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65500
65496
|
`,
|
|
65501
65497
|
};
|
|
65502
65498
|
}
|
|
@@ -65612,17 +65608,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65612
65608
|
title: "Too many parentheses",
|
|
65613
65609
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65614
65610
|
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.
|
|
65611
|
+
badExample: `
|
|
65612
|
+
IF ( destination IS INITIAL ).
|
|
65613
|
+
ENDIF.
|
|
65614
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65615
|
+
ENDIF.
|
|
65620
65616
|
`,
|
|
65621
|
-
goodExample: `
|
|
65622
|
-
IF destination IS INITIAL.
|
|
65623
|
-
ENDIF.
|
|
65624
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65625
|
-
ENDIF.
|
|
65617
|
+
goodExample: `
|
|
65618
|
+
IF destination IS INITIAL.
|
|
65619
|
+
ENDIF.
|
|
65620
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65621
|
+
ENDIF.
|
|
65626
65622
|
`,
|
|
65627
65623
|
};
|
|
65628
65624
|
}
|
|
@@ -65796,14 +65792,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65796
65792
|
title: "Max one method parameter definition per line",
|
|
65797
65793
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65798
65794
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65799
|
-
badExample: `
|
|
65800
|
-
METHODS apps_scope_token
|
|
65801
|
-
IMPORTING
|
|
65795
|
+
badExample: `
|
|
65796
|
+
METHODS apps_scope_token
|
|
65797
|
+
IMPORTING
|
|
65802
65798
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65803
|
-
goodExample: `
|
|
65804
|
-
METHODS apps_scope_token
|
|
65805
|
-
IMPORTING
|
|
65806
|
-
body TYPE bodyapps_scope_token
|
|
65799
|
+
goodExample: `
|
|
65800
|
+
METHODS apps_scope_token
|
|
65801
|
+
IMPORTING
|
|
65802
|
+
body TYPE bodyapps_scope_token
|
|
65807
65803
|
client_id TYPE str.`,
|
|
65808
65804
|
};
|
|
65809
65805
|
}
|
|
@@ -65868,11 +65864,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65868
65864
|
key: "max_one_statement",
|
|
65869
65865
|
title: "Max one statement per line",
|
|
65870
65866
|
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
|
|
65867
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65868
|
+
|
|
65869
|
+
Does not report anything for chained statements.
|
|
65870
|
+
|
|
65871
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65876
65872
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65877
65873
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65878
65874
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66210,8 +66206,8 @@ class MethodLength {
|
|
|
66210
66206
|
key: "method_length",
|
|
66211
66207
|
title: "Method/Form Length",
|
|
66212
66208
|
shortDescription: `Checks relating to method/form length.`,
|
|
66213
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66214
|
-
|
|
66209
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66210
|
+
|
|
66215
66211
|
Abstract methods without statements are considered okay.`,
|
|
66216
66212
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66217
66213
|
};
|
|
@@ -66316,20 +66312,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66316
66312
|
key: "method_overwrites_builtin",
|
|
66317
66313
|
title: "Method name overwrites builtin function",
|
|
66318
66314
|
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
|
-
|
|
66315
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66316
|
+
|
|
66317
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66318
|
+
|
|
66323
66319
|
Interface method names are ignored`,
|
|
66324
66320
|
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.
|
|
66321
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66322
|
+
PUBLIC SECTION.
|
|
66323
|
+
METHODS matches.
|
|
66324
|
+
ENDCLASS.
|
|
66325
|
+
|
|
66326
|
+
CLASS lcl IMPLEMENTATION.
|
|
66327
|
+
METHOD matches.
|
|
66328
|
+
ENDMETHOD.
|
|
66333
66329
|
ENDCLASS.`,
|
|
66334
66330
|
};
|
|
66335
66331
|
}
|
|
@@ -66520,12 +66516,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66520
66516
|
// eslint-disable-next-line max-len
|
|
66521
66517
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66522
66518
|
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.
|
|
66519
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66520
|
+
PUBLIC SECTION.
|
|
66521
|
+
METHODS
|
|
66522
|
+
foobar
|
|
66523
|
+
EXPORTING foo TYPE i
|
|
66524
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66529
66525
|
ENDCLASS.`,
|
|
66530
66526
|
};
|
|
66531
66527
|
}
|
|
@@ -66905,7 +66901,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66905
66901
|
key: "nesting",
|
|
66906
66902
|
title: "Check nesting depth",
|
|
66907
66903
|
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
|
|
66904
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66909
66905
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66910
66906
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66911
66907
|
};
|
|
@@ -67148,7 +67144,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67148
67144
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67149
67145
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67150
67146
|
badExample: `var1 = var2 = var3.`,
|
|
67151
|
-
goodExample: `var2 = var3.
|
|
67147
|
+
goodExample: `var2 = var3.
|
|
67152
67148
|
var1 = var2.`,
|
|
67153
67149
|
};
|
|
67154
67150
|
}
|
|
@@ -67207,8 +67203,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67207
67203
|
key: "no_external_form_calls",
|
|
67208
67204
|
title: "No external FORM calls",
|
|
67209
67205
|
shortDescription: `Detect external form calls`,
|
|
67210
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67211
|
-
|
|
67206
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67207
|
+
|
|
67212
67208
|
PERFORM foo(bar).`,
|
|
67213
67209
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67214
67210
|
};
|
|
@@ -67269,17 +67265,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67269
67265
|
key: "no_inline_in_optional_branches",
|
|
67270
67266
|
title: "Don't declare inline in optional branches",
|
|
67271
67267
|
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:
|
|
67268
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67269
|
+
|
|
67270
|
+
Considered optional branches:
|
|
67271
|
+
* inside IF/ELSEIF/ELSE
|
|
67272
|
+
* inside LOOP
|
|
67273
|
+
* inside WHILE
|
|
67274
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67275
|
+
* inside DO
|
|
67276
|
+
* inside SELECT loops
|
|
67277
|
+
|
|
67278
|
+
Not considered optional branches:
|
|
67283
67279
|
* TRY/CATCH/CLEANUP`,
|
|
67284
67280
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67285
67281
|
};
|
|
@@ -67379,12 +67375,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67379
67375
|
key: "no_prefixes",
|
|
67380
67376
|
title: "No Prefixes",
|
|
67381
67377
|
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
|
-
|
|
67378
|
+
extendedInformation: `
|
|
67379
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67380
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67381
|
+
|
|
67382
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67383
|
+
|
|
67388
67384
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67389
67385
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67390
67386
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67563,7 +67559,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67563
67559
|
return {
|
|
67564
67560
|
key: "no_public_attributes",
|
|
67565
67561
|
title: "No public attributes",
|
|
67566
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67562
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67567
67563
|
Exceptions are excluded from this rule.`,
|
|
67568
67564
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67569
67565
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67664,13 +67660,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67664
67660
|
key: "no_yoda_conditions",
|
|
67665
67661
|
title: "No Yoda conditions",
|
|
67666
67662
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67667
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67668
|
-
|
|
67663
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67664
|
+
|
|
67669
67665
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67670
67666
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67671
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67667
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67672
67668
|
ENDIF.`,
|
|
67673
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67669
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67674
67670
|
ENDIF.`,
|
|
67675
67671
|
};
|
|
67676
67672
|
}
|
|
@@ -67771,8 +67767,8 @@ class NROBConsistency {
|
|
|
67771
67767
|
key: "nrob_consistency",
|
|
67772
67768
|
title: "Number range consistency",
|
|
67773
67769
|
shortDescription: `Consistency checks for number ranges`,
|
|
67774
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67775
|
-
|
|
67770
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67771
|
+
|
|
67776
67772
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67777
67773
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67778
67774
|
};
|
|
@@ -68049,58 +68045,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68049
68045
|
title: "Obsolete statements",
|
|
68050
68046
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68051
68047
|
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
|
-
|
|
68048
|
+
extendedInformation: `
|
|
68049
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68050
|
+
|
|
68051
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68052
|
+
|
|
68053
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68054
|
+
|
|
68055
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68056
|
+
|
|
68057
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68058
|
+
|
|
68059
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68060
|
+
|
|
68061
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68062
|
+
|
|
68063
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68064
|
+
|
|
68065
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68066
|
+
|
|
68067
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68068
|
+
|
|
68069
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68070
|
+
|
|
68071
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68072
|
+
|
|
68073
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68074
|
+
|
|
68075
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68076
|
+
|
|
68077
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68078
|
+
SELECT COUNT(*) is considered okay
|
|
68079
|
+
|
|
68080
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68081
|
+
|
|
68082
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68083
|
+
|
|
68084
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68085
|
+
|
|
68086
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68087
|
+
|
|
68088
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68089
|
+
|
|
68094
68090
|
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.
|
|
68091
|
+
badExample: `REFRESH itab.
|
|
68092
|
+
|
|
68093
|
+
COMPUTE foo = 2 + 2.
|
|
68094
|
+
|
|
68095
|
+
MULTIPLY lv_foo BY 2.
|
|
68096
|
+
|
|
68097
|
+
INTERFACE intf LOAD.
|
|
68098
|
+
|
|
68099
|
+
IF foo IS SUPPLIED.
|
|
68104
68100
|
ENDIF.`,
|
|
68105
68101
|
};
|
|
68106
68102
|
}
|
|
@@ -68440,9 +68436,9 @@ class OmitParameterName {
|
|
|
68440
68436
|
key: "omit_parameter_name",
|
|
68441
68437
|
title: "Omit parameter name",
|
|
68442
68438
|
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
|
-
|
|
68439
|
+
extendedInformation: `
|
|
68440
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68441
|
+
|
|
68446
68442
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68447
68443
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68448
68444
|
badExample: `method( param = 2 ).`,
|
|
@@ -68648,20 +68644,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68648
68644
|
shortDescription: `Omit RECEIVING`,
|
|
68649
68645
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68650
68646
|
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
|
|
68647
|
+
badExample: `
|
|
68648
|
+
upload_pack(
|
|
68649
|
+
EXPORTING
|
|
68650
|
+
io_client = lo_client
|
|
68651
|
+
iv_url = iv_url
|
|
68652
|
+
iv_deepen_level = iv_deepen_level
|
|
68653
|
+
it_hashes = lt_hashes
|
|
68654
|
+
RECEIVING
|
|
68659
68655
|
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
|
|
68656
|
+
goodExample: `
|
|
68657
|
+
et_objects = upload_pack(
|
|
68658
|
+
io_client = lo_client
|
|
68659
|
+
iv_url = iv_url
|
|
68660
|
+
iv_deepen_level = iv_deepen_level
|
|
68665
68661
|
it_hashes = lt_hashes ).`,
|
|
68666
68662
|
};
|
|
68667
68663
|
}
|
|
@@ -68725,8 +68721,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68725
68721
|
return {
|
|
68726
68722
|
key: "parser_702_chaining",
|
|
68727
68723
|
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.
|
|
68724
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68725
|
+
this rule finds these and reports errors.
|
|
68730
68726
|
Only active on target version 702 and below.`,
|
|
68731
68727
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68732
68728
|
};
|
|
@@ -68806,8 +68802,8 @@ class ParserError {
|
|
|
68806
68802
|
return {
|
|
68807
68803
|
key: "parser_error",
|
|
68808
68804
|
title: "Parser error",
|
|
68809
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68810
|
-
|
|
68805
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68806
|
+
|
|
68811
68807
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68812
68808
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68813
68809
|
};
|
|
@@ -68892,7 +68888,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68892
68888
|
return {
|
|
68893
68889
|
key: "parser_missing_space",
|
|
68894
68890
|
title: "Parser Error, missing space",
|
|
68895
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68891
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68896
68892
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68897
68893
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68898
68894
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69092,12 +69088,23 @@ This rule makes sure the spaces are consistently required across the language.`,
|
|
|
69092
69088
|
if (children.length < 2) {
|
|
69093
69089
|
return undefined;
|
|
69094
69090
|
}
|
|
69095
|
-
|
|
69096
|
-
|
|
69097
|
-
|
|
69098
|
-
|
|
69099
|
-
|
|
69100
|
-
|
|
69091
|
+
if (children.length >= 4
|
|
69092
|
+
&& children[0].getStr().toUpperCase() === "CONV") {
|
|
69093
|
+
const first = children[2];
|
|
69094
|
+
const second = children[3];
|
|
69095
|
+
if (first.getRow() === second.getRow()
|
|
69096
|
+
&& first.getCol() + 1 === second.getStart().getCol()) {
|
|
69097
|
+
return second.getStart();
|
|
69098
|
+
}
|
|
69099
|
+
}
|
|
69100
|
+
{
|
|
69101
|
+
const nextLast = children[children.length - 2];
|
|
69102
|
+
const last = children[children.length - 1];
|
|
69103
|
+
if (nextLast.getStr().startsWith("'")
|
|
69104
|
+
&& nextLast.getRow() === last.getRow()
|
|
69105
|
+
&& nextLast.getEnd().getCol() === last.getStart().getCol()) {
|
|
69106
|
+
return last.getEnd();
|
|
69107
|
+
}
|
|
69101
69108
|
}
|
|
69102
69109
|
return undefined;
|
|
69103
69110
|
}
|
|
@@ -69304,25 +69311,25 @@ class PreferInline {
|
|
|
69304
69311
|
key: "prefer_inline",
|
|
69305
69312
|
title: "Prefer Inline Declarations",
|
|
69306
69313
|
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
|
-
|
|
69314
|
+
extendedInformation: `EXPERIMENTAL
|
|
69315
|
+
|
|
69316
|
+
Activates if language version is v740sp02 or above.
|
|
69317
|
+
|
|
69318
|
+
Variables must be local(METHOD or FORM).
|
|
69319
|
+
|
|
69320
|
+
No generic or void typed variables. No syntax errors.
|
|
69321
|
+
|
|
69322
|
+
First position used must be a full/pure write.
|
|
69323
|
+
|
|
69324
|
+
Move statment is not a cast(?=)
|
|
69325
|
+
|
|
69319
69326
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69320
69327
|
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.
|
|
69328
|
+
badExample: `DATA foo TYPE i.
|
|
69329
|
+
foo = 2.
|
|
69330
|
+
DATA percentage TYPE decfloat34.
|
|
69324
69331
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69325
|
-
goodExample: `DATA(foo) = 2.
|
|
69332
|
+
goodExample: `DATA(foo) = 2.
|
|
69326
69333
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69327
69334
|
};
|
|
69328
69335
|
}
|
|
@@ -69536,18 +69543,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69536
69543
|
key: "prefer_is_not",
|
|
69537
69544
|
title: "Prefer IS NOT to NOT IS",
|
|
69538
69545
|
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
|
-
|
|
69546
|
+
extendedInformation: `
|
|
69547
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69548
|
+
|
|
69542
69549
|
"if not is_valid( )." examples are skipped`,
|
|
69543
69550
|
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.
|
|
69551
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69552
|
+
IF variable NP 'TODO*'.
|
|
69553
|
+
IF variable <> 42.
|
|
69547
69554
|
IF variable CO 'hello'.`,
|
|
69548
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69549
|
-
IF NOT variable CP 'TODO*'.
|
|
69550
|
-
IF NOT variable = 42.
|
|
69555
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69556
|
+
IF NOT variable CP 'TODO*'.
|
|
69557
|
+
IF NOT variable = 42.
|
|
69551
69558
|
IF NOT variable CA 'hello'.`,
|
|
69552
69559
|
};
|
|
69553
69560
|
}
|
|
@@ -69735,14 +69742,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69735
69742
|
key: "prefer_raise_exception_new",
|
|
69736
69743
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69737
69744
|
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
|
-
|
|
69745
|
+
extendedInformation: `
|
|
69746
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69747
|
+
|
|
69741
69748
|
From 752 and up`,
|
|
69742
69749
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69743
69750
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69744
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69745
|
-
EXPORTING
|
|
69751
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69752
|
+
EXPORTING
|
|
69746
69753
|
previous = exception.`,
|
|
69747
69754
|
};
|
|
69748
69755
|
}
|
|
@@ -69820,12 +69827,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69820
69827
|
key: "prefer_returning_to_exporting",
|
|
69821
69828
|
title: "Prefer RETURNING to EXPORTING",
|
|
69822
69829
|
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
|
|
69830
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69824
69831
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69825
69832
|
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.
|
|
69833
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69834
|
+
PUBLIC SECTION.
|
|
69835
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69829
69836
|
ENDCLASS.`,
|
|
69830
69837
|
};
|
|
69831
69838
|
}
|
|
@@ -69921,8 +69928,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69921
69928
|
key: "prefer_xsdbool",
|
|
69922
69929
|
title: "Prefer xsdbool over boolc",
|
|
69923
69930
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69924
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69925
|
-
|
|
69931
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69932
|
+
|
|
69926
69933
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69927
69934
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69928
69935
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69994,9 +70001,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69994
70001
|
title: "Preferred compare operator",
|
|
69995
70002
|
shortDescription: `Configure undesired operator variants`,
|
|
69996
70003
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69997
|
-
badExample: `IF foo EQ bar.
|
|
70004
|
+
badExample: `IF foo EQ bar.
|
|
69998
70005
|
ENDIF.`,
|
|
69999
|
-
goodExample: `IF foo = bar.
|
|
70006
|
+
goodExample: `IF foo = bar.
|
|
70000
70007
|
ENDIF.`,
|
|
70001
70008
|
};
|
|
70002
70009
|
}
|
|
@@ -70220,26 +70227,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70220
70227
|
key: "reduce_procedural_code",
|
|
70221
70228
|
title: "Reduce procedural code",
|
|
70222
70229
|
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
|
-
|
|
70230
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70231
|
+
|
|
70232
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70233
|
+
|
|
70227
70234
|
Comments are not counted as statements.`,
|
|
70228
70235
|
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.
|
|
70236
|
+
badExample: `FORM foo.
|
|
70237
|
+
DATA lv_bar TYPE i.
|
|
70238
|
+
lv_bar = 2 + 2.
|
|
70239
|
+
IF lv_bar = 4.
|
|
70240
|
+
WRITE 'hello world'.
|
|
70241
|
+
ENDIF.
|
|
70242
|
+
DATA lv_bar TYPE i.
|
|
70243
|
+
lv_bar = 2 + 2.
|
|
70244
|
+
IF lv_bar = 4.
|
|
70245
|
+
WRITE 'hello world'.
|
|
70246
|
+
ENDIF.
|
|
70240
70247
|
ENDFORM.`,
|
|
70241
|
-
goodExample: `FORM foo.
|
|
70242
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70248
|
+
goodExample: `FORM foo.
|
|
70249
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70243
70250
|
ENDFORM.`,
|
|
70244
70251
|
};
|
|
70245
70252
|
}
|
|
@@ -70483,10 +70490,10 @@ class RemoveDescriptions {
|
|
|
70483
70490
|
return {
|
|
70484
70491
|
key: "remove_descriptions",
|
|
70485
70492
|
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
|
-
|
|
70493
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70494
|
+
|
|
70495
|
+
Class descriptions are required, see rule description_empty.
|
|
70496
|
+
|
|
70490
70497
|
Consider using ABAP Doc for documentation.`,
|
|
70491
70498
|
tags: [],
|
|
70492
70499
|
};
|
|
@@ -70611,14 +70618,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70611
70618
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70612
70619
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70613
70620
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70614
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70621
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70615
70622
|
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
|
|
70623
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70624
|
+
DESTINATION lv_rfc
|
|
70625
|
+
EXCEPTIONS
|
|
70626
|
+
system_failure = 1 MESSAGE msg
|
|
70627
|
+
communication_failure = 2 MESSAGE msg
|
|
70628
|
+
resource_failure = 3
|
|
70622
70629
|
OTHERS = 4.`,
|
|
70623
70630
|
};
|
|
70624
70631
|
}
|
|
@@ -70702,11 +70709,11 @@ class SelectAddOrderBy {
|
|
|
70702
70709
|
key: "select_add_order_by",
|
|
70703
70710
|
title: "SELECT add ORDER BY",
|
|
70704
70711
|
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
|
-
|
|
70712
|
+
extendedInformation: `
|
|
70713
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70714
|
+
|
|
70715
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70716
|
+
|
|
70710
70717
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70711
70718
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70712
70719
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70837,14 +70844,14 @@ class SelectPerformance {
|
|
|
70837
70844
|
key: "select_performance",
|
|
70838
70845
|
title: "SELECT performance",
|
|
70839
70846
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70840
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70841
|
-
|
|
70847
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70848
|
+
|
|
70842
70849
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70843
70850
|
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.
|
|
70851
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70852
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70846
70853
|
ENDSELECT.`,
|
|
70847
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70854
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70848
70855
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70849
70856
|
};
|
|
70850
70857
|
}
|
|
@@ -70958,8 +70965,8 @@ class SelectSingleFullKey {
|
|
|
70958
70965
|
key: "select_single_full_key",
|
|
70959
70966
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70960
70967
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70961
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70962
|
-
|
|
70968
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70969
|
+
|
|
70963
70970
|
If the statement contains a JOIN it is not checked`,
|
|
70964
70971
|
pseudoComment: "EC CI_NOORDER",
|
|
70965
70972
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71383,8 +71390,8 @@ class SICFConsistency {
|
|
|
71383
71390
|
key: "sicf_consistency",
|
|
71384
71391
|
title: "SICF consistency",
|
|
71385
71392
|
shortDescription: `Checks the validity of ICF services`,
|
|
71386
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71387
|
-
* Class must not have any syntax errors
|
|
71393
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71394
|
+
* Class must not have any syntax errors
|
|
71388
71395
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71389
71396
|
};
|
|
71390
71397
|
}
|
|
@@ -71496,23 +71503,23 @@ class SlowParameterPassing {
|
|
|
71496
71503
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71497
71504
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71498
71505
|
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.
|
|
71506
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71507
|
+
PUBLIC SECTION.
|
|
71508
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71509
|
+
ENDCLASS.
|
|
71510
|
+
CLASS lcl IMPLEMENTATION.
|
|
71511
|
+
METHOD bar.
|
|
71512
|
+
WRITE sdf.
|
|
71513
|
+
ENDMETHOD.
|
|
71507
71514
|
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.
|
|
71515
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71516
|
+
PUBLIC SECTION.
|
|
71517
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71518
|
+
ENDCLASS.
|
|
71519
|
+
CLASS lcl IMPLEMENTATION.
|
|
71520
|
+
METHOD bar.
|
|
71521
|
+
WRITE sdf.
|
|
71522
|
+
ENDMETHOD.
|
|
71516
71523
|
ENDCLASS.`,
|
|
71517
71524
|
};
|
|
71518
71525
|
}
|
|
@@ -71769,8 +71776,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71769
71776
|
key: "space_before_dot",
|
|
71770
71777
|
title: "Space before dot",
|
|
71771
71778
|
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
|
|
71779
|
+
extendedInformation: `
|
|
71780
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71774
71781
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71775
71782
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71776
71783
|
badExample: `WRITE bar .`,
|
|
@@ -71956,12 +71963,12 @@ class SQLValueConversion {
|
|
|
71956
71963
|
key: "sql_value_conversion",
|
|
71957
71964
|
title: "Implicit SQL Value Conversion",
|
|
71958
71965
|
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
|
|
71966
|
+
extendedInformation: `
|
|
71967
|
+
* Integer to CHAR conversion
|
|
71968
|
+
* Integer to NUMC conversion
|
|
71969
|
+
* NUMC to Integer conversion
|
|
71970
|
+
* CHAR to Integer conversion
|
|
71971
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71965
71972
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71966
71973
|
tags: [],
|
|
71967
71974
|
};
|
|
@@ -72033,7 +72040,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72033
72040
|
key: "start_at_tab",
|
|
72034
72041
|
title: "Start at tab",
|
|
72035
72042
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72036
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72043
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72037
72044
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72038
72045
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72039
72046
|
badExample: ` WRITE a.`,
|
|
@@ -72210,12 +72217,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72210
72217
|
key: "strict_sql",
|
|
72211
72218
|
title: "Strict SQL",
|
|
72212
72219
|
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
|
-
|
|
72220
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72221
|
+
|
|
72222
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72223
|
+
|
|
72224
|
+
Also see separate rule sql_escape_host_variables
|
|
72225
|
+
|
|
72219
72226
|
Activates from v750 and up`,
|
|
72220
72227
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72221
72228
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72469,11 +72476,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72469
72476
|
key: "sy_modification",
|
|
72470
72477
|
title: "Modification of SY fields",
|
|
72471
72478
|
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
|
-
|
|
72479
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72480
|
+
|
|
72474
72481
|
Changes to SY-TVAR* fields are not reported`,
|
|
72475
72482
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72476
|
-
badExample: `sy-uname = 2.
|
|
72483
|
+
badExample: `sy-uname = 2.
|
|
72477
72484
|
sy = sy.`,
|
|
72478
72485
|
};
|
|
72479
72486
|
}
|
|
@@ -72535,8 +72542,8 @@ class TABLEnhancementCategory {
|
|
|
72535
72542
|
key: "tabl_enhancement_category",
|
|
72536
72543
|
title: "TABL enhancement category must be set",
|
|
72537
72544
|
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
|
-
|
|
72545
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72546
|
+
|
|
72540
72547
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72541
72548
|
tags: [],
|
|
72542
72549
|
};
|
|
@@ -72601,8 +72608,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72601
72608
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72602
72609
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72603
72610
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72604
|
-
badExample: `FORM foo.
|
|
72605
|
-
TABLES t100.
|
|
72611
|
+
badExample: `FORM foo.
|
|
72612
|
+
TABLES t100.
|
|
72606
72613
|
ENDFORM.`,
|
|
72607
72614
|
goodExample: `TABLES t000.`,
|
|
72608
72615
|
};
|
|
@@ -72730,9 +72737,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72730
72737
|
title: "Type FORM parameters",
|
|
72731
72738
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72732
72739
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72733
|
-
badExample: `FORM foo USING bar.
|
|
72740
|
+
badExample: `FORM foo USING bar.
|
|
72734
72741
|
ENDFORM.`,
|
|
72735
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72742
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72736
72743
|
ENDFORM.`,
|
|
72737
72744
|
};
|
|
72738
72745
|
}
|
|
@@ -73405,38 +73412,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73405
73412
|
key: "unnecessary_pragma",
|
|
73406
73413
|
title: "Unnecessary Pragma",
|
|
73407
73414
|
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
|
-
|
|
73415
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73416
|
+
|
|
73417
|
+
* NEEDED without definition
|
|
73418
|
+
|
|
73419
|
+
* NO_TEXT without texts
|
|
73420
|
+
|
|
73421
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73422
|
+
|
|
73416
73423
|
NO_HANDLER inside macros are not checked`,
|
|
73417
73424
|
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.
|
|
73425
|
+
badExample: `TRY.
|
|
73426
|
+
...
|
|
73427
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73428
|
+
RETURN. " it has a handler
|
|
73429
|
+
ENDTRY.
|
|
73430
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73431
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73432
|
+
IF sy-subrc <> 0.
|
|
73426
73433
|
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,
|
|
73434
|
+
goodExample: `TRY.
|
|
73435
|
+
...
|
|
73436
|
+
CATCH zcx_abapgit_exception.
|
|
73437
|
+
RETURN.
|
|
73438
|
+
ENDTRY.
|
|
73439
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73440
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73441
|
+
IF sy-subrc <> 0.
|
|
73442
|
+
ENDIF.
|
|
73443
|
+
|
|
73444
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73445
|
+
test1 TYPE string,
|
|
73446
|
+
test2 TYPE string,
|
|
73440
73447
|
END OF blah.`,
|
|
73441
73448
|
};
|
|
73442
73449
|
}
|
|
@@ -73603,18 +73610,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73603
73610
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73604
73611
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73605
73612
|
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.
|
|
73613
|
+
badExample: `FORM hello1.
|
|
73614
|
+
WRITE 'world'.
|
|
73615
|
+
RETURN.
|
|
73616
|
+
ENDFORM.
|
|
73617
|
+
|
|
73618
|
+
FORM foo.
|
|
73619
|
+
IF 1 = 2.
|
|
73620
|
+
RETURN.
|
|
73621
|
+
ENDIF.
|
|
73615
73622
|
ENDFORM.`,
|
|
73616
|
-
goodExample: `FORM hello2.
|
|
73617
|
-
WRITE 'world'.
|
|
73623
|
+
goodExample: `FORM hello2.
|
|
73624
|
+
WRITE 'world'.
|
|
73618
73625
|
ENDFORM.`,
|
|
73619
73626
|
};
|
|
73620
73627
|
}
|
|
@@ -73965,13 +73972,13 @@ class UnusedMacros {
|
|
|
73965
73972
|
title: "Unused macros",
|
|
73966
73973
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73967
73974
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73968
|
-
badExample: `DEFINE foobar1.
|
|
73969
|
-
WRITE 'hello'.
|
|
73975
|
+
badExample: `DEFINE foobar1.
|
|
73976
|
+
WRITE 'hello'.
|
|
73970
73977
|
END-OF-DEFINITION.`,
|
|
73971
|
-
goodExample: `DEFINE foobar2.
|
|
73972
|
-
WRITE 'hello'.
|
|
73973
|
-
END-OF-DEFINITION.
|
|
73974
|
-
|
|
73978
|
+
goodExample: `DEFINE foobar2.
|
|
73979
|
+
WRITE 'hello'.
|
|
73980
|
+
END-OF-DEFINITION.
|
|
73981
|
+
|
|
73975
73982
|
foobar2.`,
|
|
73976
73983
|
};
|
|
73977
73984
|
}
|
|
@@ -74083,18 +74090,18 @@ class UnusedMethods {
|
|
|
74083
74090
|
key: "unused_methods",
|
|
74084
74091
|
title: "Unused methods",
|
|
74085
74092
|
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
|
|
74093
|
+
extendedInformation: `Checks private and protected methods.
|
|
74094
|
+
|
|
74095
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74096
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74097
|
+
|
|
74098
|
+
Skips:
|
|
74099
|
+
* methods FOR TESTING
|
|
74100
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74101
|
+
* class_constructor + constructor methods
|
|
74102
|
+
* event handlers
|
|
74103
|
+
* methods that are redefined
|
|
74104
|
+
* INCLUDEs
|
|
74098
74105
|
`,
|
|
74099
74106
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74100
74107
|
pragma: "##CALLED",
|
|
@@ -74570,23 +74577,23 @@ class UnusedVariables {
|
|
|
74570
74577
|
key: "unused_variables",
|
|
74571
74578
|
title: "Unused variables",
|
|
74572
74579
|
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
|
-
|
|
74580
|
+
extendedInformation: `Skips event parameters.
|
|
74581
|
+
|
|
74582
|
+
Note that this currently does not work if the source code uses macros.
|
|
74583
|
+
|
|
74584
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74585
|
+
|
|
74579
74586
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74580
74587
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74581
74588
|
pragma: "##NEEDED",
|
|
74582
74589
|
pseudoComment: "EC NEEDED",
|
|
74583
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74584
|
-
test TYPE string,
|
|
74585
|
-
test2 TYPE string,
|
|
74590
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74591
|
+
test TYPE string,
|
|
74592
|
+
test2 TYPE string,
|
|
74586
74593
|
END OF blah1.`,
|
|
74587
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74588
|
-
test TYPE string,
|
|
74589
|
-
test2 TYPE string,
|
|
74594
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74595
|
+
test TYPE string,
|
|
74596
|
+
test2 TYPE string,
|
|
74590
74597
|
END OF blah2.`,
|
|
74591
74598
|
};
|
|
74592
74599
|
}
|
|
@@ -74805,15 +74812,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74805
74812
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74806
74813
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74807
74814
|
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
|
-
|
|
74815
|
+
badExample: `IF line IS INITIAL.
|
|
74816
|
+
has_entries = abap_false.
|
|
74817
|
+
ELSE.
|
|
74818
|
+
has_entries = abap_true.
|
|
74819
|
+
ENDIF.
|
|
74820
|
+
|
|
74814
74821
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74815
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74816
|
-
|
|
74822
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74823
|
+
|
|
74817
74824
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74818
74825
|
};
|
|
74819
74826
|
}
|
|
@@ -74931,15 +74938,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74931
74938
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74932
74939
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74933
74940
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74934
|
-
badExample: `INTERFACE lif.
|
|
74935
|
-
METHODS load_data
|
|
74936
|
-
EXCEPTIONS
|
|
74937
|
-
invalid_parameter.
|
|
74941
|
+
badExample: `INTERFACE lif.
|
|
74942
|
+
METHODS load_data
|
|
74943
|
+
EXCEPTIONS
|
|
74944
|
+
invalid_parameter.
|
|
74938
74945
|
ENDINTERFACE.`,
|
|
74939
|
-
goodExample: `INTERFACE lif.
|
|
74940
|
-
METHODS load_data
|
|
74941
|
-
RAISING
|
|
74942
|
-
cx_something.
|
|
74946
|
+
goodExample: `INTERFACE lif.
|
|
74947
|
+
METHODS load_data
|
|
74948
|
+
RAISING
|
|
74949
|
+
cx_something.
|
|
74943
74950
|
ENDINTERFACE.`,
|
|
74944
74951
|
};
|
|
74945
74952
|
}
|
|
@@ -74999,15 +75006,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74999
75006
|
key: "use_line_exists",
|
|
75000
75007
|
title: "Use line_exists",
|
|
75001
75008
|
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
|
-
|
|
75009
|
+
extendedInformation: `
|
|
75010
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75011
|
+
|
|
75005
75012
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75006
75013
|
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.
|
|
75014
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75015
|
+
IF sy-subrc = 0.
|
|
75009
75016
|
ENDIF.`,
|
|
75010
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75017
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75011
75018
|
ENDIF.`,
|
|
75012
75019
|
};
|
|
75013
75020
|
}
|
|
@@ -75117,10 +75124,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75117
75124
|
key: "use_new",
|
|
75118
75125
|
title: "Use NEW",
|
|
75119
75126
|
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
|
-
|
|
75127
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75128
|
+
|
|
75129
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75130
|
+
|
|
75124
75131
|
Applicable from v740sp02 and up`,
|
|
75125
75132
|
badExample: `CREATE OBJECT ref.`,
|
|
75126
75133
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75218,13 +75225,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75218
75225
|
title: "WHEN OTHERS last",
|
|
75219
75226
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75220
75227
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75221
|
-
badExample: `CASE bar.
|
|
75222
|
-
WHEN OTHERS.
|
|
75223
|
-
WHEN 2.
|
|
75228
|
+
badExample: `CASE bar.
|
|
75229
|
+
WHEN OTHERS.
|
|
75230
|
+
WHEN 2.
|
|
75224
75231
|
ENDCASE.`,
|
|
75225
|
-
goodExample: `CASE bar.
|
|
75226
|
-
WHEN 2.
|
|
75227
|
-
WHEN OTHERS.
|
|
75232
|
+
goodExample: `CASE bar.
|
|
75233
|
+
WHEN 2.
|
|
75234
|
+
WHEN OTHERS.
|
|
75228
75235
|
ENDCASE.`,
|
|
75229
75236
|
};
|
|
75230
75237
|
}
|