@abaplint/cli 2.113.16 → 2.113.18
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 +868 -850
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -1009,10 +1009,18 @@ async function run(arg) {
|
|
|
1009
1009
|
if (config.get().global.files === undefined) {
|
|
1010
1010
|
throw "Error: Update abaplint configuration file to latest format";
|
|
1011
1011
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1012
|
+
if (arg.file) {
|
|
1013
|
+
const files = file_operations_1.FileOperations.loadFileNames(base + arg.file);
|
|
1014
|
+
loaded = await file_operations_1.FileOperations.loadFiles(arg.compress, files, progress);
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
const configFiles = config.get().global.files;
|
|
1018
|
+
const filesList = Array.isArray(configFiles) ? configFiles : [configFiles];
|
|
1019
|
+
for (const l of filesList) {
|
|
1020
|
+
const files = file_operations_1.FileOperations.loadFileNames(base + l);
|
|
1021
|
+
loaded.push(...await file_operations_1.FileOperations.loadFiles(arg.compress, files, progress));
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1016
1024
|
deps = await loadDependencies(config, arg.compress, progress, base);
|
|
1017
1025
|
reg = new core_1.Registry(config);
|
|
1018
1026
|
reg.addDependencies(deps);
|
|
@@ -35165,13 +35173,13 @@ class FlowGraph {
|
|
|
35165
35173
|
this.label = label;
|
|
35166
35174
|
}
|
|
35167
35175
|
toDigraph() {
|
|
35168
|
-
return `digraph G {
|
|
35169
|
-
labelloc="t";
|
|
35170
|
-
label="${this.label}";
|
|
35171
|
-
graph [fontname = "helvetica"];
|
|
35172
|
-
node [fontname = "helvetica", shape="box"];
|
|
35173
|
-
edge [fontname = "helvetica"];
|
|
35174
|
-
${this.toTextEdges()}
|
|
35176
|
+
return `digraph G {
|
|
35177
|
+
labelloc="t";
|
|
35178
|
+
label="${this.label}";
|
|
35179
|
+
graph [fontname = "helvetica"];
|
|
35180
|
+
node [fontname = "helvetica", shape="box"];
|
|
35181
|
+
edge [fontname = "helvetica"];
|
|
35182
|
+
${this.toTextEdges()}
|
|
35175
35183
|
}`;
|
|
35176
35184
|
}
|
|
35177
35185
|
listSources(node) {
|
|
@@ -43421,13 +43429,13 @@ class Help {
|
|
|
43421
43429
|
/////////////////////////////////////////////////
|
|
43422
43430
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43423
43431
|
let content = "";
|
|
43424
|
-
content = `
|
|
43425
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43426
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43427
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43428
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43429
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43430
|
-
<hr>
|
|
43432
|
+
content = `
|
|
43433
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43434
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43435
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43436
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43437
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43438
|
+
<hr>
|
|
43431
43439
|
` +
|
|
43432
43440
|
"<tt>" + textDocument.uri + " (" +
|
|
43433
43441
|
(position.line + 1) + ", " +
|
|
@@ -52747,7 +52755,7 @@ class Registry {
|
|
|
52747
52755
|
}
|
|
52748
52756
|
static abaplintVersion() {
|
|
52749
52757
|
// magic, see build script "version.sh"
|
|
52750
|
-
return "2.113.
|
|
52758
|
+
return "2.113.18";
|
|
52751
52759
|
}
|
|
52752
52760
|
getDDICReferences() {
|
|
52753
52761
|
return this.ddicReferences;
|
|
@@ -53066,10 +53074,10 @@ class SevenBitAscii {
|
|
|
53066
53074
|
key: "7bit_ascii",
|
|
53067
53075
|
title: "Check for 7bit ascii",
|
|
53068
53076
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53069
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53070
|
-
|
|
53071
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53072
|
-
|
|
53077
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53078
|
+
|
|
53079
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53080
|
+
|
|
53073
53081
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53074
53082
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53075
53083
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53275,10 +53283,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53275
53283
|
key: "abapdoc",
|
|
53276
53284
|
title: "Check abapdoc",
|
|
53277
53285
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53278
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53279
|
-
|
|
53280
|
-
Plus class and interface definitions.
|
|
53281
|
-
|
|
53286
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53287
|
+
|
|
53288
|
+
Plus class and interface definitions.
|
|
53289
|
+
|
|
53282
53290
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53283
53291
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53284
53292
|
};
|
|
@@ -53415,27 +53423,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53415
53423
|
title: "Add test attributes for tests classes with test methods",
|
|
53416
53424
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53417
53425
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53418
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53419
|
-
PUBLIC SECTION.
|
|
53420
|
-
PROTECTED SECTION.
|
|
53421
|
-
PRIVATE SECTION.
|
|
53422
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53423
|
-
ENDCLASS.
|
|
53424
|
-
|
|
53425
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53426
|
-
METHOD test.
|
|
53427
|
-
ENDMETHOD.
|
|
53426
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53427
|
+
PUBLIC SECTION.
|
|
53428
|
+
PROTECTED SECTION.
|
|
53429
|
+
PRIVATE SECTION.
|
|
53430
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53431
|
+
ENDCLASS.
|
|
53432
|
+
|
|
53433
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53434
|
+
METHOD test.
|
|
53435
|
+
ENDMETHOD.
|
|
53428
53436
|
ENDCLASS.`,
|
|
53429
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53430
|
-
PUBLIC SECTION.
|
|
53431
|
-
PROTECTED SECTION.
|
|
53432
|
-
PRIVATE SECTION.
|
|
53433
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53434
|
-
ENDCLASS.
|
|
53435
|
-
|
|
53436
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53437
|
-
METHOD test.
|
|
53438
|
-
ENDMETHOD.
|
|
53437
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53438
|
+
PUBLIC SECTION.
|
|
53439
|
+
PROTECTED SECTION.
|
|
53440
|
+
PRIVATE SECTION.
|
|
53441
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53442
|
+
ENDCLASS.
|
|
53443
|
+
|
|
53444
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53445
|
+
METHOD test.
|
|
53446
|
+
ENDMETHOD.
|
|
53439
53447
|
ENDCLASS.`,
|
|
53440
53448
|
};
|
|
53441
53449
|
}
|
|
@@ -53521,49 +53529,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53521
53529
|
key: "align_parameters",
|
|
53522
53530
|
title: "Align Parameters",
|
|
53523
53531
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53524
|
-
extendedInformation: `Checks:
|
|
53525
|
-
* function module calls
|
|
53526
|
-
* method calls
|
|
53527
|
-
* VALUE constructors
|
|
53528
|
-
* NEW constructors
|
|
53529
|
-
* RAISE EXCEPTION statements
|
|
53530
|
-
* CREATE OBJECT statements
|
|
53531
|
-
* RAISE EVENT statements
|
|
53532
|
-
|
|
53533
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53534
|
-
|
|
53535
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53536
|
-
|
|
53537
|
-
If parameters are on the same row, no issues are reported, see
|
|
53532
|
+
extendedInformation: `Checks:
|
|
53533
|
+
* function module calls
|
|
53534
|
+
* method calls
|
|
53535
|
+
* VALUE constructors
|
|
53536
|
+
* NEW constructors
|
|
53537
|
+
* RAISE EXCEPTION statements
|
|
53538
|
+
* CREATE OBJECT statements
|
|
53539
|
+
* RAISE EVENT statements
|
|
53540
|
+
|
|
53541
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53542
|
+
|
|
53543
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53544
|
+
|
|
53545
|
+
If parameters are on the same row, no issues are reported, see
|
|
53538
53546
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53539
53547
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53540
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53541
|
-
EXPORTING
|
|
53542
|
-
foo = 2
|
|
53543
|
-
parameter = 3.
|
|
53544
|
-
|
|
53545
|
-
foobar( moo = 1
|
|
53546
|
-
param = 1 ).
|
|
53547
|
-
|
|
53548
|
-
foo = VALUE #(
|
|
53549
|
-
foo = bar
|
|
53548
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53549
|
+
EXPORTING
|
|
53550
|
+
foo = 2
|
|
53551
|
+
parameter = 3.
|
|
53552
|
+
|
|
53553
|
+
foobar( moo = 1
|
|
53554
|
+
param = 1 ).
|
|
53555
|
+
|
|
53556
|
+
foo = VALUE #(
|
|
53557
|
+
foo = bar
|
|
53550
53558
|
moo = 2 ).`,
|
|
53551
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53552
|
-
EXPORTING
|
|
53553
|
-
foo = 2
|
|
53554
|
-
parameter = 3.
|
|
53555
|
-
|
|
53556
|
-
foobar( moo = 1
|
|
53557
|
-
param = 1 ).
|
|
53558
|
-
|
|
53559
|
-
foo = VALUE #(
|
|
53560
|
-
foo = bar
|
|
53561
|
-
moo = 2 ).
|
|
53562
|
-
|
|
53563
|
-
DATA(sdf) = VALUE type(
|
|
53564
|
-
common_val = 2
|
|
53565
|
-
another_common = 5
|
|
53566
|
-
( row_value = 4
|
|
53559
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53560
|
+
EXPORTING
|
|
53561
|
+
foo = 2
|
|
53562
|
+
parameter = 3.
|
|
53563
|
+
|
|
53564
|
+
foobar( moo = 1
|
|
53565
|
+
param = 1 ).
|
|
53566
|
+
|
|
53567
|
+
foo = VALUE #(
|
|
53568
|
+
foo = bar
|
|
53569
|
+
moo = 2 ).
|
|
53570
|
+
|
|
53571
|
+
DATA(sdf) = VALUE type(
|
|
53572
|
+
common_val = 2
|
|
53573
|
+
another_common = 5
|
|
53574
|
+
( row_value = 4
|
|
53567
53575
|
value_foo = 5 ) ).`,
|
|
53568
53576
|
};
|
|
53569
53577
|
}
|
|
@@ -53997,37 +54005,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
53997
54005
|
key: "align_type_expressions",
|
|
53998
54006
|
title: "Align TYPE expressions",
|
|
53999
54007
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54000
|
-
extendedInformation: `
|
|
54001
|
-
Currently works for METHODS + BEGIN OF
|
|
54002
|
-
|
|
54003
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54004
|
-
|
|
54005
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54008
|
+
extendedInformation: `
|
|
54009
|
+
Currently works for METHODS + BEGIN OF
|
|
54010
|
+
|
|
54011
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54012
|
+
|
|
54013
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54006
54014
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54007
54015
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54008
|
-
badExample: `
|
|
54009
|
-
TYPES: BEGIN OF foo,
|
|
54010
|
-
bar TYPE i,
|
|
54011
|
-
foobar TYPE i,
|
|
54012
|
-
END OF foo.
|
|
54013
|
-
|
|
54014
|
-
INTERFACE lif.
|
|
54015
|
-
METHODS bar
|
|
54016
|
-
IMPORTING
|
|
54017
|
-
foo TYPE i
|
|
54018
|
-
foobar TYPE i.
|
|
54016
|
+
badExample: `
|
|
54017
|
+
TYPES: BEGIN OF foo,
|
|
54018
|
+
bar TYPE i,
|
|
54019
|
+
foobar TYPE i,
|
|
54020
|
+
END OF foo.
|
|
54021
|
+
|
|
54022
|
+
INTERFACE lif.
|
|
54023
|
+
METHODS bar
|
|
54024
|
+
IMPORTING
|
|
54025
|
+
foo TYPE i
|
|
54026
|
+
foobar TYPE i.
|
|
54019
54027
|
ENDINTERFACE.`,
|
|
54020
|
-
goodExample: `
|
|
54021
|
-
TYPES: BEGIN OF foo,
|
|
54022
|
-
bar TYPE i,
|
|
54023
|
-
foobar TYPE i,
|
|
54024
|
-
END OF foo.
|
|
54025
|
-
|
|
54026
|
-
INTERFACE lif.
|
|
54027
|
-
METHODS bar
|
|
54028
|
-
IMPORTING
|
|
54029
|
-
foo TYPE i
|
|
54030
|
-
foobar TYPE i.
|
|
54028
|
+
goodExample: `
|
|
54029
|
+
TYPES: BEGIN OF foo,
|
|
54030
|
+
bar TYPE i,
|
|
54031
|
+
foobar TYPE i,
|
|
54032
|
+
END OF foo.
|
|
54033
|
+
|
|
54034
|
+
INTERFACE lif.
|
|
54035
|
+
METHODS bar
|
|
54036
|
+
IMPORTING
|
|
54037
|
+
foo TYPE i
|
|
54038
|
+
foobar TYPE i.
|
|
54031
54039
|
ENDINTERFACE.`,
|
|
54032
54040
|
};
|
|
54033
54041
|
}
|
|
@@ -54306,16 +54314,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54306
54314
|
return {
|
|
54307
54315
|
key: "ambiguous_statement",
|
|
54308
54316
|
title: "Check for ambigious statements",
|
|
54309
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54310
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54311
|
-
|
|
54317
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54318
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54319
|
+
|
|
54312
54320
|
Only works if the target version is 740sp05 or above`,
|
|
54313
54321
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54314
|
-
badExample: `DELETE foo FROM bar.
|
|
54322
|
+
badExample: `DELETE foo FROM bar.
|
|
54315
54323
|
MODIFY foo FROM bar.`,
|
|
54316
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54317
|
-
DELETE TABLE itab FROM 2.
|
|
54318
|
-
MODIFY zfoo FROM @wa.
|
|
54324
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54325
|
+
DELETE TABLE itab FROM 2.
|
|
54326
|
+
MODIFY zfoo FROM @wa.
|
|
54319
54327
|
MODIFY TABLE foo FROM bar.`,
|
|
54320
54328
|
};
|
|
54321
54329
|
}
|
|
@@ -54420,16 +54428,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54420
54428
|
key: "avoid_use",
|
|
54421
54429
|
title: "Avoid use of certain statements",
|
|
54422
54430
|
shortDescription: `Detects usage of certain statements.`,
|
|
54423
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54424
|
-
|
|
54425
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54426
|
-
|
|
54427
|
-
STATICS: use CLASS-DATA instead
|
|
54428
|
-
|
|
54429
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54430
|
-
|
|
54431
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54432
|
-
|
|
54431
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54432
|
+
|
|
54433
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54434
|
+
|
|
54435
|
+
STATICS: use CLASS-DATA instead
|
|
54436
|
+
|
|
54437
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54438
|
+
|
|
54439
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54440
|
+
|
|
54433
54441
|
BREAK points`,
|
|
54434
54442
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54435
54443
|
};
|
|
@@ -54561,11 +54569,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54561
54569
|
title: "Check BEGIN END names",
|
|
54562
54570
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54563
54571
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54564
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54565
|
-
field TYPE i,
|
|
54572
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54573
|
+
field TYPE i,
|
|
54566
54574
|
END OF structure_not_the_same.`,
|
|
54567
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54568
|
-
field TYPE i,
|
|
54575
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54576
|
+
field TYPE i,
|
|
54569
54577
|
END OF stru.`,
|
|
54570
54578
|
};
|
|
54571
54579
|
}
|
|
@@ -54662,20 +54670,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54662
54670
|
title: "BEGIN contains single INCLUDE",
|
|
54663
54671
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54664
54672
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54665
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54666
|
-
INCLUDE TYPE dselc.
|
|
54667
|
-
TYPES: END OF dummy1.
|
|
54668
|
-
|
|
54669
|
-
DATA BEGIN OF foo.
|
|
54670
|
-
INCLUDE STRUCTURE syst.
|
|
54671
|
-
DATA END OF foo.
|
|
54672
|
-
|
|
54673
|
-
STATICS BEGIN OF bar.
|
|
54674
|
-
INCLUDE STRUCTURE syst.
|
|
54673
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54674
|
+
INCLUDE TYPE dselc.
|
|
54675
|
+
TYPES: END OF dummy1.
|
|
54676
|
+
|
|
54677
|
+
DATA BEGIN OF foo.
|
|
54678
|
+
INCLUDE STRUCTURE syst.
|
|
54679
|
+
DATA END OF foo.
|
|
54680
|
+
|
|
54681
|
+
STATICS BEGIN OF bar.
|
|
54682
|
+
INCLUDE STRUCTURE syst.
|
|
54675
54683
|
STATICS END OF bar.`,
|
|
54676
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54677
|
-
DATA field TYPE i.
|
|
54678
|
-
INCLUDE STRUCTURE dselc.
|
|
54684
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54685
|
+
DATA field TYPE i.
|
|
54686
|
+
INCLUDE STRUCTURE dselc.
|
|
54679
54687
|
DATA END OF foo.`,
|
|
54680
54688
|
};
|
|
54681
54689
|
}
|
|
@@ -54765,9 +54773,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54765
54773
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54766
54774
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54767
54775
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54768
|
-
goodExample: `TRY.
|
|
54769
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54770
|
-
CATCH cx_sy_authorization_error.
|
|
54776
|
+
goodExample: `TRY.
|
|
54777
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54778
|
+
CATCH cx_sy_authorization_error.
|
|
54771
54779
|
ENDTRY.`,
|
|
54772
54780
|
};
|
|
54773
54781
|
}
|
|
@@ -54832,10 +54840,10 @@ class CDSCommentStyle {
|
|
|
54832
54840
|
key: "cds_comment_style",
|
|
54833
54841
|
title: "CDS Comment Style",
|
|
54834
54842
|
shortDescription: `Check for obsolete comment style`,
|
|
54835
|
-
extendedInformation: `Check for obsolete comment style
|
|
54836
|
-
|
|
54837
|
-
Comments starting with "--" are considered obsolete
|
|
54838
|
-
|
|
54843
|
+
extendedInformation: `Check for obsolete comment style
|
|
54844
|
+
|
|
54845
|
+
Comments starting with "--" are considered obsolete
|
|
54846
|
+
|
|
54839
54847
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54840
54848
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54841
54849
|
badExample: "-- this is a comment",
|
|
@@ -54901,10 +54909,10 @@ class CDSLegacyView {
|
|
|
54901
54909
|
key: "cds_legacy_view",
|
|
54902
54910
|
title: "CDS Legacy View",
|
|
54903
54911
|
shortDescription: `Identify CDS Legacy Views`,
|
|
54904
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54905
|
-
|
|
54906
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54907
|
-
|
|
54912
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54913
|
+
|
|
54914
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54915
|
+
|
|
54908
54916
|
v755 and up`,
|
|
54909
54917
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54910
54918
|
};
|
|
@@ -55059,10 +55067,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55059
55067
|
key: "chain_mainly_declarations",
|
|
55060
55068
|
title: "Chain mainly declarations",
|
|
55061
55069
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55062
|
-
extendedInformation: `
|
|
55063
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55064
|
-
|
|
55065
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55070
|
+
extendedInformation: `
|
|
55071
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55072
|
+
|
|
55073
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55066
55074
|
`,
|
|
55067
55075
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55068
55076
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55238,17 +55246,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55238
55246
|
title: "Change IF to CASE",
|
|
55239
55247
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55240
55248
|
// eslint-disable-next-line max-len
|
|
55241
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55242
|
-
|
|
55249
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55250
|
+
|
|
55243
55251
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55244
55252
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55245
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55246
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55247
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55253
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55254
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55255
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55248
55256
|
ENDIF.`,
|
|
55249
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55250
|
-
WHEN 'FOO'.
|
|
55251
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55257
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55258
|
+
WHEN 'FOO'.
|
|
55259
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55252
55260
|
ENDCASE.`,
|
|
55253
55261
|
};
|
|
55254
55262
|
}
|
|
@@ -55385,8 +55393,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55385
55393
|
return {
|
|
55386
55394
|
key: "check_abstract",
|
|
55387
55395
|
title: "Check abstract methods and classes",
|
|
55388
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55389
|
-
- class defined as abstract and final,
|
|
55396
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55397
|
+
- class defined as abstract and final,
|
|
55390
55398
|
- non-abstract class contains abstract methods`,
|
|
55391
55399
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55392
55400
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55467,11 +55475,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55467
55475
|
return {
|
|
55468
55476
|
key: "check_comments",
|
|
55469
55477
|
title: "Check Comments",
|
|
55470
|
-
shortDescription: `
|
|
55478
|
+
shortDescription: `
|
|
55471
55479
|
Various checks for comment usage.`,
|
|
55472
|
-
extendedInformation: `
|
|
55473
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55474
|
-
|
|
55480
|
+
extendedInformation: `
|
|
55481
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55482
|
+
|
|
55475
55483
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55476
55484
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55477
55485
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55633,9 +55641,9 @@ class CheckInclude {
|
|
|
55633
55641
|
key: "check_include",
|
|
55634
55642
|
title: "Check INCLUDEs",
|
|
55635
55643
|
shortDescription: `Checks INCLUDE statements`,
|
|
55636
|
-
extendedInformation: `
|
|
55637
|
-
* Reports unused includes
|
|
55638
|
-
* Errors if the includes are not found
|
|
55644
|
+
extendedInformation: `
|
|
55645
|
+
* Reports unused includes
|
|
55646
|
+
* Errors if the includes are not found
|
|
55639
55647
|
* Error if including a main program`,
|
|
55640
55648
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55641
55649
|
};
|
|
@@ -55711,14 +55719,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55711
55719
|
key: "check_subrc",
|
|
55712
55720
|
title: "Check sy-subrc",
|
|
55713
55721
|
shortDescription: `Check sy-subrc`,
|
|
55714
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55715
|
-
|
|
55716
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55717
|
-
|
|
55718
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55719
|
-
|
|
55720
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55721
|
-
|
|
55722
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55723
|
+
|
|
55724
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55725
|
+
|
|
55726
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55727
|
+
|
|
55728
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55729
|
+
|
|
55722
55730
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55723
55731
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55724
55732
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56288,17 +56296,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56288
56296
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56289
56297
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56290
56298
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56291
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56292
|
-
EXCEPTIONS
|
|
56293
|
-
system_failure = 1 MESSAGE lv_message
|
|
56294
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56295
|
-
resource_failure = 1
|
|
56299
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56300
|
+
EXCEPTIONS
|
|
56301
|
+
system_failure = 1 MESSAGE lv_message
|
|
56302
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56303
|
+
resource_failure = 1
|
|
56296
56304
|
OTHERS = 1.`,
|
|
56297
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56298
|
-
EXCEPTIONS
|
|
56299
|
-
system_failure = 1 MESSAGE lv_message
|
|
56300
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56301
|
-
resource_failure = 3
|
|
56305
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56306
|
+
EXCEPTIONS
|
|
56307
|
+
system_failure = 1 MESSAGE lv_message
|
|
56308
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56309
|
+
resource_failure = 3
|
|
56302
56310
|
OTHERS = 4.`,
|
|
56303
56311
|
};
|
|
56304
56312
|
}
|
|
@@ -56544,7 +56552,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56544
56552
|
key: "commented_code",
|
|
56545
56553
|
title: "Find commented code",
|
|
56546
56554
|
shortDescription: `Detects usage of commented out code.`,
|
|
56547
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56555
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56548
56556
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56549
56557
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56550
56558
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56777,10 +56785,10 @@ class ConstructorVisibilityPublic {
|
|
|
56777
56785
|
key: "constructor_visibility_public",
|
|
56778
56786
|
title: "Check constructor visibility is public",
|
|
56779
56787
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56780
|
-
extendedInformation: `
|
|
56781
|
-
This only applies to global classes.
|
|
56782
|
-
|
|
56783
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56788
|
+
extendedInformation: `
|
|
56789
|
+
This only applies to global classes.
|
|
56790
|
+
|
|
56791
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56784
56792
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56785
56793
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56786
56794
|
};
|
|
@@ -56855,8 +56863,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56855
56863
|
key: "contains_tab",
|
|
56856
56864
|
title: "Code contains tab",
|
|
56857
56865
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56858
|
-
extendedInformation: `
|
|
56859
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56866
|
+
extendedInformation: `
|
|
56867
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56860
56868
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56861
56869
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56862
56870
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -56943,10 +56951,10 @@ class CyclicOO {
|
|
|
56943
56951
|
key: "cyclic_oo",
|
|
56944
56952
|
title: "Cyclic OO",
|
|
56945
56953
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
56946
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56947
|
-
|
|
56948
|
-
Objects must be without syntax errors for this rule to take effect
|
|
56949
|
-
|
|
56954
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56955
|
+
|
|
56956
|
+
Objects must be without syntax errors for this rule to take effect
|
|
56957
|
+
|
|
56950
56958
|
References in testclass includes are ignored`,
|
|
56951
56959
|
};
|
|
56952
56960
|
}
|
|
@@ -57189,7 +57197,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57189
57197
|
key: "dangerous_statement",
|
|
57190
57198
|
title: "Dangerous statement",
|
|
57191
57199
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57192
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57200
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57193
57201
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57194
57202
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57195
57203
|
};
|
|
@@ -57396,13 +57404,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57396
57404
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57397
57405
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57398
57406
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57399
|
-
badExample: `FROM foo.
|
|
57400
|
-
WRITE 'hello'.
|
|
57401
|
-
DATA int TYPE i.
|
|
57407
|
+
badExample: `FROM foo.
|
|
57408
|
+
WRITE 'hello'.
|
|
57409
|
+
DATA int TYPE i.
|
|
57402
57410
|
ENDFORM.`,
|
|
57403
|
-
goodExample: `FROM foo.
|
|
57404
|
-
DATA int TYPE i.
|
|
57405
|
-
WRITE 'hello'.
|
|
57411
|
+
goodExample: `FROM foo.
|
|
57412
|
+
DATA int TYPE i.
|
|
57413
|
+
WRITE 'hello'.
|
|
57406
57414
|
ENDFORM.`,
|
|
57407
57415
|
};
|
|
57408
57416
|
}
|
|
@@ -57941,39 +57949,39 @@ class Downport {
|
|
|
57941
57949
|
key: "downport",
|
|
57942
57950
|
title: "Downport statement",
|
|
57943
57951
|
shortDescription: `Downport functionality`,
|
|
57944
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57945
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57946
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57947
|
-
|
|
57948
|
-
Current rules:
|
|
57949
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57950
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57951
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
57952
|
-
* CONV is outlined
|
|
57953
|
-
* COND is outlined
|
|
57954
|
-
* REDUCE is outlined
|
|
57955
|
-
* SWITCH is outlined
|
|
57956
|
-
* FILTER is outlined
|
|
57957
|
-
* APPEND expression is outlined
|
|
57958
|
-
* INSERT expression is outlined
|
|
57959
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57960
|
-
* CAST changed to ?=
|
|
57961
|
-
* LOOP AT method_call( ) is outlined
|
|
57962
|
-
* VALUE # with structure fields
|
|
57963
|
-
* VALUE # with internal table lines
|
|
57964
|
-
* Table Expressions are outlined
|
|
57965
|
-
* SELECT INTO @DATA definitions are outlined
|
|
57966
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57967
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57968
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57969
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
57970
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57971
|
-
* line_exists and line_index is downported to READ TABLE
|
|
57972
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
57973
|
-
* MESSAGE with non simple source
|
|
57974
|
-
|
|
57975
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57976
|
-
|
|
57952
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57953
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57954
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57955
|
+
|
|
57956
|
+
Current rules:
|
|
57957
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57958
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57959
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
57960
|
+
* CONV is outlined
|
|
57961
|
+
* COND is outlined
|
|
57962
|
+
* REDUCE is outlined
|
|
57963
|
+
* SWITCH is outlined
|
|
57964
|
+
* FILTER is outlined
|
|
57965
|
+
* APPEND expression is outlined
|
|
57966
|
+
* INSERT expression is outlined
|
|
57967
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57968
|
+
* CAST changed to ?=
|
|
57969
|
+
* LOOP AT method_call( ) is outlined
|
|
57970
|
+
* VALUE # with structure fields
|
|
57971
|
+
* VALUE # with internal table lines
|
|
57972
|
+
* Table Expressions are outlined
|
|
57973
|
+
* SELECT INTO @DATA definitions are outlined
|
|
57974
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57975
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57976
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57977
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
57978
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57979
|
+
* line_exists and line_index is downported to READ TABLE
|
|
57980
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
57981
|
+
* MESSAGE with non simple source
|
|
57982
|
+
|
|
57983
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57984
|
+
|
|
57977
57985
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
57978
57986
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
57979
57987
|
};
|
|
@@ -58551,17 +58559,17 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58551
58559
|
const fieldName = f.concatTokens();
|
|
58552
58560
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58553
58561
|
}
|
|
58554
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58562
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58555
58563
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58556
58564
|
}
|
|
58557
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58565
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58558
58566
|
${indentation}`);
|
|
58559
58567
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58560
58568
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
58561
58569
|
return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), "Outline SELECT @DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
58562
58570
|
}
|
|
58563
58571
|
downportSelectTableInline(low, high, lowFile, highSyntax) {
|
|
58564
|
-
var _a, _b, _c, _d, _e;
|
|
58572
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
58565
58573
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
58566
58574
|
return undefined;
|
|
58567
58575
|
}
|
|
@@ -58582,13 +58590,22 @@ ${indentation}`);
|
|
|
58582
58590
|
if (tableName === undefined) {
|
|
58583
58591
|
return undefined;
|
|
58584
58592
|
}
|
|
58593
|
+
const tableMap = {};
|
|
58594
|
+
for (const from of sqlFrom) {
|
|
58595
|
+
const dbName = (_c = from.findDirectExpression(Expressions.DatabaseTable)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
|
|
58596
|
+
if (dbName === undefined) {
|
|
58597
|
+
continue;
|
|
58598
|
+
}
|
|
58599
|
+
const asName = ((_d = from.findDirectExpression(Expressions.SQLAsName)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase()) || dbName;
|
|
58600
|
+
tableMap[asName] = dbName;
|
|
58601
|
+
}
|
|
58585
58602
|
const fieldList = high.findFirstExpression(Expressions.SQLFieldList);
|
|
58586
58603
|
if (fieldList === undefined) {
|
|
58587
58604
|
return undefined;
|
|
58588
58605
|
}
|
|
58589
58606
|
let fieldDefinitions = "";
|
|
58590
58607
|
for (const f of fieldList.findAllExpressions(Expressions.SQLField)) {
|
|
58591
|
-
let fieldName = (
|
|
58608
|
+
let fieldName = (_e = f.findFirstExpression(Expressions.SQLFieldName)) === null || _e === void 0 ? void 0 : _e.concatTokens();
|
|
58592
58609
|
if (fieldName === undefined) {
|
|
58593
58610
|
continue;
|
|
58594
58611
|
}
|
|
@@ -58597,18 +58614,19 @@ ${indentation}`);
|
|
|
58597
58614
|
tableName = split[0];
|
|
58598
58615
|
fieldName = split[1];
|
|
58599
58616
|
}
|
|
58600
|
-
const
|
|
58601
|
-
|
|
58602
|
-
|
|
58617
|
+
const translated = tableMap[tableName.toUpperCase()];
|
|
58618
|
+
const typeName = translated + "-" + fieldName;
|
|
58619
|
+
fieldName = ((_f = f.findFirstExpression(Expressions.SQLAsName)) === null || _f === void 0 ? void 0 : _f.concatTokens()) || fieldName;
|
|
58620
|
+
fieldDefinitions += indentation + " " + fieldName + " TYPE " + typeName.toLowerCase() + ",\n";
|
|
58603
58621
|
}
|
|
58604
58622
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58605
|
-
const name = ((
|
|
58606
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58607
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58608
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58623
|
+
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
58624
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58625
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58626
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58609
58627
|
${indentation}`);
|
|
58610
58628
|
if (fieldDefinitions === "") {
|
|
58611
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58629
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58612
58630
|
${indentation}`);
|
|
58613
58631
|
}
|
|
58614
58632
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58676,7 +58694,7 @@ ${indentation}`);
|
|
|
58676
58694
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58677
58695
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58678
58696
|
const firstToken = high.getFirstToken();
|
|
58679
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58697
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58680
58698
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58681
58699
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58682
58700
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58730,7 +58748,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58730
58748
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58731
58749
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58732
58750
|
const firstToken = high.getFirstToken();
|
|
58733
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58751
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58734
58752
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58735
58753
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58736
58754
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58772,14 +58790,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58772
58790
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58773
58791
|
const firstToken = high.getFirstToken();
|
|
58774
58792
|
// note that the tabix restore should be done before throwing the exception
|
|
58775
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58776
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58777
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58778
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58779
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58780
|
-
${indentation}IF sy-subrc <> 0.
|
|
58781
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58782
|
-
${indentation}ENDIF.
|
|
58793
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58794
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58795
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58796
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58797
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58798
|
+
${indentation}IF sy-subrc <> 0.
|
|
58799
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58800
|
+
${indentation}ENDIF.
|
|
58783
58801
|
${indentation}`);
|
|
58784
58802
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58785
58803
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58836,7 +58854,7 @@ ${indentation}`);
|
|
|
58836
58854
|
const className = classNames[0].concatTokens();
|
|
58837
58855
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58838
58856
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58839
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58857
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58840
58858
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58841
58859
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58842
58860
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -58998,16 +59016,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
58998
59016
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58999
59017
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59000
59018
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59001
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59002
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59019
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59020
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59003
59021
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59004
59022
|
if (withs.length > 0) {
|
|
59005
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59006
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59007
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59023
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59024
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59025
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59008
59026
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59009
59027
|
}
|
|
59010
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59028
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59011
59029
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59012
59030
|
if (withs.length > 0) {
|
|
59013
59031
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59119,10 +59137,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59119
59137
|
let code = "";
|
|
59120
59138
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59121
59139
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59122
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59123
|
-
IF sy-subrc <> 0.
|
|
59124
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59125
|
-
ENDIF.
|
|
59140
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59141
|
+
IF sy-subrc <> 0.
|
|
59142
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59143
|
+
ENDIF.
|
|
59126
59144
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59127
59145
|
}
|
|
59128
59146
|
else {
|
|
@@ -59211,20 +59229,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59211
59229
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59212
59230
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59213
59231
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59214
|
-
code += ` items LIKE ${loopSourceName},
|
|
59215
|
-
END OF ${groupTargetName}type.
|
|
59216
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59217
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59232
|
+
code += ` items LIKE ${loopSourceName},
|
|
59233
|
+
END OF ${groupTargetName}type.
|
|
59234
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59235
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59218
59236
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59219
59237
|
if (groupIndexName !== undefined) {
|
|
59220
59238
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59221
59239
|
}
|
|
59222
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59240
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59223
59241
|
IF sy-subrc = 0.\n`;
|
|
59224
59242
|
if (groupCountName !== undefined) {
|
|
59225
59243
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59226
59244
|
}
|
|
59227
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59245
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59228
59246
|
ELSE.\n`;
|
|
59229
59247
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59230
59248
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59245,8 +59263,8 @@ ELSE.\n`;
|
|
|
59245
59263
|
}
|
|
59246
59264
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59247
59265
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59248
|
-
code += `ENDIF.
|
|
59249
|
-
ENDLOOP.
|
|
59266
|
+
code += `ENDIF.
|
|
59267
|
+
ENDLOOP.
|
|
59250
59268
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59251
59269
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59252
59270
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59418,7 +59436,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59418
59436
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59419
59437
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59420
59438
|
// all ENUMS are char like?
|
|
59421
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59439
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59422
59440
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59423
59441
|
let count = 1;
|
|
59424
59442
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59462,14 +59480,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59462
59480
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59463
59481
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59464
59482
|
// restore tabix before exeption
|
|
59465
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59466
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59467
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59468
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59469
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59470
|
-
${indentation}IF sy-subrc <> 0.
|
|
59471
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59472
|
-
${indentation}ENDIF.
|
|
59483
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59484
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59485
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59486
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59487
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59488
|
+
${indentation}IF sy-subrc <> 0.
|
|
59489
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59490
|
+
${indentation}ENDIF.
|
|
59473
59491
|
${indentation}${uniqueName}`;
|
|
59474
59492
|
const start = target.getFirstToken().getStart();
|
|
59475
59493
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59553,11 +59571,11 @@ ${indentation}${uniqueName}`;
|
|
|
59553
59571
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59554
59572
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59555
59573
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59556
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59557
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59558
|
-
${indentation} EXPORTING
|
|
59559
|
-
${indentation} input = ${source}
|
|
59560
|
-
${indentation} IMPORTING
|
|
59574
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59575
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59576
|
+
${indentation} EXPORTING
|
|
59577
|
+
${indentation} input = ${source}
|
|
59578
|
+
${indentation} IMPORTING
|
|
59561
59579
|
${indentation} output = ${uniqueName}.\n`;
|
|
59562
59580
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59563
59581
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60869,12 +60887,12 @@ class EasyToFindMessages {
|
|
|
60869
60887
|
key: "easy_to_find_messages",
|
|
60870
60888
|
title: "Easy to find messages",
|
|
60871
60889
|
shortDescription: `Make messages easy to find`,
|
|
60872
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60873
|
-
|
|
60874
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60875
|
-
|
|
60876
|
-
Also see rule "message_exists"
|
|
60877
|
-
|
|
60890
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60891
|
+
|
|
60892
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60893
|
+
|
|
60894
|
+
Also see rule "message_exists"
|
|
60895
|
+
|
|
60878
60896
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60879
60897
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60880
60898
|
};
|
|
@@ -60955,13 +60973,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
60955
60973
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
60956
60974
|
extendedInformation: ``,
|
|
60957
60975
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60958
|
-
badExample: `
|
|
60959
|
-
INITIALIZATION.
|
|
60960
|
-
WRITE 'hello'.
|
|
60976
|
+
badExample: `
|
|
60977
|
+
INITIALIZATION.
|
|
60978
|
+
WRITE 'hello'.
|
|
60961
60979
|
END-OF-SELECTION.`,
|
|
60962
|
-
goodExample: `
|
|
60963
|
-
START-OF-SELECTION.
|
|
60964
|
-
PERFORM sdf.
|
|
60980
|
+
goodExample: `
|
|
60981
|
+
START-OF-SELECTION.
|
|
60982
|
+
PERFORM sdf.
|
|
60965
60983
|
COMMIT WORK.`,
|
|
60966
60984
|
};
|
|
60967
60985
|
}
|
|
@@ -61053,8 +61071,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61053
61071
|
key: "empty_line_in_statement",
|
|
61054
61072
|
title: "Find empty lines in statements",
|
|
61055
61073
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61056
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61057
|
-
|
|
61074
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61075
|
+
|
|
61058
61076
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61059
61077
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61060
61078
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61230,13 +61248,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61230
61248
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61231
61249
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61232
61250
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61233
|
-
badExample: `IF foo = bar.
|
|
61234
|
-
ENDIF.
|
|
61235
|
-
|
|
61236
|
-
DO 2 TIMES.
|
|
61251
|
+
badExample: `IF foo = bar.
|
|
61252
|
+
ENDIF.
|
|
61253
|
+
|
|
61254
|
+
DO 2 TIMES.
|
|
61237
61255
|
ENDDO.`,
|
|
61238
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61239
|
-
ENDLOOP.
|
|
61256
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61257
|
+
ENDLOOP.
|
|
61240
61258
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61241
61259
|
};
|
|
61242
61260
|
}
|
|
@@ -61378,10 +61396,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61378
61396
|
return {
|
|
61379
61397
|
key: "exit_or_check",
|
|
61380
61398
|
title: "Find EXIT or CHECK outside loops",
|
|
61381
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61399
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61382
61400
|
Use RETURN to leave procesing blocks instead.`,
|
|
61383
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61384
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61401
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61402
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61385
61403
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61386
61404
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61387
61405
|
};
|
|
@@ -61464,12 +61482,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61464
61482
|
key: "expand_macros",
|
|
61465
61483
|
title: "Expand Macros",
|
|
61466
61484
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61467
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61468
|
-
|
|
61485
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61486
|
+
|
|
61469
61487
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61470
|
-
badExample: `DEFINE _hello.
|
|
61471
|
-
WRITE 'hello'.
|
|
61472
|
-
END-OF-DEFINITION.
|
|
61488
|
+
badExample: `DEFINE _hello.
|
|
61489
|
+
WRITE 'hello'.
|
|
61490
|
+
END-OF-DEFINITION.
|
|
61473
61491
|
_hello.`,
|
|
61474
61492
|
goodExample: `WRITE 'hello'.`,
|
|
61475
61493
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61556,7 +61574,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61556
61574
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61557
61575
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61558
61576
|
goodExample: `call_method( foo = bar ).`,
|
|
61559
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61577
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61560
61578
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61561
61579
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61562
61580
|
};
|
|
@@ -61654,7 +61672,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61654
61672
|
key: "forbidden_identifier",
|
|
61655
61673
|
title: "Forbidden Identifier",
|
|
61656
61674
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61657
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61675
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61658
61676
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61659
61677
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61660
61678
|
};
|
|
@@ -61896,8 +61914,8 @@ class ForbiddenVoidType {
|
|
|
61896
61914
|
key: "forbidden_void_type",
|
|
61897
61915
|
title: "Forbidden Void Types",
|
|
61898
61916
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61899
|
-
extendedInformation: `Inspiration:
|
|
61900
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61917
|
+
extendedInformation: `Inspiration:
|
|
61918
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61901
61919
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61902
61920
|
};
|
|
61903
61921
|
}
|
|
@@ -62140,7 +62158,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62140
62158
|
key: "fully_type_itabs",
|
|
62141
62159
|
title: "Fully type internal tables",
|
|
62142
62160
|
shortDescription: `No implict table types or table keys`,
|
|
62143
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62161
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62144
62162
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62145
62163
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62146
62164
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62325,26 +62343,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62325
62343
|
key: "functional_writing",
|
|
62326
62344
|
title: "Use functional writing",
|
|
62327
62345
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62328
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62346
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62329
62347
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62330
62348
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62331
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62332
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62333
|
-
EXPORTING
|
|
62334
|
-
p_name = 'NAME'
|
|
62335
|
-
RECEIVING
|
|
62336
|
-
p_descr_ref = lr_typedescr
|
|
62337
|
-
EXCEPTIONS
|
|
62338
|
-
type_not_found = 1
|
|
62349
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62350
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62351
|
+
EXPORTING
|
|
62352
|
+
p_name = 'NAME'
|
|
62353
|
+
RECEIVING
|
|
62354
|
+
p_descr_ref = lr_typedescr
|
|
62355
|
+
EXCEPTIONS
|
|
62356
|
+
type_not_found = 1
|
|
62339
62357
|
OTHERS = 2.`,
|
|
62340
|
-
goodExample: `zcl_class=>method( ).
|
|
62341
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62342
|
-
EXPORTING
|
|
62343
|
-
p_name = 'NAME'
|
|
62344
|
-
RECEIVING
|
|
62345
|
-
p_descr_ref = lr_typedescr
|
|
62346
|
-
EXCEPTIONS
|
|
62347
|
-
type_not_found = 1
|
|
62358
|
+
goodExample: `zcl_class=>method( ).
|
|
62359
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62360
|
+
EXPORTING
|
|
62361
|
+
p_name = 'NAME'
|
|
62362
|
+
RECEIVING
|
|
62363
|
+
p_descr_ref = lr_typedescr
|
|
62364
|
+
EXCEPTIONS
|
|
62365
|
+
type_not_found = 1
|
|
62348
62366
|
OTHERS = 2 ).`,
|
|
62349
62367
|
};
|
|
62350
62368
|
}
|
|
@@ -62455,14 +62473,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62455
62473
|
key: "global_class",
|
|
62456
62474
|
title: "Global class checks",
|
|
62457
62475
|
shortDescription: `Checks related to global classes`,
|
|
62458
|
-
extendedInformation: `* global classes must be in own files
|
|
62459
|
-
|
|
62460
|
-
* file names must match class name
|
|
62461
|
-
|
|
62462
|
-
* file names must match interface name
|
|
62463
|
-
|
|
62464
|
-
* global classes must be global definitions
|
|
62465
|
-
|
|
62476
|
+
extendedInformation: `* global classes must be in own files
|
|
62477
|
+
|
|
62478
|
+
* file names must match class name
|
|
62479
|
+
|
|
62480
|
+
* file names must match interface name
|
|
62481
|
+
|
|
62482
|
+
* global classes must be global definitions
|
|
62483
|
+
|
|
62466
62484
|
* global interfaces must be global definitions`,
|
|
62467
62485
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62468
62486
|
};
|
|
@@ -62561,21 +62579,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62561
62579
|
return {
|
|
62562
62580
|
key: "identical_conditions",
|
|
62563
62581
|
title: "Identical conditions",
|
|
62564
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62565
|
-
|
|
62582
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62583
|
+
|
|
62566
62584
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62567
62585
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62568
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62569
|
-
ENDIF.
|
|
62570
|
-
CASE bar.
|
|
62571
|
-
WHEN '1'.
|
|
62572
|
-
WHEN 'A' OR '1'.
|
|
62586
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62587
|
+
ENDIF.
|
|
62588
|
+
CASE bar.
|
|
62589
|
+
WHEN '1'.
|
|
62590
|
+
WHEN 'A' OR '1'.
|
|
62573
62591
|
ENDCASE.`,
|
|
62574
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62575
|
-
ENDIF.
|
|
62576
|
-
CASE bar.
|
|
62577
|
-
WHEN '1'.
|
|
62578
|
-
WHEN 'A'.
|
|
62592
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62593
|
+
ENDIF.
|
|
62594
|
+
CASE bar.
|
|
62595
|
+
WHEN '1'.
|
|
62596
|
+
WHEN 'A'.
|
|
62579
62597
|
ENDCASE.`,
|
|
62580
62598
|
};
|
|
62581
62599
|
}
|
|
@@ -62709,23 +62727,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62709
62727
|
key: "identical_contents",
|
|
62710
62728
|
title: "Identical contents",
|
|
62711
62729
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62712
|
-
extendedInformation: `
|
|
62713
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62714
|
-
|
|
62730
|
+
extendedInformation: `
|
|
62731
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62732
|
+
|
|
62715
62733
|
Chained statments are ignored`,
|
|
62716
62734
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62717
|
-
badExample: `IF foo = bar.
|
|
62718
|
-
WRITE 'bar'.
|
|
62719
|
-
WRITE 'world'.
|
|
62720
|
-
ELSE.
|
|
62721
|
-
WRITE 'foo'.
|
|
62722
|
-
WRITE 'world'.
|
|
62735
|
+
badExample: `IF foo = bar.
|
|
62736
|
+
WRITE 'bar'.
|
|
62737
|
+
WRITE 'world'.
|
|
62738
|
+
ELSE.
|
|
62739
|
+
WRITE 'foo'.
|
|
62740
|
+
WRITE 'world'.
|
|
62723
62741
|
ENDIF.`,
|
|
62724
|
-
goodExample: `IF foo = bar.
|
|
62725
|
-
WRITE 'bar'.
|
|
62726
|
-
ELSE.
|
|
62727
|
-
WRITE 'foo'.
|
|
62728
|
-
ENDIF.
|
|
62742
|
+
goodExample: `IF foo = bar.
|
|
62743
|
+
WRITE 'bar'.
|
|
62744
|
+
ELSE.
|
|
62745
|
+
WRITE 'foo'.
|
|
62746
|
+
ENDIF.
|
|
62729
62747
|
WRITE 'world'.`,
|
|
62730
62748
|
};
|
|
62731
62749
|
}
|
|
@@ -62833,12 +62851,12 @@ class IdenticalDescriptions {
|
|
|
62833
62851
|
key: "identical_descriptions",
|
|
62834
62852
|
title: "Identical descriptions",
|
|
62835
62853
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62836
|
-
extendedInformation: `Case insensitive
|
|
62837
|
-
|
|
62838
|
-
Only checks the master language descriptions
|
|
62839
|
-
|
|
62840
|
-
Dependencies are skipped
|
|
62841
|
-
|
|
62854
|
+
extendedInformation: `Case insensitive
|
|
62855
|
+
|
|
62856
|
+
Only checks the master language descriptions
|
|
62857
|
+
|
|
62858
|
+
Dependencies are skipped
|
|
62859
|
+
|
|
62842
62860
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62843
62861
|
tags: [],
|
|
62844
62862
|
};
|
|
@@ -63012,43 +63030,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63012
63030
|
key: "if_in_if",
|
|
63013
63031
|
title: "IF in IF",
|
|
63014
63032
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63015
|
-
extendedInformation: `
|
|
63016
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63017
|
-
|
|
63018
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63019
|
-
|
|
63020
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63033
|
+
extendedInformation: `
|
|
63034
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63035
|
+
|
|
63036
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63037
|
+
|
|
63038
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63021
63039
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63022
|
-
badExample: `IF condition1.
|
|
63023
|
-
IF condition2.
|
|
63024
|
-
...
|
|
63025
|
-
ENDIF.
|
|
63026
|
-
ENDIF.
|
|
63027
|
-
|
|
63028
|
-
IF condition1.
|
|
63029
|
-
...
|
|
63030
|
-
ELSE.
|
|
63031
|
-
IF condition2.
|
|
63032
|
-
...
|
|
63033
|
-
ENDIF.
|
|
63040
|
+
badExample: `IF condition1.
|
|
63041
|
+
IF condition2.
|
|
63042
|
+
...
|
|
63043
|
+
ENDIF.
|
|
63044
|
+
ENDIF.
|
|
63045
|
+
|
|
63046
|
+
IF condition1.
|
|
63047
|
+
...
|
|
63048
|
+
ELSE.
|
|
63049
|
+
IF condition2.
|
|
63050
|
+
...
|
|
63051
|
+
ENDIF.
|
|
63034
63052
|
ENDIF.`,
|
|
63035
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63036
|
-
...
|
|
63037
|
-
ENDIF.
|
|
63038
|
-
|
|
63039
|
-
IF condition1.
|
|
63040
|
-
...
|
|
63041
|
-
ELSEIF condition2.
|
|
63042
|
-
...
|
|
63043
|
-
ENDIF.
|
|
63044
|
-
|
|
63045
|
-
CASE variable.
|
|
63046
|
-
WHEN value1.
|
|
63047
|
-
...
|
|
63048
|
-
WHEN value2.
|
|
63049
|
-
IF condition2.
|
|
63050
|
-
...
|
|
63051
|
-
ENDIF.
|
|
63053
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63054
|
+
...
|
|
63055
|
+
ENDIF.
|
|
63056
|
+
|
|
63057
|
+
IF condition1.
|
|
63058
|
+
...
|
|
63059
|
+
ELSEIF condition2.
|
|
63060
|
+
...
|
|
63061
|
+
ENDIF.
|
|
63062
|
+
|
|
63063
|
+
CASE variable.
|
|
63064
|
+
WHEN value1.
|
|
63065
|
+
...
|
|
63066
|
+
WHEN value2.
|
|
63067
|
+
IF condition2.
|
|
63068
|
+
...
|
|
63069
|
+
ENDIF.
|
|
63052
63070
|
ENDCASE.`,
|
|
63053
63071
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63054
63072
|
};
|
|
@@ -63233,9 +63251,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63233
63251
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63234
63252
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63235
63253
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63236
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63237
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63238
|
-
RETURN. " todo, implement method
|
|
63254
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63255
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63256
|
+
RETURN. " todo, implement method
|
|
63239
63257
|
ENDMETHOD.`);
|
|
63240
63258
|
}
|
|
63241
63259
|
}
|
|
@@ -63414,14 +63432,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63414
63432
|
key: "implicit_start_of_selection",
|
|
63415
63433
|
title: "Implicit START-OF-SELECTION",
|
|
63416
63434
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63417
|
-
extendedInformation: `Only runs for executable programs
|
|
63418
|
-
|
|
63435
|
+
extendedInformation: `Only runs for executable programs
|
|
63436
|
+
|
|
63419
63437
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63420
63438
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63421
|
-
badExample: `REPORT zfoo.
|
|
63439
|
+
badExample: `REPORT zfoo.
|
|
63422
63440
|
WRITE 'hello'.`,
|
|
63423
|
-
goodExample: `
|
|
63424
|
-
START-OF-SELECTION.
|
|
63441
|
+
goodExample: `
|
|
63442
|
+
START-OF-SELECTION.
|
|
63425
63443
|
WRITE 'hello'.`,
|
|
63426
63444
|
};
|
|
63427
63445
|
}
|
|
@@ -63526,19 +63544,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63526
63544
|
key: "in_statement_indentation",
|
|
63527
63545
|
title: "In-statement indentation",
|
|
63528
63546
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63529
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63530
|
-
|
|
63531
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63547
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63548
|
+
|
|
63549
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63532
63550
|
to distinguish them better from code within the block.`,
|
|
63533
|
-
badExample: `IF 1 = 1
|
|
63534
|
-
AND 2 = 2.
|
|
63535
|
-
WRITE 'hello' &&
|
|
63536
|
-
'world'.
|
|
63551
|
+
badExample: `IF 1 = 1
|
|
63552
|
+
AND 2 = 2.
|
|
63553
|
+
WRITE 'hello' &&
|
|
63554
|
+
'world'.
|
|
63537
63555
|
ENDIF.`,
|
|
63538
|
-
goodExample: `IF 1 = 1
|
|
63539
|
-
AND 2 = 2.
|
|
63540
|
-
WRITE 'hello' &&
|
|
63541
|
-
'world'.
|
|
63556
|
+
goodExample: `IF 1 = 1
|
|
63557
|
+
AND 2 = 2.
|
|
63558
|
+
WRITE 'hello' &&
|
|
63559
|
+
'world'.
|
|
63542
63560
|
ENDIF.`,
|
|
63543
63561
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63544
63562
|
};
|
|
@@ -63661,23 +63679,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63661
63679
|
title: "Indentation",
|
|
63662
63680
|
shortDescription: `Checks indentation`,
|
|
63663
63681
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63664
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63665
|
-
PRIVATE SECTION.
|
|
63666
|
-
METHODS constructor.
|
|
63667
|
-
ENDCLASS.
|
|
63668
|
-
|
|
63669
|
-
CLASS lcl IMPLEMENTATION.
|
|
63670
|
-
METHOD constructor.
|
|
63671
|
-
ENDMETHOD.
|
|
63682
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63683
|
+
PRIVATE SECTION.
|
|
63684
|
+
METHODS constructor.
|
|
63685
|
+
ENDCLASS.
|
|
63686
|
+
|
|
63687
|
+
CLASS lcl IMPLEMENTATION.
|
|
63688
|
+
METHOD constructor.
|
|
63689
|
+
ENDMETHOD.
|
|
63672
63690
|
ENDCLASS.`,
|
|
63673
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63674
|
-
PRIVATE SECTION.
|
|
63675
|
-
METHODS constructor.
|
|
63676
|
-
ENDCLASS.
|
|
63677
|
-
|
|
63678
|
-
CLASS lcl IMPLEMENTATION.
|
|
63679
|
-
METHOD constructor.
|
|
63680
|
-
ENDMETHOD.
|
|
63691
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63692
|
+
PRIVATE SECTION.
|
|
63693
|
+
METHODS constructor.
|
|
63694
|
+
ENDCLASS.
|
|
63695
|
+
|
|
63696
|
+
CLASS lcl IMPLEMENTATION.
|
|
63697
|
+
METHOD constructor.
|
|
63698
|
+
ENDMETHOD.
|
|
63681
63699
|
ENDCLASS.`,
|
|
63682
63700
|
};
|
|
63683
63701
|
}
|
|
@@ -64078,9 +64096,9 @@ class IntfReferencingClas {
|
|
|
64078
64096
|
key: "intf_referencing_clas",
|
|
64079
64097
|
title: "INTF referencing CLAS",
|
|
64080
64098
|
shortDescription: `Interface contains references to class`,
|
|
64081
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64082
|
-
Only first level references are checked.
|
|
64083
|
-
Exception class references are ignored.
|
|
64099
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64100
|
+
Only first level references are checked.
|
|
64101
|
+
Exception class references are ignored.
|
|
64084
64102
|
Void references are ignored.`,
|
|
64085
64103
|
};
|
|
64086
64104
|
}
|
|
@@ -64165,9 +64183,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64165
64183
|
title: "Invalid Table Index",
|
|
64166
64184
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64167
64185
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64168
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64186
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64169
64187
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64170
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64188
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64171
64189
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64172
64190
|
};
|
|
64173
64191
|
}
|
|
@@ -64768,8 +64786,8 @@ class LineBreakStyle {
|
|
|
64768
64786
|
return {
|
|
64769
64787
|
key: "line_break_style",
|
|
64770
64788
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64771
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64772
|
-
|
|
64789
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64790
|
+
|
|
64773
64791
|
abapGit does not work with CRLF`,
|
|
64774
64792
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64775
64793
|
};
|
|
@@ -64838,7 +64856,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64838
64856
|
key: "line_length",
|
|
64839
64857
|
title: "Line length",
|
|
64840
64858
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64841
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64859
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64842
64860
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64843
64861
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64844
64862
|
};
|
|
@@ -64909,7 +64927,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64909
64927
|
key: "line_only_punc",
|
|
64910
64928
|
title: "Line containing only punctuation",
|
|
64911
64929
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64912
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64930
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64913
64931
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
64914
64932
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64915
64933
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65172,15 +65190,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65172
65190
|
return {
|
|
65173
65191
|
key: "local_variable_names",
|
|
65174
65192
|
title: "Local variable naming conventions",
|
|
65175
|
-
shortDescription: `
|
|
65176
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65193
|
+
shortDescription: `
|
|
65194
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65177
65195
|
Regexes are case-insensitive.`,
|
|
65178
65196
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65179
|
-
badExample: `FORM bar.
|
|
65180
|
-
DATA foo.
|
|
65197
|
+
badExample: `FORM bar.
|
|
65198
|
+
DATA foo.
|
|
65181
65199
|
ENDFORM.`,
|
|
65182
|
-
goodExample: `FORM bar.
|
|
65183
|
-
DATA lv_foo.
|
|
65200
|
+
goodExample: `FORM bar.
|
|
65201
|
+
DATA lv_foo.
|
|
65184
65202
|
ENDFORM.`,
|
|
65185
65203
|
};
|
|
65186
65204
|
}
|
|
@@ -65332,9 +65350,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65332
65350
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65333
65351
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65334
65352
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65335
|
-
badExample: `DEFINE something.
|
|
65353
|
+
badExample: `DEFINE something.
|
|
65336
65354
|
END-OF-DEFINITION.`,
|
|
65337
|
-
goodExample: `DEFINE _something.
|
|
65355
|
+
goodExample: `DEFINE _something.
|
|
65338
65356
|
END-OF-DEFINITION.`,
|
|
65339
65357
|
};
|
|
65340
65358
|
}
|
|
@@ -65407,10 +65425,10 @@ class MainFileContents {
|
|
|
65407
65425
|
key: "main_file_contents",
|
|
65408
65426
|
title: "Main file contents",
|
|
65409
65427
|
shortDescription: `Checks related to report declarations.`,
|
|
65410
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65411
|
-
|
|
65412
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65413
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65428
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65429
|
+
|
|
65430
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65431
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65414
65432
|
`,
|
|
65415
65433
|
};
|
|
65416
65434
|
}
|
|
@@ -65526,17 +65544,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65526
65544
|
title: "Too many parentheses",
|
|
65527
65545
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65528
65546
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65529
|
-
badExample: `
|
|
65530
|
-
IF ( destination IS INITIAL ).
|
|
65531
|
-
ENDIF.
|
|
65532
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65533
|
-
ENDIF.
|
|
65547
|
+
badExample: `
|
|
65548
|
+
IF ( destination IS INITIAL ).
|
|
65549
|
+
ENDIF.
|
|
65550
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65551
|
+
ENDIF.
|
|
65534
65552
|
`,
|
|
65535
|
-
goodExample: `
|
|
65536
|
-
IF destination IS INITIAL.
|
|
65537
|
-
ENDIF.
|
|
65538
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65539
|
-
ENDIF.
|
|
65553
|
+
goodExample: `
|
|
65554
|
+
IF destination IS INITIAL.
|
|
65555
|
+
ENDIF.
|
|
65556
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65557
|
+
ENDIF.
|
|
65540
65558
|
`,
|
|
65541
65559
|
};
|
|
65542
65560
|
}
|
|
@@ -65710,14 +65728,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65710
65728
|
title: "Max one method parameter definition per line",
|
|
65711
65729
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65712
65730
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65713
|
-
badExample: `
|
|
65714
|
-
METHODS apps_scope_token
|
|
65715
|
-
IMPORTING
|
|
65731
|
+
badExample: `
|
|
65732
|
+
METHODS apps_scope_token
|
|
65733
|
+
IMPORTING
|
|
65716
65734
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65717
|
-
goodExample: `
|
|
65718
|
-
METHODS apps_scope_token
|
|
65719
|
-
IMPORTING
|
|
65720
|
-
body TYPE bodyapps_scope_token
|
|
65735
|
+
goodExample: `
|
|
65736
|
+
METHODS apps_scope_token
|
|
65737
|
+
IMPORTING
|
|
65738
|
+
body TYPE bodyapps_scope_token
|
|
65721
65739
|
client_id TYPE str.`,
|
|
65722
65740
|
};
|
|
65723
65741
|
}
|
|
@@ -65782,11 +65800,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65782
65800
|
key: "max_one_statement",
|
|
65783
65801
|
title: "Max one statement per line",
|
|
65784
65802
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65785
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65786
|
-
|
|
65787
|
-
Does not report anything for chained statements.
|
|
65788
|
-
|
|
65789
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65803
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65804
|
+
|
|
65805
|
+
Does not report anything for chained statements.
|
|
65806
|
+
|
|
65807
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65790
65808
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65791
65809
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65792
65810
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66124,8 +66142,8 @@ class MethodLength {
|
|
|
66124
66142
|
key: "method_length",
|
|
66125
66143
|
title: "Method/Form Length",
|
|
66126
66144
|
shortDescription: `Checks relating to method/form length.`,
|
|
66127
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66128
|
-
|
|
66145
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66146
|
+
|
|
66129
66147
|
Abstract methods without statements are considered okay.`,
|
|
66130
66148
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66131
66149
|
};
|
|
@@ -66230,20 +66248,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66230
66248
|
key: "method_overwrites_builtin",
|
|
66231
66249
|
title: "Method name overwrites builtin function",
|
|
66232
66250
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66233
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66234
|
-
|
|
66235
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66236
|
-
|
|
66251
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66252
|
+
|
|
66253
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66254
|
+
|
|
66237
66255
|
Interface method names are ignored`,
|
|
66238
66256
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66239
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66240
|
-
PUBLIC SECTION.
|
|
66241
|
-
METHODS matches.
|
|
66242
|
-
ENDCLASS.
|
|
66243
|
-
|
|
66244
|
-
CLASS lcl IMPLEMENTATION.
|
|
66245
|
-
METHOD matches.
|
|
66246
|
-
ENDMETHOD.
|
|
66257
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66258
|
+
PUBLIC SECTION.
|
|
66259
|
+
METHODS matches.
|
|
66260
|
+
ENDCLASS.
|
|
66261
|
+
|
|
66262
|
+
CLASS lcl IMPLEMENTATION.
|
|
66263
|
+
METHOD matches.
|
|
66264
|
+
ENDMETHOD.
|
|
66247
66265
|
ENDCLASS.`,
|
|
66248
66266
|
};
|
|
66249
66267
|
}
|
|
@@ -66434,12 +66452,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66434
66452
|
// eslint-disable-next-line max-len
|
|
66435
66453
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66436
66454
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66437
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66438
|
-
PUBLIC SECTION.
|
|
66439
|
-
METHODS
|
|
66440
|
-
foobar
|
|
66441
|
-
EXPORTING foo TYPE i
|
|
66442
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66455
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66456
|
+
PUBLIC SECTION.
|
|
66457
|
+
METHODS
|
|
66458
|
+
foobar
|
|
66459
|
+
EXPORTING foo TYPE i
|
|
66460
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66443
66461
|
ENDCLASS.`,
|
|
66444
66462
|
};
|
|
66445
66463
|
}
|
|
@@ -66819,7 +66837,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66819
66837
|
key: "nesting",
|
|
66820
66838
|
title: "Check nesting depth",
|
|
66821
66839
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66822
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66840
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66823
66841
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66824
66842
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66825
66843
|
};
|
|
@@ -67062,7 +67080,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67062
67080
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67063
67081
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67064
67082
|
badExample: `var1 = var2 = var3.`,
|
|
67065
|
-
goodExample: `var2 = var3.
|
|
67083
|
+
goodExample: `var2 = var3.
|
|
67066
67084
|
var1 = var2.`,
|
|
67067
67085
|
};
|
|
67068
67086
|
}
|
|
@@ -67121,8 +67139,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67121
67139
|
key: "no_external_form_calls",
|
|
67122
67140
|
title: "No external FORM calls",
|
|
67123
67141
|
shortDescription: `Detect external form calls`,
|
|
67124
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67125
|
-
|
|
67142
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67143
|
+
|
|
67126
67144
|
PERFORM foo(bar).`,
|
|
67127
67145
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67128
67146
|
};
|
|
@@ -67183,17 +67201,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67183
67201
|
key: "no_inline_in_optional_branches",
|
|
67184
67202
|
title: "Don't declare inline in optional branches",
|
|
67185
67203
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67186
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67187
|
-
|
|
67188
|
-
Considered optional branches:
|
|
67189
|
-
* inside IF/ELSEIF/ELSE
|
|
67190
|
-
* inside LOOP
|
|
67191
|
-
* inside WHILE
|
|
67192
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67193
|
-
* inside DO
|
|
67194
|
-
* inside SELECT loops
|
|
67195
|
-
|
|
67196
|
-
Not considered optional branches:
|
|
67204
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67205
|
+
|
|
67206
|
+
Considered optional branches:
|
|
67207
|
+
* inside IF/ELSEIF/ELSE
|
|
67208
|
+
* inside LOOP
|
|
67209
|
+
* inside WHILE
|
|
67210
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67211
|
+
* inside DO
|
|
67212
|
+
* inside SELECT loops
|
|
67213
|
+
|
|
67214
|
+
Not considered optional branches:
|
|
67197
67215
|
* TRY/CATCH/CLEANUP`,
|
|
67198
67216
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67199
67217
|
};
|
|
@@ -67293,12 +67311,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67293
67311
|
key: "no_prefixes",
|
|
67294
67312
|
title: "No Prefixes",
|
|
67295
67313
|
shortDescription: `Dont use hungarian notation`,
|
|
67296
|
-
extendedInformation: `
|
|
67297
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67298
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67299
|
-
|
|
67300
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67301
|
-
|
|
67314
|
+
extendedInformation: `
|
|
67315
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67316
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67317
|
+
|
|
67318
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67319
|
+
|
|
67302
67320
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67303
67321
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67304
67322
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67477,7 +67495,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67477
67495
|
return {
|
|
67478
67496
|
key: "no_public_attributes",
|
|
67479
67497
|
title: "No public attributes",
|
|
67480
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67498
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67481
67499
|
Exceptions are excluded from this rule.`,
|
|
67482
67500
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67483
67501
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67578,13 +67596,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67578
67596
|
key: "no_yoda_conditions",
|
|
67579
67597
|
title: "No Yoda conditions",
|
|
67580
67598
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67581
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67582
|
-
|
|
67599
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67600
|
+
|
|
67583
67601
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67584
67602
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67585
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67603
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67586
67604
|
ENDIF.`,
|
|
67587
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67605
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67588
67606
|
ENDIF.`,
|
|
67589
67607
|
};
|
|
67590
67608
|
}
|
|
@@ -67685,8 +67703,8 @@ class NROBConsistency {
|
|
|
67685
67703
|
key: "nrob_consistency",
|
|
67686
67704
|
title: "Number range consistency",
|
|
67687
67705
|
shortDescription: `Consistency checks for number ranges`,
|
|
67688
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67689
|
-
|
|
67706
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67707
|
+
|
|
67690
67708
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67691
67709
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67692
67710
|
};
|
|
@@ -67963,58 +67981,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
67963
67981
|
title: "Obsolete statements",
|
|
67964
67982
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
67965
67983
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67966
|
-
extendedInformation: `
|
|
67967
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67968
|
-
|
|
67969
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67970
|
-
|
|
67971
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67972
|
-
|
|
67973
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67974
|
-
|
|
67975
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67976
|
-
|
|
67977
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67978
|
-
|
|
67979
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67980
|
-
|
|
67981
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67982
|
-
|
|
67983
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
67984
|
-
|
|
67985
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
67986
|
-
|
|
67987
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
67988
|
-
|
|
67989
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
67990
|
-
|
|
67991
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
67992
|
-
|
|
67993
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
67994
|
-
|
|
67995
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
67996
|
-
SELECT COUNT(*) is considered okay
|
|
67997
|
-
|
|
67998
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
67999
|
-
|
|
68000
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68001
|
-
|
|
68002
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68003
|
-
|
|
68004
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68005
|
-
|
|
68006
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68007
|
-
|
|
67984
|
+
extendedInformation: `
|
|
67985
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67986
|
+
|
|
67987
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67988
|
+
|
|
67989
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67990
|
+
|
|
67991
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67992
|
+
|
|
67993
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67994
|
+
|
|
67995
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67996
|
+
|
|
67997
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67998
|
+
|
|
67999
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68000
|
+
|
|
68001
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68002
|
+
|
|
68003
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68004
|
+
|
|
68005
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68006
|
+
|
|
68007
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68008
|
+
|
|
68009
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68010
|
+
|
|
68011
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68012
|
+
|
|
68013
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68014
|
+
SELECT COUNT(*) is considered okay
|
|
68015
|
+
|
|
68016
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68017
|
+
|
|
68018
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68019
|
+
|
|
68020
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68021
|
+
|
|
68022
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68023
|
+
|
|
68024
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68025
|
+
|
|
68008
68026
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68009
|
-
badExample: `REFRESH itab.
|
|
68010
|
-
|
|
68011
|
-
COMPUTE foo = 2 + 2.
|
|
68012
|
-
|
|
68013
|
-
MULTIPLY lv_foo BY 2.
|
|
68014
|
-
|
|
68015
|
-
INTERFACE intf LOAD.
|
|
68016
|
-
|
|
68017
|
-
IF foo IS SUPPLIED.
|
|
68027
|
+
badExample: `REFRESH itab.
|
|
68028
|
+
|
|
68029
|
+
COMPUTE foo = 2 + 2.
|
|
68030
|
+
|
|
68031
|
+
MULTIPLY lv_foo BY 2.
|
|
68032
|
+
|
|
68033
|
+
INTERFACE intf LOAD.
|
|
68034
|
+
|
|
68035
|
+
IF foo IS SUPPLIED.
|
|
68018
68036
|
ENDIF.`,
|
|
68019
68037
|
};
|
|
68020
68038
|
}
|
|
@@ -68354,9 +68372,9 @@ class OmitParameterName {
|
|
|
68354
68372
|
key: "omit_parameter_name",
|
|
68355
68373
|
title: "Omit parameter name",
|
|
68356
68374
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68357
|
-
extendedInformation: `
|
|
68358
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68359
|
-
|
|
68375
|
+
extendedInformation: `
|
|
68376
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68377
|
+
|
|
68360
68378
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68361
68379
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68362
68380
|
badExample: `method( param = 2 ).`,
|
|
@@ -68562,20 +68580,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68562
68580
|
shortDescription: `Omit RECEIVING`,
|
|
68563
68581
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68564
68582
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68565
|
-
badExample: `
|
|
68566
|
-
upload_pack(
|
|
68567
|
-
EXPORTING
|
|
68568
|
-
io_client = lo_client
|
|
68569
|
-
iv_url = iv_url
|
|
68570
|
-
iv_deepen_level = iv_deepen_level
|
|
68571
|
-
it_hashes = lt_hashes
|
|
68572
|
-
RECEIVING
|
|
68583
|
+
badExample: `
|
|
68584
|
+
upload_pack(
|
|
68585
|
+
EXPORTING
|
|
68586
|
+
io_client = lo_client
|
|
68587
|
+
iv_url = iv_url
|
|
68588
|
+
iv_deepen_level = iv_deepen_level
|
|
68589
|
+
it_hashes = lt_hashes
|
|
68590
|
+
RECEIVING
|
|
68573
68591
|
rt_objects = et_objects ).`,
|
|
68574
|
-
goodExample: `
|
|
68575
|
-
et_objects = upload_pack(
|
|
68576
|
-
io_client = lo_client
|
|
68577
|
-
iv_url = iv_url
|
|
68578
|
-
iv_deepen_level = iv_deepen_level
|
|
68592
|
+
goodExample: `
|
|
68593
|
+
et_objects = upload_pack(
|
|
68594
|
+
io_client = lo_client
|
|
68595
|
+
iv_url = iv_url
|
|
68596
|
+
iv_deepen_level = iv_deepen_level
|
|
68579
68597
|
it_hashes = lt_hashes ).`,
|
|
68580
68598
|
};
|
|
68581
68599
|
}
|
|
@@ -68639,8 +68657,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68639
68657
|
return {
|
|
68640
68658
|
key: "parser_702_chaining",
|
|
68641
68659
|
title: "Parser Error, bad chanining on 702",
|
|
68642
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68643
|
-
this rule finds these and reports errors.
|
|
68660
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68661
|
+
this rule finds these and reports errors.
|
|
68644
68662
|
Only active on target version 702 and below.`,
|
|
68645
68663
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68646
68664
|
};
|
|
@@ -68720,8 +68738,8 @@ class ParserError {
|
|
|
68720
68738
|
return {
|
|
68721
68739
|
key: "parser_error",
|
|
68722
68740
|
title: "Parser error",
|
|
68723
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68724
|
-
|
|
68741
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68742
|
+
|
|
68725
68743
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68726
68744
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68727
68745
|
};
|
|
@@ -68806,7 +68824,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68806
68824
|
return {
|
|
68807
68825
|
key: "parser_missing_space",
|
|
68808
68826
|
title: "Parser Error, missing space",
|
|
68809
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68827
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68810
68828
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68811
68829
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68812
68830
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69218,25 +69236,25 @@ class PreferInline {
|
|
|
69218
69236
|
key: "prefer_inline",
|
|
69219
69237
|
title: "Prefer Inline Declarations",
|
|
69220
69238
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69221
|
-
extendedInformation: `EXPERIMENTAL
|
|
69222
|
-
|
|
69223
|
-
Activates if language version is v740sp02 or above.
|
|
69224
|
-
|
|
69225
|
-
Variables must be local(METHOD or FORM).
|
|
69226
|
-
|
|
69227
|
-
No generic or void typed variables. No syntax errors.
|
|
69228
|
-
|
|
69229
|
-
First position used must be a full/pure write.
|
|
69230
|
-
|
|
69231
|
-
Move statment is not a cast(?=)
|
|
69232
|
-
|
|
69239
|
+
extendedInformation: `EXPERIMENTAL
|
|
69240
|
+
|
|
69241
|
+
Activates if language version is v740sp02 or above.
|
|
69242
|
+
|
|
69243
|
+
Variables must be local(METHOD or FORM).
|
|
69244
|
+
|
|
69245
|
+
No generic or void typed variables. No syntax errors.
|
|
69246
|
+
|
|
69247
|
+
First position used must be a full/pure write.
|
|
69248
|
+
|
|
69249
|
+
Move statment is not a cast(?=)
|
|
69250
|
+
|
|
69233
69251
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69234
69252
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69235
|
-
badExample: `DATA foo TYPE i.
|
|
69236
|
-
foo = 2.
|
|
69237
|
-
DATA percentage TYPE decfloat34.
|
|
69253
|
+
badExample: `DATA foo TYPE i.
|
|
69254
|
+
foo = 2.
|
|
69255
|
+
DATA percentage TYPE decfloat34.
|
|
69238
69256
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69239
|
-
goodExample: `DATA(foo) = 2.
|
|
69257
|
+
goodExample: `DATA(foo) = 2.
|
|
69240
69258
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69241
69259
|
};
|
|
69242
69260
|
}
|
|
@@ -69450,18 +69468,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69450
69468
|
key: "prefer_is_not",
|
|
69451
69469
|
title: "Prefer IS NOT to NOT IS",
|
|
69452
69470
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69453
|
-
extendedInformation: `
|
|
69454
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69455
|
-
|
|
69471
|
+
extendedInformation: `
|
|
69472
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69473
|
+
|
|
69456
69474
|
"if not is_valid( )." examples are skipped`,
|
|
69457
69475
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69458
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69459
|
-
IF variable NP 'TODO*'.
|
|
69460
|
-
IF variable <> 42.
|
|
69476
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69477
|
+
IF variable NP 'TODO*'.
|
|
69478
|
+
IF variable <> 42.
|
|
69461
69479
|
IF variable CO 'hello'.`,
|
|
69462
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69463
|
-
IF NOT variable CP 'TODO*'.
|
|
69464
|
-
IF NOT variable = 42.
|
|
69480
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69481
|
+
IF NOT variable CP 'TODO*'.
|
|
69482
|
+
IF NOT variable = 42.
|
|
69465
69483
|
IF NOT variable CA 'hello'.`,
|
|
69466
69484
|
};
|
|
69467
69485
|
}
|
|
@@ -69649,14 +69667,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69649
69667
|
key: "prefer_raise_exception_new",
|
|
69650
69668
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69651
69669
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69652
|
-
extendedInformation: `
|
|
69653
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69654
|
-
|
|
69670
|
+
extendedInformation: `
|
|
69671
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69672
|
+
|
|
69655
69673
|
From 752 and up`,
|
|
69656
69674
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69657
69675
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69658
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69659
|
-
EXPORTING
|
|
69676
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69677
|
+
EXPORTING
|
|
69660
69678
|
previous = exception.`,
|
|
69661
69679
|
};
|
|
69662
69680
|
}
|
|
@@ -69734,12 +69752,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69734
69752
|
key: "prefer_returning_to_exporting",
|
|
69735
69753
|
title: "Prefer RETURNING to EXPORTING",
|
|
69736
69754
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69737
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69755
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69738
69756
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69739
69757
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69740
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69741
|
-
PUBLIC SECTION.
|
|
69742
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69758
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69759
|
+
PUBLIC SECTION.
|
|
69760
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69743
69761
|
ENDCLASS.`,
|
|
69744
69762
|
};
|
|
69745
69763
|
}
|
|
@@ -69835,8 +69853,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69835
69853
|
key: "prefer_xsdbool",
|
|
69836
69854
|
title: "Prefer xsdbool over boolc",
|
|
69837
69855
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69838
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69839
|
-
|
|
69856
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69857
|
+
|
|
69840
69858
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69841
69859
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69842
69860
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69908,9 +69926,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69908
69926
|
title: "Preferred compare operator",
|
|
69909
69927
|
shortDescription: `Configure undesired operator variants`,
|
|
69910
69928
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69911
|
-
badExample: `IF foo EQ bar.
|
|
69929
|
+
badExample: `IF foo EQ bar.
|
|
69912
69930
|
ENDIF.`,
|
|
69913
|
-
goodExample: `IF foo = bar.
|
|
69931
|
+
goodExample: `IF foo = bar.
|
|
69914
69932
|
ENDIF.`,
|
|
69915
69933
|
};
|
|
69916
69934
|
}
|
|
@@ -70134,26 +70152,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70134
70152
|
key: "reduce_procedural_code",
|
|
70135
70153
|
title: "Reduce procedural code",
|
|
70136
70154
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70137
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70138
|
-
|
|
70139
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70140
|
-
|
|
70155
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70156
|
+
|
|
70157
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70158
|
+
|
|
70141
70159
|
Comments are not counted as statements.`,
|
|
70142
70160
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70143
|
-
badExample: `FORM foo.
|
|
70144
|
-
DATA lv_bar TYPE i.
|
|
70145
|
-
lv_bar = 2 + 2.
|
|
70146
|
-
IF lv_bar = 4.
|
|
70147
|
-
WRITE 'hello world'.
|
|
70148
|
-
ENDIF.
|
|
70149
|
-
DATA lv_bar TYPE i.
|
|
70150
|
-
lv_bar = 2 + 2.
|
|
70151
|
-
IF lv_bar = 4.
|
|
70152
|
-
WRITE 'hello world'.
|
|
70153
|
-
ENDIF.
|
|
70161
|
+
badExample: `FORM foo.
|
|
70162
|
+
DATA lv_bar TYPE i.
|
|
70163
|
+
lv_bar = 2 + 2.
|
|
70164
|
+
IF lv_bar = 4.
|
|
70165
|
+
WRITE 'hello world'.
|
|
70166
|
+
ENDIF.
|
|
70167
|
+
DATA lv_bar TYPE i.
|
|
70168
|
+
lv_bar = 2 + 2.
|
|
70169
|
+
IF lv_bar = 4.
|
|
70170
|
+
WRITE 'hello world'.
|
|
70171
|
+
ENDIF.
|
|
70154
70172
|
ENDFORM.`,
|
|
70155
|
-
goodExample: `FORM foo.
|
|
70156
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70173
|
+
goodExample: `FORM foo.
|
|
70174
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70157
70175
|
ENDFORM.`,
|
|
70158
70176
|
};
|
|
70159
70177
|
}
|
|
@@ -70397,10 +70415,10 @@ class RemoveDescriptions {
|
|
|
70397
70415
|
return {
|
|
70398
70416
|
key: "remove_descriptions",
|
|
70399
70417
|
title: "Remove descriptions",
|
|
70400
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70401
|
-
|
|
70402
|
-
Class descriptions are required, see rule description_empty.
|
|
70403
|
-
|
|
70418
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70419
|
+
|
|
70420
|
+
Class descriptions are required, see rule description_empty.
|
|
70421
|
+
|
|
70404
70422
|
Consider using ABAP Doc for documentation.`,
|
|
70405
70423
|
tags: [],
|
|
70406
70424
|
};
|
|
@@ -70525,14 +70543,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70525
70543
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70526
70544
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70527
70545
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70528
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70546
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70529
70547
|
DESTINATION lv_rfc.`,
|
|
70530
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70531
|
-
DESTINATION lv_rfc
|
|
70532
|
-
EXCEPTIONS
|
|
70533
|
-
system_failure = 1 MESSAGE msg
|
|
70534
|
-
communication_failure = 2 MESSAGE msg
|
|
70535
|
-
resource_failure = 3
|
|
70548
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70549
|
+
DESTINATION lv_rfc
|
|
70550
|
+
EXCEPTIONS
|
|
70551
|
+
system_failure = 1 MESSAGE msg
|
|
70552
|
+
communication_failure = 2 MESSAGE msg
|
|
70553
|
+
resource_failure = 3
|
|
70536
70554
|
OTHERS = 4.`,
|
|
70537
70555
|
};
|
|
70538
70556
|
}
|
|
@@ -70616,11 +70634,11 @@ class SelectAddOrderBy {
|
|
|
70616
70634
|
key: "select_add_order_by",
|
|
70617
70635
|
title: "SELECT add ORDER BY",
|
|
70618
70636
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70619
|
-
extendedInformation: `
|
|
70620
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70621
|
-
|
|
70622
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70623
|
-
|
|
70637
|
+
extendedInformation: `
|
|
70638
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70639
|
+
|
|
70640
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70641
|
+
|
|
70624
70642
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70625
70643
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70626
70644
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70751,14 +70769,14 @@ class SelectPerformance {
|
|
|
70751
70769
|
key: "select_performance",
|
|
70752
70770
|
title: "SELECT performance",
|
|
70753
70771
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70754
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70755
|
-
|
|
70772
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70773
|
+
|
|
70756
70774
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70757
70775
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70758
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70759
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70776
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70777
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70760
70778
|
ENDSELECT.`,
|
|
70761
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70779
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70762
70780
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70763
70781
|
};
|
|
70764
70782
|
}
|
|
@@ -70872,8 +70890,8 @@ class SelectSingleFullKey {
|
|
|
70872
70890
|
key: "select_single_full_key",
|
|
70873
70891
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70874
70892
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70875
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70876
|
-
|
|
70893
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70894
|
+
|
|
70877
70895
|
If the statement contains a JOIN it is not checked`,
|
|
70878
70896
|
pseudoComment: "EC CI_NOORDER",
|
|
70879
70897
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71297,8 +71315,8 @@ class SICFConsistency {
|
|
|
71297
71315
|
key: "sicf_consistency",
|
|
71298
71316
|
title: "SICF consistency",
|
|
71299
71317
|
shortDescription: `Checks the validity of ICF services`,
|
|
71300
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71301
|
-
* Class must not have any syntax errors
|
|
71318
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71319
|
+
* Class must not have any syntax errors
|
|
71302
71320
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71303
71321
|
};
|
|
71304
71322
|
}
|
|
@@ -71410,23 +71428,23 @@ class SlowParameterPassing {
|
|
|
71410
71428
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71411
71429
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71412
71430
|
tags: [_irule_1.RuleTag.Performance],
|
|
71413
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71414
|
-
PUBLIC SECTION.
|
|
71415
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71416
|
-
ENDCLASS.
|
|
71417
|
-
CLASS lcl IMPLEMENTATION.
|
|
71418
|
-
METHOD bar.
|
|
71419
|
-
WRITE sdf.
|
|
71420
|
-
ENDMETHOD.
|
|
71431
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71432
|
+
PUBLIC SECTION.
|
|
71433
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71434
|
+
ENDCLASS.
|
|
71435
|
+
CLASS lcl IMPLEMENTATION.
|
|
71436
|
+
METHOD bar.
|
|
71437
|
+
WRITE sdf.
|
|
71438
|
+
ENDMETHOD.
|
|
71421
71439
|
ENDCLASS.`,
|
|
71422
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71423
|
-
PUBLIC SECTION.
|
|
71424
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71425
|
-
ENDCLASS.
|
|
71426
|
-
CLASS lcl IMPLEMENTATION.
|
|
71427
|
-
METHOD bar.
|
|
71428
|
-
WRITE sdf.
|
|
71429
|
-
ENDMETHOD.
|
|
71440
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71441
|
+
PUBLIC SECTION.
|
|
71442
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71443
|
+
ENDCLASS.
|
|
71444
|
+
CLASS lcl IMPLEMENTATION.
|
|
71445
|
+
METHOD bar.
|
|
71446
|
+
WRITE sdf.
|
|
71447
|
+
ENDMETHOD.
|
|
71430
71448
|
ENDCLASS.`,
|
|
71431
71449
|
};
|
|
71432
71450
|
}
|
|
@@ -71683,8 +71701,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71683
71701
|
key: "space_before_dot",
|
|
71684
71702
|
title: "Space before dot",
|
|
71685
71703
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71686
|
-
extendedInformation: `
|
|
71687
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71704
|
+
extendedInformation: `
|
|
71705
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71688
71706
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71689
71707
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71690
71708
|
badExample: `WRITE bar .`,
|
|
@@ -71870,12 +71888,12 @@ class SQLValueConversion {
|
|
|
71870
71888
|
key: "sql_value_conversion",
|
|
71871
71889
|
title: "Implicit SQL Value Conversion",
|
|
71872
71890
|
shortDescription: `Ensure types match when selecting from database`,
|
|
71873
|
-
extendedInformation: `
|
|
71874
|
-
* Integer to CHAR conversion
|
|
71875
|
-
* Integer to NUMC conversion
|
|
71876
|
-
* NUMC to Integer conversion
|
|
71877
|
-
* CHAR to Integer conversion
|
|
71878
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
71891
|
+
extendedInformation: `
|
|
71892
|
+
* Integer to CHAR conversion
|
|
71893
|
+
* Integer to NUMC conversion
|
|
71894
|
+
* NUMC to Integer conversion
|
|
71895
|
+
* CHAR to Integer conversion
|
|
71896
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71879
71897
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71880
71898
|
tags: [],
|
|
71881
71899
|
};
|
|
@@ -71947,7 +71965,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
71947
71965
|
key: "start_at_tab",
|
|
71948
71966
|
title: "Start at tab",
|
|
71949
71967
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
71950
|
-
extendedInformation: `Reports max 100 issues per file
|
|
71968
|
+
extendedInformation: `Reports max 100 issues per file
|
|
71951
71969
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
71952
71970
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71953
71971
|
badExample: ` WRITE a.`,
|
|
@@ -72124,12 +72142,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72124
72142
|
key: "strict_sql",
|
|
72125
72143
|
title: "Strict SQL",
|
|
72126
72144
|
shortDescription: `Strict SQL`,
|
|
72127
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72128
|
-
|
|
72129
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72130
|
-
|
|
72131
|
-
Also see separate rule sql_escape_host_variables
|
|
72132
|
-
|
|
72145
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72146
|
+
|
|
72147
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72148
|
+
|
|
72149
|
+
Also see separate rule sql_escape_host_variables
|
|
72150
|
+
|
|
72133
72151
|
Activates from v750 and up`,
|
|
72134
72152
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72135
72153
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72383,11 +72401,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72383
72401
|
key: "sy_modification",
|
|
72384
72402
|
title: "Modification of SY fields",
|
|
72385
72403
|
shortDescription: `Finds modification of sy fields`,
|
|
72386
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72387
|
-
|
|
72404
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72405
|
+
|
|
72388
72406
|
Changes to SY-TVAR* fields are not reported`,
|
|
72389
72407
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72390
|
-
badExample: `sy-uname = 2.
|
|
72408
|
+
badExample: `sy-uname = 2.
|
|
72391
72409
|
sy = sy.`,
|
|
72392
72410
|
};
|
|
72393
72411
|
}
|
|
@@ -72449,8 +72467,8 @@ class TABLEnhancementCategory {
|
|
|
72449
72467
|
key: "tabl_enhancement_category",
|
|
72450
72468
|
title: "TABL enhancement category must be set",
|
|
72451
72469
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72452
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72453
|
-
|
|
72470
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72471
|
+
|
|
72454
72472
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72455
72473
|
tags: [],
|
|
72456
72474
|
};
|
|
@@ -72515,8 +72533,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72515
72533
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72516
72534
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72517
72535
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72518
|
-
badExample: `FORM foo.
|
|
72519
|
-
TABLES t100.
|
|
72536
|
+
badExample: `FORM foo.
|
|
72537
|
+
TABLES t100.
|
|
72520
72538
|
ENDFORM.`,
|
|
72521
72539
|
goodExample: `TABLES t000.`,
|
|
72522
72540
|
};
|
|
@@ -72644,9 +72662,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72644
72662
|
title: "Type FORM parameters",
|
|
72645
72663
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72646
72664
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72647
|
-
badExample: `FORM foo USING bar.
|
|
72665
|
+
badExample: `FORM foo USING bar.
|
|
72648
72666
|
ENDFORM.`,
|
|
72649
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72667
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72650
72668
|
ENDFORM.`,
|
|
72651
72669
|
};
|
|
72652
72670
|
}
|
|
@@ -73319,38 +73337,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73319
73337
|
key: "unnecessary_pragma",
|
|
73320
73338
|
title: "Unnecessary Pragma",
|
|
73321
73339
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73322
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73323
|
-
|
|
73324
|
-
* NEEDED without definition
|
|
73325
|
-
|
|
73326
|
-
* NO_TEXT without texts
|
|
73327
|
-
|
|
73328
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73329
|
-
|
|
73340
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73341
|
+
|
|
73342
|
+
* NEEDED without definition
|
|
73343
|
+
|
|
73344
|
+
* NO_TEXT without texts
|
|
73345
|
+
|
|
73346
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73347
|
+
|
|
73330
73348
|
NO_HANDLER inside macros are not checked`,
|
|
73331
73349
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73332
|
-
badExample: `TRY.
|
|
73333
|
-
...
|
|
73334
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73335
|
-
RETURN. " it has a handler
|
|
73336
|
-
ENDTRY.
|
|
73337
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73338
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73339
|
-
IF sy-subrc <> 0.
|
|
73350
|
+
badExample: `TRY.
|
|
73351
|
+
...
|
|
73352
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73353
|
+
RETURN. " it has a handler
|
|
73354
|
+
ENDTRY.
|
|
73355
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73356
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73357
|
+
IF sy-subrc <> 0.
|
|
73340
73358
|
ENDIF.`,
|
|
73341
|
-
goodExample: `TRY.
|
|
73342
|
-
...
|
|
73343
|
-
CATCH zcx_abapgit_exception.
|
|
73344
|
-
RETURN.
|
|
73345
|
-
ENDTRY.
|
|
73346
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73347
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73348
|
-
IF sy-subrc <> 0.
|
|
73349
|
-
ENDIF.
|
|
73350
|
-
|
|
73351
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73352
|
-
test1 TYPE string,
|
|
73353
|
-
test2 TYPE string,
|
|
73359
|
+
goodExample: `TRY.
|
|
73360
|
+
...
|
|
73361
|
+
CATCH zcx_abapgit_exception.
|
|
73362
|
+
RETURN.
|
|
73363
|
+
ENDTRY.
|
|
73364
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73365
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73366
|
+
IF sy-subrc <> 0.
|
|
73367
|
+
ENDIF.
|
|
73368
|
+
|
|
73369
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73370
|
+
test1 TYPE string,
|
|
73371
|
+
test2 TYPE string,
|
|
73354
73372
|
END OF blah.`,
|
|
73355
73373
|
};
|
|
73356
73374
|
}
|
|
@@ -73517,18 +73535,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73517
73535
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73518
73536
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73519
73537
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73520
|
-
badExample: `FORM hello1.
|
|
73521
|
-
WRITE 'world'.
|
|
73522
|
-
RETURN.
|
|
73523
|
-
ENDFORM.
|
|
73524
|
-
|
|
73525
|
-
FORM foo.
|
|
73526
|
-
IF 1 = 2.
|
|
73527
|
-
RETURN.
|
|
73528
|
-
ENDIF.
|
|
73538
|
+
badExample: `FORM hello1.
|
|
73539
|
+
WRITE 'world'.
|
|
73540
|
+
RETURN.
|
|
73541
|
+
ENDFORM.
|
|
73542
|
+
|
|
73543
|
+
FORM foo.
|
|
73544
|
+
IF 1 = 2.
|
|
73545
|
+
RETURN.
|
|
73546
|
+
ENDIF.
|
|
73529
73547
|
ENDFORM.`,
|
|
73530
|
-
goodExample: `FORM hello2.
|
|
73531
|
-
WRITE 'world'.
|
|
73548
|
+
goodExample: `FORM hello2.
|
|
73549
|
+
WRITE 'world'.
|
|
73532
73550
|
ENDFORM.`,
|
|
73533
73551
|
};
|
|
73534
73552
|
}
|
|
@@ -73879,13 +73897,13 @@ class UnusedMacros {
|
|
|
73879
73897
|
title: "Unused macros",
|
|
73880
73898
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73881
73899
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73882
|
-
badExample: `DEFINE foobar1.
|
|
73883
|
-
WRITE 'hello'.
|
|
73900
|
+
badExample: `DEFINE foobar1.
|
|
73901
|
+
WRITE 'hello'.
|
|
73884
73902
|
END-OF-DEFINITION.`,
|
|
73885
|
-
goodExample: `DEFINE foobar2.
|
|
73886
|
-
WRITE 'hello'.
|
|
73887
|
-
END-OF-DEFINITION.
|
|
73888
|
-
|
|
73903
|
+
goodExample: `DEFINE foobar2.
|
|
73904
|
+
WRITE 'hello'.
|
|
73905
|
+
END-OF-DEFINITION.
|
|
73906
|
+
|
|
73889
73907
|
foobar2.`,
|
|
73890
73908
|
};
|
|
73891
73909
|
}
|
|
@@ -73997,18 +74015,18 @@ class UnusedMethods {
|
|
|
73997
74015
|
key: "unused_methods",
|
|
73998
74016
|
title: "Unused methods",
|
|
73999
74017
|
shortDescription: `Checks for unused methods`,
|
|
74000
|
-
extendedInformation: `Checks private and protected methods.
|
|
74001
|
-
|
|
74002
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74003
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74004
|
-
|
|
74005
|
-
Skips:
|
|
74006
|
-
* methods FOR TESTING
|
|
74007
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74008
|
-
* class_constructor + constructor methods
|
|
74009
|
-
* event handlers
|
|
74010
|
-
* methods that are redefined
|
|
74011
|
-
* INCLUDEs
|
|
74018
|
+
extendedInformation: `Checks private and protected methods.
|
|
74019
|
+
|
|
74020
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74021
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74022
|
+
|
|
74023
|
+
Skips:
|
|
74024
|
+
* methods FOR TESTING
|
|
74025
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74026
|
+
* class_constructor + constructor methods
|
|
74027
|
+
* event handlers
|
|
74028
|
+
* methods that are redefined
|
|
74029
|
+
* INCLUDEs
|
|
74012
74030
|
`,
|
|
74013
74031
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74014
74032
|
pragma: "##CALLED",
|
|
@@ -74484,23 +74502,23 @@ class UnusedVariables {
|
|
|
74484
74502
|
key: "unused_variables",
|
|
74485
74503
|
title: "Unused variables",
|
|
74486
74504
|
shortDescription: `Checks for unused variables and constants`,
|
|
74487
|
-
extendedInformation: `Skips event parameters.
|
|
74488
|
-
|
|
74489
|
-
Note that this currently does not work if the source code uses macros.
|
|
74490
|
-
|
|
74491
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74492
|
-
|
|
74505
|
+
extendedInformation: `Skips event parameters.
|
|
74506
|
+
|
|
74507
|
+
Note that this currently does not work if the source code uses macros.
|
|
74508
|
+
|
|
74509
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74510
|
+
|
|
74493
74511
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74494
74512
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74495
74513
|
pragma: "##NEEDED",
|
|
74496
74514
|
pseudoComment: "EC NEEDED",
|
|
74497
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74498
|
-
test TYPE string,
|
|
74499
|
-
test2 TYPE string,
|
|
74515
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74516
|
+
test TYPE string,
|
|
74517
|
+
test2 TYPE string,
|
|
74500
74518
|
END OF blah1.`,
|
|
74501
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74502
|
-
test TYPE string,
|
|
74503
|
-
test2 TYPE string,
|
|
74519
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74520
|
+
test TYPE string,
|
|
74521
|
+
test2 TYPE string,
|
|
74504
74522
|
END OF blah2.`,
|
|
74505
74523
|
};
|
|
74506
74524
|
}
|
|
@@ -74719,15 +74737,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74719
74737
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74720
74738
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74721
74739
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74722
|
-
badExample: `IF line IS INITIAL.
|
|
74723
|
-
has_entries = abap_false.
|
|
74724
|
-
ELSE.
|
|
74725
|
-
has_entries = abap_true.
|
|
74726
|
-
ENDIF.
|
|
74727
|
-
|
|
74740
|
+
badExample: `IF line IS INITIAL.
|
|
74741
|
+
has_entries = abap_false.
|
|
74742
|
+
ELSE.
|
|
74743
|
+
has_entries = abap_true.
|
|
74744
|
+
ENDIF.
|
|
74745
|
+
|
|
74728
74746
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74729
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74730
|
-
|
|
74747
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74748
|
+
|
|
74731
74749
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74732
74750
|
};
|
|
74733
74751
|
}
|
|
@@ -74845,15 +74863,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74845
74863
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74846
74864
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74847
74865
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74848
|
-
badExample: `INTERFACE lif.
|
|
74849
|
-
METHODS load_data
|
|
74850
|
-
EXCEPTIONS
|
|
74851
|
-
invalid_parameter.
|
|
74866
|
+
badExample: `INTERFACE lif.
|
|
74867
|
+
METHODS load_data
|
|
74868
|
+
EXCEPTIONS
|
|
74869
|
+
invalid_parameter.
|
|
74852
74870
|
ENDINTERFACE.`,
|
|
74853
|
-
goodExample: `INTERFACE lif.
|
|
74854
|
-
METHODS load_data
|
|
74855
|
-
RAISING
|
|
74856
|
-
cx_something.
|
|
74871
|
+
goodExample: `INTERFACE lif.
|
|
74872
|
+
METHODS load_data
|
|
74873
|
+
RAISING
|
|
74874
|
+
cx_something.
|
|
74857
74875
|
ENDINTERFACE.`,
|
|
74858
74876
|
};
|
|
74859
74877
|
}
|
|
@@ -74913,15 +74931,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74913
74931
|
key: "use_line_exists",
|
|
74914
74932
|
title: "Use line_exists",
|
|
74915
74933
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
74916
|
-
extendedInformation: `
|
|
74917
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74918
|
-
|
|
74934
|
+
extendedInformation: `
|
|
74935
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74936
|
+
|
|
74919
74937
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
74920
74938
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74921
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74922
|
-
IF sy-subrc = 0.
|
|
74939
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74940
|
+
IF sy-subrc = 0.
|
|
74923
74941
|
ENDIF.`,
|
|
74924
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74942
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74925
74943
|
ENDIF.`,
|
|
74926
74944
|
};
|
|
74927
74945
|
}
|
|
@@ -75031,10 +75049,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75031
75049
|
key: "use_new",
|
|
75032
75050
|
title: "Use NEW",
|
|
75033
75051
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75034
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75035
|
-
|
|
75036
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75037
|
-
|
|
75052
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75053
|
+
|
|
75054
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75055
|
+
|
|
75038
75056
|
Applicable from v740sp02 and up`,
|
|
75039
75057
|
badExample: `CREATE OBJECT ref.`,
|
|
75040
75058
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75132,13 +75150,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75132
75150
|
title: "WHEN OTHERS last",
|
|
75133
75151
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75134
75152
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75135
|
-
badExample: `CASE bar.
|
|
75136
|
-
WHEN OTHERS.
|
|
75137
|
-
WHEN 2.
|
|
75153
|
+
badExample: `CASE bar.
|
|
75154
|
+
WHEN OTHERS.
|
|
75155
|
+
WHEN 2.
|
|
75138
75156
|
ENDCASE.`,
|
|
75139
|
-
goodExample: `CASE bar.
|
|
75140
|
-
WHEN 2.
|
|
75141
|
-
WHEN OTHERS.
|
|
75157
|
+
goodExample: `CASE bar.
|
|
75158
|
+
WHEN 2.
|
|
75159
|
+
WHEN OTHERS.
|
|
75142
75160
|
ENDCASE.`,
|
|
75143
75161
|
};
|
|
75144
75162
|
}
|