@abaplint/cli 2.113.85 → 2.113.86
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 +857 -857
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -10201,7 +10201,7 @@ class Assign {
|
|
|
10201
10201
|
const decimals = (0, combi_1.seq)("DECIMALS", expressions_1.Source);
|
|
10202
10202
|
const casting = (0, combi_1.seq)("CASTING", (0, combi_1.opt)((0, combi_1.alt)(like, handle, (0, combi_1.per)(type, decimals))));
|
|
10203
10203
|
const obsoleteType = (0, combi_1.seq)("TYPE", expressions_1.Source, (0, combi_1.optPrio)(decimals));
|
|
10204
|
-
const ret = (0, combi_1.seq)("ASSIGN", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, "INCREMENT")), expressions_1.AssignSource, "TO", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType)), (0, combi_1.opt)(range), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v757, "ELSE UNASSIGN")));
|
|
10204
|
+
const ret = (0, combi_1.seq)("ASSIGN", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, "INCREMENT")), expressions_1.AssignSource, "TO", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType, decimals)), (0, combi_1.opt)(range), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v757, "ELSE UNASSIGN")));
|
|
10205
10205
|
return ret;
|
|
10206
10206
|
}
|
|
10207
10207
|
}
|
|
@@ -10681,7 +10681,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
|
|
|
10681
10681
|
class CallOLE {
|
|
10682
10682
|
getMatcher() {
|
|
10683
10683
|
const rc = (0, combi_1.seq)("=", expressions_1.Target);
|
|
10684
|
-
const ret = (0, combi_1.seq)("CALL METHOD OF", expressions_1.Source, expressions_1.Source, (0, combi_1.opt)(rc), (0, combi_1.opt)("NO FLUSH"), (0, combi_1.opt)("
|
|
10684
|
+
const ret = (0, combi_1.seq)("CALL METHOD OF", expressions_1.Source, expressions_1.Source, (0, combi_1.opt)(rc), (0, combi_1.opt)("NO FLUSH"), (0, combi_1.opt)("QUEUE-ONLY"), (0, combi_1.opt)(expressions_1.OLEExporting));
|
|
10685
10685
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
10686
10686
|
}
|
|
10687
10687
|
}
|
|
@@ -13753,7 +13753,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
13753
13753
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
13754
13754
|
class GetProperty {
|
|
13755
13755
|
getMatcher() {
|
|
13756
|
-
const ret = (0, combi_1.seq)("GET PROPERTY OF", expressions_1.FieldSub, expressions_1.Source, "=", expressions_1.Source, (0, combi_1.opt)("NO FLUSH"), (0, combi_1.opt)("
|
|
13756
|
+
const ret = (0, combi_1.seq)("GET PROPERTY OF", expressions_1.FieldSub, expressions_1.Source, "=", expressions_1.Source, (0, combi_1.opt)("NO FLUSH"), (0, combi_1.opt)("QUEUE-ONLY"), (0, combi_1.opt)(expressions_1.OLEExporting));
|
|
13757
13757
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
13758
13758
|
}
|
|
13759
13759
|
}
|
|
@@ -15033,7 +15033,7 @@ class ModifyLine {
|
|
|
15033
15033
|
getMatcher() {
|
|
15034
15034
|
const onOff = (0, combi_1.alt)("ON", "OFF");
|
|
15035
15035
|
const eq = (0, combi_1.seq)("=", expressions_1.Source);
|
|
15036
|
-
const form = (0, combi_1.seq)((0, combi_1.alt)("INVERSE", "INPUT", "COLOR"), (0, combi_1.alt)(eq, onOff));
|
|
15036
|
+
const form = (0, combi_1.seq)((0, combi_1.alt)("INVERSE", "INPUT", "COLOR", "HOTSPOT"), (0, combi_1.alt)(eq, onOff));
|
|
15037
15037
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
15038
15038
|
const value = (0, combi_1.seq)("FIELD VALUE", (0, combi_1.plus)((0, combi_1.seq)(expressions_1.Source, (0, combi_1.optPrio)(from))));
|
|
15039
15039
|
const format = (0, combi_1.seq)("FIELD FORMAT", expressions_1.Source, (0, combi_1.opt)(form));
|
|
@@ -16378,7 +16378,8 @@ class ScrollList {
|
|
|
16378
16378
|
const line = (0, combi_1.seq)("LINE", expressions_1.Source);
|
|
16379
16379
|
const column = (0, combi_1.seq)("TO COLUMN", expressions_1.Source);
|
|
16380
16380
|
const to = (0, combi_1.seq)("TO", (0, combi_1.alt)("FIRST PAGE", "LAST PAGE", (0, combi_1.seq)("PAGE", expressions_1.Source)));
|
|
16381
|
-
const
|
|
16381
|
+
const pages = (0, combi_1.seq)(expressions_1.Source, "PAGES");
|
|
16382
|
+
const ret = (0, combi_1.seq)("SCROLL LIST", (0, combi_1.per)(index, (0, combi_1.seq)((0, combi_1.alt)(to, "BACKWARD", "FORWARD"), (0, combi_1.opt)(pages)), (0, combi_1.seq)((0, combi_1.alt)("LEFT", "RIGHT"), (0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.Source, "PLACES"))), column, line));
|
|
16382
16383
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
16383
16384
|
}
|
|
16384
16385
|
}
|
|
@@ -32007,12 +32008,11 @@ class Loop {
|
|
|
32007
32008
|
const message = "No source type determined";
|
|
32008
32009
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32009
32010
|
}
|
|
32010
|
-
return;
|
|
32011
32011
|
}
|
|
32012
32012
|
else if (sourceType instanceof basic_1.UnknownType) {
|
|
32013
32013
|
const message = "Loop, not a table type, " + sourceType.getError();
|
|
32014
32014
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32015
|
-
|
|
32015
|
+
sourceType = new basic_1.VoidType("Loop, not a table type");
|
|
32016
32016
|
}
|
|
32017
32017
|
else if (sourceType instanceof basic_1.TableType
|
|
32018
32018
|
&& target === undefined
|
|
@@ -32020,7 +32020,6 @@ class Loop {
|
|
|
32020
32020
|
&& node.getChildren().length === 4) {
|
|
32021
32021
|
const message = "Loop, no header line";
|
|
32022
32022
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32023
|
-
return;
|
|
32024
32023
|
}
|
|
32025
32024
|
else if (!(sourceType instanceof basic_1.TableType)
|
|
32026
32025
|
&& !(sourceType instanceof basic_1.AnyType)
|
|
@@ -32029,14 +32028,12 @@ class Loop {
|
|
|
32029
32028
|
&& concat.startsWith("LOOP AT GROUP ") === false) {
|
|
32030
32029
|
const message = "Loop, not a table type";
|
|
32031
32030
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32032
|
-
return;
|
|
32033
32031
|
}
|
|
32034
32032
|
else if (loopTarget === undefined
|
|
32035
32033
|
&& sourceType instanceof basic_1.TableType
|
|
32036
32034
|
&& sourceType.isWithHeader() === false) {
|
|
32037
32035
|
const message = "Loop, no header";
|
|
32038
32036
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32039
|
-
return;
|
|
32040
32037
|
}
|
|
32041
32038
|
const targetConcat = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.concatTokens().toUpperCase();
|
|
32042
32039
|
if (sourceType instanceof basic_1.TableType) {
|
|
@@ -35723,13 +35720,13 @@ class FlowGraph {
|
|
|
35723
35720
|
this.label = label;
|
|
35724
35721
|
}
|
|
35725
35722
|
toDigraph() {
|
|
35726
|
-
return `digraph G {
|
|
35727
|
-
labelloc="t";
|
|
35728
|
-
label="${this.label}";
|
|
35729
|
-
graph [fontname = "helvetica"];
|
|
35730
|
-
node [fontname = "helvetica", shape="box"];
|
|
35731
|
-
edge [fontname = "helvetica"];
|
|
35732
|
-
${this.toTextEdges()}
|
|
35723
|
+
return `digraph G {
|
|
35724
|
+
labelloc="t";
|
|
35725
|
+
label="${this.label}";
|
|
35726
|
+
graph [fontname = "helvetica"];
|
|
35727
|
+
node [fontname = "helvetica", shape="box"];
|
|
35728
|
+
edge [fontname = "helvetica"];
|
|
35729
|
+
${this.toTextEdges()}
|
|
35733
35730
|
}`;
|
|
35734
35731
|
}
|
|
35735
35732
|
listSources(node) {
|
|
@@ -44152,13 +44149,13 @@ class Help {
|
|
|
44152
44149
|
/////////////////////////////////////////////////
|
|
44153
44150
|
static dumpABAP(file, reg, textDocument, position) {
|
|
44154
44151
|
let content = "";
|
|
44155
|
-
content = `
|
|
44156
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
44157
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
44158
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
44159
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
44160
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
44161
|
-
<hr>
|
|
44152
|
+
content = `
|
|
44153
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
44154
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
44155
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
44156
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
44157
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
44158
|
+
<hr>
|
|
44162
44159
|
` +
|
|
44163
44160
|
"<tt>" + textDocument.uri + " (" +
|
|
44164
44161
|
(position.line + 1) + ", " +
|
|
@@ -44313,9 +44310,9 @@ class Help {
|
|
|
44313
44310
|
return ret + "</ul>";
|
|
44314
44311
|
}
|
|
44315
44312
|
static tokens(file) {
|
|
44316
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
44317
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
44318
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
44313
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
44314
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
44315
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
44319
44316
|
</tr>`;
|
|
44320
44317
|
for (const token of file.getTokens()) {
|
|
44321
44318
|
const tStart = token.getStart();
|
|
@@ -45536,7 +45533,10 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
|
|
|
45536
45533
|
}
|
|
45537
45534
|
// uri fallback,
|
|
45538
45535
|
for (const file of this.getABAPFiles()) {
|
|
45539
|
-
if (file.getFilename().
|
|
45536
|
+
if (file.getFilename().includes(".prog.screen_")) {
|
|
45537
|
+
continue;
|
|
45538
|
+
}
|
|
45539
|
+
else if (file.getFilename().endsWith(".abap")) {
|
|
45540
45540
|
return file;
|
|
45541
45541
|
}
|
|
45542
45542
|
}
|
|
@@ -53633,7 +53633,7 @@ class Registry {
|
|
|
53633
53633
|
}
|
|
53634
53634
|
static abaplintVersion() {
|
|
53635
53635
|
// magic, see build script "version.sh"
|
|
53636
|
-
return "2.113.
|
|
53636
|
+
return "2.113.86";
|
|
53637
53637
|
}
|
|
53638
53638
|
getDDICReferences() {
|
|
53639
53639
|
return this.ddicReferences;
|
|
@@ -53952,10 +53952,10 @@ class SevenBitAscii {
|
|
|
53952
53952
|
key: "7bit_ascii",
|
|
53953
53953
|
title: "Check for 7bit ascii",
|
|
53954
53954
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53955
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53956
|
-
|
|
53957
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53958
|
-
|
|
53955
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53956
|
+
|
|
53957
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53958
|
+
|
|
53959
53959
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53960
53960
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53961
53961
|
badExample: `WRITE '뽑'.`,
|
|
@@ -54161,10 +54161,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
54161
54161
|
key: "abapdoc",
|
|
54162
54162
|
title: "Check abapdoc",
|
|
54163
54163
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
54164
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
54165
|
-
|
|
54166
|
-
Plus class and interface definitions.
|
|
54167
|
-
|
|
54164
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
54165
|
+
|
|
54166
|
+
Plus class and interface definitions.
|
|
54167
|
+
|
|
54168
54168
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
54169
54169
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54170
54170
|
};
|
|
@@ -54301,27 +54301,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
54301
54301
|
title: "Add test attributes for tests classes with test methods",
|
|
54302
54302
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
54303
54303
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54304
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
54305
|
-
PUBLIC SECTION.
|
|
54306
|
-
PROTECTED SECTION.
|
|
54307
|
-
PRIVATE SECTION.
|
|
54308
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54309
|
-
ENDCLASS.
|
|
54310
|
-
|
|
54311
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
54312
|
-
METHOD test.
|
|
54313
|
-
ENDMETHOD.
|
|
54304
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
54305
|
+
PUBLIC SECTION.
|
|
54306
|
+
PROTECTED SECTION.
|
|
54307
|
+
PRIVATE SECTION.
|
|
54308
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54309
|
+
ENDCLASS.
|
|
54310
|
+
|
|
54311
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
54312
|
+
METHOD test.
|
|
54313
|
+
ENDMETHOD.
|
|
54314
54314
|
ENDCLASS.`,
|
|
54315
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
54316
|
-
PUBLIC SECTION.
|
|
54317
|
-
PROTECTED SECTION.
|
|
54318
|
-
PRIVATE SECTION.
|
|
54319
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54320
|
-
ENDCLASS.
|
|
54321
|
-
|
|
54322
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
54323
|
-
METHOD test.
|
|
54324
|
-
ENDMETHOD.
|
|
54315
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
54316
|
+
PUBLIC SECTION.
|
|
54317
|
+
PROTECTED SECTION.
|
|
54318
|
+
PRIVATE SECTION.
|
|
54319
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54320
|
+
ENDCLASS.
|
|
54321
|
+
|
|
54322
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
54323
|
+
METHOD test.
|
|
54324
|
+
ENDMETHOD.
|
|
54325
54325
|
ENDCLASS.`,
|
|
54326
54326
|
};
|
|
54327
54327
|
}
|
|
@@ -54407,49 +54407,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
54407
54407
|
key: "align_parameters",
|
|
54408
54408
|
title: "Align Parameters",
|
|
54409
54409
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
54410
|
-
extendedInformation: `Checks:
|
|
54411
|
-
* function module calls
|
|
54412
|
-
* method calls
|
|
54413
|
-
* VALUE constructors
|
|
54414
|
-
* NEW constructors
|
|
54415
|
-
* RAISE EXCEPTION statements
|
|
54416
|
-
* CREATE OBJECT statements
|
|
54417
|
-
* RAISE EVENT statements
|
|
54418
|
-
|
|
54419
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54420
|
-
|
|
54421
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54422
|
-
|
|
54423
|
-
If parameters are on the same row, no issues are reported, see
|
|
54410
|
+
extendedInformation: `Checks:
|
|
54411
|
+
* function module calls
|
|
54412
|
+
* method calls
|
|
54413
|
+
* VALUE constructors
|
|
54414
|
+
* NEW constructors
|
|
54415
|
+
* RAISE EXCEPTION statements
|
|
54416
|
+
* CREATE OBJECT statements
|
|
54417
|
+
* RAISE EVENT statements
|
|
54418
|
+
|
|
54419
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54420
|
+
|
|
54421
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54422
|
+
|
|
54423
|
+
If parameters are on the same row, no issues are reported, see
|
|
54424
54424
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
54425
54425
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
54426
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54427
|
-
EXPORTING
|
|
54428
|
-
foo = 2
|
|
54429
|
-
parameter = 3.
|
|
54430
|
-
|
|
54431
|
-
foobar( moo = 1
|
|
54432
|
-
param = 1 ).
|
|
54433
|
-
|
|
54434
|
-
foo = VALUE #(
|
|
54435
|
-
foo = bar
|
|
54426
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54427
|
+
EXPORTING
|
|
54428
|
+
foo = 2
|
|
54429
|
+
parameter = 3.
|
|
54430
|
+
|
|
54431
|
+
foobar( moo = 1
|
|
54432
|
+
param = 1 ).
|
|
54433
|
+
|
|
54434
|
+
foo = VALUE #(
|
|
54435
|
+
foo = bar
|
|
54436
54436
|
moo = 2 ).`,
|
|
54437
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54438
|
-
EXPORTING
|
|
54439
|
-
foo = 2
|
|
54440
|
-
parameter = 3.
|
|
54441
|
-
|
|
54442
|
-
foobar( moo = 1
|
|
54443
|
-
param = 1 ).
|
|
54444
|
-
|
|
54445
|
-
foo = VALUE #(
|
|
54446
|
-
foo = bar
|
|
54447
|
-
moo = 2 ).
|
|
54448
|
-
|
|
54449
|
-
DATA(sdf) = VALUE type(
|
|
54450
|
-
common_val = 2
|
|
54451
|
-
another_common = 5
|
|
54452
|
-
( row_value = 4
|
|
54437
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54438
|
+
EXPORTING
|
|
54439
|
+
foo = 2
|
|
54440
|
+
parameter = 3.
|
|
54441
|
+
|
|
54442
|
+
foobar( moo = 1
|
|
54443
|
+
param = 1 ).
|
|
54444
|
+
|
|
54445
|
+
foo = VALUE #(
|
|
54446
|
+
foo = bar
|
|
54447
|
+
moo = 2 ).
|
|
54448
|
+
|
|
54449
|
+
DATA(sdf) = VALUE type(
|
|
54450
|
+
common_val = 2
|
|
54451
|
+
another_common = 5
|
|
54452
|
+
( row_value = 4
|
|
54453
54453
|
value_foo = 5 ) ).`,
|
|
54454
54454
|
};
|
|
54455
54455
|
}
|
|
@@ -54883,37 +54883,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54883
54883
|
key: "align_type_expressions",
|
|
54884
54884
|
title: "Align TYPE expressions",
|
|
54885
54885
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54886
|
-
extendedInformation: `
|
|
54887
|
-
Currently works for METHODS + BEGIN OF
|
|
54888
|
-
|
|
54889
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54890
|
-
|
|
54891
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54886
|
+
extendedInformation: `
|
|
54887
|
+
Currently works for METHODS + BEGIN OF
|
|
54888
|
+
|
|
54889
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54890
|
+
|
|
54891
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54892
54892
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54893
54893
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54894
|
-
badExample: `
|
|
54895
|
-
TYPES: BEGIN OF foo,
|
|
54896
|
-
bar TYPE i,
|
|
54897
|
-
foobar TYPE i,
|
|
54898
|
-
END OF foo.
|
|
54899
|
-
|
|
54900
|
-
INTERFACE lif.
|
|
54901
|
-
METHODS bar
|
|
54902
|
-
IMPORTING
|
|
54903
|
-
foo TYPE i
|
|
54904
|
-
foobar TYPE i.
|
|
54894
|
+
badExample: `
|
|
54895
|
+
TYPES: BEGIN OF foo,
|
|
54896
|
+
bar TYPE i,
|
|
54897
|
+
foobar TYPE i,
|
|
54898
|
+
END OF foo.
|
|
54899
|
+
|
|
54900
|
+
INTERFACE lif.
|
|
54901
|
+
METHODS bar
|
|
54902
|
+
IMPORTING
|
|
54903
|
+
foo TYPE i
|
|
54904
|
+
foobar TYPE i.
|
|
54905
54905
|
ENDINTERFACE.`,
|
|
54906
|
-
goodExample: `
|
|
54907
|
-
TYPES: BEGIN OF foo,
|
|
54908
|
-
bar TYPE i,
|
|
54909
|
-
foobar TYPE i,
|
|
54910
|
-
END OF foo.
|
|
54911
|
-
|
|
54912
|
-
INTERFACE lif.
|
|
54913
|
-
METHODS bar
|
|
54914
|
-
IMPORTING
|
|
54915
|
-
foo TYPE i
|
|
54916
|
-
foobar TYPE i.
|
|
54906
|
+
goodExample: `
|
|
54907
|
+
TYPES: BEGIN OF foo,
|
|
54908
|
+
bar TYPE i,
|
|
54909
|
+
foobar TYPE i,
|
|
54910
|
+
END OF foo.
|
|
54911
|
+
|
|
54912
|
+
INTERFACE lif.
|
|
54913
|
+
METHODS bar
|
|
54914
|
+
IMPORTING
|
|
54915
|
+
foo TYPE i
|
|
54916
|
+
foobar TYPE i.
|
|
54917
54917
|
ENDINTERFACE.`,
|
|
54918
54918
|
};
|
|
54919
54919
|
}
|
|
@@ -55192,16 +55192,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55192
55192
|
return {
|
|
55193
55193
|
key: "ambiguous_statement",
|
|
55194
55194
|
title: "Check for ambigious statements",
|
|
55195
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
55196
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
55197
|
-
|
|
55195
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
55196
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
55197
|
+
|
|
55198
55198
|
Only works if the target version is 740sp05 or above`,
|
|
55199
55199
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55200
|
-
badExample: `DELETE foo FROM bar.
|
|
55200
|
+
badExample: `DELETE foo FROM bar.
|
|
55201
55201
|
MODIFY foo FROM bar.`,
|
|
55202
|
-
goodExample: `DELETE foo FROM @bar.
|
|
55203
|
-
DELETE TABLE itab FROM 2.
|
|
55204
|
-
MODIFY zfoo FROM @wa.
|
|
55202
|
+
goodExample: `DELETE foo FROM @bar.
|
|
55203
|
+
DELETE TABLE itab FROM 2.
|
|
55204
|
+
MODIFY zfoo FROM @wa.
|
|
55205
55205
|
MODIFY TABLE foo FROM bar.`,
|
|
55206
55206
|
};
|
|
55207
55207
|
}
|
|
@@ -55306,16 +55306,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
55306
55306
|
key: "avoid_use",
|
|
55307
55307
|
title: "Avoid use of certain statements",
|
|
55308
55308
|
shortDescription: `Detects usage of certain statements.`,
|
|
55309
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
55310
|
-
|
|
55311
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
55312
|
-
|
|
55313
|
-
STATICS: use CLASS-DATA instead
|
|
55314
|
-
|
|
55315
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
55316
|
-
|
|
55317
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
55318
|
-
|
|
55309
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
55310
|
+
|
|
55311
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
55312
|
+
|
|
55313
|
+
STATICS: use CLASS-DATA instead
|
|
55314
|
+
|
|
55315
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
55316
|
+
|
|
55317
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
55318
|
+
|
|
55319
55319
|
BREAK points`,
|
|
55320
55320
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55321
55321
|
};
|
|
@@ -55447,11 +55447,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
55447
55447
|
title: "Check BEGIN END names",
|
|
55448
55448
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
55449
55449
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55450
|
-
badExample: `DATA: BEGIN OF stru,
|
|
55451
|
-
field TYPE i,
|
|
55450
|
+
badExample: `DATA: BEGIN OF stru,
|
|
55451
|
+
field TYPE i,
|
|
55452
55452
|
END OF structure_not_the_same.`,
|
|
55453
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
55454
|
-
field TYPE i,
|
|
55453
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
55454
|
+
field TYPE i,
|
|
55455
55455
|
END OF stru.`,
|
|
55456
55456
|
};
|
|
55457
55457
|
}
|
|
@@ -55548,20 +55548,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
55548
55548
|
title: "BEGIN contains single INCLUDE",
|
|
55549
55549
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
55550
55550
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55551
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
55552
|
-
INCLUDE TYPE dselc.
|
|
55553
|
-
TYPES: END OF dummy1.
|
|
55554
|
-
|
|
55555
|
-
DATA BEGIN OF foo.
|
|
55556
|
-
INCLUDE STRUCTURE syst.
|
|
55557
|
-
DATA END OF foo.
|
|
55558
|
-
|
|
55559
|
-
STATICS BEGIN OF bar.
|
|
55560
|
-
INCLUDE STRUCTURE syst.
|
|
55551
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
55552
|
+
INCLUDE TYPE dselc.
|
|
55553
|
+
TYPES: END OF dummy1.
|
|
55554
|
+
|
|
55555
|
+
DATA BEGIN OF foo.
|
|
55556
|
+
INCLUDE STRUCTURE syst.
|
|
55557
|
+
DATA END OF foo.
|
|
55558
|
+
|
|
55559
|
+
STATICS BEGIN OF bar.
|
|
55560
|
+
INCLUDE STRUCTURE syst.
|
|
55561
55561
|
STATICS END OF bar.`,
|
|
55562
|
-
goodExample: `DATA BEGIN OF foo.
|
|
55563
|
-
DATA field TYPE i.
|
|
55564
|
-
INCLUDE STRUCTURE dselc.
|
|
55562
|
+
goodExample: `DATA BEGIN OF foo.
|
|
55563
|
+
DATA field TYPE i.
|
|
55564
|
+
INCLUDE STRUCTURE dselc.
|
|
55565
55565
|
DATA END OF foo.`,
|
|
55566
55566
|
};
|
|
55567
55567
|
}
|
|
@@ -55651,9 +55651,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
55651
55651
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
55652
55652
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55653
55653
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
55654
|
-
goodExample: `TRY.
|
|
55655
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55656
|
-
CATCH cx_sy_authorization_error.
|
|
55654
|
+
goodExample: `TRY.
|
|
55655
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55656
|
+
CATCH cx_sy_authorization_error.
|
|
55657
55657
|
ENDTRY.`,
|
|
55658
55658
|
};
|
|
55659
55659
|
}
|
|
@@ -55718,10 +55718,10 @@ class CDSCommentStyle {
|
|
|
55718
55718
|
key: "cds_comment_style",
|
|
55719
55719
|
title: "CDS Comment Style",
|
|
55720
55720
|
shortDescription: `Check for obsolete comment style`,
|
|
55721
|
-
extendedInformation: `Check for obsolete comment style
|
|
55722
|
-
|
|
55723
|
-
Comments starting with "--" are considered obsolete
|
|
55724
|
-
|
|
55721
|
+
extendedInformation: `Check for obsolete comment style
|
|
55722
|
+
|
|
55723
|
+
Comments starting with "--" are considered obsolete
|
|
55724
|
+
|
|
55725
55725
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
55726
55726
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55727
55727
|
badExample: "-- this is a comment",
|
|
@@ -55787,10 +55787,10 @@ class CDSLegacyView {
|
|
|
55787
55787
|
key: "cds_legacy_view",
|
|
55788
55788
|
title: "CDS Legacy View",
|
|
55789
55789
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55790
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55791
|
-
|
|
55792
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55793
|
-
|
|
55790
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55791
|
+
|
|
55792
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55793
|
+
|
|
55794
55794
|
v755 and up`,
|
|
55795
55795
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55796
55796
|
};
|
|
@@ -55945,10 +55945,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55945
55945
|
key: "chain_mainly_declarations",
|
|
55946
55946
|
title: "Chain mainly declarations",
|
|
55947
55947
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55948
|
-
extendedInformation: `
|
|
55949
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55950
|
-
|
|
55951
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55948
|
+
extendedInformation: `
|
|
55949
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55950
|
+
|
|
55951
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55952
55952
|
`,
|
|
55953
55953
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55954
55954
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -56124,17 +56124,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
56124
56124
|
title: "Change IF to CASE",
|
|
56125
56125
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
56126
56126
|
// eslint-disable-next-line max-len
|
|
56127
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
56128
|
-
|
|
56127
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
56128
|
+
|
|
56129
56129
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
56130
56130
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
56131
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
56132
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
56133
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
56131
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
56132
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
56133
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
56134
56134
|
ENDIF.`,
|
|
56135
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
56136
|
-
WHEN 'FOO'.
|
|
56137
|
-
WHEN 'BAR' OR 'MOO'.
|
|
56135
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
56136
|
+
WHEN 'FOO'.
|
|
56137
|
+
WHEN 'BAR' OR 'MOO'.
|
|
56138
56138
|
ENDCASE.`,
|
|
56139
56139
|
};
|
|
56140
56140
|
}
|
|
@@ -56271,8 +56271,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
56271
56271
|
return {
|
|
56272
56272
|
key: "check_abstract",
|
|
56273
56273
|
title: "Check abstract methods and classes",
|
|
56274
|
-
shortDescription: `Checks abstract methods and classes:
|
|
56275
|
-
- class defined as abstract and final,
|
|
56274
|
+
shortDescription: `Checks abstract methods and classes:
|
|
56275
|
+
- class defined as abstract and final,
|
|
56276
56276
|
- non-abstract class contains abstract methods`,
|
|
56277
56277
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
56278
56278
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -56353,11 +56353,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
56353
56353
|
return {
|
|
56354
56354
|
key: "check_comments",
|
|
56355
56355
|
title: "Check Comments",
|
|
56356
|
-
shortDescription: `
|
|
56356
|
+
shortDescription: `
|
|
56357
56357
|
Various checks for comment usage.`,
|
|
56358
|
-
extendedInformation: `
|
|
56359
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
56360
|
-
|
|
56358
|
+
extendedInformation: `
|
|
56359
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
56360
|
+
|
|
56361
56361
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
56362
56362
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56363
56363
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -56519,9 +56519,9 @@ class CheckInclude {
|
|
|
56519
56519
|
key: "check_include",
|
|
56520
56520
|
title: "Check INCLUDEs",
|
|
56521
56521
|
shortDescription: `Checks INCLUDE statements`,
|
|
56522
|
-
extendedInformation: `
|
|
56523
|
-
* Reports unused includes
|
|
56524
|
-
* Errors if the includes are not found
|
|
56522
|
+
extendedInformation: `
|
|
56523
|
+
* Reports unused includes
|
|
56524
|
+
* Errors if the includes are not found
|
|
56525
56525
|
* Error if including a main program`,
|
|
56526
56526
|
tags: [_irule_1.RuleTag.Syntax],
|
|
56527
56527
|
};
|
|
@@ -56597,14 +56597,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
56597
56597
|
key: "check_subrc",
|
|
56598
56598
|
title: "Check sy-subrc",
|
|
56599
56599
|
shortDescription: `Check sy-subrc`,
|
|
56600
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56601
|
-
|
|
56602
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56603
|
-
|
|
56604
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56605
|
-
|
|
56606
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56607
|
-
|
|
56600
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56601
|
+
|
|
56602
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56603
|
+
|
|
56604
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56605
|
+
|
|
56606
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56607
|
+
|
|
56608
56608
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
56609
56609
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56610
56610
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -57174,17 +57174,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
57174
57174
|
shortDescription: `Find overlapping classic exceptions`,
|
|
57175
57175
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
57176
57176
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
57177
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
57178
|
-
EXCEPTIONS
|
|
57179
|
-
system_failure = 1 MESSAGE lv_message
|
|
57180
|
-
communication_failure = 1 MESSAGE lv_message
|
|
57181
|
-
resource_failure = 1
|
|
57177
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
57178
|
+
EXCEPTIONS
|
|
57179
|
+
system_failure = 1 MESSAGE lv_message
|
|
57180
|
+
communication_failure = 1 MESSAGE lv_message
|
|
57181
|
+
resource_failure = 1
|
|
57182
57182
|
OTHERS = 1.`,
|
|
57183
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
57184
|
-
EXCEPTIONS
|
|
57185
|
-
system_failure = 1 MESSAGE lv_message
|
|
57186
|
-
communication_failure = 2 MESSAGE lv_message
|
|
57187
|
-
resource_failure = 3
|
|
57183
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
57184
|
+
EXCEPTIONS
|
|
57185
|
+
system_failure = 1 MESSAGE lv_message
|
|
57186
|
+
communication_failure = 2 MESSAGE lv_message
|
|
57187
|
+
resource_failure = 3
|
|
57188
57188
|
OTHERS = 4.`,
|
|
57189
57189
|
};
|
|
57190
57190
|
}
|
|
@@ -57442,7 +57442,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
57442
57442
|
key: "commented_code",
|
|
57443
57443
|
title: "Find commented code",
|
|
57444
57444
|
shortDescription: `Detects usage of commented out code.`,
|
|
57445
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57445
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57446
57446
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
57447
57447
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
57448
57448
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -57675,10 +57675,10 @@ class ConstructorVisibilityPublic {
|
|
|
57675
57675
|
key: "constructor_visibility_public",
|
|
57676
57676
|
title: "Check constructor visibility is public",
|
|
57677
57677
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
57678
|
-
extendedInformation: `
|
|
57679
|
-
This only applies to global classes.
|
|
57680
|
-
|
|
57681
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57678
|
+
extendedInformation: `
|
|
57679
|
+
This only applies to global classes.
|
|
57680
|
+
|
|
57681
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57682
57682
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
57683
57683
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57684
57684
|
};
|
|
@@ -57753,8 +57753,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
57753
57753
|
key: "contains_tab",
|
|
57754
57754
|
title: "Code contains tab",
|
|
57755
57755
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
57756
|
-
extendedInformation: `
|
|
57757
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57756
|
+
extendedInformation: `
|
|
57757
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
57758
57758
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
57759
57759
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57760
57760
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57841,10 +57841,10 @@ class CyclicOO {
|
|
|
57841
57841
|
key: "cyclic_oo",
|
|
57842
57842
|
title: "Cyclic OO",
|
|
57843
57843
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57844
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57845
|
-
|
|
57846
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57847
|
-
|
|
57844
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57845
|
+
|
|
57846
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57847
|
+
|
|
57848
57848
|
References in testclass includes are ignored`,
|
|
57849
57849
|
};
|
|
57850
57850
|
}
|
|
@@ -58087,7 +58087,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
58087
58087
|
key: "dangerous_statement",
|
|
58088
58088
|
title: "Dangerous statement",
|
|
58089
58089
|
shortDescription: `Detects potentially dangerous statements`,
|
|
58090
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
58090
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
58091
58091
|
dynamic SQL can potentially create SQL injection problems`,
|
|
58092
58092
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
58093
58093
|
};
|
|
@@ -58294,13 +58294,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
58294
58294
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
58295
58295
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
58296
58296
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
58297
|
-
badExample: `FROM foo.
|
|
58298
|
-
WRITE 'hello'.
|
|
58299
|
-
DATA int TYPE i.
|
|
58297
|
+
badExample: `FROM foo.
|
|
58298
|
+
WRITE 'hello'.
|
|
58299
|
+
DATA int TYPE i.
|
|
58300
58300
|
ENDFORM.`,
|
|
58301
|
-
goodExample: `FROM foo.
|
|
58302
|
-
DATA int TYPE i.
|
|
58303
|
-
WRITE 'hello'.
|
|
58301
|
+
goodExample: `FROM foo.
|
|
58302
|
+
DATA int TYPE i.
|
|
58303
|
+
WRITE 'hello'.
|
|
58304
58304
|
ENDFORM.`,
|
|
58305
58305
|
};
|
|
58306
58306
|
}
|
|
@@ -58842,39 +58842,39 @@ class Downport {
|
|
|
58842
58842
|
key: "downport",
|
|
58843
58843
|
title: "Downport statement",
|
|
58844
58844
|
shortDescription: `Downport functionality`,
|
|
58845
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58846
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58847
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58848
|
-
|
|
58849
|
-
Current rules:
|
|
58850
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58851
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58852
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58853
|
-
* CONV is outlined
|
|
58854
|
-
* COND is outlined
|
|
58855
|
-
* REDUCE is outlined
|
|
58856
|
-
* SWITCH is outlined
|
|
58857
|
-
* FILTER is outlined
|
|
58858
|
-
* APPEND expression is outlined
|
|
58859
|
-
* INSERT expression is outlined
|
|
58860
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58861
|
-
* CAST changed to ?=
|
|
58862
|
-
* LOOP AT method_call( ) is outlined
|
|
58863
|
-
* VALUE # with structure fields
|
|
58864
|
-
* VALUE # with internal table lines
|
|
58865
|
-
* Table Expressions are outlined
|
|
58866
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58867
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58868
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58869
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58870
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58871
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58872
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58873
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58874
|
-
* MESSAGE with non simple source
|
|
58875
|
-
|
|
58876
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58877
|
-
|
|
58845
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58846
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58847
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58848
|
+
|
|
58849
|
+
Current rules:
|
|
58850
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58851
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58852
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58853
|
+
* CONV is outlined
|
|
58854
|
+
* COND is outlined
|
|
58855
|
+
* REDUCE is outlined
|
|
58856
|
+
* SWITCH is outlined
|
|
58857
|
+
* FILTER is outlined
|
|
58858
|
+
* APPEND expression is outlined
|
|
58859
|
+
* INSERT expression is outlined
|
|
58860
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58861
|
+
* CAST changed to ?=
|
|
58862
|
+
* LOOP AT method_call( ) is outlined
|
|
58863
|
+
* VALUE # with structure fields
|
|
58864
|
+
* VALUE # with internal table lines
|
|
58865
|
+
* Table Expressions are outlined
|
|
58866
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58867
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58868
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58869
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58870
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58871
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58872
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58873
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58874
|
+
* MESSAGE with non simple source
|
|
58875
|
+
|
|
58876
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58877
|
+
|
|
58878
58878
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58879
58879
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58880
58880
|
};
|
|
@@ -59489,10 +59489,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
59489
59489
|
const fieldName = f.concatTokens();
|
|
59490
59490
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
59491
59491
|
}
|
|
59492
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59492
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59493
59493
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
59494
59494
|
}
|
|
59495
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59495
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59496
59496
|
${indentation}`);
|
|
59497
59497
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
59498
59498
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59551,12 +59551,12 @@ ${indentation}`);
|
|
|
59551
59551
|
}
|
|
59552
59552
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59553
59553
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
59554
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59555
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59556
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59554
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59555
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59556
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59557
59557
|
${indentation}`);
|
|
59558
59558
|
if (fieldDefinitions === "") {
|
|
59559
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59559
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59560
59560
|
${indentation}`);
|
|
59561
59561
|
}
|
|
59562
59562
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -59624,7 +59624,7 @@ ${indentation}`);
|
|
|
59624
59624
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59625
59625
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59626
59626
|
const firstToken = high.getFirstToken();
|
|
59627
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59627
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59628
59628
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59629
59629
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59630
59630
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59678,7 +59678,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59678
59678
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59679
59679
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59680
59680
|
const firstToken = high.getFirstToken();
|
|
59681
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59681
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59682
59682
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59683
59683
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59684
59684
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59720,14 +59720,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59720
59720
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59721
59721
|
const firstToken = high.getFirstToken();
|
|
59722
59722
|
// note that the tabix restore should be done before throwing the exception
|
|
59723
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59724
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59725
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59726
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59727
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59728
|
-
${indentation}IF sy-subrc <> 0.
|
|
59729
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59730
|
-
${indentation}ENDIF.
|
|
59723
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59724
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59725
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59726
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59727
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59728
|
+
${indentation}IF sy-subrc <> 0.
|
|
59729
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59730
|
+
${indentation}ENDIF.
|
|
59731
59731
|
${indentation}`);
|
|
59732
59732
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
59733
59733
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59784,7 +59784,7 @@ ${indentation}`);
|
|
|
59784
59784
|
const className = classNames[0].concatTokens();
|
|
59785
59785
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59786
59786
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59787
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59787
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59788
59788
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
59789
59789
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
59790
59790
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59946,16 +59946,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59946
59946
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59947
59947
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59948
59948
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59949
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59950
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59949
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59950
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59951
59951
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59952
59952
|
if (withs.length > 0) {
|
|
59953
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59954
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59955
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59953
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59954
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59955
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59956
59956
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59957
59957
|
}
|
|
59958
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59958
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59959
59959
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59960
59960
|
if (withs.length > 0) {
|
|
59961
59961
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -60067,10 +60067,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
60067
60067
|
let code = "";
|
|
60068
60068
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
60069
60069
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60070
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
60071
|
-
IF sy-subrc <> 0.
|
|
60072
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60073
|
-
ENDIF.
|
|
60070
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
60071
|
+
IF sy-subrc <> 0.
|
|
60072
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60073
|
+
ENDIF.
|
|
60074
60074
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
60075
60075
|
}
|
|
60076
60076
|
else {
|
|
@@ -60159,20 +60159,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
60159
60159
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60160
60160
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60161
60161
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60162
|
-
code += ` items LIKE ${loopSourceName},
|
|
60163
|
-
END OF ${groupTargetName}type.
|
|
60164
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
60165
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
60162
|
+
code += ` items LIKE ${loopSourceName},
|
|
60163
|
+
END OF ${groupTargetName}type.
|
|
60164
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
60165
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
60166
60166
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
60167
60167
|
if (groupIndexName !== undefined) {
|
|
60168
60168
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
60169
60169
|
}
|
|
60170
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
60170
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
60171
60171
|
IF sy-subrc = 0.\n`;
|
|
60172
60172
|
if (groupCountName !== undefined) {
|
|
60173
60173
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
60174
60174
|
}
|
|
60175
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
60175
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
60176
60176
|
ELSE.\n`;
|
|
60177
60177
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
60178
60178
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -60193,8 +60193,8 @@ ELSE.\n`;
|
|
|
60193
60193
|
}
|
|
60194
60194
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
60195
60195
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
60196
|
-
code += `ENDIF.
|
|
60197
|
-
ENDLOOP.
|
|
60196
|
+
code += `ENDIF.
|
|
60197
|
+
ENDLOOP.
|
|
60198
60198
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
60199
60199
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
60200
60200
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -60366,7 +60366,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
60366
60366
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60367
60367
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
60368
60368
|
// all ENUMS are char like?
|
|
60369
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
60369
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
60370
60370
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
60371
60371
|
let count = 1;
|
|
60372
60372
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -60410,14 +60410,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
60410
60410
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60411
60411
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60412
60412
|
// restore tabix before exeption
|
|
60413
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
60414
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
60415
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
60416
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
60417
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
60418
|
-
${indentation}IF sy-subrc <> 0.
|
|
60419
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60420
|
-
${indentation}ENDIF.
|
|
60413
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
60414
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
60415
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
60416
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
60417
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
60418
|
+
${indentation}IF sy-subrc <> 0.
|
|
60419
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60420
|
+
${indentation}ENDIF.
|
|
60421
60421
|
${indentation}${uniqueName}`;
|
|
60422
60422
|
const start = target.getFirstToken().getStart();
|
|
60423
60423
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -60497,11 +60497,11 @@ ${indentation}${uniqueName}`;
|
|
|
60497
60497
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60498
60498
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60499
60499
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60500
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
60501
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
60502
|
-
${indentation} EXPORTING
|
|
60503
|
-
${indentation} input = ${source}
|
|
60504
|
-
${indentation} IMPORTING
|
|
60500
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
60501
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
60502
|
+
${indentation} EXPORTING
|
|
60503
|
+
${indentation} input = ${source}
|
|
60504
|
+
${indentation} IMPORTING
|
|
60505
60505
|
${indentation} output = ${uniqueName}.\n`;
|
|
60506
60506
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
60507
60507
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -61827,12 +61827,12 @@ class EasyToFindMessages {
|
|
|
61827
61827
|
key: "easy_to_find_messages",
|
|
61828
61828
|
title: "Easy to find messages",
|
|
61829
61829
|
shortDescription: `Make messages easy to find`,
|
|
61830
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
61831
|
-
|
|
61832
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
61833
|
-
|
|
61834
|
-
Also see rule "message_exists"
|
|
61835
|
-
|
|
61830
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61831
|
+
|
|
61832
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61833
|
+
|
|
61834
|
+
Also see rule "message_exists"
|
|
61835
|
+
|
|
61836
61836
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61837
61837
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61838
61838
|
};
|
|
@@ -61913,13 +61913,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61913
61913
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61914
61914
|
extendedInformation: ``,
|
|
61915
61915
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61916
|
-
badExample: `
|
|
61917
|
-
INITIALIZATION.
|
|
61918
|
-
WRITE 'hello'.
|
|
61916
|
+
badExample: `
|
|
61917
|
+
INITIALIZATION.
|
|
61918
|
+
WRITE 'hello'.
|
|
61919
61919
|
END-OF-SELECTION.`,
|
|
61920
|
-
goodExample: `
|
|
61921
|
-
START-OF-SELECTION.
|
|
61922
|
-
PERFORM sdf.
|
|
61920
|
+
goodExample: `
|
|
61921
|
+
START-OF-SELECTION.
|
|
61922
|
+
PERFORM sdf.
|
|
61923
61923
|
COMMIT WORK.`,
|
|
61924
61924
|
};
|
|
61925
61925
|
}
|
|
@@ -62011,8 +62011,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
62011
62011
|
key: "empty_line_in_statement",
|
|
62012
62012
|
title: "Find empty lines in statements",
|
|
62013
62013
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
62014
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
62015
|
-
|
|
62014
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
62015
|
+
|
|
62016
62016
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
62017
62017
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
62018
62018
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -62188,13 +62188,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
62188
62188
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
62189
62189
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
62190
62190
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
62191
|
-
badExample: `IF foo = bar.
|
|
62192
|
-
ENDIF.
|
|
62193
|
-
|
|
62194
|
-
DO 2 TIMES.
|
|
62191
|
+
badExample: `IF foo = bar.
|
|
62192
|
+
ENDIF.
|
|
62193
|
+
|
|
62194
|
+
DO 2 TIMES.
|
|
62195
62195
|
ENDDO.`,
|
|
62196
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
62197
|
-
ENDLOOP.
|
|
62196
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
62197
|
+
ENDLOOP.
|
|
62198
62198
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
62199
62199
|
};
|
|
62200
62200
|
}
|
|
@@ -62336,10 +62336,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
62336
62336
|
return {
|
|
62337
62337
|
key: "exit_or_check",
|
|
62338
62338
|
title: "Find EXIT or CHECK outside loops",
|
|
62339
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
62339
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
62340
62340
|
Use RETURN to leave procesing blocks instead.`,
|
|
62341
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
62342
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
62341
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
62342
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
62343
62343
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
62344
62344
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62345
62345
|
};
|
|
@@ -62422,12 +62422,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
62422
62422
|
key: "expand_macros",
|
|
62423
62423
|
title: "Expand Macros",
|
|
62424
62424
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
62425
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
62426
|
-
|
|
62425
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
62426
|
+
|
|
62427
62427
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
62428
|
-
badExample: `DEFINE _hello.
|
|
62429
|
-
WRITE 'hello'.
|
|
62430
|
-
END-OF-DEFINITION.
|
|
62428
|
+
badExample: `DEFINE _hello.
|
|
62429
|
+
WRITE 'hello'.
|
|
62430
|
+
END-OF-DEFINITION.
|
|
62431
62431
|
_hello.`,
|
|
62432
62432
|
goodExample: `WRITE 'hello'.`,
|
|
62433
62433
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -62514,7 +62514,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
62514
62514
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
62515
62515
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
62516
62516
|
goodExample: `call_method( foo = bar ).`,
|
|
62517
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62517
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62518
62518
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
62519
62519
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62520
62520
|
};
|
|
@@ -62612,7 +62612,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
62612
62612
|
key: "forbidden_identifier",
|
|
62613
62613
|
title: "Forbidden Identifier",
|
|
62614
62614
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
62615
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62615
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62616
62616
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
62617
62617
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62618
62618
|
};
|
|
@@ -62854,8 +62854,8 @@ class ForbiddenVoidType {
|
|
|
62854
62854
|
key: "forbidden_void_type",
|
|
62855
62855
|
title: "Forbidden Void Types",
|
|
62856
62856
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62857
|
-
extendedInformation: `Inspiration:
|
|
62858
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62857
|
+
extendedInformation: `Inspiration:
|
|
62858
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62859
62859
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62860
62860
|
};
|
|
62861
62861
|
}
|
|
@@ -63098,9 +63098,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
63098
63098
|
key: "fully_type_itabs",
|
|
63099
63099
|
title: "Fully type internal tables",
|
|
63100
63100
|
shortDescription: `No implict table types or table keys`,
|
|
63101
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
63101
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
63102
63102
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
63103
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
63103
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
63104
63104
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
63105
63105
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
63106
63106
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -63285,26 +63285,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
63285
63285
|
key: "functional_writing",
|
|
63286
63286
|
title: "Use functional writing",
|
|
63287
63287
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
63288
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
63288
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
63289
63289
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
63290
63290
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63291
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
63292
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
63293
|
-
EXPORTING
|
|
63294
|
-
p_name = 'NAME'
|
|
63295
|
-
RECEIVING
|
|
63296
|
-
p_descr_ref = lr_typedescr
|
|
63297
|
-
EXCEPTIONS
|
|
63298
|
-
type_not_found = 1
|
|
63291
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
63292
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
63293
|
+
EXPORTING
|
|
63294
|
+
p_name = 'NAME'
|
|
63295
|
+
RECEIVING
|
|
63296
|
+
p_descr_ref = lr_typedescr
|
|
63297
|
+
EXCEPTIONS
|
|
63298
|
+
type_not_found = 1
|
|
63299
63299
|
OTHERS = 2.`,
|
|
63300
|
-
goodExample: `zcl_class=>method( ).
|
|
63301
|
-
cl_abap_typedescr=>describe_by_name(
|
|
63302
|
-
EXPORTING
|
|
63303
|
-
p_name = 'NAME'
|
|
63304
|
-
RECEIVING
|
|
63305
|
-
p_descr_ref = lr_typedescr
|
|
63306
|
-
EXCEPTIONS
|
|
63307
|
-
type_not_found = 1
|
|
63300
|
+
goodExample: `zcl_class=>method( ).
|
|
63301
|
+
cl_abap_typedescr=>describe_by_name(
|
|
63302
|
+
EXPORTING
|
|
63303
|
+
p_name = 'NAME'
|
|
63304
|
+
RECEIVING
|
|
63305
|
+
p_descr_ref = lr_typedescr
|
|
63306
|
+
EXCEPTIONS
|
|
63307
|
+
type_not_found = 1
|
|
63308
63308
|
OTHERS = 2 ).`,
|
|
63309
63309
|
};
|
|
63310
63310
|
}
|
|
@@ -63415,14 +63415,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
63415
63415
|
key: "global_class",
|
|
63416
63416
|
title: "Global class checks",
|
|
63417
63417
|
shortDescription: `Checks related to global classes`,
|
|
63418
|
-
extendedInformation: `* global classes must be in own files
|
|
63419
|
-
|
|
63420
|
-
* file names must match class name
|
|
63421
|
-
|
|
63422
|
-
* file names must match interface name
|
|
63423
|
-
|
|
63424
|
-
* global classes must be global definitions
|
|
63425
|
-
|
|
63418
|
+
extendedInformation: `* global classes must be in own files
|
|
63419
|
+
|
|
63420
|
+
* file names must match class name
|
|
63421
|
+
|
|
63422
|
+
* file names must match interface name
|
|
63423
|
+
|
|
63424
|
+
* global classes must be global definitions
|
|
63425
|
+
|
|
63426
63426
|
* global interfaces must be global definitions`,
|
|
63427
63427
|
tags: [_irule_1.RuleTag.Syntax],
|
|
63428
63428
|
};
|
|
@@ -63521,21 +63521,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
63521
63521
|
return {
|
|
63522
63522
|
key: "identical_conditions",
|
|
63523
63523
|
title: "Identical conditions",
|
|
63524
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63525
|
-
|
|
63524
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63525
|
+
|
|
63526
63526
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
63527
63527
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63528
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63529
|
-
ENDIF.
|
|
63530
|
-
CASE bar.
|
|
63531
|
-
WHEN '1'.
|
|
63532
|
-
WHEN 'A' OR '1'.
|
|
63528
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63529
|
+
ENDIF.
|
|
63530
|
+
CASE bar.
|
|
63531
|
+
WHEN '1'.
|
|
63532
|
+
WHEN 'A' OR '1'.
|
|
63533
63533
|
ENDCASE.`,
|
|
63534
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
63535
|
-
ENDIF.
|
|
63536
|
-
CASE bar.
|
|
63537
|
-
WHEN '1'.
|
|
63538
|
-
WHEN 'A'.
|
|
63534
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
63535
|
+
ENDIF.
|
|
63536
|
+
CASE bar.
|
|
63537
|
+
WHEN '1'.
|
|
63538
|
+
WHEN 'A'.
|
|
63539
63539
|
ENDCASE.`,
|
|
63540
63540
|
};
|
|
63541
63541
|
}
|
|
@@ -63669,23 +63669,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
63669
63669
|
key: "identical_contents",
|
|
63670
63670
|
title: "Identical contents",
|
|
63671
63671
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
63672
|
-
extendedInformation: `
|
|
63673
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
63674
|
-
|
|
63672
|
+
extendedInformation: `
|
|
63673
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
63674
|
+
|
|
63675
63675
|
Chained statments are ignored`,
|
|
63676
63676
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63677
|
-
badExample: `IF foo = bar.
|
|
63678
|
-
WRITE 'bar'.
|
|
63679
|
-
WRITE 'world'.
|
|
63680
|
-
ELSE.
|
|
63681
|
-
WRITE 'foo'.
|
|
63682
|
-
WRITE 'world'.
|
|
63677
|
+
badExample: `IF foo = bar.
|
|
63678
|
+
WRITE 'bar'.
|
|
63679
|
+
WRITE 'world'.
|
|
63680
|
+
ELSE.
|
|
63681
|
+
WRITE 'foo'.
|
|
63682
|
+
WRITE 'world'.
|
|
63683
63683
|
ENDIF.`,
|
|
63684
|
-
goodExample: `IF foo = bar.
|
|
63685
|
-
WRITE 'bar'.
|
|
63686
|
-
ELSE.
|
|
63687
|
-
WRITE 'foo'.
|
|
63688
|
-
ENDIF.
|
|
63684
|
+
goodExample: `IF foo = bar.
|
|
63685
|
+
WRITE 'bar'.
|
|
63686
|
+
ELSE.
|
|
63687
|
+
WRITE 'foo'.
|
|
63688
|
+
ENDIF.
|
|
63689
63689
|
WRITE 'world'.`,
|
|
63690
63690
|
};
|
|
63691
63691
|
}
|
|
@@ -63793,12 +63793,12 @@ class IdenticalDescriptions {
|
|
|
63793
63793
|
key: "identical_descriptions",
|
|
63794
63794
|
title: "Identical descriptions",
|
|
63795
63795
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
63796
|
-
extendedInformation: `Case insensitive
|
|
63797
|
-
|
|
63798
|
-
Only checks the master language descriptions
|
|
63799
|
-
|
|
63800
|
-
Dependencies are skipped
|
|
63801
|
-
|
|
63796
|
+
extendedInformation: `Case insensitive
|
|
63797
|
+
|
|
63798
|
+
Only checks the master language descriptions
|
|
63799
|
+
|
|
63800
|
+
Dependencies are skipped
|
|
63801
|
+
|
|
63802
63802
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
63803
63803
|
tags: [],
|
|
63804
63804
|
};
|
|
@@ -63972,43 +63972,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63972
63972
|
key: "if_in_if",
|
|
63973
63973
|
title: "IF in IF",
|
|
63974
63974
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63975
|
-
extendedInformation: `
|
|
63976
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63977
|
-
|
|
63978
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63979
|
-
|
|
63980
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63975
|
+
extendedInformation: `
|
|
63976
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63977
|
+
|
|
63978
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63979
|
+
|
|
63980
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63981
63981
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63982
|
-
badExample: `IF condition1.
|
|
63983
|
-
IF condition2.
|
|
63984
|
-
...
|
|
63985
|
-
ENDIF.
|
|
63986
|
-
ENDIF.
|
|
63987
|
-
|
|
63988
|
-
IF condition1.
|
|
63989
|
-
...
|
|
63990
|
-
ELSE.
|
|
63991
|
-
IF condition2.
|
|
63992
|
-
...
|
|
63993
|
-
ENDIF.
|
|
63982
|
+
badExample: `IF condition1.
|
|
63983
|
+
IF condition2.
|
|
63984
|
+
...
|
|
63985
|
+
ENDIF.
|
|
63986
|
+
ENDIF.
|
|
63987
|
+
|
|
63988
|
+
IF condition1.
|
|
63989
|
+
...
|
|
63990
|
+
ELSE.
|
|
63991
|
+
IF condition2.
|
|
63992
|
+
...
|
|
63993
|
+
ENDIF.
|
|
63994
63994
|
ENDIF.`,
|
|
63995
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63996
|
-
...
|
|
63997
|
-
ENDIF.
|
|
63998
|
-
|
|
63999
|
-
IF condition1.
|
|
64000
|
-
...
|
|
64001
|
-
ELSEIF condition2.
|
|
64002
|
-
...
|
|
64003
|
-
ENDIF.
|
|
64004
|
-
|
|
64005
|
-
CASE variable.
|
|
64006
|
-
WHEN value1.
|
|
64007
|
-
...
|
|
64008
|
-
WHEN value2.
|
|
64009
|
-
IF condition2.
|
|
64010
|
-
...
|
|
64011
|
-
ENDIF.
|
|
63995
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63996
|
+
...
|
|
63997
|
+
ENDIF.
|
|
63998
|
+
|
|
63999
|
+
IF condition1.
|
|
64000
|
+
...
|
|
64001
|
+
ELSEIF condition2.
|
|
64002
|
+
...
|
|
64003
|
+
ENDIF.
|
|
64004
|
+
|
|
64005
|
+
CASE variable.
|
|
64006
|
+
WHEN value1.
|
|
64007
|
+
...
|
|
64008
|
+
WHEN value2.
|
|
64009
|
+
IF condition2.
|
|
64010
|
+
...
|
|
64011
|
+
ENDIF.
|
|
64012
64012
|
ENDCASE.`,
|
|
64013
64013
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64014
64014
|
};
|
|
@@ -64193,9 +64193,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
64193
64193
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
64194
64194
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
64195
64195
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
64196
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
64197
|
-
METHOD ${methodName.toLowerCase()}.
|
|
64198
|
-
RETURN. " todo, implement method
|
|
64196
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
64197
|
+
METHOD ${methodName.toLowerCase()}.
|
|
64198
|
+
RETURN. " todo, implement method
|
|
64199
64199
|
ENDMETHOD.`);
|
|
64200
64200
|
}
|
|
64201
64201
|
}
|
|
@@ -64374,14 +64374,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
64374
64374
|
key: "implicit_start_of_selection",
|
|
64375
64375
|
title: "Implicit START-OF-SELECTION",
|
|
64376
64376
|
shortDescription: `Add explicit selection screen event handling`,
|
|
64377
|
-
extendedInformation: `Only runs for executable programs
|
|
64378
|
-
|
|
64377
|
+
extendedInformation: `Only runs for executable programs
|
|
64378
|
+
|
|
64379
64379
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
64380
64380
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
64381
|
-
badExample: `REPORT zfoo.
|
|
64381
|
+
badExample: `REPORT zfoo.
|
|
64382
64382
|
WRITE 'hello'.`,
|
|
64383
|
-
goodExample: `
|
|
64384
|
-
START-OF-SELECTION.
|
|
64383
|
+
goodExample: `
|
|
64384
|
+
START-OF-SELECTION.
|
|
64385
64385
|
WRITE 'hello'.`,
|
|
64386
64386
|
};
|
|
64387
64387
|
}
|
|
@@ -64486,19 +64486,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
64486
64486
|
key: "in_statement_indentation",
|
|
64487
64487
|
title: "In-statement indentation",
|
|
64488
64488
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
64489
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64490
|
-
|
|
64491
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64489
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64490
|
+
|
|
64491
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64492
64492
|
to distinguish them better from code within the block.`,
|
|
64493
|
-
badExample: `IF 1 = 1
|
|
64494
|
-
AND 2 = 2.
|
|
64495
|
-
WRITE 'hello' &&
|
|
64496
|
-
'world'.
|
|
64493
|
+
badExample: `IF 1 = 1
|
|
64494
|
+
AND 2 = 2.
|
|
64495
|
+
WRITE 'hello' &&
|
|
64496
|
+
'world'.
|
|
64497
64497
|
ENDIF.`,
|
|
64498
|
-
goodExample: `IF 1 = 1
|
|
64499
|
-
AND 2 = 2.
|
|
64500
|
-
WRITE 'hello' &&
|
|
64501
|
-
'world'.
|
|
64498
|
+
goodExample: `IF 1 = 1
|
|
64499
|
+
AND 2 = 2.
|
|
64500
|
+
WRITE 'hello' &&
|
|
64501
|
+
'world'.
|
|
64502
64502
|
ENDIF.`,
|
|
64503
64503
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64504
64504
|
};
|
|
@@ -64624,23 +64624,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
64624
64624
|
title: "Indentation",
|
|
64625
64625
|
shortDescription: `Checks indentation`,
|
|
64626
64626
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64627
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64628
|
-
PRIVATE SECTION.
|
|
64629
|
-
METHODS constructor.
|
|
64630
|
-
ENDCLASS.
|
|
64631
|
-
|
|
64632
|
-
CLASS lcl IMPLEMENTATION.
|
|
64633
|
-
METHOD constructor.
|
|
64634
|
-
ENDMETHOD.
|
|
64627
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64628
|
+
PRIVATE SECTION.
|
|
64629
|
+
METHODS constructor.
|
|
64630
|
+
ENDCLASS.
|
|
64631
|
+
|
|
64632
|
+
CLASS lcl IMPLEMENTATION.
|
|
64633
|
+
METHOD constructor.
|
|
64634
|
+
ENDMETHOD.
|
|
64635
64635
|
ENDCLASS.`,
|
|
64636
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
64637
|
-
PRIVATE SECTION.
|
|
64638
|
-
METHODS constructor.
|
|
64639
|
-
ENDCLASS.
|
|
64640
|
-
|
|
64641
|
-
CLASS lcl IMPLEMENTATION.
|
|
64642
|
-
METHOD constructor.
|
|
64643
|
-
ENDMETHOD.
|
|
64636
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
64637
|
+
PRIVATE SECTION.
|
|
64638
|
+
METHODS constructor.
|
|
64639
|
+
ENDCLASS.
|
|
64640
|
+
|
|
64641
|
+
CLASS lcl IMPLEMENTATION.
|
|
64642
|
+
METHOD constructor.
|
|
64643
|
+
ENDMETHOD.
|
|
64644
64644
|
ENDCLASS.`,
|
|
64645
64645
|
};
|
|
64646
64646
|
}
|
|
@@ -65044,9 +65044,9 @@ class IntfReferencingClas {
|
|
|
65044
65044
|
key: "intf_referencing_clas",
|
|
65045
65045
|
title: "INTF referencing CLAS",
|
|
65046
65046
|
shortDescription: `Interface contains references to class`,
|
|
65047
|
-
extendedInformation: `Only global interfaces are checked.
|
|
65048
|
-
Only first level references are checked.
|
|
65049
|
-
Exception class references are ignored.
|
|
65047
|
+
extendedInformation: `Only global interfaces are checked.
|
|
65048
|
+
Only first level references are checked.
|
|
65049
|
+
Exception class references are ignored.
|
|
65050
65050
|
Void references are ignored.`,
|
|
65051
65051
|
};
|
|
65052
65052
|
}
|
|
@@ -65131,9 +65131,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
65131
65131
|
title: "Invalid Table Index",
|
|
65132
65132
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
65133
65133
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65134
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
65134
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
65135
65135
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
65136
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
65136
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
65137
65137
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
65138
65138
|
};
|
|
65139
65139
|
}
|
|
@@ -65735,8 +65735,8 @@ class LineBreakStyle {
|
|
|
65735
65735
|
return {
|
|
65736
65736
|
key: "line_break_style",
|
|
65737
65737
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65738
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65739
|
-
|
|
65738
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65739
|
+
|
|
65740
65740
|
abapGit does not work with CRLF`,
|
|
65741
65741
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65742
65742
|
};
|
|
@@ -65805,7 +65805,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65805
65805
|
key: "line_length",
|
|
65806
65806
|
title: "Line length",
|
|
65807
65807
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65808
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65808
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65809
65809
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65810
65810
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65811
65811
|
};
|
|
@@ -65876,7 +65876,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65876
65876
|
key: "line_only_punc",
|
|
65877
65877
|
title: "Line containing only punctuation",
|
|
65878
65878
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65879
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65879
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65880
65880
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65881
65881
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65882
65882
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -66139,15 +66139,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
66139
66139
|
return {
|
|
66140
66140
|
key: "local_variable_names",
|
|
66141
66141
|
title: "Local variable naming conventions",
|
|
66142
|
-
shortDescription: `
|
|
66143
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66142
|
+
shortDescription: `
|
|
66143
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66144
66144
|
Regexes are case-insensitive.`,
|
|
66145
66145
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
66146
|
-
badExample: `FORM bar.
|
|
66147
|
-
DATA foo.
|
|
66146
|
+
badExample: `FORM bar.
|
|
66147
|
+
DATA foo.
|
|
66148
66148
|
ENDFORM.`,
|
|
66149
|
-
goodExample: `FORM bar.
|
|
66150
|
-
DATA lv_foo.
|
|
66149
|
+
goodExample: `FORM bar.
|
|
66150
|
+
DATA lv_foo.
|
|
66151
66151
|
ENDFORM.`,
|
|
66152
66152
|
};
|
|
66153
66153
|
}
|
|
@@ -66299,9 +66299,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
66299
66299
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
66300
66300
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
66301
66301
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
66302
|
-
badExample: `DEFINE something.
|
|
66302
|
+
badExample: `DEFINE something.
|
|
66303
66303
|
END-OF-DEFINITION.`,
|
|
66304
|
-
goodExample: `DEFINE _something.
|
|
66304
|
+
goodExample: `DEFINE _something.
|
|
66305
66305
|
END-OF-DEFINITION.`,
|
|
66306
66306
|
};
|
|
66307
66307
|
}
|
|
@@ -66374,10 +66374,10 @@ class MainFileContents {
|
|
|
66374
66374
|
key: "main_file_contents",
|
|
66375
66375
|
title: "Main file contents",
|
|
66376
66376
|
shortDescription: `Checks related to report declarations.`,
|
|
66377
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
66378
|
-
|
|
66379
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
66380
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
66377
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
66378
|
+
|
|
66379
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
66380
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
66381
66381
|
`,
|
|
66382
66382
|
};
|
|
66383
66383
|
}
|
|
@@ -66493,17 +66493,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
66493
66493
|
title: "Too many parentheses",
|
|
66494
66494
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
66495
66495
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
66496
|
-
badExample: `
|
|
66497
|
-
IF ( destination IS INITIAL ).
|
|
66498
|
-
ENDIF.
|
|
66499
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66500
|
-
ENDIF.
|
|
66496
|
+
badExample: `
|
|
66497
|
+
IF ( destination IS INITIAL ).
|
|
66498
|
+
ENDIF.
|
|
66499
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66500
|
+
ENDIF.
|
|
66501
66501
|
`,
|
|
66502
|
-
goodExample: `
|
|
66503
|
-
IF destination IS INITIAL.
|
|
66504
|
-
ENDIF.
|
|
66505
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
66506
|
-
ENDIF.
|
|
66502
|
+
goodExample: `
|
|
66503
|
+
IF destination IS INITIAL.
|
|
66504
|
+
ENDIF.
|
|
66505
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
66506
|
+
ENDIF.
|
|
66507
66507
|
`,
|
|
66508
66508
|
};
|
|
66509
66509
|
}
|
|
@@ -66677,14 +66677,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66677
66677
|
title: "Max one method parameter definition per line",
|
|
66678
66678
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66679
66679
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66680
|
-
badExample: `
|
|
66681
|
-
METHODS apps_scope_token
|
|
66682
|
-
IMPORTING
|
|
66680
|
+
badExample: `
|
|
66681
|
+
METHODS apps_scope_token
|
|
66682
|
+
IMPORTING
|
|
66683
66683
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66684
|
-
goodExample: `
|
|
66685
|
-
METHODS apps_scope_token
|
|
66686
|
-
IMPORTING
|
|
66687
|
-
body TYPE bodyapps_scope_token
|
|
66684
|
+
goodExample: `
|
|
66685
|
+
METHODS apps_scope_token
|
|
66686
|
+
IMPORTING
|
|
66687
|
+
body TYPE bodyapps_scope_token
|
|
66688
66688
|
client_id TYPE str.`,
|
|
66689
66689
|
};
|
|
66690
66690
|
}
|
|
@@ -66749,11 +66749,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66749
66749
|
key: "max_one_statement",
|
|
66750
66750
|
title: "Max one statement per line",
|
|
66751
66751
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66752
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66753
|
-
|
|
66754
|
-
Does not report anything for chained statements.
|
|
66755
|
-
|
|
66756
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66752
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66753
|
+
|
|
66754
|
+
Does not report anything for chained statements.
|
|
66755
|
+
|
|
66756
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66757
66757
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66758
66758
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66759
66759
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -67091,8 +67091,8 @@ class MethodLength {
|
|
|
67091
67091
|
key: "method_length",
|
|
67092
67092
|
title: "Method/Form Length",
|
|
67093
67093
|
shortDescription: `Checks relating to method/form length.`,
|
|
67094
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
67095
|
-
|
|
67094
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
67095
|
+
|
|
67096
67096
|
Abstract methods without statements are considered okay.`,
|
|
67097
67097
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67098
67098
|
};
|
|
@@ -67197,20 +67197,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
67197
67197
|
key: "method_overwrites_builtin",
|
|
67198
67198
|
title: "Method name overwrites builtin function",
|
|
67199
67199
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
67200
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
67201
|
-
|
|
67202
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
67203
|
-
|
|
67200
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
67201
|
+
|
|
67202
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
67203
|
+
|
|
67204
67204
|
Interface method names are ignored`,
|
|
67205
67205
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67206
|
-
badExample: `CLASS lcl DEFINITION.
|
|
67207
|
-
PUBLIC SECTION.
|
|
67208
|
-
METHODS matches.
|
|
67209
|
-
ENDCLASS.
|
|
67210
|
-
|
|
67211
|
-
CLASS lcl IMPLEMENTATION.
|
|
67212
|
-
METHOD matches.
|
|
67213
|
-
ENDMETHOD.
|
|
67206
|
+
badExample: `CLASS lcl DEFINITION.
|
|
67207
|
+
PUBLIC SECTION.
|
|
67208
|
+
METHODS matches.
|
|
67209
|
+
ENDCLASS.
|
|
67210
|
+
|
|
67211
|
+
CLASS lcl IMPLEMENTATION.
|
|
67212
|
+
METHOD matches.
|
|
67213
|
+
ENDMETHOD.
|
|
67214
67214
|
ENDCLASS.`,
|
|
67215
67215
|
};
|
|
67216
67216
|
}
|
|
@@ -67401,12 +67401,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
67401
67401
|
// eslint-disable-next-line max-len
|
|
67402
67402
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
67403
67403
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67404
|
-
badExample: `CLASS lcl DEFINITION.
|
|
67405
|
-
PUBLIC SECTION.
|
|
67406
|
-
METHODS
|
|
67407
|
-
foobar
|
|
67408
|
-
EXPORTING foo TYPE i
|
|
67409
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
67404
|
+
badExample: `CLASS lcl DEFINITION.
|
|
67405
|
+
PUBLIC SECTION.
|
|
67406
|
+
METHODS
|
|
67407
|
+
foobar
|
|
67408
|
+
EXPORTING foo TYPE i
|
|
67409
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
67410
67410
|
ENDCLASS.`,
|
|
67411
67411
|
};
|
|
67412
67412
|
}
|
|
@@ -67786,7 +67786,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67786
67786
|
key: "nesting",
|
|
67787
67787
|
title: "Check nesting depth",
|
|
67788
67788
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67789
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67789
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67790
67790
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67791
67791
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67792
67792
|
};
|
|
@@ -68029,7 +68029,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
68029
68029
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
68030
68030
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68031
68031
|
badExample: `var1 = var2 = var3.`,
|
|
68032
|
-
goodExample: `var2 = var3.
|
|
68032
|
+
goodExample: `var2 = var3.
|
|
68033
68033
|
var1 = var2.`,
|
|
68034
68034
|
};
|
|
68035
68035
|
}
|
|
@@ -68088,8 +68088,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
68088
68088
|
key: "no_external_form_calls",
|
|
68089
68089
|
title: "No external FORM calls",
|
|
68090
68090
|
shortDescription: `Detect external form calls`,
|
|
68091
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
68092
|
-
|
|
68091
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
68092
|
+
|
|
68093
68093
|
PERFORM foo(bar).`,
|
|
68094
68094
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68095
68095
|
};
|
|
@@ -68150,17 +68150,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
68150
68150
|
key: "no_inline_in_optional_branches",
|
|
68151
68151
|
title: "Don't declare inline in optional branches",
|
|
68152
68152
|
shortDescription: `Don't declare inline in optional branches`,
|
|
68153
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
68154
|
-
|
|
68155
|
-
Considered optional branches:
|
|
68156
|
-
* inside IF/ELSEIF/ELSE
|
|
68157
|
-
* inside LOOP
|
|
68158
|
-
* inside WHILE
|
|
68159
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
68160
|
-
* inside DO
|
|
68161
|
-
* inside SELECT loops
|
|
68162
|
-
|
|
68163
|
-
Not considered optional branches:
|
|
68153
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
68154
|
+
|
|
68155
|
+
Considered optional branches:
|
|
68156
|
+
* inside IF/ELSEIF/ELSE
|
|
68157
|
+
* inside LOOP
|
|
68158
|
+
* inside WHILE
|
|
68159
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
68160
|
+
* inside DO
|
|
68161
|
+
* inside SELECT loops
|
|
68162
|
+
|
|
68163
|
+
Not considered optional branches:
|
|
68164
68164
|
* TRY/CATCH/CLEANUP`,
|
|
68165
68165
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68166
68166
|
};
|
|
@@ -68260,12 +68260,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
68260
68260
|
key: "no_prefixes",
|
|
68261
68261
|
title: "No Prefixes",
|
|
68262
68262
|
shortDescription: `Dont use hungarian notation`,
|
|
68263
|
-
extendedInformation: `
|
|
68264
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
68265
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
68266
|
-
|
|
68267
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
68268
|
-
|
|
68263
|
+
extendedInformation: `
|
|
68264
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
68265
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
68266
|
+
|
|
68267
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
68268
|
+
|
|
68269
68269
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
68270
68270
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68271
68271
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -68444,7 +68444,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
68444
68444
|
return {
|
|
68445
68445
|
key: "no_public_attributes",
|
|
68446
68446
|
title: "No public attributes",
|
|
68447
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
68447
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
68448
68448
|
Exceptions are excluded from this rule.`,
|
|
68449
68449
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
68450
68450
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -68545,13 +68545,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
68545
68545
|
key: "no_yoda_conditions",
|
|
68546
68546
|
title: "No Yoda conditions",
|
|
68547
68547
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
68548
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68549
|
-
|
|
68548
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68549
|
+
|
|
68550
68550
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
68551
68551
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68552
|
-
badExample: `IF 0 <> sy-subrc.
|
|
68552
|
+
badExample: `IF 0 <> sy-subrc.
|
|
68553
68553
|
ENDIF.`,
|
|
68554
|
-
goodExample: `IF sy-subrc <> 0.
|
|
68554
|
+
goodExample: `IF sy-subrc <> 0.
|
|
68555
68555
|
ENDIF.`,
|
|
68556
68556
|
};
|
|
68557
68557
|
}
|
|
@@ -68652,8 +68652,8 @@ class NROBConsistency {
|
|
|
68652
68652
|
key: "nrob_consistency",
|
|
68653
68653
|
title: "Number range consistency",
|
|
68654
68654
|
shortDescription: `Consistency checks for number ranges`,
|
|
68655
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68656
|
-
|
|
68655
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68656
|
+
|
|
68657
68657
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
68658
68658
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68659
68659
|
};
|
|
@@ -68930,58 +68930,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68930
68930
|
title: "Obsolete statements",
|
|
68931
68931
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68932
68932
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68933
|
-
extendedInformation: `
|
|
68934
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68935
|
-
|
|
68936
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68937
|
-
|
|
68938
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68939
|
-
|
|
68940
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68941
|
-
|
|
68942
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68943
|
-
|
|
68944
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68945
|
-
|
|
68946
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68947
|
-
|
|
68948
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68949
|
-
|
|
68950
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68951
|
-
|
|
68952
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68953
|
-
|
|
68954
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68955
|
-
|
|
68956
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68957
|
-
|
|
68958
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68959
|
-
|
|
68960
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68961
|
-
|
|
68962
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68963
|
-
SELECT COUNT(*) is considered okay
|
|
68964
|
-
|
|
68965
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68966
|
-
|
|
68967
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68968
|
-
|
|
68969
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68970
|
-
|
|
68971
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68972
|
-
|
|
68973
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68974
|
-
|
|
68933
|
+
extendedInformation: `
|
|
68934
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68935
|
+
|
|
68936
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68937
|
+
|
|
68938
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68939
|
+
|
|
68940
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68941
|
+
|
|
68942
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68943
|
+
|
|
68944
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68945
|
+
|
|
68946
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68947
|
+
|
|
68948
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68949
|
+
|
|
68950
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68951
|
+
|
|
68952
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68953
|
+
|
|
68954
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68955
|
+
|
|
68956
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68957
|
+
|
|
68958
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68959
|
+
|
|
68960
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68961
|
+
|
|
68962
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68963
|
+
SELECT COUNT(*) is considered okay
|
|
68964
|
+
|
|
68965
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68966
|
+
|
|
68967
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68968
|
+
|
|
68969
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68970
|
+
|
|
68971
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68972
|
+
|
|
68973
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68974
|
+
|
|
68975
68975
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68976
|
-
badExample: `REFRESH itab.
|
|
68977
|
-
|
|
68978
|
-
COMPUTE foo = 2 + 2.
|
|
68979
|
-
|
|
68980
|
-
MULTIPLY lv_foo BY 2.
|
|
68981
|
-
|
|
68982
|
-
INTERFACE intf LOAD.
|
|
68983
|
-
|
|
68984
|
-
IF foo IS SUPPLIED.
|
|
68976
|
+
badExample: `REFRESH itab.
|
|
68977
|
+
|
|
68978
|
+
COMPUTE foo = 2 + 2.
|
|
68979
|
+
|
|
68980
|
+
MULTIPLY lv_foo BY 2.
|
|
68981
|
+
|
|
68982
|
+
INTERFACE intf LOAD.
|
|
68983
|
+
|
|
68984
|
+
IF foo IS SUPPLIED.
|
|
68985
68985
|
ENDIF.`,
|
|
68986
68986
|
};
|
|
68987
68987
|
}
|
|
@@ -69321,9 +69321,9 @@ class OmitParameterName {
|
|
|
69321
69321
|
key: "omit_parameter_name",
|
|
69322
69322
|
title: "Omit parameter name",
|
|
69323
69323
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
69324
|
-
extendedInformation: `
|
|
69325
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
69326
|
-
|
|
69324
|
+
extendedInformation: `
|
|
69325
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
69326
|
+
|
|
69327
69327
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
69328
69328
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
69329
69329
|
badExample: `method( param = 2 ).`,
|
|
@@ -69529,20 +69529,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
69529
69529
|
shortDescription: `Omit RECEIVING`,
|
|
69530
69530
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
69531
69531
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69532
|
-
badExample: `
|
|
69533
|
-
upload_pack(
|
|
69534
|
-
EXPORTING
|
|
69535
|
-
io_client = lo_client
|
|
69536
|
-
iv_url = iv_url
|
|
69537
|
-
iv_deepen_level = iv_deepen_level
|
|
69538
|
-
it_hashes = lt_hashes
|
|
69539
|
-
RECEIVING
|
|
69532
|
+
badExample: `
|
|
69533
|
+
upload_pack(
|
|
69534
|
+
EXPORTING
|
|
69535
|
+
io_client = lo_client
|
|
69536
|
+
iv_url = iv_url
|
|
69537
|
+
iv_deepen_level = iv_deepen_level
|
|
69538
|
+
it_hashes = lt_hashes
|
|
69539
|
+
RECEIVING
|
|
69540
69540
|
rt_objects = et_objects ).`,
|
|
69541
|
-
goodExample: `
|
|
69542
|
-
et_objects = upload_pack(
|
|
69543
|
-
io_client = lo_client
|
|
69544
|
-
iv_url = iv_url
|
|
69545
|
-
iv_deepen_level = iv_deepen_level
|
|
69541
|
+
goodExample: `
|
|
69542
|
+
et_objects = upload_pack(
|
|
69543
|
+
io_client = lo_client
|
|
69544
|
+
iv_url = iv_url
|
|
69545
|
+
iv_deepen_level = iv_deepen_level
|
|
69546
69546
|
it_hashes = lt_hashes ).`,
|
|
69547
69547
|
};
|
|
69548
69548
|
}
|
|
@@ -69606,8 +69606,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
69606
69606
|
return {
|
|
69607
69607
|
key: "parser_702_chaining",
|
|
69608
69608
|
title: "Parser Error, bad chanining on 702",
|
|
69609
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69610
|
-
this rule finds these and reports errors.
|
|
69609
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69610
|
+
this rule finds these and reports errors.
|
|
69611
69611
|
Only active on target version 702 and below.`,
|
|
69612
69612
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69613
69613
|
};
|
|
@@ -69687,8 +69687,8 @@ class ParserError {
|
|
|
69687
69687
|
return {
|
|
69688
69688
|
key: "parser_error",
|
|
69689
69689
|
title: "Parser error",
|
|
69690
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69691
|
-
|
|
69690
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69691
|
+
|
|
69692
69692
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69693
69693
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69694
69694
|
};
|
|
@@ -69773,7 +69773,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69773
69773
|
return {
|
|
69774
69774
|
key: "parser_missing_space",
|
|
69775
69775
|
title: "Parser Error, missing space",
|
|
69776
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69776
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69777
69777
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69778
69778
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69779
69779
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -70196,25 +70196,25 @@ class PreferInline {
|
|
|
70196
70196
|
key: "prefer_inline",
|
|
70197
70197
|
title: "Prefer Inline Declarations",
|
|
70198
70198
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
70199
|
-
extendedInformation: `EXPERIMENTAL
|
|
70200
|
-
|
|
70201
|
-
Activates if language version is v740sp02 or above.
|
|
70202
|
-
|
|
70203
|
-
Variables must be local(METHOD or FORM).
|
|
70204
|
-
|
|
70205
|
-
No generic or void typed variables. No syntax errors.
|
|
70206
|
-
|
|
70207
|
-
First position used must be a full/pure write.
|
|
70208
|
-
|
|
70209
|
-
Move statment is not a cast(?=)
|
|
70210
|
-
|
|
70199
|
+
extendedInformation: `EXPERIMENTAL
|
|
70200
|
+
|
|
70201
|
+
Activates if language version is v740sp02 or above.
|
|
70202
|
+
|
|
70203
|
+
Variables must be local(METHOD or FORM).
|
|
70204
|
+
|
|
70205
|
+
No generic or void typed variables. No syntax errors.
|
|
70206
|
+
|
|
70207
|
+
First position used must be a full/pure write.
|
|
70208
|
+
|
|
70209
|
+
Move statment is not a cast(?=)
|
|
70210
|
+
|
|
70211
70211
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
70212
70212
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
70213
|
-
badExample: `DATA foo TYPE i.
|
|
70214
|
-
foo = 2.
|
|
70215
|
-
DATA percentage TYPE decfloat34.
|
|
70213
|
+
badExample: `DATA foo TYPE i.
|
|
70214
|
+
foo = 2.
|
|
70215
|
+
DATA percentage TYPE decfloat34.
|
|
70216
70216
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
70217
|
-
goodExample: `DATA(foo) = 2.
|
|
70217
|
+
goodExample: `DATA(foo) = 2.
|
|
70218
70218
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
70219
70219
|
};
|
|
70220
70220
|
}
|
|
@@ -70428,18 +70428,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
70428
70428
|
key: "prefer_is_not",
|
|
70429
70429
|
title: "Prefer IS NOT to NOT IS",
|
|
70430
70430
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
70431
|
-
extendedInformation: `
|
|
70432
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
70433
|
-
|
|
70431
|
+
extendedInformation: `
|
|
70432
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
70433
|
+
|
|
70434
70434
|
"if not is_valid( )." examples are skipped`,
|
|
70435
70435
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70436
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
70437
|
-
IF variable NP 'TODO*'.
|
|
70438
|
-
IF variable <> 42.
|
|
70436
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
70437
|
+
IF variable NP 'TODO*'.
|
|
70438
|
+
IF variable <> 42.
|
|
70439
70439
|
IF variable CO 'hello'.`,
|
|
70440
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
70441
|
-
IF NOT variable CP 'TODO*'.
|
|
70442
|
-
IF NOT variable = 42.
|
|
70440
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
70441
|
+
IF NOT variable CP 'TODO*'.
|
|
70442
|
+
IF NOT variable = 42.
|
|
70443
70443
|
IF NOT variable CA 'hello'.`,
|
|
70444
70444
|
};
|
|
70445
70445
|
}
|
|
@@ -70627,14 +70627,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
70627
70627
|
key: "prefer_raise_exception_new",
|
|
70628
70628
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
70629
70629
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
70630
|
-
extendedInformation: `
|
|
70631
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70632
|
-
|
|
70630
|
+
extendedInformation: `
|
|
70631
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70632
|
+
|
|
70633
70633
|
From 752 and up`,
|
|
70634
70634
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
70635
70635
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
70636
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70637
|
-
EXPORTING
|
|
70636
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70637
|
+
EXPORTING
|
|
70638
70638
|
previous = exception.`,
|
|
70639
70639
|
};
|
|
70640
70640
|
}
|
|
@@ -70712,12 +70712,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70712
70712
|
key: "prefer_returning_to_exporting",
|
|
70713
70713
|
title: "Prefer RETURNING to EXPORTING",
|
|
70714
70714
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70715
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70715
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70716
70716
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70717
70717
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70718
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70719
|
-
PUBLIC SECTION.
|
|
70720
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70718
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70719
|
+
PUBLIC SECTION.
|
|
70720
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70721
70721
|
ENDCLASS.`,
|
|
70722
70722
|
};
|
|
70723
70723
|
}
|
|
@@ -70813,8 +70813,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70813
70813
|
key: "prefer_xsdbool",
|
|
70814
70814
|
title: "Prefer xsdbool over boolc",
|
|
70815
70815
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70816
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70817
|
-
|
|
70816
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70817
|
+
|
|
70818
70818
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70819
70819
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70820
70820
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70886,9 +70886,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70886
70886
|
title: "Preferred compare operator",
|
|
70887
70887
|
shortDescription: `Configure undesired operator variants`,
|
|
70888
70888
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70889
|
-
badExample: `IF foo EQ bar.
|
|
70889
|
+
badExample: `IF foo EQ bar.
|
|
70890
70890
|
ENDIF.`,
|
|
70891
|
-
goodExample: `IF foo = bar.
|
|
70891
|
+
goodExample: `IF foo = bar.
|
|
70892
70892
|
ENDIF.`,
|
|
70893
70893
|
};
|
|
70894
70894
|
}
|
|
@@ -71112,26 +71112,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
71112
71112
|
key: "reduce_procedural_code",
|
|
71113
71113
|
title: "Reduce procedural code",
|
|
71114
71114
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
71115
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
71116
|
-
|
|
71117
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
71118
|
-
|
|
71115
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
71116
|
+
|
|
71117
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
71118
|
+
|
|
71119
71119
|
Comments are not counted as statements.`,
|
|
71120
71120
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
71121
|
-
badExample: `FORM foo.
|
|
71122
|
-
DATA lv_bar TYPE i.
|
|
71123
|
-
lv_bar = 2 + 2.
|
|
71124
|
-
IF lv_bar = 4.
|
|
71125
|
-
WRITE 'hello world'.
|
|
71126
|
-
ENDIF.
|
|
71127
|
-
DATA lv_bar TYPE i.
|
|
71128
|
-
lv_bar = 2 + 2.
|
|
71129
|
-
IF lv_bar = 4.
|
|
71130
|
-
WRITE 'hello world'.
|
|
71131
|
-
ENDIF.
|
|
71121
|
+
badExample: `FORM foo.
|
|
71122
|
+
DATA lv_bar TYPE i.
|
|
71123
|
+
lv_bar = 2 + 2.
|
|
71124
|
+
IF lv_bar = 4.
|
|
71125
|
+
WRITE 'hello world'.
|
|
71126
|
+
ENDIF.
|
|
71127
|
+
DATA lv_bar TYPE i.
|
|
71128
|
+
lv_bar = 2 + 2.
|
|
71129
|
+
IF lv_bar = 4.
|
|
71130
|
+
WRITE 'hello world'.
|
|
71131
|
+
ENDIF.
|
|
71132
71132
|
ENDFORM.`,
|
|
71133
|
-
goodExample: `FORM foo.
|
|
71134
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
71133
|
+
goodExample: `FORM foo.
|
|
71134
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
71135
71135
|
ENDFORM.`,
|
|
71136
71136
|
};
|
|
71137
71137
|
}
|
|
@@ -71375,10 +71375,10 @@ class RemoveDescriptions {
|
|
|
71375
71375
|
return {
|
|
71376
71376
|
key: "remove_descriptions",
|
|
71377
71377
|
title: "Remove descriptions",
|
|
71378
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
71379
|
-
|
|
71380
|
-
Class descriptions are required, see rule description_empty.
|
|
71381
|
-
|
|
71378
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
71379
|
+
|
|
71380
|
+
Class descriptions are required, see rule description_empty.
|
|
71381
|
+
|
|
71382
71382
|
Consider using ABAP Doc for documentation.`,
|
|
71383
71383
|
tags: [],
|
|
71384
71384
|
};
|
|
@@ -71503,14 +71503,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
71503
71503
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71504
71504
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
71505
71505
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
71506
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
71506
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
71507
71507
|
DESTINATION lv_rfc.`,
|
|
71508
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71509
|
-
DESTINATION lv_rfc
|
|
71510
|
-
EXCEPTIONS
|
|
71511
|
-
system_failure = 1 MESSAGE msg
|
|
71512
|
-
communication_failure = 2 MESSAGE msg
|
|
71513
|
-
resource_failure = 3
|
|
71508
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71509
|
+
DESTINATION lv_rfc
|
|
71510
|
+
EXCEPTIONS
|
|
71511
|
+
system_failure = 1 MESSAGE msg
|
|
71512
|
+
communication_failure = 2 MESSAGE msg
|
|
71513
|
+
resource_failure = 3
|
|
71514
71514
|
OTHERS = 4.`,
|
|
71515
71515
|
};
|
|
71516
71516
|
}
|
|
@@ -71594,11 +71594,11 @@ class SelectAddOrderBy {
|
|
|
71594
71594
|
key: "select_add_order_by",
|
|
71595
71595
|
title: "SELECT add ORDER BY",
|
|
71596
71596
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
71597
|
-
extendedInformation: `
|
|
71598
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71599
|
-
|
|
71600
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
71601
|
-
|
|
71597
|
+
extendedInformation: `
|
|
71598
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71599
|
+
|
|
71600
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
71601
|
+
|
|
71602
71602
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
71603
71603
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71604
71604
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71729,14 +71729,14 @@ class SelectPerformance {
|
|
|
71729
71729
|
key: "select_performance",
|
|
71730
71730
|
title: "SELECT performance",
|
|
71731
71731
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71732
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71733
|
-
|
|
71732
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71733
|
+
|
|
71734
71734
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71735
71735
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71736
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71737
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71736
|
+
badExample: `SELECT field1, field2 FROM table
|
|
71737
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71738
71738
|
ENDSELECT.`,
|
|
71739
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71739
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71740
71740
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71741
71741
|
};
|
|
71742
71742
|
}
|
|
@@ -71850,8 +71850,8 @@ class SelectSingleFullKey {
|
|
|
71850
71850
|
key: "select_single_full_key",
|
|
71851
71851
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71852
71852
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71853
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71854
|
-
|
|
71853
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71854
|
+
|
|
71855
71855
|
If the statement contains a JOIN it is not checked`,
|
|
71856
71856
|
pseudoComment: "EC CI_NOORDER",
|
|
71857
71857
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -72279,8 +72279,8 @@ class SICFConsistency {
|
|
|
72279
72279
|
key: "sicf_consistency",
|
|
72280
72280
|
title: "SICF consistency",
|
|
72281
72281
|
shortDescription: `Checks the validity of ICF services`,
|
|
72282
|
-
extendedInformation: `* Class defined in handler must exist
|
|
72283
|
-
* Class must not have any syntax errors
|
|
72282
|
+
extendedInformation: `* Class defined in handler must exist
|
|
72283
|
+
* Class must not have any syntax errors
|
|
72284
72284
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
72285
72285
|
};
|
|
72286
72286
|
}
|
|
@@ -72392,23 +72392,23 @@ class SlowParameterPassing {
|
|
|
72392
72392
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
72393
72393
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
72394
72394
|
tags: [_irule_1.RuleTag.Performance],
|
|
72395
|
-
badExample: `CLASS lcl DEFINITION.
|
|
72396
|
-
PUBLIC SECTION.
|
|
72397
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
72398
|
-
ENDCLASS.
|
|
72399
|
-
CLASS lcl IMPLEMENTATION.
|
|
72400
|
-
METHOD bar.
|
|
72401
|
-
WRITE sdf.
|
|
72402
|
-
ENDMETHOD.
|
|
72395
|
+
badExample: `CLASS lcl DEFINITION.
|
|
72396
|
+
PUBLIC SECTION.
|
|
72397
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
72398
|
+
ENDCLASS.
|
|
72399
|
+
CLASS lcl IMPLEMENTATION.
|
|
72400
|
+
METHOD bar.
|
|
72401
|
+
WRITE sdf.
|
|
72402
|
+
ENDMETHOD.
|
|
72403
72403
|
ENDCLASS.`,
|
|
72404
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
72405
|
-
PUBLIC SECTION.
|
|
72406
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
72407
|
-
ENDCLASS.
|
|
72408
|
-
CLASS lcl IMPLEMENTATION.
|
|
72409
|
-
METHOD bar.
|
|
72410
|
-
WRITE sdf.
|
|
72411
|
-
ENDMETHOD.
|
|
72404
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
72405
|
+
PUBLIC SECTION.
|
|
72406
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
72407
|
+
ENDCLASS.
|
|
72408
|
+
CLASS lcl IMPLEMENTATION.
|
|
72409
|
+
METHOD bar.
|
|
72410
|
+
WRITE sdf.
|
|
72411
|
+
ENDMETHOD.
|
|
72412
72412
|
ENDCLASS.`,
|
|
72413
72413
|
};
|
|
72414
72414
|
}
|
|
@@ -72679,8 +72679,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
72679
72679
|
key: "space_before_dot",
|
|
72680
72680
|
title: "Space before dot",
|
|
72681
72681
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
72682
|
-
extendedInformation: `
|
|
72683
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72682
|
+
extendedInformation: `
|
|
72683
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72684
72684
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
72685
72685
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72686
72686
|
badExample: `WRITE bar .`,
|
|
@@ -72866,12 +72866,12 @@ class SQLValueConversion {
|
|
|
72866
72866
|
key: "sql_value_conversion",
|
|
72867
72867
|
title: "Implicit SQL Value Conversion",
|
|
72868
72868
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72869
|
-
extendedInformation: `
|
|
72870
|
-
* Integer to CHAR conversion
|
|
72871
|
-
* Integer to NUMC conversion
|
|
72872
|
-
* NUMC to Integer conversion
|
|
72873
|
-
* CHAR to Integer conversion
|
|
72874
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72869
|
+
extendedInformation: `
|
|
72870
|
+
* Integer to CHAR conversion
|
|
72871
|
+
* Integer to NUMC conversion
|
|
72872
|
+
* NUMC to Integer conversion
|
|
72873
|
+
* CHAR to Integer conversion
|
|
72874
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72875
72875
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72876
72876
|
tags: [],
|
|
72877
72877
|
};
|
|
@@ -72943,7 +72943,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72943
72943
|
key: "start_at_tab",
|
|
72944
72944
|
title: "Start at tab",
|
|
72945
72945
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72946
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72946
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72947
72947
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72948
72948
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72949
72949
|
badExample: ` WRITE a.`,
|
|
@@ -73120,12 +73120,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
73120
73120
|
key: "strict_sql",
|
|
73121
73121
|
title: "Strict SQL",
|
|
73122
73122
|
shortDescription: `Strict SQL`,
|
|
73123
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
73124
|
-
|
|
73125
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
73126
|
-
|
|
73127
|
-
Also see separate rule sql_escape_host_variables
|
|
73128
|
-
|
|
73123
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
73124
|
+
|
|
73125
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
73126
|
+
|
|
73127
|
+
Also see separate rule sql_escape_host_variables
|
|
73128
|
+
|
|
73129
73129
|
Activates from v750 and up`,
|
|
73130
73130
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
73131
73131
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -73379,11 +73379,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
73379
73379
|
key: "sy_modification",
|
|
73380
73380
|
title: "Modification of SY fields",
|
|
73381
73381
|
shortDescription: `Finds modification of sy fields`,
|
|
73382
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
73383
|
-
|
|
73382
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
73383
|
+
|
|
73384
73384
|
Changes to SY-TVAR* fields are not reported`,
|
|
73385
73385
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73386
|
-
badExample: `sy-uname = 2.
|
|
73386
|
+
badExample: `sy-uname = 2.
|
|
73387
73387
|
sy = sy.`,
|
|
73388
73388
|
};
|
|
73389
73389
|
}
|
|
@@ -73445,8 +73445,8 @@ class TABLEnhancementCategory {
|
|
|
73445
73445
|
key: "tabl_enhancement_category",
|
|
73446
73446
|
title: "TABL enhancement category must be set",
|
|
73447
73447
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
73448
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73449
|
-
|
|
73448
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73449
|
+
|
|
73450
73450
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
73451
73451
|
tags: [],
|
|
73452
73452
|
};
|
|
@@ -73511,8 +73511,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
73511
73511
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
73512
73512
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
73513
73513
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73514
|
-
badExample: `FORM foo.
|
|
73515
|
-
TABLES t100.
|
|
73514
|
+
badExample: `FORM foo.
|
|
73515
|
+
TABLES t100.
|
|
73516
73516
|
ENDFORM.`,
|
|
73517
73517
|
goodExample: `TABLES t000.`,
|
|
73518
73518
|
};
|
|
@@ -73640,9 +73640,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
73640
73640
|
title: "Type FORM parameters",
|
|
73641
73641
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
73642
73642
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73643
|
-
badExample: `FORM foo USING bar.
|
|
73643
|
+
badExample: `FORM foo USING bar.
|
|
73644
73644
|
ENDFORM.`,
|
|
73645
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
73645
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
73646
73646
|
ENDFORM.`,
|
|
73647
73647
|
};
|
|
73648
73648
|
}
|
|
@@ -74315,38 +74315,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
74315
74315
|
key: "unnecessary_pragma",
|
|
74316
74316
|
title: "Unnecessary Pragma",
|
|
74317
74317
|
shortDescription: `Finds pragmas which can be removed`,
|
|
74318
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
74319
|
-
|
|
74320
|
-
* NEEDED without definition
|
|
74321
|
-
|
|
74322
|
-
* NO_TEXT without texts
|
|
74323
|
-
|
|
74324
|
-
* SUBRC_OK where sy-subrc is checked
|
|
74325
|
-
|
|
74318
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
74319
|
+
|
|
74320
|
+
* NEEDED without definition
|
|
74321
|
+
|
|
74322
|
+
* NO_TEXT without texts
|
|
74323
|
+
|
|
74324
|
+
* SUBRC_OK where sy-subrc is checked
|
|
74325
|
+
|
|
74326
74326
|
NO_HANDLER inside macros are not checked`,
|
|
74327
74327
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
74328
|
-
badExample: `TRY.
|
|
74329
|
-
...
|
|
74330
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
74331
|
-
RETURN. " it has a handler
|
|
74332
|
-
ENDTRY.
|
|
74333
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
74334
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
74335
|
-
IF sy-subrc <> 0.
|
|
74328
|
+
badExample: `TRY.
|
|
74329
|
+
...
|
|
74330
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
74331
|
+
RETURN. " it has a handler
|
|
74332
|
+
ENDTRY.
|
|
74333
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
74334
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
74335
|
+
IF sy-subrc <> 0.
|
|
74336
74336
|
ENDIF.`,
|
|
74337
|
-
goodExample: `TRY.
|
|
74338
|
-
...
|
|
74339
|
-
CATCH zcx_abapgit_exception.
|
|
74340
|
-
RETURN.
|
|
74341
|
-
ENDTRY.
|
|
74342
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
74343
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
74344
|
-
IF sy-subrc <> 0.
|
|
74345
|
-
ENDIF.
|
|
74346
|
-
|
|
74347
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
74348
|
-
test1 TYPE string,
|
|
74349
|
-
test2 TYPE string,
|
|
74337
|
+
goodExample: `TRY.
|
|
74338
|
+
...
|
|
74339
|
+
CATCH zcx_abapgit_exception.
|
|
74340
|
+
RETURN.
|
|
74341
|
+
ENDTRY.
|
|
74342
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
74343
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
74344
|
+
IF sy-subrc <> 0.
|
|
74345
|
+
ENDIF.
|
|
74346
|
+
|
|
74347
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
74348
|
+
test1 TYPE string,
|
|
74349
|
+
test2 TYPE string,
|
|
74350
74350
|
END OF blah.`,
|
|
74351
74351
|
};
|
|
74352
74352
|
}
|
|
@@ -74513,18 +74513,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
74513
74513
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
74514
74514
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
74515
74515
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
74516
|
-
badExample: `FORM hello1.
|
|
74517
|
-
WRITE 'world'.
|
|
74518
|
-
RETURN.
|
|
74519
|
-
ENDFORM.
|
|
74520
|
-
|
|
74521
|
-
FORM foo.
|
|
74522
|
-
IF 1 = 2.
|
|
74523
|
-
RETURN.
|
|
74524
|
-
ENDIF.
|
|
74516
|
+
badExample: `FORM hello1.
|
|
74517
|
+
WRITE 'world'.
|
|
74518
|
+
RETURN.
|
|
74519
|
+
ENDFORM.
|
|
74520
|
+
|
|
74521
|
+
FORM foo.
|
|
74522
|
+
IF 1 = 2.
|
|
74523
|
+
RETURN.
|
|
74524
|
+
ENDIF.
|
|
74525
74525
|
ENDFORM.`,
|
|
74526
|
-
goodExample: `FORM hello2.
|
|
74527
|
-
WRITE 'world'.
|
|
74526
|
+
goodExample: `FORM hello2.
|
|
74527
|
+
WRITE 'world'.
|
|
74528
74528
|
ENDFORM.`,
|
|
74529
74529
|
};
|
|
74530
74530
|
}
|
|
@@ -74875,13 +74875,13 @@ class UnusedMacros {
|
|
|
74875
74875
|
title: "Unused macros",
|
|
74876
74876
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74877
74877
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74878
|
-
badExample: `DEFINE foobar1.
|
|
74879
|
-
WRITE 'hello'.
|
|
74878
|
+
badExample: `DEFINE foobar1.
|
|
74879
|
+
WRITE 'hello'.
|
|
74880
74880
|
END-OF-DEFINITION.`,
|
|
74881
|
-
goodExample: `DEFINE foobar2.
|
|
74882
|
-
WRITE 'hello'.
|
|
74883
|
-
END-OF-DEFINITION.
|
|
74884
|
-
|
|
74881
|
+
goodExample: `DEFINE foobar2.
|
|
74882
|
+
WRITE 'hello'.
|
|
74883
|
+
END-OF-DEFINITION.
|
|
74884
|
+
|
|
74885
74885
|
foobar2.`,
|
|
74886
74886
|
};
|
|
74887
74887
|
}
|
|
@@ -74993,18 +74993,18 @@ class UnusedMethods {
|
|
|
74993
74993
|
key: "unused_methods",
|
|
74994
74994
|
title: "Unused methods",
|
|
74995
74995
|
shortDescription: `Checks for unused methods`,
|
|
74996
|
-
extendedInformation: `Checks private and protected methods.
|
|
74997
|
-
|
|
74998
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74999
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
75000
|
-
|
|
75001
|
-
Skips:
|
|
75002
|
-
* methods FOR TESTING
|
|
75003
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
75004
|
-
* class_constructor + constructor methods
|
|
75005
|
-
* event handlers
|
|
75006
|
-
* methods that are redefined
|
|
75007
|
-
* INCLUDEs
|
|
74996
|
+
extendedInformation: `Checks private and protected methods.
|
|
74997
|
+
|
|
74998
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74999
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
75000
|
+
|
|
75001
|
+
Skips:
|
|
75002
|
+
* methods FOR TESTING
|
|
75003
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
75004
|
+
* class_constructor + constructor methods
|
|
75005
|
+
* event handlers
|
|
75006
|
+
* methods that are redefined
|
|
75007
|
+
* INCLUDEs
|
|
75008
75008
|
`,
|
|
75009
75009
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75010
75010
|
pragma: "##CALLED",
|
|
@@ -75480,23 +75480,23 @@ class UnusedVariables {
|
|
|
75480
75480
|
key: "unused_variables",
|
|
75481
75481
|
title: "Unused variables",
|
|
75482
75482
|
shortDescription: `Checks for unused variables and constants`,
|
|
75483
|
-
extendedInformation: `Skips event parameters.
|
|
75484
|
-
|
|
75485
|
-
Note that this currently does not work if the source code uses macros.
|
|
75486
|
-
|
|
75487
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75488
|
-
|
|
75483
|
+
extendedInformation: `Skips event parameters.
|
|
75484
|
+
|
|
75485
|
+
Note that this currently does not work if the source code uses macros.
|
|
75486
|
+
|
|
75487
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75488
|
+
|
|
75489
75489
|
Errors found in INCLUDES are reported for the main program.`,
|
|
75490
75490
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75491
75491
|
pragma: "##NEEDED",
|
|
75492
75492
|
pseudoComment: "EC NEEDED",
|
|
75493
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
75494
|
-
test TYPE string,
|
|
75495
|
-
test2 TYPE string,
|
|
75493
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
75494
|
+
test TYPE string,
|
|
75495
|
+
test2 TYPE string,
|
|
75496
75496
|
END OF blah1.`,
|
|
75497
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75498
|
-
test TYPE string,
|
|
75499
|
-
test2 TYPE string,
|
|
75497
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75498
|
+
test TYPE string,
|
|
75499
|
+
test2 TYPE string,
|
|
75500
75500
|
END OF blah2.`,
|
|
75501
75501
|
};
|
|
75502
75502
|
}
|
|
@@ -75715,15 +75715,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75715
75715
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75716
75716
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75717
75717
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75718
|
-
badExample: `IF line IS INITIAL.
|
|
75719
|
-
has_entries = abap_false.
|
|
75720
|
-
ELSE.
|
|
75721
|
-
has_entries = abap_true.
|
|
75722
|
-
ENDIF.
|
|
75723
|
-
|
|
75718
|
+
badExample: `IF line IS INITIAL.
|
|
75719
|
+
has_entries = abap_false.
|
|
75720
|
+
ELSE.
|
|
75721
|
+
has_entries = abap_true.
|
|
75722
|
+
ENDIF.
|
|
75723
|
+
|
|
75724
75724
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75725
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75726
|
-
|
|
75725
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75726
|
+
|
|
75727
75727
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75728
75728
|
};
|
|
75729
75729
|
}
|
|
@@ -75841,15 +75841,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75841
75841
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75842
75842
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75843
75843
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75844
|
-
badExample: `INTERFACE lif.
|
|
75845
|
-
METHODS load_data
|
|
75846
|
-
EXCEPTIONS
|
|
75847
|
-
invalid_parameter.
|
|
75844
|
+
badExample: `INTERFACE lif.
|
|
75845
|
+
METHODS load_data
|
|
75846
|
+
EXCEPTIONS
|
|
75847
|
+
invalid_parameter.
|
|
75848
75848
|
ENDINTERFACE.`,
|
|
75849
|
-
goodExample: `INTERFACE lif.
|
|
75850
|
-
METHODS load_data
|
|
75851
|
-
RAISING
|
|
75852
|
-
cx_something.
|
|
75849
|
+
goodExample: `INTERFACE lif.
|
|
75850
|
+
METHODS load_data
|
|
75851
|
+
RAISING
|
|
75852
|
+
cx_something.
|
|
75853
75853
|
ENDINTERFACE.`,
|
|
75854
75854
|
};
|
|
75855
75855
|
}
|
|
@@ -75909,15 +75909,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75909
75909
|
key: "use_line_exists",
|
|
75910
75910
|
title: "Use line_exists",
|
|
75911
75911
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75912
|
-
extendedInformation: `
|
|
75913
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75914
|
-
|
|
75912
|
+
extendedInformation: `
|
|
75913
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75914
|
+
|
|
75915
75915
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75916
75916
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75917
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75918
|
-
IF sy-subrc = 0.
|
|
75917
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75918
|
+
IF sy-subrc = 0.
|
|
75919
75919
|
ENDIF.`,
|
|
75920
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75920
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75921
75921
|
ENDIF.`,
|
|
75922
75922
|
};
|
|
75923
75923
|
}
|
|
@@ -76027,10 +76027,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
76027
76027
|
key: "use_new",
|
|
76028
76028
|
title: "Use NEW",
|
|
76029
76029
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
76030
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
76031
|
-
|
|
76032
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
76033
|
-
|
|
76030
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
76031
|
+
|
|
76032
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
76033
|
+
|
|
76034
76034
|
Applicable from v740sp02 and up`,
|
|
76035
76035
|
badExample: `CREATE OBJECT ref.`,
|
|
76036
76036
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -76128,13 +76128,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
76128
76128
|
title: "WHEN OTHERS last",
|
|
76129
76129
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
76130
76130
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
76131
|
-
badExample: `CASE bar.
|
|
76132
|
-
WHEN OTHERS.
|
|
76133
|
-
WHEN 2.
|
|
76131
|
+
badExample: `CASE bar.
|
|
76132
|
+
WHEN OTHERS.
|
|
76133
|
+
WHEN 2.
|
|
76134
76134
|
ENDCASE.`,
|
|
76135
|
-
goodExample: `CASE bar.
|
|
76136
|
-
WHEN 2.
|
|
76137
|
-
WHEN OTHERS.
|
|
76135
|
+
goodExample: `CASE bar.
|
|
76136
|
+
WHEN 2.
|
|
76137
|
+
WHEN OTHERS.
|
|
76138
76138
|
ENDCASE.`,
|
|
76139
76139
|
};
|
|
76140
76140
|
}
|
|
@@ -88953,11 +88953,11 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
|
88953
88953
|
}
|
|
88954
88954
|
|
|
88955
88955
|
if ('CI' in env) {
|
|
88956
|
-
if ('GITHUB_ACTIONS'
|
|
88956
|
+
if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {
|
|
88957
88957
|
return 3;
|
|
88958
88958
|
}
|
|
88959
88959
|
|
|
88960
|
-
if (['TRAVIS', '
|
|
88960
|
+
if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
88961
88961
|
return 1;
|
|
88962
88962
|
}
|
|
88963
88963
|
|