@abaplint/cli 2.113.61 → 2.113.63
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 +876 -866
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -4811,7 +4811,7 @@ class CorrespondingBody extends combi_1.Expression {
|
|
|
4811
4811
|
const mapping = (0, combi_1.seq)("MAPPING", (0, combi_1.plus)((0, combi_1.seq)(_1.ComponentName, "=", component_chain_1.ComponentChain)));
|
|
4812
4812
|
const baseParen = (0, combi_1.seq)("BASE", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
4813
4813
|
const discarding = (0, combi_1.ver)(version_1.Version.v751, "DISCARDING DUPLICATES");
|
|
4814
|
-
return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), (0, combi_1.optPrio)(baseParen), _1.Source, (0, combi_1.optPrio)(discarding), (0, combi_1.optPrio)(mapping), (0, combi_1.optPrio)((0, combi_1.seq)("EXCEPT", (0, combi_1.alt)((0, combi_1.plus)(_1.Field), "*"))));
|
|
4814
|
+
return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), (0, combi_1.optPrio)(baseParen), _1.Source, (0, combi_1.optPrio)(discarding), (0, combi_1.optPrio)(mapping), (0, combi_1.optPrio)("CHANGING CONTROL"), (0, combi_1.optPrio)((0, combi_1.seq)("EXCEPT", (0, combi_1.alt)((0, combi_1.plus)(_1.Field), "*"))));
|
|
4815
4815
|
}
|
|
4816
4816
|
}
|
|
4817
4817
|
exports.CorrespondingBody = CorrespondingBody;
|
|
@@ -5039,7 +5039,7 @@ exports.EntityAssociation = void 0;
|
|
|
5039
5039
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
5040
5040
|
class EntityAssociation extends combi_1.Expression {
|
|
5041
5041
|
getRunnable() {
|
|
5042
|
-
return (0, combi_1.regex)(
|
|
5042
|
+
return (0, combi_1.regex)(/^\w+(\\_|\\\\)\w+$/);
|
|
5043
5043
|
}
|
|
5044
5044
|
}
|
|
5045
5045
|
exports.EntityAssociation = EntityAssociation;
|
|
@@ -9406,11 +9406,12 @@ class TypeStructure extends combi_1.Expression {
|
|
|
9406
9406
|
getRunnable() {
|
|
9407
9407
|
// todo, add version,
|
|
9408
9408
|
const hier = (0, combi_1.seq)("HIERARCHY", _1.NamespaceSimpleName);
|
|
9409
|
-
const create = (0, combi_1.seq)("CREATE", _1.NamespaceSimpleName);
|
|
9410
|
-
const update = (0, combi_1.seq)("UPDATE", _1.NamespaceSimpleName);
|
|
9411
|
-
const action = (0, combi_1.seq)("ACTION IMPORT", _1.
|
|
9409
|
+
const create = (0, combi_1.seq)("CREATE", (0, combi_1.alt)(_1.NamespaceSimpleName, _1.EntityAssociation));
|
|
9410
|
+
const update = (0, combi_1.seq)("UPDATE", (0, combi_1.alt)(_1.NamespaceSimpleName, _1.EntityAssociation));
|
|
9411
|
+
const action = (0, combi_1.seq)("ACTION IMPORT", _1.Source);
|
|
9412
|
+
const permissionsRequest = (0, combi_1.seq)("PERMISSIONS REQUEST", _1.NamespaceSimpleName);
|
|
9412
9413
|
const evt = (0, combi_1.seq)("EVENT", _1.EventName);
|
|
9413
|
-
return (0, combi_1.seq)("TYPE STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt, create, update, action));
|
|
9414
|
+
return (0, combi_1.seq)("TYPE STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt, create, update, action, permissionsRequest));
|
|
9414
9415
|
}
|
|
9415
9416
|
}
|
|
9416
9417
|
exports.TypeStructure = TypeStructure;
|
|
@@ -9446,7 +9447,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
9446
9447
|
// "WITH" is not allowed as a field name in keys
|
|
9447
9448
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
9448
9449
|
const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
|
|
9449
|
-
const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "FAILED", "LOCK", "READ RESULT", "UPDATE"), _1.TypeName));
|
|
9450
|
+
const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "FAILED", "LOCK", "READ RESULT", "UPDATE"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
|
|
9450
9451
|
const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
|
|
9451
9452
|
const oldLike = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
|
|
9452
9453
|
const typeLine = (0, combi_1.seq)("LINE OF", _1.TypeName, occurs, header);
|
|
@@ -9626,7 +9627,7 @@ class WriteOffsetLength extends combi_1.Expression {
|
|
|
9626
9627
|
getRunnable() {
|
|
9627
9628
|
const post = (0, combi_1.seq)((0, combi_1.alt)(simple_field_chain2_1.SimpleFieldChain2, (0, combi_1.regex)(/^[\d]+$/), (0, combi_1.regex)(/^\*$/)), (0, combi_1.alt)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
|
|
9628
9629
|
const wlength = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), post);
|
|
9629
|
-
const length = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeft), post);
|
|
9630
|
+
const length = (0, combi_1.seq)((0, combi_1.alt)((0, combi_1.tok)(tokens_1.WParenLeft), (0, combi_1.tok)(tokens_1.ParenLeft)), post);
|
|
9630
9631
|
const complex = (0, combi_1.alt)(wlength, (0, combi_1.seq)((0, combi_1.alt)(simple_field_chain2_1.SimpleFieldChain2, (0, combi_1.regex)(/^\/?[\w\d]+$/), "/"), (0, combi_1.opt)(length)));
|
|
9631
9632
|
const at = (0, combi_1.seq)((0, combi_1.opt)("AT"), complex);
|
|
9632
9633
|
return at;
|
|
@@ -10041,7 +10042,8 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
10041
10042
|
class Add {
|
|
10042
10043
|
getMatcher() {
|
|
10043
10044
|
const to = (0, combi_1.seq)("TO", expressions_1.Target);
|
|
10044
|
-
const
|
|
10045
|
+
const giving = (0, combi_1.seq)("GIVING", expressions_1.FieldSub);
|
|
10046
|
+
const then = (0, combi_1.seq)("THEN", expressions_1.FieldSub, "UNTIL", expressions_1.FieldSub, (0, combi_1.alt)(giving, to));
|
|
10045
10047
|
const ret = (0, combi_1.seq)("ADD", expressions_1.Source, (0, combi_1.altPrio)(to, then));
|
|
10046
10048
|
return ret;
|
|
10047
10049
|
}
|
|
@@ -12024,8 +12026,9 @@ class Describe {
|
|
|
12024
12026
|
const index = (0, combi_1.seq)("INDEX", expressions_1.Source);
|
|
12025
12027
|
const top = (0, combi_1.seq)("TOP-LINES", expressions_1.Target);
|
|
12026
12028
|
const lineSize = (0, combi_1.seq)("LINE-SIZE", expressions_1.Target);
|
|
12029
|
+
const lineCount = (0, combi_1.seq)("LINE-COUNT", expressions_1.Target);
|
|
12027
12030
|
const first = (0, combi_1.seq)("FIRST-LINE", expressions_1.Target);
|
|
12028
|
-
const list = (0, combi_1.seq)("LIST", (0, combi_1.per)(lines, pages, index, line, page, top, first, lineSize));
|
|
12031
|
+
const list = (0, combi_1.seq)("LIST", (0, combi_1.per)(lines, pages, index, line, page, top, first, lineSize, lineCount));
|
|
12029
12032
|
const ret = (0, combi_1.seq)("DESCRIBE", (0, combi_1.altPrio)(table, field, distance, list));
|
|
12030
12033
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
12031
12034
|
}
|
|
@@ -13770,7 +13773,7 @@ class Import {
|
|
|
13770
13773
|
const using = (0, combi_1.seq)("USING", expressions_1.Source);
|
|
13771
13774
|
const cluster = (0, combi_1.seq)(expressions_1.NamespaceSimpleName, (0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.regex)(/^[\w$%\^]{2}$/), (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
13772
13775
|
const buffer = (0, combi_1.seq)("DATA BUFFER", expressions_1.Source);
|
|
13773
|
-
const memory = (0, combi_1.seq)("MEMORY ID", expressions_1.Source);
|
|
13776
|
+
const memory = (0, combi_1.seq)("MEMORY", (0, combi_1.opt)((0, combi_1.seq)("ID", expressions_1.Source)));
|
|
13774
13777
|
const table = (0, combi_1.seq)("INTERNAL TABLE", expressions_1.Source);
|
|
13775
13778
|
const shared = (0, combi_1.seq)((0, combi_1.alt)("SHARED MEMORY", "SHARED BUFFER"), cluster, (0, combi_1.per)(dto, client, id));
|
|
13776
13779
|
const database = (0, combi_1.seq)("DATABASE", cluster, (0, combi_1.per)(dto, client, id, using));
|
|
@@ -14235,8 +14238,10 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
|
|
|
14235
14238
|
class Infotypes {
|
|
14236
14239
|
getMatcher() {
|
|
14237
14240
|
const occurs = (0, combi_1.seq)("OCCURS", expressions_1.Constant);
|
|
14238
|
-
const name = (0, combi_1.seq)("NAME", expressions_1.
|
|
14239
|
-
const
|
|
14241
|
+
const name = (0, combi_1.seq)("NAME", expressions_1.FieldSub);
|
|
14242
|
+
const mode = "MODE N";
|
|
14243
|
+
const valid = (0, combi_1.seq)("VALID FROM", expressions_1.Source, "TO", expressions_1.Source);
|
|
14244
|
+
const ret = (0, combi_1.seq)("INFOTYPES", (0, combi_1.regex)(/^\d\d\d\d$/), (0, combi_1.optPrio)(valid), (0, combi_1.optPrio)(name), (0, combi_1.optPrio)(occurs), (0, combi_1.optPrio)(mode));
|
|
14240
14245
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
14241
14246
|
}
|
|
14242
14247
|
}
|
|
@@ -15426,7 +15431,7 @@ class Program {
|
|
|
15426
15431
|
const message = (0, combi_1.seq)("MESSAGE-ID", expressions_1.MessageClass);
|
|
15427
15432
|
const size = (0, combi_1.seq)("LINE-SIZE", expressions_1.Source);
|
|
15428
15433
|
const heading = (0, combi_1.str)("NO STANDARD PAGE HEADING");
|
|
15429
|
-
const line = (0, combi_1.seq)("LINE-COUNT", expressions_1.Source);
|
|
15434
|
+
const line = (0, combi_1.seq)("LINE-COUNT", expressions_1.Source, (0, combi_1.opt)(expressions_1.FieldLength));
|
|
15430
15435
|
const options = (0, combi_1.per)(message, size, heading, line);
|
|
15431
15436
|
const ret = (0, combi_1.seq)("PROGRAM", (0, combi_1.opt)(expressions_1.ReportName), (0, combi_1.opt)(options));
|
|
15432
15437
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
@@ -15648,7 +15653,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
15648
15653
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
15649
15654
|
class ReadDataset {
|
|
15650
15655
|
getMatcher() {
|
|
15651
|
-
const ret = (0, combi_1.seq)("READ DATASET", expressions_1.Source, "INTO", expressions_1.Target, (0, combi_1.opt)((0, combi_1.seq)("MAXIMUM LENGTH", expressions_1.Source)
|
|
15656
|
+
const ret = (0, combi_1.seq)("READ DATASET", expressions_1.Source, "INTO", expressions_1.Target, (0, combi_1.opt)((0, combi_1.per)((0, combi_1.seq)("MAXIMUM LENGTH", expressions_1.Source), (0, combi_1.seq)("ACTUAL LENGTH", expressions_1.Target), (0, combi_1.seq)("LENGTH", expressions_1.Target))));
|
|
15652
15657
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
15653
15658
|
}
|
|
15654
15659
|
}
|
|
@@ -15676,7 +15681,7 @@ class ReadEntities {
|
|
|
15676
15681
|
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
15677
15682
|
const fields = (0, combi_1.seq)("FIELDS", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.plus)(expressions_1.SimpleName), (0, combi_1.tok)(tokens_1.WParenRightW), "WITH", expressions_1.Source);
|
|
15678
15683
|
const all = (0, combi_1.seq)("ALL FIELDS WITH", expressions_1.Source);
|
|
15679
|
-
const s = (0, combi_1.seq)("READ ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, (0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.AssociationName)), (0, combi_1.alt)(fields, from, all), "RESULT", expressions_1.Target, (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("FAILED", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("REPORTED", expressions_1.Target)));
|
|
15684
|
+
const s = (0, combi_1.seq)("READ ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, (0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.AssociationName)), (0, combi_1.alt)(fields, from, all), (0, combi_1.optPrio)((0, combi_1.seq)("RESULT", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("FAILED", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.seq)("REPORTED", expressions_1.Target)));
|
|
15680
15685
|
return (0, combi_1.ver)(version_1.Version.v754, s);
|
|
15681
15686
|
}
|
|
15682
15687
|
}
|
|
@@ -16288,11 +16293,13 @@ class SelectionScreen {
|
|
|
16288
16293
|
const pos = (0, combi_1.seq)("POSITION", (0, combi_1.altPrio)(posIntegers, posSymbols), (0, combi_1.opt)((0, combi_1.seq)("FOR TABLE", expressions_1.Field)));
|
|
16289
16294
|
const incl = (0, combi_1.seq)("INCLUDE BLOCKS", expressions_1.BlockName);
|
|
16290
16295
|
const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.BlockName, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
|
|
16291
|
-
const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position));
|
|
16296
|
+
const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position), (0, combi_1.opt)(modif));
|
|
16292
16297
|
const param = (0, combi_1.seq)("INCLUDE PARAMETERS", expressions_1.Field);
|
|
16293
16298
|
const iso = (0, combi_1.seq)("INCLUDE SELECT-OPTIONS", expressions_1.Field);
|
|
16294
16299
|
const exclude = (0, combi_1.seq)("EXCLUDE", (0, combi_1.alt)("IDS", "PARAMETERS"), (0, combi_1.regex)(/^\w+$/));
|
|
16295
|
-
const
|
|
16300
|
+
const beginVersion = (0, combi_1.seq)("BEGIN OF VERSION", (0, combi_1.regex)(/^\w+$/), expressions_1.TextElement);
|
|
16301
|
+
const endVersion = (0, combi_1.seq)("END OF VERSION", (0, combi_1.regex)(/^\w+$/));
|
|
16302
|
+
const ret = (0, combi_1.seq)("SELECTION-SCREEN", (0, combi_1.altPrio)(comment, func, skip, pos, incl, iso, push, tab, uline, beginBlock, tabbed, endBlock, beginLine, endLine, param, beginScreen, endScreen, exclude, beginVersion, endVersion));
|
|
16296
16303
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
16297
16304
|
}
|
|
16298
16305
|
}
|
|
@@ -18105,7 +18112,7 @@ class Write {
|
|
|
18105
18112
|
const dateFormat = (0, combi_1.altPrio)("DD/MM/YY", "MM/DD/YY", "DD/MM/YYYY", "MM/DD/YYYY", "DDMMYY", "MMDDYY", "YYMMDD");
|
|
18106
18113
|
const as = (0, combi_1.seq)("AS", (0, combi_1.altPrio)("LINE", "ICON", "CHECKBOX", "SYMBOL"));
|
|
18107
18114
|
const to = (0, combi_1.seq)("TO", expressions_1.Target);
|
|
18108
|
-
const options = (0, combi_1.per)(mask, to, (0, combi_1.seq)("EXPONENT", expressions_1.Source), "NO-GROUPING", "NO-ZERO", "CENTERED", (0, combi_1.seq)("INPUT", (0, combi_1.opt)(onOff)), "NO-GAP", "LEFT-JUSTIFIED", as, (0, combi_1.seq)("FRAMES", onOff), (0, combi_1.seq)("HOTSPOT", (0, combi_1.opt)(onOff)), "RIGHT-JUSTIFIED", (0, combi_1.seq)("TIME ZONE", expressions_1.Source), (0, combi_1.seq)("UNDER", expressions_1.Source), (0, combi_1.seq)("STYLE", expressions_1.Source), (0, combi_1.seq)("ROUND", expressions_1.Source), (0, combi_1.seq)("QUICKINFO", expressions_1.Source), "ENVIRONMENT TIME FORMAT", dateFormat, (0, combi_1.seq)("UNIT", expressions_1.Source), (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(onOff)), (0, combi_1.seq)("INDEX", expressions_1.Source), (0, combi_1.seq)("DECIMALS", expressions_1.Source), (0, combi_1.seq)("INVERSE", (0, combi_1.opt)(onOff)), expressions_1.Color, (0, combi_1.seq)("CURRENCY", expressions_1.Source), "NO-SIGN");
|
|
18115
|
+
const options = (0, combi_1.per)(mask, to, (0, combi_1.seq)("EXPONENT", expressions_1.Source), "NO-GROUPING", "NO-ZERO", "CENTERED", (0, combi_1.seq)("INPUT", (0, combi_1.opt)(onOff)), "NO-GAP", "LEFT-JUSTIFIED", as, (0, combi_1.seq)("FRAMES", onOff), (0, combi_1.seq)("HOTSPOT", (0, combi_1.opt)(onOff)), "RIGHT-JUSTIFIED", (0, combi_1.seq)("TIME ZONE", expressions_1.Source), (0, combi_1.seq)("UNDER", expressions_1.Source), (0, combi_1.seq)("STYLE", expressions_1.Source), (0, combi_1.seq)("ROUND", expressions_1.Source), (0, combi_1.seq)("QUICKINFO", expressions_1.Source), "ENVIRONMENT TIME FORMAT", dateFormat, (0, combi_1.seq)("UNIT", expressions_1.Source), (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(onOff)), (0, combi_1.seq)("INDEX", expressions_1.Source), (0, combi_1.seq)("DECIMALS", expressions_1.Source), (0, combi_1.seq)("INVERSE", (0, combi_1.opt)(onOff)), expressions_1.Color, (0, combi_1.seq)("CURRENCY", expressions_1.Source), "RESET", "NO-SIGN");
|
|
18109
18116
|
const ret = (0, combi_1.seq)("WRITE", (0, combi_1.alt)("AT /", (0, combi_1.seq)((0, combi_1.opt)(expressions_1.WriteOffsetLength), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic, "/"), (0, combi_1.opt)(options))));
|
|
18110
18117
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
18111
18118
|
}
|
|
@@ -35362,13 +35369,13 @@ class FlowGraph {
|
|
|
35362
35369
|
this.label = label;
|
|
35363
35370
|
}
|
|
35364
35371
|
toDigraph() {
|
|
35365
|
-
return `digraph G {
|
|
35366
|
-
labelloc="t";
|
|
35367
|
-
label="${this.label}";
|
|
35368
|
-
graph [fontname = "helvetica"];
|
|
35369
|
-
node [fontname = "helvetica", shape="box"];
|
|
35370
|
-
edge [fontname = "helvetica"];
|
|
35371
|
-
${this.toTextEdges()}
|
|
35372
|
+
return `digraph G {
|
|
35373
|
+
labelloc="t";
|
|
35374
|
+
label="${this.label}";
|
|
35375
|
+
graph [fontname = "helvetica"];
|
|
35376
|
+
node [fontname = "helvetica", shape="box"];
|
|
35377
|
+
edge [fontname = "helvetica"];
|
|
35378
|
+
${this.toTextEdges()}
|
|
35372
35379
|
}`;
|
|
35373
35380
|
}
|
|
35374
35381
|
listSources(node) {
|
|
@@ -43787,13 +43794,13 @@ class Help {
|
|
|
43787
43794
|
/////////////////////////////////////////////////
|
|
43788
43795
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43789
43796
|
let content = "";
|
|
43790
|
-
content = `
|
|
43791
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43792
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43793
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43794
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43795
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43796
|
-
<hr>
|
|
43797
|
+
content = `
|
|
43798
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43799
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43800
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43801
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43802
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43803
|
+
<hr>
|
|
43797
43804
|
` +
|
|
43798
43805
|
"<tt>" + textDocument.uri + " (" +
|
|
43799
43806
|
(position.line + 1) + ", " +
|
|
@@ -43948,9 +43955,9 @@ class Help {
|
|
|
43948
43955
|
return ret + "</ul>";
|
|
43949
43956
|
}
|
|
43950
43957
|
static tokens(file) {
|
|
43951
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
43952
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
43953
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
43958
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
43959
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
43960
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
43954
43961
|
</tr>`;
|
|
43955
43962
|
for (const token of file.getTokens()) {
|
|
43956
43963
|
const tStart = token.getStart();
|
|
@@ -51613,7 +51620,7 @@ const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplin
|
|
|
51613
51620
|
var EnhancementCategory;
|
|
51614
51621
|
(function (EnhancementCategory) {
|
|
51615
51622
|
EnhancementCategory["NotClassified"] = "0";
|
|
51616
|
-
EnhancementCategory["
|
|
51623
|
+
EnhancementCategory["CannotBeEnhanced"] = "1";
|
|
51617
51624
|
EnhancementCategory["Character"] = "2";
|
|
51618
51625
|
EnhancementCategory["CharacterOrNumeric"] = "3";
|
|
51619
51626
|
EnhancementCategory["Deep"] = "4";
|
|
@@ -51718,8 +51725,11 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
51718
51725
|
if (field.GROUPNAME !== undefined) {
|
|
51719
51726
|
components.push({ name: field.GROUPNAME, type: found });
|
|
51720
51727
|
}
|
|
51721
|
-
|
|
51722
|
-
|
|
51728
|
+
if (field.FIELDNAME.startsWith(".INCLU-") === false
|
|
51729
|
+
|| field.FIELDNAME === ".INCLU--AP") {
|
|
51730
|
+
for (const c of found.getComponents()) {
|
|
51731
|
+
components.push({ name: c.name, type: c.type });
|
|
51732
|
+
}
|
|
51723
51733
|
}
|
|
51724
51734
|
}
|
|
51725
51735
|
else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith("CI_")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith("SI_")))
|
|
@@ -53202,7 +53212,7 @@ class Registry {
|
|
|
53202
53212
|
}
|
|
53203
53213
|
static abaplintVersion() {
|
|
53204
53214
|
// magic, see build script "version.sh"
|
|
53205
|
-
return "2.113.
|
|
53215
|
+
return "2.113.63";
|
|
53206
53216
|
}
|
|
53207
53217
|
getDDICReferences() {
|
|
53208
53218
|
return this.ddicReferences;
|
|
@@ -53521,10 +53531,10 @@ class SevenBitAscii {
|
|
|
53521
53531
|
key: "7bit_ascii",
|
|
53522
53532
|
title: "Check for 7bit ascii",
|
|
53523
53533
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53524
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53525
|
-
|
|
53526
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53527
|
-
|
|
53534
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53535
|
+
|
|
53536
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53537
|
+
|
|
53528
53538
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53529
53539
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53530
53540
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53730,10 +53740,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53730
53740
|
key: "abapdoc",
|
|
53731
53741
|
title: "Check abapdoc",
|
|
53732
53742
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53733
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53734
|
-
|
|
53735
|
-
Plus class and interface definitions.
|
|
53736
|
-
|
|
53743
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53744
|
+
|
|
53745
|
+
Plus class and interface definitions.
|
|
53746
|
+
|
|
53737
53747
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53738
53748
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53739
53749
|
};
|
|
@@ -53870,27 +53880,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53870
53880
|
title: "Add test attributes for tests classes with test methods",
|
|
53871
53881
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53872
53882
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53873
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53874
|
-
PUBLIC SECTION.
|
|
53875
|
-
PROTECTED SECTION.
|
|
53876
|
-
PRIVATE SECTION.
|
|
53877
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53878
|
-
ENDCLASS.
|
|
53879
|
-
|
|
53880
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53881
|
-
METHOD test.
|
|
53882
|
-
ENDMETHOD.
|
|
53883
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53884
|
+
PUBLIC SECTION.
|
|
53885
|
+
PROTECTED SECTION.
|
|
53886
|
+
PRIVATE SECTION.
|
|
53887
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53888
|
+
ENDCLASS.
|
|
53889
|
+
|
|
53890
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53891
|
+
METHOD test.
|
|
53892
|
+
ENDMETHOD.
|
|
53883
53893
|
ENDCLASS.`,
|
|
53884
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53885
|
-
PUBLIC SECTION.
|
|
53886
|
-
PROTECTED SECTION.
|
|
53887
|
-
PRIVATE SECTION.
|
|
53888
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53889
|
-
ENDCLASS.
|
|
53890
|
-
|
|
53891
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53892
|
-
METHOD test.
|
|
53893
|
-
ENDMETHOD.
|
|
53894
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53895
|
+
PUBLIC SECTION.
|
|
53896
|
+
PROTECTED SECTION.
|
|
53897
|
+
PRIVATE SECTION.
|
|
53898
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53899
|
+
ENDCLASS.
|
|
53900
|
+
|
|
53901
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53902
|
+
METHOD test.
|
|
53903
|
+
ENDMETHOD.
|
|
53894
53904
|
ENDCLASS.`,
|
|
53895
53905
|
};
|
|
53896
53906
|
}
|
|
@@ -53976,49 +53986,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53976
53986
|
key: "align_parameters",
|
|
53977
53987
|
title: "Align Parameters",
|
|
53978
53988
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53979
|
-
extendedInformation: `Checks:
|
|
53980
|
-
* function module calls
|
|
53981
|
-
* method calls
|
|
53982
|
-
* VALUE constructors
|
|
53983
|
-
* NEW constructors
|
|
53984
|
-
* RAISE EXCEPTION statements
|
|
53985
|
-
* CREATE OBJECT statements
|
|
53986
|
-
* RAISE EVENT statements
|
|
53987
|
-
|
|
53988
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53989
|
-
|
|
53990
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53991
|
-
|
|
53992
|
-
If parameters are on the same row, no issues are reported, see
|
|
53989
|
+
extendedInformation: `Checks:
|
|
53990
|
+
* function module calls
|
|
53991
|
+
* method calls
|
|
53992
|
+
* VALUE constructors
|
|
53993
|
+
* NEW constructors
|
|
53994
|
+
* RAISE EXCEPTION statements
|
|
53995
|
+
* CREATE OBJECT statements
|
|
53996
|
+
* RAISE EVENT statements
|
|
53997
|
+
|
|
53998
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53999
|
+
|
|
54000
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54001
|
+
|
|
54002
|
+
If parameters are on the same row, no issues are reported, see
|
|
53993
54003
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53994
54004
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53995
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53996
|
-
EXPORTING
|
|
53997
|
-
foo = 2
|
|
53998
|
-
parameter = 3.
|
|
53999
|
-
|
|
54000
|
-
foobar( moo = 1
|
|
54001
|
-
param = 1 ).
|
|
54002
|
-
|
|
54003
|
-
foo = VALUE #(
|
|
54004
|
-
foo = bar
|
|
54005
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54006
|
+
EXPORTING
|
|
54007
|
+
foo = 2
|
|
54008
|
+
parameter = 3.
|
|
54009
|
+
|
|
54010
|
+
foobar( moo = 1
|
|
54011
|
+
param = 1 ).
|
|
54012
|
+
|
|
54013
|
+
foo = VALUE #(
|
|
54014
|
+
foo = bar
|
|
54005
54015
|
moo = 2 ).`,
|
|
54006
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54007
|
-
EXPORTING
|
|
54008
|
-
foo = 2
|
|
54009
|
-
parameter = 3.
|
|
54010
|
-
|
|
54011
|
-
foobar( moo = 1
|
|
54012
|
-
param = 1 ).
|
|
54013
|
-
|
|
54014
|
-
foo = VALUE #(
|
|
54015
|
-
foo = bar
|
|
54016
|
-
moo = 2 ).
|
|
54017
|
-
|
|
54018
|
-
DATA(sdf) = VALUE type(
|
|
54019
|
-
common_val = 2
|
|
54020
|
-
another_common = 5
|
|
54021
|
-
( row_value = 4
|
|
54016
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54017
|
+
EXPORTING
|
|
54018
|
+
foo = 2
|
|
54019
|
+
parameter = 3.
|
|
54020
|
+
|
|
54021
|
+
foobar( moo = 1
|
|
54022
|
+
param = 1 ).
|
|
54023
|
+
|
|
54024
|
+
foo = VALUE #(
|
|
54025
|
+
foo = bar
|
|
54026
|
+
moo = 2 ).
|
|
54027
|
+
|
|
54028
|
+
DATA(sdf) = VALUE type(
|
|
54029
|
+
common_val = 2
|
|
54030
|
+
another_common = 5
|
|
54031
|
+
( row_value = 4
|
|
54022
54032
|
value_foo = 5 ) ).`,
|
|
54023
54033
|
};
|
|
54024
54034
|
}
|
|
@@ -54452,37 +54462,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54452
54462
|
key: "align_type_expressions",
|
|
54453
54463
|
title: "Align TYPE expressions",
|
|
54454
54464
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54455
|
-
extendedInformation: `
|
|
54456
|
-
Currently works for METHODS + BEGIN OF
|
|
54457
|
-
|
|
54458
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54459
|
-
|
|
54460
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54465
|
+
extendedInformation: `
|
|
54466
|
+
Currently works for METHODS + BEGIN OF
|
|
54467
|
+
|
|
54468
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54469
|
+
|
|
54470
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54461
54471
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54462
54472
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54463
|
-
badExample: `
|
|
54464
|
-
TYPES: BEGIN OF foo,
|
|
54465
|
-
bar TYPE i,
|
|
54466
|
-
foobar TYPE i,
|
|
54467
|
-
END OF foo.
|
|
54468
|
-
|
|
54469
|
-
INTERFACE lif.
|
|
54470
|
-
METHODS bar
|
|
54471
|
-
IMPORTING
|
|
54472
|
-
foo TYPE i
|
|
54473
|
-
foobar TYPE i.
|
|
54473
|
+
badExample: `
|
|
54474
|
+
TYPES: BEGIN OF foo,
|
|
54475
|
+
bar TYPE i,
|
|
54476
|
+
foobar TYPE i,
|
|
54477
|
+
END OF foo.
|
|
54478
|
+
|
|
54479
|
+
INTERFACE lif.
|
|
54480
|
+
METHODS bar
|
|
54481
|
+
IMPORTING
|
|
54482
|
+
foo TYPE i
|
|
54483
|
+
foobar TYPE i.
|
|
54474
54484
|
ENDINTERFACE.`,
|
|
54475
|
-
goodExample: `
|
|
54476
|
-
TYPES: BEGIN OF foo,
|
|
54477
|
-
bar TYPE i,
|
|
54478
|
-
foobar TYPE i,
|
|
54479
|
-
END OF foo.
|
|
54480
|
-
|
|
54481
|
-
INTERFACE lif.
|
|
54482
|
-
METHODS bar
|
|
54483
|
-
IMPORTING
|
|
54484
|
-
foo TYPE i
|
|
54485
|
-
foobar TYPE i.
|
|
54485
|
+
goodExample: `
|
|
54486
|
+
TYPES: BEGIN OF foo,
|
|
54487
|
+
bar TYPE i,
|
|
54488
|
+
foobar TYPE i,
|
|
54489
|
+
END OF foo.
|
|
54490
|
+
|
|
54491
|
+
INTERFACE lif.
|
|
54492
|
+
METHODS bar
|
|
54493
|
+
IMPORTING
|
|
54494
|
+
foo TYPE i
|
|
54495
|
+
foobar TYPE i.
|
|
54486
54496
|
ENDINTERFACE.`,
|
|
54487
54497
|
};
|
|
54488
54498
|
}
|
|
@@ -54761,16 +54771,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54761
54771
|
return {
|
|
54762
54772
|
key: "ambiguous_statement",
|
|
54763
54773
|
title: "Check for ambigious statements",
|
|
54764
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54765
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54766
|
-
|
|
54774
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54775
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54776
|
+
|
|
54767
54777
|
Only works if the target version is 740sp05 or above`,
|
|
54768
54778
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54769
|
-
badExample: `DELETE foo FROM bar.
|
|
54779
|
+
badExample: `DELETE foo FROM bar.
|
|
54770
54780
|
MODIFY foo FROM bar.`,
|
|
54771
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54772
|
-
DELETE TABLE itab FROM 2.
|
|
54773
|
-
MODIFY zfoo FROM @wa.
|
|
54781
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54782
|
+
DELETE TABLE itab FROM 2.
|
|
54783
|
+
MODIFY zfoo FROM @wa.
|
|
54774
54784
|
MODIFY TABLE foo FROM bar.`,
|
|
54775
54785
|
};
|
|
54776
54786
|
}
|
|
@@ -54875,16 +54885,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54875
54885
|
key: "avoid_use",
|
|
54876
54886
|
title: "Avoid use of certain statements",
|
|
54877
54887
|
shortDescription: `Detects usage of certain statements.`,
|
|
54878
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54879
|
-
|
|
54880
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54881
|
-
|
|
54882
|
-
STATICS: use CLASS-DATA instead
|
|
54883
|
-
|
|
54884
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54885
|
-
|
|
54886
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54887
|
-
|
|
54888
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54889
|
+
|
|
54890
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54891
|
+
|
|
54892
|
+
STATICS: use CLASS-DATA instead
|
|
54893
|
+
|
|
54894
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54895
|
+
|
|
54896
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54897
|
+
|
|
54888
54898
|
BREAK points`,
|
|
54889
54899
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54890
54900
|
};
|
|
@@ -55016,11 +55026,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
55016
55026
|
title: "Check BEGIN END names",
|
|
55017
55027
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
55018
55028
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55019
|
-
badExample: `DATA: BEGIN OF stru,
|
|
55020
|
-
field TYPE i,
|
|
55029
|
+
badExample: `DATA: BEGIN OF stru,
|
|
55030
|
+
field TYPE i,
|
|
55021
55031
|
END OF structure_not_the_same.`,
|
|
55022
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
55023
|
-
field TYPE i,
|
|
55032
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
55033
|
+
field TYPE i,
|
|
55024
55034
|
END OF stru.`,
|
|
55025
55035
|
};
|
|
55026
55036
|
}
|
|
@@ -55117,20 +55127,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
55117
55127
|
title: "BEGIN contains single INCLUDE",
|
|
55118
55128
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
55119
55129
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55120
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
55121
|
-
INCLUDE TYPE dselc.
|
|
55122
|
-
TYPES: END OF dummy1.
|
|
55123
|
-
|
|
55124
|
-
DATA BEGIN OF foo.
|
|
55125
|
-
INCLUDE STRUCTURE syst.
|
|
55126
|
-
DATA END OF foo.
|
|
55127
|
-
|
|
55128
|
-
STATICS BEGIN OF bar.
|
|
55129
|
-
INCLUDE STRUCTURE syst.
|
|
55130
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
55131
|
+
INCLUDE TYPE dselc.
|
|
55132
|
+
TYPES: END OF dummy1.
|
|
55133
|
+
|
|
55134
|
+
DATA BEGIN OF foo.
|
|
55135
|
+
INCLUDE STRUCTURE syst.
|
|
55136
|
+
DATA END OF foo.
|
|
55137
|
+
|
|
55138
|
+
STATICS BEGIN OF bar.
|
|
55139
|
+
INCLUDE STRUCTURE syst.
|
|
55130
55140
|
STATICS END OF bar.`,
|
|
55131
|
-
goodExample: `DATA BEGIN OF foo.
|
|
55132
|
-
DATA field TYPE i.
|
|
55133
|
-
INCLUDE STRUCTURE dselc.
|
|
55141
|
+
goodExample: `DATA BEGIN OF foo.
|
|
55142
|
+
DATA field TYPE i.
|
|
55143
|
+
INCLUDE STRUCTURE dselc.
|
|
55134
55144
|
DATA END OF foo.`,
|
|
55135
55145
|
};
|
|
55136
55146
|
}
|
|
@@ -55220,9 +55230,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
55220
55230
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
55221
55231
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55222
55232
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
55223
|
-
goodExample: `TRY.
|
|
55224
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55225
|
-
CATCH cx_sy_authorization_error.
|
|
55233
|
+
goodExample: `TRY.
|
|
55234
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55235
|
+
CATCH cx_sy_authorization_error.
|
|
55226
55236
|
ENDTRY.`,
|
|
55227
55237
|
};
|
|
55228
55238
|
}
|
|
@@ -55287,10 +55297,10 @@ class CDSCommentStyle {
|
|
|
55287
55297
|
key: "cds_comment_style",
|
|
55288
55298
|
title: "CDS Comment Style",
|
|
55289
55299
|
shortDescription: `Check for obsolete comment style`,
|
|
55290
|
-
extendedInformation: `Check for obsolete comment style
|
|
55291
|
-
|
|
55292
|
-
Comments starting with "--" are considered obsolete
|
|
55293
|
-
|
|
55300
|
+
extendedInformation: `Check for obsolete comment style
|
|
55301
|
+
|
|
55302
|
+
Comments starting with "--" are considered obsolete
|
|
55303
|
+
|
|
55294
55304
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
55295
55305
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55296
55306
|
badExample: "-- this is a comment",
|
|
@@ -55356,10 +55366,10 @@ class CDSLegacyView {
|
|
|
55356
55366
|
key: "cds_legacy_view",
|
|
55357
55367
|
title: "CDS Legacy View",
|
|
55358
55368
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55359
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55360
|
-
|
|
55361
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55362
|
-
|
|
55369
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55370
|
+
|
|
55371
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55372
|
+
|
|
55363
55373
|
v755 and up`,
|
|
55364
55374
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55365
55375
|
};
|
|
@@ -55514,10 +55524,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55514
55524
|
key: "chain_mainly_declarations",
|
|
55515
55525
|
title: "Chain mainly declarations",
|
|
55516
55526
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55517
|
-
extendedInformation: `
|
|
55518
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55519
|
-
|
|
55520
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55527
|
+
extendedInformation: `
|
|
55528
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55529
|
+
|
|
55530
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55521
55531
|
`,
|
|
55522
55532
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55523
55533
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55693,17 +55703,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55693
55703
|
title: "Change IF to CASE",
|
|
55694
55704
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55695
55705
|
// eslint-disable-next-line max-len
|
|
55696
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55697
|
-
|
|
55706
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55707
|
+
|
|
55698
55708
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55699
55709
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55700
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55701
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55702
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55710
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55711
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55712
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55703
55713
|
ENDIF.`,
|
|
55704
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55705
|
-
WHEN 'FOO'.
|
|
55706
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55714
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55715
|
+
WHEN 'FOO'.
|
|
55716
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55707
55717
|
ENDCASE.`,
|
|
55708
55718
|
};
|
|
55709
55719
|
}
|
|
@@ -55840,8 +55850,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55840
55850
|
return {
|
|
55841
55851
|
key: "check_abstract",
|
|
55842
55852
|
title: "Check abstract methods and classes",
|
|
55843
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55844
|
-
- class defined as abstract and final,
|
|
55853
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55854
|
+
- class defined as abstract and final,
|
|
55845
55855
|
- non-abstract class contains abstract methods`,
|
|
55846
55856
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55847
55857
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55922,11 +55932,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55922
55932
|
return {
|
|
55923
55933
|
key: "check_comments",
|
|
55924
55934
|
title: "Check Comments",
|
|
55925
|
-
shortDescription: `
|
|
55935
|
+
shortDescription: `
|
|
55926
55936
|
Various checks for comment usage.`,
|
|
55927
|
-
extendedInformation: `
|
|
55928
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55929
|
-
|
|
55937
|
+
extendedInformation: `
|
|
55938
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55939
|
+
|
|
55930
55940
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55931
55941
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55932
55942
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -56088,9 +56098,9 @@ class CheckInclude {
|
|
|
56088
56098
|
key: "check_include",
|
|
56089
56099
|
title: "Check INCLUDEs",
|
|
56090
56100
|
shortDescription: `Checks INCLUDE statements`,
|
|
56091
|
-
extendedInformation: `
|
|
56092
|
-
* Reports unused includes
|
|
56093
|
-
* Errors if the includes are not found
|
|
56101
|
+
extendedInformation: `
|
|
56102
|
+
* Reports unused includes
|
|
56103
|
+
* Errors if the includes are not found
|
|
56094
56104
|
* Error if including a main program`,
|
|
56095
56105
|
tags: [_irule_1.RuleTag.Syntax],
|
|
56096
56106
|
};
|
|
@@ -56166,14 +56176,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
56166
56176
|
key: "check_subrc",
|
|
56167
56177
|
title: "Check sy-subrc",
|
|
56168
56178
|
shortDescription: `Check sy-subrc`,
|
|
56169
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56170
|
-
|
|
56171
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56172
|
-
|
|
56173
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56174
|
-
|
|
56175
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56176
|
-
|
|
56179
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56180
|
+
|
|
56181
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56182
|
+
|
|
56183
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56184
|
+
|
|
56185
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56186
|
+
|
|
56177
56187
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
56178
56188
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56179
56189
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56743,17 +56753,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56743
56753
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56744
56754
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56745
56755
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56746
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56747
|
-
EXCEPTIONS
|
|
56748
|
-
system_failure = 1 MESSAGE lv_message
|
|
56749
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56750
|
-
resource_failure = 1
|
|
56756
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56757
|
+
EXCEPTIONS
|
|
56758
|
+
system_failure = 1 MESSAGE lv_message
|
|
56759
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56760
|
+
resource_failure = 1
|
|
56751
56761
|
OTHERS = 1.`,
|
|
56752
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56753
|
-
EXCEPTIONS
|
|
56754
|
-
system_failure = 1 MESSAGE lv_message
|
|
56755
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56756
|
-
resource_failure = 3
|
|
56762
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56763
|
+
EXCEPTIONS
|
|
56764
|
+
system_failure = 1 MESSAGE lv_message
|
|
56765
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56766
|
+
resource_failure = 3
|
|
56757
56767
|
OTHERS = 4.`,
|
|
56758
56768
|
};
|
|
56759
56769
|
}
|
|
@@ -56999,7 +57009,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56999
57009
|
key: "commented_code",
|
|
57000
57010
|
title: "Find commented code",
|
|
57001
57011
|
shortDescription: `Detects usage of commented out code.`,
|
|
57002
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57012
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57003
57013
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
57004
57014
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
57005
57015
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -57232,10 +57242,10 @@ class ConstructorVisibilityPublic {
|
|
|
57232
57242
|
key: "constructor_visibility_public",
|
|
57233
57243
|
title: "Check constructor visibility is public",
|
|
57234
57244
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
57235
|
-
extendedInformation: `
|
|
57236
|
-
This only applies to global classes.
|
|
57237
|
-
|
|
57238
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57245
|
+
extendedInformation: `
|
|
57246
|
+
This only applies to global classes.
|
|
57247
|
+
|
|
57248
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57239
57249
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
57240
57250
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57241
57251
|
};
|
|
@@ -57310,8 +57320,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
57310
57320
|
key: "contains_tab",
|
|
57311
57321
|
title: "Code contains tab",
|
|
57312
57322
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
57313
|
-
extendedInformation: `
|
|
57314
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57323
|
+
extendedInformation: `
|
|
57324
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
57315
57325
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
57316
57326
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57317
57327
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57398,10 +57408,10 @@ class CyclicOO {
|
|
|
57398
57408
|
key: "cyclic_oo",
|
|
57399
57409
|
title: "Cyclic OO",
|
|
57400
57410
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57401
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57402
|
-
|
|
57403
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57404
|
-
|
|
57411
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57412
|
+
|
|
57413
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57414
|
+
|
|
57405
57415
|
References in testclass includes are ignored`,
|
|
57406
57416
|
};
|
|
57407
57417
|
}
|
|
@@ -57644,7 +57654,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57644
57654
|
key: "dangerous_statement",
|
|
57645
57655
|
title: "Dangerous statement",
|
|
57646
57656
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57647
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57657
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57648
57658
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57649
57659
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57650
57660
|
};
|
|
@@ -57851,13 +57861,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57851
57861
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57852
57862
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57853
57863
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57854
|
-
badExample: `FROM foo.
|
|
57855
|
-
WRITE 'hello'.
|
|
57856
|
-
DATA int TYPE i.
|
|
57864
|
+
badExample: `FROM foo.
|
|
57865
|
+
WRITE 'hello'.
|
|
57866
|
+
DATA int TYPE i.
|
|
57857
57867
|
ENDFORM.`,
|
|
57858
|
-
goodExample: `FROM foo.
|
|
57859
|
-
DATA int TYPE i.
|
|
57860
|
-
WRITE 'hello'.
|
|
57868
|
+
goodExample: `FROM foo.
|
|
57869
|
+
DATA int TYPE i.
|
|
57870
|
+
WRITE 'hello'.
|
|
57861
57871
|
ENDFORM.`,
|
|
57862
57872
|
};
|
|
57863
57873
|
}
|
|
@@ -58396,39 +58406,39 @@ class Downport {
|
|
|
58396
58406
|
key: "downport",
|
|
58397
58407
|
title: "Downport statement",
|
|
58398
58408
|
shortDescription: `Downport functionality`,
|
|
58399
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58400
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58401
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58402
|
-
|
|
58403
|
-
Current rules:
|
|
58404
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58405
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58406
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58407
|
-
* CONV is outlined
|
|
58408
|
-
* COND is outlined
|
|
58409
|
-
* REDUCE is outlined
|
|
58410
|
-
* SWITCH is outlined
|
|
58411
|
-
* FILTER is outlined
|
|
58412
|
-
* APPEND expression is outlined
|
|
58413
|
-
* INSERT expression is outlined
|
|
58414
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58415
|
-
* CAST changed to ?=
|
|
58416
|
-
* LOOP AT method_call( ) is outlined
|
|
58417
|
-
* VALUE # with structure fields
|
|
58418
|
-
* VALUE # with internal table lines
|
|
58419
|
-
* Table Expressions are outlined
|
|
58420
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58421
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58422
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58423
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58424
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58425
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58426
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58427
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58428
|
-
* MESSAGE with non simple source
|
|
58429
|
-
|
|
58430
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58431
|
-
|
|
58409
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58410
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58411
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58412
|
+
|
|
58413
|
+
Current rules:
|
|
58414
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58415
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58416
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58417
|
+
* CONV is outlined
|
|
58418
|
+
* COND is outlined
|
|
58419
|
+
* REDUCE is outlined
|
|
58420
|
+
* SWITCH is outlined
|
|
58421
|
+
* FILTER is outlined
|
|
58422
|
+
* APPEND expression is outlined
|
|
58423
|
+
* INSERT expression is outlined
|
|
58424
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58425
|
+
* CAST changed to ?=
|
|
58426
|
+
* LOOP AT method_call( ) is outlined
|
|
58427
|
+
* VALUE # with structure fields
|
|
58428
|
+
* VALUE # with internal table lines
|
|
58429
|
+
* Table Expressions are outlined
|
|
58430
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58431
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58432
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58433
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58434
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58435
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58436
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58437
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58438
|
+
* MESSAGE with non simple source
|
|
58439
|
+
|
|
58440
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58441
|
+
|
|
58432
58442
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58433
58443
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58434
58444
|
};
|
|
@@ -59006,10 +59016,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
59006
59016
|
const fieldName = f.concatTokens();
|
|
59007
59017
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
59008
59018
|
}
|
|
59009
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59019
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59010
59020
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
59011
59021
|
}
|
|
59012
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59022
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59013
59023
|
${indentation}`);
|
|
59014
59024
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
59015
59025
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59068,12 +59078,12 @@ ${indentation}`);
|
|
|
59068
59078
|
}
|
|
59069
59079
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59070
59080
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
59071
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59072
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59073
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59081
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59082
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59083
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59074
59084
|
${indentation}`);
|
|
59075
59085
|
if (fieldDefinitions === "") {
|
|
59076
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59086
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59077
59087
|
${indentation}`);
|
|
59078
59088
|
}
|
|
59079
59089
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -59141,7 +59151,7 @@ ${indentation}`);
|
|
|
59141
59151
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59142
59152
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59143
59153
|
const firstToken = high.getFirstToken();
|
|
59144
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59154
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59145
59155
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59146
59156
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59147
59157
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59195,7 +59205,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59195
59205
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59196
59206
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59197
59207
|
const firstToken = high.getFirstToken();
|
|
59198
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59208
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59199
59209
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59200
59210
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59201
59211
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59237,14 +59247,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59237
59247
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59238
59248
|
const firstToken = high.getFirstToken();
|
|
59239
59249
|
// note that the tabix restore should be done before throwing the exception
|
|
59240
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59241
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59242
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59243
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59244
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59245
|
-
${indentation}IF sy-subrc <> 0.
|
|
59246
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59247
|
-
${indentation}ENDIF.
|
|
59250
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59251
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59252
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59253
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59254
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59255
|
+
${indentation}IF sy-subrc <> 0.
|
|
59256
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59257
|
+
${indentation}ENDIF.
|
|
59248
59258
|
${indentation}`);
|
|
59249
59259
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
59250
59260
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59301,7 +59311,7 @@ ${indentation}`);
|
|
|
59301
59311
|
const className = classNames[0].concatTokens();
|
|
59302
59312
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59303
59313
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59304
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59314
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59305
59315
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
59306
59316
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
59307
59317
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59463,16 +59473,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59463
59473
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59464
59474
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59465
59475
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59466
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59467
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59476
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59477
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59468
59478
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59469
59479
|
if (withs.length > 0) {
|
|
59470
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59471
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59472
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59480
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59481
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59482
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59473
59483
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59474
59484
|
}
|
|
59475
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59485
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59476
59486
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59477
59487
|
if (withs.length > 0) {
|
|
59478
59488
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59584,10 +59594,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59584
59594
|
let code = "";
|
|
59585
59595
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59586
59596
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59587
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59588
|
-
IF sy-subrc <> 0.
|
|
59589
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59590
|
-
ENDIF.
|
|
59597
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59598
|
+
IF sy-subrc <> 0.
|
|
59599
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59600
|
+
ENDIF.
|
|
59591
59601
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59592
59602
|
}
|
|
59593
59603
|
else {
|
|
@@ -59676,20 +59686,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59676
59686
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59677
59687
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59678
59688
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59679
|
-
code += ` items LIKE ${loopSourceName},
|
|
59680
|
-
END OF ${groupTargetName}type.
|
|
59681
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59682
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59689
|
+
code += ` items LIKE ${loopSourceName},
|
|
59690
|
+
END OF ${groupTargetName}type.
|
|
59691
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59692
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59683
59693
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59684
59694
|
if (groupIndexName !== undefined) {
|
|
59685
59695
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59686
59696
|
}
|
|
59687
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59697
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59688
59698
|
IF sy-subrc = 0.\n`;
|
|
59689
59699
|
if (groupCountName !== undefined) {
|
|
59690
59700
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59691
59701
|
}
|
|
59692
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59702
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59693
59703
|
ELSE.\n`;
|
|
59694
59704
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59695
59705
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59710,8 +59720,8 @@ ELSE.\n`;
|
|
|
59710
59720
|
}
|
|
59711
59721
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59712
59722
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59713
|
-
code += `ENDIF.
|
|
59714
|
-
ENDLOOP.
|
|
59723
|
+
code += `ENDIF.
|
|
59724
|
+
ENDLOOP.
|
|
59715
59725
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59716
59726
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59717
59727
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59883,7 +59893,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59883
59893
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59884
59894
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59885
59895
|
// all ENUMS are char like?
|
|
59886
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59896
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59887
59897
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59888
59898
|
let count = 1;
|
|
59889
59899
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59927,14 +59937,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59927
59937
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59928
59938
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59929
59939
|
// restore tabix before exeption
|
|
59930
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59931
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59932
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59933
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59934
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59935
|
-
${indentation}IF sy-subrc <> 0.
|
|
59936
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59937
|
-
${indentation}ENDIF.
|
|
59940
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59941
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59942
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59943
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59944
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59945
|
+
${indentation}IF sy-subrc <> 0.
|
|
59946
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59947
|
+
${indentation}ENDIF.
|
|
59938
59948
|
${indentation}${uniqueName}`;
|
|
59939
59949
|
const start = target.getFirstToken().getStart();
|
|
59940
59950
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -60014,11 +60024,11 @@ ${indentation}${uniqueName}`;
|
|
|
60014
60024
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60015
60025
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60016
60026
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60017
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
60018
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
60019
|
-
${indentation} EXPORTING
|
|
60020
|
-
${indentation} input = ${source}
|
|
60021
|
-
${indentation} IMPORTING
|
|
60027
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
60028
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
60029
|
+
${indentation} EXPORTING
|
|
60030
|
+
${indentation} input = ${source}
|
|
60031
|
+
${indentation} IMPORTING
|
|
60022
60032
|
${indentation} output = ${uniqueName}.\n`;
|
|
60023
60033
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
60024
60034
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -61330,12 +61340,12 @@ class EasyToFindMessages {
|
|
|
61330
61340
|
key: "easy_to_find_messages",
|
|
61331
61341
|
title: "Easy to find messages",
|
|
61332
61342
|
shortDescription: `Make messages easy to find`,
|
|
61333
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
61334
|
-
|
|
61335
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
61336
|
-
|
|
61337
|
-
Also see rule "message_exists"
|
|
61338
|
-
|
|
61343
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61344
|
+
|
|
61345
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61346
|
+
|
|
61347
|
+
Also see rule "message_exists"
|
|
61348
|
+
|
|
61339
61349
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61340
61350
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61341
61351
|
};
|
|
@@ -61416,13 +61426,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61416
61426
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61417
61427
|
extendedInformation: ``,
|
|
61418
61428
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61419
|
-
badExample: `
|
|
61420
|
-
INITIALIZATION.
|
|
61421
|
-
WRITE 'hello'.
|
|
61429
|
+
badExample: `
|
|
61430
|
+
INITIALIZATION.
|
|
61431
|
+
WRITE 'hello'.
|
|
61422
61432
|
END-OF-SELECTION.`,
|
|
61423
|
-
goodExample: `
|
|
61424
|
-
START-OF-SELECTION.
|
|
61425
|
-
PERFORM sdf.
|
|
61433
|
+
goodExample: `
|
|
61434
|
+
START-OF-SELECTION.
|
|
61435
|
+
PERFORM sdf.
|
|
61426
61436
|
COMMIT WORK.`,
|
|
61427
61437
|
};
|
|
61428
61438
|
}
|
|
@@ -61514,8 +61524,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61514
61524
|
key: "empty_line_in_statement",
|
|
61515
61525
|
title: "Find empty lines in statements",
|
|
61516
61526
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61517
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61518
|
-
|
|
61527
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61528
|
+
|
|
61519
61529
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61520
61530
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61521
61531
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61691,13 +61701,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61691
61701
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61692
61702
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61693
61703
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61694
|
-
badExample: `IF foo = bar.
|
|
61695
|
-
ENDIF.
|
|
61696
|
-
|
|
61697
|
-
DO 2 TIMES.
|
|
61704
|
+
badExample: `IF foo = bar.
|
|
61705
|
+
ENDIF.
|
|
61706
|
+
|
|
61707
|
+
DO 2 TIMES.
|
|
61698
61708
|
ENDDO.`,
|
|
61699
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61700
|
-
ENDLOOP.
|
|
61709
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61710
|
+
ENDLOOP.
|
|
61701
61711
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61702
61712
|
};
|
|
61703
61713
|
}
|
|
@@ -61839,10 +61849,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61839
61849
|
return {
|
|
61840
61850
|
key: "exit_or_check",
|
|
61841
61851
|
title: "Find EXIT or CHECK outside loops",
|
|
61842
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61852
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61843
61853
|
Use RETURN to leave procesing blocks instead.`,
|
|
61844
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61845
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61854
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61855
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61846
61856
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61847
61857
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61848
61858
|
};
|
|
@@ -61925,12 +61935,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61925
61935
|
key: "expand_macros",
|
|
61926
61936
|
title: "Expand Macros",
|
|
61927
61937
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61928
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61929
|
-
|
|
61938
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61939
|
+
|
|
61930
61940
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61931
|
-
badExample: `DEFINE _hello.
|
|
61932
|
-
WRITE 'hello'.
|
|
61933
|
-
END-OF-DEFINITION.
|
|
61941
|
+
badExample: `DEFINE _hello.
|
|
61942
|
+
WRITE 'hello'.
|
|
61943
|
+
END-OF-DEFINITION.
|
|
61934
61944
|
_hello.`,
|
|
61935
61945
|
goodExample: `WRITE 'hello'.`,
|
|
61936
61946
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -62017,7 +62027,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
62017
62027
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
62018
62028
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
62019
62029
|
goodExample: `call_method( foo = bar ).`,
|
|
62020
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62030
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62021
62031
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
62022
62032
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62023
62033
|
};
|
|
@@ -62115,7 +62125,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
62115
62125
|
key: "forbidden_identifier",
|
|
62116
62126
|
title: "Forbidden Identifier",
|
|
62117
62127
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
62118
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62128
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62119
62129
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
62120
62130
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62121
62131
|
};
|
|
@@ -62357,8 +62367,8 @@ class ForbiddenVoidType {
|
|
|
62357
62367
|
key: "forbidden_void_type",
|
|
62358
62368
|
title: "Forbidden Void Types",
|
|
62359
62369
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62360
|
-
extendedInformation: `Inspiration:
|
|
62361
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62370
|
+
extendedInformation: `Inspiration:
|
|
62371
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62362
62372
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62363
62373
|
};
|
|
62364
62374
|
}
|
|
@@ -62601,9 +62611,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62601
62611
|
key: "fully_type_itabs",
|
|
62602
62612
|
title: "Fully type internal tables",
|
|
62603
62613
|
shortDescription: `No implict table types or table keys`,
|
|
62604
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62614
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62605
62615
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62606
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62616
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62607
62617
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62608
62618
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62609
62619
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62788,26 +62798,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62788
62798
|
key: "functional_writing",
|
|
62789
62799
|
title: "Use functional writing",
|
|
62790
62800
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62791
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62801
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62792
62802
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62793
62803
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62794
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62795
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62796
|
-
EXPORTING
|
|
62797
|
-
p_name = 'NAME'
|
|
62798
|
-
RECEIVING
|
|
62799
|
-
p_descr_ref = lr_typedescr
|
|
62800
|
-
EXCEPTIONS
|
|
62801
|
-
type_not_found = 1
|
|
62804
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62805
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62806
|
+
EXPORTING
|
|
62807
|
+
p_name = 'NAME'
|
|
62808
|
+
RECEIVING
|
|
62809
|
+
p_descr_ref = lr_typedescr
|
|
62810
|
+
EXCEPTIONS
|
|
62811
|
+
type_not_found = 1
|
|
62802
62812
|
OTHERS = 2.`,
|
|
62803
|
-
goodExample: `zcl_class=>method( ).
|
|
62804
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62805
|
-
EXPORTING
|
|
62806
|
-
p_name = 'NAME'
|
|
62807
|
-
RECEIVING
|
|
62808
|
-
p_descr_ref = lr_typedescr
|
|
62809
|
-
EXCEPTIONS
|
|
62810
|
-
type_not_found = 1
|
|
62813
|
+
goodExample: `zcl_class=>method( ).
|
|
62814
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62815
|
+
EXPORTING
|
|
62816
|
+
p_name = 'NAME'
|
|
62817
|
+
RECEIVING
|
|
62818
|
+
p_descr_ref = lr_typedescr
|
|
62819
|
+
EXCEPTIONS
|
|
62820
|
+
type_not_found = 1
|
|
62811
62821
|
OTHERS = 2 ).`,
|
|
62812
62822
|
};
|
|
62813
62823
|
}
|
|
@@ -62918,14 +62928,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62918
62928
|
key: "global_class",
|
|
62919
62929
|
title: "Global class checks",
|
|
62920
62930
|
shortDescription: `Checks related to global classes`,
|
|
62921
|
-
extendedInformation: `* global classes must be in own files
|
|
62922
|
-
|
|
62923
|
-
* file names must match class name
|
|
62924
|
-
|
|
62925
|
-
* file names must match interface name
|
|
62926
|
-
|
|
62927
|
-
* global classes must be global definitions
|
|
62928
|
-
|
|
62931
|
+
extendedInformation: `* global classes must be in own files
|
|
62932
|
+
|
|
62933
|
+
* file names must match class name
|
|
62934
|
+
|
|
62935
|
+
* file names must match interface name
|
|
62936
|
+
|
|
62937
|
+
* global classes must be global definitions
|
|
62938
|
+
|
|
62929
62939
|
* global interfaces must be global definitions`,
|
|
62930
62940
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62931
62941
|
};
|
|
@@ -63024,21 +63034,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
63024
63034
|
return {
|
|
63025
63035
|
key: "identical_conditions",
|
|
63026
63036
|
title: "Identical conditions",
|
|
63027
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63028
|
-
|
|
63037
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63038
|
+
|
|
63029
63039
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
63030
63040
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63031
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63032
|
-
ENDIF.
|
|
63033
|
-
CASE bar.
|
|
63034
|
-
WHEN '1'.
|
|
63035
|
-
WHEN 'A' OR '1'.
|
|
63041
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63042
|
+
ENDIF.
|
|
63043
|
+
CASE bar.
|
|
63044
|
+
WHEN '1'.
|
|
63045
|
+
WHEN 'A' OR '1'.
|
|
63036
63046
|
ENDCASE.`,
|
|
63037
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
63038
|
-
ENDIF.
|
|
63039
|
-
CASE bar.
|
|
63040
|
-
WHEN '1'.
|
|
63041
|
-
WHEN 'A'.
|
|
63047
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
63048
|
+
ENDIF.
|
|
63049
|
+
CASE bar.
|
|
63050
|
+
WHEN '1'.
|
|
63051
|
+
WHEN 'A'.
|
|
63042
63052
|
ENDCASE.`,
|
|
63043
63053
|
};
|
|
63044
63054
|
}
|
|
@@ -63172,23 +63182,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
63172
63182
|
key: "identical_contents",
|
|
63173
63183
|
title: "Identical contents",
|
|
63174
63184
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
63175
|
-
extendedInformation: `
|
|
63176
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
63177
|
-
|
|
63185
|
+
extendedInformation: `
|
|
63186
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
63187
|
+
|
|
63178
63188
|
Chained statments are ignored`,
|
|
63179
63189
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63180
|
-
badExample: `IF foo = bar.
|
|
63181
|
-
WRITE 'bar'.
|
|
63182
|
-
WRITE 'world'.
|
|
63183
|
-
ELSE.
|
|
63184
|
-
WRITE 'foo'.
|
|
63185
|
-
WRITE 'world'.
|
|
63190
|
+
badExample: `IF foo = bar.
|
|
63191
|
+
WRITE 'bar'.
|
|
63192
|
+
WRITE 'world'.
|
|
63193
|
+
ELSE.
|
|
63194
|
+
WRITE 'foo'.
|
|
63195
|
+
WRITE 'world'.
|
|
63186
63196
|
ENDIF.`,
|
|
63187
|
-
goodExample: `IF foo = bar.
|
|
63188
|
-
WRITE 'bar'.
|
|
63189
|
-
ELSE.
|
|
63190
|
-
WRITE 'foo'.
|
|
63191
|
-
ENDIF.
|
|
63197
|
+
goodExample: `IF foo = bar.
|
|
63198
|
+
WRITE 'bar'.
|
|
63199
|
+
ELSE.
|
|
63200
|
+
WRITE 'foo'.
|
|
63201
|
+
ENDIF.
|
|
63192
63202
|
WRITE 'world'.`,
|
|
63193
63203
|
};
|
|
63194
63204
|
}
|
|
@@ -63296,12 +63306,12 @@ class IdenticalDescriptions {
|
|
|
63296
63306
|
key: "identical_descriptions",
|
|
63297
63307
|
title: "Identical descriptions",
|
|
63298
63308
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
63299
|
-
extendedInformation: `Case insensitive
|
|
63300
|
-
|
|
63301
|
-
Only checks the master language descriptions
|
|
63302
|
-
|
|
63303
|
-
Dependencies are skipped
|
|
63304
|
-
|
|
63309
|
+
extendedInformation: `Case insensitive
|
|
63310
|
+
|
|
63311
|
+
Only checks the master language descriptions
|
|
63312
|
+
|
|
63313
|
+
Dependencies are skipped
|
|
63314
|
+
|
|
63305
63315
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
63306
63316
|
tags: [],
|
|
63307
63317
|
};
|
|
@@ -63475,43 +63485,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63475
63485
|
key: "if_in_if",
|
|
63476
63486
|
title: "IF in IF",
|
|
63477
63487
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63478
|
-
extendedInformation: `
|
|
63479
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63480
|
-
|
|
63481
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63482
|
-
|
|
63483
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63488
|
+
extendedInformation: `
|
|
63489
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63490
|
+
|
|
63491
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63492
|
+
|
|
63493
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63484
63494
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63485
|
-
badExample: `IF condition1.
|
|
63486
|
-
IF condition2.
|
|
63487
|
-
...
|
|
63488
|
-
ENDIF.
|
|
63489
|
-
ENDIF.
|
|
63490
|
-
|
|
63491
|
-
IF condition1.
|
|
63492
|
-
...
|
|
63493
|
-
ELSE.
|
|
63494
|
-
IF condition2.
|
|
63495
|
-
...
|
|
63496
|
-
ENDIF.
|
|
63495
|
+
badExample: `IF condition1.
|
|
63496
|
+
IF condition2.
|
|
63497
|
+
...
|
|
63498
|
+
ENDIF.
|
|
63499
|
+
ENDIF.
|
|
63500
|
+
|
|
63501
|
+
IF condition1.
|
|
63502
|
+
...
|
|
63503
|
+
ELSE.
|
|
63504
|
+
IF condition2.
|
|
63505
|
+
...
|
|
63506
|
+
ENDIF.
|
|
63497
63507
|
ENDIF.`,
|
|
63498
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63499
|
-
...
|
|
63500
|
-
ENDIF.
|
|
63501
|
-
|
|
63502
|
-
IF condition1.
|
|
63503
|
-
...
|
|
63504
|
-
ELSEIF condition2.
|
|
63505
|
-
...
|
|
63506
|
-
ENDIF.
|
|
63507
|
-
|
|
63508
|
-
CASE variable.
|
|
63509
|
-
WHEN value1.
|
|
63510
|
-
...
|
|
63511
|
-
WHEN value2.
|
|
63512
|
-
IF condition2.
|
|
63513
|
-
...
|
|
63514
|
-
ENDIF.
|
|
63508
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63509
|
+
...
|
|
63510
|
+
ENDIF.
|
|
63511
|
+
|
|
63512
|
+
IF condition1.
|
|
63513
|
+
...
|
|
63514
|
+
ELSEIF condition2.
|
|
63515
|
+
...
|
|
63516
|
+
ENDIF.
|
|
63517
|
+
|
|
63518
|
+
CASE variable.
|
|
63519
|
+
WHEN value1.
|
|
63520
|
+
...
|
|
63521
|
+
WHEN value2.
|
|
63522
|
+
IF condition2.
|
|
63523
|
+
...
|
|
63524
|
+
ENDIF.
|
|
63515
63525
|
ENDCASE.`,
|
|
63516
63526
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63517
63527
|
};
|
|
@@ -63696,9 +63706,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63696
63706
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63697
63707
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63698
63708
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63699
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63700
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63701
|
-
RETURN. " todo, implement method
|
|
63709
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63710
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63711
|
+
RETURN. " todo, implement method
|
|
63702
63712
|
ENDMETHOD.`);
|
|
63703
63713
|
}
|
|
63704
63714
|
}
|
|
@@ -63877,14 +63887,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63877
63887
|
key: "implicit_start_of_selection",
|
|
63878
63888
|
title: "Implicit START-OF-SELECTION",
|
|
63879
63889
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63880
|
-
extendedInformation: `Only runs for executable programs
|
|
63881
|
-
|
|
63890
|
+
extendedInformation: `Only runs for executable programs
|
|
63891
|
+
|
|
63882
63892
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63883
63893
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63884
|
-
badExample: `REPORT zfoo.
|
|
63894
|
+
badExample: `REPORT zfoo.
|
|
63885
63895
|
WRITE 'hello'.`,
|
|
63886
|
-
goodExample: `
|
|
63887
|
-
START-OF-SELECTION.
|
|
63896
|
+
goodExample: `
|
|
63897
|
+
START-OF-SELECTION.
|
|
63888
63898
|
WRITE 'hello'.`,
|
|
63889
63899
|
};
|
|
63890
63900
|
}
|
|
@@ -63989,19 +63999,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63989
63999
|
key: "in_statement_indentation",
|
|
63990
64000
|
title: "In-statement indentation",
|
|
63991
64001
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63992
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63993
|
-
|
|
63994
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64002
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64003
|
+
|
|
64004
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63995
64005
|
to distinguish them better from code within the block.`,
|
|
63996
|
-
badExample: `IF 1 = 1
|
|
63997
|
-
AND 2 = 2.
|
|
63998
|
-
WRITE 'hello' &&
|
|
63999
|
-
'world'.
|
|
64006
|
+
badExample: `IF 1 = 1
|
|
64007
|
+
AND 2 = 2.
|
|
64008
|
+
WRITE 'hello' &&
|
|
64009
|
+
'world'.
|
|
64000
64010
|
ENDIF.`,
|
|
64001
|
-
goodExample: `IF 1 = 1
|
|
64002
|
-
AND 2 = 2.
|
|
64003
|
-
WRITE 'hello' &&
|
|
64004
|
-
'world'.
|
|
64011
|
+
goodExample: `IF 1 = 1
|
|
64012
|
+
AND 2 = 2.
|
|
64013
|
+
WRITE 'hello' &&
|
|
64014
|
+
'world'.
|
|
64005
64015
|
ENDIF.`,
|
|
64006
64016
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64007
64017
|
};
|
|
@@ -64124,23 +64134,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
64124
64134
|
title: "Indentation",
|
|
64125
64135
|
shortDescription: `Checks indentation`,
|
|
64126
64136
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64127
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64128
|
-
PRIVATE SECTION.
|
|
64129
|
-
METHODS constructor.
|
|
64130
|
-
ENDCLASS.
|
|
64131
|
-
|
|
64132
|
-
CLASS lcl IMPLEMENTATION.
|
|
64133
|
-
METHOD constructor.
|
|
64134
|
-
ENDMETHOD.
|
|
64137
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64138
|
+
PRIVATE SECTION.
|
|
64139
|
+
METHODS constructor.
|
|
64140
|
+
ENDCLASS.
|
|
64141
|
+
|
|
64142
|
+
CLASS lcl IMPLEMENTATION.
|
|
64143
|
+
METHOD constructor.
|
|
64144
|
+
ENDMETHOD.
|
|
64135
64145
|
ENDCLASS.`,
|
|
64136
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
64137
|
-
PRIVATE SECTION.
|
|
64138
|
-
METHODS constructor.
|
|
64139
|
-
ENDCLASS.
|
|
64140
|
-
|
|
64141
|
-
CLASS lcl IMPLEMENTATION.
|
|
64142
|
-
METHOD constructor.
|
|
64143
|
-
ENDMETHOD.
|
|
64146
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
64147
|
+
PRIVATE SECTION.
|
|
64148
|
+
METHODS constructor.
|
|
64149
|
+
ENDCLASS.
|
|
64150
|
+
|
|
64151
|
+
CLASS lcl IMPLEMENTATION.
|
|
64152
|
+
METHOD constructor.
|
|
64153
|
+
ENDMETHOD.
|
|
64144
64154
|
ENDCLASS.`,
|
|
64145
64155
|
};
|
|
64146
64156
|
}
|
|
@@ -64541,9 +64551,9 @@ class IntfReferencingClas {
|
|
|
64541
64551
|
key: "intf_referencing_clas",
|
|
64542
64552
|
title: "INTF referencing CLAS",
|
|
64543
64553
|
shortDescription: `Interface contains references to class`,
|
|
64544
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64545
|
-
Only first level references are checked.
|
|
64546
|
-
Exception class references are ignored.
|
|
64554
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64555
|
+
Only first level references are checked.
|
|
64556
|
+
Exception class references are ignored.
|
|
64547
64557
|
Void references are ignored.`,
|
|
64548
64558
|
};
|
|
64549
64559
|
}
|
|
@@ -64628,9 +64638,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64628
64638
|
title: "Invalid Table Index",
|
|
64629
64639
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64630
64640
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64631
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64641
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64632
64642
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64633
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64643
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64634
64644
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64635
64645
|
};
|
|
64636
64646
|
}
|
|
@@ -65231,8 +65241,8 @@ class LineBreakStyle {
|
|
|
65231
65241
|
return {
|
|
65232
65242
|
key: "line_break_style",
|
|
65233
65243
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65234
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65235
|
-
|
|
65244
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65245
|
+
|
|
65236
65246
|
abapGit does not work with CRLF`,
|
|
65237
65247
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65238
65248
|
};
|
|
@@ -65301,7 +65311,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65301
65311
|
key: "line_length",
|
|
65302
65312
|
title: "Line length",
|
|
65303
65313
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65304
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65314
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65305
65315
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65306
65316
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65307
65317
|
};
|
|
@@ -65372,7 +65382,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65372
65382
|
key: "line_only_punc",
|
|
65373
65383
|
title: "Line containing only punctuation",
|
|
65374
65384
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65375
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65385
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65376
65386
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65377
65387
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65378
65388
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65635,15 +65645,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65635
65645
|
return {
|
|
65636
65646
|
key: "local_variable_names",
|
|
65637
65647
|
title: "Local variable naming conventions",
|
|
65638
|
-
shortDescription: `
|
|
65639
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65648
|
+
shortDescription: `
|
|
65649
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65640
65650
|
Regexes are case-insensitive.`,
|
|
65641
65651
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65642
|
-
badExample: `FORM bar.
|
|
65643
|
-
DATA foo.
|
|
65652
|
+
badExample: `FORM bar.
|
|
65653
|
+
DATA foo.
|
|
65644
65654
|
ENDFORM.`,
|
|
65645
|
-
goodExample: `FORM bar.
|
|
65646
|
-
DATA lv_foo.
|
|
65655
|
+
goodExample: `FORM bar.
|
|
65656
|
+
DATA lv_foo.
|
|
65647
65657
|
ENDFORM.`,
|
|
65648
65658
|
};
|
|
65649
65659
|
}
|
|
@@ -65795,9 +65805,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65795
65805
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65796
65806
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65797
65807
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65798
|
-
badExample: `DEFINE something.
|
|
65808
|
+
badExample: `DEFINE something.
|
|
65799
65809
|
END-OF-DEFINITION.`,
|
|
65800
|
-
goodExample: `DEFINE _something.
|
|
65810
|
+
goodExample: `DEFINE _something.
|
|
65801
65811
|
END-OF-DEFINITION.`,
|
|
65802
65812
|
};
|
|
65803
65813
|
}
|
|
@@ -65870,10 +65880,10 @@ class MainFileContents {
|
|
|
65870
65880
|
key: "main_file_contents",
|
|
65871
65881
|
title: "Main file contents",
|
|
65872
65882
|
shortDescription: `Checks related to report declarations.`,
|
|
65873
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65874
|
-
|
|
65875
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65876
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65883
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65884
|
+
|
|
65885
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65886
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65877
65887
|
`,
|
|
65878
65888
|
};
|
|
65879
65889
|
}
|
|
@@ -65989,17 +65999,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65989
65999
|
title: "Too many parentheses",
|
|
65990
66000
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65991
66001
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65992
|
-
badExample: `
|
|
65993
|
-
IF ( destination IS INITIAL ).
|
|
65994
|
-
ENDIF.
|
|
65995
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65996
|
-
ENDIF.
|
|
66002
|
+
badExample: `
|
|
66003
|
+
IF ( destination IS INITIAL ).
|
|
66004
|
+
ENDIF.
|
|
66005
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66006
|
+
ENDIF.
|
|
65997
66007
|
`,
|
|
65998
|
-
goodExample: `
|
|
65999
|
-
IF destination IS INITIAL.
|
|
66000
|
-
ENDIF.
|
|
66001
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
66002
|
-
ENDIF.
|
|
66008
|
+
goodExample: `
|
|
66009
|
+
IF destination IS INITIAL.
|
|
66010
|
+
ENDIF.
|
|
66011
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
66012
|
+
ENDIF.
|
|
66003
66013
|
`,
|
|
66004
66014
|
};
|
|
66005
66015
|
}
|
|
@@ -66173,14 +66183,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66173
66183
|
title: "Max one method parameter definition per line",
|
|
66174
66184
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66175
66185
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66176
|
-
badExample: `
|
|
66177
|
-
METHODS apps_scope_token
|
|
66178
|
-
IMPORTING
|
|
66186
|
+
badExample: `
|
|
66187
|
+
METHODS apps_scope_token
|
|
66188
|
+
IMPORTING
|
|
66179
66189
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66180
|
-
goodExample: `
|
|
66181
|
-
METHODS apps_scope_token
|
|
66182
|
-
IMPORTING
|
|
66183
|
-
body TYPE bodyapps_scope_token
|
|
66190
|
+
goodExample: `
|
|
66191
|
+
METHODS apps_scope_token
|
|
66192
|
+
IMPORTING
|
|
66193
|
+
body TYPE bodyapps_scope_token
|
|
66184
66194
|
client_id TYPE str.`,
|
|
66185
66195
|
};
|
|
66186
66196
|
}
|
|
@@ -66245,11 +66255,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66245
66255
|
key: "max_one_statement",
|
|
66246
66256
|
title: "Max one statement per line",
|
|
66247
66257
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66248
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66249
|
-
|
|
66250
|
-
Does not report anything for chained statements.
|
|
66251
|
-
|
|
66252
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66258
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66259
|
+
|
|
66260
|
+
Does not report anything for chained statements.
|
|
66261
|
+
|
|
66262
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66253
66263
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66254
66264
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66255
66265
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66587,8 +66597,8 @@ class MethodLength {
|
|
|
66587
66597
|
key: "method_length",
|
|
66588
66598
|
title: "Method/Form Length",
|
|
66589
66599
|
shortDescription: `Checks relating to method/form length.`,
|
|
66590
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66591
|
-
|
|
66600
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66601
|
+
|
|
66592
66602
|
Abstract methods without statements are considered okay.`,
|
|
66593
66603
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66594
66604
|
};
|
|
@@ -66693,20 +66703,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66693
66703
|
key: "method_overwrites_builtin",
|
|
66694
66704
|
title: "Method name overwrites builtin function",
|
|
66695
66705
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66696
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66697
|
-
|
|
66698
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66699
|
-
|
|
66706
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66707
|
+
|
|
66708
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66709
|
+
|
|
66700
66710
|
Interface method names are ignored`,
|
|
66701
66711
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66702
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66703
|
-
PUBLIC SECTION.
|
|
66704
|
-
METHODS matches.
|
|
66705
|
-
ENDCLASS.
|
|
66706
|
-
|
|
66707
|
-
CLASS lcl IMPLEMENTATION.
|
|
66708
|
-
METHOD matches.
|
|
66709
|
-
ENDMETHOD.
|
|
66712
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66713
|
+
PUBLIC SECTION.
|
|
66714
|
+
METHODS matches.
|
|
66715
|
+
ENDCLASS.
|
|
66716
|
+
|
|
66717
|
+
CLASS lcl IMPLEMENTATION.
|
|
66718
|
+
METHOD matches.
|
|
66719
|
+
ENDMETHOD.
|
|
66710
66720
|
ENDCLASS.`,
|
|
66711
66721
|
};
|
|
66712
66722
|
}
|
|
@@ -66897,12 +66907,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66897
66907
|
// eslint-disable-next-line max-len
|
|
66898
66908
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66899
66909
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66900
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66901
|
-
PUBLIC SECTION.
|
|
66902
|
-
METHODS
|
|
66903
|
-
foobar
|
|
66904
|
-
EXPORTING foo TYPE i
|
|
66905
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66910
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66911
|
+
PUBLIC SECTION.
|
|
66912
|
+
METHODS
|
|
66913
|
+
foobar
|
|
66914
|
+
EXPORTING foo TYPE i
|
|
66915
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66906
66916
|
ENDCLASS.`,
|
|
66907
66917
|
};
|
|
66908
66918
|
}
|
|
@@ -67282,7 +67292,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67282
67292
|
key: "nesting",
|
|
67283
67293
|
title: "Check nesting depth",
|
|
67284
67294
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67285
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67295
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67286
67296
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67287
67297
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67288
67298
|
};
|
|
@@ -67525,7 +67535,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67525
67535
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67526
67536
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67527
67537
|
badExample: `var1 = var2 = var3.`,
|
|
67528
|
-
goodExample: `var2 = var3.
|
|
67538
|
+
goodExample: `var2 = var3.
|
|
67529
67539
|
var1 = var2.`,
|
|
67530
67540
|
};
|
|
67531
67541
|
}
|
|
@@ -67584,8 +67594,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67584
67594
|
key: "no_external_form_calls",
|
|
67585
67595
|
title: "No external FORM calls",
|
|
67586
67596
|
shortDescription: `Detect external form calls`,
|
|
67587
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67588
|
-
|
|
67597
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67598
|
+
|
|
67589
67599
|
PERFORM foo(bar).`,
|
|
67590
67600
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67591
67601
|
};
|
|
@@ -67646,17 +67656,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67646
67656
|
key: "no_inline_in_optional_branches",
|
|
67647
67657
|
title: "Don't declare inline in optional branches",
|
|
67648
67658
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67649
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67650
|
-
|
|
67651
|
-
Considered optional branches:
|
|
67652
|
-
* inside IF/ELSEIF/ELSE
|
|
67653
|
-
* inside LOOP
|
|
67654
|
-
* inside WHILE
|
|
67655
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67656
|
-
* inside DO
|
|
67657
|
-
* inside SELECT loops
|
|
67658
|
-
|
|
67659
|
-
Not considered optional branches:
|
|
67659
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67660
|
+
|
|
67661
|
+
Considered optional branches:
|
|
67662
|
+
* inside IF/ELSEIF/ELSE
|
|
67663
|
+
* inside LOOP
|
|
67664
|
+
* inside WHILE
|
|
67665
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67666
|
+
* inside DO
|
|
67667
|
+
* inside SELECT loops
|
|
67668
|
+
|
|
67669
|
+
Not considered optional branches:
|
|
67660
67670
|
* TRY/CATCH/CLEANUP`,
|
|
67661
67671
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67662
67672
|
};
|
|
@@ -67756,12 +67766,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67756
67766
|
key: "no_prefixes",
|
|
67757
67767
|
title: "No Prefixes",
|
|
67758
67768
|
shortDescription: `Dont use hungarian notation`,
|
|
67759
|
-
extendedInformation: `
|
|
67760
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67761
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67762
|
-
|
|
67763
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67764
|
-
|
|
67769
|
+
extendedInformation: `
|
|
67770
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67771
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67772
|
+
|
|
67773
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67774
|
+
|
|
67765
67775
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67766
67776
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67767
67777
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67940,7 +67950,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67940
67950
|
return {
|
|
67941
67951
|
key: "no_public_attributes",
|
|
67942
67952
|
title: "No public attributes",
|
|
67943
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67953
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67944
67954
|
Exceptions are excluded from this rule.`,
|
|
67945
67955
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67946
67956
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -68041,13 +68051,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
68041
68051
|
key: "no_yoda_conditions",
|
|
68042
68052
|
title: "No Yoda conditions",
|
|
68043
68053
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
68044
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68045
|
-
|
|
68054
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68055
|
+
|
|
68046
68056
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
68047
68057
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68048
|
-
badExample: `IF 0 <> sy-subrc.
|
|
68058
|
+
badExample: `IF 0 <> sy-subrc.
|
|
68049
68059
|
ENDIF.`,
|
|
68050
|
-
goodExample: `IF sy-subrc <> 0.
|
|
68060
|
+
goodExample: `IF sy-subrc <> 0.
|
|
68051
68061
|
ENDIF.`,
|
|
68052
68062
|
};
|
|
68053
68063
|
}
|
|
@@ -68148,8 +68158,8 @@ class NROBConsistency {
|
|
|
68148
68158
|
key: "nrob_consistency",
|
|
68149
68159
|
title: "Number range consistency",
|
|
68150
68160
|
shortDescription: `Consistency checks for number ranges`,
|
|
68151
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68152
|
-
|
|
68161
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68162
|
+
|
|
68153
68163
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
68154
68164
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68155
68165
|
};
|
|
@@ -68426,58 +68436,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68426
68436
|
title: "Obsolete statements",
|
|
68427
68437
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68428
68438
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68429
|
-
extendedInformation: `
|
|
68430
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68431
|
-
|
|
68432
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68433
|
-
|
|
68434
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68435
|
-
|
|
68436
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68437
|
-
|
|
68438
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68439
|
-
|
|
68440
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68441
|
-
|
|
68442
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68443
|
-
|
|
68444
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68445
|
-
|
|
68446
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68447
|
-
|
|
68448
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68449
|
-
|
|
68450
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68451
|
-
|
|
68452
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68453
|
-
|
|
68454
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68455
|
-
|
|
68456
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68457
|
-
|
|
68458
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68459
|
-
SELECT COUNT(*) is considered okay
|
|
68460
|
-
|
|
68461
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68462
|
-
|
|
68463
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68464
|
-
|
|
68465
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68466
|
-
|
|
68467
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68468
|
-
|
|
68469
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68470
|
-
|
|
68439
|
+
extendedInformation: `
|
|
68440
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68441
|
+
|
|
68442
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68443
|
+
|
|
68444
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68445
|
+
|
|
68446
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68447
|
+
|
|
68448
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68449
|
+
|
|
68450
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68451
|
+
|
|
68452
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68453
|
+
|
|
68454
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68455
|
+
|
|
68456
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68457
|
+
|
|
68458
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68459
|
+
|
|
68460
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68461
|
+
|
|
68462
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68463
|
+
|
|
68464
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68465
|
+
|
|
68466
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68467
|
+
|
|
68468
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68469
|
+
SELECT COUNT(*) is considered okay
|
|
68470
|
+
|
|
68471
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68472
|
+
|
|
68473
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68474
|
+
|
|
68475
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68476
|
+
|
|
68477
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68478
|
+
|
|
68479
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68480
|
+
|
|
68471
68481
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68472
|
-
badExample: `REFRESH itab.
|
|
68473
|
-
|
|
68474
|
-
COMPUTE foo = 2 + 2.
|
|
68475
|
-
|
|
68476
|
-
MULTIPLY lv_foo BY 2.
|
|
68477
|
-
|
|
68478
|
-
INTERFACE intf LOAD.
|
|
68479
|
-
|
|
68480
|
-
IF foo IS SUPPLIED.
|
|
68482
|
+
badExample: `REFRESH itab.
|
|
68483
|
+
|
|
68484
|
+
COMPUTE foo = 2 + 2.
|
|
68485
|
+
|
|
68486
|
+
MULTIPLY lv_foo BY 2.
|
|
68487
|
+
|
|
68488
|
+
INTERFACE intf LOAD.
|
|
68489
|
+
|
|
68490
|
+
IF foo IS SUPPLIED.
|
|
68481
68491
|
ENDIF.`,
|
|
68482
68492
|
};
|
|
68483
68493
|
}
|
|
@@ -68817,9 +68827,9 @@ class OmitParameterName {
|
|
|
68817
68827
|
key: "omit_parameter_name",
|
|
68818
68828
|
title: "Omit parameter name",
|
|
68819
68829
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68820
|
-
extendedInformation: `
|
|
68821
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68822
|
-
|
|
68830
|
+
extendedInformation: `
|
|
68831
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68832
|
+
|
|
68823
68833
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68824
68834
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68825
68835
|
badExample: `method( param = 2 ).`,
|
|
@@ -69025,20 +69035,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
69025
69035
|
shortDescription: `Omit RECEIVING`,
|
|
69026
69036
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
69027
69037
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69028
|
-
badExample: `
|
|
69029
|
-
upload_pack(
|
|
69030
|
-
EXPORTING
|
|
69031
|
-
io_client = lo_client
|
|
69032
|
-
iv_url = iv_url
|
|
69033
|
-
iv_deepen_level = iv_deepen_level
|
|
69034
|
-
it_hashes = lt_hashes
|
|
69035
|
-
RECEIVING
|
|
69038
|
+
badExample: `
|
|
69039
|
+
upload_pack(
|
|
69040
|
+
EXPORTING
|
|
69041
|
+
io_client = lo_client
|
|
69042
|
+
iv_url = iv_url
|
|
69043
|
+
iv_deepen_level = iv_deepen_level
|
|
69044
|
+
it_hashes = lt_hashes
|
|
69045
|
+
RECEIVING
|
|
69036
69046
|
rt_objects = et_objects ).`,
|
|
69037
|
-
goodExample: `
|
|
69038
|
-
et_objects = upload_pack(
|
|
69039
|
-
io_client = lo_client
|
|
69040
|
-
iv_url = iv_url
|
|
69041
|
-
iv_deepen_level = iv_deepen_level
|
|
69047
|
+
goodExample: `
|
|
69048
|
+
et_objects = upload_pack(
|
|
69049
|
+
io_client = lo_client
|
|
69050
|
+
iv_url = iv_url
|
|
69051
|
+
iv_deepen_level = iv_deepen_level
|
|
69042
69052
|
it_hashes = lt_hashes ).`,
|
|
69043
69053
|
};
|
|
69044
69054
|
}
|
|
@@ -69102,8 +69112,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
69102
69112
|
return {
|
|
69103
69113
|
key: "parser_702_chaining",
|
|
69104
69114
|
title: "Parser Error, bad chanining on 702",
|
|
69105
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69106
|
-
this rule finds these and reports errors.
|
|
69115
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69116
|
+
this rule finds these and reports errors.
|
|
69107
69117
|
Only active on target version 702 and below.`,
|
|
69108
69118
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69109
69119
|
};
|
|
@@ -69183,8 +69193,8 @@ class ParserError {
|
|
|
69183
69193
|
return {
|
|
69184
69194
|
key: "parser_error",
|
|
69185
69195
|
title: "Parser error",
|
|
69186
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69187
|
-
|
|
69196
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69197
|
+
|
|
69188
69198
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69189
69199
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69190
69200
|
};
|
|
@@ -69269,7 +69279,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69269
69279
|
return {
|
|
69270
69280
|
key: "parser_missing_space",
|
|
69271
69281
|
title: "Parser Error, missing space",
|
|
69272
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69282
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69273
69283
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69274
69284
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69275
69285
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69692,25 +69702,25 @@ class PreferInline {
|
|
|
69692
69702
|
key: "prefer_inline",
|
|
69693
69703
|
title: "Prefer Inline Declarations",
|
|
69694
69704
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69695
|
-
extendedInformation: `EXPERIMENTAL
|
|
69696
|
-
|
|
69697
|
-
Activates if language version is v740sp02 or above.
|
|
69698
|
-
|
|
69699
|
-
Variables must be local(METHOD or FORM).
|
|
69700
|
-
|
|
69701
|
-
No generic or void typed variables. No syntax errors.
|
|
69702
|
-
|
|
69703
|
-
First position used must be a full/pure write.
|
|
69704
|
-
|
|
69705
|
-
Move statment is not a cast(?=)
|
|
69706
|
-
|
|
69705
|
+
extendedInformation: `EXPERIMENTAL
|
|
69706
|
+
|
|
69707
|
+
Activates if language version is v740sp02 or above.
|
|
69708
|
+
|
|
69709
|
+
Variables must be local(METHOD or FORM).
|
|
69710
|
+
|
|
69711
|
+
No generic or void typed variables. No syntax errors.
|
|
69712
|
+
|
|
69713
|
+
First position used must be a full/pure write.
|
|
69714
|
+
|
|
69715
|
+
Move statment is not a cast(?=)
|
|
69716
|
+
|
|
69707
69717
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69708
69718
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69709
|
-
badExample: `DATA foo TYPE i.
|
|
69710
|
-
foo = 2.
|
|
69711
|
-
DATA percentage TYPE decfloat34.
|
|
69719
|
+
badExample: `DATA foo TYPE i.
|
|
69720
|
+
foo = 2.
|
|
69721
|
+
DATA percentage TYPE decfloat34.
|
|
69712
69722
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69713
|
-
goodExample: `DATA(foo) = 2.
|
|
69723
|
+
goodExample: `DATA(foo) = 2.
|
|
69714
69724
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69715
69725
|
};
|
|
69716
69726
|
}
|
|
@@ -69924,18 +69934,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69924
69934
|
key: "prefer_is_not",
|
|
69925
69935
|
title: "Prefer IS NOT to NOT IS",
|
|
69926
69936
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69927
|
-
extendedInformation: `
|
|
69928
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69929
|
-
|
|
69937
|
+
extendedInformation: `
|
|
69938
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69939
|
+
|
|
69930
69940
|
"if not is_valid( )." examples are skipped`,
|
|
69931
69941
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69932
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69933
|
-
IF variable NP 'TODO*'.
|
|
69934
|
-
IF variable <> 42.
|
|
69942
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69943
|
+
IF variable NP 'TODO*'.
|
|
69944
|
+
IF variable <> 42.
|
|
69935
69945
|
IF variable CO 'hello'.`,
|
|
69936
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69937
|
-
IF NOT variable CP 'TODO*'.
|
|
69938
|
-
IF NOT variable = 42.
|
|
69946
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69947
|
+
IF NOT variable CP 'TODO*'.
|
|
69948
|
+
IF NOT variable = 42.
|
|
69939
69949
|
IF NOT variable CA 'hello'.`,
|
|
69940
69950
|
};
|
|
69941
69951
|
}
|
|
@@ -70123,14 +70133,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
70123
70133
|
key: "prefer_raise_exception_new",
|
|
70124
70134
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
70125
70135
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
70126
|
-
extendedInformation: `
|
|
70127
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70128
|
-
|
|
70136
|
+
extendedInformation: `
|
|
70137
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70138
|
+
|
|
70129
70139
|
From 752 and up`,
|
|
70130
70140
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
70131
70141
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
70132
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70133
|
-
EXPORTING
|
|
70142
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70143
|
+
EXPORTING
|
|
70134
70144
|
previous = exception.`,
|
|
70135
70145
|
};
|
|
70136
70146
|
}
|
|
@@ -70208,12 +70218,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70208
70218
|
key: "prefer_returning_to_exporting",
|
|
70209
70219
|
title: "Prefer RETURNING to EXPORTING",
|
|
70210
70220
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70211
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70221
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70212
70222
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70213
70223
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70214
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70215
|
-
PUBLIC SECTION.
|
|
70216
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70224
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70225
|
+
PUBLIC SECTION.
|
|
70226
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70217
70227
|
ENDCLASS.`,
|
|
70218
70228
|
};
|
|
70219
70229
|
}
|
|
@@ -70309,8 +70319,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70309
70319
|
key: "prefer_xsdbool",
|
|
70310
70320
|
title: "Prefer xsdbool over boolc",
|
|
70311
70321
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70312
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70313
|
-
|
|
70322
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70323
|
+
|
|
70314
70324
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70315
70325
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70316
70326
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70382,9 +70392,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70382
70392
|
title: "Preferred compare operator",
|
|
70383
70393
|
shortDescription: `Configure undesired operator variants`,
|
|
70384
70394
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70385
|
-
badExample: `IF foo EQ bar.
|
|
70395
|
+
badExample: `IF foo EQ bar.
|
|
70386
70396
|
ENDIF.`,
|
|
70387
|
-
goodExample: `IF foo = bar.
|
|
70397
|
+
goodExample: `IF foo = bar.
|
|
70388
70398
|
ENDIF.`,
|
|
70389
70399
|
};
|
|
70390
70400
|
}
|
|
@@ -70608,26 +70618,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70608
70618
|
key: "reduce_procedural_code",
|
|
70609
70619
|
title: "Reduce procedural code",
|
|
70610
70620
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70611
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70612
|
-
|
|
70613
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70614
|
-
|
|
70621
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70622
|
+
|
|
70623
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70624
|
+
|
|
70615
70625
|
Comments are not counted as statements.`,
|
|
70616
70626
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70617
|
-
badExample: `FORM foo.
|
|
70618
|
-
DATA lv_bar TYPE i.
|
|
70619
|
-
lv_bar = 2 + 2.
|
|
70620
|
-
IF lv_bar = 4.
|
|
70621
|
-
WRITE 'hello world'.
|
|
70622
|
-
ENDIF.
|
|
70623
|
-
DATA lv_bar TYPE i.
|
|
70624
|
-
lv_bar = 2 + 2.
|
|
70625
|
-
IF lv_bar = 4.
|
|
70626
|
-
WRITE 'hello world'.
|
|
70627
|
-
ENDIF.
|
|
70627
|
+
badExample: `FORM foo.
|
|
70628
|
+
DATA lv_bar TYPE i.
|
|
70629
|
+
lv_bar = 2 + 2.
|
|
70630
|
+
IF lv_bar = 4.
|
|
70631
|
+
WRITE 'hello world'.
|
|
70632
|
+
ENDIF.
|
|
70633
|
+
DATA lv_bar TYPE i.
|
|
70634
|
+
lv_bar = 2 + 2.
|
|
70635
|
+
IF lv_bar = 4.
|
|
70636
|
+
WRITE 'hello world'.
|
|
70637
|
+
ENDIF.
|
|
70628
70638
|
ENDFORM.`,
|
|
70629
|
-
goodExample: `FORM foo.
|
|
70630
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70639
|
+
goodExample: `FORM foo.
|
|
70640
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70631
70641
|
ENDFORM.`,
|
|
70632
70642
|
};
|
|
70633
70643
|
}
|
|
@@ -70871,10 +70881,10 @@ class RemoveDescriptions {
|
|
|
70871
70881
|
return {
|
|
70872
70882
|
key: "remove_descriptions",
|
|
70873
70883
|
title: "Remove descriptions",
|
|
70874
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70875
|
-
|
|
70876
|
-
Class descriptions are required, see rule description_empty.
|
|
70877
|
-
|
|
70884
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70885
|
+
|
|
70886
|
+
Class descriptions are required, see rule description_empty.
|
|
70887
|
+
|
|
70878
70888
|
Consider using ABAP Doc for documentation.`,
|
|
70879
70889
|
tags: [],
|
|
70880
70890
|
};
|
|
@@ -70999,14 +71009,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70999
71009
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71000
71010
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
71001
71011
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
71002
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
71012
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
71003
71013
|
DESTINATION lv_rfc.`,
|
|
71004
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71005
|
-
DESTINATION lv_rfc
|
|
71006
|
-
EXCEPTIONS
|
|
71007
|
-
system_failure = 1 MESSAGE msg
|
|
71008
|
-
communication_failure = 2 MESSAGE msg
|
|
71009
|
-
resource_failure = 3
|
|
71014
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71015
|
+
DESTINATION lv_rfc
|
|
71016
|
+
EXCEPTIONS
|
|
71017
|
+
system_failure = 1 MESSAGE msg
|
|
71018
|
+
communication_failure = 2 MESSAGE msg
|
|
71019
|
+
resource_failure = 3
|
|
71010
71020
|
OTHERS = 4.`,
|
|
71011
71021
|
};
|
|
71012
71022
|
}
|
|
@@ -71090,11 +71100,11 @@ class SelectAddOrderBy {
|
|
|
71090
71100
|
key: "select_add_order_by",
|
|
71091
71101
|
title: "SELECT add ORDER BY",
|
|
71092
71102
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
71093
|
-
extendedInformation: `
|
|
71094
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71095
|
-
|
|
71096
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
71097
|
-
|
|
71103
|
+
extendedInformation: `
|
|
71104
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71105
|
+
|
|
71106
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
71107
|
+
|
|
71098
71108
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
71099
71109
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71100
71110
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71225,14 +71235,14 @@ class SelectPerformance {
|
|
|
71225
71235
|
key: "select_performance",
|
|
71226
71236
|
title: "SELECT performance",
|
|
71227
71237
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71228
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71229
|
-
|
|
71238
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71239
|
+
|
|
71230
71240
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71231
71241
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71232
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71233
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71242
|
+
badExample: `SELECT field1, field2 FROM table
|
|
71243
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71234
71244
|
ENDSELECT.`,
|
|
71235
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71245
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71236
71246
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71237
71247
|
};
|
|
71238
71248
|
}
|
|
@@ -71346,8 +71356,8 @@ class SelectSingleFullKey {
|
|
|
71346
71356
|
key: "select_single_full_key",
|
|
71347
71357
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71348
71358
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71349
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71350
|
-
|
|
71359
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71360
|
+
|
|
71351
71361
|
If the statement contains a JOIN it is not checked`,
|
|
71352
71362
|
pseudoComment: "EC CI_NOORDER",
|
|
71353
71363
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71775,8 +71785,8 @@ class SICFConsistency {
|
|
|
71775
71785
|
key: "sicf_consistency",
|
|
71776
71786
|
title: "SICF consistency",
|
|
71777
71787
|
shortDescription: `Checks the validity of ICF services`,
|
|
71778
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71779
|
-
* Class must not have any syntax errors
|
|
71788
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71789
|
+
* Class must not have any syntax errors
|
|
71780
71790
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71781
71791
|
};
|
|
71782
71792
|
}
|
|
@@ -71888,23 +71898,23 @@ class SlowParameterPassing {
|
|
|
71888
71898
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71889
71899
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71890
71900
|
tags: [_irule_1.RuleTag.Performance],
|
|
71891
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71892
|
-
PUBLIC SECTION.
|
|
71893
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71894
|
-
ENDCLASS.
|
|
71895
|
-
CLASS lcl IMPLEMENTATION.
|
|
71896
|
-
METHOD bar.
|
|
71897
|
-
WRITE sdf.
|
|
71898
|
-
ENDMETHOD.
|
|
71901
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71902
|
+
PUBLIC SECTION.
|
|
71903
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71904
|
+
ENDCLASS.
|
|
71905
|
+
CLASS lcl IMPLEMENTATION.
|
|
71906
|
+
METHOD bar.
|
|
71907
|
+
WRITE sdf.
|
|
71908
|
+
ENDMETHOD.
|
|
71899
71909
|
ENDCLASS.`,
|
|
71900
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71901
|
-
PUBLIC SECTION.
|
|
71902
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71903
|
-
ENDCLASS.
|
|
71904
|
-
CLASS lcl IMPLEMENTATION.
|
|
71905
|
-
METHOD bar.
|
|
71906
|
-
WRITE sdf.
|
|
71907
|
-
ENDMETHOD.
|
|
71910
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71911
|
+
PUBLIC SECTION.
|
|
71912
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71913
|
+
ENDCLASS.
|
|
71914
|
+
CLASS lcl IMPLEMENTATION.
|
|
71915
|
+
METHOD bar.
|
|
71916
|
+
WRITE sdf.
|
|
71917
|
+
ENDMETHOD.
|
|
71908
71918
|
ENDCLASS.`,
|
|
71909
71919
|
};
|
|
71910
71920
|
}
|
|
@@ -72161,8 +72171,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
72161
72171
|
key: "space_before_dot",
|
|
72162
72172
|
title: "Space before dot",
|
|
72163
72173
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
72164
|
-
extendedInformation: `
|
|
72165
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72174
|
+
extendedInformation: `
|
|
72175
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72166
72176
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
72167
72177
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72168
72178
|
badExample: `WRITE bar .`,
|
|
@@ -72348,12 +72358,12 @@ class SQLValueConversion {
|
|
|
72348
72358
|
key: "sql_value_conversion",
|
|
72349
72359
|
title: "Implicit SQL Value Conversion",
|
|
72350
72360
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72351
|
-
extendedInformation: `
|
|
72352
|
-
* Integer to CHAR conversion
|
|
72353
|
-
* Integer to NUMC conversion
|
|
72354
|
-
* NUMC to Integer conversion
|
|
72355
|
-
* CHAR to Integer conversion
|
|
72356
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72361
|
+
extendedInformation: `
|
|
72362
|
+
* Integer to CHAR conversion
|
|
72363
|
+
* Integer to NUMC conversion
|
|
72364
|
+
* NUMC to Integer conversion
|
|
72365
|
+
* CHAR to Integer conversion
|
|
72366
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72357
72367
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72358
72368
|
tags: [],
|
|
72359
72369
|
};
|
|
@@ -72425,7 +72435,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72425
72435
|
key: "start_at_tab",
|
|
72426
72436
|
title: "Start at tab",
|
|
72427
72437
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72428
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72438
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72429
72439
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72430
72440
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72431
72441
|
badExample: ` WRITE a.`,
|
|
@@ -72602,12 +72612,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72602
72612
|
key: "strict_sql",
|
|
72603
72613
|
title: "Strict SQL",
|
|
72604
72614
|
shortDescription: `Strict SQL`,
|
|
72605
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72606
|
-
|
|
72607
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72608
|
-
|
|
72609
|
-
Also see separate rule sql_escape_host_variables
|
|
72610
|
-
|
|
72615
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72616
|
+
|
|
72617
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72618
|
+
|
|
72619
|
+
Also see separate rule sql_escape_host_variables
|
|
72620
|
+
|
|
72611
72621
|
Activates from v750 and up`,
|
|
72612
72622
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72613
72623
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72861,11 +72871,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72861
72871
|
key: "sy_modification",
|
|
72862
72872
|
title: "Modification of SY fields",
|
|
72863
72873
|
shortDescription: `Finds modification of sy fields`,
|
|
72864
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72865
|
-
|
|
72874
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72875
|
+
|
|
72866
72876
|
Changes to SY-TVAR* fields are not reported`,
|
|
72867
72877
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72868
|
-
badExample: `sy-uname = 2.
|
|
72878
|
+
badExample: `sy-uname = 2.
|
|
72869
72879
|
sy = sy.`,
|
|
72870
72880
|
};
|
|
72871
72881
|
}
|
|
@@ -72927,8 +72937,8 @@ class TABLEnhancementCategory {
|
|
|
72927
72937
|
key: "tabl_enhancement_category",
|
|
72928
72938
|
title: "TABL enhancement category must be set",
|
|
72929
72939
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72930
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72931
|
-
|
|
72940
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72941
|
+
|
|
72932
72942
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72933
72943
|
tags: [],
|
|
72934
72944
|
};
|
|
@@ -72993,8 +73003,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72993
73003
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72994
73004
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72995
73005
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72996
|
-
badExample: `FORM foo.
|
|
72997
|
-
TABLES t100.
|
|
73006
|
+
badExample: `FORM foo.
|
|
73007
|
+
TABLES t100.
|
|
72998
73008
|
ENDFORM.`,
|
|
72999
73009
|
goodExample: `TABLES t000.`,
|
|
73000
73010
|
};
|
|
@@ -73122,9 +73132,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
73122
73132
|
title: "Type FORM parameters",
|
|
73123
73133
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
73124
73134
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73125
|
-
badExample: `FORM foo USING bar.
|
|
73135
|
+
badExample: `FORM foo USING bar.
|
|
73126
73136
|
ENDFORM.`,
|
|
73127
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
73137
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
73128
73138
|
ENDFORM.`,
|
|
73129
73139
|
};
|
|
73130
73140
|
}
|
|
@@ -73797,38 +73807,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73797
73807
|
key: "unnecessary_pragma",
|
|
73798
73808
|
title: "Unnecessary Pragma",
|
|
73799
73809
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73800
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73801
|
-
|
|
73802
|
-
* NEEDED without definition
|
|
73803
|
-
|
|
73804
|
-
* NO_TEXT without texts
|
|
73805
|
-
|
|
73806
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73807
|
-
|
|
73810
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73811
|
+
|
|
73812
|
+
* NEEDED without definition
|
|
73813
|
+
|
|
73814
|
+
* NO_TEXT without texts
|
|
73815
|
+
|
|
73816
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73817
|
+
|
|
73808
73818
|
NO_HANDLER inside macros are not checked`,
|
|
73809
73819
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73810
|
-
badExample: `TRY.
|
|
73811
|
-
...
|
|
73812
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73813
|
-
RETURN. " it has a handler
|
|
73814
|
-
ENDTRY.
|
|
73815
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73816
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73817
|
-
IF sy-subrc <> 0.
|
|
73820
|
+
badExample: `TRY.
|
|
73821
|
+
...
|
|
73822
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73823
|
+
RETURN. " it has a handler
|
|
73824
|
+
ENDTRY.
|
|
73825
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73826
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73827
|
+
IF sy-subrc <> 0.
|
|
73818
73828
|
ENDIF.`,
|
|
73819
|
-
goodExample: `TRY.
|
|
73820
|
-
...
|
|
73821
|
-
CATCH zcx_abapgit_exception.
|
|
73822
|
-
RETURN.
|
|
73823
|
-
ENDTRY.
|
|
73824
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73825
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73826
|
-
IF sy-subrc <> 0.
|
|
73827
|
-
ENDIF.
|
|
73828
|
-
|
|
73829
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73830
|
-
test1 TYPE string,
|
|
73831
|
-
test2 TYPE string,
|
|
73829
|
+
goodExample: `TRY.
|
|
73830
|
+
...
|
|
73831
|
+
CATCH zcx_abapgit_exception.
|
|
73832
|
+
RETURN.
|
|
73833
|
+
ENDTRY.
|
|
73834
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73835
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73836
|
+
IF sy-subrc <> 0.
|
|
73837
|
+
ENDIF.
|
|
73838
|
+
|
|
73839
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73840
|
+
test1 TYPE string,
|
|
73841
|
+
test2 TYPE string,
|
|
73832
73842
|
END OF blah.`,
|
|
73833
73843
|
};
|
|
73834
73844
|
}
|
|
@@ -73995,18 +74005,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73995
74005
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73996
74006
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73997
74007
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73998
|
-
badExample: `FORM hello1.
|
|
73999
|
-
WRITE 'world'.
|
|
74000
|
-
RETURN.
|
|
74001
|
-
ENDFORM.
|
|
74002
|
-
|
|
74003
|
-
FORM foo.
|
|
74004
|
-
IF 1 = 2.
|
|
74005
|
-
RETURN.
|
|
74006
|
-
ENDIF.
|
|
74008
|
+
badExample: `FORM hello1.
|
|
74009
|
+
WRITE 'world'.
|
|
74010
|
+
RETURN.
|
|
74011
|
+
ENDFORM.
|
|
74012
|
+
|
|
74013
|
+
FORM foo.
|
|
74014
|
+
IF 1 = 2.
|
|
74015
|
+
RETURN.
|
|
74016
|
+
ENDIF.
|
|
74007
74017
|
ENDFORM.`,
|
|
74008
|
-
goodExample: `FORM hello2.
|
|
74009
|
-
WRITE 'world'.
|
|
74018
|
+
goodExample: `FORM hello2.
|
|
74019
|
+
WRITE 'world'.
|
|
74010
74020
|
ENDFORM.`,
|
|
74011
74021
|
};
|
|
74012
74022
|
}
|
|
@@ -74357,13 +74367,13 @@ class UnusedMacros {
|
|
|
74357
74367
|
title: "Unused macros",
|
|
74358
74368
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74359
74369
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74360
|
-
badExample: `DEFINE foobar1.
|
|
74361
|
-
WRITE 'hello'.
|
|
74370
|
+
badExample: `DEFINE foobar1.
|
|
74371
|
+
WRITE 'hello'.
|
|
74362
74372
|
END-OF-DEFINITION.`,
|
|
74363
|
-
goodExample: `DEFINE foobar2.
|
|
74364
|
-
WRITE 'hello'.
|
|
74365
|
-
END-OF-DEFINITION.
|
|
74366
|
-
|
|
74373
|
+
goodExample: `DEFINE foobar2.
|
|
74374
|
+
WRITE 'hello'.
|
|
74375
|
+
END-OF-DEFINITION.
|
|
74376
|
+
|
|
74367
74377
|
foobar2.`,
|
|
74368
74378
|
};
|
|
74369
74379
|
}
|
|
@@ -74475,18 +74485,18 @@ class UnusedMethods {
|
|
|
74475
74485
|
key: "unused_methods",
|
|
74476
74486
|
title: "Unused methods",
|
|
74477
74487
|
shortDescription: `Checks for unused methods`,
|
|
74478
|
-
extendedInformation: `Checks private and protected methods.
|
|
74479
|
-
|
|
74480
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74481
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74482
|
-
|
|
74483
|
-
Skips:
|
|
74484
|
-
* methods FOR TESTING
|
|
74485
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74486
|
-
* class_constructor + constructor methods
|
|
74487
|
-
* event handlers
|
|
74488
|
-
* methods that are redefined
|
|
74489
|
-
* INCLUDEs
|
|
74488
|
+
extendedInformation: `Checks private and protected methods.
|
|
74489
|
+
|
|
74490
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74491
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74492
|
+
|
|
74493
|
+
Skips:
|
|
74494
|
+
* methods FOR TESTING
|
|
74495
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74496
|
+
* class_constructor + constructor methods
|
|
74497
|
+
* event handlers
|
|
74498
|
+
* methods that are redefined
|
|
74499
|
+
* INCLUDEs
|
|
74490
74500
|
`,
|
|
74491
74501
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74492
74502
|
pragma: "##CALLED",
|
|
@@ -74962,23 +74972,23 @@ class UnusedVariables {
|
|
|
74962
74972
|
key: "unused_variables",
|
|
74963
74973
|
title: "Unused variables",
|
|
74964
74974
|
shortDescription: `Checks for unused variables and constants`,
|
|
74965
|
-
extendedInformation: `Skips event parameters.
|
|
74966
|
-
|
|
74967
|
-
Note that this currently does not work if the source code uses macros.
|
|
74968
|
-
|
|
74969
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74970
|
-
|
|
74975
|
+
extendedInformation: `Skips event parameters.
|
|
74976
|
+
|
|
74977
|
+
Note that this currently does not work if the source code uses macros.
|
|
74978
|
+
|
|
74979
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74980
|
+
|
|
74971
74981
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74972
74982
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74973
74983
|
pragma: "##NEEDED",
|
|
74974
74984
|
pseudoComment: "EC NEEDED",
|
|
74975
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74976
|
-
test TYPE string,
|
|
74977
|
-
test2 TYPE string,
|
|
74985
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74986
|
+
test TYPE string,
|
|
74987
|
+
test2 TYPE string,
|
|
74978
74988
|
END OF blah1.`,
|
|
74979
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74980
|
-
test TYPE string,
|
|
74981
|
-
test2 TYPE string,
|
|
74989
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74990
|
+
test TYPE string,
|
|
74991
|
+
test2 TYPE string,
|
|
74982
74992
|
END OF blah2.`,
|
|
74983
74993
|
};
|
|
74984
74994
|
}
|
|
@@ -75197,15 +75207,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75197
75207
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75198
75208
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75199
75209
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75200
|
-
badExample: `IF line IS INITIAL.
|
|
75201
|
-
has_entries = abap_false.
|
|
75202
|
-
ELSE.
|
|
75203
|
-
has_entries = abap_true.
|
|
75204
|
-
ENDIF.
|
|
75205
|
-
|
|
75210
|
+
badExample: `IF line IS INITIAL.
|
|
75211
|
+
has_entries = abap_false.
|
|
75212
|
+
ELSE.
|
|
75213
|
+
has_entries = abap_true.
|
|
75214
|
+
ENDIF.
|
|
75215
|
+
|
|
75206
75216
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75207
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75208
|
-
|
|
75217
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75218
|
+
|
|
75209
75219
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75210
75220
|
};
|
|
75211
75221
|
}
|
|
@@ -75323,15 +75333,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75323
75333
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75324
75334
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75325
75335
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75326
|
-
badExample: `INTERFACE lif.
|
|
75327
|
-
METHODS load_data
|
|
75328
|
-
EXCEPTIONS
|
|
75329
|
-
invalid_parameter.
|
|
75336
|
+
badExample: `INTERFACE lif.
|
|
75337
|
+
METHODS load_data
|
|
75338
|
+
EXCEPTIONS
|
|
75339
|
+
invalid_parameter.
|
|
75330
75340
|
ENDINTERFACE.`,
|
|
75331
|
-
goodExample: `INTERFACE lif.
|
|
75332
|
-
METHODS load_data
|
|
75333
|
-
RAISING
|
|
75334
|
-
cx_something.
|
|
75341
|
+
goodExample: `INTERFACE lif.
|
|
75342
|
+
METHODS load_data
|
|
75343
|
+
RAISING
|
|
75344
|
+
cx_something.
|
|
75335
75345
|
ENDINTERFACE.`,
|
|
75336
75346
|
};
|
|
75337
75347
|
}
|
|
@@ -75391,15 +75401,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75391
75401
|
key: "use_line_exists",
|
|
75392
75402
|
title: "Use line_exists",
|
|
75393
75403
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75394
|
-
extendedInformation: `
|
|
75395
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75396
|
-
|
|
75404
|
+
extendedInformation: `
|
|
75405
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75406
|
+
|
|
75397
75407
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75398
75408
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75399
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75400
|
-
IF sy-subrc = 0.
|
|
75409
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75410
|
+
IF sy-subrc = 0.
|
|
75401
75411
|
ENDIF.`,
|
|
75402
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75412
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75403
75413
|
ENDIF.`,
|
|
75404
75414
|
};
|
|
75405
75415
|
}
|
|
@@ -75509,10 +75519,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75509
75519
|
key: "use_new",
|
|
75510
75520
|
title: "Use NEW",
|
|
75511
75521
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75512
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75513
|
-
|
|
75514
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75515
|
-
|
|
75522
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75523
|
+
|
|
75524
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75525
|
+
|
|
75516
75526
|
Applicable from v740sp02 and up`,
|
|
75517
75527
|
badExample: `CREATE OBJECT ref.`,
|
|
75518
75528
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75610,13 +75620,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75610
75620
|
title: "WHEN OTHERS last",
|
|
75611
75621
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75612
75622
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75613
|
-
badExample: `CASE bar.
|
|
75614
|
-
WHEN OTHERS.
|
|
75615
|
-
WHEN 2.
|
|
75623
|
+
badExample: `CASE bar.
|
|
75624
|
+
WHEN OTHERS.
|
|
75625
|
+
WHEN 2.
|
|
75616
75626
|
ENDCASE.`,
|
|
75617
|
-
goodExample: `CASE bar.
|
|
75618
|
-
WHEN 2.
|
|
75619
|
-
WHEN OTHERS.
|
|
75627
|
+
goodExample: `CASE bar.
|
|
75628
|
+
WHEN 2.
|
|
75629
|
+
WHEN OTHERS.
|
|
75620
75630
|
ENDCASE.`,
|
|
75621
75631
|
};
|
|
75622
75632
|
}
|