@abaplint/cli 2.112.18 → 2.112.20
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 +884 -817
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -35126,13 +35126,13 @@ class FlowGraph {
|
|
|
35126
35126
|
this.label = label;
|
|
35127
35127
|
}
|
|
35128
35128
|
toDigraph() {
|
|
35129
|
-
return `digraph G {
|
|
35130
|
-
labelloc="t";
|
|
35131
|
-
label="${this.label}";
|
|
35132
|
-
graph [fontname = "helvetica"];
|
|
35133
|
-
node [fontname = "helvetica", shape="box"];
|
|
35134
|
-
edge [fontname = "helvetica"];
|
|
35135
|
-
${this.toTextEdges()}
|
|
35129
|
+
return `digraph G {
|
|
35130
|
+
labelloc="t";
|
|
35131
|
+
label="${this.label}";
|
|
35132
|
+
graph [fontname = "helvetica"];
|
|
35133
|
+
node [fontname = "helvetica", shape="box"];
|
|
35134
|
+
edge [fontname = "helvetica"];
|
|
35135
|
+
${this.toTextEdges()}
|
|
35136
35136
|
}`;
|
|
35137
35137
|
}
|
|
35138
35138
|
listSources(node) {
|
|
@@ -35214,36 +35214,103 @@ const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node
|
|
|
35214
35214
|
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
35215
35215
|
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
35216
35216
|
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
35217
|
+
// Levels: top, FORM, METHOD, FUNCTION-MODULE, (MODULE, AT, END-OF-*, GET, START-OF-SELECTION, TOP-OF-PAGE)
|
|
35218
|
+
//
|
|
35219
|
+
// Loop branching: LOOP, DO, WHILE, SELECT(loop), WITH, PROVIDE
|
|
35220
|
+
//
|
|
35221
|
+
// Branching: IF, CASE, CASE TYPE OF, TRY, ON, CATCH SYSTEM-EXCEPTIONS, AT
|
|
35222
|
+
//
|
|
35223
|
+
// Conditional exits: CHECK, ASSERT
|
|
35224
|
+
//
|
|
35225
|
+
// Exits: RETURN, EXIT, RAISE(not RESUMABLE), MESSAGE(type E and A?), CONTINUE, REJECT, RESUME, STOP
|
|
35226
|
+
//
|
|
35227
|
+
// Not handled? INCLUDE + malplaced macro calls
|
|
35228
|
+
/////////////////////////////////////
|
|
35229
|
+
// TODO: handling static exceptions(only static), refactor some logic from UncaughtException to common file
|
|
35230
|
+
// TODO: RAISE
|
|
35231
|
+
const FLOW_EVENTS = [
|
|
35232
|
+
Statements.StartOfSelection,
|
|
35233
|
+
Statements.AtSelectionScreen,
|
|
35234
|
+
Statements.AtLineSelection,
|
|
35235
|
+
Statements.AtUserCommand,
|
|
35236
|
+
Statements.EndOfSelection,
|
|
35237
|
+
Statements.Initialization,
|
|
35238
|
+
Statements.TopOfPage,
|
|
35239
|
+
Statements.EndOfPage,
|
|
35240
|
+
];
|
|
35217
35241
|
class StatementFlow {
|
|
35218
35242
|
constructor() {
|
|
35219
35243
|
this.counter = 0;
|
|
35220
35244
|
}
|
|
35221
35245
|
build(stru) {
|
|
35222
|
-
var _a, _b, _c;
|
|
35246
|
+
var _a, _b, _c, _d;
|
|
35223
35247
|
const ret = [];
|
|
35224
|
-
|
|
35248
|
+
let name = "";
|
|
35249
|
+
const structures = stru.findAllStructuresMulti([Structures.Form, Structures.ClassImplementation, Structures.FunctionModule]);
|
|
35225
35250
|
for (const s of structures) {
|
|
35226
|
-
let name = "";
|
|
35227
35251
|
if (s.get() instanceof Structures.Form) {
|
|
35228
35252
|
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
35253
|
+
ret.push(this.run(s, name));
|
|
35229
35254
|
}
|
|
35230
|
-
else if (s.get() instanceof Structures.
|
|
35231
|
-
|
|
35255
|
+
else if (s.get() instanceof Structures.ClassImplementation) {
|
|
35256
|
+
const className = (_b = s.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
35257
|
+
for (const method of s.findDirectStructures(Structures.Method)) {
|
|
35258
|
+
const methodName = (_c = method.findFirstExpression(Expressions.MethodName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
35259
|
+
name = "METHOD " + methodName + ", CLASS " + className;
|
|
35260
|
+
ret.push(this.run(method, name));
|
|
35261
|
+
}
|
|
35232
35262
|
}
|
|
35233
35263
|
else if (s.get() instanceof Structures.FunctionModule) {
|
|
35234
|
-
name = "FUNCTION " + ((
|
|
35264
|
+
name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
|
|
35265
|
+
ret.push(this.run(s, name));
|
|
35235
35266
|
}
|
|
35236
35267
|
else {
|
|
35237
35268
|
throw new Error("StatementFlow, unknown structure");
|
|
35238
35269
|
}
|
|
35239
|
-
|
|
35240
|
-
|
|
35241
|
-
|
|
35242
|
-
|
|
35270
|
+
}
|
|
35271
|
+
// find the top level events
|
|
35272
|
+
let inFlow = false;
|
|
35273
|
+
let collected = [];
|
|
35274
|
+
for (const s of stru.getChildren() || []) {
|
|
35275
|
+
if (FLOW_EVENTS.some(f => s.get() instanceof f)) {
|
|
35276
|
+
if (inFlow === true) {
|
|
35277
|
+
ret.push(this.runEvent(collected, name));
|
|
35278
|
+
}
|
|
35279
|
+
collected = [];
|
|
35280
|
+
inFlow = true;
|
|
35281
|
+
name = s.concatTokens();
|
|
35282
|
+
}
|
|
35283
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
35284
|
+
collected.push(s);
|
|
35285
|
+
}
|
|
35286
|
+
else {
|
|
35287
|
+
if (inFlow === true) {
|
|
35288
|
+
ret.push(this.runEvent(collected, name));
|
|
35289
|
+
inFlow = false;
|
|
35290
|
+
}
|
|
35291
|
+
collected = [];
|
|
35292
|
+
}
|
|
35293
|
+
}
|
|
35294
|
+
if (inFlow === true) {
|
|
35295
|
+
ret.push(this.runEvent(collected, name));
|
|
35296
|
+
inFlow = false;
|
|
35297
|
+
collected = [];
|
|
35243
35298
|
}
|
|
35244
35299
|
return ret.map(f => f.reduce());
|
|
35245
35300
|
}
|
|
35246
35301
|
////////////////////
|
|
35302
|
+
runEvent(s, name) {
|
|
35303
|
+
this.counter = 1;
|
|
35304
|
+
const graph = this.traverseBody(s, { procedureEnd: "end#1" });
|
|
35305
|
+
graph.setLabel(name);
|
|
35306
|
+
return graph;
|
|
35307
|
+
}
|
|
35308
|
+
run(s, name) {
|
|
35309
|
+
this.counter = 1;
|
|
35310
|
+
const graph = this.traverseBody(this.findBody(s), { procedureEnd: "end#1" });
|
|
35311
|
+
graph.setLabel(name);
|
|
35312
|
+
return graph;
|
|
35313
|
+
}
|
|
35247
35314
|
findBody(f) {
|
|
35248
35315
|
var _a;
|
|
35249
35316
|
return ((_a = f.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.getChildren()) || [];
|
|
@@ -43278,13 +43345,13 @@ class Help {
|
|
|
43278
43345
|
/////////////////////////////////////////////////
|
|
43279
43346
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43280
43347
|
let content = "";
|
|
43281
|
-
content = `
|
|
43282
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43283
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43284
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43285
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43286
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43287
|
-
<hr>
|
|
43348
|
+
content = `
|
|
43349
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43350
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43351
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43352
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43353
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43354
|
+
<hr>
|
|
43288
43355
|
` +
|
|
43289
43356
|
"<tt>" + textDocument.uri + " (" +
|
|
43290
43357
|
(position.line + 1) + ", " +
|
|
@@ -52554,7 +52621,7 @@ class Registry {
|
|
|
52554
52621
|
}
|
|
52555
52622
|
static abaplintVersion() {
|
|
52556
52623
|
// magic, see build script "version.sh"
|
|
52557
|
-
return "2.112.
|
|
52624
|
+
return "2.112.20";
|
|
52558
52625
|
}
|
|
52559
52626
|
getDDICReferences() {
|
|
52560
52627
|
return this.ddicReferences;
|
|
@@ -52873,10 +52940,10 @@ class SevenBitAscii {
|
|
|
52873
52940
|
key: "7bit_ascii",
|
|
52874
52941
|
title: "Check for 7bit ascii",
|
|
52875
52942
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
52876
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52877
|
-
|
|
52878
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52879
|
-
|
|
52943
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52944
|
+
|
|
52945
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52946
|
+
|
|
52880
52947
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
52881
52948
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52882
52949
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53082,10 +53149,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53082
53149
|
key: "abapdoc",
|
|
53083
53150
|
title: "Check abapdoc",
|
|
53084
53151
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53085
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53086
|
-
|
|
53087
|
-
Plus class and interface definitions.
|
|
53088
|
-
|
|
53152
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53153
|
+
|
|
53154
|
+
Plus class and interface definitions.
|
|
53155
|
+
|
|
53089
53156
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53090
53157
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53091
53158
|
};
|
|
@@ -53223,49 +53290,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53223
53290
|
key: "align_parameters",
|
|
53224
53291
|
title: "Align Parameters",
|
|
53225
53292
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53226
|
-
extendedInformation: `Checks:
|
|
53227
|
-
* function module calls
|
|
53228
|
-
* method calls
|
|
53229
|
-
* VALUE constructors
|
|
53230
|
-
* NEW constructors
|
|
53231
|
-
* RAISE EXCEPTION statements
|
|
53232
|
-
* CREATE OBJECT statements
|
|
53233
|
-
* RAISE EVENT statements
|
|
53234
|
-
|
|
53235
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53236
|
-
|
|
53237
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53238
|
-
|
|
53239
|
-
If parameters are on the same row, no issues are reported, see
|
|
53293
|
+
extendedInformation: `Checks:
|
|
53294
|
+
* function module calls
|
|
53295
|
+
* method calls
|
|
53296
|
+
* VALUE constructors
|
|
53297
|
+
* NEW constructors
|
|
53298
|
+
* RAISE EXCEPTION statements
|
|
53299
|
+
* CREATE OBJECT statements
|
|
53300
|
+
* RAISE EVENT statements
|
|
53301
|
+
|
|
53302
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53303
|
+
|
|
53304
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53305
|
+
|
|
53306
|
+
If parameters are on the same row, no issues are reported, see
|
|
53240
53307
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53241
53308
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53242
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53243
|
-
EXPORTING
|
|
53244
|
-
foo = 2
|
|
53245
|
-
parameter = 3.
|
|
53246
|
-
|
|
53247
|
-
foobar( moo = 1
|
|
53248
|
-
param = 1 ).
|
|
53249
|
-
|
|
53250
|
-
foo = VALUE #(
|
|
53251
|
-
foo = bar
|
|
53309
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53310
|
+
EXPORTING
|
|
53311
|
+
foo = 2
|
|
53312
|
+
parameter = 3.
|
|
53313
|
+
|
|
53314
|
+
foobar( moo = 1
|
|
53315
|
+
param = 1 ).
|
|
53316
|
+
|
|
53317
|
+
foo = VALUE #(
|
|
53318
|
+
foo = bar
|
|
53252
53319
|
moo = 2 ).`,
|
|
53253
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53254
|
-
EXPORTING
|
|
53255
|
-
foo = 2
|
|
53256
|
-
parameter = 3.
|
|
53257
|
-
|
|
53258
|
-
foobar( moo = 1
|
|
53259
|
-
param = 1 ).
|
|
53260
|
-
|
|
53261
|
-
foo = VALUE #(
|
|
53262
|
-
foo = bar
|
|
53263
|
-
moo = 2 ).
|
|
53264
|
-
|
|
53265
|
-
DATA(sdf) = VALUE type(
|
|
53266
|
-
common_val = 2
|
|
53267
|
-
another_common = 5
|
|
53268
|
-
( row_value = 4
|
|
53320
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53321
|
+
EXPORTING
|
|
53322
|
+
foo = 2
|
|
53323
|
+
parameter = 3.
|
|
53324
|
+
|
|
53325
|
+
foobar( moo = 1
|
|
53326
|
+
param = 1 ).
|
|
53327
|
+
|
|
53328
|
+
foo = VALUE #(
|
|
53329
|
+
foo = bar
|
|
53330
|
+
moo = 2 ).
|
|
53331
|
+
|
|
53332
|
+
DATA(sdf) = VALUE type(
|
|
53333
|
+
common_val = 2
|
|
53334
|
+
another_common = 5
|
|
53335
|
+
( row_value = 4
|
|
53269
53336
|
value_foo = 5 ) ).`,
|
|
53270
53337
|
};
|
|
53271
53338
|
}
|
|
@@ -53699,37 +53766,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
53699
53766
|
key: "align_type_expressions",
|
|
53700
53767
|
title: "Align TYPE expressions",
|
|
53701
53768
|
shortDescription: `Align TYPE expressions in statements`,
|
|
53702
|
-
extendedInformation: `
|
|
53703
|
-
Currently works for METHODS + BEGIN OF
|
|
53704
|
-
|
|
53705
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
53706
|
-
|
|
53707
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
53769
|
+
extendedInformation: `
|
|
53770
|
+
Currently works for METHODS + BEGIN OF
|
|
53771
|
+
|
|
53772
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
53773
|
+
|
|
53774
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
53708
53775
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
53709
53776
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
53710
|
-
badExample: `
|
|
53711
|
-
TYPES: BEGIN OF foo,
|
|
53712
|
-
bar TYPE i,
|
|
53713
|
-
foobar TYPE i,
|
|
53714
|
-
END OF foo.
|
|
53715
|
-
|
|
53716
|
-
INTERFACE lif.
|
|
53717
|
-
METHODS bar
|
|
53718
|
-
IMPORTING
|
|
53719
|
-
foo TYPE i
|
|
53720
|
-
foobar TYPE i.
|
|
53777
|
+
badExample: `
|
|
53778
|
+
TYPES: BEGIN OF foo,
|
|
53779
|
+
bar TYPE i,
|
|
53780
|
+
foobar TYPE i,
|
|
53781
|
+
END OF foo.
|
|
53782
|
+
|
|
53783
|
+
INTERFACE lif.
|
|
53784
|
+
METHODS bar
|
|
53785
|
+
IMPORTING
|
|
53786
|
+
foo TYPE i
|
|
53787
|
+
foobar TYPE i.
|
|
53721
53788
|
ENDINTERFACE.`,
|
|
53722
|
-
goodExample: `
|
|
53723
|
-
TYPES: BEGIN OF foo,
|
|
53724
|
-
bar TYPE i,
|
|
53725
|
-
foobar TYPE i,
|
|
53726
|
-
END OF foo.
|
|
53727
|
-
|
|
53728
|
-
INTERFACE lif.
|
|
53729
|
-
METHODS bar
|
|
53730
|
-
IMPORTING
|
|
53731
|
-
foo TYPE i
|
|
53732
|
-
foobar TYPE i.
|
|
53789
|
+
goodExample: `
|
|
53790
|
+
TYPES: BEGIN OF foo,
|
|
53791
|
+
bar TYPE i,
|
|
53792
|
+
foobar TYPE i,
|
|
53793
|
+
END OF foo.
|
|
53794
|
+
|
|
53795
|
+
INTERFACE lif.
|
|
53796
|
+
METHODS bar
|
|
53797
|
+
IMPORTING
|
|
53798
|
+
foo TYPE i
|
|
53799
|
+
foobar TYPE i.
|
|
53733
53800
|
ENDINTERFACE.`,
|
|
53734
53801
|
};
|
|
53735
53802
|
}
|
|
@@ -54008,15 +54075,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54008
54075
|
return {
|
|
54009
54076
|
key: "ambiguous_statement",
|
|
54010
54077
|
title: "Check for ambigious statements",
|
|
54011
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54012
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54013
|
-
|
|
54078
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54079
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54080
|
+
|
|
54014
54081
|
Only works if the target version is 740sp05 or above`,
|
|
54015
54082
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54016
|
-
badExample: `DELETE foo FROM bar.
|
|
54083
|
+
badExample: `DELETE foo FROM bar.
|
|
54017
54084
|
MODIFY foo FROM bar.`,
|
|
54018
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54019
|
-
MODIFY TABLE foo FROM bar.
|
|
54085
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54086
|
+
MODIFY TABLE foo FROM bar.
|
|
54020
54087
|
MODIFY zfoo FROM @wa.`,
|
|
54021
54088
|
};
|
|
54022
54089
|
}
|
|
@@ -54121,16 +54188,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54121
54188
|
key: "avoid_use",
|
|
54122
54189
|
title: "Avoid use of certain statements",
|
|
54123
54190
|
shortDescription: `Detects usage of certain statements.`,
|
|
54124
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54125
|
-
|
|
54126
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54127
|
-
|
|
54128
|
-
STATICS: use CLASS-DATA instead
|
|
54129
|
-
|
|
54130
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54131
|
-
|
|
54132
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54133
|
-
|
|
54191
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54192
|
+
|
|
54193
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54194
|
+
|
|
54195
|
+
STATICS: use CLASS-DATA instead
|
|
54196
|
+
|
|
54197
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54198
|
+
|
|
54199
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54200
|
+
|
|
54134
54201
|
BREAK points`,
|
|
54135
54202
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54136
54203
|
};
|
|
@@ -54262,11 +54329,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54262
54329
|
title: "Check BEGIN END names",
|
|
54263
54330
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54264
54331
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54265
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54266
|
-
field TYPE i,
|
|
54332
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54333
|
+
field TYPE i,
|
|
54267
54334
|
END OF structure_not_the_same.`,
|
|
54268
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54269
|
-
field TYPE i,
|
|
54335
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54336
|
+
field TYPE i,
|
|
54270
54337
|
END OF stru.`,
|
|
54271
54338
|
};
|
|
54272
54339
|
}
|
|
@@ -54363,20 +54430,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54363
54430
|
title: "BEGIN contains single INCLUDE",
|
|
54364
54431
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54365
54432
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54366
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54367
|
-
INCLUDE TYPE dselc.
|
|
54368
|
-
TYPES: END OF dummy1.
|
|
54369
|
-
|
|
54370
|
-
DATA BEGIN OF foo.
|
|
54371
|
-
INCLUDE STRUCTURE syst.
|
|
54372
|
-
DATA END OF foo.
|
|
54373
|
-
|
|
54374
|
-
STATICS BEGIN OF bar.
|
|
54375
|
-
INCLUDE STRUCTURE syst.
|
|
54433
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54434
|
+
INCLUDE TYPE dselc.
|
|
54435
|
+
TYPES: END OF dummy1.
|
|
54436
|
+
|
|
54437
|
+
DATA BEGIN OF foo.
|
|
54438
|
+
INCLUDE STRUCTURE syst.
|
|
54439
|
+
DATA END OF foo.
|
|
54440
|
+
|
|
54441
|
+
STATICS BEGIN OF bar.
|
|
54442
|
+
INCLUDE STRUCTURE syst.
|
|
54376
54443
|
STATICS END OF bar.`,
|
|
54377
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54378
|
-
DATA field TYPE i.
|
|
54379
|
-
INCLUDE STRUCTURE dselc.
|
|
54444
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54445
|
+
DATA field TYPE i.
|
|
54446
|
+
INCLUDE STRUCTURE dselc.
|
|
54380
54447
|
DATA END OF foo.`,
|
|
54381
54448
|
};
|
|
54382
54449
|
}
|
|
@@ -54466,9 +54533,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54466
54533
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54467
54534
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54468
54535
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54469
|
-
goodExample: `TRY.
|
|
54470
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54471
|
-
CATCH cx_sy_authorization_error.
|
|
54536
|
+
goodExample: `TRY.
|
|
54537
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54538
|
+
CATCH cx_sy_authorization_error.
|
|
54472
54539
|
ENDTRY.`,
|
|
54473
54540
|
};
|
|
54474
54541
|
}
|
|
@@ -54533,10 +54600,10 @@ class CDSCommentStyle {
|
|
|
54533
54600
|
key: "cds_comment_style",
|
|
54534
54601
|
title: "CDS Comment Style",
|
|
54535
54602
|
shortDescription: `Check for obsolete comment style`,
|
|
54536
|
-
extendedInformation: `Check for obsolete comment style
|
|
54537
|
-
|
|
54538
|
-
Comments starting with "--" are considered obsolete
|
|
54539
|
-
|
|
54603
|
+
extendedInformation: `Check for obsolete comment style
|
|
54604
|
+
|
|
54605
|
+
Comments starting with "--" are considered obsolete
|
|
54606
|
+
|
|
54540
54607
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54541
54608
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54542
54609
|
badExample: "-- this is a comment",
|
|
@@ -54602,10 +54669,10 @@ class CDSLegacyView {
|
|
|
54602
54669
|
key: "cds_legacy_view",
|
|
54603
54670
|
title: "CDS Legacy View",
|
|
54604
54671
|
shortDescription: `Identify CDS Legacy Views`,
|
|
54605
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54606
|
-
|
|
54607
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54608
|
-
|
|
54672
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54673
|
+
|
|
54674
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54675
|
+
|
|
54609
54676
|
v755 and up`,
|
|
54610
54677
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54611
54678
|
};
|
|
@@ -54760,10 +54827,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
54760
54827
|
key: "chain_mainly_declarations",
|
|
54761
54828
|
title: "Chain mainly declarations",
|
|
54762
54829
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
54763
|
-
extendedInformation: `
|
|
54764
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
54765
|
-
|
|
54766
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
54830
|
+
extendedInformation: `
|
|
54831
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
54832
|
+
|
|
54833
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
54767
54834
|
`,
|
|
54768
54835
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54769
54836
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -54939,17 +55006,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
54939
55006
|
title: "Change IF to CASE",
|
|
54940
55007
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
54941
55008
|
// eslint-disable-next-line max-len
|
|
54942
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54943
|
-
|
|
55009
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55010
|
+
|
|
54944
55011
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
54945
55012
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54946
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54947
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54948
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55013
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55014
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55015
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
54949
55016
|
ENDIF.`,
|
|
54950
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
54951
|
-
WHEN 'FOO'.
|
|
54952
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55017
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55018
|
+
WHEN 'FOO'.
|
|
55019
|
+
WHEN 'BAR' OR 'MOO'.
|
|
54953
55020
|
ENDCASE.`,
|
|
54954
55021
|
};
|
|
54955
55022
|
}
|
|
@@ -55086,8 +55153,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55086
55153
|
return {
|
|
55087
55154
|
key: "check_abstract",
|
|
55088
55155
|
title: "Check abstract methods and classes",
|
|
55089
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55090
|
-
- class defined as abstract and final,
|
|
55156
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55157
|
+
- class defined as abstract and final,
|
|
55091
55158
|
- non-abstract class contains abstract methods`,
|
|
55092
55159
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55093
55160
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55168,11 +55235,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55168
55235
|
return {
|
|
55169
55236
|
key: "check_comments",
|
|
55170
55237
|
title: "Check Comments",
|
|
55171
|
-
shortDescription: `
|
|
55238
|
+
shortDescription: `
|
|
55172
55239
|
Various checks for comment usage.`,
|
|
55173
|
-
extendedInformation: `
|
|
55174
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55175
|
-
|
|
55240
|
+
extendedInformation: `
|
|
55241
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55242
|
+
|
|
55176
55243
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55177
55244
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55178
55245
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55334,9 +55401,9 @@ class CheckInclude {
|
|
|
55334
55401
|
key: "check_include",
|
|
55335
55402
|
title: "Check INCLUDEs",
|
|
55336
55403
|
shortDescription: `Checks INCLUDE statements`,
|
|
55337
|
-
extendedInformation: `
|
|
55338
|
-
* Reports unused includes
|
|
55339
|
-
* Errors if the includes are not found
|
|
55404
|
+
extendedInformation: `
|
|
55405
|
+
* Reports unused includes
|
|
55406
|
+
* Errors if the includes are not found
|
|
55340
55407
|
* Error if including a main program`,
|
|
55341
55408
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55342
55409
|
};
|
|
@@ -55412,14 +55479,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55412
55479
|
key: "check_subrc",
|
|
55413
55480
|
title: "Check sy-subrc",
|
|
55414
55481
|
shortDescription: `Check sy-subrc`,
|
|
55415
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55416
|
-
|
|
55417
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55418
|
-
|
|
55419
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55420
|
-
|
|
55421
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55422
|
-
|
|
55482
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55483
|
+
|
|
55484
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55485
|
+
|
|
55486
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55487
|
+
|
|
55488
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55489
|
+
|
|
55423
55490
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55424
55491
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55425
55492
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -55989,17 +56056,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
55989
56056
|
shortDescription: `Find overlapping classic exceptions`,
|
|
55990
56057
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
55991
56058
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55992
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55993
|
-
EXCEPTIONS
|
|
55994
|
-
system_failure = 1 MESSAGE lv_message
|
|
55995
|
-
communication_failure = 1 MESSAGE lv_message
|
|
55996
|
-
resource_failure = 1
|
|
56059
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56060
|
+
EXCEPTIONS
|
|
56061
|
+
system_failure = 1 MESSAGE lv_message
|
|
56062
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56063
|
+
resource_failure = 1
|
|
55997
56064
|
OTHERS = 1.`,
|
|
55998
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55999
|
-
EXCEPTIONS
|
|
56000
|
-
system_failure = 1 MESSAGE lv_message
|
|
56001
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56002
|
-
resource_failure = 3
|
|
56065
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56066
|
+
EXCEPTIONS
|
|
56067
|
+
system_failure = 1 MESSAGE lv_message
|
|
56068
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56069
|
+
resource_failure = 3
|
|
56003
56070
|
OTHERS = 4.`,
|
|
56004
56071
|
};
|
|
56005
56072
|
}
|
|
@@ -56245,7 +56312,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56245
56312
|
key: "commented_code",
|
|
56246
56313
|
title: "Find commented code",
|
|
56247
56314
|
shortDescription: `Detects usage of commented out code.`,
|
|
56248
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56315
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56249
56316
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56250
56317
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56251
56318
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56478,10 +56545,10 @@ class ConstructorVisibilityPublic {
|
|
|
56478
56545
|
key: "constructor_visibility_public",
|
|
56479
56546
|
title: "Check constructor visibility is public",
|
|
56480
56547
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56481
|
-
extendedInformation: `
|
|
56482
|
-
This only applies to global classes.
|
|
56483
|
-
|
|
56484
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56548
|
+
extendedInformation: `
|
|
56549
|
+
This only applies to global classes.
|
|
56550
|
+
|
|
56551
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56485
56552
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56486
56553
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56487
56554
|
};
|
|
@@ -56556,8 +56623,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56556
56623
|
key: "contains_tab",
|
|
56557
56624
|
title: "Code contains tab",
|
|
56558
56625
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56559
|
-
extendedInformation: `
|
|
56560
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56626
|
+
extendedInformation: `
|
|
56627
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56561
56628
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56562
56629
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56563
56630
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -56644,10 +56711,10 @@ class CyclicOO {
|
|
|
56644
56711
|
key: "cyclic_oo",
|
|
56645
56712
|
title: "Cyclic OO",
|
|
56646
56713
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
56647
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56648
|
-
|
|
56649
|
-
Objects must be without syntax errors for this rule to take effect
|
|
56650
|
-
|
|
56714
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56715
|
+
|
|
56716
|
+
Objects must be without syntax errors for this rule to take effect
|
|
56717
|
+
|
|
56651
56718
|
References in testclass includes are ignored`,
|
|
56652
56719
|
};
|
|
56653
56720
|
}
|
|
@@ -56889,7 +56956,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
56889
56956
|
key: "dangerous_statement",
|
|
56890
56957
|
title: "Dangerous statement",
|
|
56891
56958
|
shortDescription: `Detects potentially dangerous statements`,
|
|
56892
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56959
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56893
56960
|
dynamic SQL can potentially create SQL injection problems`,
|
|
56894
56961
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
56895
56962
|
};
|
|
@@ -57093,13 +57160,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57093
57160
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57094
57161
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57095
57162
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57096
|
-
badExample: `FROM foo.
|
|
57097
|
-
WRITE 'hello'.
|
|
57098
|
-
DATA int TYPE i.
|
|
57163
|
+
badExample: `FROM foo.
|
|
57164
|
+
WRITE 'hello'.
|
|
57165
|
+
DATA int TYPE i.
|
|
57099
57166
|
ENDFORM.`,
|
|
57100
|
-
goodExample: `FROM foo.
|
|
57101
|
-
DATA int TYPE i.
|
|
57102
|
-
WRITE 'hello'.
|
|
57167
|
+
goodExample: `FROM foo.
|
|
57168
|
+
DATA int TYPE i.
|
|
57169
|
+
WRITE 'hello'.
|
|
57103
57170
|
ENDFORM.`,
|
|
57104
57171
|
};
|
|
57105
57172
|
}
|
|
@@ -57638,39 +57705,39 @@ class Downport {
|
|
|
57638
57705
|
key: "downport",
|
|
57639
57706
|
title: "Downport statement",
|
|
57640
57707
|
shortDescription: `Downport functionality`,
|
|
57641
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57642
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57643
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57644
|
-
|
|
57645
|
-
Current rules:
|
|
57646
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57647
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57648
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
57649
|
-
* CONV is outlined
|
|
57650
|
-
* COND is outlined
|
|
57651
|
-
* REDUCE is outlined
|
|
57652
|
-
* SWITCH is outlined
|
|
57653
|
-
* FILTER is outlined
|
|
57654
|
-
* APPEND expression is outlined
|
|
57655
|
-
* INSERT expression is outlined
|
|
57656
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57657
|
-
* CAST changed to ?=
|
|
57658
|
-
* LOOP AT method_call( ) is outlined
|
|
57659
|
-
* VALUE # with structure fields
|
|
57660
|
-
* VALUE # with internal table lines
|
|
57661
|
-
* Table Expressions are outlined
|
|
57662
|
-
* SELECT INTO @DATA definitions are outlined
|
|
57663
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57664
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57665
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57666
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
57667
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57668
|
-
* line_exists and line_index is downported to READ TABLE
|
|
57669
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
57670
|
-
* MESSAGE with non simple source
|
|
57671
|
-
|
|
57672
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57673
|
-
|
|
57708
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57709
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57710
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57711
|
+
|
|
57712
|
+
Current rules:
|
|
57713
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57714
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57715
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
57716
|
+
* CONV is outlined
|
|
57717
|
+
* COND is outlined
|
|
57718
|
+
* REDUCE is outlined
|
|
57719
|
+
* SWITCH is outlined
|
|
57720
|
+
* FILTER is outlined
|
|
57721
|
+
* APPEND expression is outlined
|
|
57722
|
+
* INSERT expression is outlined
|
|
57723
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57724
|
+
* CAST changed to ?=
|
|
57725
|
+
* LOOP AT method_call( ) is outlined
|
|
57726
|
+
* VALUE # with structure fields
|
|
57727
|
+
* VALUE # with internal table lines
|
|
57728
|
+
* Table Expressions are outlined
|
|
57729
|
+
* SELECT INTO @DATA definitions are outlined
|
|
57730
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57731
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57732
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57733
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
57734
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57735
|
+
* line_exists and line_index is downported to READ TABLE
|
|
57736
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
57737
|
+
* MESSAGE with non simple source
|
|
57738
|
+
|
|
57739
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57740
|
+
|
|
57674
57741
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
57675
57742
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
57676
57743
|
};
|
|
@@ -58248,10 +58315,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58248
58315
|
const fieldName = f.concatTokens();
|
|
58249
58316
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58250
58317
|
}
|
|
58251
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58318
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58252
58319
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58253
58320
|
}
|
|
58254
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58321
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58255
58322
|
${indentation}`);
|
|
58256
58323
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58257
58324
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58295,12 +58362,12 @@ ${indentation}`);
|
|
|
58295
58362
|
}
|
|
58296
58363
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58297
58364
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
58298
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58299
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58300
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58365
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58366
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58367
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58301
58368
|
${indentation}`);
|
|
58302
58369
|
if (fieldDefinitions === "") {
|
|
58303
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58370
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58304
58371
|
${indentation}`);
|
|
58305
58372
|
}
|
|
58306
58373
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58368,7 +58435,7 @@ ${indentation}`);
|
|
|
58368
58435
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58369
58436
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58370
58437
|
const firstToken = high.getFirstToken();
|
|
58371
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58438
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58372
58439
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58373
58440
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58374
58441
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58422,7 +58489,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58422
58489
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58423
58490
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58424
58491
|
const firstToken = high.getFirstToken();
|
|
58425
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58492
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58426
58493
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58427
58494
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58428
58495
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58464,14 +58531,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58464
58531
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58465
58532
|
const firstToken = high.getFirstToken();
|
|
58466
58533
|
// note that the tabix restore should be done before throwing the exception
|
|
58467
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58468
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58469
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58470
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58471
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58472
|
-
${indentation}IF sy-subrc <> 0.
|
|
58473
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58474
|
-
${indentation}ENDIF.
|
|
58534
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58535
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58536
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58537
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58538
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58539
|
+
${indentation}IF sy-subrc <> 0.
|
|
58540
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58541
|
+
${indentation}ENDIF.
|
|
58475
58542
|
${indentation}`);
|
|
58476
58543
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58477
58544
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58528,7 +58595,7 @@ ${indentation}`);
|
|
|
58528
58595
|
const className = classNames[0].concatTokens();
|
|
58529
58596
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58530
58597
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58531
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58598
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58532
58599
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58533
58600
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58534
58601
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -58690,16 +58757,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
58690
58757
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58691
58758
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58692
58759
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58693
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
58694
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
58760
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
58761
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
58695
58762
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
58696
58763
|
if (withs.length > 0) {
|
|
58697
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
58698
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
58699
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
58764
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
58765
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
58766
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
58700
58767
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
58701
58768
|
}
|
|
58702
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
58769
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
58703
58770
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
58704
58771
|
if (withs.length > 0) {
|
|
58705
58772
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -58811,10 +58878,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
58811
58878
|
let code = "";
|
|
58812
58879
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
58813
58880
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58814
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58815
|
-
IF sy-subrc <> 0.
|
|
58816
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58817
|
-
ENDIF.
|
|
58881
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58882
|
+
IF sy-subrc <> 0.
|
|
58883
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58884
|
+
ENDIF.
|
|
58818
58885
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
58819
58886
|
}
|
|
58820
58887
|
else {
|
|
@@ -58903,20 +58970,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
58903
58970
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58904
58971
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58905
58972
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58906
|
-
code += ` items LIKE ${loopSourceName},
|
|
58907
|
-
END OF ${groupTargetName}type.
|
|
58908
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58909
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58973
|
+
code += ` items LIKE ${loopSourceName},
|
|
58974
|
+
END OF ${groupTargetName}type.
|
|
58975
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58976
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58910
58977
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
58911
58978
|
if (groupIndexName !== undefined) {
|
|
58912
58979
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
58913
58980
|
}
|
|
58914
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58981
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58915
58982
|
IF sy-subrc = 0.\n`;
|
|
58916
58983
|
if (groupCountName !== undefined) {
|
|
58917
58984
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
58918
58985
|
}
|
|
58919
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58986
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58920
58987
|
ELSE.\n`;
|
|
58921
58988
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
58922
58989
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -58937,8 +59004,8 @@ ELSE.\n`;
|
|
|
58937
59004
|
}
|
|
58938
59005
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
58939
59006
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
58940
|
-
code += `ENDIF.
|
|
58941
|
-
ENDLOOP.
|
|
59007
|
+
code += `ENDIF.
|
|
59008
|
+
ENDLOOP.
|
|
58942
59009
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
58943
59010
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
58944
59011
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59110,7 +59177,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59110
59177
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59111
59178
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59112
59179
|
// all ENUMS are char like?
|
|
59113
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59180
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59114
59181
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59115
59182
|
let count = 1;
|
|
59116
59183
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59154,14 +59221,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59154
59221
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59155
59222
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59156
59223
|
// restore tabix before exeption
|
|
59157
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59158
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59159
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59160
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59161
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59162
|
-
${indentation}IF sy-subrc <> 0.
|
|
59163
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59164
|
-
${indentation}ENDIF.
|
|
59224
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59225
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59226
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59227
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59228
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59229
|
+
${indentation}IF sy-subrc <> 0.
|
|
59230
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59231
|
+
${indentation}ENDIF.
|
|
59165
59232
|
${indentation}${uniqueName}`;
|
|
59166
59233
|
const start = target.getFirstToken().getStart();
|
|
59167
59234
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59245,11 +59312,11 @@ ${indentation}${uniqueName}`;
|
|
|
59245
59312
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59246
59313
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59247
59314
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59248
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59249
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59250
|
-
${indentation} EXPORTING
|
|
59251
|
-
${indentation} input = ${source}
|
|
59252
|
-
${indentation} IMPORTING
|
|
59315
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59316
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59317
|
+
${indentation} EXPORTING
|
|
59318
|
+
${indentation} input = ${source}
|
|
59319
|
+
${indentation} IMPORTING
|
|
59253
59320
|
${indentation} output = ${uniqueName}.\n`;
|
|
59254
59321
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59255
59322
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60561,12 +60628,12 @@ class EasyToFindMessages {
|
|
|
60561
60628
|
key: "easy_to_find_messages",
|
|
60562
60629
|
title: "Easy to find messages",
|
|
60563
60630
|
shortDescription: `Make messages easy to find`,
|
|
60564
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60565
|
-
|
|
60566
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60567
|
-
|
|
60568
|
-
Also see rule "message_exists"
|
|
60569
|
-
|
|
60631
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60632
|
+
|
|
60633
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60634
|
+
|
|
60635
|
+
Also see rule "message_exists"
|
|
60636
|
+
|
|
60570
60637
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60571
60638
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60572
60639
|
};
|
|
@@ -60651,8 +60718,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
60651
60718
|
key: "empty_line_in_statement",
|
|
60652
60719
|
title: "Find empty lines in statements",
|
|
60653
60720
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
60654
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
60655
|
-
|
|
60721
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
60722
|
+
|
|
60656
60723
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
60657
60724
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
60658
60725
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -60828,13 +60895,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60828
60895
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
60829
60896
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
60830
60897
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60831
|
-
badExample: `IF foo = bar.
|
|
60832
|
-
ENDIF.
|
|
60833
|
-
|
|
60834
|
-
DO 2 TIMES.
|
|
60898
|
+
badExample: `IF foo = bar.
|
|
60899
|
+
ENDIF.
|
|
60900
|
+
|
|
60901
|
+
DO 2 TIMES.
|
|
60835
60902
|
ENDDO.`,
|
|
60836
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60837
|
-
ENDLOOP.
|
|
60903
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60904
|
+
ENDLOOP.
|
|
60838
60905
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
60839
60906
|
};
|
|
60840
60907
|
}
|
|
@@ -60976,10 +61043,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
60976
61043
|
return {
|
|
60977
61044
|
key: "exit_or_check",
|
|
60978
61045
|
title: "Find EXIT or CHECK outside loops",
|
|
60979
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61046
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60980
61047
|
Use RETURN to leave procesing blocks instead.`,
|
|
60981
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60982
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61048
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61049
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60983
61050
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
60984
61051
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60985
61052
|
};
|
|
@@ -61062,12 +61129,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61062
61129
|
key: "expand_macros",
|
|
61063
61130
|
title: "Expand Macros",
|
|
61064
61131
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61065
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61066
|
-
|
|
61132
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61133
|
+
|
|
61067
61134
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61068
|
-
badExample: `DEFINE _hello.
|
|
61069
|
-
WRITE 'hello'.
|
|
61070
|
-
END-OF-DEFINITION.
|
|
61135
|
+
badExample: `DEFINE _hello.
|
|
61136
|
+
WRITE 'hello'.
|
|
61137
|
+
END-OF-DEFINITION.
|
|
61071
61138
|
_hello.`,
|
|
61072
61139
|
goodExample: `WRITE 'hello'.`,
|
|
61073
61140
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61154,7 +61221,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61154
61221
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61155
61222
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61156
61223
|
goodExample: `call_method( foo = bar ).`,
|
|
61157
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61224
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61158
61225
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61159
61226
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61160
61227
|
};
|
|
@@ -61252,7 +61319,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61252
61319
|
key: "forbidden_identifier",
|
|
61253
61320
|
title: "Forbidden Identifier",
|
|
61254
61321
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61255
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61322
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61256
61323
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61257
61324
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61258
61325
|
};
|
|
@@ -61494,8 +61561,8 @@ class ForbiddenVoidType {
|
|
|
61494
61561
|
key: "forbidden_void_type",
|
|
61495
61562
|
title: "Forbidden Void Types",
|
|
61496
61563
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61497
|
-
extendedInformation: `Inspiration:
|
|
61498
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61564
|
+
extendedInformation: `Inspiration:
|
|
61565
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61499
61566
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61500
61567
|
};
|
|
61501
61568
|
}
|
|
@@ -61738,7 +61805,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
61738
61805
|
key: "fully_type_itabs",
|
|
61739
61806
|
title: "Fully type internal tables",
|
|
61740
61807
|
shortDescription: `No implict table types or table keys`,
|
|
61741
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
61808
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
61742
61809
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
61743
61810
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
61744
61811
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -61923,26 +61990,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
61923
61990
|
key: "functional_writing",
|
|
61924
61991
|
title: "Use functional writing",
|
|
61925
61992
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
61926
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61993
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61927
61994
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
61928
61995
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61929
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61930
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61931
|
-
EXPORTING
|
|
61932
|
-
p_name = 'NAME'
|
|
61933
|
-
RECEIVING
|
|
61934
|
-
p_descr_ref = lr_typedescr
|
|
61935
|
-
EXCEPTIONS
|
|
61936
|
-
type_not_found = 1
|
|
61996
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61997
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61998
|
+
EXPORTING
|
|
61999
|
+
p_name = 'NAME'
|
|
62000
|
+
RECEIVING
|
|
62001
|
+
p_descr_ref = lr_typedescr
|
|
62002
|
+
EXCEPTIONS
|
|
62003
|
+
type_not_found = 1
|
|
61937
62004
|
OTHERS = 2.`,
|
|
61938
|
-
goodExample: `zcl_class=>method( ).
|
|
61939
|
-
cl_abap_typedescr=>describe_by_name(
|
|
61940
|
-
EXPORTING
|
|
61941
|
-
p_name = 'NAME'
|
|
61942
|
-
RECEIVING
|
|
61943
|
-
p_descr_ref = lr_typedescr
|
|
61944
|
-
EXCEPTIONS
|
|
61945
|
-
type_not_found = 1
|
|
62005
|
+
goodExample: `zcl_class=>method( ).
|
|
62006
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62007
|
+
EXPORTING
|
|
62008
|
+
p_name = 'NAME'
|
|
62009
|
+
RECEIVING
|
|
62010
|
+
p_descr_ref = lr_typedescr
|
|
62011
|
+
EXCEPTIONS
|
|
62012
|
+
type_not_found = 1
|
|
61946
62013
|
OTHERS = 2 ).`,
|
|
61947
62014
|
};
|
|
61948
62015
|
}
|
|
@@ -62053,14 +62120,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62053
62120
|
key: "global_class",
|
|
62054
62121
|
title: "Global class checks",
|
|
62055
62122
|
shortDescription: `Checks related to global classes`,
|
|
62056
|
-
extendedInformation: `* global classes must be in own files
|
|
62057
|
-
|
|
62058
|
-
* file names must match class name
|
|
62059
|
-
|
|
62060
|
-
* file names must match interface name
|
|
62061
|
-
|
|
62062
|
-
* global classes must be global definitions
|
|
62063
|
-
|
|
62123
|
+
extendedInformation: `* global classes must be in own files
|
|
62124
|
+
|
|
62125
|
+
* file names must match class name
|
|
62126
|
+
|
|
62127
|
+
* file names must match interface name
|
|
62128
|
+
|
|
62129
|
+
* global classes must be global definitions
|
|
62130
|
+
|
|
62064
62131
|
* global interfaces must be global definitions`,
|
|
62065
62132
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62066
62133
|
};
|
|
@@ -62159,21 +62226,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62159
62226
|
return {
|
|
62160
62227
|
key: "identical_conditions",
|
|
62161
62228
|
title: "Identical conditions",
|
|
62162
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62163
|
-
|
|
62229
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62230
|
+
|
|
62164
62231
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62165
62232
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62166
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62167
|
-
ENDIF.
|
|
62168
|
-
CASE bar.
|
|
62169
|
-
WHEN '1'.
|
|
62170
|
-
WHEN 'A' OR '1'.
|
|
62233
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62234
|
+
ENDIF.
|
|
62235
|
+
CASE bar.
|
|
62236
|
+
WHEN '1'.
|
|
62237
|
+
WHEN 'A' OR '1'.
|
|
62171
62238
|
ENDCASE.`,
|
|
62172
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62173
|
-
ENDIF.
|
|
62174
|
-
CASE bar.
|
|
62175
|
-
WHEN '1'.
|
|
62176
|
-
WHEN 'A'.
|
|
62239
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62240
|
+
ENDIF.
|
|
62241
|
+
CASE bar.
|
|
62242
|
+
WHEN '1'.
|
|
62243
|
+
WHEN 'A'.
|
|
62177
62244
|
ENDCASE.`,
|
|
62178
62245
|
};
|
|
62179
62246
|
}
|
|
@@ -62307,23 +62374,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62307
62374
|
key: "identical_contents",
|
|
62308
62375
|
title: "Identical contents",
|
|
62309
62376
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62310
|
-
extendedInformation: `
|
|
62311
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62312
|
-
|
|
62377
|
+
extendedInformation: `
|
|
62378
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62379
|
+
|
|
62313
62380
|
Chained statments are ignored`,
|
|
62314
62381
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62315
|
-
badExample: `IF foo = bar.
|
|
62316
|
-
WRITE 'bar'.
|
|
62317
|
-
WRITE 'world'.
|
|
62318
|
-
ELSE.
|
|
62319
|
-
WRITE 'foo'.
|
|
62320
|
-
WRITE 'world'.
|
|
62382
|
+
badExample: `IF foo = bar.
|
|
62383
|
+
WRITE 'bar'.
|
|
62384
|
+
WRITE 'world'.
|
|
62385
|
+
ELSE.
|
|
62386
|
+
WRITE 'foo'.
|
|
62387
|
+
WRITE 'world'.
|
|
62321
62388
|
ENDIF.`,
|
|
62322
|
-
goodExample: `IF foo = bar.
|
|
62323
|
-
WRITE 'bar'.
|
|
62324
|
-
ELSE.
|
|
62325
|
-
WRITE 'foo'.
|
|
62326
|
-
ENDIF.
|
|
62389
|
+
goodExample: `IF foo = bar.
|
|
62390
|
+
WRITE 'bar'.
|
|
62391
|
+
ELSE.
|
|
62392
|
+
WRITE 'foo'.
|
|
62393
|
+
ENDIF.
|
|
62327
62394
|
WRITE 'world'.`,
|
|
62328
62395
|
};
|
|
62329
62396
|
}
|
|
@@ -62431,12 +62498,12 @@ class IdenticalDescriptions {
|
|
|
62431
62498
|
key: "identical_descriptions",
|
|
62432
62499
|
title: "Identical descriptions",
|
|
62433
62500
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62434
|
-
extendedInformation: `Case insensitive
|
|
62435
|
-
|
|
62436
|
-
Only checks the master language descriptions
|
|
62437
|
-
|
|
62438
|
-
Dependencies are skipped
|
|
62439
|
-
|
|
62501
|
+
extendedInformation: `Case insensitive
|
|
62502
|
+
|
|
62503
|
+
Only checks the master language descriptions
|
|
62504
|
+
|
|
62505
|
+
Dependencies are skipped
|
|
62506
|
+
|
|
62440
62507
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62441
62508
|
tags: [],
|
|
62442
62509
|
};
|
|
@@ -62610,43 +62677,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
62610
62677
|
key: "if_in_if",
|
|
62611
62678
|
title: "IF in IF",
|
|
62612
62679
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
62613
|
-
extendedInformation: `
|
|
62614
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
62615
|
-
|
|
62616
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
62617
|
-
|
|
62618
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
62680
|
+
extendedInformation: `
|
|
62681
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
62682
|
+
|
|
62683
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
62684
|
+
|
|
62685
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
62619
62686
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
62620
|
-
badExample: `IF condition1.
|
|
62621
|
-
IF condition2.
|
|
62622
|
-
...
|
|
62623
|
-
ENDIF.
|
|
62624
|
-
ENDIF.
|
|
62625
|
-
|
|
62626
|
-
IF condition1.
|
|
62627
|
-
...
|
|
62628
|
-
ELSE.
|
|
62629
|
-
IF condition2.
|
|
62630
|
-
...
|
|
62631
|
-
ENDIF.
|
|
62687
|
+
badExample: `IF condition1.
|
|
62688
|
+
IF condition2.
|
|
62689
|
+
...
|
|
62690
|
+
ENDIF.
|
|
62691
|
+
ENDIF.
|
|
62692
|
+
|
|
62693
|
+
IF condition1.
|
|
62694
|
+
...
|
|
62695
|
+
ELSE.
|
|
62696
|
+
IF condition2.
|
|
62697
|
+
...
|
|
62698
|
+
ENDIF.
|
|
62632
62699
|
ENDIF.`,
|
|
62633
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
62634
|
-
...
|
|
62635
|
-
ENDIF.
|
|
62636
|
-
|
|
62637
|
-
IF condition1.
|
|
62638
|
-
...
|
|
62639
|
-
ELSEIF condition2.
|
|
62640
|
-
...
|
|
62641
|
-
ENDIF.
|
|
62642
|
-
|
|
62643
|
-
CASE variable.
|
|
62644
|
-
WHEN value1.
|
|
62645
|
-
...
|
|
62646
|
-
WHEN value2.
|
|
62647
|
-
IF condition2.
|
|
62648
|
-
...
|
|
62649
|
-
ENDIF.
|
|
62700
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
62701
|
+
...
|
|
62702
|
+
ENDIF.
|
|
62703
|
+
|
|
62704
|
+
IF condition1.
|
|
62705
|
+
...
|
|
62706
|
+
ELSEIF condition2.
|
|
62707
|
+
...
|
|
62708
|
+
ENDIF.
|
|
62709
|
+
|
|
62710
|
+
CASE variable.
|
|
62711
|
+
WHEN value1.
|
|
62712
|
+
...
|
|
62713
|
+
WHEN value2.
|
|
62714
|
+
IF condition2.
|
|
62715
|
+
...
|
|
62716
|
+
ENDIF.
|
|
62650
62717
|
ENDCASE.`,
|
|
62651
62718
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62652
62719
|
};
|
|
@@ -62831,9 +62898,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
62831
62898
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
62832
62899
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
62833
62900
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
62834
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62835
|
-
METHOD ${methodName.toLowerCase()}.
|
|
62836
|
-
RETURN. " todo, implement method
|
|
62901
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62902
|
+
METHOD ${methodName.toLowerCase()}.
|
|
62903
|
+
RETURN. " todo, implement method
|
|
62837
62904
|
ENDMETHOD.`);
|
|
62838
62905
|
}
|
|
62839
62906
|
}
|
|
@@ -63021,19 +63088,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63021
63088
|
key: "in_statement_indentation",
|
|
63022
63089
|
title: "In-statement indentation",
|
|
63023
63090
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63024
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63025
|
-
|
|
63026
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63091
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63092
|
+
|
|
63093
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63027
63094
|
to distinguish them better from code within the block.`,
|
|
63028
|
-
badExample: `IF 1 = 1
|
|
63029
|
-
AND 2 = 2.
|
|
63030
|
-
WRITE 'hello' &&
|
|
63031
|
-
'world'.
|
|
63095
|
+
badExample: `IF 1 = 1
|
|
63096
|
+
AND 2 = 2.
|
|
63097
|
+
WRITE 'hello' &&
|
|
63098
|
+
'world'.
|
|
63032
63099
|
ENDIF.`,
|
|
63033
|
-
goodExample: `IF 1 = 1
|
|
63034
|
-
AND 2 = 2.
|
|
63035
|
-
WRITE 'hello' &&
|
|
63036
|
-
'world'.
|
|
63100
|
+
goodExample: `IF 1 = 1
|
|
63101
|
+
AND 2 = 2.
|
|
63102
|
+
WRITE 'hello' &&
|
|
63103
|
+
'world'.
|
|
63037
63104
|
ENDIF.`,
|
|
63038
63105
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63039
63106
|
};
|
|
@@ -63156,23 +63223,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63156
63223
|
title: "Indentation",
|
|
63157
63224
|
shortDescription: `Checks indentation`,
|
|
63158
63225
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63159
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63160
|
-
PRIVATE SECTION.
|
|
63161
|
-
METHODS constructor.
|
|
63162
|
-
ENDCLASS.
|
|
63163
|
-
|
|
63164
|
-
CLASS lcl IMPLEMENTATION.
|
|
63165
|
-
METHOD constructor.
|
|
63166
|
-
ENDMETHOD.
|
|
63226
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63227
|
+
PRIVATE SECTION.
|
|
63228
|
+
METHODS constructor.
|
|
63229
|
+
ENDCLASS.
|
|
63230
|
+
|
|
63231
|
+
CLASS lcl IMPLEMENTATION.
|
|
63232
|
+
METHOD constructor.
|
|
63233
|
+
ENDMETHOD.
|
|
63167
63234
|
ENDCLASS.`,
|
|
63168
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63169
|
-
PRIVATE SECTION.
|
|
63170
|
-
METHODS constructor.
|
|
63171
|
-
ENDCLASS.
|
|
63172
|
-
|
|
63173
|
-
CLASS lcl IMPLEMENTATION.
|
|
63174
|
-
METHOD constructor.
|
|
63175
|
-
ENDMETHOD.
|
|
63235
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63236
|
+
PRIVATE SECTION.
|
|
63237
|
+
METHODS constructor.
|
|
63238
|
+
ENDCLASS.
|
|
63239
|
+
|
|
63240
|
+
CLASS lcl IMPLEMENTATION.
|
|
63241
|
+
METHOD constructor.
|
|
63242
|
+
ENDMETHOD.
|
|
63176
63243
|
ENDCLASS.`,
|
|
63177
63244
|
};
|
|
63178
63245
|
}
|
|
@@ -63562,9 +63629,9 @@ class IntfReferencingClas {
|
|
|
63562
63629
|
key: "intf_referencing_clas",
|
|
63563
63630
|
title: "INTF referencing CLAS",
|
|
63564
63631
|
shortDescription: `Interface contains references to class`,
|
|
63565
|
-
extendedInformation: `Only global interfaces are checked.
|
|
63566
|
-
Only first level references are checked.
|
|
63567
|
-
Exception class references are ignored.
|
|
63632
|
+
extendedInformation: `Only global interfaces are checked.
|
|
63633
|
+
Only first level references are checked.
|
|
63634
|
+
Exception class references are ignored.
|
|
63568
63635
|
Void references are ignored.`,
|
|
63569
63636
|
};
|
|
63570
63637
|
}
|
|
@@ -63649,9 +63716,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
63649
63716
|
title: "Invalid Table Index",
|
|
63650
63717
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
63651
63718
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63652
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
63719
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
63653
63720
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
63654
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
63721
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
63655
63722
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
63656
63723
|
};
|
|
63657
63724
|
}
|
|
@@ -64252,8 +64319,8 @@ class LineBreakStyle {
|
|
|
64252
64319
|
return {
|
|
64253
64320
|
key: "line_break_style",
|
|
64254
64321
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64255
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64256
|
-
|
|
64322
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64323
|
+
|
|
64257
64324
|
abapGit does not work with CRLF`,
|
|
64258
64325
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64259
64326
|
};
|
|
@@ -64322,7 +64389,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64322
64389
|
key: "line_length",
|
|
64323
64390
|
title: "Line length",
|
|
64324
64391
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64325
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64392
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64326
64393
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64327
64394
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64328
64395
|
};
|
|
@@ -64393,7 +64460,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64393
64460
|
key: "line_only_punc",
|
|
64394
64461
|
title: "Line containing only punctuation",
|
|
64395
64462
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64396
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64463
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64397
64464
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
64398
64465
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64399
64466
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -64653,15 +64720,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
64653
64720
|
return {
|
|
64654
64721
|
key: "local_variable_names",
|
|
64655
64722
|
title: "Local variable naming conventions",
|
|
64656
|
-
shortDescription: `
|
|
64657
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
64723
|
+
shortDescription: `
|
|
64724
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
64658
64725
|
Regexes are case-insensitive.`,
|
|
64659
64726
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64660
|
-
badExample: `FORM bar.
|
|
64661
|
-
DATA foo.
|
|
64727
|
+
badExample: `FORM bar.
|
|
64728
|
+
DATA foo.
|
|
64662
64729
|
ENDFORM.`,
|
|
64663
|
-
goodExample: `FORM bar.
|
|
64664
|
-
DATA lv_foo.
|
|
64730
|
+
goodExample: `FORM bar.
|
|
64731
|
+
DATA lv_foo.
|
|
64665
64732
|
ENDFORM.`,
|
|
64666
64733
|
};
|
|
64667
64734
|
}
|
|
@@ -64813,9 +64880,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
64813
64880
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
64814
64881
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
64815
64882
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64816
|
-
badExample: `DEFINE something.
|
|
64883
|
+
badExample: `DEFINE something.
|
|
64817
64884
|
END-OF-DEFINITION.`,
|
|
64818
|
-
goodExample: `DEFINE _something.
|
|
64885
|
+
goodExample: `DEFINE _something.
|
|
64819
64886
|
END-OF-DEFINITION.`,
|
|
64820
64887
|
};
|
|
64821
64888
|
}
|
|
@@ -64888,10 +64955,10 @@ class MainFileContents {
|
|
|
64888
64955
|
key: "main_file_contents",
|
|
64889
64956
|
title: "Main file contents",
|
|
64890
64957
|
shortDescription: `Checks related to report declarations.`,
|
|
64891
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
64892
|
-
|
|
64893
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64894
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64958
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
64959
|
+
|
|
64960
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64961
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64895
64962
|
`,
|
|
64896
64963
|
};
|
|
64897
64964
|
}
|
|
@@ -65007,17 +65074,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65007
65074
|
title: "Too many parentheses",
|
|
65008
65075
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65009
65076
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65010
|
-
badExample: `
|
|
65011
|
-
IF ( destination IS INITIAL ).
|
|
65012
|
-
ENDIF.
|
|
65013
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65014
|
-
ENDIF.
|
|
65077
|
+
badExample: `
|
|
65078
|
+
IF ( destination IS INITIAL ).
|
|
65079
|
+
ENDIF.
|
|
65080
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65081
|
+
ENDIF.
|
|
65015
65082
|
`,
|
|
65016
|
-
goodExample: `
|
|
65017
|
-
IF destination IS INITIAL.
|
|
65018
|
-
ENDIF.
|
|
65019
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65020
|
-
ENDIF.
|
|
65083
|
+
goodExample: `
|
|
65084
|
+
IF destination IS INITIAL.
|
|
65085
|
+
ENDIF.
|
|
65086
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65087
|
+
ENDIF.
|
|
65021
65088
|
`,
|
|
65022
65089
|
};
|
|
65023
65090
|
}
|
|
@@ -65191,14 +65258,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65191
65258
|
title: "Max one method parameter definition per line",
|
|
65192
65259
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65193
65260
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65194
|
-
badExample: `
|
|
65195
|
-
METHODS apps_scope_token
|
|
65196
|
-
IMPORTING
|
|
65261
|
+
badExample: `
|
|
65262
|
+
METHODS apps_scope_token
|
|
65263
|
+
IMPORTING
|
|
65197
65264
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65198
|
-
goodExample: `
|
|
65199
|
-
METHODS apps_scope_token
|
|
65200
|
-
IMPORTING
|
|
65201
|
-
body TYPE bodyapps_scope_token
|
|
65265
|
+
goodExample: `
|
|
65266
|
+
METHODS apps_scope_token
|
|
65267
|
+
IMPORTING
|
|
65268
|
+
body TYPE bodyapps_scope_token
|
|
65202
65269
|
client_id TYPE str.`,
|
|
65203
65270
|
};
|
|
65204
65271
|
}
|
|
@@ -65263,11 +65330,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65263
65330
|
key: "max_one_statement",
|
|
65264
65331
|
title: "Max one statement per line",
|
|
65265
65332
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65266
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65267
|
-
|
|
65268
|
-
Does not report anything for chained statements.
|
|
65269
|
-
|
|
65270
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65333
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65334
|
+
|
|
65335
|
+
Does not report anything for chained statements.
|
|
65336
|
+
|
|
65337
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65271
65338
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65272
65339
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65273
65340
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -65605,8 +65672,8 @@ class MethodLength {
|
|
|
65605
65672
|
key: "method_length",
|
|
65606
65673
|
title: "Method/Form Length",
|
|
65607
65674
|
shortDescription: `Checks relating to method/form length.`,
|
|
65608
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
65609
|
-
|
|
65675
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
65676
|
+
|
|
65610
65677
|
Abstract methods without statements are considered okay.`,
|
|
65611
65678
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65612
65679
|
};
|
|
@@ -65711,20 +65778,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
65711
65778
|
key: "method_overwrites_builtin",
|
|
65712
65779
|
title: "Method name overwrites builtin function",
|
|
65713
65780
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
65714
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
65715
|
-
|
|
65716
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
65717
|
-
|
|
65781
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
65782
|
+
|
|
65783
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
65784
|
+
|
|
65718
65785
|
Interface method names are ignored`,
|
|
65719
65786
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65720
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65721
|
-
PUBLIC SECTION.
|
|
65722
|
-
METHODS matches.
|
|
65723
|
-
ENDCLASS.
|
|
65724
|
-
|
|
65725
|
-
CLASS lcl IMPLEMENTATION.
|
|
65726
|
-
METHOD matches.
|
|
65727
|
-
ENDMETHOD.
|
|
65787
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65788
|
+
PUBLIC SECTION.
|
|
65789
|
+
METHODS matches.
|
|
65790
|
+
ENDCLASS.
|
|
65791
|
+
|
|
65792
|
+
CLASS lcl IMPLEMENTATION.
|
|
65793
|
+
METHOD matches.
|
|
65794
|
+
ENDMETHOD.
|
|
65728
65795
|
ENDCLASS.`,
|
|
65729
65796
|
};
|
|
65730
65797
|
}
|
|
@@ -65915,12 +65982,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
65915
65982
|
// eslint-disable-next-line max-len
|
|
65916
65983
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
65917
65984
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65918
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65919
|
-
PUBLIC SECTION.
|
|
65920
|
-
METHODS
|
|
65921
|
-
foobar
|
|
65922
|
-
EXPORTING foo TYPE i
|
|
65923
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
65985
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65986
|
+
PUBLIC SECTION.
|
|
65987
|
+
METHODS
|
|
65988
|
+
foobar
|
|
65989
|
+
EXPORTING foo TYPE i
|
|
65990
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
65924
65991
|
ENDCLASS.`,
|
|
65925
65992
|
};
|
|
65926
65993
|
}
|
|
@@ -66300,7 +66367,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66300
66367
|
key: "nesting",
|
|
66301
66368
|
title: "Check nesting depth",
|
|
66302
66369
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66303
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66370
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66304
66371
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66305
66372
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66306
66373
|
};
|
|
@@ -66543,7 +66610,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
66543
66610
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
66544
66611
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66545
66612
|
badExample: `var1 = var2 = var3.`,
|
|
66546
|
-
goodExample: `var2 = var3.
|
|
66613
|
+
goodExample: `var2 = var3.
|
|
66547
66614
|
var1 = var2.`,
|
|
66548
66615
|
};
|
|
66549
66616
|
}
|
|
@@ -66602,8 +66669,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
66602
66669
|
key: "no_external_form_calls",
|
|
66603
66670
|
title: "No external FORM calls",
|
|
66604
66671
|
shortDescription: `Detect external form calls`,
|
|
66605
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
66606
|
-
|
|
66672
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
66673
|
+
|
|
66607
66674
|
PERFORM foo(bar).`,
|
|
66608
66675
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66609
66676
|
};
|
|
@@ -66664,17 +66731,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
66664
66731
|
key: "no_inline_in_optional_branches",
|
|
66665
66732
|
title: "Don't declare inline in optional branches",
|
|
66666
66733
|
shortDescription: `Don't declare inline in optional branches`,
|
|
66667
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
66668
|
-
|
|
66669
|
-
Considered optional branches:
|
|
66670
|
-
* inside IF/ELSEIF/ELSE
|
|
66671
|
-
* inside LOOP
|
|
66672
|
-
* inside WHILE
|
|
66673
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
66674
|
-
* inside DO
|
|
66675
|
-
* inside SELECT loops
|
|
66676
|
-
|
|
66677
|
-
Not considered optional branches:
|
|
66734
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
66735
|
+
|
|
66736
|
+
Considered optional branches:
|
|
66737
|
+
* inside IF/ELSEIF/ELSE
|
|
66738
|
+
* inside LOOP
|
|
66739
|
+
* inside WHILE
|
|
66740
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
66741
|
+
* inside DO
|
|
66742
|
+
* inside SELECT loops
|
|
66743
|
+
|
|
66744
|
+
Not considered optional branches:
|
|
66678
66745
|
* TRY/CATCH/CLEANUP`,
|
|
66679
66746
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66680
66747
|
};
|
|
@@ -66774,12 +66841,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
66774
66841
|
key: "no_prefixes",
|
|
66775
66842
|
title: "No Prefixes",
|
|
66776
66843
|
shortDescription: `Dont use hungarian notation`,
|
|
66777
|
-
extendedInformation: `
|
|
66778
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
66779
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
66780
|
-
|
|
66781
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66782
|
-
|
|
66844
|
+
extendedInformation: `
|
|
66845
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
66846
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
66847
|
+
|
|
66848
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66849
|
+
|
|
66783
66850
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
66784
66851
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66785
66852
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -66958,7 +67025,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
66958
67025
|
return {
|
|
66959
67026
|
key: "no_public_attributes",
|
|
66960
67027
|
title: "No public attributes",
|
|
66961
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67028
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66962
67029
|
Exceptions are excluded from this rule.`,
|
|
66963
67030
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
66964
67031
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67059,13 +67126,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67059
67126
|
key: "no_yoda_conditions",
|
|
67060
67127
|
title: "No Yoda conditions",
|
|
67061
67128
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67062
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67063
|
-
|
|
67129
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67130
|
+
|
|
67064
67131
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67065
67132
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67066
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67133
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67067
67134
|
ENDIF.`,
|
|
67068
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67135
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67069
67136
|
ENDIF.`,
|
|
67070
67137
|
};
|
|
67071
67138
|
}
|
|
@@ -67166,8 +67233,8 @@ class NROBConsistency {
|
|
|
67166
67233
|
key: "nrob_consistency",
|
|
67167
67234
|
title: "Number range consistency",
|
|
67168
67235
|
shortDescription: `Consistency checks for number ranges`,
|
|
67169
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67170
|
-
|
|
67236
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67237
|
+
|
|
67171
67238
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67172
67239
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67173
67240
|
};
|
|
@@ -67444,58 +67511,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
67444
67511
|
title: "Obsolete statements",
|
|
67445
67512
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
67446
67513
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67447
|
-
extendedInformation: `
|
|
67448
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67449
|
-
|
|
67450
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67451
|
-
|
|
67452
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67453
|
-
|
|
67454
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67455
|
-
|
|
67456
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67457
|
-
|
|
67458
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67459
|
-
|
|
67460
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67461
|
-
|
|
67462
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67463
|
-
|
|
67464
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
67465
|
-
|
|
67466
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
67467
|
-
|
|
67468
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
67469
|
-
|
|
67470
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
67471
|
-
|
|
67472
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
67473
|
-
|
|
67474
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
67475
|
-
|
|
67476
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
67477
|
-
SELECT COUNT(*) is considered okay
|
|
67478
|
-
|
|
67479
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
67480
|
-
|
|
67481
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
67482
|
-
|
|
67483
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
67484
|
-
|
|
67485
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
67486
|
-
|
|
67487
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
67488
|
-
|
|
67514
|
+
extendedInformation: `
|
|
67515
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67516
|
+
|
|
67517
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67518
|
+
|
|
67519
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67520
|
+
|
|
67521
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67522
|
+
|
|
67523
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67524
|
+
|
|
67525
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67526
|
+
|
|
67527
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67528
|
+
|
|
67529
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67530
|
+
|
|
67531
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
67532
|
+
|
|
67533
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
67534
|
+
|
|
67535
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
67536
|
+
|
|
67537
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
67538
|
+
|
|
67539
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
67540
|
+
|
|
67541
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
67542
|
+
|
|
67543
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
67544
|
+
SELECT COUNT(*) is considered okay
|
|
67545
|
+
|
|
67546
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
67547
|
+
|
|
67548
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
67549
|
+
|
|
67550
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
67551
|
+
|
|
67552
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
67553
|
+
|
|
67554
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
67555
|
+
|
|
67489
67556
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
67490
|
-
badExample: `REFRESH itab.
|
|
67491
|
-
|
|
67492
|
-
COMPUTE foo = 2 + 2.
|
|
67493
|
-
|
|
67494
|
-
MULTIPLY lv_foo BY 2.
|
|
67495
|
-
|
|
67496
|
-
INTERFACE intf LOAD.
|
|
67497
|
-
|
|
67498
|
-
IF foo IS SUPPLIED.
|
|
67557
|
+
badExample: `REFRESH itab.
|
|
67558
|
+
|
|
67559
|
+
COMPUTE foo = 2 + 2.
|
|
67560
|
+
|
|
67561
|
+
MULTIPLY lv_foo BY 2.
|
|
67562
|
+
|
|
67563
|
+
INTERFACE intf LOAD.
|
|
67564
|
+
|
|
67565
|
+
IF foo IS SUPPLIED.
|
|
67499
67566
|
ENDIF.`,
|
|
67500
67567
|
};
|
|
67501
67568
|
}
|
|
@@ -67835,9 +67902,9 @@ class OmitParameterName {
|
|
|
67835
67902
|
key: "omit_parameter_name",
|
|
67836
67903
|
title: "Omit parameter name",
|
|
67837
67904
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
67838
|
-
extendedInformation: `
|
|
67839
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67840
|
-
|
|
67905
|
+
extendedInformation: `
|
|
67906
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67907
|
+
|
|
67841
67908
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
67842
67909
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67843
67910
|
badExample: `method( param = 2 ).`,
|
|
@@ -68043,20 +68110,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68043
68110
|
shortDescription: `Omit RECEIVING`,
|
|
68044
68111
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68045
68112
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68046
|
-
badExample: `
|
|
68047
|
-
upload_pack(
|
|
68048
|
-
EXPORTING
|
|
68049
|
-
io_client = lo_client
|
|
68050
|
-
iv_url = iv_url
|
|
68051
|
-
iv_deepen_level = iv_deepen_level
|
|
68052
|
-
it_hashes = lt_hashes
|
|
68053
|
-
RECEIVING
|
|
68113
|
+
badExample: `
|
|
68114
|
+
upload_pack(
|
|
68115
|
+
EXPORTING
|
|
68116
|
+
io_client = lo_client
|
|
68117
|
+
iv_url = iv_url
|
|
68118
|
+
iv_deepen_level = iv_deepen_level
|
|
68119
|
+
it_hashes = lt_hashes
|
|
68120
|
+
RECEIVING
|
|
68054
68121
|
rt_objects = et_objects ).`,
|
|
68055
|
-
goodExample: `
|
|
68056
|
-
et_objects = upload_pack(
|
|
68057
|
-
io_client = lo_client
|
|
68058
|
-
iv_url = iv_url
|
|
68059
|
-
iv_deepen_level = iv_deepen_level
|
|
68122
|
+
goodExample: `
|
|
68123
|
+
et_objects = upload_pack(
|
|
68124
|
+
io_client = lo_client
|
|
68125
|
+
iv_url = iv_url
|
|
68126
|
+
iv_deepen_level = iv_deepen_level
|
|
68060
68127
|
it_hashes = lt_hashes ).`,
|
|
68061
68128
|
};
|
|
68062
68129
|
}
|
|
@@ -68120,8 +68187,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68120
68187
|
return {
|
|
68121
68188
|
key: "parser_702_chaining",
|
|
68122
68189
|
title: "Parser Error, bad chanining on 702",
|
|
68123
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68124
|
-
this rule finds these and reports errors.
|
|
68190
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68191
|
+
this rule finds these and reports errors.
|
|
68125
68192
|
Only active on target version 702 and below.`,
|
|
68126
68193
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68127
68194
|
};
|
|
@@ -68201,8 +68268,8 @@ class ParserError {
|
|
|
68201
68268
|
return {
|
|
68202
68269
|
key: "parser_error",
|
|
68203
68270
|
title: "Parser error",
|
|
68204
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68205
|
-
|
|
68271
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68272
|
+
|
|
68206
68273
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68207
68274
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68208
68275
|
};
|
|
@@ -68287,7 +68354,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68287
68354
|
return {
|
|
68288
68355
|
key: "parser_missing_space",
|
|
68289
68356
|
title: "Parser Error, missing space",
|
|
68290
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68357
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68291
68358
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68292
68359
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68293
68360
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -68699,25 +68766,25 @@ class PreferInline {
|
|
|
68699
68766
|
key: "prefer_inline",
|
|
68700
68767
|
title: "Prefer Inline Declarations",
|
|
68701
68768
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
68702
|
-
extendedInformation: `EXPERIMENTAL
|
|
68703
|
-
|
|
68704
|
-
Activates if language version is v740sp02 or above.
|
|
68705
|
-
|
|
68706
|
-
Variables must be local(METHOD or FORM).
|
|
68707
|
-
|
|
68708
|
-
No generic or void typed variables. No syntax errors.
|
|
68709
|
-
|
|
68710
|
-
First position used must be a full/pure write.
|
|
68711
|
-
|
|
68712
|
-
Move statment is not a cast(?=)
|
|
68713
|
-
|
|
68769
|
+
extendedInformation: `EXPERIMENTAL
|
|
68770
|
+
|
|
68771
|
+
Activates if language version is v740sp02 or above.
|
|
68772
|
+
|
|
68773
|
+
Variables must be local(METHOD or FORM).
|
|
68774
|
+
|
|
68775
|
+
No generic or void typed variables. No syntax errors.
|
|
68776
|
+
|
|
68777
|
+
First position used must be a full/pure write.
|
|
68778
|
+
|
|
68779
|
+
Move statment is not a cast(?=)
|
|
68780
|
+
|
|
68714
68781
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
68715
68782
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
68716
|
-
badExample: `DATA foo TYPE i.
|
|
68717
|
-
foo = 2.
|
|
68718
|
-
DATA percentage TYPE decfloat34.
|
|
68783
|
+
badExample: `DATA foo TYPE i.
|
|
68784
|
+
foo = 2.
|
|
68785
|
+
DATA percentage TYPE decfloat34.
|
|
68719
68786
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
68720
|
-
goodExample: `DATA(foo) = 2.
|
|
68787
|
+
goodExample: `DATA(foo) = 2.
|
|
68721
68788
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
68722
68789
|
};
|
|
68723
68790
|
}
|
|
@@ -68931,18 +68998,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
68931
68998
|
key: "prefer_is_not",
|
|
68932
68999
|
title: "Prefer IS NOT to NOT IS",
|
|
68933
69000
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
68934
|
-
extendedInformation: `
|
|
68935
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68936
|
-
|
|
69001
|
+
extendedInformation: `
|
|
69002
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69003
|
+
|
|
68937
69004
|
"if not is_valid( )." examples are skipped`,
|
|
68938
69005
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68939
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
68940
|
-
IF variable NP 'TODO*'.
|
|
68941
|
-
IF variable <> 42.
|
|
69006
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69007
|
+
IF variable NP 'TODO*'.
|
|
69008
|
+
IF variable <> 42.
|
|
68942
69009
|
IF variable CO 'hello'.`,
|
|
68943
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
68944
|
-
IF NOT variable CP 'TODO*'.
|
|
68945
|
-
IF NOT variable = 42.
|
|
69010
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69011
|
+
IF NOT variable CP 'TODO*'.
|
|
69012
|
+
IF NOT variable = 42.
|
|
68946
69013
|
IF NOT variable CA 'hello'.`,
|
|
68947
69014
|
};
|
|
68948
69015
|
}
|
|
@@ -69130,14 +69197,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69130
69197
|
key: "prefer_raise_exception_new",
|
|
69131
69198
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69132
69199
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69133
|
-
extendedInformation: `
|
|
69134
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69135
|
-
|
|
69200
|
+
extendedInformation: `
|
|
69201
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69202
|
+
|
|
69136
69203
|
From 752 and up`,
|
|
69137
69204
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69138
69205
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69139
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69140
|
-
EXPORTING
|
|
69206
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69207
|
+
EXPORTING
|
|
69141
69208
|
previous = exception.`,
|
|
69142
69209
|
};
|
|
69143
69210
|
}
|
|
@@ -69215,12 +69282,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69215
69282
|
key: "prefer_returning_to_exporting",
|
|
69216
69283
|
title: "Prefer RETURNING to EXPORTING",
|
|
69217
69284
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69218
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69285
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69219
69286
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69220
69287
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69221
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69222
|
-
PUBLIC SECTION.
|
|
69223
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69288
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69289
|
+
PUBLIC SECTION.
|
|
69290
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69224
69291
|
ENDCLASS.`,
|
|
69225
69292
|
};
|
|
69226
69293
|
}
|
|
@@ -69316,8 +69383,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69316
69383
|
key: "prefer_xsdbool",
|
|
69317
69384
|
title: "Prefer xsdbool over boolc",
|
|
69318
69385
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69319
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69320
|
-
|
|
69386
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69387
|
+
|
|
69321
69388
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69322
69389
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69323
69390
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69389,9 +69456,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69389
69456
|
title: "Preferred compare operator",
|
|
69390
69457
|
shortDescription: `Configure undesired operator variants`,
|
|
69391
69458
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69392
|
-
badExample: `IF foo EQ bar.
|
|
69459
|
+
badExample: `IF foo EQ bar.
|
|
69393
69460
|
ENDIF.`,
|
|
69394
|
-
goodExample: `IF foo = bar.
|
|
69461
|
+
goodExample: `IF foo = bar.
|
|
69395
69462
|
ENDIF.`,
|
|
69396
69463
|
};
|
|
69397
69464
|
}
|
|
@@ -69615,26 +69682,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
69615
69682
|
key: "reduce_procedural_code",
|
|
69616
69683
|
title: "Reduce procedural code",
|
|
69617
69684
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
69618
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
69619
|
-
|
|
69620
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
69621
|
-
|
|
69685
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
69686
|
+
|
|
69687
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
69688
|
+
|
|
69622
69689
|
Comments are not counted as statements.`,
|
|
69623
69690
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
69624
|
-
badExample: `FORM foo.
|
|
69625
|
-
DATA lv_bar TYPE i.
|
|
69626
|
-
lv_bar = 2 + 2.
|
|
69627
|
-
IF lv_bar = 4.
|
|
69628
|
-
WRITE 'hello world'.
|
|
69629
|
-
ENDIF.
|
|
69630
|
-
DATA lv_bar TYPE i.
|
|
69631
|
-
lv_bar = 2 + 2.
|
|
69632
|
-
IF lv_bar = 4.
|
|
69633
|
-
WRITE 'hello world'.
|
|
69634
|
-
ENDIF.
|
|
69691
|
+
badExample: `FORM foo.
|
|
69692
|
+
DATA lv_bar TYPE i.
|
|
69693
|
+
lv_bar = 2 + 2.
|
|
69694
|
+
IF lv_bar = 4.
|
|
69695
|
+
WRITE 'hello world'.
|
|
69696
|
+
ENDIF.
|
|
69697
|
+
DATA lv_bar TYPE i.
|
|
69698
|
+
lv_bar = 2 + 2.
|
|
69699
|
+
IF lv_bar = 4.
|
|
69700
|
+
WRITE 'hello world'.
|
|
69701
|
+
ENDIF.
|
|
69635
69702
|
ENDFORM.`,
|
|
69636
|
-
goodExample: `FORM foo.
|
|
69637
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
69703
|
+
goodExample: `FORM foo.
|
|
69704
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
69638
69705
|
ENDFORM.`,
|
|
69639
69706
|
};
|
|
69640
69707
|
}
|
|
@@ -69878,10 +69945,10 @@ class RemoveDescriptions {
|
|
|
69878
69945
|
return {
|
|
69879
69946
|
key: "remove_descriptions",
|
|
69880
69947
|
title: "Remove descriptions",
|
|
69881
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69882
|
-
|
|
69883
|
-
Class descriptions are required, see rule description_empty.
|
|
69884
|
-
|
|
69948
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69949
|
+
|
|
69950
|
+
Class descriptions are required, see rule description_empty.
|
|
69951
|
+
|
|
69885
69952
|
Consider using ABAP Doc for documentation.`,
|
|
69886
69953
|
tags: [],
|
|
69887
69954
|
};
|
|
@@ -70006,14 +70073,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70006
70073
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70007
70074
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70008
70075
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70009
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70076
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70010
70077
|
DESTINATION lv_rfc.`,
|
|
70011
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70012
|
-
DESTINATION lv_rfc
|
|
70013
|
-
EXCEPTIONS
|
|
70014
|
-
system_failure = 1 MESSAGE msg
|
|
70015
|
-
communication_failure = 2 MESSAGE msg
|
|
70016
|
-
resource_failure = 3
|
|
70078
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70079
|
+
DESTINATION lv_rfc
|
|
70080
|
+
EXCEPTIONS
|
|
70081
|
+
system_failure = 1 MESSAGE msg
|
|
70082
|
+
communication_failure = 2 MESSAGE msg
|
|
70083
|
+
resource_failure = 3
|
|
70017
70084
|
OTHERS = 4.`,
|
|
70018
70085
|
};
|
|
70019
70086
|
}
|
|
@@ -70097,11 +70164,11 @@ class SelectAddOrderBy {
|
|
|
70097
70164
|
key: "select_add_order_by",
|
|
70098
70165
|
title: "SELECT add ORDER BY",
|
|
70099
70166
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70100
|
-
extendedInformation: `
|
|
70101
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70102
|
-
|
|
70103
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70104
|
-
|
|
70167
|
+
extendedInformation: `
|
|
70168
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70169
|
+
|
|
70170
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70171
|
+
|
|
70105
70172
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70106
70173
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70107
70174
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70232,14 +70299,14 @@ class SelectPerformance {
|
|
|
70232
70299
|
key: "select_performance",
|
|
70233
70300
|
title: "SELECT performance",
|
|
70234
70301
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70235
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70236
|
-
|
|
70302
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70303
|
+
|
|
70237
70304
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70238
70305
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70239
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70240
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70306
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70307
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70241
70308
|
ENDSELECT.`,
|
|
70242
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70309
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70243
70310
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70244
70311
|
};
|
|
70245
70312
|
}
|
|
@@ -70353,8 +70420,8 @@ class SelectSingleFullKey {
|
|
|
70353
70420
|
key: "select_single_full_key",
|
|
70354
70421
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70355
70422
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70356
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70357
|
-
|
|
70423
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70424
|
+
|
|
70358
70425
|
If the statement contains a JOIN it is not checked`,
|
|
70359
70426
|
pseudoComment: "EC CI_NOORDER",
|
|
70360
70427
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -70778,8 +70845,8 @@ class SICFConsistency {
|
|
|
70778
70845
|
key: "sicf_consistency",
|
|
70779
70846
|
title: "SICF consistency",
|
|
70780
70847
|
shortDescription: `Checks the validity of ICF services`,
|
|
70781
|
-
extendedInformation: `* Class defined in handler must exist
|
|
70782
|
-
* Class must not have any syntax errors
|
|
70848
|
+
extendedInformation: `* Class defined in handler must exist
|
|
70849
|
+
* Class must not have any syntax errors
|
|
70783
70850
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
70784
70851
|
};
|
|
70785
70852
|
}
|
|
@@ -70891,23 +70958,23 @@ class SlowParameterPassing {
|
|
|
70891
70958
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
70892
70959
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
70893
70960
|
tags: [_irule_1.RuleTag.Performance],
|
|
70894
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70895
|
-
PUBLIC SECTION.
|
|
70896
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70897
|
-
ENDCLASS.
|
|
70898
|
-
CLASS lcl IMPLEMENTATION.
|
|
70899
|
-
METHOD bar.
|
|
70900
|
-
WRITE sdf.
|
|
70901
|
-
ENDMETHOD.
|
|
70961
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70962
|
+
PUBLIC SECTION.
|
|
70963
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70964
|
+
ENDCLASS.
|
|
70965
|
+
CLASS lcl IMPLEMENTATION.
|
|
70966
|
+
METHOD bar.
|
|
70967
|
+
WRITE sdf.
|
|
70968
|
+
ENDMETHOD.
|
|
70902
70969
|
ENDCLASS.`,
|
|
70903
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
70904
|
-
PUBLIC SECTION.
|
|
70905
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
70906
|
-
ENDCLASS.
|
|
70907
|
-
CLASS lcl IMPLEMENTATION.
|
|
70908
|
-
METHOD bar.
|
|
70909
|
-
WRITE sdf.
|
|
70910
|
-
ENDMETHOD.
|
|
70970
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
70971
|
+
PUBLIC SECTION.
|
|
70972
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
70973
|
+
ENDCLASS.
|
|
70974
|
+
CLASS lcl IMPLEMENTATION.
|
|
70975
|
+
METHOD bar.
|
|
70976
|
+
WRITE sdf.
|
|
70977
|
+
ENDMETHOD.
|
|
70911
70978
|
ENDCLASS.`,
|
|
70912
70979
|
};
|
|
70913
70980
|
}
|
|
@@ -71164,8 +71231,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71164
71231
|
key: "space_before_dot",
|
|
71165
71232
|
title: "Space before dot",
|
|
71166
71233
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71167
|
-
extendedInformation: `
|
|
71168
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71234
|
+
extendedInformation: `
|
|
71235
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71169
71236
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71170
71237
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71171
71238
|
badExample: `WRITE bar .`,
|
|
@@ -71351,12 +71418,12 @@ class SQLValueConversion {
|
|
|
71351
71418
|
key: "sql_value_conversion",
|
|
71352
71419
|
title: "Implicit SQL Value Conversion",
|
|
71353
71420
|
shortDescription: `Ensure types match when selecting from database`,
|
|
71354
|
-
extendedInformation: `
|
|
71355
|
-
* Integer to CHAR conversion
|
|
71356
|
-
* Integer to NUMC conversion
|
|
71357
|
-
* NUMC to Integer conversion
|
|
71358
|
-
* CHAR to Integer conversion
|
|
71359
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
71421
|
+
extendedInformation: `
|
|
71422
|
+
* Integer to CHAR conversion
|
|
71423
|
+
* Integer to NUMC conversion
|
|
71424
|
+
* NUMC to Integer conversion
|
|
71425
|
+
* CHAR to Integer conversion
|
|
71426
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71360
71427
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71361
71428
|
tags: [],
|
|
71362
71429
|
};
|
|
@@ -71428,7 +71495,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
71428
71495
|
key: "start_at_tab",
|
|
71429
71496
|
title: "Start at tab",
|
|
71430
71497
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
71431
|
-
extendedInformation: `Reports max 100 issues per file
|
|
71498
|
+
extendedInformation: `Reports max 100 issues per file
|
|
71432
71499
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
71433
71500
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71434
71501
|
badExample: ` WRITE a.`,
|
|
@@ -71605,12 +71672,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
71605
71672
|
key: "strict_sql",
|
|
71606
71673
|
title: "Strict SQL",
|
|
71607
71674
|
shortDescription: `Strict SQL`,
|
|
71608
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
71609
|
-
|
|
71610
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
71611
|
-
|
|
71612
|
-
Also see separate rule sql_escape_host_variables
|
|
71613
|
-
|
|
71675
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
71676
|
+
|
|
71677
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
71678
|
+
|
|
71679
|
+
Also see separate rule sql_escape_host_variables
|
|
71680
|
+
|
|
71614
71681
|
Activates from v750 and up`,
|
|
71615
71682
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
71616
71683
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -71864,11 +71931,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
71864
71931
|
key: "sy_modification",
|
|
71865
71932
|
title: "Modification of SY fields",
|
|
71866
71933
|
shortDescription: `Finds modification of sy fields`,
|
|
71867
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71868
|
-
|
|
71934
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71935
|
+
|
|
71869
71936
|
Changes to SY-TVAR* fields are not reported`,
|
|
71870
71937
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71871
|
-
badExample: `sy-uname = 2.
|
|
71938
|
+
badExample: `sy-uname = 2.
|
|
71872
71939
|
sy = sy.`,
|
|
71873
71940
|
};
|
|
71874
71941
|
}
|
|
@@ -71930,8 +71997,8 @@ class TABLEnhancementCategory {
|
|
|
71930
71997
|
key: "tabl_enhancement_category",
|
|
71931
71998
|
title: "TABL enhancement category must be set",
|
|
71932
71999
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
71933
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71934
|
-
|
|
72000
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72001
|
+
|
|
71935
72002
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
71936
72003
|
tags: [],
|
|
71937
72004
|
};
|
|
@@ -71996,8 +72063,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
71996
72063
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
71997
72064
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
71998
72065
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71999
|
-
badExample: `FORM foo.
|
|
72000
|
-
TABLES t100.
|
|
72066
|
+
badExample: `FORM foo.
|
|
72067
|
+
TABLES t100.
|
|
72001
72068
|
ENDFORM.`,
|
|
72002
72069
|
goodExample: `TABLES t000.`,
|
|
72003
72070
|
};
|
|
@@ -72125,9 +72192,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72125
72192
|
title: "Type FORM parameters",
|
|
72126
72193
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72127
72194
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72128
|
-
badExample: `FORM foo USING bar.
|
|
72195
|
+
badExample: `FORM foo USING bar.
|
|
72129
72196
|
ENDFORM.`,
|
|
72130
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72197
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72131
72198
|
ENDFORM.`,
|
|
72132
72199
|
};
|
|
72133
72200
|
}
|
|
@@ -72800,38 +72867,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
72800
72867
|
key: "unnecessary_pragma",
|
|
72801
72868
|
title: "Unnecessary Pragma",
|
|
72802
72869
|
shortDescription: `Finds pragmas which can be removed`,
|
|
72803
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
72804
|
-
|
|
72805
|
-
* NEEDED without definition
|
|
72806
|
-
|
|
72807
|
-
* NO_TEXT without texts
|
|
72808
|
-
|
|
72809
|
-
* SUBRC_OK where sy-subrc is checked
|
|
72810
|
-
|
|
72870
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
72871
|
+
|
|
72872
|
+
* NEEDED without definition
|
|
72873
|
+
|
|
72874
|
+
* NO_TEXT without texts
|
|
72875
|
+
|
|
72876
|
+
* SUBRC_OK where sy-subrc is checked
|
|
72877
|
+
|
|
72811
72878
|
NO_HANDLER inside macros are not checked`,
|
|
72812
72879
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72813
|
-
badExample: `TRY.
|
|
72814
|
-
...
|
|
72815
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
72816
|
-
RETURN. " it has a handler
|
|
72817
|
-
ENDTRY.
|
|
72818
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
72819
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
72820
|
-
IF sy-subrc <> 0.
|
|
72880
|
+
badExample: `TRY.
|
|
72881
|
+
...
|
|
72882
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
72883
|
+
RETURN. " it has a handler
|
|
72884
|
+
ENDTRY.
|
|
72885
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
72886
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
72887
|
+
IF sy-subrc <> 0.
|
|
72821
72888
|
ENDIF.`,
|
|
72822
|
-
goodExample: `TRY.
|
|
72823
|
-
...
|
|
72824
|
-
CATCH zcx_abapgit_exception.
|
|
72825
|
-
RETURN.
|
|
72826
|
-
ENDTRY.
|
|
72827
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
72828
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
72829
|
-
IF sy-subrc <> 0.
|
|
72830
|
-
ENDIF.
|
|
72831
|
-
|
|
72832
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
72833
|
-
test1 TYPE string,
|
|
72834
|
-
test2 TYPE string,
|
|
72889
|
+
goodExample: `TRY.
|
|
72890
|
+
...
|
|
72891
|
+
CATCH zcx_abapgit_exception.
|
|
72892
|
+
RETURN.
|
|
72893
|
+
ENDTRY.
|
|
72894
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
72895
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
72896
|
+
IF sy-subrc <> 0.
|
|
72897
|
+
ENDIF.
|
|
72898
|
+
|
|
72899
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
72900
|
+
test1 TYPE string,
|
|
72901
|
+
test2 TYPE string,
|
|
72835
72902
|
END OF blah.`,
|
|
72836
72903
|
};
|
|
72837
72904
|
}
|
|
@@ -72998,18 +73065,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
72998
73065
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
72999
73066
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73000
73067
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73001
|
-
badExample: `FORM hello1.
|
|
73002
|
-
WRITE 'world'.
|
|
73003
|
-
RETURN.
|
|
73004
|
-
ENDFORM.
|
|
73005
|
-
|
|
73006
|
-
FORM foo.
|
|
73007
|
-
IF 1 = 2.
|
|
73008
|
-
RETURN.
|
|
73009
|
-
ENDIF.
|
|
73068
|
+
badExample: `FORM hello1.
|
|
73069
|
+
WRITE 'world'.
|
|
73070
|
+
RETURN.
|
|
73071
|
+
ENDFORM.
|
|
73072
|
+
|
|
73073
|
+
FORM foo.
|
|
73074
|
+
IF 1 = 2.
|
|
73075
|
+
RETURN.
|
|
73076
|
+
ENDIF.
|
|
73010
73077
|
ENDFORM.`,
|
|
73011
|
-
goodExample: `FORM hello2.
|
|
73012
|
-
WRITE 'world'.
|
|
73078
|
+
goodExample: `FORM hello2.
|
|
73079
|
+
WRITE 'world'.
|
|
73013
73080
|
ENDFORM.`,
|
|
73014
73081
|
};
|
|
73015
73082
|
}
|
|
@@ -73360,13 +73427,13 @@ class UnusedMacros {
|
|
|
73360
73427
|
title: "Unused macros",
|
|
73361
73428
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73362
73429
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73363
|
-
badExample: `DEFINE foobar1.
|
|
73364
|
-
WRITE 'hello'.
|
|
73430
|
+
badExample: `DEFINE foobar1.
|
|
73431
|
+
WRITE 'hello'.
|
|
73365
73432
|
END-OF-DEFINITION.`,
|
|
73366
|
-
goodExample: `DEFINE foobar2.
|
|
73367
|
-
WRITE 'hello'.
|
|
73368
|
-
END-OF-DEFINITION.
|
|
73369
|
-
|
|
73433
|
+
goodExample: `DEFINE foobar2.
|
|
73434
|
+
WRITE 'hello'.
|
|
73435
|
+
END-OF-DEFINITION.
|
|
73436
|
+
|
|
73370
73437
|
foobar2.`,
|
|
73371
73438
|
};
|
|
73372
73439
|
}
|
|
@@ -73474,17 +73541,17 @@ class UnusedMethods {
|
|
|
73474
73541
|
key: "unused_methods",
|
|
73475
73542
|
title: "Unused methods",
|
|
73476
73543
|
shortDescription: `Checks for unused methods`,
|
|
73477
|
-
extendedInformation: `Checks private and protected methods.
|
|
73478
|
-
|
|
73479
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
73480
|
-
|
|
73481
|
-
Skips:
|
|
73482
|
-
* methods FOR TESTING
|
|
73483
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
73484
|
-
* class_constructor + constructor methods
|
|
73485
|
-
* event handlers
|
|
73486
|
-
* methods that are redefined
|
|
73487
|
-
* INCLUDEs
|
|
73544
|
+
extendedInformation: `Checks private and protected methods.
|
|
73545
|
+
|
|
73546
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
73547
|
+
|
|
73548
|
+
Skips:
|
|
73549
|
+
* methods FOR TESTING
|
|
73550
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
73551
|
+
* class_constructor + constructor methods
|
|
73552
|
+
* event handlers
|
|
73553
|
+
* methods that are redefined
|
|
73554
|
+
* INCLUDEs
|
|
73488
73555
|
`,
|
|
73489
73556
|
tags: [],
|
|
73490
73557
|
pragma: "##CALLED",
|
|
@@ -73918,23 +73985,23 @@ class UnusedVariables {
|
|
|
73918
73985
|
key: "unused_variables",
|
|
73919
73986
|
title: "Unused variables",
|
|
73920
73987
|
shortDescription: `Checks for unused variables and constants`,
|
|
73921
|
-
extendedInformation: `Skips event parameters.
|
|
73922
|
-
|
|
73923
|
-
Note that this currently does not work if the source code uses macros.
|
|
73924
|
-
|
|
73925
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73926
|
-
|
|
73988
|
+
extendedInformation: `Skips event parameters.
|
|
73989
|
+
|
|
73990
|
+
Note that this currently does not work if the source code uses macros.
|
|
73991
|
+
|
|
73992
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73993
|
+
|
|
73927
73994
|
Errors found in INCLUDES are reported for the main program.`,
|
|
73928
73995
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73929
73996
|
pragma: "##NEEDED",
|
|
73930
73997
|
pseudoComment: "EC NEEDED",
|
|
73931
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
73932
|
-
test TYPE string,
|
|
73933
|
-
test2 TYPE string,
|
|
73998
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
73999
|
+
test TYPE string,
|
|
74000
|
+
test2 TYPE string,
|
|
73934
74001
|
END OF blah1.`,
|
|
73935
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73936
|
-
test TYPE string,
|
|
73937
|
-
test2 TYPE string,
|
|
74002
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74003
|
+
test TYPE string,
|
|
74004
|
+
test2 TYPE string,
|
|
73938
74005
|
END OF blah2.`,
|
|
73939
74006
|
};
|
|
73940
74007
|
}
|
|
@@ -74153,15 +74220,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74153
74220
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74154
74221
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74155
74222
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74156
|
-
badExample: `IF line IS INITIAL.
|
|
74157
|
-
has_entries = abap_false.
|
|
74158
|
-
ELSE.
|
|
74159
|
-
has_entries = abap_true.
|
|
74160
|
-
ENDIF.
|
|
74161
|
-
|
|
74223
|
+
badExample: `IF line IS INITIAL.
|
|
74224
|
+
has_entries = abap_false.
|
|
74225
|
+
ELSE.
|
|
74226
|
+
has_entries = abap_true.
|
|
74227
|
+
ENDIF.
|
|
74228
|
+
|
|
74162
74229
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74163
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74164
|
-
|
|
74230
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74231
|
+
|
|
74165
74232
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74166
74233
|
};
|
|
74167
74234
|
}
|
|
@@ -74279,15 +74346,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74279
74346
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74280
74347
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74281
74348
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74282
|
-
badExample: `INTERFACE lif.
|
|
74283
|
-
METHODS load_data
|
|
74284
|
-
EXCEPTIONS
|
|
74285
|
-
invalid_parameter.
|
|
74349
|
+
badExample: `INTERFACE lif.
|
|
74350
|
+
METHODS load_data
|
|
74351
|
+
EXCEPTIONS
|
|
74352
|
+
invalid_parameter.
|
|
74286
74353
|
ENDINTERFACE.`,
|
|
74287
|
-
goodExample: `INTERFACE lif.
|
|
74288
|
-
METHODS load_data
|
|
74289
|
-
RAISING
|
|
74290
|
-
cx_something.
|
|
74354
|
+
goodExample: `INTERFACE lif.
|
|
74355
|
+
METHODS load_data
|
|
74356
|
+
RAISING
|
|
74357
|
+
cx_something.
|
|
74291
74358
|
ENDINTERFACE.`,
|
|
74292
74359
|
};
|
|
74293
74360
|
}
|
|
@@ -74347,15 +74414,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74347
74414
|
key: "use_line_exists",
|
|
74348
74415
|
title: "Use line_exists",
|
|
74349
74416
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
74350
|
-
extendedInformation: `
|
|
74351
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74352
|
-
|
|
74417
|
+
extendedInformation: `
|
|
74418
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74419
|
+
|
|
74353
74420
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
74354
74421
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74355
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74356
|
-
IF sy-subrc = 0.
|
|
74422
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74423
|
+
IF sy-subrc = 0.
|
|
74357
74424
|
ENDIF.`,
|
|
74358
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74425
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74359
74426
|
ENDIF.`,
|
|
74360
74427
|
};
|
|
74361
74428
|
}
|
|
@@ -74465,10 +74532,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
74465
74532
|
key: "use_new",
|
|
74466
74533
|
title: "Use NEW",
|
|
74467
74534
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
74468
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
74469
|
-
|
|
74470
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
74471
|
-
|
|
74535
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
74536
|
+
|
|
74537
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
74538
|
+
|
|
74472
74539
|
Applicable from v740sp02 and up`,
|
|
74473
74540
|
badExample: `CREATE OBJECT ref.`,
|
|
74474
74541
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -74566,13 +74633,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
74566
74633
|
title: "WHEN OTHERS last",
|
|
74567
74634
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
74568
74635
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
74569
|
-
badExample: `CASE bar.
|
|
74570
|
-
WHEN OTHERS.
|
|
74571
|
-
WHEN 2.
|
|
74636
|
+
badExample: `CASE bar.
|
|
74637
|
+
WHEN OTHERS.
|
|
74638
|
+
WHEN 2.
|
|
74572
74639
|
ENDCASE.`,
|
|
74573
|
-
goodExample: `CASE bar.
|
|
74574
|
-
WHEN 2.
|
|
74575
|
-
WHEN OTHERS.
|
|
74640
|
+
goodExample: `CASE bar.
|
|
74641
|
+
WHEN 2.
|
|
74642
|
+
WHEN OTHERS.
|
|
74576
74643
|
ENDCASE.`,
|
|
74577
74644
|
};
|
|
74578
74645
|
}
|