@abaplint/cli 2.113.20 → 2.113.22
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 +866 -843
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -35173,13 +35173,13 @@ class FlowGraph {
|
|
|
35173
35173
|
this.label = label;
|
|
35174
35174
|
}
|
|
35175
35175
|
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()}
|
|
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()}
|
|
35183
35183
|
}`;
|
|
35184
35184
|
}
|
|
35185
35185
|
listSources(node) {
|
|
@@ -35362,7 +35362,8 @@ class StatementFlow {
|
|
|
35362
35362
|
if (inEvent === true) {
|
|
35363
35363
|
ret.push(this.runEvent(collected, name));
|
|
35364
35364
|
}
|
|
35365
|
-
else if (collected.length > 0
|
|
35365
|
+
else if (collected.length > 0
|
|
35366
|
+
&& !(obj instanceof objects_1.FunctionGroup)) {
|
|
35366
35367
|
// implicit START-OF-SELECTION
|
|
35367
35368
|
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
35368
35369
|
}
|
|
@@ -35548,6 +35549,14 @@ class StatementFlow {
|
|
|
35548
35549
|
}
|
|
35549
35550
|
// TODO, handle CLEANUP
|
|
35550
35551
|
}
|
|
35552
|
+
else if (type instanceof Structures.CatchSystemExceptions) {
|
|
35553
|
+
// TODO: this is not completely correct
|
|
35554
|
+
const catchName = this.buildName(n.getFirstStatement());
|
|
35555
|
+
const body = this.traverseBody(this.findBody(n), context);
|
|
35556
|
+
graph.addEdge(current, catchName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35557
|
+
graph.addGraph(catchName, body, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35558
|
+
graph.addEdge(body.getEnd(), graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35559
|
+
}
|
|
35551
35560
|
else if (type instanceof Structures.Case) {
|
|
35552
35561
|
const caseName = this.buildName(n.getFirstStatement());
|
|
35553
35562
|
graph.addEdge(current, caseName, flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
@@ -43429,13 +43438,13 @@ class Help {
|
|
|
43429
43438
|
/////////////////////////////////////////////////
|
|
43430
43439
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43431
43440
|
let content = "";
|
|
43432
|
-
content = `
|
|
43433
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43434
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43435
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43436
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43437
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43438
|
-
<hr>
|
|
43441
|
+
content = `
|
|
43442
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43443
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43444
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43445
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43446
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43447
|
+
<hr>
|
|
43439
43448
|
` +
|
|
43440
43449
|
"<tt>" + textDocument.uri + " (" +
|
|
43441
43450
|
(position.line + 1) + ", " +
|
|
@@ -46524,8 +46533,9 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
46524
46533
|
return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.definitionName;
|
|
46525
46534
|
}
|
|
46526
46535
|
getDescription() {
|
|
46527
|
-
|
|
46528
|
-
|
|
46536
|
+
var _a;
|
|
46537
|
+
this.parse();
|
|
46538
|
+
return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.description;
|
|
46529
46539
|
}
|
|
46530
46540
|
parseType(reg) {
|
|
46531
46541
|
this.parse();
|
|
@@ -46559,6 +46569,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
46559
46569
|
this.parsedData = {
|
|
46560
46570
|
sqlViewName: undefined,
|
|
46561
46571
|
definitionName: undefined,
|
|
46572
|
+
description: this.findDescription(),
|
|
46562
46573
|
fields: [],
|
|
46563
46574
|
sources: [],
|
|
46564
46575
|
relations: [],
|
|
@@ -46598,6 +46609,14 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
46598
46609
|
this.parsedData.sqlViewName = match[1].toUpperCase();
|
|
46599
46610
|
}
|
|
46600
46611
|
}
|
|
46612
|
+
findDescription() {
|
|
46613
|
+
var _a;
|
|
46614
|
+
const match = (_a = this.findSourceFile()) === null || _a === void 0 ? void 0 : _a.getRaw().match(/@EndUserText\.label: '([\w ]+)'/);
|
|
46615
|
+
if (match) {
|
|
46616
|
+
return match[1];
|
|
46617
|
+
}
|
|
46618
|
+
return undefined;
|
|
46619
|
+
}
|
|
46601
46620
|
findFieldNames(tree) {
|
|
46602
46621
|
var _a, _b;
|
|
46603
46622
|
let expr = tree.findFirstExpression(expressions_1.CDSSelect);
|
|
@@ -52000,6 +52019,7 @@ class View extends _abstract_object_1.AbstractObject {
|
|
|
52000
52019
|
this.parsedData = {
|
|
52001
52020
|
header: {
|
|
52002
52021
|
VIEWCLASS: "",
|
|
52022
|
+
DDTEXT: "",
|
|
52003
52023
|
},
|
|
52004
52024
|
fields: [],
|
|
52005
52025
|
join: [],
|
|
@@ -52011,6 +52031,7 @@ class View extends _abstract_object_1.AbstractObject {
|
|
|
52011
52031
|
const header = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.DD25V;
|
|
52012
52032
|
this.parsedData.header = {
|
|
52013
52033
|
VIEWCLASS: (header === null || header === void 0 ? void 0 : header.VIEWCLASS) || "",
|
|
52034
|
+
DDTEXT: (header === null || header === void 0 ? void 0 : header.DDTEXT) || "",
|
|
52014
52035
|
};
|
|
52015
52036
|
const fields = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.DD27P_TABLE;
|
|
52016
52037
|
for (const field of (0, xml_utils_1.xmlToArray)(fields === null || fields === void 0 ? void 0 : fields.DD27P)) {
|
|
@@ -52756,7 +52777,7 @@ class Registry {
|
|
|
52756
52777
|
}
|
|
52757
52778
|
static abaplintVersion() {
|
|
52758
52779
|
// magic, see build script "version.sh"
|
|
52759
|
-
return "2.113.
|
|
52780
|
+
return "2.113.22";
|
|
52760
52781
|
}
|
|
52761
52782
|
getDDICReferences() {
|
|
52762
52783
|
return this.ddicReferences;
|
|
@@ -53075,10 +53096,10 @@ class SevenBitAscii {
|
|
|
53075
53096
|
key: "7bit_ascii",
|
|
53076
53097
|
title: "Check for 7bit ascii",
|
|
53077
53098
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53078
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53079
|
-
|
|
53080
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53081
|
-
|
|
53099
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53100
|
+
|
|
53101
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53102
|
+
|
|
53082
53103
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53083
53104
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53084
53105
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53284,10 +53305,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53284
53305
|
key: "abapdoc",
|
|
53285
53306
|
title: "Check abapdoc",
|
|
53286
53307
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53287
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53288
|
-
|
|
53289
|
-
Plus class and interface definitions.
|
|
53290
|
-
|
|
53308
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53309
|
+
|
|
53310
|
+
Plus class and interface definitions.
|
|
53311
|
+
|
|
53291
53312
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53292
53313
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53293
53314
|
};
|
|
@@ -53424,27 +53445,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53424
53445
|
title: "Add test attributes for tests classes with test methods",
|
|
53425
53446
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53426
53447
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53427
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53428
|
-
PUBLIC SECTION.
|
|
53429
|
-
PROTECTED SECTION.
|
|
53430
|
-
PRIVATE SECTION.
|
|
53431
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53432
|
-
ENDCLASS.
|
|
53433
|
-
|
|
53434
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53435
|
-
METHOD test.
|
|
53436
|
-
ENDMETHOD.
|
|
53448
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53449
|
+
PUBLIC SECTION.
|
|
53450
|
+
PROTECTED SECTION.
|
|
53451
|
+
PRIVATE SECTION.
|
|
53452
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53453
|
+
ENDCLASS.
|
|
53454
|
+
|
|
53455
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53456
|
+
METHOD test.
|
|
53457
|
+
ENDMETHOD.
|
|
53437
53458
|
ENDCLASS.`,
|
|
53438
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53439
|
-
PUBLIC SECTION.
|
|
53440
|
-
PROTECTED SECTION.
|
|
53441
|
-
PRIVATE SECTION.
|
|
53442
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53443
|
-
ENDCLASS.
|
|
53444
|
-
|
|
53445
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53446
|
-
METHOD test.
|
|
53447
|
-
ENDMETHOD.
|
|
53459
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53460
|
+
PUBLIC SECTION.
|
|
53461
|
+
PROTECTED SECTION.
|
|
53462
|
+
PRIVATE SECTION.
|
|
53463
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53464
|
+
ENDCLASS.
|
|
53465
|
+
|
|
53466
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53467
|
+
METHOD test.
|
|
53468
|
+
ENDMETHOD.
|
|
53448
53469
|
ENDCLASS.`,
|
|
53449
53470
|
};
|
|
53450
53471
|
}
|
|
@@ -53530,49 +53551,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53530
53551
|
key: "align_parameters",
|
|
53531
53552
|
title: "Align Parameters",
|
|
53532
53553
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53533
|
-
extendedInformation: `Checks:
|
|
53534
|
-
* function module calls
|
|
53535
|
-
* method calls
|
|
53536
|
-
* VALUE constructors
|
|
53537
|
-
* NEW constructors
|
|
53538
|
-
* RAISE EXCEPTION statements
|
|
53539
|
-
* CREATE OBJECT statements
|
|
53540
|
-
* RAISE EVENT statements
|
|
53541
|
-
|
|
53542
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53543
|
-
|
|
53544
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53545
|
-
|
|
53546
|
-
If parameters are on the same row, no issues are reported, see
|
|
53554
|
+
extendedInformation: `Checks:
|
|
53555
|
+
* function module calls
|
|
53556
|
+
* method calls
|
|
53557
|
+
* VALUE constructors
|
|
53558
|
+
* NEW constructors
|
|
53559
|
+
* RAISE EXCEPTION statements
|
|
53560
|
+
* CREATE OBJECT statements
|
|
53561
|
+
* RAISE EVENT statements
|
|
53562
|
+
|
|
53563
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53564
|
+
|
|
53565
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53566
|
+
|
|
53567
|
+
If parameters are on the same row, no issues are reported, see
|
|
53547
53568
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53548
53569
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53549
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53550
|
-
EXPORTING
|
|
53551
|
-
foo = 2
|
|
53552
|
-
parameter = 3.
|
|
53553
|
-
|
|
53554
|
-
foobar( moo = 1
|
|
53555
|
-
param = 1 ).
|
|
53556
|
-
|
|
53557
|
-
foo = VALUE #(
|
|
53558
|
-
foo = bar
|
|
53570
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53571
|
+
EXPORTING
|
|
53572
|
+
foo = 2
|
|
53573
|
+
parameter = 3.
|
|
53574
|
+
|
|
53575
|
+
foobar( moo = 1
|
|
53576
|
+
param = 1 ).
|
|
53577
|
+
|
|
53578
|
+
foo = VALUE #(
|
|
53579
|
+
foo = bar
|
|
53559
53580
|
moo = 2 ).`,
|
|
53560
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53561
|
-
EXPORTING
|
|
53562
|
-
foo = 2
|
|
53563
|
-
parameter = 3.
|
|
53564
|
-
|
|
53565
|
-
foobar( moo = 1
|
|
53566
|
-
param = 1 ).
|
|
53567
|
-
|
|
53568
|
-
foo = VALUE #(
|
|
53569
|
-
foo = bar
|
|
53570
|
-
moo = 2 ).
|
|
53571
|
-
|
|
53572
|
-
DATA(sdf) = VALUE type(
|
|
53573
|
-
common_val = 2
|
|
53574
|
-
another_common = 5
|
|
53575
|
-
( row_value = 4
|
|
53581
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53582
|
+
EXPORTING
|
|
53583
|
+
foo = 2
|
|
53584
|
+
parameter = 3.
|
|
53585
|
+
|
|
53586
|
+
foobar( moo = 1
|
|
53587
|
+
param = 1 ).
|
|
53588
|
+
|
|
53589
|
+
foo = VALUE #(
|
|
53590
|
+
foo = bar
|
|
53591
|
+
moo = 2 ).
|
|
53592
|
+
|
|
53593
|
+
DATA(sdf) = VALUE type(
|
|
53594
|
+
common_val = 2
|
|
53595
|
+
another_common = 5
|
|
53596
|
+
( row_value = 4
|
|
53576
53597
|
value_foo = 5 ) ).`,
|
|
53577
53598
|
};
|
|
53578
53599
|
}
|
|
@@ -54006,37 +54027,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54006
54027
|
key: "align_type_expressions",
|
|
54007
54028
|
title: "Align TYPE expressions",
|
|
54008
54029
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54009
|
-
extendedInformation: `
|
|
54010
|
-
Currently works for METHODS + BEGIN OF
|
|
54011
|
-
|
|
54012
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54013
|
-
|
|
54014
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54030
|
+
extendedInformation: `
|
|
54031
|
+
Currently works for METHODS + BEGIN OF
|
|
54032
|
+
|
|
54033
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54034
|
+
|
|
54035
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54015
54036
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54016
54037
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54017
|
-
badExample: `
|
|
54018
|
-
TYPES: BEGIN OF foo,
|
|
54019
|
-
bar TYPE i,
|
|
54020
|
-
foobar TYPE i,
|
|
54021
|
-
END OF foo.
|
|
54022
|
-
|
|
54023
|
-
INTERFACE lif.
|
|
54024
|
-
METHODS bar
|
|
54025
|
-
IMPORTING
|
|
54026
|
-
foo TYPE i
|
|
54027
|
-
foobar TYPE i.
|
|
54038
|
+
badExample: `
|
|
54039
|
+
TYPES: BEGIN OF foo,
|
|
54040
|
+
bar TYPE i,
|
|
54041
|
+
foobar TYPE i,
|
|
54042
|
+
END OF foo.
|
|
54043
|
+
|
|
54044
|
+
INTERFACE lif.
|
|
54045
|
+
METHODS bar
|
|
54046
|
+
IMPORTING
|
|
54047
|
+
foo TYPE i
|
|
54048
|
+
foobar TYPE i.
|
|
54028
54049
|
ENDINTERFACE.`,
|
|
54029
|
-
goodExample: `
|
|
54030
|
-
TYPES: BEGIN OF foo,
|
|
54031
|
-
bar TYPE i,
|
|
54032
|
-
foobar TYPE i,
|
|
54033
|
-
END OF foo.
|
|
54034
|
-
|
|
54035
|
-
INTERFACE lif.
|
|
54036
|
-
METHODS bar
|
|
54037
|
-
IMPORTING
|
|
54038
|
-
foo TYPE i
|
|
54039
|
-
foobar TYPE i.
|
|
54050
|
+
goodExample: `
|
|
54051
|
+
TYPES: BEGIN OF foo,
|
|
54052
|
+
bar TYPE i,
|
|
54053
|
+
foobar TYPE i,
|
|
54054
|
+
END OF foo.
|
|
54055
|
+
|
|
54056
|
+
INTERFACE lif.
|
|
54057
|
+
METHODS bar
|
|
54058
|
+
IMPORTING
|
|
54059
|
+
foo TYPE i
|
|
54060
|
+
foobar TYPE i.
|
|
54040
54061
|
ENDINTERFACE.`,
|
|
54041
54062
|
};
|
|
54042
54063
|
}
|
|
@@ -54315,16 +54336,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54315
54336
|
return {
|
|
54316
54337
|
key: "ambiguous_statement",
|
|
54317
54338
|
title: "Check for ambigious statements",
|
|
54318
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54319
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54320
|
-
|
|
54339
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54340
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54341
|
+
|
|
54321
54342
|
Only works if the target version is 740sp05 or above`,
|
|
54322
54343
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54323
|
-
badExample: `DELETE foo FROM bar.
|
|
54344
|
+
badExample: `DELETE foo FROM bar.
|
|
54324
54345
|
MODIFY foo FROM bar.`,
|
|
54325
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54326
|
-
DELETE TABLE itab FROM 2.
|
|
54327
|
-
MODIFY zfoo FROM @wa.
|
|
54346
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54347
|
+
DELETE TABLE itab FROM 2.
|
|
54348
|
+
MODIFY zfoo FROM @wa.
|
|
54328
54349
|
MODIFY TABLE foo FROM bar.`,
|
|
54329
54350
|
};
|
|
54330
54351
|
}
|
|
@@ -54429,16 +54450,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54429
54450
|
key: "avoid_use",
|
|
54430
54451
|
title: "Avoid use of certain statements",
|
|
54431
54452
|
shortDescription: `Detects usage of certain statements.`,
|
|
54432
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54433
|
-
|
|
54434
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54435
|
-
|
|
54436
|
-
STATICS: use CLASS-DATA instead
|
|
54437
|
-
|
|
54438
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54439
|
-
|
|
54440
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54441
|
-
|
|
54453
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54454
|
+
|
|
54455
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54456
|
+
|
|
54457
|
+
STATICS: use CLASS-DATA instead
|
|
54458
|
+
|
|
54459
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54460
|
+
|
|
54461
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54462
|
+
|
|
54442
54463
|
BREAK points`,
|
|
54443
54464
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54444
54465
|
};
|
|
@@ -54570,11 +54591,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54570
54591
|
title: "Check BEGIN END names",
|
|
54571
54592
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54572
54593
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54573
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54574
|
-
field TYPE i,
|
|
54594
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54595
|
+
field TYPE i,
|
|
54575
54596
|
END OF structure_not_the_same.`,
|
|
54576
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54577
|
-
field TYPE i,
|
|
54597
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54598
|
+
field TYPE i,
|
|
54578
54599
|
END OF stru.`,
|
|
54579
54600
|
};
|
|
54580
54601
|
}
|
|
@@ -54671,20 +54692,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54671
54692
|
title: "BEGIN contains single INCLUDE",
|
|
54672
54693
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54673
54694
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54674
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54675
|
-
INCLUDE TYPE dselc.
|
|
54676
|
-
TYPES: END OF dummy1.
|
|
54677
|
-
|
|
54678
|
-
DATA BEGIN OF foo.
|
|
54679
|
-
INCLUDE STRUCTURE syst.
|
|
54680
|
-
DATA END OF foo.
|
|
54681
|
-
|
|
54682
|
-
STATICS BEGIN OF bar.
|
|
54683
|
-
INCLUDE STRUCTURE syst.
|
|
54695
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54696
|
+
INCLUDE TYPE dselc.
|
|
54697
|
+
TYPES: END OF dummy1.
|
|
54698
|
+
|
|
54699
|
+
DATA BEGIN OF foo.
|
|
54700
|
+
INCLUDE STRUCTURE syst.
|
|
54701
|
+
DATA END OF foo.
|
|
54702
|
+
|
|
54703
|
+
STATICS BEGIN OF bar.
|
|
54704
|
+
INCLUDE STRUCTURE syst.
|
|
54684
54705
|
STATICS END OF bar.`,
|
|
54685
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54686
|
-
DATA field TYPE i.
|
|
54687
|
-
INCLUDE STRUCTURE dselc.
|
|
54706
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54707
|
+
DATA field TYPE i.
|
|
54708
|
+
INCLUDE STRUCTURE dselc.
|
|
54688
54709
|
DATA END OF foo.`,
|
|
54689
54710
|
};
|
|
54690
54711
|
}
|
|
@@ -54774,9 +54795,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54774
54795
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54775
54796
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54776
54797
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54777
|
-
goodExample: `TRY.
|
|
54778
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54779
|
-
CATCH cx_sy_authorization_error.
|
|
54798
|
+
goodExample: `TRY.
|
|
54799
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54800
|
+
CATCH cx_sy_authorization_error.
|
|
54780
54801
|
ENDTRY.`,
|
|
54781
54802
|
};
|
|
54782
54803
|
}
|
|
@@ -54841,10 +54862,10 @@ class CDSCommentStyle {
|
|
|
54841
54862
|
key: "cds_comment_style",
|
|
54842
54863
|
title: "CDS Comment Style",
|
|
54843
54864
|
shortDescription: `Check for obsolete comment style`,
|
|
54844
|
-
extendedInformation: `Check for obsolete comment style
|
|
54845
|
-
|
|
54846
|
-
Comments starting with "--" are considered obsolete
|
|
54847
|
-
|
|
54865
|
+
extendedInformation: `Check for obsolete comment style
|
|
54866
|
+
|
|
54867
|
+
Comments starting with "--" are considered obsolete
|
|
54868
|
+
|
|
54848
54869
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54849
54870
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54850
54871
|
badExample: "-- this is a comment",
|
|
@@ -54910,10 +54931,10 @@ class CDSLegacyView {
|
|
|
54910
54931
|
key: "cds_legacy_view",
|
|
54911
54932
|
title: "CDS Legacy View",
|
|
54912
54933
|
shortDescription: `Identify CDS Legacy Views`,
|
|
54913
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54914
|
-
|
|
54915
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54916
|
-
|
|
54934
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54935
|
+
|
|
54936
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54937
|
+
|
|
54917
54938
|
v755 and up`,
|
|
54918
54939
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54919
54940
|
};
|
|
@@ -55068,10 +55089,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55068
55089
|
key: "chain_mainly_declarations",
|
|
55069
55090
|
title: "Chain mainly declarations",
|
|
55070
55091
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55071
|
-
extendedInformation: `
|
|
55072
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55073
|
-
|
|
55074
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55092
|
+
extendedInformation: `
|
|
55093
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55094
|
+
|
|
55095
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55075
55096
|
`,
|
|
55076
55097
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55077
55098
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55247,17 +55268,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55247
55268
|
title: "Change IF to CASE",
|
|
55248
55269
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55249
55270
|
// eslint-disable-next-line max-len
|
|
55250
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55251
|
-
|
|
55271
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55272
|
+
|
|
55252
55273
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55253
55274
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55254
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55255
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55256
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55275
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55276
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55277
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55257
55278
|
ENDIF.`,
|
|
55258
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55259
|
-
WHEN 'FOO'.
|
|
55260
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55279
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55280
|
+
WHEN 'FOO'.
|
|
55281
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55261
55282
|
ENDCASE.`,
|
|
55262
55283
|
};
|
|
55263
55284
|
}
|
|
@@ -55394,8 +55415,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55394
55415
|
return {
|
|
55395
55416
|
key: "check_abstract",
|
|
55396
55417
|
title: "Check abstract methods and classes",
|
|
55397
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55398
|
-
- class defined as abstract and final,
|
|
55418
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55419
|
+
- class defined as abstract and final,
|
|
55399
55420
|
- non-abstract class contains abstract methods`,
|
|
55400
55421
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55401
55422
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55476,11 +55497,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55476
55497
|
return {
|
|
55477
55498
|
key: "check_comments",
|
|
55478
55499
|
title: "Check Comments",
|
|
55479
|
-
shortDescription: `
|
|
55500
|
+
shortDescription: `
|
|
55480
55501
|
Various checks for comment usage.`,
|
|
55481
|
-
extendedInformation: `
|
|
55482
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55483
|
-
|
|
55502
|
+
extendedInformation: `
|
|
55503
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55504
|
+
|
|
55484
55505
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55485
55506
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55486
55507
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55642,9 +55663,9 @@ class CheckInclude {
|
|
|
55642
55663
|
key: "check_include",
|
|
55643
55664
|
title: "Check INCLUDEs",
|
|
55644
55665
|
shortDescription: `Checks INCLUDE statements`,
|
|
55645
|
-
extendedInformation: `
|
|
55646
|
-
* Reports unused includes
|
|
55647
|
-
* Errors if the includes are not found
|
|
55666
|
+
extendedInformation: `
|
|
55667
|
+
* Reports unused includes
|
|
55668
|
+
* Errors if the includes are not found
|
|
55648
55669
|
* Error if including a main program`,
|
|
55649
55670
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55650
55671
|
};
|
|
@@ -55720,14 +55741,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55720
55741
|
key: "check_subrc",
|
|
55721
55742
|
title: "Check sy-subrc",
|
|
55722
55743
|
shortDescription: `Check sy-subrc`,
|
|
55723
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55724
|
-
|
|
55725
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55726
|
-
|
|
55727
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55728
|
-
|
|
55729
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55730
|
-
|
|
55744
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55745
|
+
|
|
55746
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55747
|
+
|
|
55748
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55749
|
+
|
|
55750
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55751
|
+
|
|
55731
55752
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55732
55753
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55733
55754
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56297,17 +56318,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56297
56318
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56298
56319
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56299
56320
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56300
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56301
|
-
EXCEPTIONS
|
|
56302
|
-
system_failure = 1 MESSAGE lv_message
|
|
56303
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56304
|
-
resource_failure = 1
|
|
56321
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56322
|
+
EXCEPTIONS
|
|
56323
|
+
system_failure = 1 MESSAGE lv_message
|
|
56324
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56325
|
+
resource_failure = 1
|
|
56305
56326
|
OTHERS = 1.`,
|
|
56306
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56307
|
-
EXCEPTIONS
|
|
56308
|
-
system_failure = 1 MESSAGE lv_message
|
|
56309
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56310
|
-
resource_failure = 3
|
|
56327
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56328
|
+
EXCEPTIONS
|
|
56329
|
+
system_failure = 1 MESSAGE lv_message
|
|
56330
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56331
|
+
resource_failure = 3
|
|
56311
56332
|
OTHERS = 4.`,
|
|
56312
56333
|
};
|
|
56313
56334
|
}
|
|
@@ -56553,7 +56574,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56553
56574
|
key: "commented_code",
|
|
56554
56575
|
title: "Find commented code",
|
|
56555
56576
|
shortDescription: `Detects usage of commented out code.`,
|
|
56556
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56577
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56557
56578
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56558
56579
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56559
56580
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56786,10 +56807,10 @@ class ConstructorVisibilityPublic {
|
|
|
56786
56807
|
key: "constructor_visibility_public",
|
|
56787
56808
|
title: "Check constructor visibility is public",
|
|
56788
56809
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56789
|
-
extendedInformation: `
|
|
56790
|
-
This only applies to global classes.
|
|
56791
|
-
|
|
56792
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56810
|
+
extendedInformation: `
|
|
56811
|
+
This only applies to global classes.
|
|
56812
|
+
|
|
56813
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56793
56814
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56794
56815
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56795
56816
|
};
|
|
@@ -56864,8 +56885,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56864
56885
|
key: "contains_tab",
|
|
56865
56886
|
title: "Code contains tab",
|
|
56866
56887
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56867
|
-
extendedInformation: `
|
|
56868
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56888
|
+
extendedInformation: `
|
|
56889
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56869
56890
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56870
56891
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56871
56892
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -56952,10 +56973,10 @@ class CyclicOO {
|
|
|
56952
56973
|
key: "cyclic_oo",
|
|
56953
56974
|
title: "Cyclic OO",
|
|
56954
56975
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
56955
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56956
|
-
|
|
56957
|
-
Objects must be without syntax errors for this rule to take effect
|
|
56958
|
-
|
|
56976
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56977
|
+
|
|
56978
|
+
Objects must be without syntax errors for this rule to take effect
|
|
56979
|
+
|
|
56959
56980
|
References in testclass includes are ignored`,
|
|
56960
56981
|
};
|
|
56961
56982
|
}
|
|
@@ -57198,7 +57219,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57198
57219
|
key: "dangerous_statement",
|
|
57199
57220
|
title: "Dangerous statement",
|
|
57200
57221
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57201
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57222
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57202
57223
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57203
57224
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57204
57225
|
};
|
|
@@ -57405,13 +57426,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57405
57426
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57406
57427
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57407
57428
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57408
|
-
badExample: `FROM foo.
|
|
57409
|
-
WRITE 'hello'.
|
|
57410
|
-
DATA int TYPE i.
|
|
57429
|
+
badExample: `FROM foo.
|
|
57430
|
+
WRITE 'hello'.
|
|
57431
|
+
DATA int TYPE i.
|
|
57411
57432
|
ENDFORM.`,
|
|
57412
|
-
goodExample: `FROM foo.
|
|
57413
|
-
DATA int TYPE i.
|
|
57414
|
-
WRITE 'hello'.
|
|
57433
|
+
goodExample: `FROM foo.
|
|
57434
|
+
DATA int TYPE i.
|
|
57435
|
+
WRITE 'hello'.
|
|
57415
57436
|
ENDFORM.`,
|
|
57416
57437
|
};
|
|
57417
57438
|
}
|
|
@@ -57950,39 +57971,39 @@ class Downport {
|
|
|
57950
57971
|
key: "downport",
|
|
57951
57972
|
title: "Downport statement",
|
|
57952
57973
|
shortDescription: `Downport functionality`,
|
|
57953
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57954
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57955
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57956
|
-
|
|
57957
|
-
Current rules:
|
|
57958
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57959
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57960
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
57961
|
-
* CONV is outlined
|
|
57962
|
-
* COND is outlined
|
|
57963
|
-
* REDUCE is outlined
|
|
57964
|
-
* SWITCH is outlined
|
|
57965
|
-
* FILTER is outlined
|
|
57966
|
-
* APPEND expression is outlined
|
|
57967
|
-
* INSERT expression is outlined
|
|
57968
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57969
|
-
* CAST changed to ?=
|
|
57970
|
-
* LOOP AT method_call( ) is outlined
|
|
57971
|
-
* VALUE # with structure fields
|
|
57972
|
-
* VALUE # with internal table lines
|
|
57973
|
-
* Table Expressions are outlined
|
|
57974
|
-
* SELECT INTO @DATA definitions are outlined
|
|
57975
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57976
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57977
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57978
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
57979
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57980
|
-
* line_exists and line_index is downported to READ TABLE
|
|
57981
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
57982
|
-
* MESSAGE with non simple source
|
|
57983
|
-
|
|
57984
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57985
|
-
|
|
57974
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57975
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57976
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57977
|
+
|
|
57978
|
+
Current rules:
|
|
57979
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57980
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57981
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
57982
|
+
* CONV is outlined
|
|
57983
|
+
* COND is outlined
|
|
57984
|
+
* REDUCE is outlined
|
|
57985
|
+
* SWITCH is outlined
|
|
57986
|
+
* FILTER is outlined
|
|
57987
|
+
* APPEND expression is outlined
|
|
57988
|
+
* INSERT expression is outlined
|
|
57989
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57990
|
+
* CAST changed to ?=
|
|
57991
|
+
* LOOP AT method_call( ) is outlined
|
|
57992
|
+
* VALUE # with structure fields
|
|
57993
|
+
* VALUE # with internal table lines
|
|
57994
|
+
* Table Expressions are outlined
|
|
57995
|
+
* SELECT INTO @DATA definitions are outlined
|
|
57996
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57997
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57998
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57999
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58000
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58001
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58002
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58003
|
+
* MESSAGE with non simple source
|
|
58004
|
+
|
|
58005
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58006
|
+
|
|
57986
58007
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
57987
58008
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
57988
58009
|
};
|
|
@@ -58560,10 +58581,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58560
58581
|
const fieldName = f.concatTokens();
|
|
58561
58582
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58562
58583
|
}
|
|
58563
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58584
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58564
58585
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58565
58586
|
}
|
|
58566
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58587
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58567
58588
|
${indentation}`);
|
|
58568
58589
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58569
58590
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58622,12 +58643,12 @@ ${indentation}`);
|
|
|
58622
58643
|
}
|
|
58623
58644
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58624
58645
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
58625
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58626
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58627
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58646
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58647
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58648
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58628
58649
|
${indentation}`);
|
|
58629
58650
|
if (fieldDefinitions === "") {
|
|
58630
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58651
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58631
58652
|
${indentation}`);
|
|
58632
58653
|
}
|
|
58633
58654
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58695,7 +58716,7 @@ ${indentation}`);
|
|
|
58695
58716
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58696
58717
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58697
58718
|
const firstToken = high.getFirstToken();
|
|
58698
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58719
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58699
58720
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58700
58721
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58701
58722
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58749,7 +58770,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58749
58770
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58750
58771
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58751
58772
|
const firstToken = high.getFirstToken();
|
|
58752
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58773
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58753
58774
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58754
58775
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58755
58776
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58791,14 +58812,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58791
58812
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58792
58813
|
const firstToken = high.getFirstToken();
|
|
58793
58814
|
// note that the tabix restore should be done before throwing the exception
|
|
58794
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58795
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58796
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58797
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58798
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58799
|
-
${indentation}IF sy-subrc <> 0.
|
|
58800
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58801
|
-
${indentation}ENDIF.
|
|
58815
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58816
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58817
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58818
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58819
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58820
|
+
${indentation}IF sy-subrc <> 0.
|
|
58821
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58822
|
+
${indentation}ENDIF.
|
|
58802
58823
|
${indentation}`);
|
|
58803
58824
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58804
58825
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58855,7 +58876,7 @@ ${indentation}`);
|
|
|
58855
58876
|
const className = classNames[0].concatTokens();
|
|
58856
58877
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58857
58878
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58858
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58879
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58859
58880
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58860
58881
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58861
58882
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59017,16 +59038,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59017
59038
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59018
59039
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59019
59040
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59020
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59021
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59041
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59042
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59022
59043
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59023
59044
|
if (withs.length > 0) {
|
|
59024
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59025
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59026
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59045
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59046
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59047
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59027
59048
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59028
59049
|
}
|
|
59029
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59050
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59030
59051
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59031
59052
|
if (withs.length > 0) {
|
|
59032
59053
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59138,10 +59159,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59138
59159
|
let code = "";
|
|
59139
59160
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59140
59161
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59141
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59142
|
-
IF sy-subrc <> 0.
|
|
59143
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59144
|
-
ENDIF.
|
|
59162
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59163
|
+
IF sy-subrc <> 0.
|
|
59164
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59165
|
+
ENDIF.
|
|
59145
59166
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59146
59167
|
}
|
|
59147
59168
|
else {
|
|
@@ -59230,20 +59251,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59230
59251
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59231
59252
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59232
59253
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59233
|
-
code += ` items LIKE ${loopSourceName},
|
|
59234
|
-
END OF ${groupTargetName}type.
|
|
59235
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59236
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59254
|
+
code += ` items LIKE ${loopSourceName},
|
|
59255
|
+
END OF ${groupTargetName}type.
|
|
59256
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59257
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59237
59258
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59238
59259
|
if (groupIndexName !== undefined) {
|
|
59239
59260
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59240
59261
|
}
|
|
59241
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59262
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59242
59263
|
IF sy-subrc = 0.\n`;
|
|
59243
59264
|
if (groupCountName !== undefined) {
|
|
59244
59265
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59245
59266
|
}
|
|
59246
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59267
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59247
59268
|
ELSE.\n`;
|
|
59248
59269
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59249
59270
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59264,8 +59285,8 @@ ELSE.\n`;
|
|
|
59264
59285
|
}
|
|
59265
59286
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59266
59287
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59267
|
-
code += `ENDIF.
|
|
59268
|
-
ENDLOOP.
|
|
59288
|
+
code += `ENDIF.
|
|
59289
|
+
ENDLOOP.
|
|
59269
59290
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59270
59291
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59271
59292
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59437,7 +59458,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59437
59458
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59438
59459
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59439
59460
|
// all ENUMS are char like?
|
|
59440
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59461
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59441
59462
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59442
59463
|
let count = 1;
|
|
59443
59464
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59481,14 +59502,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59481
59502
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59482
59503
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59483
59504
|
// restore tabix before exeption
|
|
59484
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59485
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59486
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59487
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59488
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59489
|
-
${indentation}IF sy-subrc <> 0.
|
|
59490
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59491
|
-
${indentation}ENDIF.
|
|
59505
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59506
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59507
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59508
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59509
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59510
|
+
${indentation}IF sy-subrc <> 0.
|
|
59511
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59512
|
+
${indentation}ENDIF.
|
|
59492
59513
|
${indentation}${uniqueName}`;
|
|
59493
59514
|
const start = target.getFirstToken().getStart();
|
|
59494
59515
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59572,11 +59593,11 @@ ${indentation}${uniqueName}`;
|
|
|
59572
59593
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59573
59594
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59574
59595
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59575
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59576
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59577
|
-
${indentation} EXPORTING
|
|
59578
|
-
${indentation} input = ${source}
|
|
59579
|
-
${indentation} IMPORTING
|
|
59596
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59597
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59598
|
+
${indentation} EXPORTING
|
|
59599
|
+
${indentation} input = ${source}
|
|
59600
|
+
${indentation} IMPORTING
|
|
59580
59601
|
${indentation} output = ${uniqueName}.\n`;
|
|
59581
59602
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59582
59603
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60888,12 +60909,12 @@ class EasyToFindMessages {
|
|
|
60888
60909
|
key: "easy_to_find_messages",
|
|
60889
60910
|
title: "Easy to find messages",
|
|
60890
60911
|
shortDescription: `Make messages easy to find`,
|
|
60891
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60892
|
-
|
|
60893
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60894
|
-
|
|
60895
|
-
Also see rule "message_exists"
|
|
60896
|
-
|
|
60912
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60913
|
+
|
|
60914
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60915
|
+
|
|
60916
|
+
Also see rule "message_exists"
|
|
60917
|
+
|
|
60897
60918
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60898
60919
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60899
60920
|
};
|
|
@@ -60974,13 +60995,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
60974
60995
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
60975
60996
|
extendedInformation: ``,
|
|
60976
60997
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60977
|
-
badExample: `
|
|
60978
|
-
INITIALIZATION.
|
|
60979
|
-
WRITE 'hello'.
|
|
60998
|
+
badExample: `
|
|
60999
|
+
INITIALIZATION.
|
|
61000
|
+
WRITE 'hello'.
|
|
60980
61001
|
END-OF-SELECTION.`,
|
|
60981
|
-
goodExample: `
|
|
60982
|
-
START-OF-SELECTION.
|
|
60983
|
-
PERFORM sdf.
|
|
61002
|
+
goodExample: `
|
|
61003
|
+
START-OF-SELECTION.
|
|
61004
|
+
PERFORM sdf.
|
|
60984
61005
|
COMMIT WORK.`,
|
|
60985
61006
|
};
|
|
60986
61007
|
}
|
|
@@ -61072,8 +61093,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61072
61093
|
key: "empty_line_in_statement",
|
|
61073
61094
|
title: "Find empty lines in statements",
|
|
61074
61095
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61075
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61076
|
-
|
|
61096
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61097
|
+
|
|
61077
61098
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61078
61099
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61079
61100
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61249,13 +61270,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61249
61270
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61250
61271
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61251
61272
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61252
|
-
badExample: `IF foo = bar.
|
|
61253
|
-
ENDIF.
|
|
61254
|
-
|
|
61255
|
-
DO 2 TIMES.
|
|
61273
|
+
badExample: `IF foo = bar.
|
|
61274
|
+
ENDIF.
|
|
61275
|
+
|
|
61276
|
+
DO 2 TIMES.
|
|
61256
61277
|
ENDDO.`,
|
|
61257
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61258
|
-
ENDLOOP.
|
|
61278
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61279
|
+
ENDLOOP.
|
|
61259
61280
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61260
61281
|
};
|
|
61261
61282
|
}
|
|
@@ -61397,10 +61418,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61397
61418
|
return {
|
|
61398
61419
|
key: "exit_or_check",
|
|
61399
61420
|
title: "Find EXIT or CHECK outside loops",
|
|
61400
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61421
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61401
61422
|
Use RETURN to leave procesing blocks instead.`,
|
|
61402
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61403
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61423
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61424
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61404
61425
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61405
61426
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61406
61427
|
};
|
|
@@ -61483,12 +61504,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61483
61504
|
key: "expand_macros",
|
|
61484
61505
|
title: "Expand Macros",
|
|
61485
61506
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61486
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61487
|
-
|
|
61507
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61508
|
+
|
|
61488
61509
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61489
|
-
badExample: `DEFINE _hello.
|
|
61490
|
-
WRITE 'hello'.
|
|
61491
|
-
END-OF-DEFINITION.
|
|
61510
|
+
badExample: `DEFINE _hello.
|
|
61511
|
+
WRITE 'hello'.
|
|
61512
|
+
END-OF-DEFINITION.
|
|
61492
61513
|
_hello.`,
|
|
61493
61514
|
goodExample: `WRITE 'hello'.`,
|
|
61494
61515
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61575,7 +61596,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61575
61596
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61576
61597
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61577
61598
|
goodExample: `call_method( foo = bar ).`,
|
|
61578
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61599
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61579
61600
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61580
61601
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61581
61602
|
};
|
|
@@ -61673,7 +61694,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61673
61694
|
key: "forbidden_identifier",
|
|
61674
61695
|
title: "Forbidden Identifier",
|
|
61675
61696
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61676
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61697
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61677
61698
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61678
61699
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61679
61700
|
};
|
|
@@ -61915,8 +61936,8 @@ class ForbiddenVoidType {
|
|
|
61915
61936
|
key: "forbidden_void_type",
|
|
61916
61937
|
title: "Forbidden Void Types",
|
|
61917
61938
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61918
|
-
extendedInformation: `Inspiration:
|
|
61919
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61939
|
+
extendedInformation: `Inspiration:
|
|
61940
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61920
61941
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61921
61942
|
};
|
|
61922
61943
|
}
|
|
@@ -62159,7 +62180,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62159
62180
|
key: "fully_type_itabs",
|
|
62160
62181
|
title: "Fully type internal tables",
|
|
62161
62182
|
shortDescription: `No implict table types or table keys`,
|
|
62162
|
-
|
|
62183
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62184
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62185
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62163
62186
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62164
62187
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62165
62188
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62344,26 +62367,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62344
62367
|
key: "functional_writing",
|
|
62345
62368
|
title: "Use functional writing",
|
|
62346
62369
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62347
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62370
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62348
62371
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62349
62372
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62350
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62351
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62352
|
-
EXPORTING
|
|
62353
|
-
p_name = 'NAME'
|
|
62354
|
-
RECEIVING
|
|
62355
|
-
p_descr_ref = lr_typedescr
|
|
62356
|
-
EXCEPTIONS
|
|
62357
|
-
type_not_found = 1
|
|
62373
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62374
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62375
|
+
EXPORTING
|
|
62376
|
+
p_name = 'NAME'
|
|
62377
|
+
RECEIVING
|
|
62378
|
+
p_descr_ref = lr_typedescr
|
|
62379
|
+
EXCEPTIONS
|
|
62380
|
+
type_not_found = 1
|
|
62358
62381
|
OTHERS = 2.`,
|
|
62359
|
-
goodExample: `zcl_class=>method( ).
|
|
62360
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62361
|
-
EXPORTING
|
|
62362
|
-
p_name = 'NAME'
|
|
62363
|
-
RECEIVING
|
|
62364
|
-
p_descr_ref = lr_typedescr
|
|
62365
|
-
EXCEPTIONS
|
|
62366
|
-
type_not_found = 1
|
|
62382
|
+
goodExample: `zcl_class=>method( ).
|
|
62383
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62384
|
+
EXPORTING
|
|
62385
|
+
p_name = 'NAME'
|
|
62386
|
+
RECEIVING
|
|
62387
|
+
p_descr_ref = lr_typedescr
|
|
62388
|
+
EXCEPTIONS
|
|
62389
|
+
type_not_found = 1
|
|
62367
62390
|
OTHERS = 2 ).`,
|
|
62368
62391
|
};
|
|
62369
62392
|
}
|
|
@@ -62474,14 +62497,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62474
62497
|
key: "global_class",
|
|
62475
62498
|
title: "Global class checks",
|
|
62476
62499
|
shortDescription: `Checks related to global classes`,
|
|
62477
|
-
extendedInformation: `* global classes must be in own files
|
|
62478
|
-
|
|
62479
|
-
* file names must match class name
|
|
62480
|
-
|
|
62481
|
-
* file names must match interface name
|
|
62482
|
-
|
|
62483
|
-
* global classes must be global definitions
|
|
62484
|
-
|
|
62500
|
+
extendedInformation: `* global classes must be in own files
|
|
62501
|
+
|
|
62502
|
+
* file names must match class name
|
|
62503
|
+
|
|
62504
|
+
* file names must match interface name
|
|
62505
|
+
|
|
62506
|
+
* global classes must be global definitions
|
|
62507
|
+
|
|
62485
62508
|
* global interfaces must be global definitions`,
|
|
62486
62509
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62487
62510
|
};
|
|
@@ -62580,21 +62603,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62580
62603
|
return {
|
|
62581
62604
|
key: "identical_conditions",
|
|
62582
62605
|
title: "Identical conditions",
|
|
62583
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62584
|
-
|
|
62606
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62607
|
+
|
|
62585
62608
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62586
62609
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62587
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62588
|
-
ENDIF.
|
|
62589
|
-
CASE bar.
|
|
62590
|
-
WHEN '1'.
|
|
62591
|
-
WHEN 'A' OR '1'.
|
|
62610
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62611
|
+
ENDIF.
|
|
62612
|
+
CASE bar.
|
|
62613
|
+
WHEN '1'.
|
|
62614
|
+
WHEN 'A' OR '1'.
|
|
62592
62615
|
ENDCASE.`,
|
|
62593
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62594
|
-
ENDIF.
|
|
62595
|
-
CASE bar.
|
|
62596
|
-
WHEN '1'.
|
|
62597
|
-
WHEN 'A'.
|
|
62616
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62617
|
+
ENDIF.
|
|
62618
|
+
CASE bar.
|
|
62619
|
+
WHEN '1'.
|
|
62620
|
+
WHEN 'A'.
|
|
62598
62621
|
ENDCASE.`,
|
|
62599
62622
|
};
|
|
62600
62623
|
}
|
|
@@ -62728,23 +62751,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62728
62751
|
key: "identical_contents",
|
|
62729
62752
|
title: "Identical contents",
|
|
62730
62753
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62731
|
-
extendedInformation: `
|
|
62732
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62733
|
-
|
|
62754
|
+
extendedInformation: `
|
|
62755
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62756
|
+
|
|
62734
62757
|
Chained statments are ignored`,
|
|
62735
62758
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62736
|
-
badExample: `IF foo = bar.
|
|
62737
|
-
WRITE 'bar'.
|
|
62738
|
-
WRITE 'world'.
|
|
62739
|
-
ELSE.
|
|
62740
|
-
WRITE 'foo'.
|
|
62741
|
-
WRITE 'world'.
|
|
62759
|
+
badExample: `IF foo = bar.
|
|
62760
|
+
WRITE 'bar'.
|
|
62761
|
+
WRITE 'world'.
|
|
62762
|
+
ELSE.
|
|
62763
|
+
WRITE 'foo'.
|
|
62764
|
+
WRITE 'world'.
|
|
62742
62765
|
ENDIF.`,
|
|
62743
|
-
goodExample: `IF foo = bar.
|
|
62744
|
-
WRITE 'bar'.
|
|
62745
|
-
ELSE.
|
|
62746
|
-
WRITE 'foo'.
|
|
62747
|
-
ENDIF.
|
|
62766
|
+
goodExample: `IF foo = bar.
|
|
62767
|
+
WRITE 'bar'.
|
|
62768
|
+
ELSE.
|
|
62769
|
+
WRITE 'foo'.
|
|
62770
|
+
ENDIF.
|
|
62748
62771
|
WRITE 'world'.`,
|
|
62749
62772
|
};
|
|
62750
62773
|
}
|
|
@@ -62852,12 +62875,12 @@ class IdenticalDescriptions {
|
|
|
62852
62875
|
key: "identical_descriptions",
|
|
62853
62876
|
title: "Identical descriptions",
|
|
62854
62877
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62855
|
-
extendedInformation: `Case insensitive
|
|
62856
|
-
|
|
62857
|
-
Only checks the master language descriptions
|
|
62858
|
-
|
|
62859
|
-
Dependencies are skipped
|
|
62860
|
-
|
|
62878
|
+
extendedInformation: `Case insensitive
|
|
62879
|
+
|
|
62880
|
+
Only checks the master language descriptions
|
|
62881
|
+
|
|
62882
|
+
Dependencies are skipped
|
|
62883
|
+
|
|
62861
62884
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62862
62885
|
tags: [],
|
|
62863
62886
|
};
|
|
@@ -63031,43 +63054,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63031
63054
|
key: "if_in_if",
|
|
63032
63055
|
title: "IF in IF",
|
|
63033
63056
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63034
|
-
extendedInformation: `
|
|
63035
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63036
|
-
|
|
63037
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63038
|
-
|
|
63039
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63057
|
+
extendedInformation: `
|
|
63058
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63059
|
+
|
|
63060
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63061
|
+
|
|
63062
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63040
63063
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63041
|
-
badExample: `IF condition1.
|
|
63042
|
-
IF condition2.
|
|
63043
|
-
...
|
|
63044
|
-
ENDIF.
|
|
63045
|
-
ENDIF.
|
|
63046
|
-
|
|
63047
|
-
IF condition1.
|
|
63048
|
-
...
|
|
63049
|
-
ELSE.
|
|
63050
|
-
IF condition2.
|
|
63051
|
-
...
|
|
63052
|
-
ENDIF.
|
|
63064
|
+
badExample: `IF condition1.
|
|
63065
|
+
IF condition2.
|
|
63066
|
+
...
|
|
63067
|
+
ENDIF.
|
|
63068
|
+
ENDIF.
|
|
63069
|
+
|
|
63070
|
+
IF condition1.
|
|
63071
|
+
...
|
|
63072
|
+
ELSE.
|
|
63073
|
+
IF condition2.
|
|
63074
|
+
...
|
|
63075
|
+
ENDIF.
|
|
63053
63076
|
ENDIF.`,
|
|
63054
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63055
|
-
...
|
|
63056
|
-
ENDIF.
|
|
63057
|
-
|
|
63058
|
-
IF condition1.
|
|
63059
|
-
...
|
|
63060
|
-
ELSEIF condition2.
|
|
63061
|
-
...
|
|
63062
|
-
ENDIF.
|
|
63063
|
-
|
|
63064
|
-
CASE variable.
|
|
63065
|
-
WHEN value1.
|
|
63066
|
-
...
|
|
63067
|
-
WHEN value2.
|
|
63068
|
-
IF condition2.
|
|
63069
|
-
...
|
|
63070
|
-
ENDIF.
|
|
63077
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63078
|
+
...
|
|
63079
|
+
ENDIF.
|
|
63080
|
+
|
|
63081
|
+
IF condition1.
|
|
63082
|
+
...
|
|
63083
|
+
ELSEIF condition2.
|
|
63084
|
+
...
|
|
63085
|
+
ENDIF.
|
|
63086
|
+
|
|
63087
|
+
CASE variable.
|
|
63088
|
+
WHEN value1.
|
|
63089
|
+
...
|
|
63090
|
+
WHEN value2.
|
|
63091
|
+
IF condition2.
|
|
63092
|
+
...
|
|
63093
|
+
ENDIF.
|
|
63071
63094
|
ENDCASE.`,
|
|
63072
63095
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63073
63096
|
};
|
|
@@ -63252,9 +63275,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63252
63275
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63253
63276
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63254
63277
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63255
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63256
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63257
|
-
RETURN. " todo, implement method
|
|
63278
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63279
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63280
|
+
RETURN. " todo, implement method
|
|
63258
63281
|
ENDMETHOD.`);
|
|
63259
63282
|
}
|
|
63260
63283
|
}
|
|
@@ -63433,14 +63456,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63433
63456
|
key: "implicit_start_of_selection",
|
|
63434
63457
|
title: "Implicit START-OF-SELECTION",
|
|
63435
63458
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63436
|
-
extendedInformation: `Only runs for executable programs
|
|
63437
|
-
|
|
63459
|
+
extendedInformation: `Only runs for executable programs
|
|
63460
|
+
|
|
63438
63461
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63439
63462
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63440
|
-
badExample: `REPORT zfoo.
|
|
63463
|
+
badExample: `REPORT zfoo.
|
|
63441
63464
|
WRITE 'hello'.`,
|
|
63442
|
-
goodExample: `
|
|
63443
|
-
START-OF-SELECTION.
|
|
63465
|
+
goodExample: `
|
|
63466
|
+
START-OF-SELECTION.
|
|
63444
63467
|
WRITE 'hello'.`,
|
|
63445
63468
|
};
|
|
63446
63469
|
}
|
|
@@ -63545,19 +63568,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63545
63568
|
key: "in_statement_indentation",
|
|
63546
63569
|
title: "In-statement indentation",
|
|
63547
63570
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63548
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63549
|
-
|
|
63550
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63571
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63572
|
+
|
|
63573
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63551
63574
|
to distinguish them better from code within the block.`,
|
|
63552
|
-
badExample: `IF 1 = 1
|
|
63553
|
-
AND 2 = 2.
|
|
63554
|
-
WRITE 'hello' &&
|
|
63555
|
-
'world'.
|
|
63575
|
+
badExample: `IF 1 = 1
|
|
63576
|
+
AND 2 = 2.
|
|
63577
|
+
WRITE 'hello' &&
|
|
63578
|
+
'world'.
|
|
63556
63579
|
ENDIF.`,
|
|
63557
|
-
goodExample: `IF 1 = 1
|
|
63558
|
-
AND 2 = 2.
|
|
63559
|
-
WRITE 'hello' &&
|
|
63560
|
-
'world'.
|
|
63580
|
+
goodExample: `IF 1 = 1
|
|
63581
|
+
AND 2 = 2.
|
|
63582
|
+
WRITE 'hello' &&
|
|
63583
|
+
'world'.
|
|
63561
63584
|
ENDIF.`,
|
|
63562
63585
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63563
63586
|
};
|
|
@@ -63680,23 +63703,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63680
63703
|
title: "Indentation",
|
|
63681
63704
|
shortDescription: `Checks indentation`,
|
|
63682
63705
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63683
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63684
|
-
PRIVATE SECTION.
|
|
63685
|
-
METHODS constructor.
|
|
63686
|
-
ENDCLASS.
|
|
63687
|
-
|
|
63688
|
-
CLASS lcl IMPLEMENTATION.
|
|
63689
|
-
METHOD constructor.
|
|
63690
|
-
ENDMETHOD.
|
|
63706
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63707
|
+
PRIVATE SECTION.
|
|
63708
|
+
METHODS constructor.
|
|
63709
|
+
ENDCLASS.
|
|
63710
|
+
|
|
63711
|
+
CLASS lcl IMPLEMENTATION.
|
|
63712
|
+
METHOD constructor.
|
|
63713
|
+
ENDMETHOD.
|
|
63691
63714
|
ENDCLASS.`,
|
|
63692
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63693
|
-
PRIVATE SECTION.
|
|
63694
|
-
METHODS constructor.
|
|
63695
|
-
ENDCLASS.
|
|
63696
|
-
|
|
63697
|
-
CLASS lcl IMPLEMENTATION.
|
|
63698
|
-
METHOD constructor.
|
|
63699
|
-
ENDMETHOD.
|
|
63715
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63716
|
+
PRIVATE SECTION.
|
|
63717
|
+
METHODS constructor.
|
|
63718
|
+
ENDCLASS.
|
|
63719
|
+
|
|
63720
|
+
CLASS lcl IMPLEMENTATION.
|
|
63721
|
+
METHOD constructor.
|
|
63722
|
+
ENDMETHOD.
|
|
63700
63723
|
ENDCLASS.`,
|
|
63701
63724
|
};
|
|
63702
63725
|
}
|
|
@@ -64097,9 +64120,9 @@ class IntfReferencingClas {
|
|
|
64097
64120
|
key: "intf_referencing_clas",
|
|
64098
64121
|
title: "INTF referencing CLAS",
|
|
64099
64122
|
shortDescription: `Interface contains references to class`,
|
|
64100
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64101
|
-
Only first level references are checked.
|
|
64102
|
-
Exception class references are ignored.
|
|
64123
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64124
|
+
Only first level references are checked.
|
|
64125
|
+
Exception class references are ignored.
|
|
64103
64126
|
Void references are ignored.`,
|
|
64104
64127
|
};
|
|
64105
64128
|
}
|
|
@@ -64184,9 +64207,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64184
64207
|
title: "Invalid Table Index",
|
|
64185
64208
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64186
64209
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64187
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64210
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64188
64211
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64189
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64212
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64190
64213
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64191
64214
|
};
|
|
64192
64215
|
}
|
|
@@ -64787,8 +64810,8 @@ class LineBreakStyle {
|
|
|
64787
64810
|
return {
|
|
64788
64811
|
key: "line_break_style",
|
|
64789
64812
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64790
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64791
|
-
|
|
64813
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64814
|
+
|
|
64792
64815
|
abapGit does not work with CRLF`,
|
|
64793
64816
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64794
64817
|
};
|
|
@@ -64857,7 +64880,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64857
64880
|
key: "line_length",
|
|
64858
64881
|
title: "Line length",
|
|
64859
64882
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64860
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64883
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64861
64884
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64862
64885
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64863
64886
|
};
|
|
@@ -64928,7 +64951,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64928
64951
|
key: "line_only_punc",
|
|
64929
64952
|
title: "Line containing only punctuation",
|
|
64930
64953
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64931
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64954
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64932
64955
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
64933
64956
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64934
64957
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65191,15 +65214,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65191
65214
|
return {
|
|
65192
65215
|
key: "local_variable_names",
|
|
65193
65216
|
title: "Local variable naming conventions",
|
|
65194
|
-
shortDescription: `
|
|
65195
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65217
|
+
shortDescription: `
|
|
65218
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65196
65219
|
Regexes are case-insensitive.`,
|
|
65197
65220
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65198
|
-
badExample: `FORM bar.
|
|
65199
|
-
DATA foo.
|
|
65221
|
+
badExample: `FORM bar.
|
|
65222
|
+
DATA foo.
|
|
65200
65223
|
ENDFORM.`,
|
|
65201
|
-
goodExample: `FORM bar.
|
|
65202
|
-
DATA lv_foo.
|
|
65224
|
+
goodExample: `FORM bar.
|
|
65225
|
+
DATA lv_foo.
|
|
65203
65226
|
ENDFORM.`,
|
|
65204
65227
|
};
|
|
65205
65228
|
}
|
|
@@ -65351,9 +65374,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65351
65374
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65352
65375
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65353
65376
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65354
|
-
badExample: `DEFINE something.
|
|
65377
|
+
badExample: `DEFINE something.
|
|
65355
65378
|
END-OF-DEFINITION.`,
|
|
65356
|
-
goodExample: `DEFINE _something.
|
|
65379
|
+
goodExample: `DEFINE _something.
|
|
65357
65380
|
END-OF-DEFINITION.`,
|
|
65358
65381
|
};
|
|
65359
65382
|
}
|
|
@@ -65426,10 +65449,10 @@ class MainFileContents {
|
|
|
65426
65449
|
key: "main_file_contents",
|
|
65427
65450
|
title: "Main file contents",
|
|
65428
65451
|
shortDescription: `Checks related to report declarations.`,
|
|
65429
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65430
|
-
|
|
65431
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65432
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65452
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65453
|
+
|
|
65454
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65455
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65433
65456
|
`,
|
|
65434
65457
|
};
|
|
65435
65458
|
}
|
|
@@ -65545,17 +65568,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65545
65568
|
title: "Too many parentheses",
|
|
65546
65569
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65547
65570
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65548
|
-
badExample: `
|
|
65549
|
-
IF ( destination IS INITIAL ).
|
|
65550
|
-
ENDIF.
|
|
65551
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65552
|
-
ENDIF.
|
|
65571
|
+
badExample: `
|
|
65572
|
+
IF ( destination IS INITIAL ).
|
|
65573
|
+
ENDIF.
|
|
65574
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65575
|
+
ENDIF.
|
|
65553
65576
|
`,
|
|
65554
|
-
goodExample: `
|
|
65555
|
-
IF destination IS INITIAL.
|
|
65556
|
-
ENDIF.
|
|
65557
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65558
|
-
ENDIF.
|
|
65577
|
+
goodExample: `
|
|
65578
|
+
IF destination IS INITIAL.
|
|
65579
|
+
ENDIF.
|
|
65580
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65581
|
+
ENDIF.
|
|
65559
65582
|
`,
|
|
65560
65583
|
};
|
|
65561
65584
|
}
|
|
@@ -65729,14 +65752,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65729
65752
|
title: "Max one method parameter definition per line",
|
|
65730
65753
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65731
65754
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65732
|
-
badExample: `
|
|
65733
|
-
METHODS apps_scope_token
|
|
65734
|
-
IMPORTING
|
|
65755
|
+
badExample: `
|
|
65756
|
+
METHODS apps_scope_token
|
|
65757
|
+
IMPORTING
|
|
65735
65758
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65736
|
-
goodExample: `
|
|
65737
|
-
METHODS apps_scope_token
|
|
65738
|
-
IMPORTING
|
|
65739
|
-
body TYPE bodyapps_scope_token
|
|
65759
|
+
goodExample: `
|
|
65760
|
+
METHODS apps_scope_token
|
|
65761
|
+
IMPORTING
|
|
65762
|
+
body TYPE bodyapps_scope_token
|
|
65740
65763
|
client_id TYPE str.`,
|
|
65741
65764
|
};
|
|
65742
65765
|
}
|
|
@@ -65801,11 +65824,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65801
65824
|
key: "max_one_statement",
|
|
65802
65825
|
title: "Max one statement per line",
|
|
65803
65826
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65804
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65805
|
-
|
|
65806
|
-
Does not report anything for chained statements.
|
|
65807
|
-
|
|
65808
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65827
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65828
|
+
|
|
65829
|
+
Does not report anything for chained statements.
|
|
65830
|
+
|
|
65831
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65809
65832
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65810
65833
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65811
65834
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66143,8 +66166,8 @@ class MethodLength {
|
|
|
66143
66166
|
key: "method_length",
|
|
66144
66167
|
title: "Method/Form Length",
|
|
66145
66168
|
shortDescription: `Checks relating to method/form length.`,
|
|
66146
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66147
|
-
|
|
66169
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66170
|
+
|
|
66148
66171
|
Abstract methods without statements are considered okay.`,
|
|
66149
66172
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66150
66173
|
};
|
|
@@ -66249,20 +66272,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66249
66272
|
key: "method_overwrites_builtin",
|
|
66250
66273
|
title: "Method name overwrites builtin function",
|
|
66251
66274
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66252
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66253
|
-
|
|
66254
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66255
|
-
|
|
66275
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66276
|
+
|
|
66277
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66278
|
+
|
|
66256
66279
|
Interface method names are ignored`,
|
|
66257
66280
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66258
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66259
|
-
PUBLIC SECTION.
|
|
66260
|
-
METHODS matches.
|
|
66261
|
-
ENDCLASS.
|
|
66262
|
-
|
|
66263
|
-
CLASS lcl IMPLEMENTATION.
|
|
66264
|
-
METHOD matches.
|
|
66265
|
-
ENDMETHOD.
|
|
66281
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66282
|
+
PUBLIC SECTION.
|
|
66283
|
+
METHODS matches.
|
|
66284
|
+
ENDCLASS.
|
|
66285
|
+
|
|
66286
|
+
CLASS lcl IMPLEMENTATION.
|
|
66287
|
+
METHOD matches.
|
|
66288
|
+
ENDMETHOD.
|
|
66266
66289
|
ENDCLASS.`,
|
|
66267
66290
|
};
|
|
66268
66291
|
}
|
|
@@ -66453,12 +66476,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66453
66476
|
// eslint-disable-next-line max-len
|
|
66454
66477
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66455
66478
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66456
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66457
|
-
PUBLIC SECTION.
|
|
66458
|
-
METHODS
|
|
66459
|
-
foobar
|
|
66460
|
-
EXPORTING foo TYPE i
|
|
66461
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66479
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66480
|
+
PUBLIC SECTION.
|
|
66481
|
+
METHODS
|
|
66482
|
+
foobar
|
|
66483
|
+
EXPORTING foo TYPE i
|
|
66484
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66462
66485
|
ENDCLASS.`,
|
|
66463
66486
|
};
|
|
66464
66487
|
}
|
|
@@ -66838,7 +66861,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66838
66861
|
key: "nesting",
|
|
66839
66862
|
title: "Check nesting depth",
|
|
66840
66863
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66841
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66864
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66842
66865
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66843
66866
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66844
66867
|
};
|
|
@@ -67081,7 +67104,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67081
67104
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67082
67105
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67083
67106
|
badExample: `var1 = var2 = var3.`,
|
|
67084
|
-
goodExample: `var2 = var3.
|
|
67107
|
+
goodExample: `var2 = var3.
|
|
67085
67108
|
var1 = var2.`,
|
|
67086
67109
|
};
|
|
67087
67110
|
}
|
|
@@ -67140,8 +67163,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67140
67163
|
key: "no_external_form_calls",
|
|
67141
67164
|
title: "No external FORM calls",
|
|
67142
67165
|
shortDescription: `Detect external form calls`,
|
|
67143
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67144
|
-
|
|
67166
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67167
|
+
|
|
67145
67168
|
PERFORM foo(bar).`,
|
|
67146
67169
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67147
67170
|
};
|
|
@@ -67202,17 +67225,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67202
67225
|
key: "no_inline_in_optional_branches",
|
|
67203
67226
|
title: "Don't declare inline in optional branches",
|
|
67204
67227
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67205
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67206
|
-
|
|
67207
|
-
Considered optional branches:
|
|
67208
|
-
* inside IF/ELSEIF/ELSE
|
|
67209
|
-
* inside LOOP
|
|
67210
|
-
* inside WHILE
|
|
67211
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67212
|
-
* inside DO
|
|
67213
|
-
* inside SELECT loops
|
|
67214
|
-
|
|
67215
|
-
Not considered optional branches:
|
|
67228
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67229
|
+
|
|
67230
|
+
Considered optional branches:
|
|
67231
|
+
* inside IF/ELSEIF/ELSE
|
|
67232
|
+
* inside LOOP
|
|
67233
|
+
* inside WHILE
|
|
67234
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67235
|
+
* inside DO
|
|
67236
|
+
* inside SELECT loops
|
|
67237
|
+
|
|
67238
|
+
Not considered optional branches:
|
|
67216
67239
|
* TRY/CATCH/CLEANUP`,
|
|
67217
67240
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67218
67241
|
};
|
|
@@ -67312,12 +67335,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67312
67335
|
key: "no_prefixes",
|
|
67313
67336
|
title: "No Prefixes",
|
|
67314
67337
|
shortDescription: `Dont use hungarian notation`,
|
|
67315
|
-
extendedInformation: `
|
|
67316
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67317
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67318
|
-
|
|
67319
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67320
|
-
|
|
67338
|
+
extendedInformation: `
|
|
67339
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67340
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67341
|
+
|
|
67342
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67343
|
+
|
|
67321
67344
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67322
67345
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67323
67346
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67496,7 +67519,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67496
67519
|
return {
|
|
67497
67520
|
key: "no_public_attributes",
|
|
67498
67521
|
title: "No public attributes",
|
|
67499
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67522
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67500
67523
|
Exceptions are excluded from this rule.`,
|
|
67501
67524
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67502
67525
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67597,13 +67620,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67597
67620
|
key: "no_yoda_conditions",
|
|
67598
67621
|
title: "No Yoda conditions",
|
|
67599
67622
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67600
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67601
|
-
|
|
67623
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67624
|
+
|
|
67602
67625
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67603
67626
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67604
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67627
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67605
67628
|
ENDIF.`,
|
|
67606
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67629
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67607
67630
|
ENDIF.`,
|
|
67608
67631
|
};
|
|
67609
67632
|
}
|
|
@@ -67704,8 +67727,8 @@ class NROBConsistency {
|
|
|
67704
67727
|
key: "nrob_consistency",
|
|
67705
67728
|
title: "Number range consistency",
|
|
67706
67729
|
shortDescription: `Consistency checks for number ranges`,
|
|
67707
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67708
|
-
|
|
67730
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67731
|
+
|
|
67709
67732
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67710
67733
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67711
67734
|
};
|
|
@@ -67982,58 +68005,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
67982
68005
|
title: "Obsolete statements",
|
|
67983
68006
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
67984
68007
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67985
|
-
extendedInformation: `
|
|
67986
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67987
|
-
|
|
67988
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67989
|
-
|
|
67990
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67991
|
-
|
|
67992
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67993
|
-
|
|
67994
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67995
|
-
|
|
67996
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67997
|
-
|
|
67998
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67999
|
-
|
|
68000
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68001
|
-
|
|
68002
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68003
|
-
|
|
68004
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68005
|
-
|
|
68006
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68007
|
-
|
|
68008
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68009
|
-
|
|
68010
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68011
|
-
|
|
68012
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68013
|
-
|
|
68014
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68015
|
-
SELECT COUNT(*) is considered okay
|
|
68016
|
-
|
|
68017
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68018
|
-
|
|
68019
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68020
|
-
|
|
68021
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68022
|
-
|
|
68023
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68024
|
-
|
|
68025
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68026
|
-
|
|
68008
|
+
extendedInformation: `
|
|
68009
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68010
|
+
|
|
68011
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68012
|
+
|
|
68013
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68014
|
+
|
|
68015
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68016
|
+
|
|
68017
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68018
|
+
|
|
68019
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68020
|
+
|
|
68021
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68022
|
+
|
|
68023
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68024
|
+
|
|
68025
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68026
|
+
|
|
68027
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68028
|
+
|
|
68029
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68030
|
+
|
|
68031
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68032
|
+
|
|
68033
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68034
|
+
|
|
68035
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68036
|
+
|
|
68037
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68038
|
+
SELECT COUNT(*) is considered okay
|
|
68039
|
+
|
|
68040
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68041
|
+
|
|
68042
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68043
|
+
|
|
68044
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68045
|
+
|
|
68046
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68047
|
+
|
|
68048
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68049
|
+
|
|
68027
68050
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68028
|
-
badExample: `REFRESH itab.
|
|
68029
|
-
|
|
68030
|
-
COMPUTE foo = 2 + 2.
|
|
68031
|
-
|
|
68032
|
-
MULTIPLY lv_foo BY 2.
|
|
68033
|
-
|
|
68034
|
-
INTERFACE intf LOAD.
|
|
68035
|
-
|
|
68036
|
-
IF foo IS SUPPLIED.
|
|
68051
|
+
badExample: `REFRESH itab.
|
|
68052
|
+
|
|
68053
|
+
COMPUTE foo = 2 + 2.
|
|
68054
|
+
|
|
68055
|
+
MULTIPLY lv_foo BY 2.
|
|
68056
|
+
|
|
68057
|
+
INTERFACE intf LOAD.
|
|
68058
|
+
|
|
68059
|
+
IF foo IS SUPPLIED.
|
|
68037
68060
|
ENDIF.`,
|
|
68038
68061
|
};
|
|
68039
68062
|
}
|
|
@@ -68373,9 +68396,9 @@ class OmitParameterName {
|
|
|
68373
68396
|
key: "omit_parameter_name",
|
|
68374
68397
|
title: "Omit parameter name",
|
|
68375
68398
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68376
|
-
extendedInformation: `
|
|
68377
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68378
|
-
|
|
68399
|
+
extendedInformation: `
|
|
68400
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68401
|
+
|
|
68379
68402
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68380
68403
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68381
68404
|
badExample: `method( param = 2 ).`,
|
|
@@ -68581,20 +68604,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68581
68604
|
shortDescription: `Omit RECEIVING`,
|
|
68582
68605
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68583
68606
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68584
|
-
badExample: `
|
|
68585
|
-
upload_pack(
|
|
68586
|
-
EXPORTING
|
|
68587
|
-
io_client = lo_client
|
|
68588
|
-
iv_url = iv_url
|
|
68589
|
-
iv_deepen_level = iv_deepen_level
|
|
68590
|
-
it_hashes = lt_hashes
|
|
68591
|
-
RECEIVING
|
|
68607
|
+
badExample: `
|
|
68608
|
+
upload_pack(
|
|
68609
|
+
EXPORTING
|
|
68610
|
+
io_client = lo_client
|
|
68611
|
+
iv_url = iv_url
|
|
68612
|
+
iv_deepen_level = iv_deepen_level
|
|
68613
|
+
it_hashes = lt_hashes
|
|
68614
|
+
RECEIVING
|
|
68592
68615
|
rt_objects = et_objects ).`,
|
|
68593
|
-
goodExample: `
|
|
68594
|
-
et_objects = upload_pack(
|
|
68595
|
-
io_client = lo_client
|
|
68596
|
-
iv_url = iv_url
|
|
68597
|
-
iv_deepen_level = iv_deepen_level
|
|
68616
|
+
goodExample: `
|
|
68617
|
+
et_objects = upload_pack(
|
|
68618
|
+
io_client = lo_client
|
|
68619
|
+
iv_url = iv_url
|
|
68620
|
+
iv_deepen_level = iv_deepen_level
|
|
68598
68621
|
it_hashes = lt_hashes ).`,
|
|
68599
68622
|
};
|
|
68600
68623
|
}
|
|
@@ -68658,8 +68681,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68658
68681
|
return {
|
|
68659
68682
|
key: "parser_702_chaining",
|
|
68660
68683
|
title: "Parser Error, bad chanining on 702",
|
|
68661
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68662
|
-
this rule finds these and reports errors.
|
|
68684
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68685
|
+
this rule finds these and reports errors.
|
|
68663
68686
|
Only active on target version 702 and below.`,
|
|
68664
68687
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68665
68688
|
};
|
|
@@ -68739,8 +68762,8 @@ class ParserError {
|
|
|
68739
68762
|
return {
|
|
68740
68763
|
key: "parser_error",
|
|
68741
68764
|
title: "Parser error",
|
|
68742
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68743
|
-
|
|
68765
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68766
|
+
|
|
68744
68767
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68745
68768
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68746
68769
|
};
|
|
@@ -68825,7 +68848,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68825
68848
|
return {
|
|
68826
68849
|
key: "parser_missing_space",
|
|
68827
68850
|
title: "Parser Error, missing space",
|
|
68828
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68851
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68829
68852
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68830
68853
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68831
68854
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69237,25 +69260,25 @@ class PreferInline {
|
|
|
69237
69260
|
key: "prefer_inline",
|
|
69238
69261
|
title: "Prefer Inline Declarations",
|
|
69239
69262
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69240
|
-
extendedInformation: `EXPERIMENTAL
|
|
69241
|
-
|
|
69242
|
-
Activates if language version is v740sp02 or above.
|
|
69243
|
-
|
|
69244
|
-
Variables must be local(METHOD or FORM).
|
|
69245
|
-
|
|
69246
|
-
No generic or void typed variables. No syntax errors.
|
|
69247
|
-
|
|
69248
|
-
First position used must be a full/pure write.
|
|
69249
|
-
|
|
69250
|
-
Move statment is not a cast(?=)
|
|
69251
|
-
|
|
69263
|
+
extendedInformation: `EXPERIMENTAL
|
|
69264
|
+
|
|
69265
|
+
Activates if language version is v740sp02 or above.
|
|
69266
|
+
|
|
69267
|
+
Variables must be local(METHOD or FORM).
|
|
69268
|
+
|
|
69269
|
+
No generic or void typed variables. No syntax errors.
|
|
69270
|
+
|
|
69271
|
+
First position used must be a full/pure write.
|
|
69272
|
+
|
|
69273
|
+
Move statment is not a cast(?=)
|
|
69274
|
+
|
|
69252
69275
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69253
69276
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69254
|
-
badExample: `DATA foo TYPE i.
|
|
69255
|
-
foo = 2.
|
|
69256
|
-
DATA percentage TYPE decfloat34.
|
|
69277
|
+
badExample: `DATA foo TYPE i.
|
|
69278
|
+
foo = 2.
|
|
69279
|
+
DATA percentage TYPE decfloat34.
|
|
69257
69280
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69258
|
-
goodExample: `DATA(foo) = 2.
|
|
69281
|
+
goodExample: `DATA(foo) = 2.
|
|
69259
69282
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69260
69283
|
};
|
|
69261
69284
|
}
|
|
@@ -69469,18 +69492,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69469
69492
|
key: "prefer_is_not",
|
|
69470
69493
|
title: "Prefer IS NOT to NOT IS",
|
|
69471
69494
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69472
|
-
extendedInformation: `
|
|
69473
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69474
|
-
|
|
69495
|
+
extendedInformation: `
|
|
69496
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69497
|
+
|
|
69475
69498
|
"if not is_valid( )." examples are skipped`,
|
|
69476
69499
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69477
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69478
|
-
IF variable NP 'TODO*'.
|
|
69479
|
-
IF variable <> 42.
|
|
69500
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69501
|
+
IF variable NP 'TODO*'.
|
|
69502
|
+
IF variable <> 42.
|
|
69480
69503
|
IF variable CO 'hello'.`,
|
|
69481
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69482
|
-
IF NOT variable CP 'TODO*'.
|
|
69483
|
-
IF NOT variable = 42.
|
|
69504
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69505
|
+
IF NOT variable CP 'TODO*'.
|
|
69506
|
+
IF NOT variable = 42.
|
|
69484
69507
|
IF NOT variable CA 'hello'.`,
|
|
69485
69508
|
};
|
|
69486
69509
|
}
|
|
@@ -69668,14 +69691,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69668
69691
|
key: "prefer_raise_exception_new",
|
|
69669
69692
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69670
69693
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69671
|
-
extendedInformation: `
|
|
69672
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69673
|
-
|
|
69694
|
+
extendedInformation: `
|
|
69695
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69696
|
+
|
|
69674
69697
|
From 752 and up`,
|
|
69675
69698
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69676
69699
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69677
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69678
|
-
EXPORTING
|
|
69700
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69701
|
+
EXPORTING
|
|
69679
69702
|
previous = exception.`,
|
|
69680
69703
|
};
|
|
69681
69704
|
}
|
|
@@ -69753,12 +69776,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69753
69776
|
key: "prefer_returning_to_exporting",
|
|
69754
69777
|
title: "Prefer RETURNING to EXPORTING",
|
|
69755
69778
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69756
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69779
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69757
69780
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69758
69781
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69759
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69760
|
-
PUBLIC SECTION.
|
|
69761
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69782
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69783
|
+
PUBLIC SECTION.
|
|
69784
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69762
69785
|
ENDCLASS.`,
|
|
69763
69786
|
};
|
|
69764
69787
|
}
|
|
@@ -69854,8 +69877,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69854
69877
|
key: "prefer_xsdbool",
|
|
69855
69878
|
title: "Prefer xsdbool over boolc",
|
|
69856
69879
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69857
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69858
|
-
|
|
69880
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69881
|
+
|
|
69859
69882
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69860
69883
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69861
69884
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69927,9 +69950,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69927
69950
|
title: "Preferred compare operator",
|
|
69928
69951
|
shortDescription: `Configure undesired operator variants`,
|
|
69929
69952
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69930
|
-
badExample: `IF foo EQ bar.
|
|
69953
|
+
badExample: `IF foo EQ bar.
|
|
69931
69954
|
ENDIF.`,
|
|
69932
|
-
goodExample: `IF foo = bar.
|
|
69955
|
+
goodExample: `IF foo = bar.
|
|
69933
69956
|
ENDIF.`,
|
|
69934
69957
|
};
|
|
69935
69958
|
}
|
|
@@ -70153,26 +70176,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70153
70176
|
key: "reduce_procedural_code",
|
|
70154
70177
|
title: "Reduce procedural code",
|
|
70155
70178
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70156
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70157
|
-
|
|
70158
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70159
|
-
|
|
70179
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70180
|
+
|
|
70181
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70182
|
+
|
|
70160
70183
|
Comments are not counted as statements.`,
|
|
70161
70184
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70162
|
-
badExample: `FORM foo.
|
|
70163
|
-
DATA lv_bar TYPE i.
|
|
70164
|
-
lv_bar = 2 + 2.
|
|
70165
|
-
IF lv_bar = 4.
|
|
70166
|
-
WRITE 'hello world'.
|
|
70167
|
-
ENDIF.
|
|
70168
|
-
DATA lv_bar TYPE i.
|
|
70169
|
-
lv_bar = 2 + 2.
|
|
70170
|
-
IF lv_bar = 4.
|
|
70171
|
-
WRITE 'hello world'.
|
|
70172
|
-
ENDIF.
|
|
70185
|
+
badExample: `FORM foo.
|
|
70186
|
+
DATA lv_bar TYPE i.
|
|
70187
|
+
lv_bar = 2 + 2.
|
|
70188
|
+
IF lv_bar = 4.
|
|
70189
|
+
WRITE 'hello world'.
|
|
70190
|
+
ENDIF.
|
|
70191
|
+
DATA lv_bar TYPE i.
|
|
70192
|
+
lv_bar = 2 + 2.
|
|
70193
|
+
IF lv_bar = 4.
|
|
70194
|
+
WRITE 'hello world'.
|
|
70195
|
+
ENDIF.
|
|
70173
70196
|
ENDFORM.`,
|
|
70174
|
-
goodExample: `FORM foo.
|
|
70175
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70197
|
+
goodExample: `FORM foo.
|
|
70198
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70176
70199
|
ENDFORM.`,
|
|
70177
70200
|
};
|
|
70178
70201
|
}
|
|
@@ -70416,10 +70439,10 @@ class RemoveDescriptions {
|
|
|
70416
70439
|
return {
|
|
70417
70440
|
key: "remove_descriptions",
|
|
70418
70441
|
title: "Remove descriptions",
|
|
70419
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70420
|
-
|
|
70421
|
-
Class descriptions are required, see rule description_empty.
|
|
70422
|
-
|
|
70442
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70443
|
+
|
|
70444
|
+
Class descriptions are required, see rule description_empty.
|
|
70445
|
+
|
|
70423
70446
|
Consider using ABAP Doc for documentation.`,
|
|
70424
70447
|
tags: [],
|
|
70425
70448
|
};
|
|
@@ -70544,14 +70567,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70544
70567
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70545
70568
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70546
70569
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70547
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70570
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70548
70571
|
DESTINATION lv_rfc.`,
|
|
70549
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70550
|
-
DESTINATION lv_rfc
|
|
70551
|
-
EXCEPTIONS
|
|
70552
|
-
system_failure = 1 MESSAGE msg
|
|
70553
|
-
communication_failure = 2 MESSAGE msg
|
|
70554
|
-
resource_failure = 3
|
|
70572
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70573
|
+
DESTINATION lv_rfc
|
|
70574
|
+
EXCEPTIONS
|
|
70575
|
+
system_failure = 1 MESSAGE msg
|
|
70576
|
+
communication_failure = 2 MESSAGE msg
|
|
70577
|
+
resource_failure = 3
|
|
70555
70578
|
OTHERS = 4.`,
|
|
70556
70579
|
};
|
|
70557
70580
|
}
|
|
@@ -70635,11 +70658,11 @@ class SelectAddOrderBy {
|
|
|
70635
70658
|
key: "select_add_order_by",
|
|
70636
70659
|
title: "SELECT add ORDER BY",
|
|
70637
70660
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70638
|
-
extendedInformation: `
|
|
70639
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70640
|
-
|
|
70641
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70642
|
-
|
|
70661
|
+
extendedInformation: `
|
|
70662
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70663
|
+
|
|
70664
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70665
|
+
|
|
70643
70666
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70644
70667
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70645
70668
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70770,14 +70793,14 @@ class SelectPerformance {
|
|
|
70770
70793
|
key: "select_performance",
|
|
70771
70794
|
title: "SELECT performance",
|
|
70772
70795
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70773
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70774
|
-
|
|
70796
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70797
|
+
|
|
70775
70798
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70776
70799
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70777
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70778
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70800
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70801
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70779
70802
|
ENDSELECT.`,
|
|
70780
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70803
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70781
70804
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70782
70805
|
};
|
|
70783
70806
|
}
|
|
@@ -70891,8 +70914,8 @@ class SelectSingleFullKey {
|
|
|
70891
70914
|
key: "select_single_full_key",
|
|
70892
70915
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70893
70916
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70894
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70895
|
-
|
|
70917
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70918
|
+
|
|
70896
70919
|
If the statement contains a JOIN it is not checked`,
|
|
70897
70920
|
pseudoComment: "EC CI_NOORDER",
|
|
70898
70921
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71316,8 +71339,8 @@ class SICFConsistency {
|
|
|
71316
71339
|
key: "sicf_consistency",
|
|
71317
71340
|
title: "SICF consistency",
|
|
71318
71341
|
shortDescription: `Checks the validity of ICF services`,
|
|
71319
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71320
|
-
* Class must not have any syntax errors
|
|
71342
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71343
|
+
* Class must not have any syntax errors
|
|
71321
71344
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71322
71345
|
};
|
|
71323
71346
|
}
|
|
@@ -71429,23 +71452,23 @@ class SlowParameterPassing {
|
|
|
71429
71452
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71430
71453
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71431
71454
|
tags: [_irule_1.RuleTag.Performance],
|
|
71432
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71433
|
-
PUBLIC SECTION.
|
|
71434
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71435
|
-
ENDCLASS.
|
|
71436
|
-
CLASS lcl IMPLEMENTATION.
|
|
71437
|
-
METHOD bar.
|
|
71438
|
-
WRITE sdf.
|
|
71439
|
-
ENDMETHOD.
|
|
71455
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71456
|
+
PUBLIC SECTION.
|
|
71457
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71458
|
+
ENDCLASS.
|
|
71459
|
+
CLASS lcl IMPLEMENTATION.
|
|
71460
|
+
METHOD bar.
|
|
71461
|
+
WRITE sdf.
|
|
71462
|
+
ENDMETHOD.
|
|
71440
71463
|
ENDCLASS.`,
|
|
71441
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71442
|
-
PUBLIC SECTION.
|
|
71443
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71444
|
-
ENDCLASS.
|
|
71445
|
-
CLASS lcl IMPLEMENTATION.
|
|
71446
|
-
METHOD bar.
|
|
71447
|
-
WRITE sdf.
|
|
71448
|
-
ENDMETHOD.
|
|
71464
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71465
|
+
PUBLIC SECTION.
|
|
71466
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71467
|
+
ENDCLASS.
|
|
71468
|
+
CLASS lcl IMPLEMENTATION.
|
|
71469
|
+
METHOD bar.
|
|
71470
|
+
WRITE sdf.
|
|
71471
|
+
ENDMETHOD.
|
|
71449
71472
|
ENDCLASS.`,
|
|
71450
71473
|
};
|
|
71451
71474
|
}
|
|
@@ -71702,8 +71725,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71702
71725
|
key: "space_before_dot",
|
|
71703
71726
|
title: "Space before dot",
|
|
71704
71727
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71705
|
-
extendedInformation: `
|
|
71706
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71728
|
+
extendedInformation: `
|
|
71729
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71707
71730
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71708
71731
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71709
71732
|
badExample: `WRITE bar .`,
|
|
@@ -71889,12 +71912,12 @@ class SQLValueConversion {
|
|
|
71889
71912
|
key: "sql_value_conversion",
|
|
71890
71913
|
title: "Implicit SQL Value Conversion",
|
|
71891
71914
|
shortDescription: `Ensure types match when selecting from database`,
|
|
71892
|
-
extendedInformation: `
|
|
71893
|
-
* Integer to CHAR conversion
|
|
71894
|
-
* Integer to NUMC conversion
|
|
71895
|
-
* NUMC to Integer conversion
|
|
71896
|
-
* CHAR to Integer conversion
|
|
71897
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
71915
|
+
extendedInformation: `
|
|
71916
|
+
* Integer to CHAR conversion
|
|
71917
|
+
* Integer to NUMC conversion
|
|
71918
|
+
* NUMC to Integer conversion
|
|
71919
|
+
* CHAR to Integer conversion
|
|
71920
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71898
71921
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71899
71922
|
tags: [],
|
|
71900
71923
|
};
|
|
@@ -71966,7 +71989,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
71966
71989
|
key: "start_at_tab",
|
|
71967
71990
|
title: "Start at tab",
|
|
71968
71991
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
71969
|
-
extendedInformation: `Reports max 100 issues per file
|
|
71992
|
+
extendedInformation: `Reports max 100 issues per file
|
|
71970
71993
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
71971
71994
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71972
71995
|
badExample: ` WRITE a.`,
|
|
@@ -72143,12 +72166,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72143
72166
|
key: "strict_sql",
|
|
72144
72167
|
title: "Strict SQL",
|
|
72145
72168
|
shortDescription: `Strict SQL`,
|
|
72146
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72147
|
-
|
|
72148
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72149
|
-
|
|
72150
|
-
Also see separate rule sql_escape_host_variables
|
|
72151
|
-
|
|
72169
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72170
|
+
|
|
72171
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72172
|
+
|
|
72173
|
+
Also see separate rule sql_escape_host_variables
|
|
72174
|
+
|
|
72152
72175
|
Activates from v750 and up`,
|
|
72153
72176
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72154
72177
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72402,11 +72425,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72402
72425
|
key: "sy_modification",
|
|
72403
72426
|
title: "Modification of SY fields",
|
|
72404
72427
|
shortDescription: `Finds modification of sy fields`,
|
|
72405
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72406
|
-
|
|
72428
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72429
|
+
|
|
72407
72430
|
Changes to SY-TVAR* fields are not reported`,
|
|
72408
72431
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72409
|
-
badExample: `sy-uname = 2.
|
|
72432
|
+
badExample: `sy-uname = 2.
|
|
72410
72433
|
sy = sy.`,
|
|
72411
72434
|
};
|
|
72412
72435
|
}
|
|
@@ -72468,8 +72491,8 @@ class TABLEnhancementCategory {
|
|
|
72468
72491
|
key: "tabl_enhancement_category",
|
|
72469
72492
|
title: "TABL enhancement category must be set",
|
|
72470
72493
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72471
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72472
|
-
|
|
72494
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72495
|
+
|
|
72473
72496
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72474
72497
|
tags: [],
|
|
72475
72498
|
};
|
|
@@ -72534,8 +72557,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72534
72557
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72535
72558
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72536
72559
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72537
|
-
badExample: `FORM foo.
|
|
72538
|
-
TABLES t100.
|
|
72560
|
+
badExample: `FORM foo.
|
|
72561
|
+
TABLES t100.
|
|
72539
72562
|
ENDFORM.`,
|
|
72540
72563
|
goodExample: `TABLES t000.`,
|
|
72541
72564
|
};
|
|
@@ -72663,9 +72686,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72663
72686
|
title: "Type FORM parameters",
|
|
72664
72687
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72665
72688
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72666
|
-
badExample: `FORM foo USING bar.
|
|
72689
|
+
badExample: `FORM foo USING bar.
|
|
72667
72690
|
ENDFORM.`,
|
|
72668
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72691
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72669
72692
|
ENDFORM.`,
|
|
72670
72693
|
};
|
|
72671
72694
|
}
|
|
@@ -73338,38 +73361,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73338
73361
|
key: "unnecessary_pragma",
|
|
73339
73362
|
title: "Unnecessary Pragma",
|
|
73340
73363
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73341
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73342
|
-
|
|
73343
|
-
* NEEDED without definition
|
|
73344
|
-
|
|
73345
|
-
* NO_TEXT without texts
|
|
73346
|
-
|
|
73347
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73348
|
-
|
|
73364
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73365
|
+
|
|
73366
|
+
* NEEDED without definition
|
|
73367
|
+
|
|
73368
|
+
* NO_TEXT without texts
|
|
73369
|
+
|
|
73370
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73371
|
+
|
|
73349
73372
|
NO_HANDLER inside macros are not checked`,
|
|
73350
73373
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73351
|
-
badExample: `TRY.
|
|
73352
|
-
...
|
|
73353
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73354
|
-
RETURN. " it has a handler
|
|
73355
|
-
ENDTRY.
|
|
73356
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73357
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73358
|
-
IF sy-subrc <> 0.
|
|
73374
|
+
badExample: `TRY.
|
|
73375
|
+
...
|
|
73376
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73377
|
+
RETURN. " it has a handler
|
|
73378
|
+
ENDTRY.
|
|
73379
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73380
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73381
|
+
IF sy-subrc <> 0.
|
|
73359
73382
|
ENDIF.`,
|
|
73360
|
-
goodExample: `TRY.
|
|
73361
|
-
...
|
|
73362
|
-
CATCH zcx_abapgit_exception.
|
|
73363
|
-
RETURN.
|
|
73364
|
-
ENDTRY.
|
|
73365
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73366
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73367
|
-
IF sy-subrc <> 0.
|
|
73368
|
-
ENDIF.
|
|
73369
|
-
|
|
73370
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73371
|
-
test1 TYPE string,
|
|
73372
|
-
test2 TYPE string,
|
|
73383
|
+
goodExample: `TRY.
|
|
73384
|
+
...
|
|
73385
|
+
CATCH zcx_abapgit_exception.
|
|
73386
|
+
RETURN.
|
|
73387
|
+
ENDTRY.
|
|
73388
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73389
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73390
|
+
IF sy-subrc <> 0.
|
|
73391
|
+
ENDIF.
|
|
73392
|
+
|
|
73393
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73394
|
+
test1 TYPE string,
|
|
73395
|
+
test2 TYPE string,
|
|
73373
73396
|
END OF blah.`,
|
|
73374
73397
|
};
|
|
73375
73398
|
}
|
|
@@ -73536,18 +73559,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73536
73559
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73537
73560
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73538
73561
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73539
|
-
badExample: `FORM hello1.
|
|
73540
|
-
WRITE 'world'.
|
|
73541
|
-
RETURN.
|
|
73542
|
-
ENDFORM.
|
|
73543
|
-
|
|
73544
|
-
FORM foo.
|
|
73545
|
-
IF 1 = 2.
|
|
73546
|
-
RETURN.
|
|
73547
|
-
ENDIF.
|
|
73562
|
+
badExample: `FORM hello1.
|
|
73563
|
+
WRITE 'world'.
|
|
73564
|
+
RETURN.
|
|
73565
|
+
ENDFORM.
|
|
73566
|
+
|
|
73567
|
+
FORM foo.
|
|
73568
|
+
IF 1 = 2.
|
|
73569
|
+
RETURN.
|
|
73570
|
+
ENDIF.
|
|
73548
73571
|
ENDFORM.`,
|
|
73549
|
-
goodExample: `FORM hello2.
|
|
73550
|
-
WRITE 'world'.
|
|
73572
|
+
goodExample: `FORM hello2.
|
|
73573
|
+
WRITE 'world'.
|
|
73551
73574
|
ENDFORM.`,
|
|
73552
73575
|
};
|
|
73553
73576
|
}
|
|
@@ -73898,13 +73921,13 @@ class UnusedMacros {
|
|
|
73898
73921
|
title: "Unused macros",
|
|
73899
73922
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73900
73923
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73901
|
-
badExample: `DEFINE foobar1.
|
|
73902
|
-
WRITE 'hello'.
|
|
73924
|
+
badExample: `DEFINE foobar1.
|
|
73925
|
+
WRITE 'hello'.
|
|
73903
73926
|
END-OF-DEFINITION.`,
|
|
73904
|
-
goodExample: `DEFINE foobar2.
|
|
73905
|
-
WRITE 'hello'.
|
|
73906
|
-
END-OF-DEFINITION.
|
|
73907
|
-
|
|
73927
|
+
goodExample: `DEFINE foobar2.
|
|
73928
|
+
WRITE 'hello'.
|
|
73929
|
+
END-OF-DEFINITION.
|
|
73930
|
+
|
|
73908
73931
|
foobar2.`,
|
|
73909
73932
|
};
|
|
73910
73933
|
}
|
|
@@ -74016,18 +74039,18 @@ class UnusedMethods {
|
|
|
74016
74039
|
key: "unused_methods",
|
|
74017
74040
|
title: "Unused methods",
|
|
74018
74041
|
shortDescription: `Checks for unused methods`,
|
|
74019
|
-
extendedInformation: `Checks private and protected methods.
|
|
74020
|
-
|
|
74021
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74022
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74023
|
-
|
|
74024
|
-
Skips:
|
|
74025
|
-
* methods FOR TESTING
|
|
74026
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74027
|
-
* class_constructor + constructor methods
|
|
74028
|
-
* event handlers
|
|
74029
|
-
* methods that are redefined
|
|
74030
|
-
* INCLUDEs
|
|
74042
|
+
extendedInformation: `Checks private and protected methods.
|
|
74043
|
+
|
|
74044
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74045
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74046
|
+
|
|
74047
|
+
Skips:
|
|
74048
|
+
* methods FOR TESTING
|
|
74049
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74050
|
+
* class_constructor + constructor methods
|
|
74051
|
+
* event handlers
|
|
74052
|
+
* methods that are redefined
|
|
74053
|
+
* INCLUDEs
|
|
74031
74054
|
`,
|
|
74032
74055
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74033
74056
|
pragma: "##CALLED",
|
|
@@ -74503,23 +74526,23 @@ class UnusedVariables {
|
|
|
74503
74526
|
key: "unused_variables",
|
|
74504
74527
|
title: "Unused variables",
|
|
74505
74528
|
shortDescription: `Checks for unused variables and constants`,
|
|
74506
|
-
extendedInformation: `Skips event parameters.
|
|
74507
|
-
|
|
74508
|
-
Note that this currently does not work if the source code uses macros.
|
|
74509
|
-
|
|
74510
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74511
|
-
|
|
74529
|
+
extendedInformation: `Skips event parameters.
|
|
74530
|
+
|
|
74531
|
+
Note that this currently does not work if the source code uses macros.
|
|
74532
|
+
|
|
74533
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74534
|
+
|
|
74512
74535
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74513
74536
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74514
74537
|
pragma: "##NEEDED",
|
|
74515
74538
|
pseudoComment: "EC NEEDED",
|
|
74516
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74517
|
-
test TYPE string,
|
|
74518
|
-
test2 TYPE string,
|
|
74539
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74540
|
+
test TYPE string,
|
|
74541
|
+
test2 TYPE string,
|
|
74519
74542
|
END OF blah1.`,
|
|
74520
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74521
|
-
test TYPE string,
|
|
74522
|
-
test2 TYPE string,
|
|
74543
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74544
|
+
test TYPE string,
|
|
74545
|
+
test2 TYPE string,
|
|
74523
74546
|
END OF blah2.`,
|
|
74524
74547
|
};
|
|
74525
74548
|
}
|
|
@@ -74738,15 +74761,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74738
74761
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74739
74762
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74740
74763
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74741
|
-
badExample: `IF line IS INITIAL.
|
|
74742
|
-
has_entries = abap_false.
|
|
74743
|
-
ELSE.
|
|
74744
|
-
has_entries = abap_true.
|
|
74745
|
-
ENDIF.
|
|
74746
|
-
|
|
74764
|
+
badExample: `IF line IS INITIAL.
|
|
74765
|
+
has_entries = abap_false.
|
|
74766
|
+
ELSE.
|
|
74767
|
+
has_entries = abap_true.
|
|
74768
|
+
ENDIF.
|
|
74769
|
+
|
|
74747
74770
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74748
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74749
|
-
|
|
74771
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74772
|
+
|
|
74750
74773
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74751
74774
|
};
|
|
74752
74775
|
}
|
|
@@ -74864,15 +74887,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74864
74887
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74865
74888
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74866
74889
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74867
|
-
badExample: `INTERFACE lif.
|
|
74868
|
-
METHODS load_data
|
|
74869
|
-
EXCEPTIONS
|
|
74870
|
-
invalid_parameter.
|
|
74890
|
+
badExample: `INTERFACE lif.
|
|
74891
|
+
METHODS load_data
|
|
74892
|
+
EXCEPTIONS
|
|
74893
|
+
invalid_parameter.
|
|
74871
74894
|
ENDINTERFACE.`,
|
|
74872
|
-
goodExample: `INTERFACE lif.
|
|
74873
|
-
METHODS load_data
|
|
74874
|
-
RAISING
|
|
74875
|
-
cx_something.
|
|
74895
|
+
goodExample: `INTERFACE lif.
|
|
74896
|
+
METHODS load_data
|
|
74897
|
+
RAISING
|
|
74898
|
+
cx_something.
|
|
74876
74899
|
ENDINTERFACE.`,
|
|
74877
74900
|
};
|
|
74878
74901
|
}
|
|
@@ -74932,15 +74955,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74932
74955
|
key: "use_line_exists",
|
|
74933
74956
|
title: "Use line_exists",
|
|
74934
74957
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
74935
|
-
extendedInformation: `
|
|
74936
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74937
|
-
|
|
74958
|
+
extendedInformation: `
|
|
74959
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74960
|
+
|
|
74938
74961
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
74939
74962
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74940
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74941
|
-
IF sy-subrc = 0.
|
|
74963
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74964
|
+
IF sy-subrc = 0.
|
|
74942
74965
|
ENDIF.`,
|
|
74943
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74966
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74944
74967
|
ENDIF.`,
|
|
74945
74968
|
};
|
|
74946
74969
|
}
|
|
@@ -75050,10 +75073,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75050
75073
|
key: "use_new",
|
|
75051
75074
|
title: "Use NEW",
|
|
75052
75075
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75053
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75054
|
-
|
|
75055
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75056
|
-
|
|
75076
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75077
|
+
|
|
75078
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75079
|
+
|
|
75057
75080
|
Applicable from v740sp02 and up`,
|
|
75058
75081
|
badExample: `CREATE OBJECT ref.`,
|
|
75059
75082
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75151,13 +75174,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75151
75174
|
title: "WHEN OTHERS last",
|
|
75152
75175
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75153
75176
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75154
|
-
badExample: `CASE bar.
|
|
75155
|
-
WHEN OTHERS.
|
|
75156
|
-
WHEN 2.
|
|
75177
|
+
badExample: `CASE bar.
|
|
75178
|
+
WHEN OTHERS.
|
|
75179
|
+
WHEN 2.
|
|
75157
75180
|
ENDCASE.`,
|
|
75158
|
-
goodExample: `CASE bar.
|
|
75159
|
-
WHEN 2.
|
|
75160
|
-
WHEN OTHERS.
|
|
75181
|
+
goodExample: `CASE bar.
|
|
75182
|
+
WHEN 2.
|
|
75183
|
+
WHEN OTHERS.
|
|
75161
75184
|
ENDCASE.`,
|
|
75162
75185
|
};
|
|
75163
75186
|
}
|