@abaplint/cli 2.113.83 → 2.113.85
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 +854 -847
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -13105,9 +13105,12 @@ exports.Field = void 0;
|
|
|
13105
13105
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
13106
13106
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
13107
13107
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
13108
|
+
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
13108
13109
|
class Field {
|
|
13109
13110
|
getMatcher() {
|
|
13110
|
-
const
|
|
13111
|
+
const module = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("ON INPUT", "ON REQUEST")));
|
|
13112
|
+
const values = (0, combi_1.seq)("VALUES", (0, combi_1.tok)(tokens_1.WParenLeft), "BETWEEN", expressions_1.Constant, "AND", expressions_1.Constant, (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
13113
|
+
const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.alt)(module, values)));
|
|
13111
13114
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
13112
13115
|
}
|
|
13113
13116
|
}
|
|
@@ -15091,7 +15094,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
|
|
|
15091
15094
|
class Module {
|
|
15092
15095
|
getMatcher() {
|
|
15093
15096
|
const sw = (0, combi_1.seq)("SWITCH", expressions_1.NamespaceSimpleName);
|
|
15094
|
-
const ret = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("INPUT", "OUTPUT", "ON CHAIN-REQUEST", "ON CHAIN-INPUT", sw)));
|
|
15097
|
+
const ret = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("INPUT", "OUTPUT", "ON CHAIN-REQUEST", "ON CHAIN-INPUT", "AT EXIT-COMMAND", sw)));
|
|
15095
15098
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
15096
15099
|
}
|
|
15097
15100
|
}
|
|
@@ -35720,13 +35723,13 @@ class FlowGraph {
|
|
|
35720
35723
|
this.label = label;
|
|
35721
35724
|
}
|
|
35722
35725
|
toDigraph() {
|
|
35723
|
-
return `digraph G {
|
|
35724
|
-
labelloc="t";
|
|
35725
|
-
label="${this.label}";
|
|
35726
|
-
graph [fontname = "helvetica"];
|
|
35727
|
-
node [fontname = "helvetica", shape="box"];
|
|
35728
|
-
edge [fontname = "helvetica"];
|
|
35729
|
-
${this.toTextEdges()}
|
|
35726
|
+
return `digraph G {
|
|
35727
|
+
labelloc="t";
|
|
35728
|
+
label="${this.label}";
|
|
35729
|
+
graph [fontname = "helvetica"];
|
|
35730
|
+
node [fontname = "helvetica", shape="box"];
|
|
35731
|
+
edge [fontname = "helvetica"];
|
|
35732
|
+
${this.toTextEdges()}
|
|
35730
35733
|
}`;
|
|
35731
35734
|
}
|
|
35732
35735
|
listSources(node) {
|
|
@@ -44149,13 +44152,13 @@ class Help {
|
|
|
44149
44152
|
/////////////////////////////////////////////////
|
|
44150
44153
|
static dumpABAP(file, reg, textDocument, position) {
|
|
44151
44154
|
let content = "";
|
|
44152
|
-
content = `
|
|
44153
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
44154
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
44155
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
44156
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
44157
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
44158
|
-
<hr>
|
|
44155
|
+
content = `
|
|
44156
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
44157
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
44158
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
44159
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
44160
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
44161
|
+
<hr>
|
|
44159
44162
|
` +
|
|
44160
44163
|
"<tt>" + textDocument.uri + " (" +
|
|
44161
44164
|
(position.line + 1) + ", " +
|
|
@@ -44310,9 +44313,9 @@ class Help {
|
|
|
44310
44313
|
return ret + "</ul>";
|
|
44311
44314
|
}
|
|
44312
44315
|
static tokens(file) {
|
|
44313
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
44314
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
44315
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
44316
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
44317
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
44318
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
44316
44319
|
</tr>`;
|
|
44317
44320
|
for (const token of file.getTokens()) {
|
|
44318
44321
|
const tStart = token.getStart();
|
|
@@ -53315,6 +53318,7 @@ class Indent {
|
|
|
53315
53318
|
|| type instanceof Statements.EndModule
|
|
53316
53319
|
|| type instanceof Statements.EndSelect
|
|
53317
53320
|
|| type instanceof Statements.EndMethod
|
|
53321
|
+
|| type instanceof Statements.EndChain
|
|
53318
53322
|
|| type instanceof Statements.EndAt
|
|
53319
53323
|
|| type instanceof Statements.Else
|
|
53320
53324
|
|| type instanceof Statements.EndExec
|
|
@@ -53423,6 +53427,7 @@ class Indent {
|
|
|
53423
53427
|
|| type instanceof Statements.Else
|
|
53424
53428
|
|| type instanceof Statements.ElseIf
|
|
53425
53429
|
|| type instanceof Statements.MethodImplementation
|
|
53430
|
+
|| type instanceof Statements.Chain
|
|
53426
53431
|
|| type instanceof Statements.TestInjection
|
|
53427
53432
|
|| type instanceof Statements.TestSeam
|
|
53428
53433
|
|| (this.options.selectionScreenBlockIndentation === true
|
|
@@ -53628,7 +53633,7 @@ class Registry {
|
|
|
53628
53633
|
}
|
|
53629
53634
|
static abaplintVersion() {
|
|
53630
53635
|
// magic, see build script "version.sh"
|
|
53631
|
-
return "2.113.
|
|
53636
|
+
return "2.113.85";
|
|
53632
53637
|
}
|
|
53633
53638
|
getDDICReferences() {
|
|
53634
53639
|
return this.ddicReferences;
|
|
@@ -53947,10 +53952,10 @@ class SevenBitAscii {
|
|
|
53947
53952
|
key: "7bit_ascii",
|
|
53948
53953
|
title: "Check for 7bit ascii",
|
|
53949
53954
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53950
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53951
|
-
|
|
53952
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53953
|
-
|
|
53955
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53956
|
+
|
|
53957
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53958
|
+
|
|
53954
53959
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53955
53960
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53956
53961
|
badExample: `WRITE '뽑'.`,
|
|
@@ -54156,10 +54161,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
54156
54161
|
key: "abapdoc",
|
|
54157
54162
|
title: "Check abapdoc",
|
|
54158
54163
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
54159
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
54160
|
-
|
|
54161
|
-
Plus class and interface definitions.
|
|
54162
|
-
|
|
54164
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
54165
|
+
|
|
54166
|
+
Plus class and interface definitions.
|
|
54167
|
+
|
|
54163
54168
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
54164
54169
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54165
54170
|
};
|
|
@@ -54296,27 +54301,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
54296
54301
|
title: "Add test attributes for tests classes with test methods",
|
|
54297
54302
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
54298
54303
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54299
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
54300
|
-
PUBLIC SECTION.
|
|
54301
|
-
PROTECTED SECTION.
|
|
54302
|
-
PRIVATE SECTION.
|
|
54303
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54304
|
-
ENDCLASS.
|
|
54305
|
-
|
|
54306
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
54307
|
-
METHOD test.
|
|
54308
|
-
ENDMETHOD.
|
|
54304
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
54305
|
+
PUBLIC SECTION.
|
|
54306
|
+
PROTECTED SECTION.
|
|
54307
|
+
PRIVATE SECTION.
|
|
54308
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54309
|
+
ENDCLASS.
|
|
54310
|
+
|
|
54311
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
54312
|
+
METHOD test.
|
|
54313
|
+
ENDMETHOD.
|
|
54309
54314
|
ENDCLASS.`,
|
|
54310
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
54311
|
-
PUBLIC SECTION.
|
|
54312
|
-
PROTECTED SECTION.
|
|
54313
|
-
PRIVATE SECTION.
|
|
54314
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54315
|
-
ENDCLASS.
|
|
54316
|
-
|
|
54317
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
54318
|
-
METHOD test.
|
|
54319
|
-
ENDMETHOD.
|
|
54315
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
54316
|
+
PUBLIC SECTION.
|
|
54317
|
+
PROTECTED SECTION.
|
|
54318
|
+
PRIVATE SECTION.
|
|
54319
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54320
|
+
ENDCLASS.
|
|
54321
|
+
|
|
54322
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
54323
|
+
METHOD test.
|
|
54324
|
+
ENDMETHOD.
|
|
54320
54325
|
ENDCLASS.`,
|
|
54321
54326
|
};
|
|
54322
54327
|
}
|
|
@@ -54402,49 +54407,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
54402
54407
|
key: "align_parameters",
|
|
54403
54408
|
title: "Align Parameters",
|
|
54404
54409
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
54405
|
-
extendedInformation: `Checks:
|
|
54406
|
-
* function module calls
|
|
54407
|
-
* method calls
|
|
54408
|
-
* VALUE constructors
|
|
54409
|
-
* NEW constructors
|
|
54410
|
-
* RAISE EXCEPTION statements
|
|
54411
|
-
* CREATE OBJECT statements
|
|
54412
|
-
* RAISE EVENT statements
|
|
54413
|
-
|
|
54414
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54415
|
-
|
|
54416
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54417
|
-
|
|
54418
|
-
If parameters are on the same row, no issues are reported, see
|
|
54410
|
+
extendedInformation: `Checks:
|
|
54411
|
+
* function module calls
|
|
54412
|
+
* method calls
|
|
54413
|
+
* VALUE constructors
|
|
54414
|
+
* NEW constructors
|
|
54415
|
+
* RAISE EXCEPTION statements
|
|
54416
|
+
* CREATE OBJECT statements
|
|
54417
|
+
* RAISE EVENT statements
|
|
54418
|
+
|
|
54419
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54420
|
+
|
|
54421
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54422
|
+
|
|
54423
|
+
If parameters are on the same row, no issues are reported, see
|
|
54419
54424
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
54420
54425
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
54421
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54422
|
-
EXPORTING
|
|
54423
|
-
foo = 2
|
|
54424
|
-
parameter = 3.
|
|
54425
|
-
|
|
54426
|
-
foobar( moo = 1
|
|
54427
|
-
param = 1 ).
|
|
54428
|
-
|
|
54429
|
-
foo = VALUE #(
|
|
54430
|
-
foo = bar
|
|
54426
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54427
|
+
EXPORTING
|
|
54428
|
+
foo = 2
|
|
54429
|
+
parameter = 3.
|
|
54430
|
+
|
|
54431
|
+
foobar( moo = 1
|
|
54432
|
+
param = 1 ).
|
|
54433
|
+
|
|
54434
|
+
foo = VALUE #(
|
|
54435
|
+
foo = bar
|
|
54431
54436
|
moo = 2 ).`,
|
|
54432
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54433
|
-
EXPORTING
|
|
54434
|
-
foo = 2
|
|
54435
|
-
parameter = 3.
|
|
54436
|
-
|
|
54437
|
-
foobar( moo = 1
|
|
54438
|
-
param = 1 ).
|
|
54439
|
-
|
|
54440
|
-
foo = VALUE #(
|
|
54441
|
-
foo = bar
|
|
54442
|
-
moo = 2 ).
|
|
54443
|
-
|
|
54444
|
-
DATA(sdf) = VALUE type(
|
|
54445
|
-
common_val = 2
|
|
54446
|
-
another_common = 5
|
|
54447
|
-
( row_value = 4
|
|
54437
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54438
|
+
EXPORTING
|
|
54439
|
+
foo = 2
|
|
54440
|
+
parameter = 3.
|
|
54441
|
+
|
|
54442
|
+
foobar( moo = 1
|
|
54443
|
+
param = 1 ).
|
|
54444
|
+
|
|
54445
|
+
foo = VALUE #(
|
|
54446
|
+
foo = bar
|
|
54447
|
+
moo = 2 ).
|
|
54448
|
+
|
|
54449
|
+
DATA(sdf) = VALUE type(
|
|
54450
|
+
common_val = 2
|
|
54451
|
+
another_common = 5
|
|
54452
|
+
( row_value = 4
|
|
54448
54453
|
value_foo = 5 ) ).`,
|
|
54449
54454
|
};
|
|
54450
54455
|
}
|
|
@@ -54878,37 +54883,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54878
54883
|
key: "align_type_expressions",
|
|
54879
54884
|
title: "Align TYPE expressions",
|
|
54880
54885
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54881
|
-
extendedInformation: `
|
|
54882
|
-
Currently works for METHODS + BEGIN OF
|
|
54883
|
-
|
|
54884
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54885
|
-
|
|
54886
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54886
|
+
extendedInformation: `
|
|
54887
|
+
Currently works for METHODS + BEGIN OF
|
|
54888
|
+
|
|
54889
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54890
|
+
|
|
54891
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54887
54892
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54888
54893
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54889
|
-
badExample: `
|
|
54890
|
-
TYPES: BEGIN OF foo,
|
|
54891
|
-
bar TYPE i,
|
|
54892
|
-
foobar TYPE i,
|
|
54893
|
-
END OF foo.
|
|
54894
|
-
|
|
54895
|
-
INTERFACE lif.
|
|
54896
|
-
METHODS bar
|
|
54897
|
-
IMPORTING
|
|
54898
|
-
foo TYPE i
|
|
54899
|
-
foobar TYPE i.
|
|
54894
|
+
badExample: `
|
|
54895
|
+
TYPES: BEGIN OF foo,
|
|
54896
|
+
bar TYPE i,
|
|
54897
|
+
foobar TYPE i,
|
|
54898
|
+
END OF foo.
|
|
54899
|
+
|
|
54900
|
+
INTERFACE lif.
|
|
54901
|
+
METHODS bar
|
|
54902
|
+
IMPORTING
|
|
54903
|
+
foo TYPE i
|
|
54904
|
+
foobar TYPE i.
|
|
54900
54905
|
ENDINTERFACE.`,
|
|
54901
|
-
goodExample: `
|
|
54902
|
-
TYPES: BEGIN OF foo,
|
|
54903
|
-
bar TYPE i,
|
|
54904
|
-
foobar TYPE i,
|
|
54905
|
-
END OF foo.
|
|
54906
|
-
|
|
54907
|
-
INTERFACE lif.
|
|
54908
|
-
METHODS bar
|
|
54909
|
-
IMPORTING
|
|
54910
|
-
foo TYPE i
|
|
54911
|
-
foobar TYPE i.
|
|
54906
|
+
goodExample: `
|
|
54907
|
+
TYPES: BEGIN OF foo,
|
|
54908
|
+
bar TYPE i,
|
|
54909
|
+
foobar TYPE i,
|
|
54910
|
+
END OF foo.
|
|
54911
|
+
|
|
54912
|
+
INTERFACE lif.
|
|
54913
|
+
METHODS bar
|
|
54914
|
+
IMPORTING
|
|
54915
|
+
foo TYPE i
|
|
54916
|
+
foobar TYPE i.
|
|
54912
54917
|
ENDINTERFACE.`,
|
|
54913
54918
|
};
|
|
54914
54919
|
}
|
|
@@ -55187,16 +55192,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55187
55192
|
return {
|
|
55188
55193
|
key: "ambiguous_statement",
|
|
55189
55194
|
title: "Check for ambigious statements",
|
|
55190
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
55191
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
55192
|
-
|
|
55195
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
55196
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
55197
|
+
|
|
55193
55198
|
Only works if the target version is 740sp05 or above`,
|
|
55194
55199
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55195
|
-
badExample: `DELETE foo FROM bar.
|
|
55200
|
+
badExample: `DELETE foo FROM bar.
|
|
55196
55201
|
MODIFY foo FROM bar.`,
|
|
55197
|
-
goodExample: `DELETE foo FROM @bar.
|
|
55198
|
-
DELETE TABLE itab FROM 2.
|
|
55199
|
-
MODIFY zfoo FROM @wa.
|
|
55202
|
+
goodExample: `DELETE foo FROM @bar.
|
|
55203
|
+
DELETE TABLE itab FROM 2.
|
|
55204
|
+
MODIFY zfoo FROM @wa.
|
|
55200
55205
|
MODIFY TABLE foo FROM bar.`,
|
|
55201
55206
|
};
|
|
55202
55207
|
}
|
|
@@ -55301,16 +55306,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
55301
55306
|
key: "avoid_use",
|
|
55302
55307
|
title: "Avoid use of certain statements",
|
|
55303
55308
|
shortDescription: `Detects usage of certain statements.`,
|
|
55304
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
55305
|
-
|
|
55306
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
55307
|
-
|
|
55308
|
-
STATICS: use CLASS-DATA instead
|
|
55309
|
-
|
|
55310
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
55311
|
-
|
|
55312
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
55313
|
-
|
|
55309
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
55310
|
+
|
|
55311
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
55312
|
+
|
|
55313
|
+
STATICS: use CLASS-DATA instead
|
|
55314
|
+
|
|
55315
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
55316
|
+
|
|
55317
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
55318
|
+
|
|
55314
55319
|
BREAK points`,
|
|
55315
55320
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55316
55321
|
};
|
|
@@ -55442,11 +55447,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
55442
55447
|
title: "Check BEGIN END names",
|
|
55443
55448
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
55444
55449
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55445
|
-
badExample: `DATA: BEGIN OF stru,
|
|
55446
|
-
field TYPE i,
|
|
55450
|
+
badExample: `DATA: BEGIN OF stru,
|
|
55451
|
+
field TYPE i,
|
|
55447
55452
|
END OF structure_not_the_same.`,
|
|
55448
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
55449
|
-
field TYPE i,
|
|
55453
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
55454
|
+
field TYPE i,
|
|
55450
55455
|
END OF stru.`,
|
|
55451
55456
|
};
|
|
55452
55457
|
}
|
|
@@ -55543,20 +55548,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
55543
55548
|
title: "BEGIN contains single INCLUDE",
|
|
55544
55549
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
55545
55550
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55546
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
55547
|
-
INCLUDE TYPE dselc.
|
|
55548
|
-
TYPES: END OF dummy1.
|
|
55549
|
-
|
|
55550
|
-
DATA BEGIN OF foo.
|
|
55551
|
-
INCLUDE STRUCTURE syst.
|
|
55552
|
-
DATA END OF foo.
|
|
55553
|
-
|
|
55554
|
-
STATICS BEGIN OF bar.
|
|
55555
|
-
INCLUDE STRUCTURE syst.
|
|
55551
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
55552
|
+
INCLUDE TYPE dselc.
|
|
55553
|
+
TYPES: END OF dummy1.
|
|
55554
|
+
|
|
55555
|
+
DATA BEGIN OF foo.
|
|
55556
|
+
INCLUDE STRUCTURE syst.
|
|
55557
|
+
DATA END OF foo.
|
|
55558
|
+
|
|
55559
|
+
STATICS BEGIN OF bar.
|
|
55560
|
+
INCLUDE STRUCTURE syst.
|
|
55556
55561
|
STATICS END OF bar.`,
|
|
55557
|
-
goodExample: `DATA BEGIN OF foo.
|
|
55558
|
-
DATA field TYPE i.
|
|
55559
|
-
INCLUDE STRUCTURE dselc.
|
|
55562
|
+
goodExample: `DATA BEGIN OF foo.
|
|
55563
|
+
DATA field TYPE i.
|
|
55564
|
+
INCLUDE STRUCTURE dselc.
|
|
55560
55565
|
DATA END OF foo.`,
|
|
55561
55566
|
};
|
|
55562
55567
|
}
|
|
@@ -55646,9 +55651,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
55646
55651
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
55647
55652
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55648
55653
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
55649
|
-
goodExample: `TRY.
|
|
55650
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55651
|
-
CATCH cx_sy_authorization_error.
|
|
55654
|
+
goodExample: `TRY.
|
|
55655
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55656
|
+
CATCH cx_sy_authorization_error.
|
|
55652
55657
|
ENDTRY.`,
|
|
55653
55658
|
};
|
|
55654
55659
|
}
|
|
@@ -55713,10 +55718,10 @@ class CDSCommentStyle {
|
|
|
55713
55718
|
key: "cds_comment_style",
|
|
55714
55719
|
title: "CDS Comment Style",
|
|
55715
55720
|
shortDescription: `Check for obsolete comment style`,
|
|
55716
|
-
extendedInformation: `Check for obsolete comment style
|
|
55717
|
-
|
|
55718
|
-
Comments starting with "--" are considered obsolete
|
|
55719
|
-
|
|
55721
|
+
extendedInformation: `Check for obsolete comment style
|
|
55722
|
+
|
|
55723
|
+
Comments starting with "--" are considered obsolete
|
|
55724
|
+
|
|
55720
55725
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
55721
55726
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55722
55727
|
badExample: "-- this is a comment",
|
|
@@ -55782,10 +55787,10 @@ class CDSLegacyView {
|
|
|
55782
55787
|
key: "cds_legacy_view",
|
|
55783
55788
|
title: "CDS Legacy View",
|
|
55784
55789
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55785
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55786
|
-
|
|
55787
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55788
|
-
|
|
55790
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55791
|
+
|
|
55792
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55793
|
+
|
|
55789
55794
|
v755 and up`,
|
|
55790
55795
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55791
55796
|
};
|
|
@@ -55940,10 +55945,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55940
55945
|
key: "chain_mainly_declarations",
|
|
55941
55946
|
title: "Chain mainly declarations",
|
|
55942
55947
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55943
|
-
extendedInformation: `
|
|
55944
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55945
|
-
|
|
55946
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55948
|
+
extendedInformation: `
|
|
55949
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55950
|
+
|
|
55951
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55947
55952
|
`,
|
|
55948
55953
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55949
55954
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -56119,17 +56124,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
56119
56124
|
title: "Change IF to CASE",
|
|
56120
56125
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
56121
56126
|
// eslint-disable-next-line max-len
|
|
56122
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
56123
|
-
|
|
56127
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
56128
|
+
|
|
56124
56129
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
56125
56130
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
56126
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
56127
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
56128
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
56131
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
56132
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
56133
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
56129
56134
|
ENDIF.`,
|
|
56130
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
56131
|
-
WHEN 'FOO'.
|
|
56132
|
-
WHEN 'BAR' OR 'MOO'.
|
|
56135
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
56136
|
+
WHEN 'FOO'.
|
|
56137
|
+
WHEN 'BAR' OR 'MOO'.
|
|
56133
56138
|
ENDCASE.`,
|
|
56134
56139
|
};
|
|
56135
56140
|
}
|
|
@@ -56266,8 +56271,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
56266
56271
|
return {
|
|
56267
56272
|
key: "check_abstract",
|
|
56268
56273
|
title: "Check abstract methods and classes",
|
|
56269
|
-
shortDescription: `Checks abstract methods and classes:
|
|
56270
|
-
- class defined as abstract and final,
|
|
56274
|
+
shortDescription: `Checks abstract methods and classes:
|
|
56275
|
+
- class defined as abstract and final,
|
|
56271
56276
|
- non-abstract class contains abstract methods`,
|
|
56272
56277
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
56273
56278
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -56348,11 +56353,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
56348
56353
|
return {
|
|
56349
56354
|
key: "check_comments",
|
|
56350
56355
|
title: "Check Comments",
|
|
56351
|
-
shortDescription: `
|
|
56356
|
+
shortDescription: `
|
|
56352
56357
|
Various checks for comment usage.`,
|
|
56353
|
-
extendedInformation: `
|
|
56354
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
56355
|
-
|
|
56358
|
+
extendedInformation: `
|
|
56359
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
56360
|
+
|
|
56356
56361
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
56357
56362
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56358
56363
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -56514,9 +56519,9 @@ class CheckInclude {
|
|
|
56514
56519
|
key: "check_include",
|
|
56515
56520
|
title: "Check INCLUDEs",
|
|
56516
56521
|
shortDescription: `Checks INCLUDE statements`,
|
|
56517
|
-
extendedInformation: `
|
|
56518
|
-
* Reports unused includes
|
|
56519
|
-
* Errors if the includes are not found
|
|
56522
|
+
extendedInformation: `
|
|
56523
|
+
* Reports unused includes
|
|
56524
|
+
* Errors if the includes are not found
|
|
56520
56525
|
* Error if including a main program`,
|
|
56521
56526
|
tags: [_irule_1.RuleTag.Syntax],
|
|
56522
56527
|
};
|
|
@@ -56592,14 +56597,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
56592
56597
|
key: "check_subrc",
|
|
56593
56598
|
title: "Check sy-subrc",
|
|
56594
56599
|
shortDescription: `Check sy-subrc`,
|
|
56595
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56596
|
-
|
|
56597
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56598
|
-
|
|
56599
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56600
|
-
|
|
56601
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56602
|
-
|
|
56600
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56601
|
+
|
|
56602
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56603
|
+
|
|
56604
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56605
|
+
|
|
56606
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56607
|
+
|
|
56603
56608
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
56604
56609
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56605
56610
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -57169,17 +57174,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
57169
57174
|
shortDescription: `Find overlapping classic exceptions`,
|
|
57170
57175
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
57171
57176
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
57172
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
57173
|
-
EXCEPTIONS
|
|
57174
|
-
system_failure = 1 MESSAGE lv_message
|
|
57175
|
-
communication_failure = 1 MESSAGE lv_message
|
|
57176
|
-
resource_failure = 1
|
|
57177
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
57178
|
+
EXCEPTIONS
|
|
57179
|
+
system_failure = 1 MESSAGE lv_message
|
|
57180
|
+
communication_failure = 1 MESSAGE lv_message
|
|
57181
|
+
resource_failure = 1
|
|
57177
57182
|
OTHERS = 1.`,
|
|
57178
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
57179
|
-
EXCEPTIONS
|
|
57180
|
-
system_failure = 1 MESSAGE lv_message
|
|
57181
|
-
communication_failure = 2 MESSAGE lv_message
|
|
57182
|
-
resource_failure = 3
|
|
57183
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
57184
|
+
EXCEPTIONS
|
|
57185
|
+
system_failure = 1 MESSAGE lv_message
|
|
57186
|
+
communication_failure = 2 MESSAGE lv_message
|
|
57187
|
+
resource_failure = 3
|
|
57183
57188
|
OTHERS = 4.`,
|
|
57184
57189
|
};
|
|
57185
57190
|
}
|
|
@@ -57437,7 +57442,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
57437
57442
|
key: "commented_code",
|
|
57438
57443
|
title: "Find commented code",
|
|
57439
57444
|
shortDescription: `Detects usage of commented out code.`,
|
|
57440
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57445
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57441
57446
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
57442
57447
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
57443
57448
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -57670,10 +57675,10 @@ class ConstructorVisibilityPublic {
|
|
|
57670
57675
|
key: "constructor_visibility_public",
|
|
57671
57676
|
title: "Check constructor visibility is public",
|
|
57672
57677
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
57673
|
-
extendedInformation: `
|
|
57674
|
-
This only applies to global classes.
|
|
57675
|
-
|
|
57676
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57678
|
+
extendedInformation: `
|
|
57679
|
+
This only applies to global classes.
|
|
57680
|
+
|
|
57681
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57677
57682
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
57678
57683
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57679
57684
|
};
|
|
@@ -57748,8 +57753,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
57748
57753
|
key: "contains_tab",
|
|
57749
57754
|
title: "Code contains tab",
|
|
57750
57755
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
57751
|
-
extendedInformation: `
|
|
57752
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57756
|
+
extendedInformation: `
|
|
57757
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
57753
57758
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
57754
57759
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57755
57760
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57836,10 +57841,10 @@ class CyclicOO {
|
|
|
57836
57841
|
key: "cyclic_oo",
|
|
57837
57842
|
title: "Cyclic OO",
|
|
57838
57843
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57839
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57840
|
-
|
|
57841
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57842
|
-
|
|
57844
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57845
|
+
|
|
57846
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57847
|
+
|
|
57843
57848
|
References in testclass includes are ignored`,
|
|
57844
57849
|
};
|
|
57845
57850
|
}
|
|
@@ -58082,7 +58087,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
58082
58087
|
key: "dangerous_statement",
|
|
58083
58088
|
title: "Dangerous statement",
|
|
58084
58089
|
shortDescription: `Detects potentially dangerous statements`,
|
|
58085
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
58090
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
58086
58091
|
dynamic SQL can potentially create SQL injection problems`,
|
|
58087
58092
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
58088
58093
|
};
|
|
@@ -58289,13 +58294,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
58289
58294
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
58290
58295
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
58291
58296
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
58292
|
-
badExample: `FROM foo.
|
|
58293
|
-
WRITE 'hello'.
|
|
58294
|
-
DATA int TYPE i.
|
|
58297
|
+
badExample: `FROM foo.
|
|
58298
|
+
WRITE 'hello'.
|
|
58299
|
+
DATA int TYPE i.
|
|
58295
58300
|
ENDFORM.`,
|
|
58296
|
-
goodExample: `FROM foo.
|
|
58297
|
-
DATA int TYPE i.
|
|
58298
|
-
WRITE 'hello'.
|
|
58301
|
+
goodExample: `FROM foo.
|
|
58302
|
+
DATA int TYPE i.
|
|
58303
|
+
WRITE 'hello'.
|
|
58299
58304
|
ENDFORM.`,
|
|
58300
58305
|
};
|
|
58301
58306
|
}
|
|
@@ -58837,39 +58842,39 @@ class Downport {
|
|
|
58837
58842
|
key: "downport",
|
|
58838
58843
|
title: "Downport statement",
|
|
58839
58844
|
shortDescription: `Downport functionality`,
|
|
58840
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58841
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58842
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58843
|
-
|
|
58844
|
-
Current rules:
|
|
58845
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58846
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58847
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58848
|
-
* CONV is outlined
|
|
58849
|
-
* COND is outlined
|
|
58850
|
-
* REDUCE is outlined
|
|
58851
|
-
* SWITCH is outlined
|
|
58852
|
-
* FILTER is outlined
|
|
58853
|
-
* APPEND expression is outlined
|
|
58854
|
-
* INSERT expression is outlined
|
|
58855
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58856
|
-
* CAST changed to ?=
|
|
58857
|
-
* LOOP AT method_call( ) is outlined
|
|
58858
|
-
* VALUE # with structure fields
|
|
58859
|
-
* VALUE # with internal table lines
|
|
58860
|
-
* Table Expressions are outlined
|
|
58861
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58862
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58863
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58864
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58865
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58866
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58867
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58868
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58869
|
-
* MESSAGE with non simple source
|
|
58870
|
-
|
|
58871
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58872
|
-
|
|
58845
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58846
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58847
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58848
|
+
|
|
58849
|
+
Current rules:
|
|
58850
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58851
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58852
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58853
|
+
* CONV is outlined
|
|
58854
|
+
* COND is outlined
|
|
58855
|
+
* REDUCE is outlined
|
|
58856
|
+
* SWITCH is outlined
|
|
58857
|
+
* FILTER is outlined
|
|
58858
|
+
* APPEND expression is outlined
|
|
58859
|
+
* INSERT expression is outlined
|
|
58860
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58861
|
+
* CAST changed to ?=
|
|
58862
|
+
* LOOP AT method_call( ) is outlined
|
|
58863
|
+
* VALUE # with structure fields
|
|
58864
|
+
* VALUE # with internal table lines
|
|
58865
|
+
* Table Expressions are outlined
|
|
58866
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58867
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58868
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58869
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58870
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58871
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58872
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58873
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58874
|
+
* MESSAGE with non simple source
|
|
58875
|
+
|
|
58876
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58877
|
+
|
|
58873
58878
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58874
58879
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58875
58880
|
};
|
|
@@ -59254,10 +59259,12 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
59254
59259
|
//////////////////////////////////////////
|
|
59255
59260
|
/** move INTO from after WHERE to after FROM */
|
|
59256
59261
|
downportSQLMoveInto(low, high, lowFile, _highSyntax) {
|
|
59262
|
+
var _a;
|
|
59257
59263
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
59258
59264
|
return undefined;
|
|
59259
59265
|
}
|
|
59260
|
-
|
|
59266
|
+
// note: SQLCond is also used in JOIN(FROM) conditions
|
|
59267
|
+
const where = (_a = high.findFirstExpression(Expressions.Select)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.SQLCond);
|
|
59261
59268
|
if (where === undefined) {
|
|
59262
59269
|
return undefined;
|
|
59263
59270
|
}
|
|
@@ -59482,10 +59489,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
59482
59489
|
const fieldName = f.concatTokens();
|
|
59483
59490
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
59484
59491
|
}
|
|
59485
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59492
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59486
59493
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
59487
59494
|
}
|
|
59488
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59495
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59489
59496
|
${indentation}`);
|
|
59490
59497
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
59491
59498
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59544,12 +59551,12 @@ ${indentation}`);
|
|
|
59544
59551
|
}
|
|
59545
59552
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59546
59553
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
59547
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59548
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59549
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59554
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59555
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59556
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59550
59557
|
${indentation}`);
|
|
59551
59558
|
if (fieldDefinitions === "") {
|
|
59552
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59559
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59553
59560
|
${indentation}`);
|
|
59554
59561
|
}
|
|
59555
59562
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -59617,7 +59624,7 @@ ${indentation}`);
|
|
|
59617
59624
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59618
59625
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59619
59626
|
const firstToken = high.getFirstToken();
|
|
59620
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59627
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59621
59628
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59622
59629
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59623
59630
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59671,7 +59678,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59671
59678
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59672
59679
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59673
59680
|
const firstToken = high.getFirstToken();
|
|
59674
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59681
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59675
59682
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59676
59683
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59677
59684
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59713,14 +59720,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59713
59720
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59714
59721
|
const firstToken = high.getFirstToken();
|
|
59715
59722
|
// note that the tabix restore should be done before throwing the exception
|
|
59716
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59717
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59718
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59719
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59720
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59721
|
-
${indentation}IF sy-subrc <> 0.
|
|
59722
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59723
|
-
${indentation}ENDIF.
|
|
59723
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59724
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59725
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59726
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59727
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59728
|
+
${indentation}IF sy-subrc <> 0.
|
|
59729
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59730
|
+
${indentation}ENDIF.
|
|
59724
59731
|
${indentation}`);
|
|
59725
59732
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
59726
59733
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59777,7 +59784,7 @@ ${indentation}`);
|
|
|
59777
59784
|
const className = classNames[0].concatTokens();
|
|
59778
59785
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59779
59786
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59780
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59787
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59781
59788
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
59782
59789
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
59783
59790
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59939,16 +59946,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59939
59946
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59940
59947
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59941
59948
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59942
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59943
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59949
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59950
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59944
59951
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59945
59952
|
if (withs.length > 0) {
|
|
59946
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59947
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59948
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59953
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59954
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59955
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59949
59956
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59950
59957
|
}
|
|
59951
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59958
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59952
59959
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59953
59960
|
if (withs.length > 0) {
|
|
59954
59961
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -60060,10 +60067,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
60060
60067
|
let code = "";
|
|
60061
60068
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
60062
60069
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60063
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
60064
|
-
IF sy-subrc <> 0.
|
|
60065
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60066
|
-
ENDIF.
|
|
60070
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
60071
|
+
IF sy-subrc <> 0.
|
|
60072
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60073
|
+
ENDIF.
|
|
60067
60074
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
60068
60075
|
}
|
|
60069
60076
|
else {
|
|
@@ -60152,20 +60159,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
60152
60159
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60153
60160
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60154
60161
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60155
|
-
code += ` items LIKE ${loopSourceName},
|
|
60156
|
-
END OF ${groupTargetName}type.
|
|
60157
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
60158
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
60162
|
+
code += ` items LIKE ${loopSourceName},
|
|
60163
|
+
END OF ${groupTargetName}type.
|
|
60164
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
60165
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
60159
60166
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
60160
60167
|
if (groupIndexName !== undefined) {
|
|
60161
60168
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
60162
60169
|
}
|
|
60163
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
60170
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
60164
60171
|
IF sy-subrc = 0.\n`;
|
|
60165
60172
|
if (groupCountName !== undefined) {
|
|
60166
60173
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
60167
60174
|
}
|
|
60168
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
60175
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
60169
60176
|
ELSE.\n`;
|
|
60170
60177
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
60171
60178
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -60186,8 +60193,8 @@ ELSE.\n`;
|
|
|
60186
60193
|
}
|
|
60187
60194
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
60188
60195
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
60189
|
-
code += `ENDIF.
|
|
60190
|
-
ENDLOOP.
|
|
60196
|
+
code += `ENDIF.
|
|
60197
|
+
ENDLOOP.
|
|
60191
60198
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
60192
60199
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
60193
60200
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -60359,7 +60366,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
60359
60366
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60360
60367
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
60361
60368
|
// all ENUMS are char like?
|
|
60362
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
60369
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
60363
60370
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
60364
60371
|
let count = 1;
|
|
60365
60372
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -60403,14 +60410,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
60403
60410
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60404
60411
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60405
60412
|
// restore tabix before exeption
|
|
60406
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
60407
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
60408
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
60409
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
60410
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
60411
|
-
${indentation}IF sy-subrc <> 0.
|
|
60412
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60413
|
-
${indentation}ENDIF.
|
|
60413
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
60414
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
60415
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
60416
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
60417
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
60418
|
+
${indentation}IF sy-subrc <> 0.
|
|
60419
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60420
|
+
${indentation}ENDIF.
|
|
60414
60421
|
${indentation}${uniqueName}`;
|
|
60415
60422
|
const start = target.getFirstToken().getStart();
|
|
60416
60423
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -60490,11 +60497,11 @@ ${indentation}${uniqueName}`;
|
|
|
60490
60497
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60491
60498
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60492
60499
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60493
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
60494
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
60495
|
-
${indentation} EXPORTING
|
|
60496
|
-
${indentation} input = ${source}
|
|
60497
|
-
${indentation} IMPORTING
|
|
60500
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
60501
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
60502
|
+
${indentation} EXPORTING
|
|
60503
|
+
${indentation} input = ${source}
|
|
60504
|
+
${indentation} IMPORTING
|
|
60498
60505
|
${indentation} output = ${uniqueName}.\n`;
|
|
60499
60506
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
60500
60507
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -61820,12 +61827,12 @@ class EasyToFindMessages {
|
|
|
61820
61827
|
key: "easy_to_find_messages",
|
|
61821
61828
|
title: "Easy to find messages",
|
|
61822
61829
|
shortDescription: `Make messages easy to find`,
|
|
61823
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
61824
|
-
|
|
61825
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
61826
|
-
|
|
61827
|
-
Also see rule "message_exists"
|
|
61828
|
-
|
|
61830
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61831
|
+
|
|
61832
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61833
|
+
|
|
61834
|
+
Also see rule "message_exists"
|
|
61835
|
+
|
|
61829
61836
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61830
61837
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61831
61838
|
};
|
|
@@ -61906,13 +61913,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61906
61913
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61907
61914
|
extendedInformation: ``,
|
|
61908
61915
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61909
|
-
badExample: `
|
|
61910
|
-
INITIALIZATION.
|
|
61911
|
-
WRITE 'hello'.
|
|
61916
|
+
badExample: `
|
|
61917
|
+
INITIALIZATION.
|
|
61918
|
+
WRITE 'hello'.
|
|
61912
61919
|
END-OF-SELECTION.`,
|
|
61913
|
-
goodExample: `
|
|
61914
|
-
START-OF-SELECTION.
|
|
61915
|
-
PERFORM sdf.
|
|
61920
|
+
goodExample: `
|
|
61921
|
+
START-OF-SELECTION.
|
|
61922
|
+
PERFORM sdf.
|
|
61916
61923
|
COMMIT WORK.`,
|
|
61917
61924
|
};
|
|
61918
61925
|
}
|
|
@@ -62004,8 +62011,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
62004
62011
|
key: "empty_line_in_statement",
|
|
62005
62012
|
title: "Find empty lines in statements",
|
|
62006
62013
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
62007
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
62008
|
-
|
|
62014
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
62015
|
+
|
|
62009
62016
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
62010
62017
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
62011
62018
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -62181,13 +62188,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
62181
62188
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
62182
62189
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
62183
62190
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
62184
|
-
badExample: `IF foo = bar.
|
|
62185
|
-
ENDIF.
|
|
62186
|
-
|
|
62187
|
-
DO 2 TIMES.
|
|
62191
|
+
badExample: `IF foo = bar.
|
|
62192
|
+
ENDIF.
|
|
62193
|
+
|
|
62194
|
+
DO 2 TIMES.
|
|
62188
62195
|
ENDDO.`,
|
|
62189
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
62190
|
-
ENDLOOP.
|
|
62196
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
62197
|
+
ENDLOOP.
|
|
62191
62198
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
62192
62199
|
};
|
|
62193
62200
|
}
|
|
@@ -62329,10 +62336,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
62329
62336
|
return {
|
|
62330
62337
|
key: "exit_or_check",
|
|
62331
62338
|
title: "Find EXIT or CHECK outside loops",
|
|
62332
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
62339
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
62333
62340
|
Use RETURN to leave procesing blocks instead.`,
|
|
62334
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
62335
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
62341
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
62342
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
62336
62343
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
62337
62344
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62338
62345
|
};
|
|
@@ -62415,12 +62422,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
62415
62422
|
key: "expand_macros",
|
|
62416
62423
|
title: "Expand Macros",
|
|
62417
62424
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
62418
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
62419
|
-
|
|
62425
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
62426
|
+
|
|
62420
62427
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
62421
|
-
badExample: `DEFINE _hello.
|
|
62422
|
-
WRITE 'hello'.
|
|
62423
|
-
END-OF-DEFINITION.
|
|
62428
|
+
badExample: `DEFINE _hello.
|
|
62429
|
+
WRITE 'hello'.
|
|
62430
|
+
END-OF-DEFINITION.
|
|
62424
62431
|
_hello.`,
|
|
62425
62432
|
goodExample: `WRITE 'hello'.`,
|
|
62426
62433
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -62507,7 +62514,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
62507
62514
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
62508
62515
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
62509
62516
|
goodExample: `call_method( foo = bar ).`,
|
|
62510
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62517
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62511
62518
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
62512
62519
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62513
62520
|
};
|
|
@@ -62605,7 +62612,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
62605
62612
|
key: "forbidden_identifier",
|
|
62606
62613
|
title: "Forbidden Identifier",
|
|
62607
62614
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
62608
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62615
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62609
62616
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
62610
62617
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62611
62618
|
};
|
|
@@ -62847,8 +62854,8 @@ class ForbiddenVoidType {
|
|
|
62847
62854
|
key: "forbidden_void_type",
|
|
62848
62855
|
title: "Forbidden Void Types",
|
|
62849
62856
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62850
|
-
extendedInformation: `Inspiration:
|
|
62851
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62857
|
+
extendedInformation: `Inspiration:
|
|
62858
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62852
62859
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62853
62860
|
};
|
|
62854
62861
|
}
|
|
@@ -63091,9 +63098,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
63091
63098
|
key: "fully_type_itabs",
|
|
63092
63099
|
title: "Fully type internal tables",
|
|
63093
63100
|
shortDescription: `No implict table types or table keys`,
|
|
63094
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
63101
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
63095
63102
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
63096
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
63103
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
63097
63104
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
63098
63105
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
63099
63106
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -63278,26 +63285,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
63278
63285
|
key: "functional_writing",
|
|
63279
63286
|
title: "Use functional writing",
|
|
63280
63287
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
63281
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
63288
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
63282
63289
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
63283
63290
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63284
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
63285
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
63286
|
-
EXPORTING
|
|
63287
|
-
p_name = 'NAME'
|
|
63288
|
-
RECEIVING
|
|
63289
|
-
p_descr_ref = lr_typedescr
|
|
63290
|
-
EXCEPTIONS
|
|
63291
|
-
type_not_found = 1
|
|
63291
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
63292
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
63293
|
+
EXPORTING
|
|
63294
|
+
p_name = 'NAME'
|
|
63295
|
+
RECEIVING
|
|
63296
|
+
p_descr_ref = lr_typedescr
|
|
63297
|
+
EXCEPTIONS
|
|
63298
|
+
type_not_found = 1
|
|
63292
63299
|
OTHERS = 2.`,
|
|
63293
|
-
goodExample: `zcl_class=>method( ).
|
|
63294
|
-
cl_abap_typedescr=>describe_by_name(
|
|
63295
|
-
EXPORTING
|
|
63296
|
-
p_name = 'NAME'
|
|
63297
|
-
RECEIVING
|
|
63298
|
-
p_descr_ref = lr_typedescr
|
|
63299
|
-
EXCEPTIONS
|
|
63300
|
-
type_not_found = 1
|
|
63300
|
+
goodExample: `zcl_class=>method( ).
|
|
63301
|
+
cl_abap_typedescr=>describe_by_name(
|
|
63302
|
+
EXPORTING
|
|
63303
|
+
p_name = 'NAME'
|
|
63304
|
+
RECEIVING
|
|
63305
|
+
p_descr_ref = lr_typedescr
|
|
63306
|
+
EXCEPTIONS
|
|
63307
|
+
type_not_found = 1
|
|
63301
63308
|
OTHERS = 2 ).`,
|
|
63302
63309
|
};
|
|
63303
63310
|
}
|
|
@@ -63408,14 +63415,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
63408
63415
|
key: "global_class",
|
|
63409
63416
|
title: "Global class checks",
|
|
63410
63417
|
shortDescription: `Checks related to global classes`,
|
|
63411
|
-
extendedInformation: `* global classes must be in own files
|
|
63412
|
-
|
|
63413
|
-
* file names must match class name
|
|
63414
|
-
|
|
63415
|
-
* file names must match interface name
|
|
63416
|
-
|
|
63417
|
-
* global classes must be global definitions
|
|
63418
|
-
|
|
63418
|
+
extendedInformation: `* global classes must be in own files
|
|
63419
|
+
|
|
63420
|
+
* file names must match class name
|
|
63421
|
+
|
|
63422
|
+
* file names must match interface name
|
|
63423
|
+
|
|
63424
|
+
* global classes must be global definitions
|
|
63425
|
+
|
|
63419
63426
|
* global interfaces must be global definitions`,
|
|
63420
63427
|
tags: [_irule_1.RuleTag.Syntax],
|
|
63421
63428
|
};
|
|
@@ -63514,21 +63521,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
63514
63521
|
return {
|
|
63515
63522
|
key: "identical_conditions",
|
|
63516
63523
|
title: "Identical conditions",
|
|
63517
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63518
|
-
|
|
63524
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63525
|
+
|
|
63519
63526
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
63520
63527
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63521
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63522
|
-
ENDIF.
|
|
63523
|
-
CASE bar.
|
|
63524
|
-
WHEN '1'.
|
|
63525
|
-
WHEN 'A' OR '1'.
|
|
63528
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63529
|
+
ENDIF.
|
|
63530
|
+
CASE bar.
|
|
63531
|
+
WHEN '1'.
|
|
63532
|
+
WHEN 'A' OR '1'.
|
|
63526
63533
|
ENDCASE.`,
|
|
63527
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
63528
|
-
ENDIF.
|
|
63529
|
-
CASE bar.
|
|
63530
|
-
WHEN '1'.
|
|
63531
|
-
WHEN 'A'.
|
|
63534
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
63535
|
+
ENDIF.
|
|
63536
|
+
CASE bar.
|
|
63537
|
+
WHEN '1'.
|
|
63538
|
+
WHEN 'A'.
|
|
63532
63539
|
ENDCASE.`,
|
|
63533
63540
|
};
|
|
63534
63541
|
}
|
|
@@ -63662,23 +63669,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
63662
63669
|
key: "identical_contents",
|
|
63663
63670
|
title: "Identical contents",
|
|
63664
63671
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
63665
|
-
extendedInformation: `
|
|
63666
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
63667
|
-
|
|
63672
|
+
extendedInformation: `
|
|
63673
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
63674
|
+
|
|
63668
63675
|
Chained statments are ignored`,
|
|
63669
63676
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63670
|
-
badExample: `IF foo = bar.
|
|
63671
|
-
WRITE 'bar'.
|
|
63672
|
-
WRITE 'world'.
|
|
63673
|
-
ELSE.
|
|
63674
|
-
WRITE 'foo'.
|
|
63675
|
-
WRITE 'world'.
|
|
63677
|
+
badExample: `IF foo = bar.
|
|
63678
|
+
WRITE 'bar'.
|
|
63679
|
+
WRITE 'world'.
|
|
63680
|
+
ELSE.
|
|
63681
|
+
WRITE 'foo'.
|
|
63682
|
+
WRITE 'world'.
|
|
63676
63683
|
ENDIF.`,
|
|
63677
|
-
goodExample: `IF foo = bar.
|
|
63678
|
-
WRITE 'bar'.
|
|
63679
|
-
ELSE.
|
|
63680
|
-
WRITE 'foo'.
|
|
63681
|
-
ENDIF.
|
|
63684
|
+
goodExample: `IF foo = bar.
|
|
63685
|
+
WRITE 'bar'.
|
|
63686
|
+
ELSE.
|
|
63687
|
+
WRITE 'foo'.
|
|
63688
|
+
ENDIF.
|
|
63682
63689
|
WRITE 'world'.`,
|
|
63683
63690
|
};
|
|
63684
63691
|
}
|
|
@@ -63786,12 +63793,12 @@ class IdenticalDescriptions {
|
|
|
63786
63793
|
key: "identical_descriptions",
|
|
63787
63794
|
title: "Identical descriptions",
|
|
63788
63795
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
63789
|
-
extendedInformation: `Case insensitive
|
|
63790
|
-
|
|
63791
|
-
Only checks the master language descriptions
|
|
63792
|
-
|
|
63793
|
-
Dependencies are skipped
|
|
63794
|
-
|
|
63796
|
+
extendedInformation: `Case insensitive
|
|
63797
|
+
|
|
63798
|
+
Only checks the master language descriptions
|
|
63799
|
+
|
|
63800
|
+
Dependencies are skipped
|
|
63801
|
+
|
|
63795
63802
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
63796
63803
|
tags: [],
|
|
63797
63804
|
};
|
|
@@ -63965,43 +63972,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63965
63972
|
key: "if_in_if",
|
|
63966
63973
|
title: "IF in IF",
|
|
63967
63974
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63968
|
-
extendedInformation: `
|
|
63969
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63970
|
-
|
|
63971
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63972
|
-
|
|
63973
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63975
|
+
extendedInformation: `
|
|
63976
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63977
|
+
|
|
63978
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63979
|
+
|
|
63980
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63974
63981
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63975
|
-
badExample: `IF condition1.
|
|
63976
|
-
IF condition2.
|
|
63977
|
-
...
|
|
63978
|
-
ENDIF.
|
|
63979
|
-
ENDIF.
|
|
63980
|
-
|
|
63981
|
-
IF condition1.
|
|
63982
|
-
...
|
|
63983
|
-
ELSE.
|
|
63984
|
-
IF condition2.
|
|
63985
|
-
...
|
|
63986
|
-
ENDIF.
|
|
63982
|
+
badExample: `IF condition1.
|
|
63983
|
+
IF condition2.
|
|
63984
|
+
...
|
|
63985
|
+
ENDIF.
|
|
63986
|
+
ENDIF.
|
|
63987
|
+
|
|
63988
|
+
IF condition1.
|
|
63989
|
+
...
|
|
63990
|
+
ELSE.
|
|
63991
|
+
IF condition2.
|
|
63992
|
+
...
|
|
63993
|
+
ENDIF.
|
|
63987
63994
|
ENDIF.`,
|
|
63988
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63989
|
-
...
|
|
63990
|
-
ENDIF.
|
|
63991
|
-
|
|
63992
|
-
IF condition1.
|
|
63993
|
-
...
|
|
63994
|
-
ELSEIF condition2.
|
|
63995
|
-
...
|
|
63996
|
-
ENDIF.
|
|
63997
|
-
|
|
63998
|
-
CASE variable.
|
|
63999
|
-
WHEN value1.
|
|
64000
|
-
...
|
|
64001
|
-
WHEN value2.
|
|
64002
|
-
IF condition2.
|
|
64003
|
-
...
|
|
64004
|
-
ENDIF.
|
|
63995
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63996
|
+
...
|
|
63997
|
+
ENDIF.
|
|
63998
|
+
|
|
63999
|
+
IF condition1.
|
|
64000
|
+
...
|
|
64001
|
+
ELSEIF condition2.
|
|
64002
|
+
...
|
|
64003
|
+
ENDIF.
|
|
64004
|
+
|
|
64005
|
+
CASE variable.
|
|
64006
|
+
WHEN value1.
|
|
64007
|
+
...
|
|
64008
|
+
WHEN value2.
|
|
64009
|
+
IF condition2.
|
|
64010
|
+
...
|
|
64011
|
+
ENDIF.
|
|
64005
64012
|
ENDCASE.`,
|
|
64006
64013
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64007
64014
|
};
|
|
@@ -64186,9 +64193,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
64186
64193
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
64187
64194
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
64188
64195
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
64189
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
64190
|
-
METHOD ${methodName.toLowerCase()}.
|
|
64191
|
-
RETURN. " todo, implement method
|
|
64196
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
64197
|
+
METHOD ${methodName.toLowerCase()}.
|
|
64198
|
+
RETURN. " todo, implement method
|
|
64192
64199
|
ENDMETHOD.`);
|
|
64193
64200
|
}
|
|
64194
64201
|
}
|
|
@@ -64367,14 +64374,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
64367
64374
|
key: "implicit_start_of_selection",
|
|
64368
64375
|
title: "Implicit START-OF-SELECTION",
|
|
64369
64376
|
shortDescription: `Add explicit selection screen event handling`,
|
|
64370
|
-
extendedInformation: `Only runs for executable programs
|
|
64371
|
-
|
|
64377
|
+
extendedInformation: `Only runs for executable programs
|
|
64378
|
+
|
|
64372
64379
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
64373
64380
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
64374
|
-
badExample: `REPORT zfoo.
|
|
64381
|
+
badExample: `REPORT zfoo.
|
|
64375
64382
|
WRITE 'hello'.`,
|
|
64376
|
-
goodExample: `
|
|
64377
|
-
START-OF-SELECTION.
|
|
64383
|
+
goodExample: `
|
|
64384
|
+
START-OF-SELECTION.
|
|
64378
64385
|
WRITE 'hello'.`,
|
|
64379
64386
|
};
|
|
64380
64387
|
}
|
|
@@ -64479,19 +64486,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
64479
64486
|
key: "in_statement_indentation",
|
|
64480
64487
|
title: "In-statement indentation",
|
|
64481
64488
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
64482
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64483
|
-
|
|
64484
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64489
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64490
|
+
|
|
64491
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64485
64492
|
to distinguish them better from code within the block.`,
|
|
64486
|
-
badExample: `IF 1 = 1
|
|
64487
|
-
AND 2 = 2.
|
|
64488
|
-
WRITE 'hello' &&
|
|
64489
|
-
'world'.
|
|
64493
|
+
badExample: `IF 1 = 1
|
|
64494
|
+
AND 2 = 2.
|
|
64495
|
+
WRITE 'hello' &&
|
|
64496
|
+
'world'.
|
|
64490
64497
|
ENDIF.`,
|
|
64491
|
-
goodExample: `IF 1 = 1
|
|
64492
|
-
AND 2 = 2.
|
|
64493
|
-
WRITE 'hello' &&
|
|
64494
|
-
'world'.
|
|
64498
|
+
goodExample: `IF 1 = 1
|
|
64499
|
+
AND 2 = 2.
|
|
64500
|
+
WRITE 'hello' &&
|
|
64501
|
+
'world'.
|
|
64495
64502
|
ENDIF.`,
|
|
64496
64503
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64497
64504
|
};
|
|
@@ -64617,23 +64624,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
64617
64624
|
title: "Indentation",
|
|
64618
64625
|
shortDescription: `Checks indentation`,
|
|
64619
64626
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64620
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64621
|
-
PRIVATE SECTION.
|
|
64622
|
-
METHODS constructor.
|
|
64623
|
-
ENDCLASS.
|
|
64624
|
-
|
|
64625
|
-
CLASS lcl IMPLEMENTATION.
|
|
64626
|
-
METHOD constructor.
|
|
64627
|
-
ENDMETHOD.
|
|
64627
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64628
|
+
PRIVATE SECTION.
|
|
64629
|
+
METHODS constructor.
|
|
64630
|
+
ENDCLASS.
|
|
64631
|
+
|
|
64632
|
+
CLASS lcl IMPLEMENTATION.
|
|
64633
|
+
METHOD constructor.
|
|
64634
|
+
ENDMETHOD.
|
|
64628
64635
|
ENDCLASS.`,
|
|
64629
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
64630
|
-
PRIVATE SECTION.
|
|
64631
|
-
METHODS constructor.
|
|
64632
|
-
ENDCLASS.
|
|
64633
|
-
|
|
64634
|
-
CLASS lcl IMPLEMENTATION.
|
|
64635
|
-
METHOD constructor.
|
|
64636
|
-
ENDMETHOD.
|
|
64636
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
64637
|
+
PRIVATE SECTION.
|
|
64638
|
+
METHODS constructor.
|
|
64639
|
+
ENDCLASS.
|
|
64640
|
+
|
|
64641
|
+
CLASS lcl IMPLEMENTATION.
|
|
64642
|
+
METHOD constructor.
|
|
64643
|
+
ENDMETHOD.
|
|
64637
64644
|
ENDCLASS.`,
|
|
64638
64645
|
};
|
|
64639
64646
|
}
|
|
@@ -65037,9 +65044,9 @@ class IntfReferencingClas {
|
|
|
65037
65044
|
key: "intf_referencing_clas",
|
|
65038
65045
|
title: "INTF referencing CLAS",
|
|
65039
65046
|
shortDescription: `Interface contains references to class`,
|
|
65040
|
-
extendedInformation: `Only global interfaces are checked.
|
|
65041
|
-
Only first level references are checked.
|
|
65042
|
-
Exception class references are ignored.
|
|
65047
|
+
extendedInformation: `Only global interfaces are checked.
|
|
65048
|
+
Only first level references are checked.
|
|
65049
|
+
Exception class references are ignored.
|
|
65043
65050
|
Void references are ignored.`,
|
|
65044
65051
|
};
|
|
65045
65052
|
}
|
|
@@ -65124,9 +65131,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
65124
65131
|
title: "Invalid Table Index",
|
|
65125
65132
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
65126
65133
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65127
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
65134
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
65128
65135
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
65129
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
65136
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
65130
65137
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
65131
65138
|
};
|
|
65132
65139
|
}
|
|
@@ -65728,8 +65735,8 @@ class LineBreakStyle {
|
|
|
65728
65735
|
return {
|
|
65729
65736
|
key: "line_break_style",
|
|
65730
65737
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65731
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65732
|
-
|
|
65738
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65739
|
+
|
|
65733
65740
|
abapGit does not work with CRLF`,
|
|
65734
65741
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65735
65742
|
};
|
|
@@ -65798,7 +65805,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65798
65805
|
key: "line_length",
|
|
65799
65806
|
title: "Line length",
|
|
65800
65807
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65801
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65808
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65802
65809
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65803
65810
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65804
65811
|
};
|
|
@@ -65869,7 +65876,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65869
65876
|
key: "line_only_punc",
|
|
65870
65877
|
title: "Line containing only punctuation",
|
|
65871
65878
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65872
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65879
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65873
65880
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65874
65881
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65875
65882
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -66132,15 +66139,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
66132
66139
|
return {
|
|
66133
66140
|
key: "local_variable_names",
|
|
66134
66141
|
title: "Local variable naming conventions",
|
|
66135
|
-
shortDescription: `
|
|
66136
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66142
|
+
shortDescription: `
|
|
66143
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66137
66144
|
Regexes are case-insensitive.`,
|
|
66138
66145
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
66139
|
-
badExample: `FORM bar.
|
|
66140
|
-
DATA foo.
|
|
66146
|
+
badExample: `FORM bar.
|
|
66147
|
+
DATA foo.
|
|
66141
66148
|
ENDFORM.`,
|
|
66142
|
-
goodExample: `FORM bar.
|
|
66143
|
-
DATA lv_foo.
|
|
66149
|
+
goodExample: `FORM bar.
|
|
66150
|
+
DATA lv_foo.
|
|
66144
66151
|
ENDFORM.`,
|
|
66145
66152
|
};
|
|
66146
66153
|
}
|
|
@@ -66292,9 +66299,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
66292
66299
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
66293
66300
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
66294
66301
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
66295
|
-
badExample: `DEFINE something.
|
|
66302
|
+
badExample: `DEFINE something.
|
|
66296
66303
|
END-OF-DEFINITION.`,
|
|
66297
|
-
goodExample: `DEFINE _something.
|
|
66304
|
+
goodExample: `DEFINE _something.
|
|
66298
66305
|
END-OF-DEFINITION.`,
|
|
66299
66306
|
};
|
|
66300
66307
|
}
|
|
@@ -66367,10 +66374,10 @@ class MainFileContents {
|
|
|
66367
66374
|
key: "main_file_contents",
|
|
66368
66375
|
title: "Main file contents",
|
|
66369
66376
|
shortDescription: `Checks related to report declarations.`,
|
|
66370
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
66371
|
-
|
|
66372
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
66373
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
66377
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
66378
|
+
|
|
66379
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
66380
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
66374
66381
|
`,
|
|
66375
66382
|
};
|
|
66376
66383
|
}
|
|
@@ -66486,17 +66493,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
66486
66493
|
title: "Too many parentheses",
|
|
66487
66494
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
66488
66495
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
66489
|
-
badExample: `
|
|
66490
|
-
IF ( destination IS INITIAL ).
|
|
66491
|
-
ENDIF.
|
|
66492
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66493
|
-
ENDIF.
|
|
66496
|
+
badExample: `
|
|
66497
|
+
IF ( destination IS INITIAL ).
|
|
66498
|
+
ENDIF.
|
|
66499
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66500
|
+
ENDIF.
|
|
66494
66501
|
`,
|
|
66495
|
-
goodExample: `
|
|
66496
|
-
IF destination IS INITIAL.
|
|
66497
|
-
ENDIF.
|
|
66498
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
66499
|
-
ENDIF.
|
|
66502
|
+
goodExample: `
|
|
66503
|
+
IF destination IS INITIAL.
|
|
66504
|
+
ENDIF.
|
|
66505
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
66506
|
+
ENDIF.
|
|
66500
66507
|
`,
|
|
66501
66508
|
};
|
|
66502
66509
|
}
|
|
@@ -66670,14 +66677,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66670
66677
|
title: "Max one method parameter definition per line",
|
|
66671
66678
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66672
66679
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66673
|
-
badExample: `
|
|
66674
|
-
METHODS apps_scope_token
|
|
66675
|
-
IMPORTING
|
|
66680
|
+
badExample: `
|
|
66681
|
+
METHODS apps_scope_token
|
|
66682
|
+
IMPORTING
|
|
66676
66683
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66677
|
-
goodExample: `
|
|
66678
|
-
METHODS apps_scope_token
|
|
66679
|
-
IMPORTING
|
|
66680
|
-
body TYPE bodyapps_scope_token
|
|
66684
|
+
goodExample: `
|
|
66685
|
+
METHODS apps_scope_token
|
|
66686
|
+
IMPORTING
|
|
66687
|
+
body TYPE bodyapps_scope_token
|
|
66681
66688
|
client_id TYPE str.`,
|
|
66682
66689
|
};
|
|
66683
66690
|
}
|
|
@@ -66742,11 +66749,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66742
66749
|
key: "max_one_statement",
|
|
66743
66750
|
title: "Max one statement per line",
|
|
66744
66751
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66745
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66746
|
-
|
|
66747
|
-
Does not report anything for chained statements.
|
|
66748
|
-
|
|
66749
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66752
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66753
|
+
|
|
66754
|
+
Does not report anything for chained statements.
|
|
66755
|
+
|
|
66756
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66750
66757
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66751
66758
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66752
66759
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -67084,8 +67091,8 @@ class MethodLength {
|
|
|
67084
67091
|
key: "method_length",
|
|
67085
67092
|
title: "Method/Form Length",
|
|
67086
67093
|
shortDescription: `Checks relating to method/form length.`,
|
|
67087
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
67088
|
-
|
|
67094
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
67095
|
+
|
|
67089
67096
|
Abstract methods without statements are considered okay.`,
|
|
67090
67097
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67091
67098
|
};
|
|
@@ -67190,20 +67197,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
67190
67197
|
key: "method_overwrites_builtin",
|
|
67191
67198
|
title: "Method name overwrites builtin function",
|
|
67192
67199
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
67193
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
67194
|
-
|
|
67195
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
67196
|
-
|
|
67200
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
67201
|
+
|
|
67202
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
67203
|
+
|
|
67197
67204
|
Interface method names are ignored`,
|
|
67198
67205
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67199
|
-
badExample: `CLASS lcl DEFINITION.
|
|
67200
|
-
PUBLIC SECTION.
|
|
67201
|
-
METHODS matches.
|
|
67202
|
-
ENDCLASS.
|
|
67203
|
-
|
|
67204
|
-
CLASS lcl IMPLEMENTATION.
|
|
67205
|
-
METHOD matches.
|
|
67206
|
-
ENDMETHOD.
|
|
67206
|
+
badExample: `CLASS lcl DEFINITION.
|
|
67207
|
+
PUBLIC SECTION.
|
|
67208
|
+
METHODS matches.
|
|
67209
|
+
ENDCLASS.
|
|
67210
|
+
|
|
67211
|
+
CLASS lcl IMPLEMENTATION.
|
|
67212
|
+
METHOD matches.
|
|
67213
|
+
ENDMETHOD.
|
|
67207
67214
|
ENDCLASS.`,
|
|
67208
67215
|
};
|
|
67209
67216
|
}
|
|
@@ -67394,12 +67401,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
67394
67401
|
// eslint-disable-next-line max-len
|
|
67395
67402
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
67396
67403
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67397
|
-
badExample: `CLASS lcl DEFINITION.
|
|
67398
|
-
PUBLIC SECTION.
|
|
67399
|
-
METHODS
|
|
67400
|
-
foobar
|
|
67401
|
-
EXPORTING foo TYPE i
|
|
67402
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
67404
|
+
badExample: `CLASS lcl DEFINITION.
|
|
67405
|
+
PUBLIC SECTION.
|
|
67406
|
+
METHODS
|
|
67407
|
+
foobar
|
|
67408
|
+
EXPORTING foo TYPE i
|
|
67409
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
67403
67410
|
ENDCLASS.`,
|
|
67404
67411
|
};
|
|
67405
67412
|
}
|
|
@@ -67779,7 +67786,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67779
67786
|
key: "nesting",
|
|
67780
67787
|
title: "Check nesting depth",
|
|
67781
67788
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67782
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67789
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67783
67790
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67784
67791
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67785
67792
|
};
|
|
@@ -68022,7 +68029,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
68022
68029
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
68023
68030
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68024
68031
|
badExample: `var1 = var2 = var3.`,
|
|
68025
|
-
goodExample: `var2 = var3.
|
|
68032
|
+
goodExample: `var2 = var3.
|
|
68026
68033
|
var1 = var2.`,
|
|
68027
68034
|
};
|
|
68028
68035
|
}
|
|
@@ -68081,8 +68088,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
68081
68088
|
key: "no_external_form_calls",
|
|
68082
68089
|
title: "No external FORM calls",
|
|
68083
68090
|
shortDescription: `Detect external form calls`,
|
|
68084
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
68085
|
-
|
|
68091
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
68092
|
+
|
|
68086
68093
|
PERFORM foo(bar).`,
|
|
68087
68094
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68088
68095
|
};
|
|
@@ -68143,17 +68150,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
68143
68150
|
key: "no_inline_in_optional_branches",
|
|
68144
68151
|
title: "Don't declare inline in optional branches",
|
|
68145
68152
|
shortDescription: `Don't declare inline in optional branches`,
|
|
68146
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
68147
|
-
|
|
68148
|
-
Considered optional branches:
|
|
68149
|
-
* inside IF/ELSEIF/ELSE
|
|
68150
|
-
* inside LOOP
|
|
68151
|
-
* inside WHILE
|
|
68152
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
68153
|
-
* inside DO
|
|
68154
|
-
* inside SELECT loops
|
|
68155
|
-
|
|
68156
|
-
Not considered optional branches:
|
|
68153
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
68154
|
+
|
|
68155
|
+
Considered optional branches:
|
|
68156
|
+
* inside IF/ELSEIF/ELSE
|
|
68157
|
+
* inside LOOP
|
|
68158
|
+
* inside WHILE
|
|
68159
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
68160
|
+
* inside DO
|
|
68161
|
+
* inside SELECT loops
|
|
68162
|
+
|
|
68163
|
+
Not considered optional branches:
|
|
68157
68164
|
* TRY/CATCH/CLEANUP`,
|
|
68158
68165
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68159
68166
|
};
|
|
@@ -68253,12 +68260,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
68253
68260
|
key: "no_prefixes",
|
|
68254
68261
|
title: "No Prefixes",
|
|
68255
68262
|
shortDescription: `Dont use hungarian notation`,
|
|
68256
|
-
extendedInformation: `
|
|
68257
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
68258
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
68259
|
-
|
|
68260
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
68261
|
-
|
|
68263
|
+
extendedInformation: `
|
|
68264
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
68265
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
68266
|
+
|
|
68267
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
68268
|
+
|
|
68262
68269
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
68263
68270
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68264
68271
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -68437,7 +68444,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
68437
68444
|
return {
|
|
68438
68445
|
key: "no_public_attributes",
|
|
68439
68446
|
title: "No public attributes",
|
|
68440
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
68447
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
68441
68448
|
Exceptions are excluded from this rule.`,
|
|
68442
68449
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
68443
68450
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -68538,13 +68545,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
68538
68545
|
key: "no_yoda_conditions",
|
|
68539
68546
|
title: "No Yoda conditions",
|
|
68540
68547
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
68541
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68542
|
-
|
|
68548
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68549
|
+
|
|
68543
68550
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
68544
68551
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68545
|
-
badExample: `IF 0 <> sy-subrc.
|
|
68552
|
+
badExample: `IF 0 <> sy-subrc.
|
|
68546
68553
|
ENDIF.`,
|
|
68547
|
-
goodExample: `IF sy-subrc <> 0.
|
|
68554
|
+
goodExample: `IF sy-subrc <> 0.
|
|
68548
68555
|
ENDIF.`,
|
|
68549
68556
|
};
|
|
68550
68557
|
}
|
|
@@ -68645,8 +68652,8 @@ class NROBConsistency {
|
|
|
68645
68652
|
key: "nrob_consistency",
|
|
68646
68653
|
title: "Number range consistency",
|
|
68647
68654
|
shortDescription: `Consistency checks for number ranges`,
|
|
68648
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68649
|
-
|
|
68655
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68656
|
+
|
|
68650
68657
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
68651
68658
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68652
68659
|
};
|
|
@@ -68923,58 +68930,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68923
68930
|
title: "Obsolete statements",
|
|
68924
68931
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68925
68932
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68926
|
-
extendedInformation: `
|
|
68927
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68928
|
-
|
|
68929
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68930
|
-
|
|
68931
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68932
|
-
|
|
68933
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68934
|
-
|
|
68935
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68936
|
-
|
|
68937
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68938
|
-
|
|
68939
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68940
|
-
|
|
68941
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68942
|
-
|
|
68943
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68944
|
-
|
|
68945
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68946
|
-
|
|
68947
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68948
|
-
|
|
68949
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68950
|
-
|
|
68951
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68952
|
-
|
|
68953
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68954
|
-
|
|
68955
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68956
|
-
SELECT COUNT(*) is considered okay
|
|
68957
|
-
|
|
68958
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68959
|
-
|
|
68960
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68961
|
-
|
|
68962
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68963
|
-
|
|
68964
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68965
|
-
|
|
68966
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68967
|
-
|
|
68933
|
+
extendedInformation: `
|
|
68934
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68935
|
+
|
|
68936
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68937
|
+
|
|
68938
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68939
|
+
|
|
68940
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68941
|
+
|
|
68942
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68943
|
+
|
|
68944
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68945
|
+
|
|
68946
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68947
|
+
|
|
68948
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68949
|
+
|
|
68950
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68951
|
+
|
|
68952
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68953
|
+
|
|
68954
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68955
|
+
|
|
68956
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68957
|
+
|
|
68958
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68959
|
+
|
|
68960
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68961
|
+
|
|
68962
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68963
|
+
SELECT COUNT(*) is considered okay
|
|
68964
|
+
|
|
68965
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68966
|
+
|
|
68967
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68968
|
+
|
|
68969
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68970
|
+
|
|
68971
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68972
|
+
|
|
68973
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68974
|
+
|
|
68968
68975
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68969
|
-
badExample: `REFRESH itab.
|
|
68970
|
-
|
|
68971
|
-
COMPUTE foo = 2 + 2.
|
|
68972
|
-
|
|
68973
|
-
MULTIPLY lv_foo BY 2.
|
|
68974
|
-
|
|
68975
|
-
INTERFACE intf LOAD.
|
|
68976
|
-
|
|
68977
|
-
IF foo IS SUPPLIED.
|
|
68976
|
+
badExample: `REFRESH itab.
|
|
68977
|
+
|
|
68978
|
+
COMPUTE foo = 2 + 2.
|
|
68979
|
+
|
|
68980
|
+
MULTIPLY lv_foo BY 2.
|
|
68981
|
+
|
|
68982
|
+
INTERFACE intf LOAD.
|
|
68983
|
+
|
|
68984
|
+
IF foo IS SUPPLIED.
|
|
68978
68985
|
ENDIF.`,
|
|
68979
68986
|
};
|
|
68980
68987
|
}
|
|
@@ -69314,9 +69321,9 @@ class OmitParameterName {
|
|
|
69314
69321
|
key: "omit_parameter_name",
|
|
69315
69322
|
title: "Omit parameter name",
|
|
69316
69323
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
69317
|
-
extendedInformation: `
|
|
69318
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
69319
|
-
|
|
69324
|
+
extendedInformation: `
|
|
69325
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
69326
|
+
|
|
69320
69327
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
69321
69328
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
69322
69329
|
badExample: `method( param = 2 ).`,
|
|
@@ -69522,20 +69529,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
69522
69529
|
shortDescription: `Omit RECEIVING`,
|
|
69523
69530
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
69524
69531
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69525
|
-
badExample: `
|
|
69526
|
-
upload_pack(
|
|
69527
|
-
EXPORTING
|
|
69528
|
-
io_client = lo_client
|
|
69529
|
-
iv_url = iv_url
|
|
69530
|
-
iv_deepen_level = iv_deepen_level
|
|
69531
|
-
it_hashes = lt_hashes
|
|
69532
|
-
RECEIVING
|
|
69532
|
+
badExample: `
|
|
69533
|
+
upload_pack(
|
|
69534
|
+
EXPORTING
|
|
69535
|
+
io_client = lo_client
|
|
69536
|
+
iv_url = iv_url
|
|
69537
|
+
iv_deepen_level = iv_deepen_level
|
|
69538
|
+
it_hashes = lt_hashes
|
|
69539
|
+
RECEIVING
|
|
69533
69540
|
rt_objects = et_objects ).`,
|
|
69534
|
-
goodExample: `
|
|
69535
|
-
et_objects = upload_pack(
|
|
69536
|
-
io_client = lo_client
|
|
69537
|
-
iv_url = iv_url
|
|
69538
|
-
iv_deepen_level = iv_deepen_level
|
|
69541
|
+
goodExample: `
|
|
69542
|
+
et_objects = upload_pack(
|
|
69543
|
+
io_client = lo_client
|
|
69544
|
+
iv_url = iv_url
|
|
69545
|
+
iv_deepen_level = iv_deepen_level
|
|
69539
69546
|
it_hashes = lt_hashes ).`,
|
|
69540
69547
|
};
|
|
69541
69548
|
}
|
|
@@ -69599,8 +69606,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
69599
69606
|
return {
|
|
69600
69607
|
key: "parser_702_chaining",
|
|
69601
69608
|
title: "Parser Error, bad chanining on 702",
|
|
69602
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69603
|
-
this rule finds these and reports errors.
|
|
69609
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69610
|
+
this rule finds these and reports errors.
|
|
69604
69611
|
Only active on target version 702 and below.`,
|
|
69605
69612
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69606
69613
|
};
|
|
@@ -69680,8 +69687,8 @@ class ParserError {
|
|
|
69680
69687
|
return {
|
|
69681
69688
|
key: "parser_error",
|
|
69682
69689
|
title: "Parser error",
|
|
69683
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69684
|
-
|
|
69690
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69691
|
+
|
|
69685
69692
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69686
69693
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69687
69694
|
};
|
|
@@ -69766,7 +69773,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69766
69773
|
return {
|
|
69767
69774
|
key: "parser_missing_space",
|
|
69768
69775
|
title: "Parser Error, missing space",
|
|
69769
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69776
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69770
69777
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69771
69778
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69772
69779
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -70189,25 +70196,25 @@ class PreferInline {
|
|
|
70189
70196
|
key: "prefer_inline",
|
|
70190
70197
|
title: "Prefer Inline Declarations",
|
|
70191
70198
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
70192
|
-
extendedInformation: `EXPERIMENTAL
|
|
70193
|
-
|
|
70194
|
-
Activates if language version is v740sp02 or above.
|
|
70195
|
-
|
|
70196
|
-
Variables must be local(METHOD or FORM).
|
|
70197
|
-
|
|
70198
|
-
No generic or void typed variables. No syntax errors.
|
|
70199
|
-
|
|
70200
|
-
First position used must be a full/pure write.
|
|
70201
|
-
|
|
70202
|
-
Move statment is not a cast(?=)
|
|
70203
|
-
|
|
70199
|
+
extendedInformation: `EXPERIMENTAL
|
|
70200
|
+
|
|
70201
|
+
Activates if language version is v740sp02 or above.
|
|
70202
|
+
|
|
70203
|
+
Variables must be local(METHOD or FORM).
|
|
70204
|
+
|
|
70205
|
+
No generic or void typed variables. No syntax errors.
|
|
70206
|
+
|
|
70207
|
+
First position used must be a full/pure write.
|
|
70208
|
+
|
|
70209
|
+
Move statment is not a cast(?=)
|
|
70210
|
+
|
|
70204
70211
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
70205
70212
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
70206
|
-
badExample: `DATA foo TYPE i.
|
|
70207
|
-
foo = 2.
|
|
70208
|
-
DATA percentage TYPE decfloat34.
|
|
70213
|
+
badExample: `DATA foo TYPE i.
|
|
70214
|
+
foo = 2.
|
|
70215
|
+
DATA percentage TYPE decfloat34.
|
|
70209
70216
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
70210
|
-
goodExample: `DATA(foo) = 2.
|
|
70217
|
+
goodExample: `DATA(foo) = 2.
|
|
70211
70218
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
70212
70219
|
};
|
|
70213
70220
|
}
|
|
@@ -70421,18 +70428,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
70421
70428
|
key: "prefer_is_not",
|
|
70422
70429
|
title: "Prefer IS NOT to NOT IS",
|
|
70423
70430
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
70424
|
-
extendedInformation: `
|
|
70425
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
70426
|
-
|
|
70431
|
+
extendedInformation: `
|
|
70432
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
70433
|
+
|
|
70427
70434
|
"if not is_valid( )." examples are skipped`,
|
|
70428
70435
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70429
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
70430
|
-
IF variable NP 'TODO*'.
|
|
70431
|
-
IF variable <> 42.
|
|
70436
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
70437
|
+
IF variable NP 'TODO*'.
|
|
70438
|
+
IF variable <> 42.
|
|
70432
70439
|
IF variable CO 'hello'.`,
|
|
70433
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
70434
|
-
IF NOT variable CP 'TODO*'.
|
|
70435
|
-
IF NOT variable = 42.
|
|
70440
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
70441
|
+
IF NOT variable CP 'TODO*'.
|
|
70442
|
+
IF NOT variable = 42.
|
|
70436
70443
|
IF NOT variable CA 'hello'.`,
|
|
70437
70444
|
};
|
|
70438
70445
|
}
|
|
@@ -70620,14 +70627,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
70620
70627
|
key: "prefer_raise_exception_new",
|
|
70621
70628
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
70622
70629
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
70623
|
-
extendedInformation: `
|
|
70624
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70625
|
-
|
|
70630
|
+
extendedInformation: `
|
|
70631
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70632
|
+
|
|
70626
70633
|
From 752 and up`,
|
|
70627
70634
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
70628
70635
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
70629
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70630
|
-
EXPORTING
|
|
70636
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70637
|
+
EXPORTING
|
|
70631
70638
|
previous = exception.`,
|
|
70632
70639
|
};
|
|
70633
70640
|
}
|
|
@@ -70705,12 +70712,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70705
70712
|
key: "prefer_returning_to_exporting",
|
|
70706
70713
|
title: "Prefer RETURNING to EXPORTING",
|
|
70707
70714
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70708
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70715
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70709
70716
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70710
70717
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70711
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70712
|
-
PUBLIC SECTION.
|
|
70713
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70718
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70719
|
+
PUBLIC SECTION.
|
|
70720
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70714
70721
|
ENDCLASS.`,
|
|
70715
70722
|
};
|
|
70716
70723
|
}
|
|
@@ -70806,8 +70813,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70806
70813
|
key: "prefer_xsdbool",
|
|
70807
70814
|
title: "Prefer xsdbool over boolc",
|
|
70808
70815
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70809
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70810
|
-
|
|
70816
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70817
|
+
|
|
70811
70818
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70812
70819
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70813
70820
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70879,9 +70886,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70879
70886
|
title: "Preferred compare operator",
|
|
70880
70887
|
shortDescription: `Configure undesired operator variants`,
|
|
70881
70888
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70882
|
-
badExample: `IF foo EQ bar.
|
|
70889
|
+
badExample: `IF foo EQ bar.
|
|
70883
70890
|
ENDIF.`,
|
|
70884
|
-
goodExample: `IF foo = bar.
|
|
70891
|
+
goodExample: `IF foo = bar.
|
|
70885
70892
|
ENDIF.`,
|
|
70886
70893
|
};
|
|
70887
70894
|
}
|
|
@@ -71105,26 +71112,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
71105
71112
|
key: "reduce_procedural_code",
|
|
71106
71113
|
title: "Reduce procedural code",
|
|
71107
71114
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
71108
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
71109
|
-
|
|
71110
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
71111
|
-
|
|
71115
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
71116
|
+
|
|
71117
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
71118
|
+
|
|
71112
71119
|
Comments are not counted as statements.`,
|
|
71113
71120
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
71114
|
-
badExample: `FORM foo.
|
|
71115
|
-
DATA lv_bar TYPE i.
|
|
71116
|
-
lv_bar = 2 + 2.
|
|
71117
|
-
IF lv_bar = 4.
|
|
71118
|
-
WRITE 'hello world'.
|
|
71119
|
-
ENDIF.
|
|
71120
|
-
DATA lv_bar TYPE i.
|
|
71121
|
-
lv_bar = 2 + 2.
|
|
71122
|
-
IF lv_bar = 4.
|
|
71123
|
-
WRITE 'hello world'.
|
|
71124
|
-
ENDIF.
|
|
71121
|
+
badExample: `FORM foo.
|
|
71122
|
+
DATA lv_bar TYPE i.
|
|
71123
|
+
lv_bar = 2 + 2.
|
|
71124
|
+
IF lv_bar = 4.
|
|
71125
|
+
WRITE 'hello world'.
|
|
71126
|
+
ENDIF.
|
|
71127
|
+
DATA lv_bar TYPE i.
|
|
71128
|
+
lv_bar = 2 + 2.
|
|
71129
|
+
IF lv_bar = 4.
|
|
71130
|
+
WRITE 'hello world'.
|
|
71131
|
+
ENDIF.
|
|
71125
71132
|
ENDFORM.`,
|
|
71126
|
-
goodExample: `FORM foo.
|
|
71127
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
71133
|
+
goodExample: `FORM foo.
|
|
71134
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
71128
71135
|
ENDFORM.`,
|
|
71129
71136
|
};
|
|
71130
71137
|
}
|
|
@@ -71368,10 +71375,10 @@ class RemoveDescriptions {
|
|
|
71368
71375
|
return {
|
|
71369
71376
|
key: "remove_descriptions",
|
|
71370
71377
|
title: "Remove descriptions",
|
|
71371
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
71372
|
-
|
|
71373
|
-
Class descriptions are required, see rule description_empty.
|
|
71374
|
-
|
|
71378
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
71379
|
+
|
|
71380
|
+
Class descriptions are required, see rule description_empty.
|
|
71381
|
+
|
|
71375
71382
|
Consider using ABAP Doc for documentation.`,
|
|
71376
71383
|
tags: [],
|
|
71377
71384
|
};
|
|
@@ -71496,14 +71503,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
71496
71503
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71497
71504
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
71498
71505
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
71499
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
71506
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
71500
71507
|
DESTINATION lv_rfc.`,
|
|
71501
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71502
|
-
DESTINATION lv_rfc
|
|
71503
|
-
EXCEPTIONS
|
|
71504
|
-
system_failure = 1 MESSAGE msg
|
|
71505
|
-
communication_failure = 2 MESSAGE msg
|
|
71506
|
-
resource_failure = 3
|
|
71508
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71509
|
+
DESTINATION lv_rfc
|
|
71510
|
+
EXCEPTIONS
|
|
71511
|
+
system_failure = 1 MESSAGE msg
|
|
71512
|
+
communication_failure = 2 MESSAGE msg
|
|
71513
|
+
resource_failure = 3
|
|
71507
71514
|
OTHERS = 4.`,
|
|
71508
71515
|
};
|
|
71509
71516
|
}
|
|
@@ -71587,11 +71594,11 @@ class SelectAddOrderBy {
|
|
|
71587
71594
|
key: "select_add_order_by",
|
|
71588
71595
|
title: "SELECT add ORDER BY",
|
|
71589
71596
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
71590
|
-
extendedInformation: `
|
|
71591
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71592
|
-
|
|
71593
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
71594
|
-
|
|
71597
|
+
extendedInformation: `
|
|
71598
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71599
|
+
|
|
71600
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
71601
|
+
|
|
71595
71602
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
71596
71603
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71597
71604
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71722,14 +71729,14 @@ class SelectPerformance {
|
|
|
71722
71729
|
key: "select_performance",
|
|
71723
71730
|
title: "SELECT performance",
|
|
71724
71731
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71725
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71726
|
-
|
|
71732
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71733
|
+
|
|
71727
71734
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71728
71735
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71729
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71730
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71736
|
+
badExample: `SELECT field1, field2 FROM table
|
|
71737
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71731
71738
|
ENDSELECT.`,
|
|
71732
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71739
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71733
71740
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71734
71741
|
};
|
|
71735
71742
|
}
|
|
@@ -71843,8 +71850,8 @@ class SelectSingleFullKey {
|
|
|
71843
71850
|
key: "select_single_full_key",
|
|
71844
71851
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71845
71852
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71846
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71847
|
-
|
|
71853
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71854
|
+
|
|
71848
71855
|
If the statement contains a JOIN it is not checked`,
|
|
71849
71856
|
pseudoComment: "EC CI_NOORDER",
|
|
71850
71857
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -72272,8 +72279,8 @@ class SICFConsistency {
|
|
|
72272
72279
|
key: "sicf_consistency",
|
|
72273
72280
|
title: "SICF consistency",
|
|
72274
72281
|
shortDescription: `Checks the validity of ICF services`,
|
|
72275
|
-
extendedInformation: `* Class defined in handler must exist
|
|
72276
|
-
* Class must not have any syntax errors
|
|
72282
|
+
extendedInformation: `* Class defined in handler must exist
|
|
72283
|
+
* Class must not have any syntax errors
|
|
72277
72284
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
72278
72285
|
};
|
|
72279
72286
|
}
|
|
@@ -72385,23 +72392,23 @@ class SlowParameterPassing {
|
|
|
72385
72392
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
72386
72393
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
72387
72394
|
tags: [_irule_1.RuleTag.Performance],
|
|
72388
|
-
badExample: `CLASS lcl DEFINITION.
|
|
72389
|
-
PUBLIC SECTION.
|
|
72390
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
72391
|
-
ENDCLASS.
|
|
72392
|
-
CLASS lcl IMPLEMENTATION.
|
|
72393
|
-
METHOD bar.
|
|
72394
|
-
WRITE sdf.
|
|
72395
|
-
ENDMETHOD.
|
|
72395
|
+
badExample: `CLASS lcl DEFINITION.
|
|
72396
|
+
PUBLIC SECTION.
|
|
72397
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
72398
|
+
ENDCLASS.
|
|
72399
|
+
CLASS lcl IMPLEMENTATION.
|
|
72400
|
+
METHOD bar.
|
|
72401
|
+
WRITE sdf.
|
|
72402
|
+
ENDMETHOD.
|
|
72396
72403
|
ENDCLASS.`,
|
|
72397
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
72398
|
-
PUBLIC SECTION.
|
|
72399
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
72400
|
-
ENDCLASS.
|
|
72401
|
-
CLASS lcl IMPLEMENTATION.
|
|
72402
|
-
METHOD bar.
|
|
72403
|
-
WRITE sdf.
|
|
72404
|
-
ENDMETHOD.
|
|
72404
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
72405
|
+
PUBLIC SECTION.
|
|
72406
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
72407
|
+
ENDCLASS.
|
|
72408
|
+
CLASS lcl IMPLEMENTATION.
|
|
72409
|
+
METHOD bar.
|
|
72410
|
+
WRITE sdf.
|
|
72411
|
+
ENDMETHOD.
|
|
72405
72412
|
ENDCLASS.`,
|
|
72406
72413
|
};
|
|
72407
72414
|
}
|
|
@@ -72672,8 +72679,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
72672
72679
|
key: "space_before_dot",
|
|
72673
72680
|
title: "Space before dot",
|
|
72674
72681
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
72675
|
-
extendedInformation: `
|
|
72676
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72682
|
+
extendedInformation: `
|
|
72683
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72677
72684
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
72678
72685
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72679
72686
|
badExample: `WRITE bar .`,
|
|
@@ -72859,12 +72866,12 @@ class SQLValueConversion {
|
|
|
72859
72866
|
key: "sql_value_conversion",
|
|
72860
72867
|
title: "Implicit SQL Value Conversion",
|
|
72861
72868
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72862
|
-
extendedInformation: `
|
|
72863
|
-
* Integer to CHAR conversion
|
|
72864
|
-
* Integer to NUMC conversion
|
|
72865
|
-
* NUMC to Integer conversion
|
|
72866
|
-
* CHAR to Integer conversion
|
|
72867
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72869
|
+
extendedInformation: `
|
|
72870
|
+
* Integer to CHAR conversion
|
|
72871
|
+
* Integer to NUMC conversion
|
|
72872
|
+
* NUMC to Integer conversion
|
|
72873
|
+
* CHAR to Integer conversion
|
|
72874
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72868
72875
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72869
72876
|
tags: [],
|
|
72870
72877
|
};
|
|
@@ -72936,7 +72943,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72936
72943
|
key: "start_at_tab",
|
|
72937
72944
|
title: "Start at tab",
|
|
72938
72945
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72939
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72946
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72940
72947
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72941
72948
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72942
72949
|
badExample: ` WRITE a.`,
|
|
@@ -73113,12 +73120,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
73113
73120
|
key: "strict_sql",
|
|
73114
73121
|
title: "Strict SQL",
|
|
73115
73122
|
shortDescription: `Strict SQL`,
|
|
73116
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
73117
|
-
|
|
73118
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
73119
|
-
|
|
73120
|
-
Also see separate rule sql_escape_host_variables
|
|
73121
|
-
|
|
73123
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
73124
|
+
|
|
73125
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
73126
|
+
|
|
73127
|
+
Also see separate rule sql_escape_host_variables
|
|
73128
|
+
|
|
73122
73129
|
Activates from v750 and up`,
|
|
73123
73130
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
73124
73131
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -73372,11 +73379,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
73372
73379
|
key: "sy_modification",
|
|
73373
73380
|
title: "Modification of SY fields",
|
|
73374
73381
|
shortDescription: `Finds modification of sy fields`,
|
|
73375
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
73376
|
-
|
|
73382
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
73383
|
+
|
|
73377
73384
|
Changes to SY-TVAR* fields are not reported`,
|
|
73378
73385
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73379
|
-
badExample: `sy-uname = 2.
|
|
73386
|
+
badExample: `sy-uname = 2.
|
|
73380
73387
|
sy = sy.`,
|
|
73381
73388
|
};
|
|
73382
73389
|
}
|
|
@@ -73438,8 +73445,8 @@ class TABLEnhancementCategory {
|
|
|
73438
73445
|
key: "tabl_enhancement_category",
|
|
73439
73446
|
title: "TABL enhancement category must be set",
|
|
73440
73447
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
73441
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73442
|
-
|
|
73448
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73449
|
+
|
|
73443
73450
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
73444
73451
|
tags: [],
|
|
73445
73452
|
};
|
|
@@ -73504,8 +73511,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
73504
73511
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
73505
73512
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
73506
73513
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73507
|
-
badExample: `FORM foo.
|
|
73508
|
-
TABLES t100.
|
|
73514
|
+
badExample: `FORM foo.
|
|
73515
|
+
TABLES t100.
|
|
73509
73516
|
ENDFORM.`,
|
|
73510
73517
|
goodExample: `TABLES t000.`,
|
|
73511
73518
|
};
|
|
@@ -73633,9 +73640,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
73633
73640
|
title: "Type FORM parameters",
|
|
73634
73641
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
73635
73642
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73636
|
-
badExample: `FORM foo USING bar.
|
|
73643
|
+
badExample: `FORM foo USING bar.
|
|
73637
73644
|
ENDFORM.`,
|
|
73638
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
73645
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
73639
73646
|
ENDFORM.`,
|
|
73640
73647
|
};
|
|
73641
73648
|
}
|
|
@@ -74308,38 +74315,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
74308
74315
|
key: "unnecessary_pragma",
|
|
74309
74316
|
title: "Unnecessary Pragma",
|
|
74310
74317
|
shortDescription: `Finds pragmas which can be removed`,
|
|
74311
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
74312
|
-
|
|
74313
|
-
* NEEDED without definition
|
|
74314
|
-
|
|
74315
|
-
* NO_TEXT without texts
|
|
74316
|
-
|
|
74317
|
-
* SUBRC_OK where sy-subrc is checked
|
|
74318
|
-
|
|
74318
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
74319
|
+
|
|
74320
|
+
* NEEDED without definition
|
|
74321
|
+
|
|
74322
|
+
* NO_TEXT without texts
|
|
74323
|
+
|
|
74324
|
+
* SUBRC_OK where sy-subrc is checked
|
|
74325
|
+
|
|
74319
74326
|
NO_HANDLER inside macros are not checked`,
|
|
74320
74327
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
74321
|
-
badExample: `TRY.
|
|
74322
|
-
...
|
|
74323
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
74324
|
-
RETURN. " it has a handler
|
|
74325
|
-
ENDTRY.
|
|
74326
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
74327
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
74328
|
-
IF sy-subrc <> 0.
|
|
74328
|
+
badExample: `TRY.
|
|
74329
|
+
...
|
|
74330
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
74331
|
+
RETURN. " it has a handler
|
|
74332
|
+
ENDTRY.
|
|
74333
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
74334
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
74335
|
+
IF sy-subrc <> 0.
|
|
74329
74336
|
ENDIF.`,
|
|
74330
|
-
goodExample: `TRY.
|
|
74331
|
-
...
|
|
74332
|
-
CATCH zcx_abapgit_exception.
|
|
74333
|
-
RETURN.
|
|
74334
|
-
ENDTRY.
|
|
74335
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
74336
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
74337
|
-
IF sy-subrc <> 0.
|
|
74338
|
-
ENDIF.
|
|
74339
|
-
|
|
74340
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
74341
|
-
test1 TYPE string,
|
|
74342
|
-
test2 TYPE string,
|
|
74337
|
+
goodExample: `TRY.
|
|
74338
|
+
...
|
|
74339
|
+
CATCH zcx_abapgit_exception.
|
|
74340
|
+
RETURN.
|
|
74341
|
+
ENDTRY.
|
|
74342
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
74343
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
74344
|
+
IF sy-subrc <> 0.
|
|
74345
|
+
ENDIF.
|
|
74346
|
+
|
|
74347
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
74348
|
+
test1 TYPE string,
|
|
74349
|
+
test2 TYPE string,
|
|
74343
74350
|
END OF blah.`,
|
|
74344
74351
|
};
|
|
74345
74352
|
}
|
|
@@ -74506,18 +74513,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
74506
74513
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
74507
74514
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
74508
74515
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
74509
|
-
badExample: `FORM hello1.
|
|
74510
|
-
WRITE 'world'.
|
|
74511
|
-
RETURN.
|
|
74512
|
-
ENDFORM.
|
|
74513
|
-
|
|
74514
|
-
FORM foo.
|
|
74515
|
-
IF 1 = 2.
|
|
74516
|
-
RETURN.
|
|
74517
|
-
ENDIF.
|
|
74516
|
+
badExample: `FORM hello1.
|
|
74517
|
+
WRITE 'world'.
|
|
74518
|
+
RETURN.
|
|
74519
|
+
ENDFORM.
|
|
74520
|
+
|
|
74521
|
+
FORM foo.
|
|
74522
|
+
IF 1 = 2.
|
|
74523
|
+
RETURN.
|
|
74524
|
+
ENDIF.
|
|
74518
74525
|
ENDFORM.`,
|
|
74519
|
-
goodExample: `FORM hello2.
|
|
74520
|
-
WRITE 'world'.
|
|
74526
|
+
goodExample: `FORM hello2.
|
|
74527
|
+
WRITE 'world'.
|
|
74521
74528
|
ENDFORM.`,
|
|
74522
74529
|
};
|
|
74523
74530
|
}
|
|
@@ -74868,13 +74875,13 @@ class UnusedMacros {
|
|
|
74868
74875
|
title: "Unused macros",
|
|
74869
74876
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74870
74877
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74871
|
-
badExample: `DEFINE foobar1.
|
|
74872
|
-
WRITE 'hello'.
|
|
74878
|
+
badExample: `DEFINE foobar1.
|
|
74879
|
+
WRITE 'hello'.
|
|
74873
74880
|
END-OF-DEFINITION.`,
|
|
74874
|
-
goodExample: `DEFINE foobar2.
|
|
74875
|
-
WRITE 'hello'.
|
|
74876
|
-
END-OF-DEFINITION.
|
|
74877
|
-
|
|
74881
|
+
goodExample: `DEFINE foobar2.
|
|
74882
|
+
WRITE 'hello'.
|
|
74883
|
+
END-OF-DEFINITION.
|
|
74884
|
+
|
|
74878
74885
|
foobar2.`,
|
|
74879
74886
|
};
|
|
74880
74887
|
}
|
|
@@ -74986,18 +74993,18 @@ class UnusedMethods {
|
|
|
74986
74993
|
key: "unused_methods",
|
|
74987
74994
|
title: "Unused methods",
|
|
74988
74995
|
shortDescription: `Checks for unused methods`,
|
|
74989
|
-
extendedInformation: `Checks private and protected methods.
|
|
74990
|
-
|
|
74991
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74992
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74993
|
-
|
|
74994
|
-
Skips:
|
|
74995
|
-
* methods FOR TESTING
|
|
74996
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74997
|
-
* class_constructor + constructor methods
|
|
74998
|
-
* event handlers
|
|
74999
|
-
* methods that are redefined
|
|
75000
|
-
* INCLUDEs
|
|
74996
|
+
extendedInformation: `Checks private and protected methods.
|
|
74997
|
+
|
|
74998
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74999
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
75000
|
+
|
|
75001
|
+
Skips:
|
|
75002
|
+
* methods FOR TESTING
|
|
75003
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
75004
|
+
* class_constructor + constructor methods
|
|
75005
|
+
* event handlers
|
|
75006
|
+
* methods that are redefined
|
|
75007
|
+
* INCLUDEs
|
|
75001
75008
|
`,
|
|
75002
75009
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75003
75010
|
pragma: "##CALLED",
|
|
@@ -75473,23 +75480,23 @@ class UnusedVariables {
|
|
|
75473
75480
|
key: "unused_variables",
|
|
75474
75481
|
title: "Unused variables",
|
|
75475
75482
|
shortDescription: `Checks for unused variables and constants`,
|
|
75476
|
-
extendedInformation: `Skips event parameters.
|
|
75477
|
-
|
|
75478
|
-
Note that this currently does not work if the source code uses macros.
|
|
75479
|
-
|
|
75480
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75481
|
-
|
|
75483
|
+
extendedInformation: `Skips event parameters.
|
|
75484
|
+
|
|
75485
|
+
Note that this currently does not work if the source code uses macros.
|
|
75486
|
+
|
|
75487
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75488
|
+
|
|
75482
75489
|
Errors found in INCLUDES are reported for the main program.`,
|
|
75483
75490
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75484
75491
|
pragma: "##NEEDED",
|
|
75485
75492
|
pseudoComment: "EC NEEDED",
|
|
75486
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
75487
|
-
test TYPE string,
|
|
75488
|
-
test2 TYPE string,
|
|
75493
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
75494
|
+
test TYPE string,
|
|
75495
|
+
test2 TYPE string,
|
|
75489
75496
|
END OF blah1.`,
|
|
75490
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75491
|
-
test TYPE string,
|
|
75492
|
-
test2 TYPE string,
|
|
75497
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75498
|
+
test TYPE string,
|
|
75499
|
+
test2 TYPE string,
|
|
75493
75500
|
END OF blah2.`,
|
|
75494
75501
|
};
|
|
75495
75502
|
}
|
|
@@ -75708,15 +75715,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75708
75715
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75709
75716
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75710
75717
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75711
|
-
badExample: `IF line IS INITIAL.
|
|
75712
|
-
has_entries = abap_false.
|
|
75713
|
-
ELSE.
|
|
75714
|
-
has_entries = abap_true.
|
|
75715
|
-
ENDIF.
|
|
75716
|
-
|
|
75718
|
+
badExample: `IF line IS INITIAL.
|
|
75719
|
+
has_entries = abap_false.
|
|
75720
|
+
ELSE.
|
|
75721
|
+
has_entries = abap_true.
|
|
75722
|
+
ENDIF.
|
|
75723
|
+
|
|
75717
75724
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75718
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75719
|
-
|
|
75725
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75726
|
+
|
|
75720
75727
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75721
75728
|
};
|
|
75722
75729
|
}
|
|
@@ -75834,15 +75841,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75834
75841
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75835
75842
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75836
75843
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75837
|
-
badExample: `INTERFACE lif.
|
|
75838
|
-
METHODS load_data
|
|
75839
|
-
EXCEPTIONS
|
|
75840
|
-
invalid_parameter.
|
|
75844
|
+
badExample: `INTERFACE lif.
|
|
75845
|
+
METHODS load_data
|
|
75846
|
+
EXCEPTIONS
|
|
75847
|
+
invalid_parameter.
|
|
75841
75848
|
ENDINTERFACE.`,
|
|
75842
|
-
goodExample: `INTERFACE lif.
|
|
75843
|
-
METHODS load_data
|
|
75844
|
-
RAISING
|
|
75845
|
-
cx_something.
|
|
75849
|
+
goodExample: `INTERFACE lif.
|
|
75850
|
+
METHODS load_data
|
|
75851
|
+
RAISING
|
|
75852
|
+
cx_something.
|
|
75846
75853
|
ENDINTERFACE.`,
|
|
75847
75854
|
};
|
|
75848
75855
|
}
|
|
@@ -75902,15 +75909,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75902
75909
|
key: "use_line_exists",
|
|
75903
75910
|
title: "Use line_exists",
|
|
75904
75911
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75905
|
-
extendedInformation: `
|
|
75906
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75907
|
-
|
|
75912
|
+
extendedInformation: `
|
|
75913
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75914
|
+
|
|
75908
75915
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75909
75916
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75910
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75911
|
-
IF sy-subrc = 0.
|
|
75917
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75918
|
+
IF sy-subrc = 0.
|
|
75912
75919
|
ENDIF.`,
|
|
75913
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75920
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75914
75921
|
ENDIF.`,
|
|
75915
75922
|
};
|
|
75916
75923
|
}
|
|
@@ -76020,10 +76027,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
76020
76027
|
key: "use_new",
|
|
76021
76028
|
title: "Use NEW",
|
|
76022
76029
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
76023
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
76024
|
-
|
|
76025
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
76026
|
-
|
|
76030
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
76031
|
+
|
|
76032
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
76033
|
+
|
|
76027
76034
|
Applicable from v740sp02 and up`,
|
|
76028
76035
|
badExample: `CREATE OBJECT ref.`,
|
|
76029
76036
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -76121,13 +76128,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
76121
76128
|
title: "WHEN OTHERS last",
|
|
76122
76129
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
76123
76130
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
76124
|
-
badExample: `CASE bar.
|
|
76125
|
-
WHEN OTHERS.
|
|
76126
|
-
WHEN 2.
|
|
76131
|
+
badExample: `CASE bar.
|
|
76132
|
+
WHEN OTHERS.
|
|
76133
|
+
WHEN 2.
|
|
76127
76134
|
ENDCASE.`,
|
|
76128
|
-
goodExample: `CASE bar.
|
|
76129
|
-
WHEN 2.
|
|
76130
|
-
WHEN OTHERS.
|
|
76135
|
+
goodExample: `CASE bar.
|
|
76136
|
+
WHEN 2.
|
|
76137
|
+
WHEN OTHERS.
|
|
76131
76138
|
ENDCASE.`,
|
|
76132
76139
|
};
|
|
76133
76140
|
}
|