@abaplint/cli 2.110.4 → 2.110.5
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 +805 -805
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -9276,7 +9276,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
9276
9276
|
const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), _1.TypeName);
|
|
9277
9277
|
const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
|
|
9278
9278
|
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
9279
|
-
const rangeLike = (0, combi_1.seq)("RANGE OF",
|
|
9279
|
+
const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
9280
9280
|
// a maximum of 15 secondary table keys can be defined
|
|
9281
9281
|
// "WITH" is not allowed as a field name in keys
|
|
9282
9282
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
@@ -23287,7 +23287,7 @@ class BasicTypes {
|
|
|
23287
23287
|
return new Types.TableType(structure, options, name);
|
|
23288
23288
|
}
|
|
23289
23289
|
else if (text.startsWith("LIKE RANGE OF ")) {
|
|
23290
|
-
const sub = node.findFirstExpression(Expressions.
|
|
23290
|
+
const sub = node.findFirstExpression(Expressions.FieldChain);
|
|
23291
23291
|
found = this.resolveLikeName(sub);
|
|
23292
23292
|
if (found === undefined) {
|
|
23293
23293
|
return new Types.UnknownType("LIKE RANGE OF, could not resolve type");
|
|
@@ -34468,13 +34468,13 @@ class FlowGraph {
|
|
|
34468
34468
|
this.label = label;
|
|
34469
34469
|
}
|
|
34470
34470
|
toDigraph() {
|
|
34471
|
-
return `digraph G {
|
|
34472
|
-
labelloc="t";
|
|
34473
|
-
label="${this.label}";
|
|
34474
|
-
graph [fontname = "helvetica"];
|
|
34475
|
-
node [fontname = "helvetica", shape="box"];
|
|
34476
|
-
edge [fontname = "helvetica"];
|
|
34477
|
-
${this.toTextEdges()}
|
|
34471
|
+
return `digraph G {
|
|
34472
|
+
labelloc="t";
|
|
34473
|
+
label="${this.label}";
|
|
34474
|
+
graph [fontname = "helvetica"];
|
|
34475
|
+
node [fontname = "helvetica", shape="box"];
|
|
34476
|
+
edge [fontname = "helvetica"];
|
|
34477
|
+
${this.toTextEdges()}
|
|
34478
34478
|
}`;
|
|
34479
34479
|
}
|
|
34480
34480
|
listSources(node) {
|
|
@@ -42573,13 +42573,13 @@ class Help {
|
|
|
42573
42573
|
/////////////////////////////////////////////////
|
|
42574
42574
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42575
42575
|
let content = "";
|
|
42576
|
-
content = `
|
|
42577
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42578
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42579
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42580
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42581
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42582
|
-
<hr>
|
|
42576
|
+
content = `
|
|
42577
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42578
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42579
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42580
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42581
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42582
|
+
<hr>
|
|
42583
42583
|
` +
|
|
42584
42584
|
"<tt>" + textDocument.uri + " (" +
|
|
42585
42585
|
(position.line + 1) + ", " +
|
|
@@ -51781,7 +51781,7 @@ class Registry {
|
|
|
51781
51781
|
}
|
|
51782
51782
|
static abaplintVersion() {
|
|
51783
51783
|
// magic, see build script "version.sh"
|
|
51784
|
-
return "2.110.
|
|
51784
|
+
return "2.110.5";
|
|
51785
51785
|
}
|
|
51786
51786
|
getDDICReferences() {
|
|
51787
51787
|
return this.ddicReferences;
|
|
@@ -52100,10 +52100,10 @@ class SevenBitAscii {
|
|
|
52100
52100
|
key: "7bit_ascii",
|
|
52101
52101
|
title: "Check for 7bit ascii",
|
|
52102
52102
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
52103
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52104
|
-
|
|
52105
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52106
|
-
|
|
52103
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52104
|
+
|
|
52105
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52106
|
+
|
|
52107
52107
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
52108
52108
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52109
52109
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52309,10 +52309,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52309
52309
|
key: "abapdoc",
|
|
52310
52310
|
title: "Check abapdoc",
|
|
52311
52311
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52312
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52313
|
-
|
|
52314
|
-
Plus class and interface definitions.
|
|
52315
|
-
|
|
52312
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52313
|
+
|
|
52314
|
+
Plus class and interface definitions.
|
|
52315
|
+
|
|
52316
52316
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52317
52317
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52318
52318
|
};
|
|
@@ -52450,49 +52450,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52450
52450
|
key: "align_parameters",
|
|
52451
52451
|
title: "Align Parameters",
|
|
52452
52452
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52453
|
-
extendedInformation: `Checks:
|
|
52454
|
-
* function module calls
|
|
52455
|
-
* method calls
|
|
52456
|
-
* VALUE constructors
|
|
52457
|
-
* NEW constructors
|
|
52458
|
-
* RAISE EXCEPTION statements
|
|
52459
|
-
* CREATE OBJECT statements
|
|
52460
|
-
* RAISE EVENT statements
|
|
52461
|
-
|
|
52462
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52463
|
-
|
|
52464
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52465
|
-
|
|
52466
|
-
If parameters are on the same row, no issues are reported, see
|
|
52453
|
+
extendedInformation: `Checks:
|
|
52454
|
+
* function module calls
|
|
52455
|
+
* method calls
|
|
52456
|
+
* VALUE constructors
|
|
52457
|
+
* NEW constructors
|
|
52458
|
+
* RAISE EXCEPTION statements
|
|
52459
|
+
* CREATE OBJECT statements
|
|
52460
|
+
* RAISE EVENT statements
|
|
52461
|
+
|
|
52462
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52463
|
+
|
|
52464
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52465
|
+
|
|
52466
|
+
If parameters are on the same row, no issues are reported, see
|
|
52467
52467
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52468
52468
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52469
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52470
|
-
EXPORTING
|
|
52471
|
-
foo = 2
|
|
52472
|
-
parameter = 3.
|
|
52473
|
-
|
|
52474
|
-
foobar( moo = 1
|
|
52475
|
-
param = 1 ).
|
|
52476
|
-
|
|
52477
|
-
foo = VALUE #(
|
|
52478
|
-
foo = bar
|
|
52469
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52470
|
+
EXPORTING
|
|
52471
|
+
foo = 2
|
|
52472
|
+
parameter = 3.
|
|
52473
|
+
|
|
52474
|
+
foobar( moo = 1
|
|
52475
|
+
param = 1 ).
|
|
52476
|
+
|
|
52477
|
+
foo = VALUE #(
|
|
52478
|
+
foo = bar
|
|
52479
52479
|
moo = 2 ).`,
|
|
52480
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52481
|
-
EXPORTING
|
|
52482
|
-
foo = 2
|
|
52483
|
-
parameter = 3.
|
|
52484
|
-
|
|
52485
|
-
foobar( moo = 1
|
|
52486
|
-
param = 1 ).
|
|
52487
|
-
|
|
52488
|
-
foo = VALUE #(
|
|
52489
|
-
foo = bar
|
|
52490
|
-
moo = 2 ).
|
|
52491
|
-
|
|
52492
|
-
DATA(sdf) = VALUE type(
|
|
52493
|
-
common_val = 2
|
|
52494
|
-
another_common = 5
|
|
52495
|
-
( row_value = 4
|
|
52480
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52481
|
+
EXPORTING
|
|
52482
|
+
foo = 2
|
|
52483
|
+
parameter = 3.
|
|
52484
|
+
|
|
52485
|
+
foobar( moo = 1
|
|
52486
|
+
param = 1 ).
|
|
52487
|
+
|
|
52488
|
+
foo = VALUE #(
|
|
52489
|
+
foo = bar
|
|
52490
|
+
moo = 2 ).
|
|
52491
|
+
|
|
52492
|
+
DATA(sdf) = VALUE type(
|
|
52493
|
+
common_val = 2
|
|
52494
|
+
another_common = 5
|
|
52495
|
+
( row_value = 4
|
|
52496
52496
|
value_foo = 5 ) ).`,
|
|
52497
52497
|
};
|
|
52498
52498
|
}
|
|
@@ -52926,37 +52926,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52926
52926
|
key: "align_type_expressions",
|
|
52927
52927
|
title: "Align TYPE expressions",
|
|
52928
52928
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52929
|
-
extendedInformation: `
|
|
52930
|
-
Currently works for METHODS + BEGIN OF
|
|
52931
|
-
|
|
52932
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52933
|
-
|
|
52934
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52929
|
+
extendedInformation: `
|
|
52930
|
+
Currently works for METHODS + BEGIN OF
|
|
52931
|
+
|
|
52932
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52933
|
+
|
|
52934
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52935
52935
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52936
52936
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52937
|
-
badExample: `
|
|
52938
|
-
TYPES: BEGIN OF foo,
|
|
52939
|
-
bar TYPE i,
|
|
52940
|
-
foobar TYPE i,
|
|
52941
|
-
END OF foo.
|
|
52942
|
-
|
|
52943
|
-
INTERFACE lif.
|
|
52944
|
-
METHODS bar
|
|
52945
|
-
IMPORTING
|
|
52946
|
-
foo TYPE i
|
|
52947
|
-
foobar TYPE i.
|
|
52937
|
+
badExample: `
|
|
52938
|
+
TYPES: BEGIN OF foo,
|
|
52939
|
+
bar TYPE i,
|
|
52940
|
+
foobar TYPE i,
|
|
52941
|
+
END OF foo.
|
|
52942
|
+
|
|
52943
|
+
INTERFACE lif.
|
|
52944
|
+
METHODS bar
|
|
52945
|
+
IMPORTING
|
|
52946
|
+
foo TYPE i
|
|
52947
|
+
foobar TYPE i.
|
|
52948
52948
|
ENDINTERFACE.`,
|
|
52949
|
-
goodExample: `
|
|
52950
|
-
TYPES: BEGIN OF foo,
|
|
52951
|
-
bar TYPE i,
|
|
52952
|
-
foobar TYPE i,
|
|
52953
|
-
END OF foo.
|
|
52954
|
-
|
|
52955
|
-
INTERFACE lif.
|
|
52956
|
-
METHODS bar
|
|
52957
|
-
IMPORTING
|
|
52958
|
-
foo TYPE i
|
|
52959
|
-
foobar TYPE i.
|
|
52949
|
+
goodExample: `
|
|
52950
|
+
TYPES: BEGIN OF foo,
|
|
52951
|
+
bar TYPE i,
|
|
52952
|
+
foobar TYPE i,
|
|
52953
|
+
END OF foo.
|
|
52954
|
+
|
|
52955
|
+
INTERFACE lif.
|
|
52956
|
+
METHODS bar
|
|
52957
|
+
IMPORTING
|
|
52958
|
+
foo TYPE i
|
|
52959
|
+
foobar TYPE i.
|
|
52960
52960
|
ENDINTERFACE.`,
|
|
52961
52961
|
};
|
|
52962
52962
|
}
|
|
@@ -53235,15 +53235,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
53235
53235
|
return {
|
|
53236
53236
|
key: "ambiguous_statement",
|
|
53237
53237
|
title: "Check for ambigious statements",
|
|
53238
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53239
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53240
|
-
|
|
53238
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53239
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53240
|
+
|
|
53241
53241
|
Only works if the target version is 740sp05 or above`,
|
|
53242
53242
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53243
|
-
badExample: `DELETE foo FROM bar.
|
|
53243
|
+
badExample: `DELETE foo FROM bar.
|
|
53244
53244
|
MODIFY foo FROM bar.`,
|
|
53245
|
-
goodExample: `DELETE foo FROM @bar.
|
|
53246
|
-
MODIFY TABLE foo FROM bar.
|
|
53245
|
+
goodExample: `DELETE foo FROM @bar.
|
|
53246
|
+
MODIFY TABLE foo FROM bar.
|
|
53247
53247
|
MODIFY zfoo FROM @wa.`,
|
|
53248
53248
|
};
|
|
53249
53249
|
}
|
|
@@ -53348,16 +53348,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53348
53348
|
key: "avoid_use",
|
|
53349
53349
|
title: "Avoid use of certain statements",
|
|
53350
53350
|
shortDescription: `Detects usage of certain statements.`,
|
|
53351
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53352
|
-
|
|
53353
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53354
|
-
|
|
53355
|
-
STATICS: use CLASS-DATA instead
|
|
53356
|
-
|
|
53357
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53358
|
-
|
|
53359
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53360
|
-
|
|
53351
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53352
|
+
|
|
53353
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53354
|
+
|
|
53355
|
+
STATICS: use CLASS-DATA instead
|
|
53356
|
+
|
|
53357
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53358
|
+
|
|
53359
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53360
|
+
|
|
53361
53361
|
BREAK points`,
|
|
53362
53362
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53363
53363
|
};
|
|
@@ -53489,11 +53489,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53489
53489
|
title: "Check BEGIN END names",
|
|
53490
53490
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53491
53491
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53492
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53493
|
-
field TYPE i,
|
|
53492
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53493
|
+
field TYPE i,
|
|
53494
53494
|
END OF structure_not_the_same.`,
|
|
53495
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53496
|
-
field TYPE i,
|
|
53495
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53496
|
+
field TYPE i,
|
|
53497
53497
|
END OF stru.`,
|
|
53498
53498
|
};
|
|
53499
53499
|
}
|
|
@@ -53590,20 +53590,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53590
53590
|
title: "BEGIN contains single INCLUDE",
|
|
53591
53591
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53592
53592
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53593
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53594
|
-
INCLUDE TYPE dselc.
|
|
53595
|
-
TYPES: END OF dummy1.
|
|
53596
|
-
|
|
53597
|
-
DATA BEGIN OF foo.
|
|
53598
|
-
INCLUDE STRUCTURE syst.
|
|
53599
|
-
DATA END OF foo.
|
|
53600
|
-
|
|
53601
|
-
STATICS BEGIN OF bar.
|
|
53602
|
-
INCLUDE STRUCTURE syst.
|
|
53593
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
53594
|
+
INCLUDE TYPE dselc.
|
|
53595
|
+
TYPES: END OF dummy1.
|
|
53596
|
+
|
|
53597
|
+
DATA BEGIN OF foo.
|
|
53598
|
+
INCLUDE STRUCTURE syst.
|
|
53599
|
+
DATA END OF foo.
|
|
53600
|
+
|
|
53601
|
+
STATICS BEGIN OF bar.
|
|
53602
|
+
INCLUDE STRUCTURE syst.
|
|
53603
53603
|
STATICS END OF bar.`,
|
|
53604
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53605
|
-
DATA field TYPE i.
|
|
53606
|
-
INCLUDE STRUCTURE dselc.
|
|
53604
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53605
|
+
DATA field TYPE i.
|
|
53606
|
+
INCLUDE STRUCTURE dselc.
|
|
53607
53607
|
DATA END OF foo.`,
|
|
53608
53608
|
};
|
|
53609
53609
|
}
|
|
@@ -53693,9 +53693,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53693
53693
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53694
53694
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53695
53695
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53696
|
-
goodExample: `TRY.
|
|
53697
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53698
|
-
CATCH cx_sy_authorization_error.
|
|
53696
|
+
goodExample: `TRY.
|
|
53697
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53698
|
+
CATCH cx_sy_authorization_error.
|
|
53699
53699
|
ENDTRY.`,
|
|
53700
53700
|
};
|
|
53701
53701
|
}
|
|
@@ -53760,10 +53760,10 @@ class CDSCommentStyle {
|
|
|
53760
53760
|
key: "cds_comment_style",
|
|
53761
53761
|
title: "CDS Comment Style",
|
|
53762
53762
|
shortDescription: `Check for obsolete comment style`,
|
|
53763
|
-
extendedInformation: `Check for obsolete comment style
|
|
53764
|
-
|
|
53765
|
-
Comments starting with "--" are considered obsolete
|
|
53766
|
-
|
|
53763
|
+
extendedInformation: `Check for obsolete comment style
|
|
53764
|
+
|
|
53765
|
+
Comments starting with "--" are considered obsolete
|
|
53766
|
+
|
|
53767
53767
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53768
53768
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53769
53769
|
badExample: "-- this is a comment",
|
|
@@ -53830,10 +53830,10 @@ class CDSLegacyView {
|
|
|
53830
53830
|
title: "CDS Legacy View",
|
|
53831
53831
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53832
53832
|
// eslint-disable-next-line max-len
|
|
53833
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53834
|
-
|
|
53835
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53836
|
-
|
|
53833
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53834
|
+
|
|
53835
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53836
|
+
|
|
53837
53837
|
v755 and up`,
|
|
53838
53838
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53839
53839
|
};
|
|
@@ -53988,10 +53988,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53988
53988
|
key: "chain_mainly_declarations",
|
|
53989
53989
|
title: "Chain mainly declarations",
|
|
53990
53990
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53991
|
-
extendedInformation: `
|
|
53992
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53993
|
-
|
|
53994
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53991
|
+
extendedInformation: `
|
|
53992
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53993
|
+
|
|
53994
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53995
53995
|
`,
|
|
53996
53996
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53997
53997
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -54167,17 +54167,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
54167
54167
|
title: "Change IF to CASE",
|
|
54168
54168
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
54169
54169
|
// eslint-disable-next-line max-len
|
|
54170
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54171
|
-
|
|
54170
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54171
|
+
|
|
54172
54172
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
54173
54173
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54174
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54175
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54176
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
54174
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54175
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54176
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
54177
54177
|
ENDIF.`,
|
|
54178
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
54179
|
-
WHEN 'FOO'.
|
|
54180
|
-
WHEN 'BAR' OR 'MOO'.
|
|
54178
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
54179
|
+
WHEN 'FOO'.
|
|
54180
|
+
WHEN 'BAR' OR 'MOO'.
|
|
54181
54181
|
ENDCASE.`,
|
|
54182
54182
|
};
|
|
54183
54183
|
}
|
|
@@ -54314,8 +54314,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54314
54314
|
return {
|
|
54315
54315
|
key: "check_abstract",
|
|
54316
54316
|
title: "Check abstract methods and classes",
|
|
54317
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54318
|
-
- class defined as abstract and final,
|
|
54317
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54318
|
+
- class defined as abstract and final,
|
|
54319
54319
|
- non-abstract class contains abstract methods`,
|
|
54320
54320
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54321
54321
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54396,11 +54396,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54396
54396
|
return {
|
|
54397
54397
|
key: "check_comments",
|
|
54398
54398
|
title: "Check Comments",
|
|
54399
|
-
shortDescription: `
|
|
54399
|
+
shortDescription: `
|
|
54400
54400
|
Various checks for comment usage.`,
|
|
54401
|
-
extendedInformation: `
|
|
54402
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54403
|
-
|
|
54401
|
+
extendedInformation: `
|
|
54402
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54403
|
+
|
|
54404
54404
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54405
54405
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54406
54406
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54562,9 +54562,9 @@ class CheckInclude {
|
|
|
54562
54562
|
key: "check_include",
|
|
54563
54563
|
title: "Check INCLUDEs",
|
|
54564
54564
|
shortDescription: `Checks INCLUDE statements`,
|
|
54565
|
-
extendedInformation: `
|
|
54566
|
-
* Reports unused includes
|
|
54567
|
-
* Errors if the includes are not found
|
|
54565
|
+
extendedInformation: `
|
|
54566
|
+
* Reports unused includes
|
|
54567
|
+
* Errors if the includes are not found
|
|
54568
54568
|
* Error if including a main program`,
|
|
54569
54569
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54570
54570
|
};
|
|
@@ -54640,14 +54640,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54640
54640
|
key: "check_subrc",
|
|
54641
54641
|
title: "Check sy-subrc",
|
|
54642
54642
|
shortDescription: `Check sy-subrc`,
|
|
54643
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54644
|
-
|
|
54645
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54646
|
-
|
|
54647
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54648
|
-
|
|
54649
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54650
|
-
|
|
54643
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54644
|
+
|
|
54645
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54646
|
+
|
|
54647
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54648
|
+
|
|
54649
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54650
|
+
|
|
54651
54651
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54652
54652
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54653
54653
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -55216,17 +55216,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
55216
55216
|
shortDescription: `Find overlapping classic exceptions`,
|
|
55217
55217
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
55218
55218
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55219
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55220
|
-
EXCEPTIONS
|
|
55221
|
-
system_failure = 1 MESSAGE lv_message
|
|
55222
|
-
communication_failure = 1 MESSAGE lv_message
|
|
55223
|
-
resource_failure = 1
|
|
55219
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55220
|
+
EXCEPTIONS
|
|
55221
|
+
system_failure = 1 MESSAGE lv_message
|
|
55222
|
+
communication_failure = 1 MESSAGE lv_message
|
|
55223
|
+
resource_failure = 1
|
|
55224
55224
|
OTHERS = 1.`,
|
|
55225
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55226
|
-
EXCEPTIONS
|
|
55227
|
-
system_failure = 1 MESSAGE lv_message
|
|
55228
|
-
communication_failure = 2 MESSAGE lv_message
|
|
55229
|
-
resource_failure = 3
|
|
55225
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55226
|
+
EXCEPTIONS
|
|
55227
|
+
system_failure = 1 MESSAGE lv_message
|
|
55228
|
+
communication_failure = 2 MESSAGE lv_message
|
|
55229
|
+
resource_failure = 3
|
|
55230
55230
|
OTHERS = 4.`,
|
|
55231
55231
|
};
|
|
55232
55232
|
}
|
|
@@ -55472,7 +55472,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55472
55472
|
key: "commented_code",
|
|
55473
55473
|
title: "Find commented code",
|
|
55474
55474
|
shortDescription: `Detects usage of commented out code.`,
|
|
55475
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55475
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55476
55476
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55477
55477
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55478
55478
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55705,10 +55705,10 @@ class ConstructorVisibilityPublic {
|
|
|
55705
55705
|
key: "constructor_visibility_public",
|
|
55706
55706
|
title: "Check constructor visibility is public",
|
|
55707
55707
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55708
|
-
extendedInformation: `
|
|
55709
|
-
This only applies to global classes.
|
|
55710
|
-
|
|
55711
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55708
|
+
extendedInformation: `
|
|
55709
|
+
This only applies to global classes.
|
|
55710
|
+
|
|
55711
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55712
55712
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55713
55713
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55714
55714
|
};
|
|
@@ -55783,8 +55783,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55783
55783
|
key: "contains_tab",
|
|
55784
55784
|
title: "Code contains tab",
|
|
55785
55785
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55786
|
-
extendedInformation: `
|
|
55787
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55786
|
+
extendedInformation: `
|
|
55787
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55788
55788
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55789
55789
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55790
55790
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55871,10 +55871,10 @@ class CyclicOO {
|
|
|
55871
55871
|
key: "cyclic_oo",
|
|
55872
55872
|
title: "Cyclic OO",
|
|
55873
55873
|
shortDescription: `Finds cyclic OO references`,
|
|
55874
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55875
|
-
|
|
55876
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55877
|
-
|
|
55874
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55875
|
+
|
|
55876
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55877
|
+
|
|
55878
55878
|
References in testclass includes are ignored`,
|
|
55879
55879
|
};
|
|
55880
55880
|
}
|
|
@@ -56116,7 +56116,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
56116
56116
|
key: "dangerous_statement",
|
|
56117
56117
|
title: "Dangerous statement",
|
|
56118
56118
|
shortDescription: `Detects potentially dangerous statements`,
|
|
56119
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56119
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56120
56120
|
dynamic SQL can potentially create SQL injection problems`,
|
|
56121
56121
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
56122
56122
|
};
|
|
@@ -56320,13 +56320,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56320
56320
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56321
56321
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56322
56322
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56323
|
-
badExample: `FROM foo.
|
|
56324
|
-
WRITE 'hello'.
|
|
56325
|
-
DATA int TYPE i.
|
|
56323
|
+
badExample: `FROM foo.
|
|
56324
|
+
WRITE 'hello'.
|
|
56325
|
+
DATA int TYPE i.
|
|
56326
56326
|
ENDFORM.`,
|
|
56327
|
-
goodExample: `FROM foo.
|
|
56328
|
-
DATA int TYPE i.
|
|
56329
|
-
WRITE 'hello'.
|
|
56327
|
+
goodExample: `FROM foo.
|
|
56328
|
+
DATA int TYPE i.
|
|
56329
|
+
WRITE 'hello'.
|
|
56330
56330
|
ENDFORM.`,
|
|
56331
56331
|
};
|
|
56332
56332
|
}
|
|
@@ -56862,39 +56862,39 @@ class Downport {
|
|
|
56862
56862
|
key: "downport",
|
|
56863
56863
|
title: "Downport statement",
|
|
56864
56864
|
shortDescription: `Downport functionality`,
|
|
56865
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56866
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56867
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56868
|
-
|
|
56869
|
-
Current rules:
|
|
56870
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56871
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56872
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56873
|
-
* CONV is outlined
|
|
56874
|
-
* COND is outlined
|
|
56875
|
-
* REDUCE is outlined
|
|
56876
|
-
* SWITCH is outlined
|
|
56877
|
-
* FILTER is outlined
|
|
56878
|
-
* APPEND expression is outlined
|
|
56879
|
-
* INSERT expression is outlined
|
|
56880
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56881
|
-
* CAST changed to ?=
|
|
56882
|
-
* LOOP AT method_call( ) is outlined
|
|
56883
|
-
* VALUE # with structure fields
|
|
56884
|
-
* VALUE # with internal table lines
|
|
56885
|
-
* Table Expressions are outlined
|
|
56886
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56887
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56888
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56889
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56890
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56891
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56892
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56893
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56894
|
-
* MESSAGE with non simple source
|
|
56895
|
-
|
|
56896
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56897
|
-
|
|
56865
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56866
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56867
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56868
|
+
|
|
56869
|
+
Current rules:
|
|
56870
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56871
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56872
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56873
|
+
* CONV is outlined
|
|
56874
|
+
* COND is outlined
|
|
56875
|
+
* REDUCE is outlined
|
|
56876
|
+
* SWITCH is outlined
|
|
56877
|
+
* FILTER is outlined
|
|
56878
|
+
* APPEND expression is outlined
|
|
56879
|
+
* INSERT expression is outlined
|
|
56880
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56881
|
+
* CAST changed to ?=
|
|
56882
|
+
* LOOP AT method_call( ) is outlined
|
|
56883
|
+
* VALUE # with structure fields
|
|
56884
|
+
* VALUE # with internal table lines
|
|
56885
|
+
* Table Expressions are outlined
|
|
56886
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56887
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56888
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56889
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56890
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56891
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56892
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56893
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56894
|
+
* MESSAGE with non simple source
|
|
56895
|
+
|
|
56896
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56897
|
+
|
|
56898
56898
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56899
56899
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56900
56900
|
};
|
|
@@ -57472,10 +57472,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57472
57472
|
const fieldName = f.concatTokens();
|
|
57473
57473
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57474
57474
|
}
|
|
57475
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57475
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57476
57476
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57477
57477
|
}
|
|
57478
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57478
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57479
57479
|
${indentation}`);
|
|
57480
57480
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57481
57481
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57519,12 +57519,12 @@ ${indentation}`);
|
|
|
57519
57519
|
}
|
|
57520
57520
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57521
57521
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
57522
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57523
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57524
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57522
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57523
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57524
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57525
57525
|
${indentation}`);
|
|
57526
57526
|
if (fieldDefinitions === "") {
|
|
57527
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57527
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57528
57528
|
${indentation}`);
|
|
57529
57529
|
}
|
|
57530
57530
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57592,7 +57592,7 @@ ${indentation}`);
|
|
|
57592
57592
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57593
57593
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57594
57594
|
const firstToken = high.getFirstToken();
|
|
57595
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57595
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57596
57596
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57597
57597
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57598
57598
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57646,7 +57646,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57646
57646
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57647
57647
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57648
57648
|
const firstToken = high.getFirstToken();
|
|
57649
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57649
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57650
57650
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57651
57651
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57652
57652
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57688,14 +57688,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57688
57688
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57689
57689
|
const firstToken = high.getFirstToken();
|
|
57690
57690
|
// note that the tabix restore should be done before throwing the exception
|
|
57691
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57692
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57693
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57694
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57695
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57696
|
-
${indentation}IF sy-subrc <> 0.
|
|
57697
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57698
|
-
${indentation}ENDIF.
|
|
57691
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57692
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57693
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57694
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57695
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57696
|
+
${indentation}IF sy-subrc <> 0.
|
|
57697
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57698
|
+
${indentation}ENDIF.
|
|
57699
57699
|
${indentation}`);
|
|
57700
57700
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57701
57701
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57752,7 +57752,7 @@ ${indentation}`);
|
|
|
57752
57752
|
const className = classNames[0].concatTokens();
|
|
57753
57753
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57754
57754
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57755
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57755
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57756
57756
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57757
57757
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57758
57758
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57914,16 +57914,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57914
57914
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57915
57915
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57916
57916
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57917
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57918
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57917
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57918
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57919
57919
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57920
57920
|
if (withs.length > 0) {
|
|
57921
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57922
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57923
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57921
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57922
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57923
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57924
57924
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57925
57925
|
}
|
|
57926
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57926
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57927
57927
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57928
57928
|
if (withs.length > 0) {
|
|
57929
57929
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -58035,10 +58035,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
58035
58035
|
let code = "";
|
|
58036
58036
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
58037
58037
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58038
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58039
|
-
IF sy-subrc <> 0.
|
|
58040
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58041
|
-
ENDIF.
|
|
58038
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58039
|
+
IF sy-subrc <> 0.
|
|
58040
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58041
|
+
ENDIF.
|
|
58042
58042
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
58043
58043
|
}
|
|
58044
58044
|
else {
|
|
@@ -58127,20 +58127,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
58127
58127
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58128
58128
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58129
58129
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58130
|
-
code += ` items LIKE ${loopSourceName},
|
|
58131
|
-
END OF ${groupTargetName}type.
|
|
58132
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58133
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58130
|
+
code += ` items LIKE ${loopSourceName},
|
|
58131
|
+
END OF ${groupTargetName}type.
|
|
58132
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58133
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58134
58134
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
58135
58135
|
if (groupIndexName !== undefined) {
|
|
58136
58136
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
58137
58137
|
}
|
|
58138
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58138
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58139
58139
|
IF sy-subrc = 0.\n`;
|
|
58140
58140
|
if (groupCountName !== undefined) {
|
|
58141
58141
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
58142
58142
|
}
|
|
58143
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58143
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58144
58144
|
ELSE.\n`;
|
|
58145
58145
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
58146
58146
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -58161,8 +58161,8 @@ ELSE.\n`;
|
|
|
58161
58161
|
}
|
|
58162
58162
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
58163
58163
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
58164
|
-
code += `ENDIF.
|
|
58165
|
-
ENDLOOP.
|
|
58164
|
+
code += `ENDIF.
|
|
58165
|
+
ENDLOOP.
|
|
58166
58166
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
58167
58167
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
58168
58168
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58334,7 +58334,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58334
58334
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58335
58335
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58336
58336
|
// all ENUMS are char like?
|
|
58337
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58337
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58338
58338
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58339
58339
|
let count = 1;
|
|
58340
58340
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58378,14 +58378,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58378
58378
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58379
58379
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58380
58380
|
// restore tabix before exeption
|
|
58381
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58382
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58383
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58384
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58385
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58386
|
-
${indentation}IF sy-subrc <> 0.
|
|
58387
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58388
|
-
${indentation}ENDIF.
|
|
58381
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58382
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58383
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58384
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58385
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58386
|
+
${indentation}IF sy-subrc <> 0.
|
|
58387
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58388
|
+
${indentation}ENDIF.
|
|
58389
58389
|
${indentation}${uniqueName}`;
|
|
58390
58390
|
const start = target.getFirstToken().getStart();
|
|
58391
58391
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58469,11 +58469,11 @@ ${indentation}${uniqueName}`;
|
|
|
58469
58469
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58470
58470
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58471
58471
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58472
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58473
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58474
|
-
${indentation} EXPORTING
|
|
58475
|
-
${indentation} input = ${source}
|
|
58476
|
-
${indentation} IMPORTING
|
|
58472
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58473
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58474
|
+
${indentation} EXPORTING
|
|
58475
|
+
${indentation} input = ${source}
|
|
58476
|
+
${indentation} IMPORTING
|
|
58477
58477
|
${indentation} output = ${uniqueName}.\n`;
|
|
58478
58478
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58479
58479
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59785,12 +59785,12 @@ class EasyToFindMessages {
|
|
|
59785
59785
|
key: "easy_to_find_messages",
|
|
59786
59786
|
title: "Easy to find messages",
|
|
59787
59787
|
shortDescription: `Make messages easy to find`,
|
|
59788
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59789
|
-
|
|
59790
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59791
|
-
|
|
59792
|
-
Also see rule "message_exists"
|
|
59793
|
-
|
|
59788
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
59789
|
+
|
|
59790
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
59791
|
+
|
|
59792
|
+
Also see rule "message_exists"
|
|
59793
|
+
|
|
59794
59794
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59795
59795
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59796
59796
|
};
|
|
@@ -59875,8 +59875,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59875
59875
|
key: "empty_line_in_statement",
|
|
59876
59876
|
title: "Find empty lines in statements",
|
|
59877
59877
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59878
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59879
|
-
|
|
59878
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59879
|
+
|
|
59880
59880
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59881
59881
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59882
59882
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -60052,13 +60052,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60052
60052
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
60053
60053
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
60054
60054
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60055
|
-
badExample: `IF foo = bar.
|
|
60056
|
-
ENDIF.
|
|
60057
|
-
|
|
60058
|
-
DO 2 TIMES.
|
|
60055
|
+
badExample: `IF foo = bar.
|
|
60056
|
+
ENDIF.
|
|
60057
|
+
|
|
60058
|
+
DO 2 TIMES.
|
|
60059
60059
|
ENDDO.`,
|
|
60060
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60061
|
-
ENDLOOP.
|
|
60060
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60061
|
+
ENDLOOP.
|
|
60062
60062
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
60063
60063
|
};
|
|
60064
60064
|
}
|
|
@@ -60200,10 +60200,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
60200
60200
|
return {
|
|
60201
60201
|
key: "exit_or_check",
|
|
60202
60202
|
title: "Find EXIT or CHECK outside loops",
|
|
60203
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60203
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60204
60204
|
Use RETURN to leave procesing blocks instead.`,
|
|
60205
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60206
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60205
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60206
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60207
60207
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
60208
60208
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60209
60209
|
};
|
|
@@ -60286,12 +60286,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
60286
60286
|
key: "expand_macros",
|
|
60287
60287
|
title: "Expand Macros",
|
|
60288
60288
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
60289
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60290
|
-
|
|
60289
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60290
|
+
|
|
60291
60291
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
60292
|
-
badExample: `DEFINE _hello.
|
|
60293
|
-
WRITE 'hello'.
|
|
60294
|
-
END-OF-DEFINITION.
|
|
60292
|
+
badExample: `DEFINE _hello.
|
|
60293
|
+
WRITE 'hello'.
|
|
60294
|
+
END-OF-DEFINITION.
|
|
60295
60295
|
_hello.`,
|
|
60296
60296
|
goodExample: `WRITE 'hello'.`,
|
|
60297
60297
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60378,7 +60378,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60378
60378
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60379
60379
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60380
60380
|
goodExample: `call_method( foo = bar ).`,
|
|
60381
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60381
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60382
60382
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60383
60383
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60384
60384
|
};
|
|
@@ -60476,7 +60476,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60476
60476
|
key: "forbidden_identifier",
|
|
60477
60477
|
title: "Forbidden Identifier",
|
|
60478
60478
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60479
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60479
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60480
60480
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60481
60481
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60482
60482
|
};
|
|
@@ -60718,8 +60718,8 @@ class ForbiddenVoidType {
|
|
|
60718
60718
|
key: "forbidden_void_type",
|
|
60719
60719
|
title: "Forbidden Void Types",
|
|
60720
60720
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60721
|
-
extendedInformation: `Inspiration:
|
|
60722
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60721
|
+
extendedInformation: `Inspiration:
|
|
60722
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60723
60723
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60724
60724
|
};
|
|
60725
60725
|
}
|
|
@@ -60962,7 +60962,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60962
60962
|
key: "fully_type_itabs",
|
|
60963
60963
|
title: "Fully type internal tables",
|
|
60964
60964
|
shortDescription: `No implict table types or table keys`,
|
|
60965
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60965
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60966
60966
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60967
60967
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60968
60968
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -61147,26 +61147,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
61147
61147
|
key: "functional_writing",
|
|
61148
61148
|
title: "Use functional writing",
|
|
61149
61149
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
61150
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61150
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61151
61151
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
61152
61152
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61153
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61154
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61155
|
-
EXPORTING
|
|
61156
|
-
p_name = 'NAME'
|
|
61157
|
-
RECEIVING
|
|
61158
|
-
p_descr_ref = lr_typedescr
|
|
61159
|
-
EXCEPTIONS
|
|
61160
|
-
type_not_found = 1
|
|
61153
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61154
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61155
|
+
EXPORTING
|
|
61156
|
+
p_name = 'NAME'
|
|
61157
|
+
RECEIVING
|
|
61158
|
+
p_descr_ref = lr_typedescr
|
|
61159
|
+
EXCEPTIONS
|
|
61160
|
+
type_not_found = 1
|
|
61161
61161
|
OTHERS = 2.`,
|
|
61162
|
-
goodExample: `zcl_class=>method( ).
|
|
61163
|
-
cl_abap_typedescr=>describe_by_name(
|
|
61164
|
-
EXPORTING
|
|
61165
|
-
p_name = 'NAME'
|
|
61166
|
-
RECEIVING
|
|
61167
|
-
p_descr_ref = lr_typedescr
|
|
61168
|
-
EXCEPTIONS
|
|
61169
|
-
type_not_found = 1
|
|
61162
|
+
goodExample: `zcl_class=>method( ).
|
|
61163
|
+
cl_abap_typedescr=>describe_by_name(
|
|
61164
|
+
EXPORTING
|
|
61165
|
+
p_name = 'NAME'
|
|
61166
|
+
RECEIVING
|
|
61167
|
+
p_descr_ref = lr_typedescr
|
|
61168
|
+
EXCEPTIONS
|
|
61169
|
+
type_not_found = 1
|
|
61170
61170
|
OTHERS = 2 ).`,
|
|
61171
61171
|
};
|
|
61172
61172
|
}
|
|
@@ -61277,14 +61277,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
61277
61277
|
key: "global_class",
|
|
61278
61278
|
title: "Global class checks",
|
|
61279
61279
|
shortDescription: `Checks related to global classes`,
|
|
61280
|
-
extendedInformation: `* global classes must be in own files
|
|
61281
|
-
|
|
61282
|
-
* file names must match class name
|
|
61283
|
-
|
|
61284
|
-
* file names must match interface name
|
|
61285
|
-
|
|
61286
|
-
* global classes must be global definitions
|
|
61287
|
-
|
|
61280
|
+
extendedInformation: `* global classes must be in own files
|
|
61281
|
+
|
|
61282
|
+
* file names must match class name
|
|
61283
|
+
|
|
61284
|
+
* file names must match interface name
|
|
61285
|
+
|
|
61286
|
+
* global classes must be global definitions
|
|
61287
|
+
|
|
61288
61288
|
* global interfaces must be global definitions`,
|
|
61289
61289
|
tags: [_irule_1.RuleTag.Syntax],
|
|
61290
61290
|
};
|
|
@@ -61383,21 +61383,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61383
61383
|
return {
|
|
61384
61384
|
key: "identical_conditions",
|
|
61385
61385
|
title: "Identical conditions",
|
|
61386
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61387
|
-
|
|
61386
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61387
|
+
|
|
61388
61388
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61389
61389
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61390
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61391
|
-
ENDIF.
|
|
61392
|
-
CASE bar.
|
|
61393
|
-
WHEN '1'.
|
|
61394
|
-
WHEN 'A' OR '1'.
|
|
61390
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61391
|
+
ENDIF.
|
|
61392
|
+
CASE bar.
|
|
61393
|
+
WHEN '1'.
|
|
61394
|
+
WHEN 'A' OR '1'.
|
|
61395
61395
|
ENDCASE.`,
|
|
61396
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61397
|
-
ENDIF.
|
|
61398
|
-
CASE bar.
|
|
61399
|
-
WHEN '1'.
|
|
61400
|
-
WHEN 'A'.
|
|
61396
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61397
|
+
ENDIF.
|
|
61398
|
+
CASE bar.
|
|
61399
|
+
WHEN '1'.
|
|
61400
|
+
WHEN 'A'.
|
|
61401
61401
|
ENDCASE.`,
|
|
61402
61402
|
};
|
|
61403
61403
|
}
|
|
@@ -61531,23 +61531,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61531
61531
|
key: "identical_contents",
|
|
61532
61532
|
title: "Identical contents",
|
|
61533
61533
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61534
|
-
extendedInformation: `
|
|
61535
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61536
|
-
|
|
61534
|
+
extendedInformation: `
|
|
61535
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61536
|
+
|
|
61537
61537
|
Chained statments are ignored`,
|
|
61538
61538
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61539
|
-
badExample: `IF foo = bar.
|
|
61540
|
-
WRITE 'bar'.
|
|
61541
|
-
WRITE 'world'.
|
|
61542
|
-
ELSE.
|
|
61543
|
-
WRITE 'foo'.
|
|
61544
|
-
WRITE 'world'.
|
|
61539
|
+
badExample: `IF foo = bar.
|
|
61540
|
+
WRITE 'bar'.
|
|
61541
|
+
WRITE 'world'.
|
|
61542
|
+
ELSE.
|
|
61543
|
+
WRITE 'foo'.
|
|
61544
|
+
WRITE 'world'.
|
|
61545
61545
|
ENDIF.`,
|
|
61546
|
-
goodExample: `IF foo = bar.
|
|
61547
|
-
WRITE 'bar'.
|
|
61548
|
-
ELSE.
|
|
61549
|
-
WRITE 'foo'.
|
|
61550
|
-
ENDIF.
|
|
61546
|
+
goodExample: `IF foo = bar.
|
|
61547
|
+
WRITE 'bar'.
|
|
61548
|
+
ELSE.
|
|
61549
|
+
WRITE 'foo'.
|
|
61550
|
+
ENDIF.
|
|
61551
61551
|
WRITE 'world'.`,
|
|
61552
61552
|
};
|
|
61553
61553
|
}
|
|
@@ -61655,12 +61655,12 @@ class IdenticalDescriptions {
|
|
|
61655
61655
|
key: "identical_descriptions",
|
|
61656
61656
|
title: "Identical descriptions",
|
|
61657
61657
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61658
|
-
extendedInformation: `Case insensitive
|
|
61659
|
-
|
|
61660
|
-
Only checks the master language descriptions
|
|
61661
|
-
|
|
61662
|
-
Dependencies are skipped
|
|
61663
|
-
|
|
61658
|
+
extendedInformation: `Case insensitive
|
|
61659
|
+
|
|
61660
|
+
Only checks the master language descriptions
|
|
61661
|
+
|
|
61662
|
+
Dependencies are skipped
|
|
61663
|
+
|
|
61664
61664
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61665
61665
|
tags: [],
|
|
61666
61666
|
};
|
|
@@ -61834,43 +61834,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61834
61834
|
key: "if_in_if",
|
|
61835
61835
|
title: "IF in IF",
|
|
61836
61836
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61837
|
-
extendedInformation: `
|
|
61838
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61839
|
-
|
|
61840
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61841
|
-
|
|
61842
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
61837
|
+
extendedInformation: `
|
|
61838
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61839
|
+
|
|
61840
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61841
|
+
|
|
61842
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
61843
61843
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61844
|
-
badExample: `IF condition1.
|
|
61845
|
-
IF condition2.
|
|
61846
|
-
...
|
|
61847
|
-
ENDIF.
|
|
61848
|
-
ENDIF.
|
|
61849
|
-
|
|
61850
|
-
IF condition1.
|
|
61851
|
-
...
|
|
61852
|
-
ELSE.
|
|
61853
|
-
IF condition2.
|
|
61854
|
-
...
|
|
61855
|
-
ENDIF.
|
|
61844
|
+
badExample: `IF condition1.
|
|
61845
|
+
IF condition2.
|
|
61846
|
+
...
|
|
61847
|
+
ENDIF.
|
|
61848
|
+
ENDIF.
|
|
61849
|
+
|
|
61850
|
+
IF condition1.
|
|
61851
|
+
...
|
|
61852
|
+
ELSE.
|
|
61853
|
+
IF condition2.
|
|
61854
|
+
...
|
|
61855
|
+
ENDIF.
|
|
61856
61856
|
ENDIF.`,
|
|
61857
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61858
|
-
...
|
|
61859
|
-
ENDIF.
|
|
61860
|
-
|
|
61861
|
-
IF condition1.
|
|
61862
|
-
...
|
|
61863
|
-
ELSEIF condition2.
|
|
61864
|
-
...
|
|
61865
|
-
ENDIF.
|
|
61866
|
-
|
|
61867
|
-
CASE variable.
|
|
61868
|
-
WHEN value1.
|
|
61869
|
-
...
|
|
61870
|
-
WHEN value2.
|
|
61871
|
-
IF condition2.
|
|
61872
|
-
...
|
|
61873
|
-
ENDIF.
|
|
61857
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61858
|
+
...
|
|
61859
|
+
ENDIF.
|
|
61860
|
+
|
|
61861
|
+
IF condition1.
|
|
61862
|
+
...
|
|
61863
|
+
ELSEIF condition2.
|
|
61864
|
+
...
|
|
61865
|
+
ENDIF.
|
|
61866
|
+
|
|
61867
|
+
CASE variable.
|
|
61868
|
+
WHEN value1.
|
|
61869
|
+
...
|
|
61870
|
+
WHEN value2.
|
|
61871
|
+
IF condition2.
|
|
61872
|
+
...
|
|
61873
|
+
ENDIF.
|
|
61874
61874
|
ENDCASE.`,
|
|
61875
61875
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61876
61876
|
};
|
|
@@ -62055,9 +62055,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
62055
62055
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
62056
62056
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
62057
62057
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
62058
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62059
|
-
METHOD ${methodName.toLowerCase()}.
|
|
62060
|
-
RETURN. " todo, implement method
|
|
62058
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62059
|
+
METHOD ${methodName.toLowerCase()}.
|
|
62060
|
+
RETURN. " todo, implement method
|
|
62061
62061
|
ENDMETHOD.`);
|
|
62062
62062
|
}
|
|
62063
62063
|
}
|
|
@@ -62245,19 +62245,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
62245
62245
|
key: "in_statement_indentation",
|
|
62246
62246
|
title: "In-statement indentation",
|
|
62247
62247
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
62248
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62249
|
-
|
|
62250
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62248
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62249
|
+
|
|
62250
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62251
62251
|
to distinguish them better from code within the block.`,
|
|
62252
|
-
badExample: `IF 1 = 1
|
|
62253
|
-
AND 2 = 2.
|
|
62254
|
-
WRITE 'hello' &&
|
|
62255
|
-
'world'.
|
|
62252
|
+
badExample: `IF 1 = 1
|
|
62253
|
+
AND 2 = 2.
|
|
62254
|
+
WRITE 'hello' &&
|
|
62255
|
+
'world'.
|
|
62256
62256
|
ENDIF.`,
|
|
62257
|
-
goodExample: `IF 1 = 1
|
|
62258
|
-
AND 2 = 2.
|
|
62259
|
-
WRITE 'hello' &&
|
|
62260
|
-
'world'.
|
|
62257
|
+
goodExample: `IF 1 = 1
|
|
62258
|
+
AND 2 = 2.
|
|
62259
|
+
WRITE 'hello' &&
|
|
62260
|
+
'world'.
|
|
62261
62261
|
ENDIF.`,
|
|
62262
62262
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62263
62263
|
};
|
|
@@ -62380,23 +62380,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62380
62380
|
title: "Indentation",
|
|
62381
62381
|
shortDescription: `Checks indentation`,
|
|
62382
62382
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62383
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62384
|
-
PRIVATE SECTION.
|
|
62385
|
-
METHODS constructor.
|
|
62386
|
-
ENDCLASS.
|
|
62387
|
-
|
|
62388
|
-
CLASS lcl IMPLEMENTATION.
|
|
62389
|
-
METHOD constructor.
|
|
62390
|
-
ENDMETHOD.
|
|
62383
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62384
|
+
PRIVATE SECTION.
|
|
62385
|
+
METHODS constructor.
|
|
62386
|
+
ENDCLASS.
|
|
62387
|
+
|
|
62388
|
+
CLASS lcl IMPLEMENTATION.
|
|
62389
|
+
METHOD constructor.
|
|
62390
|
+
ENDMETHOD.
|
|
62391
62391
|
ENDCLASS.`,
|
|
62392
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62393
|
-
PRIVATE SECTION.
|
|
62394
|
-
METHODS constructor.
|
|
62395
|
-
ENDCLASS.
|
|
62396
|
-
|
|
62397
|
-
CLASS lcl IMPLEMENTATION.
|
|
62398
|
-
METHOD constructor.
|
|
62399
|
-
ENDMETHOD.
|
|
62392
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62393
|
+
PRIVATE SECTION.
|
|
62394
|
+
METHODS constructor.
|
|
62395
|
+
ENDCLASS.
|
|
62396
|
+
|
|
62397
|
+
CLASS lcl IMPLEMENTATION.
|
|
62398
|
+
METHOD constructor.
|
|
62399
|
+
ENDMETHOD.
|
|
62400
62400
|
ENDCLASS.`,
|
|
62401
62401
|
};
|
|
62402
62402
|
}
|
|
@@ -62785,9 +62785,9 @@ class IntfReferencingClas {
|
|
|
62785
62785
|
key: "intf_referencing_clas",
|
|
62786
62786
|
title: "INTF referencing CLAS",
|
|
62787
62787
|
shortDescription: `Interface contains references to class`,
|
|
62788
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62789
|
-
Only first level references are checked.
|
|
62790
|
-
Exception class references are ignored.
|
|
62788
|
+
extendedInformation: `Only global interfaces are checked.
|
|
62789
|
+
Only first level references are checked.
|
|
62790
|
+
Exception class references are ignored.
|
|
62791
62791
|
Void references are ignored.`,
|
|
62792
62792
|
};
|
|
62793
62793
|
}
|
|
@@ -62872,9 +62872,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
62872
62872
|
title: "Invalid Table Index",
|
|
62873
62873
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
62874
62874
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62875
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
62875
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
62876
62876
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
62877
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
62877
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
62878
62878
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62879
62879
|
};
|
|
62880
62880
|
}
|
|
@@ -63475,8 +63475,8 @@ class LineBreakStyle {
|
|
|
63475
63475
|
return {
|
|
63476
63476
|
key: "line_break_style",
|
|
63477
63477
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63478
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63479
|
-
|
|
63478
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63479
|
+
|
|
63480
63480
|
abapGit does not work with CRLF`,
|
|
63481
63481
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63482
63482
|
};
|
|
@@ -63545,7 +63545,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63545
63545
|
key: "line_length",
|
|
63546
63546
|
title: "Line length",
|
|
63547
63547
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63548
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63548
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63549
63549
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63550
63550
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63551
63551
|
};
|
|
@@ -63616,7 +63616,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63616
63616
|
key: "line_only_punc",
|
|
63617
63617
|
title: "Line containing only punctuation",
|
|
63618
63618
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63619
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63619
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63620
63620
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63621
63621
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63622
63622
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -63876,15 +63876,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63876
63876
|
return {
|
|
63877
63877
|
key: "local_variable_names",
|
|
63878
63878
|
title: "Local variable naming conventions",
|
|
63879
|
-
shortDescription: `
|
|
63880
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63879
|
+
shortDescription: `
|
|
63880
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63881
63881
|
Regexes are case-insensitive.`,
|
|
63882
63882
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
63883
|
-
badExample: `FORM bar.
|
|
63884
|
-
DATA foo.
|
|
63883
|
+
badExample: `FORM bar.
|
|
63884
|
+
DATA foo.
|
|
63885
63885
|
ENDFORM.`,
|
|
63886
|
-
goodExample: `FORM bar.
|
|
63887
|
-
DATA lv_foo.
|
|
63886
|
+
goodExample: `FORM bar.
|
|
63887
|
+
DATA lv_foo.
|
|
63888
63888
|
ENDFORM.`,
|
|
63889
63889
|
};
|
|
63890
63890
|
}
|
|
@@ -64107,10 +64107,10 @@ class MainFileContents {
|
|
|
64107
64107
|
key: "main_file_contents",
|
|
64108
64108
|
title: "Main file contents",
|
|
64109
64109
|
shortDescription: `Checks related to report declarations.`,
|
|
64110
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
64111
|
-
|
|
64112
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64113
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64110
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
64111
|
+
|
|
64112
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64113
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64114
64114
|
`,
|
|
64115
64115
|
};
|
|
64116
64116
|
}
|
|
@@ -64226,17 +64226,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
64226
64226
|
title: "Too many parentheses",
|
|
64227
64227
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
64228
64228
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64229
|
-
badExample: `
|
|
64230
|
-
IF ( destination IS INITIAL ).
|
|
64231
|
-
ENDIF.
|
|
64232
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64233
|
-
ENDIF.
|
|
64229
|
+
badExample: `
|
|
64230
|
+
IF ( destination IS INITIAL ).
|
|
64231
|
+
ENDIF.
|
|
64232
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64233
|
+
ENDIF.
|
|
64234
64234
|
`,
|
|
64235
|
-
goodExample: `
|
|
64236
|
-
IF destination IS INITIAL.
|
|
64237
|
-
ENDIF.
|
|
64238
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
64239
|
-
ENDIF.
|
|
64235
|
+
goodExample: `
|
|
64236
|
+
IF destination IS INITIAL.
|
|
64237
|
+
ENDIF.
|
|
64238
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
64239
|
+
ENDIF.
|
|
64240
64240
|
`,
|
|
64241
64241
|
};
|
|
64242
64242
|
}
|
|
@@ -64410,14 +64410,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64410
64410
|
title: "Max one method parameter definition per line",
|
|
64411
64411
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64412
64412
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64413
|
-
badExample: `
|
|
64414
|
-
METHODS apps_scope_token
|
|
64415
|
-
IMPORTING
|
|
64413
|
+
badExample: `
|
|
64414
|
+
METHODS apps_scope_token
|
|
64415
|
+
IMPORTING
|
|
64416
64416
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64417
|
-
goodExample: `
|
|
64418
|
-
METHODS apps_scope_token
|
|
64419
|
-
IMPORTING
|
|
64420
|
-
body TYPE bodyapps_scope_token
|
|
64417
|
+
goodExample: `
|
|
64418
|
+
METHODS apps_scope_token
|
|
64419
|
+
IMPORTING
|
|
64420
|
+
body TYPE bodyapps_scope_token
|
|
64421
64421
|
client_id TYPE str.`,
|
|
64422
64422
|
};
|
|
64423
64423
|
}
|
|
@@ -64482,11 +64482,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64482
64482
|
key: "max_one_statement",
|
|
64483
64483
|
title: "Max one statement per line",
|
|
64484
64484
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64485
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64486
|
-
|
|
64487
|
-
Does not report anything for chained statements.
|
|
64488
|
-
|
|
64489
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64485
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64486
|
+
|
|
64487
|
+
Does not report anything for chained statements.
|
|
64488
|
+
|
|
64489
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64490
64490
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64491
64491
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64492
64492
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -64824,8 +64824,8 @@ class MethodLength {
|
|
|
64824
64824
|
key: "method_length",
|
|
64825
64825
|
title: "Method/Form Length",
|
|
64826
64826
|
shortDescription: `Checks relating to method/form length.`,
|
|
64827
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64828
|
-
|
|
64827
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64828
|
+
|
|
64829
64829
|
Abstract methods without statements are considered okay.`,
|
|
64830
64830
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64831
64831
|
};
|
|
@@ -64930,20 +64930,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
64930
64930
|
key: "method_overwrites_builtin",
|
|
64931
64931
|
title: "Method name overwrites builtin function",
|
|
64932
64932
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
64933
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64934
|
-
|
|
64935
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64936
|
-
|
|
64933
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64934
|
+
|
|
64935
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64936
|
+
|
|
64937
64937
|
Interface method names are ignored`,
|
|
64938
64938
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64939
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64940
|
-
PUBLIC SECTION.
|
|
64941
|
-
METHODS matches.
|
|
64942
|
-
ENDCLASS.
|
|
64943
|
-
|
|
64944
|
-
CLASS lcl IMPLEMENTATION.
|
|
64945
|
-
METHOD matches.
|
|
64946
|
-
ENDMETHOD.
|
|
64939
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64940
|
+
PUBLIC SECTION.
|
|
64941
|
+
METHODS matches.
|
|
64942
|
+
ENDCLASS.
|
|
64943
|
+
|
|
64944
|
+
CLASS lcl IMPLEMENTATION.
|
|
64945
|
+
METHOD matches.
|
|
64946
|
+
ENDMETHOD.
|
|
64947
64947
|
ENDCLASS.`,
|
|
64948
64948
|
};
|
|
64949
64949
|
}
|
|
@@ -65134,12 +65134,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
65134
65134
|
// eslint-disable-next-line max-len
|
|
65135
65135
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
65136
65136
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65137
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65138
|
-
PUBLIC SECTION.
|
|
65139
|
-
METHODS
|
|
65140
|
-
foobar
|
|
65141
|
-
EXPORTING foo TYPE i
|
|
65142
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
65137
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65138
|
+
PUBLIC SECTION.
|
|
65139
|
+
METHODS
|
|
65140
|
+
foobar
|
|
65141
|
+
EXPORTING foo TYPE i
|
|
65142
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
65143
65143
|
ENDCLASS.`,
|
|
65144
65144
|
};
|
|
65145
65145
|
}
|
|
@@ -65519,7 +65519,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65519
65519
|
key: "nesting",
|
|
65520
65520
|
title: "Check nesting depth",
|
|
65521
65521
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65522
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65522
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65523
65523
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65524
65524
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65525
65525
|
};
|
|
@@ -65762,7 +65762,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65762
65762
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65763
65763
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65764
65764
|
badExample: `var1 = var2 = var3.`,
|
|
65765
|
-
goodExample: `var2 = var3.
|
|
65765
|
+
goodExample: `var2 = var3.
|
|
65766
65766
|
var1 = var2.`,
|
|
65767
65767
|
};
|
|
65768
65768
|
}
|
|
@@ -65821,8 +65821,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
65821
65821
|
key: "no_external_form_calls",
|
|
65822
65822
|
title: "No external FORM calls",
|
|
65823
65823
|
shortDescription: `Detect external form calls`,
|
|
65824
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65825
|
-
|
|
65824
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65825
|
+
|
|
65826
65826
|
PERFORM foo(bar).`,
|
|
65827
65827
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65828
65828
|
};
|
|
@@ -65883,17 +65883,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
65883
65883
|
key: "no_inline_in_optional_branches",
|
|
65884
65884
|
title: "Don't declare inline in optional branches",
|
|
65885
65885
|
shortDescription: `Don't declare inline in optional branches`,
|
|
65886
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65887
|
-
|
|
65888
|
-
Considered optional branches:
|
|
65889
|
-
* inside IF/ELSEIF/ELSE
|
|
65890
|
-
* inside LOOP
|
|
65891
|
-
* inside WHILE
|
|
65892
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
65893
|
-
* inside DO
|
|
65894
|
-
* inside SELECT loops
|
|
65895
|
-
|
|
65896
|
-
Not considered optional branches:
|
|
65886
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65887
|
+
|
|
65888
|
+
Considered optional branches:
|
|
65889
|
+
* inside IF/ELSEIF/ELSE
|
|
65890
|
+
* inside LOOP
|
|
65891
|
+
* inside WHILE
|
|
65892
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
65893
|
+
* inside DO
|
|
65894
|
+
* inside SELECT loops
|
|
65895
|
+
|
|
65896
|
+
Not considered optional branches:
|
|
65897
65897
|
* TRY/CATCH/CLEANUP`,
|
|
65898
65898
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65899
65899
|
};
|
|
@@ -65993,12 +65993,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
65993
65993
|
key: "no_prefixes",
|
|
65994
65994
|
title: "No Prefixes",
|
|
65995
65995
|
shortDescription: `Dont use hungarian notation`,
|
|
65996
|
-
extendedInformation: `
|
|
65997
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65998
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65999
|
-
|
|
66000
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66001
|
-
|
|
65996
|
+
extendedInformation: `
|
|
65997
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65998
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65999
|
+
|
|
66000
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66001
|
+
|
|
66002
66002
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
66003
66003
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66004
66004
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -66177,7 +66177,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
66177
66177
|
return {
|
|
66178
66178
|
key: "no_public_attributes",
|
|
66179
66179
|
title: "No public attributes",
|
|
66180
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66180
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66181
66181
|
Exceptions are excluded from this rule.`,
|
|
66182
66182
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
66183
66183
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -66278,13 +66278,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
66278
66278
|
key: "no_yoda_conditions",
|
|
66279
66279
|
title: "No Yoda conditions",
|
|
66280
66280
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
66281
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66282
|
-
|
|
66281
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66282
|
+
|
|
66283
66283
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
66284
66284
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66285
|
-
badExample: `IF 0 <> sy-subrc.
|
|
66285
|
+
badExample: `IF 0 <> sy-subrc.
|
|
66286
66286
|
ENDIF.`,
|
|
66287
|
-
goodExample: `IF sy-subrc <> 0.
|
|
66287
|
+
goodExample: `IF sy-subrc <> 0.
|
|
66288
66288
|
ENDIF.`,
|
|
66289
66289
|
};
|
|
66290
66290
|
}
|
|
@@ -66385,8 +66385,8 @@ class NROBConsistency {
|
|
|
66385
66385
|
key: "nrob_consistency",
|
|
66386
66386
|
title: "Number range consistency",
|
|
66387
66387
|
shortDescription: `Consistency checks for number ranges`,
|
|
66388
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66389
|
-
|
|
66388
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66389
|
+
|
|
66390
66390
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
66391
66391
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66392
66392
|
};
|
|
@@ -66663,58 +66663,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66663
66663
|
title: "Obsolete statements",
|
|
66664
66664
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66665
66665
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66666
|
-
extendedInformation: `
|
|
66667
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66668
|
-
|
|
66669
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66670
|
-
|
|
66671
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66672
|
-
|
|
66673
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66674
|
-
|
|
66675
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66676
|
-
|
|
66677
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66678
|
-
|
|
66679
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66680
|
-
|
|
66681
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66682
|
-
|
|
66683
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66684
|
-
|
|
66685
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66686
|
-
|
|
66687
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66688
|
-
|
|
66689
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66690
|
-
|
|
66691
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66692
|
-
|
|
66693
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66694
|
-
|
|
66695
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66696
|
-
SELECT COUNT(*) is considered okay
|
|
66697
|
-
|
|
66698
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66699
|
-
|
|
66700
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66701
|
-
|
|
66702
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66703
|
-
|
|
66704
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66705
|
-
|
|
66706
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66707
|
-
|
|
66666
|
+
extendedInformation: `
|
|
66667
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66668
|
+
|
|
66669
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66670
|
+
|
|
66671
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66672
|
+
|
|
66673
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66674
|
+
|
|
66675
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66676
|
+
|
|
66677
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66678
|
+
|
|
66679
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66680
|
+
|
|
66681
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66682
|
+
|
|
66683
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66684
|
+
|
|
66685
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66686
|
+
|
|
66687
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66688
|
+
|
|
66689
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66690
|
+
|
|
66691
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66692
|
+
|
|
66693
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66694
|
+
|
|
66695
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66696
|
+
SELECT COUNT(*) is considered okay
|
|
66697
|
+
|
|
66698
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66699
|
+
|
|
66700
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66701
|
+
|
|
66702
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66703
|
+
|
|
66704
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66705
|
+
|
|
66706
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66707
|
+
|
|
66708
66708
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66709
|
-
badExample: `REFRESH itab.
|
|
66710
|
-
|
|
66711
|
-
COMPUTE foo = 2 + 2.
|
|
66712
|
-
|
|
66713
|
-
MULTIPLY lv_foo BY 2.
|
|
66714
|
-
|
|
66715
|
-
INTERFACE intf LOAD.
|
|
66716
|
-
|
|
66717
|
-
IF foo IS SUPPLIED.
|
|
66709
|
+
badExample: `REFRESH itab.
|
|
66710
|
+
|
|
66711
|
+
COMPUTE foo = 2 + 2.
|
|
66712
|
+
|
|
66713
|
+
MULTIPLY lv_foo BY 2.
|
|
66714
|
+
|
|
66715
|
+
INTERFACE intf LOAD.
|
|
66716
|
+
|
|
66717
|
+
IF foo IS SUPPLIED.
|
|
66718
66718
|
ENDIF.`,
|
|
66719
66719
|
};
|
|
66720
66720
|
}
|
|
@@ -67054,9 +67054,9 @@ class OmitParameterName {
|
|
|
67054
67054
|
key: "omit_parameter_name",
|
|
67055
67055
|
title: "Omit parameter name",
|
|
67056
67056
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
67057
|
-
extendedInformation: `
|
|
67058
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67059
|
-
|
|
67057
|
+
extendedInformation: `
|
|
67058
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67059
|
+
|
|
67060
67060
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
67061
67061
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67062
67062
|
badExample: `method( param = 2 ).`,
|
|
@@ -67262,20 +67262,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
67262
67262
|
shortDescription: `Omit RECEIVING`,
|
|
67263
67263
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
67264
67264
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67265
|
-
badExample: `
|
|
67266
|
-
upload_pack(
|
|
67267
|
-
EXPORTING
|
|
67268
|
-
io_client = lo_client
|
|
67269
|
-
iv_url = iv_url
|
|
67270
|
-
iv_deepen_level = iv_deepen_level
|
|
67271
|
-
it_hashes = lt_hashes
|
|
67272
|
-
RECEIVING
|
|
67265
|
+
badExample: `
|
|
67266
|
+
upload_pack(
|
|
67267
|
+
EXPORTING
|
|
67268
|
+
io_client = lo_client
|
|
67269
|
+
iv_url = iv_url
|
|
67270
|
+
iv_deepen_level = iv_deepen_level
|
|
67271
|
+
it_hashes = lt_hashes
|
|
67272
|
+
RECEIVING
|
|
67273
67273
|
rt_objects = et_objects ).`,
|
|
67274
|
-
goodExample: `
|
|
67275
|
-
et_objects = upload_pack(
|
|
67276
|
-
io_client = lo_client
|
|
67277
|
-
iv_url = iv_url
|
|
67278
|
-
iv_deepen_level = iv_deepen_level
|
|
67274
|
+
goodExample: `
|
|
67275
|
+
et_objects = upload_pack(
|
|
67276
|
+
io_client = lo_client
|
|
67277
|
+
iv_url = iv_url
|
|
67278
|
+
iv_deepen_level = iv_deepen_level
|
|
67279
67279
|
it_hashes = lt_hashes ).`,
|
|
67280
67280
|
};
|
|
67281
67281
|
}
|
|
@@ -67339,8 +67339,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
67339
67339
|
return {
|
|
67340
67340
|
key: "parser_702_chaining",
|
|
67341
67341
|
title: "Parser Error, bad chanining on 702",
|
|
67342
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67343
|
-
this rule finds these and reports errors.
|
|
67342
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67343
|
+
this rule finds these and reports errors.
|
|
67344
67344
|
Only active on target version 702 and below.`,
|
|
67345
67345
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67346
67346
|
};
|
|
@@ -67420,8 +67420,8 @@ class ParserError {
|
|
|
67420
67420
|
return {
|
|
67421
67421
|
key: "parser_error",
|
|
67422
67422
|
title: "Parser error",
|
|
67423
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67424
|
-
|
|
67423
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67424
|
+
|
|
67425
67425
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67426
67426
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67427
67427
|
};
|
|
@@ -67506,7 +67506,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67506
67506
|
return {
|
|
67507
67507
|
key: "parser_missing_space",
|
|
67508
67508
|
title: "Parser Error, missing space",
|
|
67509
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67509
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67510
67510
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67511
67511
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67512
67512
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -67918,25 +67918,25 @@ class PreferInline {
|
|
|
67918
67918
|
key: "prefer_inline",
|
|
67919
67919
|
title: "Prefer Inline Declarations",
|
|
67920
67920
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
67921
|
-
extendedInformation: `EXPERIMENTAL
|
|
67922
|
-
|
|
67923
|
-
Activates if language version is v740sp02 or above.
|
|
67924
|
-
|
|
67925
|
-
Variables must be local(METHOD or FORM).
|
|
67926
|
-
|
|
67927
|
-
No generic or void typed variables. No syntax errors.
|
|
67928
|
-
|
|
67929
|
-
First position used must be a full/pure write.
|
|
67930
|
-
|
|
67931
|
-
Move statment is not a cast(?=)
|
|
67932
|
-
|
|
67921
|
+
extendedInformation: `EXPERIMENTAL
|
|
67922
|
+
|
|
67923
|
+
Activates if language version is v740sp02 or above.
|
|
67924
|
+
|
|
67925
|
+
Variables must be local(METHOD or FORM).
|
|
67926
|
+
|
|
67927
|
+
No generic or void typed variables. No syntax errors.
|
|
67928
|
+
|
|
67929
|
+
First position used must be a full/pure write.
|
|
67930
|
+
|
|
67931
|
+
Move statment is not a cast(?=)
|
|
67932
|
+
|
|
67933
67933
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
67934
67934
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
67935
|
-
badExample: `DATA foo TYPE i.
|
|
67936
|
-
foo = 2.
|
|
67937
|
-
DATA percentage TYPE decfloat34.
|
|
67935
|
+
badExample: `DATA foo TYPE i.
|
|
67936
|
+
foo = 2.
|
|
67937
|
+
DATA percentage TYPE decfloat34.
|
|
67938
67938
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
67939
|
-
goodExample: `DATA(foo) = 2.
|
|
67939
|
+
goodExample: `DATA(foo) = 2.
|
|
67940
67940
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
67941
67941
|
};
|
|
67942
67942
|
}
|
|
@@ -68150,18 +68150,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
68150
68150
|
key: "prefer_is_not",
|
|
68151
68151
|
title: "Prefer IS NOT to NOT IS",
|
|
68152
68152
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
68153
|
-
extendedInformation: `
|
|
68154
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68155
|
-
|
|
68153
|
+
extendedInformation: `
|
|
68154
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68155
|
+
|
|
68156
68156
|
"if not is_valid( )." examples are skipped`,
|
|
68157
68157
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68158
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
68159
|
-
IF variable NP 'TODO*'.
|
|
68160
|
-
IF variable <> 42.
|
|
68158
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
68159
|
+
IF variable NP 'TODO*'.
|
|
68160
|
+
IF variable <> 42.
|
|
68161
68161
|
IF variable CO 'hello'.`,
|
|
68162
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
68163
|
-
IF NOT variable CP 'TODO*'.
|
|
68164
|
-
IF NOT variable = 42.
|
|
68162
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
68163
|
+
IF NOT variable CP 'TODO*'.
|
|
68164
|
+
IF NOT variable = 42.
|
|
68165
68165
|
IF NOT variable CA 'hello'.`,
|
|
68166
68166
|
};
|
|
68167
68167
|
}
|
|
@@ -68349,14 +68349,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
68349
68349
|
key: "prefer_raise_exception_new",
|
|
68350
68350
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
68351
68351
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
68352
|
-
extendedInformation: `
|
|
68353
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68354
|
-
|
|
68352
|
+
extendedInformation: `
|
|
68353
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68354
|
+
|
|
68355
68355
|
From 752 and up`,
|
|
68356
68356
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
68357
68357
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
68358
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68359
|
-
EXPORTING
|
|
68358
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68359
|
+
EXPORTING
|
|
68360
68360
|
previous = exception.`,
|
|
68361
68361
|
};
|
|
68362
68362
|
}
|
|
@@ -68434,12 +68434,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68434
68434
|
key: "prefer_returning_to_exporting",
|
|
68435
68435
|
title: "Prefer RETURNING to EXPORTING",
|
|
68436
68436
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68437
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68437
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68438
68438
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68439
68439
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68440
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68441
|
-
PUBLIC SECTION.
|
|
68442
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68440
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68441
|
+
PUBLIC SECTION.
|
|
68442
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68443
68443
|
ENDCLASS.`,
|
|
68444
68444
|
};
|
|
68445
68445
|
}
|
|
@@ -68535,8 +68535,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68535
68535
|
key: "prefer_xsdbool",
|
|
68536
68536
|
title: "Prefer xsdbool over boolc",
|
|
68537
68537
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68538
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68539
|
-
|
|
68538
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68539
|
+
|
|
68540
68540
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68541
68541
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68542
68542
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68608,9 +68608,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68608
68608
|
title: "Preferred compare operator",
|
|
68609
68609
|
shortDescription: `Configure undesired operator variants`,
|
|
68610
68610
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68611
|
-
badExample: `IF foo EQ bar.
|
|
68611
|
+
badExample: `IF foo EQ bar.
|
|
68612
68612
|
ENDIF.`,
|
|
68613
|
-
goodExample: `IF foo = bar.
|
|
68613
|
+
goodExample: `IF foo = bar.
|
|
68614
68614
|
ENDIF.`,
|
|
68615
68615
|
};
|
|
68616
68616
|
}
|
|
@@ -68834,26 +68834,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
68834
68834
|
key: "reduce_procedural_code",
|
|
68835
68835
|
title: "Reduce procedural code",
|
|
68836
68836
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
68837
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68838
|
-
|
|
68839
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68840
|
-
|
|
68837
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68838
|
+
|
|
68839
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68840
|
+
|
|
68841
68841
|
Comments are not counted as statements.`,
|
|
68842
68842
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68843
|
-
badExample: `FORM foo.
|
|
68844
|
-
DATA lv_bar TYPE i.
|
|
68845
|
-
lv_bar = 2 + 2.
|
|
68846
|
-
IF lv_bar = 4.
|
|
68847
|
-
WRITE 'hello world'.
|
|
68848
|
-
ENDIF.
|
|
68849
|
-
DATA lv_bar TYPE i.
|
|
68850
|
-
lv_bar = 2 + 2.
|
|
68851
|
-
IF lv_bar = 4.
|
|
68852
|
-
WRITE 'hello world'.
|
|
68853
|
-
ENDIF.
|
|
68843
|
+
badExample: `FORM foo.
|
|
68844
|
+
DATA lv_bar TYPE i.
|
|
68845
|
+
lv_bar = 2 + 2.
|
|
68846
|
+
IF lv_bar = 4.
|
|
68847
|
+
WRITE 'hello world'.
|
|
68848
|
+
ENDIF.
|
|
68849
|
+
DATA lv_bar TYPE i.
|
|
68850
|
+
lv_bar = 2 + 2.
|
|
68851
|
+
IF lv_bar = 4.
|
|
68852
|
+
WRITE 'hello world'.
|
|
68853
|
+
ENDIF.
|
|
68854
68854
|
ENDFORM.`,
|
|
68855
|
-
goodExample: `FORM foo.
|
|
68856
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
68855
|
+
goodExample: `FORM foo.
|
|
68856
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
68857
68857
|
ENDFORM.`,
|
|
68858
68858
|
};
|
|
68859
68859
|
}
|
|
@@ -69097,10 +69097,10 @@ class RemoveDescriptions {
|
|
|
69097
69097
|
return {
|
|
69098
69098
|
key: "remove_descriptions",
|
|
69099
69099
|
title: "Remove descriptions",
|
|
69100
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69101
|
-
|
|
69102
|
-
Class descriptions are required, see rule description_empty.
|
|
69103
|
-
|
|
69100
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69101
|
+
|
|
69102
|
+
Class descriptions are required, see rule description_empty.
|
|
69103
|
+
|
|
69104
69104
|
Consider using ABAP Doc for documentation.`,
|
|
69105
69105
|
tags: [],
|
|
69106
69106
|
};
|
|
@@ -69225,14 +69225,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
69225
69225
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69226
69226
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
69227
69227
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
69228
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
69228
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
69229
69229
|
DESTINATION lv_rfc.`,
|
|
69230
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69231
|
-
DESTINATION lv_rfc
|
|
69232
|
-
EXCEPTIONS
|
|
69233
|
-
system_failure = 1 MESSAGE msg
|
|
69234
|
-
communication_failure = 2 MESSAGE msg
|
|
69235
|
-
resource_failure = 3
|
|
69230
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69231
|
+
DESTINATION lv_rfc
|
|
69232
|
+
EXCEPTIONS
|
|
69233
|
+
system_failure = 1 MESSAGE msg
|
|
69234
|
+
communication_failure = 2 MESSAGE msg
|
|
69235
|
+
resource_failure = 3
|
|
69236
69236
|
OTHERS = 4.`,
|
|
69237
69237
|
};
|
|
69238
69238
|
}
|
|
@@ -69316,11 +69316,11 @@ class SelectAddOrderBy {
|
|
|
69316
69316
|
key: "select_add_order_by",
|
|
69317
69317
|
title: "SELECT add ORDER BY",
|
|
69318
69318
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
69319
|
-
extendedInformation: `
|
|
69320
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69321
|
-
|
|
69322
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
69323
|
-
|
|
69319
|
+
extendedInformation: `
|
|
69320
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69321
|
+
|
|
69322
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
69323
|
+
|
|
69324
69324
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
69325
69325
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69326
69326
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69451,14 +69451,14 @@ class SelectPerformance {
|
|
|
69451
69451
|
key: "select_performance",
|
|
69452
69452
|
title: "SELECT performance",
|
|
69453
69453
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69454
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69455
|
-
|
|
69454
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69455
|
+
|
|
69456
69456
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69457
69457
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69458
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69459
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69458
|
+
badExample: `SELECT field1, field2 FROM table
|
|
69459
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69460
69460
|
ENDSELECT.`,
|
|
69461
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69461
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69462
69462
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69463
69463
|
};
|
|
69464
69464
|
}
|
|
@@ -69572,8 +69572,8 @@ class SelectSingleFullKey {
|
|
|
69572
69572
|
key: "select_single_full_key",
|
|
69573
69573
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69574
69574
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69575
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69576
|
-
|
|
69575
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69576
|
+
|
|
69577
69577
|
If the statement contains a JOIN it is not checked`,
|
|
69578
69578
|
pseudoComment: "EC CI_NOORDER",
|
|
69579
69579
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -69997,8 +69997,8 @@ class SICFConsistency {
|
|
|
69997
69997
|
key: "sicf_consistency",
|
|
69998
69998
|
title: "SICF consistency",
|
|
69999
69999
|
shortDescription: `Checks the validity of ICF services`,
|
|
70000
|
-
extendedInformation: `* Class defined in handler must exist
|
|
70001
|
-
* Class must not have any syntax errors
|
|
70000
|
+
extendedInformation: `* Class defined in handler must exist
|
|
70001
|
+
* Class must not have any syntax errors
|
|
70002
70002
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
70003
70003
|
};
|
|
70004
70004
|
}
|
|
@@ -70110,23 +70110,23 @@ class SlowParameterPassing {
|
|
|
70110
70110
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
70111
70111
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
70112
70112
|
tags: [_irule_1.RuleTag.Performance],
|
|
70113
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70114
|
-
PUBLIC SECTION.
|
|
70115
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70116
|
-
ENDCLASS.
|
|
70117
|
-
CLASS lcl IMPLEMENTATION.
|
|
70118
|
-
METHOD bar.
|
|
70119
|
-
WRITE sdf.
|
|
70120
|
-
ENDMETHOD.
|
|
70113
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70114
|
+
PUBLIC SECTION.
|
|
70115
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70116
|
+
ENDCLASS.
|
|
70117
|
+
CLASS lcl IMPLEMENTATION.
|
|
70118
|
+
METHOD bar.
|
|
70119
|
+
WRITE sdf.
|
|
70120
|
+
ENDMETHOD.
|
|
70121
70121
|
ENDCLASS.`,
|
|
70122
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
70123
|
-
PUBLIC SECTION.
|
|
70124
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
70125
|
-
ENDCLASS.
|
|
70126
|
-
CLASS lcl IMPLEMENTATION.
|
|
70127
|
-
METHOD bar.
|
|
70128
|
-
WRITE sdf.
|
|
70129
|
-
ENDMETHOD.
|
|
70122
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
70123
|
+
PUBLIC SECTION.
|
|
70124
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
70125
|
+
ENDCLASS.
|
|
70126
|
+
CLASS lcl IMPLEMENTATION.
|
|
70127
|
+
METHOD bar.
|
|
70128
|
+
WRITE sdf.
|
|
70129
|
+
ENDMETHOD.
|
|
70130
70130
|
ENDCLASS.`,
|
|
70131
70131
|
};
|
|
70132
70132
|
}
|
|
@@ -70383,8 +70383,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
70383
70383
|
key: "space_before_dot",
|
|
70384
70384
|
title: "Space before dot",
|
|
70385
70385
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
70386
|
-
extendedInformation: `
|
|
70387
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70386
|
+
extendedInformation: `
|
|
70387
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70388
70388
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
70389
70389
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70390
70390
|
badExample: `WRITE bar .`,
|
|
@@ -70570,12 +70570,12 @@ class SQLValueConversion {
|
|
|
70570
70570
|
key: "sql_value_conversion",
|
|
70571
70571
|
title: "Implicit SQL Value Conversion",
|
|
70572
70572
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70573
|
-
extendedInformation: `
|
|
70574
|
-
* Integer to CHAR conversion
|
|
70575
|
-
* Integer to NUMC conversion
|
|
70576
|
-
* NUMC to Integer conversion
|
|
70577
|
-
* CHAR to Integer conversion
|
|
70578
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
70573
|
+
extendedInformation: `
|
|
70574
|
+
* Integer to CHAR conversion
|
|
70575
|
+
* Integer to NUMC conversion
|
|
70576
|
+
* NUMC to Integer conversion
|
|
70577
|
+
* CHAR to Integer conversion
|
|
70578
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
70579
70579
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70580
70580
|
tags: [],
|
|
70581
70581
|
};
|
|
@@ -70647,7 +70647,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70647
70647
|
key: "start_at_tab",
|
|
70648
70648
|
title: "Start at tab",
|
|
70649
70649
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70650
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70650
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70651
70651
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70652
70652
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70653
70653
|
badExample: ` WRITE a.`,
|
|
@@ -70824,12 +70824,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
70824
70824
|
key: "strict_sql",
|
|
70825
70825
|
title: "Strict SQL",
|
|
70826
70826
|
shortDescription: `Strict SQL`,
|
|
70827
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70828
|
-
|
|
70829
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70830
|
-
|
|
70831
|
-
Also see separate rule sql_escape_host_variables
|
|
70832
|
-
|
|
70827
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70828
|
+
|
|
70829
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70830
|
+
|
|
70831
|
+
Also see separate rule sql_escape_host_variables
|
|
70832
|
+
|
|
70833
70833
|
Activates from v750 and up`,
|
|
70834
70834
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
70835
70835
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -71083,11 +71083,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
71083
71083
|
key: "sy_modification",
|
|
71084
71084
|
title: "Modification of SY fields",
|
|
71085
71085
|
shortDescription: `Finds modification of sy fields`,
|
|
71086
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71087
|
-
|
|
71086
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71087
|
+
|
|
71088
71088
|
Changes to SY-TVAR* fields are not reported`,
|
|
71089
71089
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71090
|
-
badExample: `sy-uname = 2.
|
|
71090
|
+
badExample: `sy-uname = 2.
|
|
71091
71091
|
sy = sy.`,
|
|
71092
71092
|
};
|
|
71093
71093
|
}
|
|
@@ -71149,8 +71149,8 @@ class TABLEnhancementCategory {
|
|
|
71149
71149
|
key: "tabl_enhancement_category",
|
|
71150
71150
|
title: "TABL enhancement category must be set",
|
|
71151
71151
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
71152
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71153
|
-
|
|
71152
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71153
|
+
|
|
71154
71154
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
71155
71155
|
tags: [],
|
|
71156
71156
|
};
|
|
@@ -71278,9 +71278,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
71278
71278
|
title: "Type FORM parameters",
|
|
71279
71279
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
71280
71280
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71281
|
-
badExample: `FORM foo USING bar.
|
|
71281
|
+
badExample: `FORM foo USING bar.
|
|
71282
71282
|
ENDFORM.`,
|
|
71283
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
71283
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
71284
71284
|
ENDFORM.`,
|
|
71285
71285
|
};
|
|
71286
71286
|
}
|
|
@@ -71953,38 +71953,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
71953
71953
|
key: "unnecessary_pragma",
|
|
71954
71954
|
title: "Unnecessary Pragma",
|
|
71955
71955
|
shortDescription: `Finds pragmas which can be removed`,
|
|
71956
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
71957
|
-
|
|
71958
|
-
* NEEDED without definition
|
|
71959
|
-
|
|
71960
|
-
* NO_TEXT without texts
|
|
71961
|
-
|
|
71962
|
-
* SUBRC_OK where sy-subrc is checked
|
|
71963
|
-
|
|
71956
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
71957
|
+
|
|
71958
|
+
* NEEDED without definition
|
|
71959
|
+
|
|
71960
|
+
* NO_TEXT without texts
|
|
71961
|
+
|
|
71962
|
+
* SUBRC_OK where sy-subrc is checked
|
|
71963
|
+
|
|
71964
71964
|
NO_HANDLER inside macros are not checked`,
|
|
71965
71965
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71966
|
-
badExample: `TRY.
|
|
71967
|
-
...
|
|
71968
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71969
|
-
RETURN. " it has a handler
|
|
71970
|
-
ENDTRY.
|
|
71971
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71972
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71973
|
-
IF sy-subrc <> 0.
|
|
71966
|
+
badExample: `TRY.
|
|
71967
|
+
...
|
|
71968
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71969
|
+
RETURN. " it has a handler
|
|
71970
|
+
ENDTRY.
|
|
71971
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71972
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71973
|
+
IF sy-subrc <> 0.
|
|
71974
71974
|
ENDIF.`,
|
|
71975
|
-
goodExample: `TRY.
|
|
71976
|
-
...
|
|
71977
|
-
CATCH zcx_abapgit_exception.
|
|
71978
|
-
RETURN.
|
|
71979
|
-
ENDTRY.
|
|
71980
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71981
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71982
|
-
IF sy-subrc <> 0.
|
|
71983
|
-
ENDIF.
|
|
71984
|
-
|
|
71985
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
71986
|
-
test1 TYPE string,
|
|
71987
|
-
test2 TYPE string,
|
|
71975
|
+
goodExample: `TRY.
|
|
71976
|
+
...
|
|
71977
|
+
CATCH zcx_abapgit_exception.
|
|
71978
|
+
RETURN.
|
|
71979
|
+
ENDTRY.
|
|
71980
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71981
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71982
|
+
IF sy-subrc <> 0.
|
|
71983
|
+
ENDIF.
|
|
71984
|
+
|
|
71985
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
71986
|
+
test1 TYPE string,
|
|
71987
|
+
test2 TYPE string,
|
|
71988
71988
|
END OF blah.`,
|
|
71989
71989
|
};
|
|
71990
71990
|
}
|
|
@@ -72151,18 +72151,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
72151
72151
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
72152
72152
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
72153
72153
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
72154
|
-
badExample: `FORM hello1.
|
|
72155
|
-
WRITE 'world'.
|
|
72156
|
-
RETURN.
|
|
72157
|
-
ENDFORM.
|
|
72158
|
-
|
|
72159
|
-
FORM foo.
|
|
72160
|
-
IF 1 = 2.
|
|
72161
|
-
RETURN.
|
|
72162
|
-
ENDIF.
|
|
72154
|
+
badExample: `FORM hello1.
|
|
72155
|
+
WRITE 'world'.
|
|
72156
|
+
RETURN.
|
|
72157
|
+
ENDFORM.
|
|
72158
|
+
|
|
72159
|
+
FORM foo.
|
|
72160
|
+
IF 1 = 2.
|
|
72161
|
+
RETURN.
|
|
72162
|
+
ENDIF.
|
|
72163
72163
|
ENDFORM.`,
|
|
72164
|
-
goodExample: `FORM hello2.
|
|
72165
|
-
WRITE 'world'.
|
|
72164
|
+
goodExample: `FORM hello2.
|
|
72165
|
+
WRITE 'world'.
|
|
72166
72166
|
ENDFORM.`,
|
|
72167
72167
|
};
|
|
72168
72168
|
}
|
|
@@ -72513,13 +72513,13 @@ class UnusedMacros {
|
|
|
72513
72513
|
title: "Unused macros",
|
|
72514
72514
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
72515
72515
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72516
|
-
badExample: `DEFINE foobar1.
|
|
72517
|
-
WRITE 'hello'.
|
|
72516
|
+
badExample: `DEFINE foobar1.
|
|
72517
|
+
WRITE 'hello'.
|
|
72518
72518
|
END-OF-DEFINITION.`,
|
|
72519
|
-
goodExample: `DEFINE foobar2.
|
|
72520
|
-
WRITE 'hello'.
|
|
72521
|
-
END-OF-DEFINITION.
|
|
72522
|
-
|
|
72519
|
+
goodExample: `DEFINE foobar2.
|
|
72520
|
+
WRITE 'hello'.
|
|
72521
|
+
END-OF-DEFINITION.
|
|
72522
|
+
|
|
72523
72523
|
foobar2.`,
|
|
72524
72524
|
};
|
|
72525
72525
|
}
|
|
@@ -72627,17 +72627,17 @@ class UnusedMethods {
|
|
|
72627
72627
|
key: "unused_methods",
|
|
72628
72628
|
title: "Unused methods",
|
|
72629
72629
|
shortDescription: `Checks for unused methods`,
|
|
72630
|
-
extendedInformation: `Checks private and protected methods.
|
|
72631
|
-
|
|
72632
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72633
|
-
|
|
72634
|
-
Skips:
|
|
72635
|
-
* methods FOR TESTING
|
|
72636
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72637
|
-
* class_constructor + constructor methods
|
|
72638
|
-
* event handlers
|
|
72639
|
-
* methods that are redefined
|
|
72640
|
-
* INCLUDEs
|
|
72630
|
+
extendedInformation: `Checks private and protected methods.
|
|
72631
|
+
|
|
72632
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72633
|
+
|
|
72634
|
+
Skips:
|
|
72635
|
+
* methods FOR TESTING
|
|
72636
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72637
|
+
* class_constructor + constructor methods
|
|
72638
|
+
* event handlers
|
|
72639
|
+
* methods that are redefined
|
|
72640
|
+
* INCLUDEs
|
|
72641
72641
|
`,
|
|
72642
72642
|
tags: [],
|
|
72643
72643
|
pragma: "##CALLED",
|
|
@@ -73071,23 +73071,23 @@ class UnusedVariables {
|
|
|
73071
73071
|
key: "unused_variables",
|
|
73072
73072
|
title: "Unused variables",
|
|
73073
73073
|
shortDescription: `Checks for unused variables and constants`,
|
|
73074
|
-
extendedInformation: `Skips event parameters.
|
|
73075
|
-
|
|
73076
|
-
Note that this currently does not work if the source code uses macros.
|
|
73077
|
-
|
|
73078
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73079
|
-
|
|
73074
|
+
extendedInformation: `Skips event parameters.
|
|
73075
|
+
|
|
73076
|
+
Note that this currently does not work if the source code uses macros.
|
|
73077
|
+
|
|
73078
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73079
|
+
|
|
73080
73080
|
Errors found in INCLUDES are reported for the main program.`,
|
|
73081
73081
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73082
73082
|
pragma: "##NEEDED",
|
|
73083
73083
|
pseudoComment: "EC NEEDED",
|
|
73084
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
73085
|
-
test TYPE string,
|
|
73086
|
-
test2 TYPE string,
|
|
73084
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
73085
|
+
test TYPE string,
|
|
73086
|
+
test2 TYPE string,
|
|
73087
73087
|
END OF blah1.`,
|
|
73088
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73089
|
-
test TYPE string,
|
|
73090
|
-
test2 TYPE string,
|
|
73088
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73089
|
+
test TYPE string,
|
|
73090
|
+
test2 TYPE string,
|
|
73091
73091
|
END OF blah2.`,
|
|
73092
73092
|
};
|
|
73093
73093
|
}
|
|
@@ -73306,15 +73306,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
73306
73306
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
73307
73307
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
73308
73308
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
73309
|
-
badExample: `IF line IS INITIAL.
|
|
73310
|
-
has_entries = abap_false.
|
|
73311
|
-
ELSE.
|
|
73312
|
-
has_entries = abap_true.
|
|
73313
|
-
ENDIF.
|
|
73314
|
-
|
|
73309
|
+
badExample: `IF line IS INITIAL.
|
|
73310
|
+
has_entries = abap_false.
|
|
73311
|
+
ELSE.
|
|
73312
|
+
has_entries = abap_true.
|
|
73313
|
+
ENDIF.
|
|
73314
|
+
|
|
73315
73315
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
73316
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73317
|
-
|
|
73316
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73317
|
+
|
|
73318
73318
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
73319
73319
|
};
|
|
73320
73320
|
}
|
|
@@ -73432,15 +73432,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
73432
73432
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
73433
73433
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
73434
73434
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73435
|
-
badExample: `INTERFACE lif.
|
|
73436
|
-
METHODS load_data
|
|
73437
|
-
EXCEPTIONS
|
|
73438
|
-
invalid_parameter.
|
|
73435
|
+
badExample: `INTERFACE lif.
|
|
73436
|
+
METHODS load_data
|
|
73437
|
+
EXCEPTIONS
|
|
73438
|
+
invalid_parameter.
|
|
73439
73439
|
ENDINTERFACE.`,
|
|
73440
|
-
goodExample: `INTERFACE lif.
|
|
73441
|
-
METHODS load_data
|
|
73442
|
-
RAISING
|
|
73443
|
-
cx_something.
|
|
73440
|
+
goodExample: `INTERFACE lif.
|
|
73441
|
+
METHODS load_data
|
|
73442
|
+
RAISING
|
|
73443
|
+
cx_something.
|
|
73444
73444
|
ENDINTERFACE.`,
|
|
73445
73445
|
};
|
|
73446
73446
|
}
|
|
@@ -73500,15 +73500,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
73500
73500
|
key: "use_line_exists",
|
|
73501
73501
|
title: "Use line_exists",
|
|
73502
73502
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73503
|
-
extendedInformation: `
|
|
73504
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73505
|
-
|
|
73503
|
+
extendedInformation: `
|
|
73504
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73505
|
+
|
|
73506
73506
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73507
73507
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73508
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73509
|
-
IF sy-subrc = 0.
|
|
73508
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73509
|
+
IF sy-subrc = 0.
|
|
73510
73510
|
ENDIF.`,
|
|
73511
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73511
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73512
73512
|
ENDIF.`,
|
|
73513
73513
|
};
|
|
73514
73514
|
}
|
|
@@ -73618,10 +73618,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73618
73618
|
key: "use_new",
|
|
73619
73619
|
title: "Use NEW",
|
|
73620
73620
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73621
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73622
|
-
|
|
73623
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73624
|
-
|
|
73621
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73622
|
+
|
|
73623
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73624
|
+
|
|
73625
73625
|
Applicable from v740sp02 and up`,
|
|
73626
73626
|
badExample: `CREATE OBJECT ref.`,
|
|
73627
73627
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73719,13 +73719,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73719
73719
|
title: "WHEN OTHERS last",
|
|
73720
73720
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73721
73721
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73722
|
-
badExample: `CASE bar.
|
|
73723
|
-
WHEN OTHERS.
|
|
73724
|
-
WHEN 2.
|
|
73722
|
+
badExample: `CASE bar.
|
|
73723
|
+
WHEN OTHERS.
|
|
73724
|
+
WHEN 2.
|
|
73725
73725
|
ENDCASE.`,
|
|
73726
|
-
goodExample: `CASE bar.
|
|
73727
|
-
WHEN 2.
|
|
73728
|
-
WHEN OTHERS.
|
|
73726
|
+
goodExample: `CASE bar.
|
|
73727
|
+
WHEN 2.
|
|
73728
|
+
WHEN OTHERS.
|
|
73729
73729
|
ENDCASE.`,
|
|
73730
73730
|
};
|
|
73731
73731
|
}
|