@abaplint/cli 2.110.2 → 2.110.3
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 +815 -813
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -7921,8 +7921,9 @@ class SQLCase extends combi_1.Expression {
|
|
|
7921
7921
|
getRunnable() {
|
|
7922
7922
|
const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
|
|
7923
7923
|
const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7924
|
-
const
|
|
7925
|
-
const
|
|
7924
|
+
const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource);
|
|
7925
|
+
const when = (0, combi_1.seq)("WHEN", (0, combi_1.alt)(constant_1.Constant, sql_cond_1.SQLCond), "THEN", sourc, (0, combi_1.starPrio)(sub));
|
|
7926
|
+
const els = (0, combi_1.seq)("ELSE", sourc);
|
|
7926
7927
|
return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.plus)(when), (0, combi_1.optPrio)(els), "END"));
|
|
7927
7928
|
}
|
|
7928
7929
|
}
|
|
@@ -8317,21 +8318,22 @@ const sql_aggregation_1 = __webpack_require__(/*! ./sql_aggregation */ "./node_m
|
|
|
8317
8318
|
class SQLFunction extends combi_1.Expression {
|
|
8318
8319
|
getRunnable() {
|
|
8319
8320
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8320
|
-
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.
|
|
8321
|
-
const param = (0, combi_1.
|
|
8321
|
+
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, paren)));
|
|
8322
|
+
const param = (0, combi_1.altPrio)(SQLFunction, sql_aggregation_1.SQLAggregation, sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, constant_1.Constant, at);
|
|
8322
8323
|
const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), "FLTP", "NUMC", "INT8");
|
|
8324
|
+
const commaParam = (0, combi_1.seq)(",", param);
|
|
8323
8325
|
const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("abs", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8324
8326
|
const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("cast", (0, combi_1.tok)(tokens_1.ParenLeftW), param, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8325
8327
|
const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("ceil", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8326
|
-
const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("coalesce", (0, combi_1.tok)(tokens_1.ParenLeftW), param,
|
|
8327
|
-
const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("concat", (0, combi_1.tok)(tokens_1.ParenLeftW), param,
|
|
8328
|
-
const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("div", (0, combi_1.tok)(tokens_1.ParenLeftW), param,
|
|
8328
|
+
const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("coalesce", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.optPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8329
|
+
const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("concat", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8330
|
+
const div = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("div", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8329
8331
|
const floor = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("floor", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8330
8332
|
const length = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("length", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8331
8333
|
const lower = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("lower", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8332
|
-
const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param,
|
|
8333
|
-
const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param,
|
|
8334
|
-
const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param,
|
|
8334
|
+
const mod = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("mod", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8335
|
+
const replace = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("replace", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8336
|
+
const round = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("round", (0, combi_1.tok)(tokens_1.ParenLeftW), param, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8335
8337
|
const upper = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("upper", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8336
8338
|
const uuid = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("uuid", (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8337
8339
|
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round);
|
|
@@ -34466,13 +34468,13 @@ class FlowGraph {
|
|
|
34466
34468
|
this.label = label;
|
|
34467
34469
|
}
|
|
34468
34470
|
toDigraph() {
|
|
34469
|
-
return `digraph G {
|
|
34470
|
-
labelloc="t";
|
|
34471
|
-
label="${this.label}";
|
|
34472
|
-
graph [fontname = "helvetica"];
|
|
34473
|
-
node [fontname = "helvetica", shape="box"];
|
|
34474
|
-
edge [fontname = "helvetica"];
|
|
34475
|
-
${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()}
|
|
34476
34478
|
}`;
|
|
34477
34479
|
}
|
|
34478
34480
|
listSources(node) {
|
|
@@ -42568,13 +42570,13 @@ class Help {
|
|
|
42568
42570
|
/////////////////////////////////////////////////
|
|
42569
42571
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42570
42572
|
let content = "";
|
|
42571
|
-
content = `
|
|
42572
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42573
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42574
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42575
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42576
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42577
|
-
<hr>
|
|
42573
|
+
content = `
|
|
42574
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42575
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42576
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42577
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42578
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42579
|
+
<hr>
|
|
42578
42580
|
` +
|
|
42579
42581
|
"<tt>" + textDocument.uri + " (" +
|
|
42580
42582
|
(position.line + 1) + ", " +
|
|
@@ -51776,7 +51778,7 @@ class Registry {
|
|
|
51776
51778
|
}
|
|
51777
51779
|
static abaplintVersion() {
|
|
51778
51780
|
// magic, see build script "version.sh"
|
|
51779
|
-
return "2.110.
|
|
51781
|
+
return "2.110.3";
|
|
51780
51782
|
}
|
|
51781
51783
|
getDDICReferences() {
|
|
51782
51784
|
return this.ddicReferences;
|
|
@@ -52095,10 +52097,10 @@ class SevenBitAscii {
|
|
|
52095
52097
|
key: "7bit_ascii",
|
|
52096
52098
|
title: "Check for 7bit ascii",
|
|
52097
52099
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
52098
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52099
|
-
|
|
52100
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52101
|
-
|
|
52100
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52101
|
+
|
|
52102
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52103
|
+
|
|
52102
52104
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
52103
52105
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52104
52106
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52304,10 +52306,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52304
52306
|
key: "abapdoc",
|
|
52305
52307
|
title: "Check abapdoc",
|
|
52306
52308
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52307
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52308
|
-
|
|
52309
|
-
Plus class and interface definitions.
|
|
52310
|
-
|
|
52309
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52310
|
+
|
|
52311
|
+
Plus class and interface definitions.
|
|
52312
|
+
|
|
52311
52313
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52312
52314
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52313
52315
|
};
|
|
@@ -52445,49 +52447,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52445
52447
|
key: "align_parameters",
|
|
52446
52448
|
title: "Align Parameters",
|
|
52447
52449
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52448
|
-
extendedInformation: `Checks:
|
|
52449
|
-
* function module calls
|
|
52450
|
-
* method calls
|
|
52451
|
-
* VALUE constructors
|
|
52452
|
-
* NEW constructors
|
|
52453
|
-
* RAISE EXCEPTION statements
|
|
52454
|
-
* CREATE OBJECT statements
|
|
52455
|
-
* RAISE EVENT statements
|
|
52456
|
-
|
|
52457
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52458
|
-
|
|
52459
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52460
|
-
|
|
52461
|
-
If parameters are on the same row, no issues are reported, see
|
|
52450
|
+
extendedInformation: `Checks:
|
|
52451
|
+
* function module calls
|
|
52452
|
+
* method calls
|
|
52453
|
+
* VALUE constructors
|
|
52454
|
+
* NEW constructors
|
|
52455
|
+
* RAISE EXCEPTION statements
|
|
52456
|
+
* CREATE OBJECT statements
|
|
52457
|
+
* RAISE EVENT statements
|
|
52458
|
+
|
|
52459
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52460
|
+
|
|
52461
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52462
|
+
|
|
52463
|
+
If parameters are on the same row, no issues are reported, see
|
|
52462
52464
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52463
52465
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52464
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52465
|
-
EXPORTING
|
|
52466
|
-
foo = 2
|
|
52467
|
-
parameter = 3.
|
|
52468
|
-
|
|
52469
|
-
foobar( moo = 1
|
|
52470
|
-
param = 1 ).
|
|
52471
|
-
|
|
52472
|
-
foo = VALUE #(
|
|
52473
|
-
foo = bar
|
|
52466
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52467
|
+
EXPORTING
|
|
52468
|
+
foo = 2
|
|
52469
|
+
parameter = 3.
|
|
52470
|
+
|
|
52471
|
+
foobar( moo = 1
|
|
52472
|
+
param = 1 ).
|
|
52473
|
+
|
|
52474
|
+
foo = VALUE #(
|
|
52475
|
+
foo = bar
|
|
52474
52476
|
moo = 2 ).`,
|
|
52475
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52476
|
-
EXPORTING
|
|
52477
|
-
foo = 2
|
|
52478
|
-
parameter = 3.
|
|
52479
|
-
|
|
52480
|
-
foobar( moo = 1
|
|
52481
|
-
param = 1 ).
|
|
52482
|
-
|
|
52483
|
-
foo = VALUE #(
|
|
52484
|
-
foo = bar
|
|
52485
|
-
moo = 2 ).
|
|
52486
|
-
|
|
52487
|
-
DATA(sdf) = VALUE type(
|
|
52488
|
-
common_val = 2
|
|
52489
|
-
another_common = 5
|
|
52490
|
-
( row_value = 4
|
|
52477
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52478
|
+
EXPORTING
|
|
52479
|
+
foo = 2
|
|
52480
|
+
parameter = 3.
|
|
52481
|
+
|
|
52482
|
+
foobar( moo = 1
|
|
52483
|
+
param = 1 ).
|
|
52484
|
+
|
|
52485
|
+
foo = VALUE #(
|
|
52486
|
+
foo = bar
|
|
52487
|
+
moo = 2 ).
|
|
52488
|
+
|
|
52489
|
+
DATA(sdf) = VALUE type(
|
|
52490
|
+
common_val = 2
|
|
52491
|
+
another_common = 5
|
|
52492
|
+
( row_value = 4
|
|
52491
52493
|
value_foo = 5 ) ).`,
|
|
52492
52494
|
};
|
|
52493
52495
|
}
|
|
@@ -52921,37 +52923,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52921
52923
|
key: "align_type_expressions",
|
|
52922
52924
|
title: "Align TYPE expressions",
|
|
52923
52925
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52924
|
-
extendedInformation: `
|
|
52925
|
-
Currently works for METHODS + BEGIN OF
|
|
52926
|
-
|
|
52927
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52928
|
-
|
|
52929
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52926
|
+
extendedInformation: `
|
|
52927
|
+
Currently works for METHODS + BEGIN OF
|
|
52928
|
+
|
|
52929
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52930
|
+
|
|
52931
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52930
52932
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52931
52933
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52932
|
-
badExample: `
|
|
52933
|
-
TYPES: BEGIN OF foo,
|
|
52934
|
-
bar TYPE i,
|
|
52935
|
-
foobar TYPE i,
|
|
52936
|
-
END OF foo.
|
|
52937
|
-
|
|
52938
|
-
INTERFACE lif.
|
|
52939
|
-
METHODS bar
|
|
52940
|
-
IMPORTING
|
|
52941
|
-
foo TYPE i
|
|
52942
|
-
foobar TYPE i.
|
|
52934
|
+
badExample: `
|
|
52935
|
+
TYPES: BEGIN OF foo,
|
|
52936
|
+
bar TYPE i,
|
|
52937
|
+
foobar TYPE i,
|
|
52938
|
+
END OF foo.
|
|
52939
|
+
|
|
52940
|
+
INTERFACE lif.
|
|
52941
|
+
METHODS bar
|
|
52942
|
+
IMPORTING
|
|
52943
|
+
foo TYPE i
|
|
52944
|
+
foobar TYPE i.
|
|
52943
52945
|
ENDINTERFACE.`,
|
|
52944
|
-
goodExample: `
|
|
52945
|
-
TYPES: BEGIN OF foo,
|
|
52946
|
-
bar TYPE i,
|
|
52947
|
-
foobar TYPE i,
|
|
52948
|
-
END OF foo.
|
|
52949
|
-
|
|
52950
|
-
INTERFACE lif.
|
|
52951
|
-
METHODS bar
|
|
52952
|
-
IMPORTING
|
|
52953
|
-
foo TYPE i
|
|
52954
|
-
foobar TYPE i.
|
|
52946
|
+
goodExample: `
|
|
52947
|
+
TYPES: BEGIN OF foo,
|
|
52948
|
+
bar TYPE i,
|
|
52949
|
+
foobar TYPE i,
|
|
52950
|
+
END OF foo.
|
|
52951
|
+
|
|
52952
|
+
INTERFACE lif.
|
|
52953
|
+
METHODS bar
|
|
52954
|
+
IMPORTING
|
|
52955
|
+
foo TYPE i
|
|
52956
|
+
foobar TYPE i.
|
|
52955
52957
|
ENDINTERFACE.`,
|
|
52956
52958
|
};
|
|
52957
52959
|
}
|
|
@@ -53230,15 +53232,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
53230
53232
|
return {
|
|
53231
53233
|
key: "ambiguous_statement",
|
|
53232
53234
|
title: "Check for ambigious statements",
|
|
53233
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53234
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53235
|
-
|
|
53235
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53236
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53237
|
+
|
|
53236
53238
|
Only works if the target version is 740sp05 or above`,
|
|
53237
53239
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53238
|
-
badExample: `DELETE foo FROM bar.
|
|
53240
|
+
badExample: `DELETE foo FROM bar.
|
|
53239
53241
|
MODIFY foo FROM bar.`,
|
|
53240
|
-
goodExample: `DELETE foo FROM @bar.
|
|
53241
|
-
MODIFY TABLE foo FROM bar.
|
|
53242
|
+
goodExample: `DELETE foo FROM @bar.
|
|
53243
|
+
MODIFY TABLE foo FROM bar.
|
|
53242
53244
|
MODIFY zfoo FROM @wa.`,
|
|
53243
53245
|
};
|
|
53244
53246
|
}
|
|
@@ -53343,16 +53345,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53343
53345
|
key: "avoid_use",
|
|
53344
53346
|
title: "Avoid use of certain statements",
|
|
53345
53347
|
shortDescription: `Detects usage of certain statements.`,
|
|
53346
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53347
|
-
|
|
53348
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53349
|
-
|
|
53350
|
-
STATICS: use CLASS-DATA instead
|
|
53351
|
-
|
|
53352
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53353
|
-
|
|
53354
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53355
|
-
|
|
53348
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53349
|
+
|
|
53350
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53351
|
+
|
|
53352
|
+
STATICS: use CLASS-DATA instead
|
|
53353
|
+
|
|
53354
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53355
|
+
|
|
53356
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53357
|
+
|
|
53356
53358
|
BREAK points`,
|
|
53357
53359
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53358
53360
|
};
|
|
@@ -53484,11 +53486,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53484
53486
|
title: "Check BEGIN END names",
|
|
53485
53487
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53486
53488
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53487
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53488
|
-
field TYPE i,
|
|
53489
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53490
|
+
field TYPE i,
|
|
53489
53491
|
END OF structure_not_the_same.`,
|
|
53490
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53491
|
-
field TYPE i,
|
|
53492
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53493
|
+
field TYPE i,
|
|
53492
53494
|
END OF stru.`,
|
|
53493
53495
|
};
|
|
53494
53496
|
}
|
|
@@ -53585,20 +53587,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53585
53587
|
title: "BEGIN contains single INCLUDE",
|
|
53586
53588
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53587
53589
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53588
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53589
|
-
INCLUDE TYPE dselc.
|
|
53590
|
-
TYPES: END OF dummy1.
|
|
53591
|
-
|
|
53592
|
-
DATA BEGIN OF foo.
|
|
53593
|
-
INCLUDE STRUCTURE syst.
|
|
53594
|
-
DATA END OF foo.
|
|
53595
|
-
|
|
53596
|
-
STATICS BEGIN OF bar.
|
|
53597
|
-
INCLUDE STRUCTURE syst.
|
|
53590
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
53591
|
+
INCLUDE TYPE dselc.
|
|
53592
|
+
TYPES: END OF dummy1.
|
|
53593
|
+
|
|
53594
|
+
DATA BEGIN OF foo.
|
|
53595
|
+
INCLUDE STRUCTURE syst.
|
|
53596
|
+
DATA END OF foo.
|
|
53597
|
+
|
|
53598
|
+
STATICS BEGIN OF bar.
|
|
53599
|
+
INCLUDE STRUCTURE syst.
|
|
53598
53600
|
STATICS END OF bar.`,
|
|
53599
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53600
|
-
DATA field TYPE i.
|
|
53601
|
-
INCLUDE STRUCTURE dselc.
|
|
53601
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53602
|
+
DATA field TYPE i.
|
|
53603
|
+
INCLUDE STRUCTURE dselc.
|
|
53602
53604
|
DATA END OF foo.`,
|
|
53603
53605
|
};
|
|
53604
53606
|
}
|
|
@@ -53688,9 +53690,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53688
53690
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53689
53691
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53690
53692
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53691
|
-
goodExample: `TRY.
|
|
53692
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53693
|
-
CATCH cx_sy_authorization_error.
|
|
53693
|
+
goodExample: `TRY.
|
|
53694
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53695
|
+
CATCH cx_sy_authorization_error.
|
|
53694
53696
|
ENDTRY.`,
|
|
53695
53697
|
};
|
|
53696
53698
|
}
|
|
@@ -53755,10 +53757,10 @@ class CDSCommentStyle {
|
|
|
53755
53757
|
key: "cds_comment_style",
|
|
53756
53758
|
title: "CDS Comment Style",
|
|
53757
53759
|
shortDescription: `Check for obsolete comment style`,
|
|
53758
|
-
extendedInformation: `Check for obsolete comment style
|
|
53759
|
-
|
|
53760
|
-
Comments starting with "--" are considered obsolete
|
|
53761
|
-
|
|
53760
|
+
extendedInformation: `Check for obsolete comment style
|
|
53761
|
+
|
|
53762
|
+
Comments starting with "--" are considered obsolete
|
|
53763
|
+
|
|
53762
53764
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53763
53765
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53764
53766
|
badExample: "-- this is a comment",
|
|
@@ -53825,10 +53827,10 @@ class CDSLegacyView {
|
|
|
53825
53827
|
title: "CDS Legacy View",
|
|
53826
53828
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53827
53829
|
// eslint-disable-next-line max-len
|
|
53828
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53829
|
-
|
|
53830
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53831
|
-
|
|
53830
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53831
|
+
|
|
53832
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53833
|
+
|
|
53832
53834
|
v755 and up`,
|
|
53833
53835
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53834
53836
|
};
|
|
@@ -53983,10 +53985,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53983
53985
|
key: "chain_mainly_declarations",
|
|
53984
53986
|
title: "Chain mainly declarations",
|
|
53985
53987
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53986
|
-
extendedInformation: `
|
|
53987
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53988
|
-
|
|
53989
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53988
|
+
extendedInformation: `
|
|
53989
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53990
|
+
|
|
53991
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53990
53992
|
`,
|
|
53991
53993
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53992
53994
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -54162,17 +54164,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
54162
54164
|
title: "Change IF to CASE",
|
|
54163
54165
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
54164
54166
|
// eslint-disable-next-line max-len
|
|
54165
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54166
|
-
|
|
54167
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54168
|
+
|
|
54167
54169
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
54168
54170
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54169
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54170
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54171
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
54171
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54172
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54173
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
54172
54174
|
ENDIF.`,
|
|
54173
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
54174
|
-
WHEN 'FOO'.
|
|
54175
|
-
WHEN 'BAR' OR 'MOO'.
|
|
54175
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
54176
|
+
WHEN 'FOO'.
|
|
54177
|
+
WHEN 'BAR' OR 'MOO'.
|
|
54176
54178
|
ENDCASE.`,
|
|
54177
54179
|
};
|
|
54178
54180
|
}
|
|
@@ -54309,8 +54311,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54309
54311
|
return {
|
|
54310
54312
|
key: "check_abstract",
|
|
54311
54313
|
title: "Check abstract methods and classes",
|
|
54312
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54313
|
-
- class defined as abstract and final,
|
|
54314
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54315
|
+
- class defined as abstract and final,
|
|
54314
54316
|
- non-abstract class contains abstract methods`,
|
|
54315
54317
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54316
54318
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54391,11 +54393,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54391
54393
|
return {
|
|
54392
54394
|
key: "check_comments",
|
|
54393
54395
|
title: "Check Comments",
|
|
54394
|
-
shortDescription: `
|
|
54396
|
+
shortDescription: `
|
|
54395
54397
|
Various checks for comment usage.`,
|
|
54396
|
-
extendedInformation: `
|
|
54397
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54398
|
-
|
|
54398
|
+
extendedInformation: `
|
|
54399
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54400
|
+
|
|
54399
54401
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54400
54402
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54401
54403
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54557,9 +54559,9 @@ class CheckInclude {
|
|
|
54557
54559
|
key: "check_include",
|
|
54558
54560
|
title: "Check INCLUDEs",
|
|
54559
54561
|
shortDescription: `Checks INCLUDE statements`,
|
|
54560
|
-
extendedInformation: `
|
|
54561
|
-
* Reports unused includes
|
|
54562
|
-
* Errors if the includes are not found
|
|
54562
|
+
extendedInformation: `
|
|
54563
|
+
* Reports unused includes
|
|
54564
|
+
* Errors if the includes are not found
|
|
54563
54565
|
* Error if including a main program`,
|
|
54564
54566
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54565
54567
|
};
|
|
@@ -54635,14 +54637,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54635
54637
|
key: "check_subrc",
|
|
54636
54638
|
title: "Check sy-subrc",
|
|
54637
54639
|
shortDescription: `Check sy-subrc`,
|
|
54638
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54639
|
-
|
|
54640
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54641
|
-
|
|
54642
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54643
|
-
|
|
54644
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54645
|
-
|
|
54640
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54641
|
+
|
|
54642
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54643
|
+
|
|
54644
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54645
|
+
|
|
54646
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54647
|
+
|
|
54646
54648
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54647
54649
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54648
54650
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -55211,17 +55213,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
55211
55213
|
shortDescription: `Find overlapping classic exceptions`,
|
|
55212
55214
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
55213
55215
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55214
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55215
|
-
EXCEPTIONS
|
|
55216
|
-
system_failure = 1 MESSAGE lv_message
|
|
55217
|
-
communication_failure = 1 MESSAGE lv_message
|
|
55218
|
-
resource_failure = 1
|
|
55216
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55217
|
+
EXCEPTIONS
|
|
55218
|
+
system_failure = 1 MESSAGE lv_message
|
|
55219
|
+
communication_failure = 1 MESSAGE lv_message
|
|
55220
|
+
resource_failure = 1
|
|
55219
55221
|
OTHERS = 1.`,
|
|
55220
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55221
|
-
EXCEPTIONS
|
|
55222
|
-
system_failure = 1 MESSAGE lv_message
|
|
55223
|
-
communication_failure = 2 MESSAGE lv_message
|
|
55224
|
-
resource_failure = 3
|
|
55222
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55223
|
+
EXCEPTIONS
|
|
55224
|
+
system_failure = 1 MESSAGE lv_message
|
|
55225
|
+
communication_failure = 2 MESSAGE lv_message
|
|
55226
|
+
resource_failure = 3
|
|
55225
55227
|
OTHERS = 4.`,
|
|
55226
55228
|
};
|
|
55227
55229
|
}
|
|
@@ -55467,7 +55469,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55467
55469
|
key: "commented_code",
|
|
55468
55470
|
title: "Find commented code",
|
|
55469
55471
|
shortDescription: `Detects usage of commented out code.`,
|
|
55470
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55472
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55471
55473
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55472
55474
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55473
55475
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55700,10 +55702,10 @@ class ConstructorVisibilityPublic {
|
|
|
55700
55702
|
key: "constructor_visibility_public",
|
|
55701
55703
|
title: "Check constructor visibility is public",
|
|
55702
55704
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55703
|
-
extendedInformation: `
|
|
55704
|
-
This only applies to global classes.
|
|
55705
|
-
|
|
55706
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55705
|
+
extendedInformation: `
|
|
55706
|
+
This only applies to global classes.
|
|
55707
|
+
|
|
55708
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55707
55709
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55708
55710
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55709
55711
|
};
|
|
@@ -55778,8 +55780,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55778
55780
|
key: "contains_tab",
|
|
55779
55781
|
title: "Code contains tab",
|
|
55780
55782
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55781
|
-
extendedInformation: `
|
|
55782
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55783
|
+
extendedInformation: `
|
|
55784
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55783
55785
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55784
55786
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55785
55787
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55866,10 +55868,10 @@ class CyclicOO {
|
|
|
55866
55868
|
key: "cyclic_oo",
|
|
55867
55869
|
title: "Cyclic OO",
|
|
55868
55870
|
shortDescription: `Finds cyclic OO references`,
|
|
55869
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55870
|
-
|
|
55871
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55872
|
-
|
|
55871
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55872
|
+
|
|
55873
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55874
|
+
|
|
55873
55875
|
References in testclass includes are ignored`,
|
|
55874
55876
|
};
|
|
55875
55877
|
}
|
|
@@ -56111,7 +56113,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
56111
56113
|
key: "dangerous_statement",
|
|
56112
56114
|
title: "Dangerous statement",
|
|
56113
56115
|
shortDescription: `Detects potentially dangerous statements`,
|
|
56114
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56116
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56115
56117
|
dynamic SQL can potentially create SQL injection problems`,
|
|
56116
56118
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
56117
56119
|
};
|
|
@@ -56315,13 +56317,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56315
56317
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56316
56318
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56317
56319
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56318
|
-
badExample: `FROM foo.
|
|
56319
|
-
WRITE 'hello'.
|
|
56320
|
-
DATA int TYPE i.
|
|
56320
|
+
badExample: `FROM foo.
|
|
56321
|
+
WRITE 'hello'.
|
|
56322
|
+
DATA int TYPE i.
|
|
56321
56323
|
ENDFORM.`,
|
|
56322
|
-
goodExample: `FROM foo.
|
|
56323
|
-
DATA int TYPE i.
|
|
56324
|
-
WRITE 'hello'.
|
|
56324
|
+
goodExample: `FROM foo.
|
|
56325
|
+
DATA int TYPE i.
|
|
56326
|
+
WRITE 'hello'.
|
|
56325
56327
|
ENDFORM.`,
|
|
56326
56328
|
};
|
|
56327
56329
|
}
|
|
@@ -56857,39 +56859,39 @@ class Downport {
|
|
|
56857
56859
|
key: "downport",
|
|
56858
56860
|
title: "Downport statement",
|
|
56859
56861
|
shortDescription: `Downport functionality`,
|
|
56860
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56861
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56862
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56863
|
-
|
|
56864
|
-
Current rules:
|
|
56865
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56866
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56867
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56868
|
-
* CONV is outlined
|
|
56869
|
-
* COND is outlined
|
|
56870
|
-
* REDUCE is outlined
|
|
56871
|
-
* SWITCH is outlined
|
|
56872
|
-
* FILTER is outlined
|
|
56873
|
-
* APPEND expression is outlined
|
|
56874
|
-
* INSERT expression is outlined
|
|
56875
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56876
|
-
* CAST changed to ?=
|
|
56877
|
-
* LOOP AT method_call( ) is outlined
|
|
56878
|
-
* VALUE # with structure fields
|
|
56879
|
-
* VALUE # with internal table lines
|
|
56880
|
-
* Table Expressions are outlined
|
|
56881
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56882
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56883
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56884
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56885
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56886
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56887
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56888
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56889
|
-
* MESSAGE with non simple source
|
|
56890
|
-
|
|
56891
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56892
|
-
|
|
56862
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56863
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56864
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56865
|
+
|
|
56866
|
+
Current rules:
|
|
56867
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56868
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56869
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56870
|
+
* CONV is outlined
|
|
56871
|
+
* COND is outlined
|
|
56872
|
+
* REDUCE is outlined
|
|
56873
|
+
* SWITCH is outlined
|
|
56874
|
+
* FILTER is outlined
|
|
56875
|
+
* APPEND expression is outlined
|
|
56876
|
+
* INSERT expression is outlined
|
|
56877
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56878
|
+
* CAST changed to ?=
|
|
56879
|
+
* LOOP AT method_call( ) is outlined
|
|
56880
|
+
* VALUE # with structure fields
|
|
56881
|
+
* VALUE # with internal table lines
|
|
56882
|
+
* Table Expressions are outlined
|
|
56883
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56884
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56885
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56886
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56887
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56888
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56889
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56890
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56891
|
+
* MESSAGE with non simple source
|
|
56892
|
+
|
|
56893
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56894
|
+
|
|
56893
56895
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56894
56896
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56895
56897
|
};
|
|
@@ -57467,10 +57469,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57467
57469
|
const fieldName = f.concatTokens();
|
|
57468
57470
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57469
57471
|
}
|
|
57470
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57472
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57471
57473
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57472
57474
|
}
|
|
57473
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57475
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57474
57476
|
${indentation}`);
|
|
57475
57477
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57476
57478
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57514,12 +57516,12 @@ ${indentation}`);
|
|
|
57514
57516
|
}
|
|
57515
57517
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57516
57518
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
57517
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57518
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57519
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57519
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57520
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57521
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57520
57522
|
${indentation}`);
|
|
57521
57523
|
if (fieldDefinitions === "") {
|
|
57522
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57524
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57523
57525
|
${indentation}`);
|
|
57524
57526
|
}
|
|
57525
57527
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57587,7 +57589,7 @@ ${indentation}`);
|
|
|
57587
57589
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57588
57590
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57589
57591
|
const firstToken = high.getFirstToken();
|
|
57590
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57592
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57591
57593
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57592
57594
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57593
57595
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57641,7 +57643,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57641
57643
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57642
57644
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57643
57645
|
const firstToken = high.getFirstToken();
|
|
57644
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57646
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57645
57647
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57646
57648
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57647
57649
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57683,14 +57685,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57683
57685
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57684
57686
|
const firstToken = high.getFirstToken();
|
|
57685
57687
|
// note that the tabix restore should be done before throwing the exception
|
|
57686
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57687
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57688
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57689
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57690
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57691
|
-
${indentation}IF sy-subrc <> 0.
|
|
57692
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57693
|
-
${indentation}ENDIF.
|
|
57688
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57689
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57690
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57691
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57692
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57693
|
+
${indentation}IF sy-subrc <> 0.
|
|
57694
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57695
|
+
${indentation}ENDIF.
|
|
57694
57696
|
${indentation}`);
|
|
57695
57697
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57696
57698
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57747,7 +57749,7 @@ ${indentation}`);
|
|
|
57747
57749
|
const className = classNames[0].concatTokens();
|
|
57748
57750
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57749
57751
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57750
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57752
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57751
57753
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57752
57754
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57753
57755
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57909,16 +57911,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57909
57911
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57910
57912
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57911
57913
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57912
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57913
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57914
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57915
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57914
57916
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57915
57917
|
if (withs.length > 0) {
|
|
57916
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57917
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57918
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57918
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57919
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57920
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57919
57921
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57920
57922
|
}
|
|
57921
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57923
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57922
57924
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57923
57925
|
if (withs.length > 0) {
|
|
57924
57926
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -58030,10 +58032,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
58030
58032
|
let code = "";
|
|
58031
58033
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
58032
58034
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58033
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58034
|
-
IF sy-subrc <> 0.
|
|
58035
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58036
|
-
ENDIF.
|
|
58035
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58036
|
+
IF sy-subrc <> 0.
|
|
58037
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58038
|
+
ENDIF.
|
|
58037
58039
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
58038
58040
|
}
|
|
58039
58041
|
else {
|
|
@@ -58122,20 +58124,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
58122
58124
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58123
58125
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58124
58126
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58125
|
-
code += ` items LIKE ${loopSourceName},
|
|
58126
|
-
END OF ${groupTargetName}type.
|
|
58127
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58128
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58127
|
+
code += ` items LIKE ${loopSourceName},
|
|
58128
|
+
END OF ${groupTargetName}type.
|
|
58129
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58130
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58129
58131
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
58130
58132
|
if (groupIndexName !== undefined) {
|
|
58131
58133
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
58132
58134
|
}
|
|
58133
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58135
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58134
58136
|
IF sy-subrc = 0.\n`;
|
|
58135
58137
|
if (groupCountName !== undefined) {
|
|
58136
58138
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
58137
58139
|
}
|
|
58138
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58140
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58139
58141
|
ELSE.\n`;
|
|
58140
58142
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
58141
58143
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -58156,8 +58158,8 @@ ELSE.\n`;
|
|
|
58156
58158
|
}
|
|
58157
58159
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
58158
58160
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
58159
|
-
code += `ENDIF.
|
|
58160
|
-
ENDLOOP.
|
|
58161
|
+
code += `ENDIF.
|
|
58162
|
+
ENDLOOP.
|
|
58161
58163
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
58162
58164
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
58163
58165
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58329,7 +58331,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58329
58331
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58330
58332
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58331
58333
|
// all ENUMS are char like?
|
|
58332
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58334
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58333
58335
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58334
58336
|
let count = 1;
|
|
58335
58337
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58373,14 +58375,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58373
58375
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58374
58376
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58375
58377
|
// restore tabix before exeption
|
|
58376
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58377
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58378
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58379
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58380
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58381
|
-
${indentation}IF sy-subrc <> 0.
|
|
58382
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58383
|
-
${indentation}ENDIF.
|
|
58378
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58379
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58380
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58381
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58382
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58383
|
+
${indentation}IF sy-subrc <> 0.
|
|
58384
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58385
|
+
${indentation}ENDIF.
|
|
58384
58386
|
${indentation}${uniqueName}`;
|
|
58385
58387
|
const start = target.getFirstToken().getStart();
|
|
58386
58388
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58464,11 +58466,11 @@ ${indentation}${uniqueName}`;
|
|
|
58464
58466
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58465
58467
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58466
58468
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58467
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58468
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58469
|
-
${indentation} EXPORTING
|
|
58470
|
-
${indentation} input = ${source}
|
|
58471
|
-
${indentation} IMPORTING
|
|
58469
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58470
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58471
|
+
${indentation} EXPORTING
|
|
58472
|
+
${indentation} input = ${source}
|
|
58473
|
+
${indentation} IMPORTING
|
|
58472
58474
|
${indentation} output = ${uniqueName}.\n`;
|
|
58473
58475
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58474
58476
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59780,12 +59782,12 @@ class EasyToFindMessages {
|
|
|
59780
59782
|
key: "easy_to_find_messages",
|
|
59781
59783
|
title: "Easy to find messages",
|
|
59782
59784
|
shortDescription: `Make messages easy to find`,
|
|
59783
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59784
|
-
|
|
59785
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59786
|
-
|
|
59787
|
-
Also see rule "message_exists"
|
|
59788
|
-
|
|
59785
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
59786
|
+
|
|
59787
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
59788
|
+
|
|
59789
|
+
Also see rule "message_exists"
|
|
59790
|
+
|
|
59789
59791
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59790
59792
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59791
59793
|
};
|
|
@@ -59870,8 +59872,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59870
59872
|
key: "empty_line_in_statement",
|
|
59871
59873
|
title: "Find empty lines in statements",
|
|
59872
59874
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59873
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59874
|
-
|
|
59875
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59876
|
+
|
|
59875
59877
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59876
59878
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59877
59879
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -60047,13 +60049,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60047
60049
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
60048
60050
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
60049
60051
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60050
|
-
badExample: `IF foo = bar.
|
|
60051
|
-
ENDIF.
|
|
60052
|
-
|
|
60053
|
-
DO 2 TIMES.
|
|
60052
|
+
badExample: `IF foo = bar.
|
|
60053
|
+
ENDIF.
|
|
60054
|
+
|
|
60055
|
+
DO 2 TIMES.
|
|
60054
60056
|
ENDDO.`,
|
|
60055
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60056
|
-
ENDLOOP.
|
|
60057
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60058
|
+
ENDLOOP.
|
|
60057
60059
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
60058
60060
|
};
|
|
60059
60061
|
}
|
|
@@ -60195,10 +60197,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
60195
60197
|
return {
|
|
60196
60198
|
key: "exit_or_check",
|
|
60197
60199
|
title: "Find EXIT or CHECK outside loops",
|
|
60198
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60200
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60199
60201
|
Use RETURN to leave procesing blocks instead.`,
|
|
60200
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60201
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60202
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60203
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60202
60204
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
60203
60205
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60204
60206
|
};
|
|
@@ -60281,12 +60283,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
60281
60283
|
key: "expand_macros",
|
|
60282
60284
|
title: "Expand Macros",
|
|
60283
60285
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
60284
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60285
|
-
|
|
60286
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60287
|
+
|
|
60286
60288
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
60287
|
-
badExample: `DEFINE _hello.
|
|
60288
|
-
WRITE 'hello'.
|
|
60289
|
-
END-OF-DEFINITION.
|
|
60289
|
+
badExample: `DEFINE _hello.
|
|
60290
|
+
WRITE 'hello'.
|
|
60291
|
+
END-OF-DEFINITION.
|
|
60290
60292
|
_hello.`,
|
|
60291
60293
|
goodExample: `WRITE 'hello'.`,
|
|
60292
60294
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60373,7 +60375,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60373
60375
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60374
60376
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60375
60377
|
goodExample: `call_method( foo = bar ).`,
|
|
60376
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60378
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60377
60379
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60378
60380
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60379
60381
|
};
|
|
@@ -60471,7 +60473,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60471
60473
|
key: "forbidden_identifier",
|
|
60472
60474
|
title: "Forbidden Identifier",
|
|
60473
60475
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60474
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60476
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60475
60477
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60476
60478
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60477
60479
|
};
|
|
@@ -60713,8 +60715,8 @@ class ForbiddenVoidType {
|
|
|
60713
60715
|
key: "forbidden_void_type",
|
|
60714
60716
|
title: "Forbidden Void Types",
|
|
60715
60717
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60716
|
-
extendedInformation: `Inspiration:
|
|
60717
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60718
|
+
extendedInformation: `Inspiration:
|
|
60719
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60718
60720
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60719
60721
|
};
|
|
60720
60722
|
}
|
|
@@ -60957,7 +60959,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60957
60959
|
key: "fully_type_itabs",
|
|
60958
60960
|
title: "Fully type internal tables",
|
|
60959
60961
|
shortDescription: `No implict table types or table keys`,
|
|
60960
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60962
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60961
60963
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60962
60964
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60963
60965
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -61142,26 +61144,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
61142
61144
|
key: "functional_writing",
|
|
61143
61145
|
title: "Use functional writing",
|
|
61144
61146
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
61145
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61147
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61146
61148
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
61147
61149
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61148
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61149
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61150
|
-
EXPORTING
|
|
61151
|
-
p_name = 'NAME'
|
|
61152
|
-
RECEIVING
|
|
61153
|
-
p_descr_ref = lr_typedescr
|
|
61154
|
-
EXCEPTIONS
|
|
61155
|
-
type_not_found = 1
|
|
61150
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61151
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61152
|
+
EXPORTING
|
|
61153
|
+
p_name = 'NAME'
|
|
61154
|
+
RECEIVING
|
|
61155
|
+
p_descr_ref = lr_typedescr
|
|
61156
|
+
EXCEPTIONS
|
|
61157
|
+
type_not_found = 1
|
|
61156
61158
|
OTHERS = 2.`,
|
|
61157
|
-
goodExample: `zcl_class=>method( ).
|
|
61158
|
-
cl_abap_typedescr=>describe_by_name(
|
|
61159
|
-
EXPORTING
|
|
61160
|
-
p_name = 'NAME'
|
|
61161
|
-
RECEIVING
|
|
61162
|
-
p_descr_ref = lr_typedescr
|
|
61163
|
-
EXCEPTIONS
|
|
61164
|
-
type_not_found = 1
|
|
61159
|
+
goodExample: `zcl_class=>method( ).
|
|
61160
|
+
cl_abap_typedescr=>describe_by_name(
|
|
61161
|
+
EXPORTING
|
|
61162
|
+
p_name = 'NAME'
|
|
61163
|
+
RECEIVING
|
|
61164
|
+
p_descr_ref = lr_typedescr
|
|
61165
|
+
EXCEPTIONS
|
|
61166
|
+
type_not_found = 1
|
|
61165
61167
|
OTHERS = 2 ).`,
|
|
61166
61168
|
};
|
|
61167
61169
|
}
|
|
@@ -61272,14 +61274,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
61272
61274
|
key: "global_class",
|
|
61273
61275
|
title: "Global class checks",
|
|
61274
61276
|
shortDescription: `Checks related to global classes`,
|
|
61275
|
-
extendedInformation: `* global classes must be in own files
|
|
61276
|
-
|
|
61277
|
-
* file names must match class name
|
|
61278
|
-
|
|
61279
|
-
* file names must match interface name
|
|
61280
|
-
|
|
61281
|
-
* global classes must be global definitions
|
|
61282
|
-
|
|
61277
|
+
extendedInformation: `* global classes must be in own files
|
|
61278
|
+
|
|
61279
|
+
* file names must match class name
|
|
61280
|
+
|
|
61281
|
+
* file names must match interface name
|
|
61282
|
+
|
|
61283
|
+
* global classes must be global definitions
|
|
61284
|
+
|
|
61283
61285
|
* global interfaces must be global definitions`,
|
|
61284
61286
|
tags: [_irule_1.RuleTag.Syntax],
|
|
61285
61287
|
};
|
|
@@ -61378,21 +61380,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61378
61380
|
return {
|
|
61379
61381
|
key: "identical_conditions",
|
|
61380
61382
|
title: "Identical conditions",
|
|
61381
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61382
|
-
|
|
61383
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61384
|
+
|
|
61383
61385
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61384
61386
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61385
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61386
|
-
ENDIF.
|
|
61387
|
-
CASE bar.
|
|
61388
|
-
WHEN '1'.
|
|
61389
|
-
WHEN 'A' OR '1'.
|
|
61387
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61388
|
+
ENDIF.
|
|
61389
|
+
CASE bar.
|
|
61390
|
+
WHEN '1'.
|
|
61391
|
+
WHEN 'A' OR '1'.
|
|
61390
61392
|
ENDCASE.`,
|
|
61391
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61392
|
-
ENDIF.
|
|
61393
|
-
CASE bar.
|
|
61394
|
-
WHEN '1'.
|
|
61395
|
-
WHEN 'A'.
|
|
61393
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61394
|
+
ENDIF.
|
|
61395
|
+
CASE bar.
|
|
61396
|
+
WHEN '1'.
|
|
61397
|
+
WHEN 'A'.
|
|
61396
61398
|
ENDCASE.`,
|
|
61397
61399
|
};
|
|
61398
61400
|
}
|
|
@@ -61526,23 +61528,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61526
61528
|
key: "identical_contents",
|
|
61527
61529
|
title: "Identical contents",
|
|
61528
61530
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61529
|
-
extendedInformation: `
|
|
61530
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61531
|
-
|
|
61531
|
+
extendedInformation: `
|
|
61532
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61533
|
+
|
|
61532
61534
|
Chained statments are ignored`,
|
|
61533
61535
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61534
|
-
badExample: `IF foo = bar.
|
|
61535
|
-
WRITE 'bar'.
|
|
61536
|
-
WRITE 'world'.
|
|
61537
|
-
ELSE.
|
|
61538
|
-
WRITE 'foo'.
|
|
61539
|
-
WRITE 'world'.
|
|
61536
|
+
badExample: `IF foo = bar.
|
|
61537
|
+
WRITE 'bar'.
|
|
61538
|
+
WRITE 'world'.
|
|
61539
|
+
ELSE.
|
|
61540
|
+
WRITE 'foo'.
|
|
61541
|
+
WRITE 'world'.
|
|
61540
61542
|
ENDIF.`,
|
|
61541
|
-
goodExample: `IF foo = bar.
|
|
61542
|
-
WRITE 'bar'.
|
|
61543
|
-
ELSE.
|
|
61544
|
-
WRITE 'foo'.
|
|
61545
|
-
ENDIF.
|
|
61543
|
+
goodExample: `IF foo = bar.
|
|
61544
|
+
WRITE 'bar'.
|
|
61545
|
+
ELSE.
|
|
61546
|
+
WRITE 'foo'.
|
|
61547
|
+
ENDIF.
|
|
61546
61548
|
WRITE 'world'.`,
|
|
61547
61549
|
};
|
|
61548
61550
|
}
|
|
@@ -61650,12 +61652,12 @@ class IdenticalDescriptions {
|
|
|
61650
61652
|
key: "identical_descriptions",
|
|
61651
61653
|
title: "Identical descriptions",
|
|
61652
61654
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61653
|
-
extendedInformation: `Case insensitive
|
|
61654
|
-
|
|
61655
|
-
Only checks the master language descriptions
|
|
61656
|
-
|
|
61657
|
-
Dependencies are skipped
|
|
61658
|
-
|
|
61655
|
+
extendedInformation: `Case insensitive
|
|
61656
|
+
|
|
61657
|
+
Only checks the master language descriptions
|
|
61658
|
+
|
|
61659
|
+
Dependencies are skipped
|
|
61660
|
+
|
|
61659
61661
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61660
61662
|
tags: [],
|
|
61661
61663
|
};
|
|
@@ -61829,43 +61831,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61829
61831
|
key: "if_in_if",
|
|
61830
61832
|
title: "IF in IF",
|
|
61831
61833
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61832
|
-
extendedInformation: `
|
|
61833
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61834
|
-
|
|
61835
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61836
|
-
|
|
61837
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
61834
|
+
extendedInformation: `
|
|
61835
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61836
|
+
|
|
61837
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61838
|
+
|
|
61839
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
61838
61840
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61839
|
-
badExample: `IF condition1.
|
|
61840
|
-
IF condition2.
|
|
61841
|
-
...
|
|
61842
|
-
ENDIF.
|
|
61843
|
-
ENDIF.
|
|
61844
|
-
|
|
61845
|
-
IF condition1.
|
|
61846
|
-
...
|
|
61847
|
-
ELSE.
|
|
61848
|
-
IF condition2.
|
|
61849
|
-
...
|
|
61850
|
-
ENDIF.
|
|
61841
|
+
badExample: `IF condition1.
|
|
61842
|
+
IF condition2.
|
|
61843
|
+
...
|
|
61844
|
+
ENDIF.
|
|
61845
|
+
ENDIF.
|
|
61846
|
+
|
|
61847
|
+
IF condition1.
|
|
61848
|
+
...
|
|
61849
|
+
ELSE.
|
|
61850
|
+
IF condition2.
|
|
61851
|
+
...
|
|
61852
|
+
ENDIF.
|
|
61851
61853
|
ENDIF.`,
|
|
61852
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61853
|
-
...
|
|
61854
|
-
ENDIF.
|
|
61855
|
-
|
|
61856
|
-
IF condition1.
|
|
61857
|
-
...
|
|
61858
|
-
ELSEIF condition2.
|
|
61859
|
-
...
|
|
61860
|
-
ENDIF.
|
|
61861
|
-
|
|
61862
|
-
CASE variable.
|
|
61863
|
-
WHEN value1.
|
|
61864
|
-
...
|
|
61865
|
-
WHEN value2.
|
|
61866
|
-
IF condition2.
|
|
61867
|
-
...
|
|
61868
|
-
ENDIF.
|
|
61854
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61855
|
+
...
|
|
61856
|
+
ENDIF.
|
|
61857
|
+
|
|
61858
|
+
IF condition1.
|
|
61859
|
+
...
|
|
61860
|
+
ELSEIF condition2.
|
|
61861
|
+
...
|
|
61862
|
+
ENDIF.
|
|
61863
|
+
|
|
61864
|
+
CASE variable.
|
|
61865
|
+
WHEN value1.
|
|
61866
|
+
...
|
|
61867
|
+
WHEN value2.
|
|
61868
|
+
IF condition2.
|
|
61869
|
+
...
|
|
61870
|
+
ENDIF.
|
|
61869
61871
|
ENDCASE.`,
|
|
61870
61872
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61871
61873
|
};
|
|
@@ -62050,9 +62052,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
62050
62052
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
62051
62053
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
62052
62054
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
62053
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62054
|
-
METHOD ${methodName.toLowerCase()}.
|
|
62055
|
-
RETURN. " todo, implement method
|
|
62055
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62056
|
+
METHOD ${methodName.toLowerCase()}.
|
|
62057
|
+
RETURN. " todo, implement method
|
|
62056
62058
|
ENDMETHOD.`);
|
|
62057
62059
|
}
|
|
62058
62060
|
}
|
|
@@ -62240,19 +62242,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
62240
62242
|
key: "in_statement_indentation",
|
|
62241
62243
|
title: "In-statement indentation",
|
|
62242
62244
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
62243
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62244
|
-
|
|
62245
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62245
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62246
|
+
|
|
62247
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62246
62248
|
to distinguish them better from code within the block.`,
|
|
62247
|
-
badExample: `IF 1 = 1
|
|
62248
|
-
AND 2 = 2.
|
|
62249
|
-
WRITE 'hello' &&
|
|
62250
|
-
'world'.
|
|
62249
|
+
badExample: `IF 1 = 1
|
|
62250
|
+
AND 2 = 2.
|
|
62251
|
+
WRITE 'hello' &&
|
|
62252
|
+
'world'.
|
|
62251
62253
|
ENDIF.`,
|
|
62252
|
-
goodExample: `IF 1 = 1
|
|
62253
|
-
AND 2 = 2.
|
|
62254
|
-
WRITE 'hello' &&
|
|
62255
|
-
'world'.
|
|
62254
|
+
goodExample: `IF 1 = 1
|
|
62255
|
+
AND 2 = 2.
|
|
62256
|
+
WRITE 'hello' &&
|
|
62257
|
+
'world'.
|
|
62256
62258
|
ENDIF.`,
|
|
62257
62259
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62258
62260
|
};
|
|
@@ -62375,23 +62377,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62375
62377
|
title: "Indentation",
|
|
62376
62378
|
shortDescription: `Checks indentation`,
|
|
62377
62379
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62378
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62379
|
-
PRIVATE SECTION.
|
|
62380
|
-
METHODS constructor.
|
|
62381
|
-
ENDCLASS.
|
|
62382
|
-
|
|
62383
|
-
CLASS lcl IMPLEMENTATION.
|
|
62384
|
-
METHOD constructor.
|
|
62385
|
-
ENDMETHOD.
|
|
62380
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62381
|
+
PRIVATE SECTION.
|
|
62382
|
+
METHODS constructor.
|
|
62383
|
+
ENDCLASS.
|
|
62384
|
+
|
|
62385
|
+
CLASS lcl IMPLEMENTATION.
|
|
62386
|
+
METHOD constructor.
|
|
62387
|
+
ENDMETHOD.
|
|
62386
62388
|
ENDCLASS.`,
|
|
62387
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62388
|
-
PRIVATE SECTION.
|
|
62389
|
-
METHODS constructor.
|
|
62390
|
-
ENDCLASS.
|
|
62391
|
-
|
|
62392
|
-
CLASS lcl IMPLEMENTATION.
|
|
62393
|
-
METHOD constructor.
|
|
62394
|
-
ENDMETHOD.
|
|
62389
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62390
|
+
PRIVATE SECTION.
|
|
62391
|
+
METHODS constructor.
|
|
62392
|
+
ENDCLASS.
|
|
62393
|
+
|
|
62394
|
+
CLASS lcl IMPLEMENTATION.
|
|
62395
|
+
METHOD constructor.
|
|
62396
|
+
ENDMETHOD.
|
|
62395
62397
|
ENDCLASS.`,
|
|
62396
62398
|
};
|
|
62397
62399
|
}
|
|
@@ -62780,9 +62782,9 @@ class IntfReferencingClas {
|
|
|
62780
62782
|
key: "intf_referencing_clas",
|
|
62781
62783
|
title: "INTF referencing CLAS",
|
|
62782
62784
|
shortDescription: `Interface contains references to class`,
|
|
62783
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62784
|
-
Only first level references are checked.
|
|
62785
|
-
Exception class references are ignored.
|
|
62785
|
+
extendedInformation: `Only global interfaces are checked.
|
|
62786
|
+
Only first level references are checked.
|
|
62787
|
+
Exception class references are ignored.
|
|
62786
62788
|
Void references are ignored.`,
|
|
62787
62789
|
};
|
|
62788
62790
|
}
|
|
@@ -62867,9 +62869,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
62867
62869
|
title: "Invalid Table Index",
|
|
62868
62870
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
62869
62871
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62870
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
62872
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
62871
62873
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
62872
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
62874
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
62873
62875
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62874
62876
|
};
|
|
62875
62877
|
}
|
|
@@ -63470,8 +63472,8 @@ class LineBreakStyle {
|
|
|
63470
63472
|
return {
|
|
63471
63473
|
key: "line_break_style",
|
|
63472
63474
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63473
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63474
|
-
|
|
63475
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63476
|
+
|
|
63475
63477
|
abapGit does not work with CRLF`,
|
|
63476
63478
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63477
63479
|
};
|
|
@@ -63540,7 +63542,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63540
63542
|
key: "line_length",
|
|
63541
63543
|
title: "Line length",
|
|
63542
63544
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63543
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63545
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63544
63546
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63545
63547
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63546
63548
|
};
|
|
@@ -63611,7 +63613,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63611
63613
|
key: "line_only_punc",
|
|
63612
63614
|
title: "Line containing only punctuation",
|
|
63613
63615
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63614
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63616
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63615
63617
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63616
63618
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63617
63619
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -63871,15 +63873,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63871
63873
|
return {
|
|
63872
63874
|
key: "local_variable_names",
|
|
63873
63875
|
title: "Local variable naming conventions",
|
|
63874
|
-
shortDescription: `
|
|
63875
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63876
|
+
shortDescription: `
|
|
63877
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63876
63878
|
Regexes are case-insensitive.`,
|
|
63877
63879
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
63878
|
-
badExample: `FORM bar.
|
|
63879
|
-
DATA foo.
|
|
63880
|
+
badExample: `FORM bar.
|
|
63881
|
+
DATA foo.
|
|
63880
63882
|
ENDFORM.`,
|
|
63881
|
-
goodExample: `FORM bar.
|
|
63882
|
-
DATA lv_foo.
|
|
63883
|
+
goodExample: `FORM bar.
|
|
63884
|
+
DATA lv_foo.
|
|
63883
63885
|
ENDFORM.`,
|
|
63884
63886
|
};
|
|
63885
63887
|
}
|
|
@@ -64102,10 +64104,10 @@ class MainFileContents {
|
|
|
64102
64104
|
key: "main_file_contents",
|
|
64103
64105
|
title: "Main file contents",
|
|
64104
64106
|
shortDescription: `Checks related to report declarations.`,
|
|
64105
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
64106
|
-
|
|
64107
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64108
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64107
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
64108
|
+
|
|
64109
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64110
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64109
64111
|
`,
|
|
64110
64112
|
};
|
|
64111
64113
|
}
|
|
@@ -64221,17 +64223,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
64221
64223
|
title: "Too many parentheses",
|
|
64222
64224
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
64223
64225
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64224
|
-
badExample: `
|
|
64225
|
-
IF ( destination IS INITIAL ).
|
|
64226
|
-
ENDIF.
|
|
64227
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64228
|
-
ENDIF.
|
|
64226
|
+
badExample: `
|
|
64227
|
+
IF ( destination IS INITIAL ).
|
|
64228
|
+
ENDIF.
|
|
64229
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64230
|
+
ENDIF.
|
|
64229
64231
|
`,
|
|
64230
|
-
goodExample: `
|
|
64231
|
-
IF destination IS INITIAL.
|
|
64232
|
-
ENDIF.
|
|
64233
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
64234
|
-
ENDIF.
|
|
64232
|
+
goodExample: `
|
|
64233
|
+
IF destination IS INITIAL.
|
|
64234
|
+
ENDIF.
|
|
64235
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
64236
|
+
ENDIF.
|
|
64235
64237
|
`,
|
|
64236
64238
|
};
|
|
64237
64239
|
}
|
|
@@ -64405,14 +64407,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64405
64407
|
title: "Max one method parameter definition per line",
|
|
64406
64408
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64407
64409
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64408
|
-
badExample: `
|
|
64409
|
-
METHODS apps_scope_token
|
|
64410
|
-
IMPORTING
|
|
64410
|
+
badExample: `
|
|
64411
|
+
METHODS apps_scope_token
|
|
64412
|
+
IMPORTING
|
|
64411
64413
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64412
|
-
goodExample: `
|
|
64413
|
-
METHODS apps_scope_token
|
|
64414
|
-
IMPORTING
|
|
64415
|
-
body TYPE bodyapps_scope_token
|
|
64414
|
+
goodExample: `
|
|
64415
|
+
METHODS apps_scope_token
|
|
64416
|
+
IMPORTING
|
|
64417
|
+
body TYPE bodyapps_scope_token
|
|
64416
64418
|
client_id TYPE str.`,
|
|
64417
64419
|
};
|
|
64418
64420
|
}
|
|
@@ -64477,11 +64479,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64477
64479
|
key: "max_one_statement",
|
|
64478
64480
|
title: "Max one statement per line",
|
|
64479
64481
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64480
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64481
|
-
|
|
64482
|
-
Does not report anything for chained statements.
|
|
64483
|
-
|
|
64484
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64482
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64483
|
+
|
|
64484
|
+
Does not report anything for chained statements.
|
|
64485
|
+
|
|
64486
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64485
64487
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64486
64488
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64487
64489
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -64819,8 +64821,8 @@ class MethodLength {
|
|
|
64819
64821
|
key: "method_length",
|
|
64820
64822
|
title: "Method/Form Length",
|
|
64821
64823
|
shortDescription: `Checks relating to method/form length.`,
|
|
64822
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64823
|
-
|
|
64824
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64825
|
+
|
|
64824
64826
|
Abstract methods without statements are considered okay.`,
|
|
64825
64827
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64826
64828
|
};
|
|
@@ -64925,20 +64927,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
64925
64927
|
key: "method_overwrites_builtin",
|
|
64926
64928
|
title: "Method name overwrites builtin function",
|
|
64927
64929
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
64928
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64929
|
-
|
|
64930
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64931
|
-
|
|
64930
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64931
|
+
|
|
64932
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64933
|
+
|
|
64932
64934
|
Interface method names are ignored`,
|
|
64933
64935
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64934
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64935
|
-
PUBLIC SECTION.
|
|
64936
|
-
METHODS matches.
|
|
64937
|
-
ENDCLASS.
|
|
64938
|
-
|
|
64939
|
-
CLASS lcl IMPLEMENTATION.
|
|
64940
|
-
METHOD matches.
|
|
64941
|
-
ENDMETHOD.
|
|
64936
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64937
|
+
PUBLIC SECTION.
|
|
64938
|
+
METHODS matches.
|
|
64939
|
+
ENDCLASS.
|
|
64940
|
+
|
|
64941
|
+
CLASS lcl IMPLEMENTATION.
|
|
64942
|
+
METHOD matches.
|
|
64943
|
+
ENDMETHOD.
|
|
64942
64944
|
ENDCLASS.`,
|
|
64943
64945
|
};
|
|
64944
64946
|
}
|
|
@@ -65129,12 +65131,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
65129
65131
|
// eslint-disable-next-line max-len
|
|
65130
65132
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
65131
65133
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65132
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65133
|
-
PUBLIC SECTION.
|
|
65134
|
-
METHODS
|
|
65135
|
-
foobar
|
|
65136
|
-
EXPORTING foo TYPE i
|
|
65137
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
65134
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65135
|
+
PUBLIC SECTION.
|
|
65136
|
+
METHODS
|
|
65137
|
+
foobar
|
|
65138
|
+
EXPORTING foo TYPE i
|
|
65139
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
65138
65140
|
ENDCLASS.`,
|
|
65139
65141
|
};
|
|
65140
65142
|
}
|
|
@@ -65514,7 +65516,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65514
65516
|
key: "nesting",
|
|
65515
65517
|
title: "Check nesting depth",
|
|
65516
65518
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65517
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65519
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65518
65520
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65519
65521
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65520
65522
|
};
|
|
@@ -65757,7 +65759,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65757
65759
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65758
65760
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65759
65761
|
badExample: `var1 = var2 = var3.`,
|
|
65760
|
-
goodExample: `var2 = var3.
|
|
65762
|
+
goodExample: `var2 = var3.
|
|
65761
65763
|
var1 = var2.`,
|
|
65762
65764
|
};
|
|
65763
65765
|
}
|
|
@@ -65816,8 +65818,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
65816
65818
|
key: "no_external_form_calls",
|
|
65817
65819
|
title: "No external FORM calls",
|
|
65818
65820
|
shortDescription: `Detect external form calls`,
|
|
65819
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65820
|
-
|
|
65821
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65822
|
+
|
|
65821
65823
|
PERFORM foo(bar).`,
|
|
65822
65824
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65823
65825
|
};
|
|
@@ -65878,17 +65880,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
65878
65880
|
key: "no_inline_in_optional_branches",
|
|
65879
65881
|
title: "Don't declare inline in optional branches",
|
|
65880
65882
|
shortDescription: `Don't declare inline in optional branches`,
|
|
65881
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65882
|
-
|
|
65883
|
-
Considered optional branches:
|
|
65884
|
-
* inside IF/ELSEIF/ELSE
|
|
65885
|
-
* inside LOOP
|
|
65886
|
-
* inside WHILE
|
|
65887
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
65888
|
-
* inside DO
|
|
65889
|
-
* inside SELECT loops
|
|
65890
|
-
|
|
65891
|
-
Not considered optional branches:
|
|
65883
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65884
|
+
|
|
65885
|
+
Considered optional branches:
|
|
65886
|
+
* inside IF/ELSEIF/ELSE
|
|
65887
|
+
* inside LOOP
|
|
65888
|
+
* inside WHILE
|
|
65889
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
65890
|
+
* inside DO
|
|
65891
|
+
* inside SELECT loops
|
|
65892
|
+
|
|
65893
|
+
Not considered optional branches:
|
|
65892
65894
|
* TRY/CATCH/CLEANUP`,
|
|
65893
65895
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65894
65896
|
};
|
|
@@ -65988,12 +65990,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
65988
65990
|
key: "no_prefixes",
|
|
65989
65991
|
title: "No Prefixes",
|
|
65990
65992
|
shortDescription: `Dont use hungarian notation`,
|
|
65991
|
-
extendedInformation: `
|
|
65992
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65993
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65994
|
-
|
|
65995
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65996
|
-
|
|
65993
|
+
extendedInformation: `
|
|
65994
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65995
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65996
|
+
|
|
65997
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65998
|
+
|
|
65997
65999
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
65998
66000
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65999
66001
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -66172,7 +66174,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
66172
66174
|
return {
|
|
66173
66175
|
key: "no_public_attributes",
|
|
66174
66176
|
title: "No public attributes",
|
|
66175
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66177
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66176
66178
|
Exceptions are excluded from this rule.`,
|
|
66177
66179
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
66178
66180
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -66273,13 +66275,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
66273
66275
|
key: "no_yoda_conditions",
|
|
66274
66276
|
title: "No Yoda conditions",
|
|
66275
66277
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
66276
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66277
|
-
|
|
66278
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66279
|
+
|
|
66278
66280
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
66279
66281
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66280
|
-
badExample: `IF 0 <> sy-subrc.
|
|
66282
|
+
badExample: `IF 0 <> sy-subrc.
|
|
66281
66283
|
ENDIF.`,
|
|
66282
|
-
goodExample: `IF sy-subrc <> 0.
|
|
66284
|
+
goodExample: `IF sy-subrc <> 0.
|
|
66283
66285
|
ENDIF.`,
|
|
66284
66286
|
};
|
|
66285
66287
|
}
|
|
@@ -66380,8 +66382,8 @@ class NROBConsistency {
|
|
|
66380
66382
|
key: "nrob_consistency",
|
|
66381
66383
|
title: "Number range consistency",
|
|
66382
66384
|
shortDescription: `Consistency checks for number ranges`,
|
|
66383
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66384
|
-
|
|
66385
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66386
|
+
|
|
66385
66387
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
66386
66388
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66387
66389
|
};
|
|
@@ -66658,58 +66660,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66658
66660
|
title: "Obsolete statements",
|
|
66659
66661
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66660
66662
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66661
|
-
extendedInformation: `
|
|
66662
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66663
|
-
|
|
66664
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66665
|
-
|
|
66666
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66667
|
-
|
|
66668
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66669
|
-
|
|
66670
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66671
|
-
|
|
66672
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66673
|
-
|
|
66674
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66675
|
-
|
|
66676
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66677
|
-
|
|
66678
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66679
|
-
|
|
66680
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66681
|
-
|
|
66682
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66683
|
-
|
|
66684
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66685
|
-
|
|
66686
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66687
|
-
|
|
66688
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66689
|
-
|
|
66690
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66691
|
-
SELECT COUNT(*) is considered okay
|
|
66692
|
-
|
|
66693
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66694
|
-
|
|
66695
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66696
|
-
|
|
66697
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66698
|
-
|
|
66699
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66700
|
-
|
|
66701
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66702
|
-
|
|
66663
|
+
extendedInformation: `
|
|
66664
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66665
|
+
|
|
66666
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66667
|
+
|
|
66668
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66669
|
+
|
|
66670
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66671
|
+
|
|
66672
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66673
|
+
|
|
66674
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66675
|
+
|
|
66676
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66677
|
+
|
|
66678
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66679
|
+
|
|
66680
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66681
|
+
|
|
66682
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66683
|
+
|
|
66684
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66685
|
+
|
|
66686
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66687
|
+
|
|
66688
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66689
|
+
|
|
66690
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66691
|
+
|
|
66692
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66693
|
+
SELECT COUNT(*) is considered okay
|
|
66694
|
+
|
|
66695
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66696
|
+
|
|
66697
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66698
|
+
|
|
66699
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66700
|
+
|
|
66701
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66702
|
+
|
|
66703
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66704
|
+
|
|
66703
66705
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66704
|
-
badExample: `REFRESH itab.
|
|
66705
|
-
|
|
66706
|
-
COMPUTE foo = 2 + 2.
|
|
66707
|
-
|
|
66708
|
-
MULTIPLY lv_foo BY 2.
|
|
66709
|
-
|
|
66710
|
-
INTERFACE intf LOAD.
|
|
66711
|
-
|
|
66712
|
-
IF foo IS SUPPLIED.
|
|
66706
|
+
badExample: `REFRESH itab.
|
|
66707
|
+
|
|
66708
|
+
COMPUTE foo = 2 + 2.
|
|
66709
|
+
|
|
66710
|
+
MULTIPLY lv_foo BY 2.
|
|
66711
|
+
|
|
66712
|
+
INTERFACE intf LOAD.
|
|
66713
|
+
|
|
66714
|
+
IF foo IS SUPPLIED.
|
|
66713
66715
|
ENDIF.`,
|
|
66714
66716
|
};
|
|
66715
66717
|
}
|
|
@@ -67049,9 +67051,9 @@ class OmitParameterName {
|
|
|
67049
67051
|
key: "omit_parameter_name",
|
|
67050
67052
|
title: "Omit parameter name",
|
|
67051
67053
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
67052
|
-
extendedInformation: `
|
|
67053
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67054
|
-
|
|
67054
|
+
extendedInformation: `
|
|
67055
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67056
|
+
|
|
67055
67057
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
67056
67058
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67057
67059
|
badExample: `method( param = 2 ).`,
|
|
@@ -67257,20 +67259,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
67257
67259
|
shortDescription: `Omit RECEIVING`,
|
|
67258
67260
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
67259
67261
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67260
|
-
badExample: `
|
|
67261
|
-
upload_pack(
|
|
67262
|
-
EXPORTING
|
|
67263
|
-
io_client = lo_client
|
|
67264
|
-
iv_url = iv_url
|
|
67265
|
-
iv_deepen_level = iv_deepen_level
|
|
67266
|
-
it_hashes = lt_hashes
|
|
67267
|
-
RECEIVING
|
|
67262
|
+
badExample: `
|
|
67263
|
+
upload_pack(
|
|
67264
|
+
EXPORTING
|
|
67265
|
+
io_client = lo_client
|
|
67266
|
+
iv_url = iv_url
|
|
67267
|
+
iv_deepen_level = iv_deepen_level
|
|
67268
|
+
it_hashes = lt_hashes
|
|
67269
|
+
RECEIVING
|
|
67268
67270
|
rt_objects = et_objects ).`,
|
|
67269
|
-
goodExample: `
|
|
67270
|
-
et_objects = upload_pack(
|
|
67271
|
-
io_client = lo_client
|
|
67272
|
-
iv_url = iv_url
|
|
67273
|
-
iv_deepen_level = iv_deepen_level
|
|
67271
|
+
goodExample: `
|
|
67272
|
+
et_objects = upload_pack(
|
|
67273
|
+
io_client = lo_client
|
|
67274
|
+
iv_url = iv_url
|
|
67275
|
+
iv_deepen_level = iv_deepen_level
|
|
67274
67276
|
it_hashes = lt_hashes ).`,
|
|
67275
67277
|
};
|
|
67276
67278
|
}
|
|
@@ -67334,8 +67336,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
67334
67336
|
return {
|
|
67335
67337
|
key: "parser_702_chaining",
|
|
67336
67338
|
title: "Parser Error, bad chanining on 702",
|
|
67337
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67338
|
-
this rule finds these and reports errors.
|
|
67339
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67340
|
+
this rule finds these and reports errors.
|
|
67339
67341
|
Only active on target version 702 and below.`,
|
|
67340
67342
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67341
67343
|
};
|
|
@@ -67415,8 +67417,8 @@ class ParserError {
|
|
|
67415
67417
|
return {
|
|
67416
67418
|
key: "parser_error",
|
|
67417
67419
|
title: "Parser error",
|
|
67418
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67419
|
-
|
|
67420
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67421
|
+
|
|
67420
67422
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67421
67423
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67422
67424
|
};
|
|
@@ -67501,7 +67503,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67501
67503
|
return {
|
|
67502
67504
|
key: "parser_missing_space",
|
|
67503
67505
|
title: "Parser Error, missing space",
|
|
67504
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67506
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67505
67507
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67506
67508
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67507
67509
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -67913,25 +67915,25 @@ class PreferInline {
|
|
|
67913
67915
|
key: "prefer_inline",
|
|
67914
67916
|
title: "Prefer Inline Declarations",
|
|
67915
67917
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
67916
|
-
extendedInformation: `EXPERIMENTAL
|
|
67917
|
-
|
|
67918
|
-
Activates if language version is v740sp02 or above.
|
|
67919
|
-
|
|
67920
|
-
Variables must be local(METHOD or FORM).
|
|
67921
|
-
|
|
67922
|
-
No generic or void typed variables. No syntax errors.
|
|
67923
|
-
|
|
67924
|
-
First position used must be a full/pure write.
|
|
67925
|
-
|
|
67926
|
-
Move statment is not a cast(?=)
|
|
67927
|
-
|
|
67918
|
+
extendedInformation: `EXPERIMENTAL
|
|
67919
|
+
|
|
67920
|
+
Activates if language version is v740sp02 or above.
|
|
67921
|
+
|
|
67922
|
+
Variables must be local(METHOD or FORM).
|
|
67923
|
+
|
|
67924
|
+
No generic or void typed variables. No syntax errors.
|
|
67925
|
+
|
|
67926
|
+
First position used must be a full/pure write.
|
|
67927
|
+
|
|
67928
|
+
Move statment is not a cast(?=)
|
|
67929
|
+
|
|
67928
67930
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
67929
67931
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
67930
|
-
badExample: `DATA foo TYPE i.
|
|
67931
|
-
foo = 2.
|
|
67932
|
-
DATA percentage TYPE decfloat34.
|
|
67932
|
+
badExample: `DATA foo TYPE i.
|
|
67933
|
+
foo = 2.
|
|
67934
|
+
DATA percentage TYPE decfloat34.
|
|
67933
67935
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
67934
|
-
goodExample: `DATA(foo) = 2.
|
|
67936
|
+
goodExample: `DATA(foo) = 2.
|
|
67935
67937
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
67936
67938
|
};
|
|
67937
67939
|
}
|
|
@@ -68145,18 +68147,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
68145
68147
|
key: "prefer_is_not",
|
|
68146
68148
|
title: "Prefer IS NOT to NOT IS",
|
|
68147
68149
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
68148
|
-
extendedInformation: `
|
|
68149
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68150
|
-
|
|
68150
|
+
extendedInformation: `
|
|
68151
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68152
|
+
|
|
68151
68153
|
"if not is_valid( )." examples are skipped`,
|
|
68152
68154
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68153
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
68154
|
-
IF variable NP 'TODO*'.
|
|
68155
|
-
IF variable <> 42.
|
|
68155
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
68156
|
+
IF variable NP 'TODO*'.
|
|
68157
|
+
IF variable <> 42.
|
|
68156
68158
|
IF variable CO 'hello'.`,
|
|
68157
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
68158
|
-
IF NOT variable CP 'TODO*'.
|
|
68159
|
-
IF NOT variable = 42.
|
|
68159
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
68160
|
+
IF NOT variable CP 'TODO*'.
|
|
68161
|
+
IF NOT variable = 42.
|
|
68160
68162
|
IF NOT variable CA 'hello'.`,
|
|
68161
68163
|
};
|
|
68162
68164
|
}
|
|
@@ -68344,14 +68346,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
68344
68346
|
key: "prefer_raise_exception_new",
|
|
68345
68347
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
68346
68348
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
68347
|
-
extendedInformation: `
|
|
68348
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68349
|
-
|
|
68349
|
+
extendedInformation: `
|
|
68350
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68351
|
+
|
|
68350
68352
|
From 752 and up`,
|
|
68351
68353
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
68352
68354
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
68353
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68354
|
-
EXPORTING
|
|
68355
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68356
|
+
EXPORTING
|
|
68355
68357
|
previous = exception.`,
|
|
68356
68358
|
};
|
|
68357
68359
|
}
|
|
@@ -68429,12 +68431,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68429
68431
|
key: "prefer_returning_to_exporting",
|
|
68430
68432
|
title: "Prefer RETURNING to EXPORTING",
|
|
68431
68433
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68432
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68434
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68433
68435
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68434
68436
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68435
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68436
|
-
PUBLIC SECTION.
|
|
68437
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68437
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68438
|
+
PUBLIC SECTION.
|
|
68439
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68438
68440
|
ENDCLASS.`,
|
|
68439
68441
|
};
|
|
68440
68442
|
}
|
|
@@ -68530,8 +68532,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68530
68532
|
key: "prefer_xsdbool",
|
|
68531
68533
|
title: "Prefer xsdbool over boolc",
|
|
68532
68534
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68533
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68534
|
-
|
|
68535
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68536
|
+
|
|
68535
68537
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68536
68538
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68537
68539
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68603,9 +68605,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68603
68605
|
title: "Preferred compare operator",
|
|
68604
68606
|
shortDescription: `Configure undesired operator variants`,
|
|
68605
68607
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68606
|
-
badExample: `IF foo EQ bar.
|
|
68608
|
+
badExample: `IF foo EQ bar.
|
|
68607
68609
|
ENDIF.`,
|
|
68608
|
-
goodExample: `IF foo = bar.
|
|
68610
|
+
goodExample: `IF foo = bar.
|
|
68609
68611
|
ENDIF.`,
|
|
68610
68612
|
};
|
|
68611
68613
|
}
|
|
@@ -68829,26 +68831,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
68829
68831
|
key: "reduce_procedural_code",
|
|
68830
68832
|
title: "Reduce procedural code",
|
|
68831
68833
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
68832
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68833
|
-
|
|
68834
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68835
|
-
|
|
68834
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68835
|
+
|
|
68836
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68837
|
+
|
|
68836
68838
|
Comments are not counted as statements.`,
|
|
68837
68839
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68838
|
-
badExample: `FORM foo.
|
|
68839
|
-
DATA lv_bar TYPE i.
|
|
68840
|
-
lv_bar = 2 + 2.
|
|
68841
|
-
IF lv_bar = 4.
|
|
68842
|
-
WRITE 'hello world'.
|
|
68843
|
-
ENDIF.
|
|
68844
|
-
DATA lv_bar TYPE i.
|
|
68845
|
-
lv_bar = 2 + 2.
|
|
68846
|
-
IF lv_bar = 4.
|
|
68847
|
-
WRITE 'hello world'.
|
|
68848
|
-
ENDIF.
|
|
68840
|
+
badExample: `FORM foo.
|
|
68841
|
+
DATA lv_bar TYPE i.
|
|
68842
|
+
lv_bar = 2 + 2.
|
|
68843
|
+
IF lv_bar = 4.
|
|
68844
|
+
WRITE 'hello world'.
|
|
68845
|
+
ENDIF.
|
|
68846
|
+
DATA lv_bar TYPE i.
|
|
68847
|
+
lv_bar = 2 + 2.
|
|
68848
|
+
IF lv_bar = 4.
|
|
68849
|
+
WRITE 'hello world'.
|
|
68850
|
+
ENDIF.
|
|
68849
68851
|
ENDFORM.`,
|
|
68850
|
-
goodExample: `FORM foo.
|
|
68851
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
68852
|
+
goodExample: `FORM foo.
|
|
68853
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
68852
68854
|
ENDFORM.`,
|
|
68853
68855
|
};
|
|
68854
68856
|
}
|
|
@@ -69092,10 +69094,10 @@ class RemoveDescriptions {
|
|
|
69092
69094
|
return {
|
|
69093
69095
|
key: "remove_descriptions",
|
|
69094
69096
|
title: "Remove descriptions",
|
|
69095
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69096
|
-
|
|
69097
|
-
Class descriptions are required, see rule description_empty.
|
|
69098
|
-
|
|
69097
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69098
|
+
|
|
69099
|
+
Class descriptions are required, see rule description_empty.
|
|
69100
|
+
|
|
69099
69101
|
Consider using ABAP Doc for documentation.`,
|
|
69100
69102
|
tags: [],
|
|
69101
69103
|
};
|
|
@@ -69220,14 +69222,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
69220
69222
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69221
69223
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
69222
69224
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
69223
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
69225
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
69224
69226
|
DESTINATION lv_rfc.`,
|
|
69225
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69226
|
-
DESTINATION lv_rfc
|
|
69227
|
-
EXCEPTIONS
|
|
69228
|
-
system_failure = 1 MESSAGE msg
|
|
69229
|
-
communication_failure = 2 MESSAGE msg
|
|
69230
|
-
resource_failure = 3
|
|
69227
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69228
|
+
DESTINATION lv_rfc
|
|
69229
|
+
EXCEPTIONS
|
|
69230
|
+
system_failure = 1 MESSAGE msg
|
|
69231
|
+
communication_failure = 2 MESSAGE msg
|
|
69232
|
+
resource_failure = 3
|
|
69231
69233
|
OTHERS = 4.`,
|
|
69232
69234
|
};
|
|
69233
69235
|
}
|
|
@@ -69311,11 +69313,11 @@ class SelectAddOrderBy {
|
|
|
69311
69313
|
key: "select_add_order_by",
|
|
69312
69314
|
title: "SELECT add ORDER BY",
|
|
69313
69315
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
69314
|
-
extendedInformation: `
|
|
69315
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69316
|
-
|
|
69317
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
69318
|
-
|
|
69316
|
+
extendedInformation: `
|
|
69317
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69318
|
+
|
|
69319
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
69320
|
+
|
|
69319
69321
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
69320
69322
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69321
69323
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69446,14 +69448,14 @@ class SelectPerformance {
|
|
|
69446
69448
|
key: "select_performance",
|
|
69447
69449
|
title: "SELECT performance",
|
|
69448
69450
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69449
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69450
|
-
|
|
69451
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69452
|
+
|
|
69451
69453
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69452
69454
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69453
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69454
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69455
|
+
badExample: `SELECT field1, field2 FROM table
|
|
69456
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69455
69457
|
ENDSELECT.`,
|
|
69456
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69458
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69457
69459
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69458
69460
|
};
|
|
69459
69461
|
}
|
|
@@ -69567,8 +69569,8 @@ class SelectSingleFullKey {
|
|
|
69567
69569
|
key: "select_single_full_key",
|
|
69568
69570
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69569
69571
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69570
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69571
|
-
|
|
69572
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69573
|
+
|
|
69572
69574
|
If the statement contains a JOIN it is not checked`,
|
|
69573
69575
|
pseudoComment: "EC CI_NOORDER",
|
|
69574
69576
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -69992,8 +69994,8 @@ class SICFConsistency {
|
|
|
69992
69994
|
key: "sicf_consistency",
|
|
69993
69995
|
title: "SICF consistency",
|
|
69994
69996
|
shortDescription: `Checks the validity of ICF services`,
|
|
69995
|
-
extendedInformation: `* Class defined in handler must exist
|
|
69996
|
-
* Class must not have any syntax errors
|
|
69997
|
+
extendedInformation: `* Class defined in handler must exist
|
|
69998
|
+
* Class must not have any syntax errors
|
|
69997
69999
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
69998
70000
|
};
|
|
69999
70001
|
}
|
|
@@ -70105,23 +70107,23 @@ class SlowParameterPassing {
|
|
|
70105
70107
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
70106
70108
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
70107
70109
|
tags: [_irule_1.RuleTag.Performance],
|
|
70108
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70109
|
-
PUBLIC SECTION.
|
|
70110
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70111
|
-
ENDCLASS.
|
|
70112
|
-
CLASS lcl IMPLEMENTATION.
|
|
70113
|
-
METHOD bar.
|
|
70114
|
-
WRITE sdf.
|
|
70115
|
-
ENDMETHOD.
|
|
70110
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70111
|
+
PUBLIC SECTION.
|
|
70112
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70113
|
+
ENDCLASS.
|
|
70114
|
+
CLASS lcl IMPLEMENTATION.
|
|
70115
|
+
METHOD bar.
|
|
70116
|
+
WRITE sdf.
|
|
70117
|
+
ENDMETHOD.
|
|
70116
70118
|
ENDCLASS.`,
|
|
70117
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
70118
|
-
PUBLIC SECTION.
|
|
70119
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
70120
|
-
ENDCLASS.
|
|
70121
|
-
CLASS lcl IMPLEMENTATION.
|
|
70122
|
-
METHOD bar.
|
|
70123
|
-
WRITE sdf.
|
|
70124
|
-
ENDMETHOD.
|
|
70119
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
70120
|
+
PUBLIC SECTION.
|
|
70121
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
70122
|
+
ENDCLASS.
|
|
70123
|
+
CLASS lcl IMPLEMENTATION.
|
|
70124
|
+
METHOD bar.
|
|
70125
|
+
WRITE sdf.
|
|
70126
|
+
ENDMETHOD.
|
|
70125
70127
|
ENDCLASS.`,
|
|
70126
70128
|
};
|
|
70127
70129
|
}
|
|
@@ -70378,8 +70380,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
70378
70380
|
key: "space_before_dot",
|
|
70379
70381
|
title: "Space before dot",
|
|
70380
70382
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
70381
|
-
extendedInformation: `
|
|
70382
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70383
|
+
extendedInformation: `
|
|
70384
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70383
70385
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
70384
70386
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70385
70387
|
badExample: `WRITE bar .`,
|
|
@@ -70565,12 +70567,12 @@ class SQLValueConversion {
|
|
|
70565
70567
|
key: "sql_value_conversion",
|
|
70566
70568
|
title: "Implicit SQL Value Conversion",
|
|
70567
70569
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70568
|
-
extendedInformation: `
|
|
70569
|
-
* Integer to CHAR conversion
|
|
70570
|
-
* Integer to NUMC conversion
|
|
70571
|
-
* NUMC to Integer conversion
|
|
70572
|
-
* CHAR to Integer conversion
|
|
70573
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
70570
|
+
extendedInformation: `
|
|
70571
|
+
* Integer to CHAR conversion
|
|
70572
|
+
* Integer to NUMC conversion
|
|
70573
|
+
* NUMC to Integer conversion
|
|
70574
|
+
* CHAR to Integer conversion
|
|
70575
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
70574
70576
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70575
70577
|
tags: [],
|
|
70576
70578
|
};
|
|
@@ -70642,7 +70644,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70642
70644
|
key: "start_at_tab",
|
|
70643
70645
|
title: "Start at tab",
|
|
70644
70646
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70645
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70647
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70646
70648
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70647
70649
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70648
70650
|
badExample: ` WRITE a.`,
|
|
@@ -70819,12 +70821,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
70819
70821
|
key: "strict_sql",
|
|
70820
70822
|
title: "Strict SQL",
|
|
70821
70823
|
shortDescription: `Strict SQL`,
|
|
70822
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70823
|
-
|
|
70824
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70825
|
-
|
|
70826
|
-
Also see separate rule sql_escape_host_variables
|
|
70827
|
-
|
|
70824
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70825
|
+
|
|
70826
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70827
|
+
|
|
70828
|
+
Also see separate rule sql_escape_host_variables
|
|
70829
|
+
|
|
70828
70830
|
Activates from v750 and up`,
|
|
70829
70831
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
70830
70832
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -71078,11 +71080,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
71078
71080
|
key: "sy_modification",
|
|
71079
71081
|
title: "Modification of SY fields",
|
|
71080
71082
|
shortDescription: `Finds modification of sy fields`,
|
|
71081
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71082
|
-
|
|
71083
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71084
|
+
|
|
71083
71085
|
Changes to SY-TVAR* fields are not reported`,
|
|
71084
71086
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71085
|
-
badExample: `sy-uname = 2.
|
|
71087
|
+
badExample: `sy-uname = 2.
|
|
71086
71088
|
sy = sy.`,
|
|
71087
71089
|
};
|
|
71088
71090
|
}
|
|
@@ -71144,8 +71146,8 @@ class TABLEnhancementCategory {
|
|
|
71144
71146
|
key: "tabl_enhancement_category",
|
|
71145
71147
|
title: "TABL enhancement category must be set",
|
|
71146
71148
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
71147
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71148
|
-
|
|
71149
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71150
|
+
|
|
71149
71151
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
71150
71152
|
tags: [],
|
|
71151
71153
|
};
|
|
@@ -71273,9 +71275,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
71273
71275
|
title: "Type FORM parameters",
|
|
71274
71276
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
71275
71277
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71276
|
-
badExample: `FORM foo USING bar.
|
|
71278
|
+
badExample: `FORM foo USING bar.
|
|
71277
71279
|
ENDFORM.`,
|
|
71278
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
71280
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
71279
71281
|
ENDFORM.`,
|
|
71280
71282
|
};
|
|
71281
71283
|
}
|
|
@@ -71948,38 +71950,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
71948
71950
|
key: "unnecessary_pragma",
|
|
71949
71951
|
title: "Unnecessary Pragma",
|
|
71950
71952
|
shortDescription: `Finds pragmas which can be removed`,
|
|
71951
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
71952
|
-
|
|
71953
|
-
* NEEDED without definition
|
|
71954
|
-
|
|
71955
|
-
* NO_TEXT without texts
|
|
71956
|
-
|
|
71957
|
-
* SUBRC_OK where sy-subrc is checked
|
|
71958
|
-
|
|
71953
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
71954
|
+
|
|
71955
|
+
* NEEDED without definition
|
|
71956
|
+
|
|
71957
|
+
* NO_TEXT without texts
|
|
71958
|
+
|
|
71959
|
+
* SUBRC_OK where sy-subrc is checked
|
|
71960
|
+
|
|
71959
71961
|
NO_HANDLER inside macros are not checked`,
|
|
71960
71962
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71961
|
-
badExample: `TRY.
|
|
71962
|
-
...
|
|
71963
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71964
|
-
RETURN. " it has a handler
|
|
71965
|
-
ENDTRY.
|
|
71966
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71967
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71968
|
-
IF sy-subrc <> 0.
|
|
71963
|
+
badExample: `TRY.
|
|
71964
|
+
...
|
|
71965
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71966
|
+
RETURN. " it has a handler
|
|
71967
|
+
ENDTRY.
|
|
71968
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71969
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71970
|
+
IF sy-subrc <> 0.
|
|
71969
71971
|
ENDIF.`,
|
|
71970
|
-
goodExample: `TRY.
|
|
71971
|
-
...
|
|
71972
|
-
CATCH zcx_abapgit_exception.
|
|
71973
|
-
RETURN.
|
|
71974
|
-
ENDTRY.
|
|
71975
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71976
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71977
|
-
IF sy-subrc <> 0.
|
|
71978
|
-
ENDIF.
|
|
71979
|
-
|
|
71980
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
71981
|
-
test1 TYPE string,
|
|
71982
|
-
test2 TYPE string,
|
|
71972
|
+
goodExample: `TRY.
|
|
71973
|
+
...
|
|
71974
|
+
CATCH zcx_abapgit_exception.
|
|
71975
|
+
RETURN.
|
|
71976
|
+
ENDTRY.
|
|
71977
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71978
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71979
|
+
IF sy-subrc <> 0.
|
|
71980
|
+
ENDIF.
|
|
71981
|
+
|
|
71982
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
71983
|
+
test1 TYPE string,
|
|
71984
|
+
test2 TYPE string,
|
|
71983
71985
|
END OF blah.`,
|
|
71984
71986
|
};
|
|
71985
71987
|
}
|
|
@@ -72146,18 +72148,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
72146
72148
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
72147
72149
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
72148
72150
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
72149
|
-
badExample: `FORM hello1.
|
|
72150
|
-
WRITE 'world'.
|
|
72151
|
-
RETURN.
|
|
72152
|
-
ENDFORM.
|
|
72153
|
-
|
|
72154
|
-
FORM foo.
|
|
72155
|
-
IF 1 = 2.
|
|
72156
|
-
RETURN.
|
|
72157
|
-
ENDIF.
|
|
72151
|
+
badExample: `FORM hello1.
|
|
72152
|
+
WRITE 'world'.
|
|
72153
|
+
RETURN.
|
|
72154
|
+
ENDFORM.
|
|
72155
|
+
|
|
72156
|
+
FORM foo.
|
|
72157
|
+
IF 1 = 2.
|
|
72158
|
+
RETURN.
|
|
72159
|
+
ENDIF.
|
|
72158
72160
|
ENDFORM.`,
|
|
72159
|
-
goodExample: `FORM hello2.
|
|
72160
|
-
WRITE 'world'.
|
|
72161
|
+
goodExample: `FORM hello2.
|
|
72162
|
+
WRITE 'world'.
|
|
72161
72163
|
ENDFORM.`,
|
|
72162
72164
|
};
|
|
72163
72165
|
}
|
|
@@ -72508,13 +72510,13 @@ class UnusedMacros {
|
|
|
72508
72510
|
title: "Unused macros",
|
|
72509
72511
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
72510
72512
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72511
|
-
badExample: `DEFINE foobar1.
|
|
72512
|
-
WRITE 'hello'.
|
|
72513
|
+
badExample: `DEFINE foobar1.
|
|
72514
|
+
WRITE 'hello'.
|
|
72513
72515
|
END-OF-DEFINITION.`,
|
|
72514
|
-
goodExample: `DEFINE foobar2.
|
|
72515
|
-
WRITE 'hello'.
|
|
72516
|
-
END-OF-DEFINITION.
|
|
72517
|
-
|
|
72516
|
+
goodExample: `DEFINE foobar2.
|
|
72517
|
+
WRITE 'hello'.
|
|
72518
|
+
END-OF-DEFINITION.
|
|
72519
|
+
|
|
72518
72520
|
foobar2.`,
|
|
72519
72521
|
};
|
|
72520
72522
|
}
|
|
@@ -72622,17 +72624,17 @@ class UnusedMethods {
|
|
|
72622
72624
|
key: "unused_methods",
|
|
72623
72625
|
title: "Unused methods",
|
|
72624
72626
|
shortDescription: `Checks for unused methods`,
|
|
72625
|
-
extendedInformation: `Checks private and protected methods.
|
|
72626
|
-
|
|
72627
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72628
|
-
|
|
72629
|
-
Skips:
|
|
72630
|
-
* methods FOR TESTING
|
|
72631
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72632
|
-
* class_constructor + constructor methods
|
|
72633
|
-
* event handlers
|
|
72634
|
-
* methods that are redefined
|
|
72635
|
-
* INCLUDEs
|
|
72627
|
+
extendedInformation: `Checks private and protected methods.
|
|
72628
|
+
|
|
72629
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72630
|
+
|
|
72631
|
+
Skips:
|
|
72632
|
+
* methods FOR TESTING
|
|
72633
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72634
|
+
* class_constructor + constructor methods
|
|
72635
|
+
* event handlers
|
|
72636
|
+
* methods that are redefined
|
|
72637
|
+
* INCLUDEs
|
|
72636
72638
|
`,
|
|
72637
72639
|
tags: [],
|
|
72638
72640
|
pragma: "##CALLED",
|
|
@@ -73066,23 +73068,23 @@ class UnusedVariables {
|
|
|
73066
73068
|
key: "unused_variables",
|
|
73067
73069
|
title: "Unused variables",
|
|
73068
73070
|
shortDescription: `Checks for unused variables and constants`,
|
|
73069
|
-
extendedInformation: `Skips event parameters.
|
|
73070
|
-
|
|
73071
|
-
Note that this currently does not work if the source code uses macros.
|
|
73072
|
-
|
|
73073
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73074
|
-
|
|
73071
|
+
extendedInformation: `Skips event parameters.
|
|
73072
|
+
|
|
73073
|
+
Note that this currently does not work if the source code uses macros.
|
|
73074
|
+
|
|
73075
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73076
|
+
|
|
73075
73077
|
Errors found in INCLUDES are reported for the main program.`,
|
|
73076
73078
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73077
73079
|
pragma: "##NEEDED",
|
|
73078
73080
|
pseudoComment: "EC NEEDED",
|
|
73079
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
73080
|
-
test TYPE string,
|
|
73081
|
-
test2 TYPE string,
|
|
73081
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
73082
|
+
test TYPE string,
|
|
73083
|
+
test2 TYPE string,
|
|
73082
73084
|
END OF blah1.`,
|
|
73083
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73084
|
-
test TYPE string,
|
|
73085
|
-
test2 TYPE string,
|
|
73085
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73086
|
+
test TYPE string,
|
|
73087
|
+
test2 TYPE string,
|
|
73086
73088
|
END OF blah2.`,
|
|
73087
73089
|
};
|
|
73088
73090
|
}
|
|
@@ -73301,15 +73303,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
73301
73303
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
73302
73304
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
73303
73305
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
73304
|
-
badExample: `IF line IS INITIAL.
|
|
73305
|
-
has_entries = abap_false.
|
|
73306
|
-
ELSE.
|
|
73307
|
-
has_entries = abap_true.
|
|
73308
|
-
ENDIF.
|
|
73309
|
-
|
|
73306
|
+
badExample: `IF line IS INITIAL.
|
|
73307
|
+
has_entries = abap_false.
|
|
73308
|
+
ELSE.
|
|
73309
|
+
has_entries = abap_true.
|
|
73310
|
+
ENDIF.
|
|
73311
|
+
|
|
73310
73312
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
73311
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73312
|
-
|
|
73313
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73314
|
+
|
|
73313
73315
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
73314
73316
|
};
|
|
73315
73317
|
}
|
|
@@ -73427,15 +73429,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
73427
73429
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
73428
73430
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
73429
73431
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73430
|
-
badExample: `INTERFACE lif.
|
|
73431
|
-
METHODS load_data
|
|
73432
|
-
EXCEPTIONS
|
|
73433
|
-
invalid_parameter.
|
|
73432
|
+
badExample: `INTERFACE lif.
|
|
73433
|
+
METHODS load_data
|
|
73434
|
+
EXCEPTIONS
|
|
73435
|
+
invalid_parameter.
|
|
73434
73436
|
ENDINTERFACE.`,
|
|
73435
|
-
goodExample: `INTERFACE lif.
|
|
73436
|
-
METHODS load_data
|
|
73437
|
-
RAISING
|
|
73438
|
-
cx_something.
|
|
73437
|
+
goodExample: `INTERFACE lif.
|
|
73438
|
+
METHODS load_data
|
|
73439
|
+
RAISING
|
|
73440
|
+
cx_something.
|
|
73439
73441
|
ENDINTERFACE.`,
|
|
73440
73442
|
};
|
|
73441
73443
|
}
|
|
@@ -73495,15 +73497,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
73495
73497
|
key: "use_line_exists",
|
|
73496
73498
|
title: "Use line_exists",
|
|
73497
73499
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73498
|
-
extendedInformation: `
|
|
73499
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73500
|
-
|
|
73500
|
+
extendedInformation: `
|
|
73501
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73502
|
+
|
|
73501
73503
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73502
73504
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73503
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73504
|
-
IF sy-subrc = 0.
|
|
73505
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73506
|
+
IF sy-subrc = 0.
|
|
73505
73507
|
ENDIF.`,
|
|
73506
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73508
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73507
73509
|
ENDIF.`,
|
|
73508
73510
|
};
|
|
73509
73511
|
}
|
|
@@ -73613,10 +73615,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73613
73615
|
key: "use_new",
|
|
73614
73616
|
title: "Use NEW",
|
|
73615
73617
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73616
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73617
|
-
|
|
73618
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73619
|
-
|
|
73618
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73619
|
+
|
|
73620
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73621
|
+
|
|
73620
73622
|
Applicable from v740sp02 and up`,
|
|
73621
73623
|
badExample: `CREATE OBJECT ref.`,
|
|
73622
73624
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73714,13 +73716,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73714
73716
|
title: "WHEN OTHERS last",
|
|
73715
73717
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73716
73718
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73717
|
-
badExample: `CASE bar.
|
|
73718
|
-
WHEN OTHERS.
|
|
73719
|
-
WHEN 2.
|
|
73719
|
+
badExample: `CASE bar.
|
|
73720
|
+
WHEN OTHERS.
|
|
73721
|
+
WHEN 2.
|
|
73720
73722
|
ENDCASE.`,
|
|
73721
|
-
goodExample: `CASE bar.
|
|
73722
|
-
WHEN 2.
|
|
73723
|
-
WHEN OTHERS.
|
|
73723
|
+
goodExample: `CASE bar.
|
|
73724
|
+
WHEN 2.
|
|
73725
|
+
WHEN OTHERS.
|
|
73724
73726
|
ENDCASE.`,
|
|
73725
73727
|
};
|
|
73726
73728
|
}
|