@abaplint/transpiler-cli 2.10.19 → 2.10.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/build/bundle.js +952 -865
- package/build/types.d.ts +3 -3
- package/package.json +7 -5
package/build/bundle.js
CHANGED
|
@@ -83,17 +83,20 @@ class FileOperations {
|
|
|
83
83
|
const filter = (config.input_filter ?? []).map(pattern => new RegExp(pattern, "i"));
|
|
84
84
|
let skipped = 0;
|
|
85
85
|
let added = 0;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
const folders = Array.isArray(config.input_folder) ? config.input_folder : [config.input_folder];
|
|
87
|
+
for (const folder of folders) {
|
|
88
|
+
for (const filename of glob.sync(folder + "/**", { nosort: true, nodir: true })) {
|
|
89
|
+
if (filter.length > 0 && filter.some(a => a.test(filename)) === false) {
|
|
90
|
+
skipped++;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
files.push({
|
|
94
|
+
filename: path.basename(filename),
|
|
95
|
+
relative: path.relative(config.output_folder, path.dirname(filename)),
|
|
96
|
+
contents: fs.readFileSync(filename, "utf8"),
|
|
97
|
+
});
|
|
98
|
+
added++;
|
|
90
99
|
}
|
|
91
|
-
files.push({
|
|
92
|
-
filename: path.basename(filename),
|
|
93
|
-
relative: path.relative(config.output_folder, path.dirname(filename)),
|
|
94
|
-
contents: fs.readFileSync(filename, "utf8"),
|
|
95
|
-
});
|
|
96
|
-
added++;
|
|
97
100
|
}
|
|
98
101
|
console.log(added + " files added from source");
|
|
99
102
|
console.log(skipped + " files skipped in source");
|
|
@@ -18965,6 +18968,7 @@ class ABAPFileInformation {
|
|
|
18965
18968
|
identifier: new _identifier_1.Identifier(methodName, this.filename),
|
|
18966
18969
|
isRedefinition: def.findDirectExpression(Expressions.Redefinition) !== undefined,
|
|
18967
18970
|
isForTesting: def.concatTokens().toUpperCase().includes(" FOR TESTING"),
|
|
18971
|
+
isFinal: def.concatTokens().toUpperCase().includes(" FINAL"),
|
|
18968
18972
|
isAbstract: def.findDirectExpression(Expressions.Abstract) !== undefined,
|
|
18969
18973
|
isEventHandler: def.findDirectExpression(Expressions.EventHandler) !== undefined,
|
|
18970
18974
|
visibility,
|
|
@@ -30986,6 +30990,7 @@ const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifie
|
|
|
30986
30990
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
30987
30991
|
const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
|
|
30988
30992
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
30993
|
+
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
30989
30994
|
class Parameter {
|
|
30990
30995
|
runSyntax(node, input) {
|
|
30991
30996
|
var _a;
|
|
@@ -30995,19 +31000,24 @@ class Parameter {
|
|
|
30995
31000
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
30996
31001
|
return;
|
|
30997
31002
|
}
|
|
31003
|
+
else if (nameToken === undefined) {
|
|
31004
|
+
return;
|
|
31005
|
+
}
|
|
30998
31006
|
if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
|
|
30999
31007
|
const message = "RADIOBUTTON and LENGTH not possible together";
|
|
31000
31008
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
31001
31009
|
return;
|
|
31002
31010
|
}
|
|
31003
31011
|
const bfound = new basic_types_1.BasicTypes(input).parseType(node);
|
|
31004
|
-
if (
|
|
31012
|
+
if (bfound) {
|
|
31005
31013
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound));
|
|
31006
|
-
return;
|
|
31007
31014
|
}
|
|
31008
|
-
|
|
31015
|
+
else {
|
|
31009
31016
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.UnknownType("Parameter, fallback")));
|
|
31010
31017
|
}
|
|
31018
|
+
const magicName = "%_" + nameToken.getStr() + "_%_app_%";
|
|
31019
|
+
const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
|
|
31020
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, new basic_1.VoidType("PARAMETER magic")));
|
|
31011
31021
|
}
|
|
31012
31022
|
}
|
|
31013
31023
|
exports.Parameter = Parameter;
|
|
@@ -31668,12 +31678,18 @@ exports.SelectionScreen = void 0;
|
|
|
31668
31678
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
31669
31679
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
|
|
31670
31680
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
31681
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
31671
31682
|
class SelectionScreen {
|
|
31672
31683
|
runSyntax(node, input) {
|
|
31673
31684
|
const field = node.findFirstExpression(Expressions.InlineField);
|
|
31674
31685
|
if (field === undefined) {
|
|
31675
31686
|
return;
|
|
31676
31687
|
}
|
|
31688
|
+
if (field.getFirstToken().getStr().length > 8) {
|
|
31689
|
+
const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
|
|
31690
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
|
|
31691
|
+
return;
|
|
31692
|
+
}
|
|
31677
31693
|
const name = field.getFirstToken();
|
|
31678
31694
|
const concat = node.concatTokens().toUpperCase();
|
|
31679
31695
|
if (concat.includes("BEGIN OF TABBED BLOCK")) {
|
|
@@ -31713,6 +31729,7 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
|
|
|
31713
31729
|
const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
|
|
31714
31730
|
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
31715
31731
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
31732
|
+
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
31716
31733
|
class SelectOption {
|
|
31717
31734
|
runSyntax(node, input) {
|
|
31718
31735
|
var _a;
|
|
@@ -31722,12 +31739,15 @@ class SelectOption {
|
|
|
31722
31739
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
|
|
31723
31740
|
return;
|
|
31724
31741
|
}
|
|
31742
|
+
else if (nameToken === undefined) {
|
|
31743
|
+
return;
|
|
31744
|
+
}
|
|
31725
31745
|
for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
31726
31746
|
new dynamic_1.Dynamic().runSyntax(d, input);
|
|
31727
31747
|
}
|
|
31728
31748
|
const nameExpression = node.findFirstExpression(Expressions.FieldChain);
|
|
31729
31749
|
let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameExpression);
|
|
31730
|
-
if (found
|
|
31750
|
+
if (found) {
|
|
31731
31751
|
if (found instanceof basic_1.StructureType) {
|
|
31732
31752
|
let length = 0;
|
|
31733
31753
|
for (const c of found.getComponents()) {
|
|
@@ -31749,11 +31769,13 @@ class SelectOption {
|
|
|
31749
31769
|
{ name: "HIGH", type: found },
|
|
31750
31770
|
]);
|
|
31751
31771
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.TableType(stru, { withHeader: true, keyType: basic_1.TableKeyType.default })));
|
|
31752
|
-
return;
|
|
31753
31772
|
}
|
|
31754
|
-
|
|
31773
|
+
else {
|
|
31755
31774
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, new basic_1.UnknownType("Select option, fallback")));
|
|
31756
31775
|
}
|
|
31776
|
+
const magicName = "%_" + nameToken.getStr() + "_%_app_%";
|
|
31777
|
+
const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
|
|
31778
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, new basic_1.VoidType("SELECT-OPTION magic")));
|
|
31757
31779
|
}
|
|
31758
31780
|
}
|
|
31759
31781
|
exports.SelectOption = SelectOption;
|
|
@@ -34073,13 +34095,13 @@ class FlowGraph {
|
|
|
34073
34095
|
this.label = label;
|
|
34074
34096
|
}
|
|
34075
34097
|
toDigraph() {
|
|
34076
|
-
return `digraph G {
|
|
34077
|
-
labelloc="t";
|
|
34078
|
-
label="${this.label}";
|
|
34079
|
-
graph [fontname = "helvetica"];
|
|
34080
|
-
node [fontname = "helvetica", shape="box"];
|
|
34081
|
-
edge [fontname = "helvetica"];
|
|
34082
|
-
${this.toTextEdges()}
|
|
34098
|
+
return `digraph G {
|
|
34099
|
+
labelloc="t";
|
|
34100
|
+
label="${this.label}";
|
|
34101
|
+
graph [fontname = "helvetica"];
|
|
34102
|
+
node [fontname = "helvetica", shape="box"];
|
|
34103
|
+
edge [fontname = "helvetica"];
|
|
34104
|
+
${this.toTextEdges()}
|
|
34083
34105
|
}`;
|
|
34084
34106
|
}
|
|
34085
34107
|
listSources(node) {
|
|
@@ -42329,13 +42351,13 @@ class Help {
|
|
|
42329
42351
|
/////////////////////////////////////////////////
|
|
42330
42352
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42331
42353
|
let content = "";
|
|
42332
|
-
content = `
|
|
42333
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42334
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42335
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42336
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42337
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42338
|
-
<hr>
|
|
42354
|
+
content = `
|
|
42355
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42356
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42357
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42358
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42359
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42360
|
+
<hr>
|
|
42339
42361
|
` +
|
|
42340
42362
|
"<tt>" + textDocument.uri + " (" +
|
|
42341
42363
|
(position.line + 1) + ", " +
|
|
@@ -49083,7 +49105,7 @@ class RenameGlobalClass {
|
|
|
49083
49105
|
}
|
|
49084
49106
|
const main = obj.getMainABAPFile();
|
|
49085
49107
|
if (main === undefined) {
|
|
49086
|
-
throw new Error(
|
|
49108
|
+
throw new Error(`Main file not found, ${obj.getType()} ${obj.getName()}`);
|
|
49087
49109
|
}
|
|
49088
49110
|
let changes = [];
|
|
49089
49111
|
// todo, this is actually the same as "id" ?
|
|
@@ -51655,7 +51677,7 @@ class Registry {
|
|
|
51655
51677
|
}
|
|
51656
51678
|
static abaplintVersion() {
|
|
51657
51679
|
// magic, see build script "version.sh"
|
|
51658
|
-
return "2.113.
|
|
51680
|
+
return "2.113.16";
|
|
51659
51681
|
}
|
|
51660
51682
|
getDDICReferences() {
|
|
51661
51683
|
return this.ddicReferences;
|
|
@@ -51974,10 +51996,10 @@ class SevenBitAscii {
|
|
|
51974
51996
|
key: "7bit_ascii",
|
|
51975
51997
|
title: "Check for 7bit ascii",
|
|
51976
51998
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
51977
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51978
|
-
|
|
51979
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51980
|
-
|
|
51999
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52000
|
+
|
|
52001
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52002
|
+
|
|
51981
52003
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
51982
52004
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
51983
52005
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52183,10 +52205,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52183
52205
|
key: "abapdoc",
|
|
52184
52206
|
title: "Check abapdoc",
|
|
52185
52207
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52186
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52187
|
-
|
|
52188
|
-
Plus class and interface definitions.
|
|
52189
|
-
|
|
52208
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52209
|
+
|
|
52210
|
+
Plus class and interface definitions.
|
|
52211
|
+
|
|
52190
52212
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52191
52213
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52192
52214
|
};
|
|
@@ -52323,27 +52345,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
52323
52345
|
title: "Add test attributes for tests classes with test methods",
|
|
52324
52346
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
52325
52347
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52326
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
52327
|
-
PUBLIC SECTION.
|
|
52328
|
-
PROTECTED SECTION.
|
|
52329
|
-
PRIVATE SECTION.
|
|
52330
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
52331
|
-
ENDCLASS.
|
|
52332
|
-
|
|
52333
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
52334
|
-
METHOD test.
|
|
52335
|
-
ENDMETHOD.
|
|
52348
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
52349
|
+
PUBLIC SECTION.
|
|
52350
|
+
PROTECTED SECTION.
|
|
52351
|
+
PRIVATE SECTION.
|
|
52352
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
52353
|
+
ENDCLASS.
|
|
52354
|
+
|
|
52355
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
52356
|
+
METHOD test.
|
|
52357
|
+
ENDMETHOD.
|
|
52336
52358
|
ENDCLASS.`,
|
|
52337
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
52338
|
-
PUBLIC SECTION.
|
|
52339
|
-
PROTECTED SECTION.
|
|
52340
|
-
PRIVATE SECTION.
|
|
52341
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
52342
|
-
ENDCLASS.
|
|
52343
|
-
|
|
52344
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
52345
|
-
METHOD test.
|
|
52346
|
-
ENDMETHOD.
|
|
52359
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
52360
|
+
PUBLIC SECTION.
|
|
52361
|
+
PROTECTED SECTION.
|
|
52362
|
+
PRIVATE SECTION.
|
|
52363
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
52364
|
+
ENDCLASS.
|
|
52365
|
+
|
|
52366
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
52367
|
+
METHOD test.
|
|
52368
|
+
ENDMETHOD.
|
|
52347
52369
|
ENDCLASS.`,
|
|
52348
52370
|
};
|
|
52349
52371
|
}
|
|
@@ -52429,49 +52451,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52429
52451
|
key: "align_parameters",
|
|
52430
52452
|
title: "Align Parameters",
|
|
52431
52453
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52432
|
-
extendedInformation: `Checks:
|
|
52433
|
-
* function module calls
|
|
52434
|
-
* method calls
|
|
52435
|
-
* VALUE constructors
|
|
52436
|
-
* NEW constructors
|
|
52437
|
-
* RAISE EXCEPTION statements
|
|
52438
|
-
* CREATE OBJECT statements
|
|
52439
|
-
* RAISE EVENT statements
|
|
52440
|
-
|
|
52441
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52442
|
-
|
|
52443
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52444
|
-
|
|
52445
|
-
If parameters are on the same row, no issues are reported, see
|
|
52454
|
+
extendedInformation: `Checks:
|
|
52455
|
+
* function module calls
|
|
52456
|
+
* method calls
|
|
52457
|
+
* VALUE constructors
|
|
52458
|
+
* NEW constructors
|
|
52459
|
+
* RAISE EXCEPTION statements
|
|
52460
|
+
* CREATE OBJECT statements
|
|
52461
|
+
* RAISE EVENT statements
|
|
52462
|
+
|
|
52463
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52464
|
+
|
|
52465
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52466
|
+
|
|
52467
|
+
If parameters are on the same row, no issues are reported, see
|
|
52446
52468
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52447
52469
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52448
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52449
|
-
EXPORTING
|
|
52450
|
-
foo = 2
|
|
52451
|
-
parameter = 3.
|
|
52452
|
-
|
|
52453
|
-
foobar( moo = 1
|
|
52454
|
-
param = 1 ).
|
|
52455
|
-
|
|
52456
|
-
foo = VALUE #(
|
|
52457
|
-
foo = bar
|
|
52470
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52471
|
+
EXPORTING
|
|
52472
|
+
foo = 2
|
|
52473
|
+
parameter = 3.
|
|
52474
|
+
|
|
52475
|
+
foobar( moo = 1
|
|
52476
|
+
param = 1 ).
|
|
52477
|
+
|
|
52478
|
+
foo = VALUE #(
|
|
52479
|
+
foo = bar
|
|
52458
52480
|
moo = 2 ).`,
|
|
52459
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52460
|
-
EXPORTING
|
|
52461
|
-
foo = 2
|
|
52462
|
-
parameter = 3.
|
|
52463
|
-
|
|
52464
|
-
foobar( moo = 1
|
|
52465
|
-
param = 1 ).
|
|
52466
|
-
|
|
52467
|
-
foo = VALUE #(
|
|
52468
|
-
foo = bar
|
|
52469
|
-
moo = 2 ).
|
|
52470
|
-
|
|
52471
|
-
DATA(sdf) = VALUE type(
|
|
52472
|
-
common_val = 2
|
|
52473
|
-
another_common = 5
|
|
52474
|
-
( row_value = 4
|
|
52481
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52482
|
+
EXPORTING
|
|
52483
|
+
foo = 2
|
|
52484
|
+
parameter = 3.
|
|
52485
|
+
|
|
52486
|
+
foobar( moo = 1
|
|
52487
|
+
param = 1 ).
|
|
52488
|
+
|
|
52489
|
+
foo = VALUE #(
|
|
52490
|
+
foo = bar
|
|
52491
|
+
moo = 2 ).
|
|
52492
|
+
|
|
52493
|
+
DATA(sdf) = VALUE type(
|
|
52494
|
+
common_val = 2
|
|
52495
|
+
another_common = 5
|
|
52496
|
+
( row_value = 4
|
|
52475
52497
|
value_foo = 5 ) ).`,
|
|
52476
52498
|
};
|
|
52477
52499
|
}
|
|
@@ -52905,37 +52927,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52905
52927
|
key: "align_type_expressions",
|
|
52906
52928
|
title: "Align TYPE expressions",
|
|
52907
52929
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52908
|
-
extendedInformation: `
|
|
52909
|
-
Currently works for METHODS + BEGIN OF
|
|
52910
|
-
|
|
52911
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52912
|
-
|
|
52913
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52930
|
+
extendedInformation: `
|
|
52931
|
+
Currently works for METHODS + BEGIN OF
|
|
52932
|
+
|
|
52933
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52934
|
+
|
|
52935
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52914
52936
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52915
52937
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52916
|
-
badExample: `
|
|
52917
|
-
TYPES: BEGIN OF foo,
|
|
52918
|
-
bar TYPE i,
|
|
52919
|
-
foobar TYPE i,
|
|
52920
|
-
END OF foo.
|
|
52921
|
-
|
|
52922
|
-
INTERFACE lif.
|
|
52923
|
-
METHODS bar
|
|
52924
|
-
IMPORTING
|
|
52925
|
-
foo TYPE i
|
|
52926
|
-
foobar TYPE i.
|
|
52938
|
+
badExample: `
|
|
52939
|
+
TYPES: BEGIN OF foo,
|
|
52940
|
+
bar TYPE i,
|
|
52941
|
+
foobar TYPE i,
|
|
52942
|
+
END OF foo.
|
|
52943
|
+
|
|
52944
|
+
INTERFACE lif.
|
|
52945
|
+
METHODS bar
|
|
52946
|
+
IMPORTING
|
|
52947
|
+
foo TYPE i
|
|
52948
|
+
foobar TYPE i.
|
|
52927
52949
|
ENDINTERFACE.`,
|
|
52928
|
-
goodExample: `
|
|
52929
|
-
TYPES: BEGIN OF foo,
|
|
52930
|
-
bar TYPE i,
|
|
52931
|
-
foobar TYPE i,
|
|
52932
|
-
END OF foo.
|
|
52933
|
-
|
|
52934
|
-
INTERFACE lif.
|
|
52935
|
-
METHODS bar
|
|
52936
|
-
IMPORTING
|
|
52937
|
-
foo TYPE i
|
|
52938
|
-
foobar TYPE i.
|
|
52950
|
+
goodExample: `
|
|
52951
|
+
TYPES: BEGIN OF foo,
|
|
52952
|
+
bar TYPE i,
|
|
52953
|
+
foobar TYPE i,
|
|
52954
|
+
END OF foo.
|
|
52955
|
+
|
|
52956
|
+
INTERFACE lif.
|
|
52957
|
+
METHODS bar
|
|
52958
|
+
IMPORTING
|
|
52959
|
+
foo TYPE i
|
|
52960
|
+
foobar TYPE i.
|
|
52939
52961
|
ENDINTERFACE.`,
|
|
52940
52962
|
};
|
|
52941
52963
|
}
|
|
@@ -53214,16 +53236,17 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
53214
53236
|
return {
|
|
53215
53237
|
key: "ambiguous_statement",
|
|
53216
53238
|
title: "Check for ambigious statements",
|
|
53217
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53218
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53219
|
-
|
|
53239
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53240
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53241
|
+
|
|
53220
53242
|
Only works if the target version is 740sp05 or above`,
|
|
53221
53243
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53222
|
-
badExample: `DELETE foo FROM bar.
|
|
53244
|
+
badExample: `DELETE foo FROM bar.
|
|
53223
53245
|
MODIFY foo FROM bar.`,
|
|
53224
|
-
goodExample: `DELETE foo FROM @bar.
|
|
53225
|
-
|
|
53226
|
-
MODIFY zfoo FROM @wa
|
|
53246
|
+
goodExample: `DELETE foo FROM @bar.
|
|
53247
|
+
DELETE TABLE itab FROM 2.
|
|
53248
|
+
MODIFY zfoo FROM @wa.
|
|
53249
|
+
MODIFY TABLE foo FROM bar.`,
|
|
53227
53250
|
};
|
|
53228
53251
|
}
|
|
53229
53252
|
getMessage() {
|
|
@@ -53327,16 +53350,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53327
53350
|
key: "avoid_use",
|
|
53328
53351
|
title: "Avoid use of certain statements",
|
|
53329
53352
|
shortDescription: `Detects usage of certain statements.`,
|
|
53330
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53331
|
-
|
|
53332
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53333
|
-
|
|
53334
|
-
STATICS: use CLASS-DATA instead
|
|
53335
|
-
|
|
53336
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53337
|
-
|
|
53338
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53339
|
-
|
|
53353
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53354
|
+
|
|
53355
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53356
|
+
|
|
53357
|
+
STATICS: use CLASS-DATA instead
|
|
53358
|
+
|
|
53359
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53360
|
+
|
|
53361
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53362
|
+
|
|
53340
53363
|
BREAK points`,
|
|
53341
53364
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53342
53365
|
};
|
|
@@ -53468,11 +53491,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53468
53491
|
title: "Check BEGIN END names",
|
|
53469
53492
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53470
53493
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53471
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53472
|
-
field TYPE i,
|
|
53494
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53495
|
+
field TYPE i,
|
|
53473
53496
|
END OF structure_not_the_same.`,
|
|
53474
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53475
|
-
field TYPE i,
|
|
53497
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53498
|
+
field TYPE i,
|
|
53476
53499
|
END OF stru.`,
|
|
53477
53500
|
};
|
|
53478
53501
|
}
|
|
@@ -53569,20 +53592,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53569
53592
|
title: "BEGIN contains single INCLUDE",
|
|
53570
53593
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53571
53594
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53572
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53573
|
-
INCLUDE TYPE dselc.
|
|
53574
|
-
TYPES: END OF dummy1.
|
|
53575
|
-
|
|
53576
|
-
DATA BEGIN OF foo.
|
|
53577
|
-
INCLUDE STRUCTURE syst.
|
|
53578
|
-
DATA END OF foo.
|
|
53579
|
-
|
|
53580
|
-
STATICS BEGIN OF bar.
|
|
53581
|
-
INCLUDE STRUCTURE syst.
|
|
53595
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
53596
|
+
INCLUDE TYPE dselc.
|
|
53597
|
+
TYPES: END OF dummy1.
|
|
53598
|
+
|
|
53599
|
+
DATA BEGIN OF foo.
|
|
53600
|
+
INCLUDE STRUCTURE syst.
|
|
53601
|
+
DATA END OF foo.
|
|
53602
|
+
|
|
53603
|
+
STATICS BEGIN OF bar.
|
|
53604
|
+
INCLUDE STRUCTURE syst.
|
|
53582
53605
|
STATICS END OF bar.`,
|
|
53583
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53584
|
-
DATA field TYPE i.
|
|
53585
|
-
INCLUDE STRUCTURE dselc.
|
|
53606
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53607
|
+
DATA field TYPE i.
|
|
53608
|
+
INCLUDE STRUCTURE dselc.
|
|
53586
53609
|
DATA END OF foo.`,
|
|
53587
53610
|
};
|
|
53588
53611
|
}
|
|
@@ -53672,9 +53695,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53672
53695
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53673
53696
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53674
53697
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53675
|
-
goodExample: `TRY.
|
|
53676
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53677
|
-
CATCH cx_sy_authorization_error.
|
|
53698
|
+
goodExample: `TRY.
|
|
53699
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53700
|
+
CATCH cx_sy_authorization_error.
|
|
53678
53701
|
ENDTRY.`,
|
|
53679
53702
|
};
|
|
53680
53703
|
}
|
|
@@ -53739,10 +53762,10 @@ class CDSCommentStyle {
|
|
|
53739
53762
|
key: "cds_comment_style",
|
|
53740
53763
|
title: "CDS Comment Style",
|
|
53741
53764
|
shortDescription: `Check for obsolete comment style`,
|
|
53742
|
-
extendedInformation: `Check for obsolete comment style
|
|
53743
|
-
|
|
53744
|
-
Comments starting with "--" are considered obsolete
|
|
53745
|
-
|
|
53765
|
+
extendedInformation: `Check for obsolete comment style
|
|
53766
|
+
|
|
53767
|
+
Comments starting with "--" are considered obsolete
|
|
53768
|
+
|
|
53746
53769
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53747
53770
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53748
53771
|
badExample: "-- this is a comment",
|
|
@@ -53808,10 +53831,10 @@ class CDSLegacyView {
|
|
|
53808
53831
|
key: "cds_legacy_view",
|
|
53809
53832
|
title: "CDS Legacy View",
|
|
53810
53833
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53811
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53812
|
-
|
|
53813
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53814
|
-
|
|
53834
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53835
|
+
|
|
53836
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53837
|
+
|
|
53815
53838
|
v755 and up`,
|
|
53816
53839
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53817
53840
|
};
|
|
@@ -53966,10 +53989,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53966
53989
|
key: "chain_mainly_declarations",
|
|
53967
53990
|
title: "Chain mainly declarations",
|
|
53968
53991
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53969
|
-
extendedInformation: `
|
|
53970
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53971
|
-
|
|
53972
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53992
|
+
extendedInformation: `
|
|
53993
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53994
|
+
|
|
53995
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53973
53996
|
`,
|
|
53974
53997
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53975
53998
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -54145,17 +54168,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
54145
54168
|
title: "Change IF to CASE",
|
|
54146
54169
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
54147
54170
|
// eslint-disable-next-line max-len
|
|
54148
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54149
|
-
|
|
54171
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54172
|
+
|
|
54150
54173
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
54151
54174
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54152
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54153
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54154
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
54175
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54176
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54177
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
54155
54178
|
ENDIF.`,
|
|
54156
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
54157
|
-
WHEN 'FOO'.
|
|
54158
|
-
WHEN 'BAR' OR 'MOO'.
|
|
54179
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
54180
|
+
WHEN 'FOO'.
|
|
54181
|
+
WHEN 'BAR' OR 'MOO'.
|
|
54159
54182
|
ENDCASE.`,
|
|
54160
54183
|
};
|
|
54161
54184
|
}
|
|
@@ -54292,8 +54315,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54292
54315
|
return {
|
|
54293
54316
|
key: "check_abstract",
|
|
54294
54317
|
title: "Check abstract methods and classes",
|
|
54295
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54296
|
-
- class defined as abstract and final,
|
|
54318
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54319
|
+
- class defined as abstract and final,
|
|
54297
54320
|
- non-abstract class contains abstract methods`,
|
|
54298
54321
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54299
54322
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54374,11 +54397,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54374
54397
|
return {
|
|
54375
54398
|
key: "check_comments",
|
|
54376
54399
|
title: "Check Comments",
|
|
54377
|
-
shortDescription: `
|
|
54400
|
+
shortDescription: `
|
|
54378
54401
|
Various checks for comment usage.`,
|
|
54379
|
-
extendedInformation: `
|
|
54380
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54381
|
-
|
|
54402
|
+
extendedInformation: `
|
|
54403
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54404
|
+
|
|
54382
54405
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54383
54406
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54384
54407
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54540,9 +54563,9 @@ class CheckInclude {
|
|
|
54540
54563
|
key: "check_include",
|
|
54541
54564
|
title: "Check INCLUDEs",
|
|
54542
54565
|
shortDescription: `Checks INCLUDE statements`,
|
|
54543
|
-
extendedInformation: `
|
|
54544
|
-
* Reports unused includes
|
|
54545
|
-
* Errors if the includes are not found
|
|
54566
|
+
extendedInformation: `
|
|
54567
|
+
* Reports unused includes
|
|
54568
|
+
* Errors if the includes are not found
|
|
54546
54569
|
* Error if including a main program`,
|
|
54547
54570
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54548
54571
|
};
|
|
@@ -54618,14 +54641,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54618
54641
|
key: "check_subrc",
|
|
54619
54642
|
title: "Check sy-subrc",
|
|
54620
54643
|
shortDescription: `Check sy-subrc`,
|
|
54621
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54622
|
-
|
|
54623
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54624
|
-
|
|
54625
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54626
|
-
|
|
54627
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54628
|
-
|
|
54644
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54645
|
+
|
|
54646
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54647
|
+
|
|
54648
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54649
|
+
|
|
54650
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54651
|
+
|
|
54629
54652
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54630
54653
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54631
54654
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -55195,17 +55218,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
55195
55218
|
shortDescription: `Find overlapping classic exceptions`,
|
|
55196
55219
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
55197
55220
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55198
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55199
|
-
EXCEPTIONS
|
|
55200
|
-
system_failure = 1 MESSAGE lv_message
|
|
55201
|
-
communication_failure = 1 MESSAGE lv_message
|
|
55202
|
-
resource_failure = 1
|
|
55221
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55222
|
+
EXCEPTIONS
|
|
55223
|
+
system_failure = 1 MESSAGE lv_message
|
|
55224
|
+
communication_failure = 1 MESSAGE lv_message
|
|
55225
|
+
resource_failure = 1
|
|
55203
55226
|
OTHERS = 1.`,
|
|
55204
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55205
|
-
EXCEPTIONS
|
|
55206
|
-
system_failure = 1 MESSAGE lv_message
|
|
55207
|
-
communication_failure = 2 MESSAGE lv_message
|
|
55208
|
-
resource_failure = 3
|
|
55227
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55228
|
+
EXCEPTIONS
|
|
55229
|
+
system_failure = 1 MESSAGE lv_message
|
|
55230
|
+
communication_failure = 2 MESSAGE lv_message
|
|
55231
|
+
resource_failure = 3
|
|
55209
55232
|
OTHERS = 4.`,
|
|
55210
55233
|
};
|
|
55211
55234
|
}
|
|
@@ -55451,7 +55474,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55451
55474
|
key: "commented_code",
|
|
55452
55475
|
title: "Find commented code",
|
|
55453
55476
|
shortDescription: `Detects usage of commented out code.`,
|
|
55454
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55477
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55455
55478
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55456
55479
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55457
55480
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55684,10 +55707,10 @@ class ConstructorVisibilityPublic {
|
|
|
55684
55707
|
key: "constructor_visibility_public",
|
|
55685
55708
|
title: "Check constructor visibility is public",
|
|
55686
55709
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55687
|
-
extendedInformation: `
|
|
55688
|
-
This only applies to global classes.
|
|
55689
|
-
|
|
55690
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55710
|
+
extendedInformation: `
|
|
55711
|
+
This only applies to global classes.
|
|
55712
|
+
|
|
55713
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55691
55714
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55692
55715
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55693
55716
|
};
|
|
@@ -55762,8 +55785,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55762
55785
|
key: "contains_tab",
|
|
55763
55786
|
title: "Code contains tab",
|
|
55764
55787
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55765
|
-
extendedInformation: `
|
|
55766
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55788
|
+
extendedInformation: `
|
|
55789
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55767
55790
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55768
55791
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55769
55792
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55850,10 +55873,10 @@ class CyclicOO {
|
|
|
55850
55873
|
key: "cyclic_oo",
|
|
55851
55874
|
title: "Cyclic OO",
|
|
55852
55875
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
55853
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55854
|
-
|
|
55855
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55856
|
-
|
|
55876
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55877
|
+
|
|
55878
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55879
|
+
|
|
55857
55880
|
References in testclass includes are ignored`,
|
|
55858
55881
|
};
|
|
55859
55882
|
}
|
|
@@ -56078,6 +56101,7 @@ class DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
56078
56101
|
this.generateSubroutine = true;
|
|
56079
56102
|
this.deleteReport = true;
|
|
56080
56103
|
this.deleteTextpool = true;
|
|
56104
|
+
this.insertTextpool = true;
|
|
56081
56105
|
this.deleteDynpro = true;
|
|
56082
56106
|
this.exportDynpro = true;
|
|
56083
56107
|
/** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */
|
|
@@ -56095,7 +56119,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
56095
56119
|
key: "dangerous_statement",
|
|
56096
56120
|
title: "Dangerous statement",
|
|
56097
56121
|
shortDescription: `Detects potentially dangerous statements`,
|
|
56098
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56122
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56099
56123
|
dynamic SQL can potentially create SQL injection problems`,
|
|
56100
56124
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
56101
56125
|
};
|
|
@@ -56141,6 +56165,9 @@ dynamic SQL can potentially create SQL injection problems`,
|
|
|
56141
56165
|
else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {
|
|
56142
56166
|
message = "DELETE TEXTPOOL";
|
|
56143
56167
|
}
|
|
56168
|
+
else if (this.conf.insertTextpool && statement instanceof Statements.InsertTextpool) {
|
|
56169
|
+
message = "INSERT TEXTPOOL";
|
|
56170
|
+
}
|
|
56144
56171
|
else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {
|
|
56145
56172
|
message = "DELETE DYNPRO";
|
|
56146
56173
|
}
|
|
@@ -56299,13 +56326,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56299
56326
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56300
56327
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56301
56328
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56302
|
-
badExample: `FROM foo.
|
|
56303
|
-
WRITE 'hello'.
|
|
56304
|
-
DATA int TYPE i.
|
|
56329
|
+
badExample: `FROM foo.
|
|
56330
|
+
WRITE 'hello'.
|
|
56331
|
+
DATA int TYPE i.
|
|
56305
56332
|
ENDFORM.`,
|
|
56306
|
-
goodExample: `FROM foo.
|
|
56307
|
-
DATA int TYPE i.
|
|
56308
|
-
WRITE 'hello'.
|
|
56333
|
+
goodExample: `FROM foo.
|
|
56334
|
+
DATA int TYPE i.
|
|
56335
|
+
WRITE 'hello'.
|
|
56309
56336
|
ENDFORM.`,
|
|
56310
56337
|
};
|
|
56311
56338
|
}
|
|
@@ -56844,39 +56871,39 @@ class Downport {
|
|
|
56844
56871
|
key: "downport",
|
|
56845
56872
|
title: "Downport statement",
|
|
56846
56873
|
shortDescription: `Downport functionality`,
|
|
56847
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56848
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56849
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56850
|
-
|
|
56851
|
-
Current rules:
|
|
56852
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56853
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56854
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56855
|
-
* CONV is outlined
|
|
56856
|
-
* COND is outlined
|
|
56857
|
-
* REDUCE is outlined
|
|
56858
|
-
* SWITCH is outlined
|
|
56859
|
-
* FILTER is outlined
|
|
56860
|
-
* APPEND expression is outlined
|
|
56861
|
-
* INSERT expression is outlined
|
|
56862
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56863
|
-
* CAST changed to ?=
|
|
56864
|
-
* LOOP AT method_call( ) is outlined
|
|
56865
|
-
* VALUE # with structure fields
|
|
56866
|
-
* VALUE # with internal table lines
|
|
56867
|
-
* Table Expressions are outlined
|
|
56868
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56869
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56870
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56871
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56872
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56873
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56874
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56875
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56876
|
-
* MESSAGE with non simple source
|
|
56877
|
-
|
|
56878
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56879
|
-
|
|
56874
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56875
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56876
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56877
|
+
|
|
56878
|
+
Current rules:
|
|
56879
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56880
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56881
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56882
|
+
* CONV is outlined
|
|
56883
|
+
* COND is outlined
|
|
56884
|
+
* REDUCE is outlined
|
|
56885
|
+
* SWITCH is outlined
|
|
56886
|
+
* FILTER is outlined
|
|
56887
|
+
* APPEND expression is outlined
|
|
56888
|
+
* INSERT expression is outlined
|
|
56889
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56890
|
+
* CAST changed to ?=
|
|
56891
|
+
* LOOP AT method_call( ) is outlined
|
|
56892
|
+
* VALUE # with structure fields
|
|
56893
|
+
* VALUE # with internal table lines
|
|
56894
|
+
* Table Expressions are outlined
|
|
56895
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56896
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56897
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56898
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56899
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56900
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56901
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56902
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56903
|
+
* MESSAGE with non simple source
|
|
56904
|
+
|
|
56905
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56906
|
+
|
|
56880
56907
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56881
56908
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56882
56909
|
};
|
|
@@ -57454,17 +57481,17 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57454
57481
|
const fieldName = f.concatTokens();
|
|
57455
57482
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57456
57483
|
}
|
|
57457
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57484
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57458
57485
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57459
57486
|
}
|
|
57460
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57487
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57461
57488
|
${indentation}`);
|
|
57462
57489
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57463
57490
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
57464
57491
|
return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), "Outline SELECT @DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
57465
57492
|
}
|
|
57466
57493
|
downportSelectTableInline(low, high, lowFile, highSyntax) {
|
|
57467
|
-
var _a, _b, _c;
|
|
57494
|
+
var _a, _b, _c, _d, _e;
|
|
57468
57495
|
if (!(low.get() instanceof _statement_1.Unknown)) {
|
|
57469
57496
|
return undefined;
|
|
57470
57497
|
}
|
|
@@ -57490,23 +57517,28 @@ ${indentation}`);
|
|
|
57490
57517
|
return undefined;
|
|
57491
57518
|
}
|
|
57492
57519
|
let fieldDefinitions = "";
|
|
57493
|
-
for (const f of fieldList.findAllExpressions(Expressions.
|
|
57494
|
-
let fieldName = f.concatTokens();
|
|
57520
|
+
for (const f of fieldList.findAllExpressions(Expressions.SQLField)) {
|
|
57521
|
+
let fieldName = (_c = f.findFirstExpression(Expressions.SQLFieldName)) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
57522
|
+
if (fieldName === undefined) {
|
|
57523
|
+
continue;
|
|
57524
|
+
}
|
|
57495
57525
|
if (fieldName.includes("~")) {
|
|
57496
57526
|
const split = fieldName.split("~");
|
|
57497
57527
|
tableName = split[0];
|
|
57498
57528
|
fieldName = split[1];
|
|
57499
57529
|
}
|
|
57500
|
-
|
|
57530
|
+
const typeName = tableName + "-" + fieldName;
|
|
57531
|
+
fieldName = ((_d = f.findFirstExpression(Expressions.SQLAsName)) === null || _d === void 0 ? void 0 : _d.concatTokens()) || fieldName;
|
|
57532
|
+
fieldDefinitions += indentation + " " + fieldName + " TYPE " + typeName + ",\n";
|
|
57501
57533
|
}
|
|
57502
57534
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57503
|
-
const name = ((
|
|
57504
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57505
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57506
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57535
|
+
const name = ((_e = inlineData.findFirstExpression(Expressions.TargetField)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || "error";
|
|
57536
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57537
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57538
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57507
57539
|
${indentation}`);
|
|
57508
57540
|
if (fieldDefinitions === "") {
|
|
57509
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57541
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57510
57542
|
${indentation}`);
|
|
57511
57543
|
}
|
|
57512
57544
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57574,7 +57606,7 @@ ${indentation}`);
|
|
|
57574
57606
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57575
57607
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57576
57608
|
const firstToken = high.getFirstToken();
|
|
57577
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57609
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57578
57610
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57579
57611
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57580
57612
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57628,7 +57660,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57628
57660
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57629
57661
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57630
57662
|
const firstToken = high.getFirstToken();
|
|
57631
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57663
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57632
57664
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57633
57665
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57634
57666
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57670,14 +57702,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57670
57702
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57671
57703
|
const firstToken = high.getFirstToken();
|
|
57672
57704
|
// note that the tabix restore should be done before throwing the exception
|
|
57673
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57674
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57675
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57676
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57677
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57678
|
-
${indentation}IF sy-subrc <> 0.
|
|
57679
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57680
|
-
${indentation}ENDIF.
|
|
57705
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57706
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57707
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57708
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57709
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57710
|
+
${indentation}IF sy-subrc <> 0.
|
|
57711
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57712
|
+
${indentation}ENDIF.
|
|
57681
57713
|
${indentation}`);
|
|
57682
57714
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57683
57715
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57734,7 +57766,7 @@ ${indentation}`);
|
|
|
57734
57766
|
const className = classNames[0].concatTokens();
|
|
57735
57767
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57736
57768
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57737
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57769
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57738
57770
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57739
57771
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57740
57772
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57896,16 +57928,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57896
57928
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57897
57929
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57898
57930
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57899
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57900
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57931
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57932
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57901
57933
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57902
57934
|
if (withs.length > 0) {
|
|
57903
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57904
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57905
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57935
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57936
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57937
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57906
57938
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57907
57939
|
}
|
|
57908
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57940
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57909
57941
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57910
57942
|
if (withs.length > 0) {
|
|
57911
57943
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -58017,10 +58049,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
58017
58049
|
let code = "";
|
|
58018
58050
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
58019
58051
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58020
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58021
|
-
IF sy-subrc <> 0.
|
|
58022
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58023
|
-
ENDIF.
|
|
58052
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58053
|
+
IF sy-subrc <> 0.
|
|
58054
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58055
|
+
ENDIF.
|
|
58024
58056
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
58025
58057
|
}
|
|
58026
58058
|
else {
|
|
@@ -58109,20 +58141,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
58109
58141
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58110
58142
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58111
58143
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58112
|
-
code += ` items LIKE ${loopSourceName},
|
|
58113
|
-
END OF ${groupTargetName}type.
|
|
58114
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58115
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58144
|
+
code += ` items LIKE ${loopSourceName},
|
|
58145
|
+
END OF ${groupTargetName}type.
|
|
58146
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58147
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58116
58148
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
58117
58149
|
if (groupIndexName !== undefined) {
|
|
58118
58150
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
58119
58151
|
}
|
|
58120
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58152
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58121
58153
|
IF sy-subrc = 0.\n`;
|
|
58122
58154
|
if (groupCountName !== undefined) {
|
|
58123
58155
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
58124
58156
|
}
|
|
58125
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58157
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58126
58158
|
ELSE.\n`;
|
|
58127
58159
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
58128
58160
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -58143,8 +58175,8 @@ ELSE.\n`;
|
|
|
58143
58175
|
}
|
|
58144
58176
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
58145
58177
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
58146
|
-
code += `ENDIF.
|
|
58147
|
-
ENDLOOP.
|
|
58178
|
+
code += `ENDIF.
|
|
58179
|
+
ENDLOOP.
|
|
58148
58180
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
58149
58181
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
58150
58182
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58316,7 +58348,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58316
58348
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58317
58349
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58318
58350
|
// all ENUMS are char like?
|
|
58319
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58351
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58320
58352
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58321
58353
|
let count = 1;
|
|
58322
58354
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58360,14 +58392,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58360
58392
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58361
58393
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58362
58394
|
// restore tabix before exeption
|
|
58363
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58364
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58365
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58366
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58367
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58368
|
-
${indentation}IF sy-subrc <> 0.
|
|
58369
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58370
|
-
${indentation}ENDIF.
|
|
58395
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58396
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58397
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58398
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58399
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58400
|
+
${indentation}IF sy-subrc <> 0.
|
|
58401
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58402
|
+
${indentation}ENDIF.
|
|
58371
58403
|
${indentation}${uniqueName}`;
|
|
58372
58404
|
const start = target.getFirstToken().getStart();
|
|
58373
58405
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58451,11 +58483,11 @@ ${indentation}${uniqueName}`;
|
|
|
58451
58483
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58452
58484
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58453
58485
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58454
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58455
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58456
|
-
${indentation} EXPORTING
|
|
58457
|
-
${indentation} input = ${source}
|
|
58458
|
-
${indentation} IMPORTING
|
|
58486
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58487
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58488
|
+
${indentation} EXPORTING
|
|
58489
|
+
${indentation} input = ${source}
|
|
58490
|
+
${indentation} IMPORTING
|
|
58459
58491
|
${indentation} output = ${uniqueName}.\n`;
|
|
58460
58492
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58461
58493
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59767,12 +59799,12 @@ class EasyToFindMessages {
|
|
|
59767
59799
|
key: "easy_to_find_messages",
|
|
59768
59800
|
title: "Easy to find messages",
|
|
59769
59801
|
shortDescription: `Make messages easy to find`,
|
|
59770
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59771
|
-
|
|
59772
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59773
|
-
|
|
59774
|
-
Also see rule "message_exists"
|
|
59775
|
-
|
|
59802
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
59803
|
+
|
|
59804
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
59805
|
+
|
|
59806
|
+
Also see rule "message_exists"
|
|
59807
|
+
|
|
59776
59808
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59777
59809
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59778
59810
|
};
|
|
@@ -59853,13 +59885,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
59853
59885
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
59854
59886
|
extendedInformation: ``,
|
|
59855
59887
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
59856
|
-
badExample: `
|
|
59857
|
-
INITIALIZATION.
|
|
59858
|
-
WRITE 'hello'.
|
|
59888
|
+
badExample: `
|
|
59889
|
+
INITIALIZATION.
|
|
59890
|
+
WRITE 'hello'.
|
|
59859
59891
|
END-OF-SELECTION.`,
|
|
59860
|
-
goodExample: `
|
|
59861
|
-
START-OF-SELECTION.
|
|
59862
|
-
PERFORM sdf.
|
|
59892
|
+
goodExample: `
|
|
59893
|
+
START-OF-SELECTION.
|
|
59894
|
+
PERFORM sdf.
|
|
59863
59895
|
COMMIT WORK.`,
|
|
59864
59896
|
};
|
|
59865
59897
|
}
|
|
@@ -59951,8 +59983,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59951
59983
|
key: "empty_line_in_statement",
|
|
59952
59984
|
title: "Find empty lines in statements",
|
|
59953
59985
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59954
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59955
|
-
|
|
59986
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59987
|
+
|
|
59956
59988
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59957
59989
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59958
59990
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -60128,13 +60160,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60128
60160
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
60129
60161
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
60130
60162
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60131
|
-
badExample: `IF foo = bar.
|
|
60132
|
-
ENDIF.
|
|
60133
|
-
|
|
60134
|
-
DO 2 TIMES.
|
|
60163
|
+
badExample: `IF foo = bar.
|
|
60164
|
+
ENDIF.
|
|
60165
|
+
|
|
60166
|
+
DO 2 TIMES.
|
|
60135
60167
|
ENDDO.`,
|
|
60136
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60137
|
-
ENDLOOP.
|
|
60168
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60169
|
+
ENDLOOP.
|
|
60138
60170
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
60139
60171
|
};
|
|
60140
60172
|
}
|
|
@@ -60276,10 +60308,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
60276
60308
|
return {
|
|
60277
60309
|
key: "exit_or_check",
|
|
60278
60310
|
title: "Find EXIT or CHECK outside loops",
|
|
60279
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60311
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60280
60312
|
Use RETURN to leave procesing blocks instead.`,
|
|
60281
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60282
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60313
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60314
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60283
60315
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
60284
60316
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60285
60317
|
};
|
|
@@ -60362,12 +60394,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
60362
60394
|
key: "expand_macros",
|
|
60363
60395
|
title: "Expand Macros",
|
|
60364
60396
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
60365
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60366
|
-
|
|
60397
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60398
|
+
|
|
60367
60399
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
60368
|
-
badExample: `DEFINE _hello.
|
|
60369
|
-
WRITE 'hello'.
|
|
60370
|
-
END-OF-DEFINITION.
|
|
60400
|
+
badExample: `DEFINE _hello.
|
|
60401
|
+
WRITE 'hello'.
|
|
60402
|
+
END-OF-DEFINITION.
|
|
60371
60403
|
_hello.`,
|
|
60372
60404
|
goodExample: `WRITE 'hello'.`,
|
|
60373
60405
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60454,7 +60486,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60454
60486
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60455
60487
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60456
60488
|
goodExample: `call_method( foo = bar ).`,
|
|
60457
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60489
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60458
60490
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60459
60491
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60460
60492
|
};
|
|
@@ -60552,7 +60584,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60552
60584
|
key: "forbidden_identifier",
|
|
60553
60585
|
title: "Forbidden Identifier",
|
|
60554
60586
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60555
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60587
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60556
60588
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60557
60589
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60558
60590
|
};
|
|
@@ -60794,8 +60826,8 @@ class ForbiddenVoidType {
|
|
|
60794
60826
|
key: "forbidden_void_type",
|
|
60795
60827
|
title: "Forbidden Void Types",
|
|
60796
60828
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60797
|
-
extendedInformation: `Inspiration:
|
|
60798
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60829
|
+
extendedInformation: `Inspiration:
|
|
60830
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60799
60831
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60800
60832
|
};
|
|
60801
60833
|
}
|
|
@@ -61038,7 +61070,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
61038
61070
|
key: "fully_type_itabs",
|
|
61039
61071
|
title: "Fully type internal tables",
|
|
61040
61072
|
shortDescription: `No implict table types or table keys`,
|
|
61041
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
61073
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
61042
61074
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
61043
61075
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
61044
61076
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -61223,26 +61255,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
61223
61255
|
key: "functional_writing",
|
|
61224
61256
|
title: "Use functional writing",
|
|
61225
61257
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
61226
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61258
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61227
61259
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
61228
61260
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61229
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61230
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61231
|
-
EXPORTING
|
|
61232
|
-
p_name = 'NAME'
|
|
61233
|
-
RECEIVING
|
|
61234
|
-
p_descr_ref = lr_typedescr
|
|
61235
|
-
EXCEPTIONS
|
|
61236
|
-
type_not_found = 1
|
|
61261
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61262
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61263
|
+
EXPORTING
|
|
61264
|
+
p_name = 'NAME'
|
|
61265
|
+
RECEIVING
|
|
61266
|
+
p_descr_ref = lr_typedescr
|
|
61267
|
+
EXCEPTIONS
|
|
61268
|
+
type_not_found = 1
|
|
61237
61269
|
OTHERS = 2.`,
|
|
61238
|
-
goodExample: `zcl_class=>method( ).
|
|
61239
|
-
cl_abap_typedescr=>describe_by_name(
|
|
61240
|
-
EXPORTING
|
|
61241
|
-
p_name = 'NAME'
|
|
61242
|
-
RECEIVING
|
|
61243
|
-
p_descr_ref = lr_typedescr
|
|
61244
|
-
EXCEPTIONS
|
|
61245
|
-
type_not_found = 1
|
|
61270
|
+
goodExample: `zcl_class=>method( ).
|
|
61271
|
+
cl_abap_typedescr=>describe_by_name(
|
|
61272
|
+
EXPORTING
|
|
61273
|
+
p_name = 'NAME'
|
|
61274
|
+
RECEIVING
|
|
61275
|
+
p_descr_ref = lr_typedescr
|
|
61276
|
+
EXCEPTIONS
|
|
61277
|
+
type_not_found = 1
|
|
61246
61278
|
OTHERS = 2 ).`,
|
|
61247
61279
|
};
|
|
61248
61280
|
}
|
|
@@ -61353,14 +61385,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
61353
61385
|
key: "global_class",
|
|
61354
61386
|
title: "Global class checks",
|
|
61355
61387
|
shortDescription: `Checks related to global classes`,
|
|
61356
|
-
extendedInformation: `* global classes must be in own files
|
|
61357
|
-
|
|
61358
|
-
* file names must match class name
|
|
61359
|
-
|
|
61360
|
-
* file names must match interface name
|
|
61361
|
-
|
|
61362
|
-
* global classes must be global definitions
|
|
61363
|
-
|
|
61388
|
+
extendedInformation: `* global classes must be in own files
|
|
61389
|
+
|
|
61390
|
+
* file names must match class name
|
|
61391
|
+
|
|
61392
|
+
* file names must match interface name
|
|
61393
|
+
|
|
61394
|
+
* global classes must be global definitions
|
|
61395
|
+
|
|
61364
61396
|
* global interfaces must be global definitions`,
|
|
61365
61397
|
tags: [_irule_1.RuleTag.Syntax],
|
|
61366
61398
|
};
|
|
@@ -61459,21 +61491,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61459
61491
|
return {
|
|
61460
61492
|
key: "identical_conditions",
|
|
61461
61493
|
title: "Identical conditions",
|
|
61462
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61463
|
-
|
|
61494
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61495
|
+
|
|
61464
61496
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61465
61497
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61466
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61467
|
-
ENDIF.
|
|
61468
|
-
CASE bar.
|
|
61469
|
-
WHEN '1'.
|
|
61470
|
-
WHEN 'A' OR '1'.
|
|
61498
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61499
|
+
ENDIF.
|
|
61500
|
+
CASE bar.
|
|
61501
|
+
WHEN '1'.
|
|
61502
|
+
WHEN 'A' OR '1'.
|
|
61471
61503
|
ENDCASE.`,
|
|
61472
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61473
|
-
ENDIF.
|
|
61474
|
-
CASE bar.
|
|
61475
|
-
WHEN '1'.
|
|
61476
|
-
WHEN 'A'.
|
|
61504
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61505
|
+
ENDIF.
|
|
61506
|
+
CASE bar.
|
|
61507
|
+
WHEN '1'.
|
|
61508
|
+
WHEN 'A'.
|
|
61477
61509
|
ENDCASE.`,
|
|
61478
61510
|
};
|
|
61479
61511
|
}
|
|
@@ -61607,23 +61639,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61607
61639
|
key: "identical_contents",
|
|
61608
61640
|
title: "Identical contents",
|
|
61609
61641
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61610
|
-
extendedInformation: `
|
|
61611
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61612
|
-
|
|
61642
|
+
extendedInformation: `
|
|
61643
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61644
|
+
|
|
61613
61645
|
Chained statments are ignored`,
|
|
61614
61646
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61615
|
-
badExample: `IF foo = bar.
|
|
61616
|
-
WRITE 'bar'.
|
|
61617
|
-
WRITE 'world'.
|
|
61618
|
-
ELSE.
|
|
61619
|
-
WRITE 'foo'.
|
|
61620
|
-
WRITE 'world'.
|
|
61647
|
+
badExample: `IF foo = bar.
|
|
61648
|
+
WRITE 'bar'.
|
|
61649
|
+
WRITE 'world'.
|
|
61650
|
+
ELSE.
|
|
61651
|
+
WRITE 'foo'.
|
|
61652
|
+
WRITE 'world'.
|
|
61621
61653
|
ENDIF.`,
|
|
61622
|
-
goodExample: `IF foo = bar.
|
|
61623
|
-
WRITE 'bar'.
|
|
61624
|
-
ELSE.
|
|
61625
|
-
WRITE 'foo'.
|
|
61626
|
-
ENDIF.
|
|
61654
|
+
goodExample: `IF foo = bar.
|
|
61655
|
+
WRITE 'bar'.
|
|
61656
|
+
ELSE.
|
|
61657
|
+
WRITE 'foo'.
|
|
61658
|
+
ENDIF.
|
|
61627
61659
|
WRITE 'world'.`,
|
|
61628
61660
|
};
|
|
61629
61661
|
}
|
|
@@ -61731,12 +61763,12 @@ class IdenticalDescriptions {
|
|
|
61731
61763
|
key: "identical_descriptions",
|
|
61732
61764
|
title: "Identical descriptions",
|
|
61733
61765
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61734
|
-
extendedInformation: `Case insensitive
|
|
61735
|
-
|
|
61736
|
-
Only checks the master language descriptions
|
|
61737
|
-
|
|
61738
|
-
Dependencies are skipped
|
|
61739
|
-
|
|
61766
|
+
extendedInformation: `Case insensitive
|
|
61767
|
+
|
|
61768
|
+
Only checks the master language descriptions
|
|
61769
|
+
|
|
61770
|
+
Dependencies are skipped
|
|
61771
|
+
|
|
61740
61772
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61741
61773
|
tags: [],
|
|
61742
61774
|
};
|
|
@@ -61910,43 +61942,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61910
61942
|
key: "if_in_if",
|
|
61911
61943
|
title: "IF in IF",
|
|
61912
61944
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61913
|
-
extendedInformation: `
|
|
61914
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61915
|
-
|
|
61916
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61917
|
-
|
|
61918
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
61945
|
+
extendedInformation: `
|
|
61946
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61947
|
+
|
|
61948
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61949
|
+
|
|
61950
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
61919
61951
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61920
|
-
badExample: `IF condition1.
|
|
61921
|
-
IF condition2.
|
|
61922
|
-
...
|
|
61923
|
-
ENDIF.
|
|
61924
|
-
ENDIF.
|
|
61925
|
-
|
|
61926
|
-
IF condition1.
|
|
61927
|
-
...
|
|
61928
|
-
ELSE.
|
|
61929
|
-
IF condition2.
|
|
61930
|
-
...
|
|
61931
|
-
ENDIF.
|
|
61952
|
+
badExample: `IF condition1.
|
|
61953
|
+
IF condition2.
|
|
61954
|
+
...
|
|
61955
|
+
ENDIF.
|
|
61956
|
+
ENDIF.
|
|
61957
|
+
|
|
61958
|
+
IF condition1.
|
|
61959
|
+
...
|
|
61960
|
+
ELSE.
|
|
61961
|
+
IF condition2.
|
|
61962
|
+
...
|
|
61963
|
+
ENDIF.
|
|
61932
61964
|
ENDIF.`,
|
|
61933
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61934
|
-
...
|
|
61935
|
-
ENDIF.
|
|
61936
|
-
|
|
61937
|
-
IF condition1.
|
|
61938
|
-
...
|
|
61939
|
-
ELSEIF condition2.
|
|
61940
|
-
...
|
|
61941
|
-
ENDIF.
|
|
61942
|
-
|
|
61943
|
-
CASE variable.
|
|
61944
|
-
WHEN value1.
|
|
61945
|
-
...
|
|
61946
|
-
WHEN value2.
|
|
61947
|
-
IF condition2.
|
|
61948
|
-
...
|
|
61949
|
-
ENDIF.
|
|
61965
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61966
|
+
...
|
|
61967
|
+
ENDIF.
|
|
61968
|
+
|
|
61969
|
+
IF condition1.
|
|
61970
|
+
...
|
|
61971
|
+
ELSEIF condition2.
|
|
61972
|
+
...
|
|
61973
|
+
ENDIF.
|
|
61974
|
+
|
|
61975
|
+
CASE variable.
|
|
61976
|
+
WHEN value1.
|
|
61977
|
+
...
|
|
61978
|
+
WHEN value2.
|
|
61979
|
+
IF condition2.
|
|
61980
|
+
...
|
|
61981
|
+
ENDIF.
|
|
61950
61982
|
ENDCASE.`,
|
|
61951
61983
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61952
61984
|
};
|
|
@@ -62131,9 +62163,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
62131
62163
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
62132
62164
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
62133
62165
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
62134
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62135
|
-
METHOD ${methodName.toLowerCase()}.
|
|
62136
|
-
RETURN. " todo, implement method
|
|
62166
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62167
|
+
METHOD ${methodName.toLowerCase()}.
|
|
62168
|
+
RETURN. " todo, implement method
|
|
62137
62169
|
ENDMETHOD.`);
|
|
62138
62170
|
}
|
|
62139
62171
|
}
|
|
@@ -62312,14 +62344,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
62312
62344
|
key: "implicit_start_of_selection",
|
|
62313
62345
|
title: "Implicit START-OF-SELECTION",
|
|
62314
62346
|
shortDescription: `Add explicit selection screen event handling`,
|
|
62315
|
-
extendedInformation: `Only runs for executable programs
|
|
62316
|
-
|
|
62347
|
+
extendedInformation: `Only runs for executable programs
|
|
62348
|
+
|
|
62317
62349
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
62318
62350
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62319
|
-
badExample: `REPORT zfoo.
|
|
62351
|
+
badExample: `REPORT zfoo.
|
|
62320
62352
|
WRITE 'hello'.`,
|
|
62321
|
-
goodExample: `
|
|
62322
|
-
START-OF-SELECTION.
|
|
62353
|
+
goodExample: `
|
|
62354
|
+
START-OF-SELECTION.
|
|
62323
62355
|
WRITE 'hello'.`,
|
|
62324
62356
|
};
|
|
62325
62357
|
}
|
|
@@ -62424,19 +62456,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
62424
62456
|
key: "in_statement_indentation",
|
|
62425
62457
|
title: "In-statement indentation",
|
|
62426
62458
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
62427
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62428
|
-
|
|
62429
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62459
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62460
|
+
|
|
62461
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62430
62462
|
to distinguish them better from code within the block.`,
|
|
62431
|
-
badExample: `IF 1 = 1
|
|
62432
|
-
AND 2 = 2.
|
|
62433
|
-
WRITE 'hello' &&
|
|
62434
|
-
'world'.
|
|
62463
|
+
badExample: `IF 1 = 1
|
|
62464
|
+
AND 2 = 2.
|
|
62465
|
+
WRITE 'hello' &&
|
|
62466
|
+
'world'.
|
|
62435
62467
|
ENDIF.`,
|
|
62436
|
-
goodExample: `IF 1 = 1
|
|
62437
|
-
AND 2 = 2.
|
|
62438
|
-
WRITE 'hello' &&
|
|
62439
|
-
'world'.
|
|
62468
|
+
goodExample: `IF 1 = 1
|
|
62469
|
+
AND 2 = 2.
|
|
62470
|
+
WRITE 'hello' &&
|
|
62471
|
+
'world'.
|
|
62440
62472
|
ENDIF.`,
|
|
62441
62473
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62442
62474
|
};
|
|
@@ -62559,23 +62591,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62559
62591
|
title: "Indentation",
|
|
62560
62592
|
shortDescription: `Checks indentation`,
|
|
62561
62593
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62562
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62563
|
-
PRIVATE SECTION.
|
|
62564
|
-
METHODS constructor.
|
|
62565
|
-
ENDCLASS.
|
|
62566
|
-
|
|
62567
|
-
CLASS lcl IMPLEMENTATION.
|
|
62568
|
-
METHOD constructor.
|
|
62569
|
-
ENDMETHOD.
|
|
62594
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62595
|
+
PRIVATE SECTION.
|
|
62596
|
+
METHODS constructor.
|
|
62597
|
+
ENDCLASS.
|
|
62598
|
+
|
|
62599
|
+
CLASS lcl IMPLEMENTATION.
|
|
62600
|
+
METHOD constructor.
|
|
62601
|
+
ENDMETHOD.
|
|
62570
62602
|
ENDCLASS.`,
|
|
62571
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62572
|
-
PRIVATE SECTION.
|
|
62573
|
-
METHODS constructor.
|
|
62574
|
-
ENDCLASS.
|
|
62575
|
-
|
|
62576
|
-
CLASS lcl IMPLEMENTATION.
|
|
62577
|
-
METHOD constructor.
|
|
62578
|
-
ENDMETHOD.
|
|
62603
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62604
|
+
PRIVATE SECTION.
|
|
62605
|
+
METHODS constructor.
|
|
62606
|
+
ENDCLASS.
|
|
62607
|
+
|
|
62608
|
+
CLASS lcl IMPLEMENTATION.
|
|
62609
|
+
METHOD constructor.
|
|
62610
|
+
ENDMETHOD.
|
|
62579
62611
|
ENDCLASS.`,
|
|
62580
62612
|
};
|
|
62581
62613
|
}
|
|
@@ -62609,6 +62641,7 @@ ENDCLASS.`,
|
|
|
62609
62641
|
};
|
|
62610
62642
|
const expected = new indent_1.Indent(indentOpts).getExpectedIndents(file);
|
|
62611
62643
|
const ret = [];
|
|
62644
|
+
let previous = undefined;
|
|
62612
62645
|
for (const statement of file.getStatements()) {
|
|
62613
62646
|
const position = statement.getFirstToken().getStart();
|
|
62614
62647
|
if (position instanceof virtual_position_1.VirtualPosition) {
|
|
@@ -62643,6 +62676,12 @@ ENDCLASS.`,
|
|
|
62643
62676
|
continue;
|
|
62644
62677
|
}
|
|
62645
62678
|
}
|
|
62679
|
+
// only apply for the first statement in a chain
|
|
62680
|
+
if (statement.getColon() !== undefined
|
|
62681
|
+
&& (previous === null || previous === void 0 ? void 0 : previous.getColon()) !== undefined
|
|
62682
|
+
&& statement.getColon().getStart().equals(previous.getColon().getStart())) {
|
|
62683
|
+
continue;
|
|
62684
|
+
}
|
|
62646
62685
|
if (indent && indent > 0 && indent !== position.getCol()) {
|
|
62647
62686
|
const expected = indent - 1;
|
|
62648
62687
|
const fix = edit_helper_1.EditHelper.replaceRange(file, new position_1.Position(position.getRow(), 1), position, " ".repeat(expected));
|
|
@@ -62653,6 +62692,7 @@ ENDCLASS.`,
|
|
|
62653
62692
|
break;
|
|
62654
62693
|
}
|
|
62655
62694
|
}
|
|
62695
|
+
previous = statement;
|
|
62656
62696
|
}
|
|
62657
62697
|
return ret;
|
|
62658
62698
|
}
|
|
@@ -62968,9 +63008,9 @@ class IntfReferencingClas {
|
|
|
62968
63008
|
key: "intf_referencing_clas",
|
|
62969
63009
|
title: "INTF referencing CLAS",
|
|
62970
63010
|
shortDescription: `Interface contains references to class`,
|
|
62971
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62972
|
-
Only first level references are checked.
|
|
62973
|
-
Exception class references are ignored.
|
|
63011
|
+
extendedInformation: `Only global interfaces are checked.
|
|
63012
|
+
Only first level references are checked.
|
|
63013
|
+
Exception class references are ignored.
|
|
62974
63014
|
Void references are ignored.`,
|
|
62975
63015
|
};
|
|
62976
63016
|
}
|
|
@@ -63055,9 +63095,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
63055
63095
|
title: "Invalid Table Index",
|
|
63056
63096
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
63057
63097
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63058
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
63098
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
63059
63099
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
63060
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
63100
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
63061
63101
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
63062
63102
|
};
|
|
63063
63103
|
}
|
|
@@ -63658,8 +63698,8 @@ class LineBreakStyle {
|
|
|
63658
63698
|
return {
|
|
63659
63699
|
key: "line_break_style",
|
|
63660
63700
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63661
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63662
|
-
|
|
63701
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63702
|
+
|
|
63663
63703
|
abapGit does not work with CRLF`,
|
|
63664
63704
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63665
63705
|
};
|
|
@@ -63728,7 +63768,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63728
63768
|
key: "line_length",
|
|
63729
63769
|
title: "Line length",
|
|
63730
63770
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63731
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63771
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63732
63772
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63733
63773
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63734
63774
|
};
|
|
@@ -63799,7 +63839,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63799
63839
|
key: "line_only_punc",
|
|
63800
63840
|
title: "Line containing only punctuation",
|
|
63801
63841
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63802
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63842
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63803
63843
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63804
63844
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63805
63845
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -64062,15 +64102,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
64062
64102
|
return {
|
|
64063
64103
|
key: "local_variable_names",
|
|
64064
64104
|
title: "Local variable naming conventions",
|
|
64065
|
-
shortDescription: `
|
|
64066
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
64105
|
+
shortDescription: `
|
|
64106
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
64067
64107
|
Regexes are case-insensitive.`,
|
|
64068
64108
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64069
|
-
badExample: `FORM bar.
|
|
64070
|
-
DATA foo.
|
|
64109
|
+
badExample: `FORM bar.
|
|
64110
|
+
DATA foo.
|
|
64071
64111
|
ENDFORM.`,
|
|
64072
|
-
goodExample: `FORM bar.
|
|
64073
|
-
DATA lv_foo.
|
|
64112
|
+
goodExample: `FORM bar.
|
|
64113
|
+
DATA lv_foo.
|
|
64074
64114
|
ENDFORM.`,
|
|
64075
64115
|
};
|
|
64076
64116
|
}
|
|
@@ -64222,9 +64262,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
64222
64262
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
64223
64263
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
64224
64264
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
64225
|
-
badExample: `DEFINE something.
|
|
64265
|
+
badExample: `DEFINE something.
|
|
64226
64266
|
END-OF-DEFINITION.`,
|
|
64227
|
-
goodExample: `DEFINE _something.
|
|
64267
|
+
goodExample: `DEFINE _something.
|
|
64228
64268
|
END-OF-DEFINITION.`,
|
|
64229
64269
|
};
|
|
64230
64270
|
}
|
|
@@ -64297,10 +64337,10 @@ class MainFileContents {
|
|
|
64297
64337
|
key: "main_file_contents",
|
|
64298
64338
|
title: "Main file contents",
|
|
64299
64339
|
shortDescription: `Checks related to report declarations.`,
|
|
64300
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
64301
|
-
|
|
64302
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64303
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64340
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
64341
|
+
|
|
64342
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64343
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64304
64344
|
`,
|
|
64305
64345
|
};
|
|
64306
64346
|
}
|
|
@@ -64416,17 +64456,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
64416
64456
|
title: "Too many parentheses",
|
|
64417
64457
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
64418
64458
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64419
|
-
badExample: `
|
|
64420
|
-
IF ( destination IS INITIAL ).
|
|
64421
|
-
ENDIF.
|
|
64422
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64423
|
-
ENDIF.
|
|
64459
|
+
badExample: `
|
|
64460
|
+
IF ( destination IS INITIAL ).
|
|
64461
|
+
ENDIF.
|
|
64462
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64463
|
+
ENDIF.
|
|
64424
64464
|
`,
|
|
64425
|
-
goodExample: `
|
|
64426
|
-
IF destination IS INITIAL.
|
|
64427
|
-
ENDIF.
|
|
64428
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
64429
|
-
ENDIF.
|
|
64465
|
+
goodExample: `
|
|
64466
|
+
IF destination IS INITIAL.
|
|
64467
|
+
ENDIF.
|
|
64468
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
64469
|
+
ENDIF.
|
|
64430
64470
|
`,
|
|
64431
64471
|
};
|
|
64432
64472
|
}
|
|
@@ -64600,14 +64640,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64600
64640
|
title: "Max one method parameter definition per line",
|
|
64601
64641
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64602
64642
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64603
|
-
badExample: `
|
|
64604
|
-
METHODS apps_scope_token
|
|
64605
|
-
IMPORTING
|
|
64643
|
+
badExample: `
|
|
64644
|
+
METHODS apps_scope_token
|
|
64645
|
+
IMPORTING
|
|
64606
64646
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64607
|
-
goodExample: `
|
|
64608
|
-
METHODS apps_scope_token
|
|
64609
|
-
IMPORTING
|
|
64610
|
-
body TYPE bodyapps_scope_token
|
|
64647
|
+
goodExample: `
|
|
64648
|
+
METHODS apps_scope_token
|
|
64649
|
+
IMPORTING
|
|
64650
|
+
body TYPE bodyapps_scope_token
|
|
64611
64651
|
client_id TYPE str.`,
|
|
64612
64652
|
};
|
|
64613
64653
|
}
|
|
@@ -64672,11 +64712,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64672
64712
|
key: "max_one_statement",
|
|
64673
64713
|
title: "Max one statement per line",
|
|
64674
64714
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64675
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64676
|
-
|
|
64677
|
-
Does not report anything for chained statements.
|
|
64678
|
-
|
|
64679
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64715
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64716
|
+
|
|
64717
|
+
Does not report anything for chained statements.
|
|
64718
|
+
|
|
64719
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64680
64720
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64681
64721
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64682
64722
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -65014,8 +65054,8 @@ class MethodLength {
|
|
|
65014
65054
|
key: "method_length",
|
|
65015
65055
|
title: "Method/Form Length",
|
|
65016
65056
|
shortDescription: `Checks relating to method/form length.`,
|
|
65017
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
65018
|
-
|
|
65057
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
65058
|
+
|
|
65019
65059
|
Abstract methods without statements are considered okay.`,
|
|
65020
65060
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65021
65061
|
};
|
|
@@ -65120,20 +65160,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
65120
65160
|
key: "method_overwrites_builtin",
|
|
65121
65161
|
title: "Method name overwrites builtin function",
|
|
65122
65162
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
65123
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
65124
|
-
|
|
65125
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
65126
|
-
|
|
65163
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
65164
|
+
|
|
65165
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
65166
|
+
|
|
65127
65167
|
Interface method names are ignored`,
|
|
65128
65168
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65129
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65130
|
-
PUBLIC SECTION.
|
|
65131
|
-
METHODS matches.
|
|
65132
|
-
ENDCLASS.
|
|
65133
|
-
|
|
65134
|
-
CLASS lcl IMPLEMENTATION.
|
|
65135
|
-
METHOD matches.
|
|
65136
|
-
ENDMETHOD.
|
|
65169
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65170
|
+
PUBLIC SECTION.
|
|
65171
|
+
METHODS matches.
|
|
65172
|
+
ENDCLASS.
|
|
65173
|
+
|
|
65174
|
+
CLASS lcl IMPLEMENTATION.
|
|
65175
|
+
METHOD matches.
|
|
65176
|
+
ENDMETHOD.
|
|
65137
65177
|
ENDCLASS.`,
|
|
65138
65178
|
};
|
|
65139
65179
|
}
|
|
@@ -65324,12 +65364,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
65324
65364
|
// eslint-disable-next-line max-len
|
|
65325
65365
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
65326
65366
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65327
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65328
|
-
PUBLIC SECTION.
|
|
65329
|
-
METHODS
|
|
65330
|
-
foobar
|
|
65331
|
-
EXPORTING foo TYPE i
|
|
65332
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
65367
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65368
|
+
PUBLIC SECTION.
|
|
65369
|
+
METHODS
|
|
65370
|
+
foobar
|
|
65371
|
+
EXPORTING foo TYPE i
|
|
65372
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
65333
65373
|
ENDCLASS.`,
|
|
65334
65374
|
};
|
|
65335
65375
|
}
|
|
@@ -65709,7 +65749,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65709
65749
|
key: "nesting",
|
|
65710
65750
|
title: "Check nesting depth",
|
|
65711
65751
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65712
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65752
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65713
65753
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65714
65754
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65715
65755
|
};
|
|
@@ -65952,7 +65992,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65952
65992
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65953
65993
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65954
65994
|
badExample: `var1 = var2 = var3.`,
|
|
65955
|
-
goodExample: `var2 = var3.
|
|
65995
|
+
goodExample: `var2 = var3.
|
|
65956
65996
|
var1 = var2.`,
|
|
65957
65997
|
};
|
|
65958
65998
|
}
|
|
@@ -66011,8 +66051,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
66011
66051
|
key: "no_external_form_calls",
|
|
66012
66052
|
title: "No external FORM calls",
|
|
66013
66053
|
shortDescription: `Detect external form calls`,
|
|
66014
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
66015
|
-
|
|
66054
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
66055
|
+
|
|
66016
66056
|
PERFORM foo(bar).`,
|
|
66017
66057
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66018
66058
|
};
|
|
@@ -66073,17 +66113,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
66073
66113
|
key: "no_inline_in_optional_branches",
|
|
66074
66114
|
title: "Don't declare inline in optional branches",
|
|
66075
66115
|
shortDescription: `Don't declare inline in optional branches`,
|
|
66076
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
66077
|
-
|
|
66078
|
-
Considered optional branches:
|
|
66079
|
-
* inside IF/ELSEIF/ELSE
|
|
66080
|
-
* inside LOOP
|
|
66081
|
-
* inside WHILE
|
|
66082
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
66083
|
-
* inside DO
|
|
66084
|
-
* inside SELECT loops
|
|
66085
|
-
|
|
66086
|
-
Not considered optional branches:
|
|
66116
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
66117
|
+
|
|
66118
|
+
Considered optional branches:
|
|
66119
|
+
* inside IF/ELSEIF/ELSE
|
|
66120
|
+
* inside LOOP
|
|
66121
|
+
* inside WHILE
|
|
66122
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
66123
|
+
* inside DO
|
|
66124
|
+
* inside SELECT loops
|
|
66125
|
+
|
|
66126
|
+
Not considered optional branches:
|
|
66087
66127
|
* TRY/CATCH/CLEANUP`,
|
|
66088
66128
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66089
66129
|
};
|
|
@@ -66183,12 +66223,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
66183
66223
|
key: "no_prefixes",
|
|
66184
66224
|
title: "No Prefixes",
|
|
66185
66225
|
shortDescription: `Dont use hungarian notation`,
|
|
66186
|
-
extendedInformation: `
|
|
66187
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
66188
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
66189
|
-
|
|
66190
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66191
|
-
|
|
66226
|
+
extendedInformation: `
|
|
66227
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
66228
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
66229
|
+
|
|
66230
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66231
|
+
|
|
66192
66232
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
66193
66233
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66194
66234
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -66367,7 +66407,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
66367
66407
|
return {
|
|
66368
66408
|
key: "no_public_attributes",
|
|
66369
66409
|
title: "No public attributes",
|
|
66370
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66410
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66371
66411
|
Exceptions are excluded from this rule.`,
|
|
66372
66412
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
66373
66413
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -66468,13 +66508,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
66468
66508
|
key: "no_yoda_conditions",
|
|
66469
66509
|
title: "No Yoda conditions",
|
|
66470
66510
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
66471
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66472
|
-
|
|
66511
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66512
|
+
|
|
66473
66513
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
66474
66514
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66475
|
-
badExample: `IF 0 <> sy-subrc.
|
|
66515
|
+
badExample: `IF 0 <> sy-subrc.
|
|
66476
66516
|
ENDIF.`,
|
|
66477
|
-
goodExample: `IF sy-subrc <> 0.
|
|
66517
|
+
goodExample: `IF sy-subrc <> 0.
|
|
66478
66518
|
ENDIF.`,
|
|
66479
66519
|
};
|
|
66480
66520
|
}
|
|
@@ -66575,8 +66615,8 @@ class NROBConsistency {
|
|
|
66575
66615
|
key: "nrob_consistency",
|
|
66576
66616
|
title: "Number range consistency",
|
|
66577
66617
|
shortDescription: `Consistency checks for number ranges`,
|
|
66578
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66579
|
-
|
|
66618
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66619
|
+
|
|
66580
66620
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
66581
66621
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66582
66622
|
};
|
|
@@ -66853,58 +66893,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66853
66893
|
title: "Obsolete statements",
|
|
66854
66894
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66855
66895
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66856
|
-
extendedInformation: `
|
|
66857
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66858
|
-
|
|
66859
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66860
|
-
|
|
66861
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66862
|
-
|
|
66863
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66864
|
-
|
|
66865
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66866
|
-
|
|
66867
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66868
|
-
|
|
66869
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66870
|
-
|
|
66871
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66872
|
-
|
|
66873
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66874
|
-
|
|
66875
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66876
|
-
|
|
66877
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66878
|
-
|
|
66879
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66880
|
-
|
|
66881
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66882
|
-
|
|
66883
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66884
|
-
|
|
66885
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66886
|
-
SELECT COUNT(*) is considered okay
|
|
66887
|
-
|
|
66888
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66889
|
-
|
|
66890
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66891
|
-
|
|
66892
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66893
|
-
|
|
66894
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66895
|
-
|
|
66896
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66897
|
-
|
|
66896
|
+
extendedInformation: `
|
|
66897
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66898
|
+
|
|
66899
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66900
|
+
|
|
66901
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66902
|
+
|
|
66903
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66904
|
+
|
|
66905
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66906
|
+
|
|
66907
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66908
|
+
|
|
66909
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66910
|
+
|
|
66911
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66912
|
+
|
|
66913
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66914
|
+
|
|
66915
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66916
|
+
|
|
66917
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66918
|
+
|
|
66919
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66920
|
+
|
|
66921
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66922
|
+
|
|
66923
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66924
|
+
|
|
66925
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66926
|
+
SELECT COUNT(*) is considered okay
|
|
66927
|
+
|
|
66928
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66929
|
+
|
|
66930
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66931
|
+
|
|
66932
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66933
|
+
|
|
66934
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66935
|
+
|
|
66936
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66937
|
+
|
|
66898
66938
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66899
|
-
badExample: `REFRESH itab.
|
|
66900
|
-
|
|
66901
|
-
COMPUTE foo = 2 + 2.
|
|
66902
|
-
|
|
66903
|
-
MULTIPLY lv_foo BY 2.
|
|
66904
|
-
|
|
66905
|
-
INTERFACE intf LOAD.
|
|
66906
|
-
|
|
66907
|
-
IF foo IS SUPPLIED.
|
|
66939
|
+
badExample: `REFRESH itab.
|
|
66940
|
+
|
|
66941
|
+
COMPUTE foo = 2 + 2.
|
|
66942
|
+
|
|
66943
|
+
MULTIPLY lv_foo BY 2.
|
|
66944
|
+
|
|
66945
|
+
INTERFACE intf LOAD.
|
|
66946
|
+
|
|
66947
|
+
IF foo IS SUPPLIED.
|
|
66908
66948
|
ENDIF.`,
|
|
66909
66949
|
};
|
|
66910
66950
|
}
|
|
@@ -67244,9 +67284,9 @@ class OmitParameterName {
|
|
|
67244
67284
|
key: "omit_parameter_name",
|
|
67245
67285
|
title: "Omit parameter name",
|
|
67246
67286
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
67247
|
-
extendedInformation: `
|
|
67248
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67249
|
-
|
|
67287
|
+
extendedInformation: `
|
|
67288
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67289
|
+
|
|
67250
67290
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
67251
67291
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67252
67292
|
badExample: `method( param = 2 ).`,
|
|
@@ -67452,20 +67492,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
67452
67492
|
shortDescription: `Omit RECEIVING`,
|
|
67453
67493
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
67454
67494
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67455
|
-
badExample: `
|
|
67456
|
-
upload_pack(
|
|
67457
|
-
EXPORTING
|
|
67458
|
-
io_client = lo_client
|
|
67459
|
-
iv_url = iv_url
|
|
67460
|
-
iv_deepen_level = iv_deepen_level
|
|
67461
|
-
it_hashes = lt_hashes
|
|
67462
|
-
RECEIVING
|
|
67495
|
+
badExample: `
|
|
67496
|
+
upload_pack(
|
|
67497
|
+
EXPORTING
|
|
67498
|
+
io_client = lo_client
|
|
67499
|
+
iv_url = iv_url
|
|
67500
|
+
iv_deepen_level = iv_deepen_level
|
|
67501
|
+
it_hashes = lt_hashes
|
|
67502
|
+
RECEIVING
|
|
67463
67503
|
rt_objects = et_objects ).`,
|
|
67464
|
-
goodExample: `
|
|
67465
|
-
et_objects = upload_pack(
|
|
67466
|
-
io_client = lo_client
|
|
67467
|
-
iv_url = iv_url
|
|
67468
|
-
iv_deepen_level = iv_deepen_level
|
|
67504
|
+
goodExample: `
|
|
67505
|
+
et_objects = upload_pack(
|
|
67506
|
+
io_client = lo_client
|
|
67507
|
+
iv_url = iv_url
|
|
67508
|
+
iv_deepen_level = iv_deepen_level
|
|
67469
67509
|
it_hashes = lt_hashes ).`,
|
|
67470
67510
|
};
|
|
67471
67511
|
}
|
|
@@ -67529,8 +67569,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
67529
67569
|
return {
|
|
67530
67570
|
key: "parser_702_chaining",
|
|
67531
67571
|
title: "Parser Error, bad chanining on 702",
|
|
67532
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67533
|
-
this rule finds these and reports errors.
|
|
67572
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67573
|
+
this rule finds these and reports errors.
|
|
67534
67574
|
Only active on target version 702 and below.`,
|
|
67535
67575
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67536
67576
|
};
|
|
@@ -67610,8 +67650,8 @@ class ParserError {
|
|
|
67610
67650
|
return {
|
|
67611
67651
|
key: "parser_error",
|
|
67612
67652
|
title: "Parser error",
|
|
67613
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67614
|
-
|
|
67653
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67654
|
+
|
|
67615
67655
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67616
67656
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67617
67657
|
};
|
|
@@ -67696,7 +67736,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67696
67736
|
return {
|
|
67697
67737
|
key: "parser_missing_space",
|
|
67698
67738
|
title: "Parser Error, missing space",
|
|
67699
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67739
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67700
67740
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67701
67741
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67702
67742
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -68108,25 +68148,25 @@ class PreferInline {
|
|
|
68108
68148
|
key: "prefer_inline",
|
|
68109
68149
|
title: "Prefer Inline Declarations",
|
|
68110
68150
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
68111
|
-
extendedInformation: `EXPERIMENTAL
|
|
68112
|
-
|
|
68113
|
-
Activates if language version is v740sp02 or above.
|
|
68114
|
-
|
|
68115
|
-
Variables must be local(METHOD or FORM).
|
|
68116
|
-
|
|
68117
|
-
No generic or void typed variables. No syntax errors.
|
|
68118
|
-
|
|
68119
|
-
First position used must be a full/pure write.
|
|
68120
|
-
|
|
68121
|
-
Move statment is not a cast(?=)
|
|
68122
|
-
|
|
68151
|
+
extendedInformation: `EXPERIMENTAL
|
|
68152
|
+
|
|
68153
|
+
Activates if language version is v740sp02 or above.
|
|
68154
|
+
|
|
68155
|
+
Variables must be local(METHOD or FORM).
|
|
68156
|
+
|
|
68157
|
+
No generic or void typed variables. No syntax errors.
|
|
68158
|
+
|
|
68159
|
+
First position used must be a full/pure write.
|
|
68160
|
+
|
|
68161
|
+
Move statment is not a cast(?=)
|
|
68162
|
+
|
|
68123
68163
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
68124
68164
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
68125
|
-
badExample: `DATA foo TYPE i.
|
|
68126
|
-
foo = 2.
|
|
68127
|
-
DATA percentage TYPE decfloat34.
|
|
68165
|
+
badExample: `DATA foo TYPE i.
|
|
68166
|
+
foo = 2.
|
|
68167
|
+
DATA percentage TYPE decfloat34.
|
|
68128
68168
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
68129
|
-
goodExample: `DATA(foo) = 2.
|
|
68169
|
+
goodExample: `DATA(foo) = 2.
|
|
68130
68170
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
68131
68171
|
};
|
|
68132
68172
|
}
|
|
@@ -68340,18 +68380,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
68340
68380
|
key: "prefer_is_not",
|
|
68341
68381
|
title: "Prefer IS NOT to NOT IS",
|
|
68342
68382
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
68343
|
-
extendedInformation: `
|
|
68344
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68345
|
-
|
|
68383
|
+
extendedInformation: `
|
|
68384
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68385
|
+
|
|
68346
68386
|
"if not is_valid( )." examples are skipped`,
|
|
68347
68387
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68348
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
68349
|
-
IF variable NP 'TODO*'.
|
|
68350
|
-
IF variable <> 42.
|
|
68388
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
68389
|
+
IF variable NP 'TODO*'.
|
|
68390
|
+
IF variable <> 42.
|
|
68351
68391
|
IF variable CO 'hello'.`,
|
|
68352
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
68353
|
-
IF NOT variable CP 'TODO*'.
|
|
68354
|
-
IF NOT variable = 42.
|
|
68392
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
68393
|
+
IF NOT variable CP 'TODO*'.
|
|
68394
|
+
IF NOT variable = 42.
|
|
68355
68395
|
IF NOT variable CA 'hello'.`,
|
|
68356
68396
|
};
|
|
68357
68397
|
}
|
|
@@ -68539,14 +68579,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
68539
68579
|
key: "prefer_raise_exception_new",
|
|
68540
68580
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
68541
68581
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
68542
|
-
extendedInformation: `
|
|
68543
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68544
|
-
|
|
68582
|
+
extendedInformation: `
|
|
68583
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68584
|
+
|
|
68545
68585
|
From 752 and up`,
|
|
68546
68586
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
68547
68587
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
68548
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68549
|
-
EXPORTING
|
|
68588
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68589
|
+
EXPORTING
|
|
68550
68590
|
previous = exception.`,
|
|
68551
68591
|
};
|
|
68552
68592
|
}
|
|
@@ -68624,12 +68664,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68624
68664
|
key: "prefer_returning_to_exporting",
|
|
68625
68665
|
title: "Prefer RETURNING to EXPORTING",
|
|
68626
68666
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68627
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68667
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68628
68668
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68629
68669
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68630
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68631
|
-
PUBLIC SECTION.
|
|
68632
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68670
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68671
|
+
PUBLIC SECTION.
|
|
68672
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68633
68673
|
ENDCLASS.`,
|
|
68634
68674
|
};
|
|
68635
68675
|
}
|
|
@@ -68725,8 +68765,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68725
68765
|
key: "prefer_xsdbool",
|
|
68726
68766
|
title: "Prefer xsdbool over boolc",
|
|
68727
68767
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68728
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68729
|
-
|
|
68768
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68769
|
+
|
|
68730
68770
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68731
68771
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68732
68772
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68798,9 +68838,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68798
68838
|
title: "Preferred compare operator",
|
|
68799
68839
|
shortDescription: `Configure undesired operator variants`,
|
|
68800
68840
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68801
|
-
badExample: `IF foo EQ bar.
|
|
68841
|
+
badExample: `IF foo EQ bar.
|
|
68802
68842
|
ENDIF.`,
|
|
68803
|
-
goodExample: `IF foo = bar.
|
|
68843
|
+
goodExample: `IF foo = bar.
|
|
68804
68844
|
ENDIF.`,
|
|
68805
68845
|
};
|
|
68806
68846
|
}
|
|
@@ -69024,26 +69064,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
69024
69064
|
key: "reduce_procedural_code",
|
|
69025
69065
|
title: "Reduce procedural code",
|
|
69026
69066
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
69027
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
69028
|
-
|
|
69029
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
69030
|
-
|
|
69067
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
69068
|
+
|
|
69069
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
69070
|
+
|
|
69031
69071
|
Comments are not counted as statements.`,
|
|
69032
69072
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
69033
|
-
badExample: `FORM foo.
|
|
69034
|
-
DATA lv_bar TYPE i.
|
|
69035
|
-
lv_bar = 2 + 2.
|
|
69036
|
-
IF lv_bar = 4.
|
|
69037
|
-
WRITE 'hello world'.
|
|
69038
|
-
ENDIF.
|
|
69039
|
-
DATA lv_bar TYPE i.
|
|
69040
|
-
lv_bar = 2 + 2.
|
|
69041
|
-
IF lv_bar = 4.
|
|
69042
|
-
WRITE 'hello world'.
|
|
69043
|
-
ENDIF.
|
|
69073
|
+
badExample: `FORM foo.
|
|
69074
|
+
DATA lv_bar TYPE i.
|
|
69075
|
+
lv_bar = 2 + 2.
|
|
69076
|
+
IF lv_bar = 4.
|
|
69077
|
+
WRITE 'hello world'.
|
|
69078
|
+
ENDIF.
|
|
69079
|
+
DATA lv_bar TYPE i.
|
|
69080
|
+
lv_bar = 2 + 2.
|
|
69081
|
+
IF lv_bar = 4.
|
|
69082
|
+
WRITE 'hello world'.
|
|
69083
|
+
ENDIF.
|
|
69044
69084
|
ENDFORM.`,
|
|
69045
|
-
goodExample: `FORM foo.
|
|
69046
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
69085
|
+
goodExample: `FORM foo.
|
|
69086
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
69047
69087
|
ENDFORM.`,
|
|
69048
69088
|
};
|
|
69049
69089
|
}
|
|
@@ -69287,10 +69327,10 @@ class RemoveDescriptions {
|
|
|
69287
69327
|
return {
|
|
69288
69328
|
key: "remove_descriptions",
|
|
69289
69329
|
title: "Remove descriptions",
|
|
69290
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69291
|
-
|
|
69292
|
-
Class descriptions are required, see rule description_empty.
|
|
69293
|
-
|
|
69330
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69331
|
+
|
|
69332
|
+
Class descriptions are required, see rule description_empty.
|
|
69333
|
+
|
|
69294
69334
|
Consider using ABAP Doc for documentation.`,
|
|
69295
69335
|
tags: [],
|
|
69296
69336
|
};
|
|
@@ -69415,14 +69455,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
69415
69455
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69416
69456
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
69417
69457
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
69418
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
69458
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
69419
69459
|
DESTINATION lv_rfc.`,
|
|
69420
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69421
|
-
DESTINATION lv_rfc
|
|
69422
|
-
EXCEPTIONS
|
|
69423
|
-
system_failure = 1 MESSAGE msg
|
|
69424
|
-
communication_failure = 2 MESSAGE msg
|
|
69425
|
-
resource_failure = 3
|
|
69460
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69461
|
+
DESTINATION lv_rfc
|
|
69462
|
+
EXCEPTIONS
|
|
69463
|
+
system_failure = 1 MESSAGE msg
|
|
69464
|
+
communication_failure = 2 MESSAGE msg
|
|
69465
|
+
resource_failure = 3
|
|
69426
69466
|
OTHERS = 4.`,
|
|
69427
69467
|
};
|
|
69428
69468
|
}
|
|
@@ -69506,11 +69546,11 @@ class SelectAddOrderBy {
|
|
|
69506
69546
|
key: "select_add_order_by",
|
|
69507
69547
|
title: "SELECT add ORDER BY",
|
|
69508
69548
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
69509
|
-
extendedInformation: `
|
|
69510
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69511
|
-
|
|
69512
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
69513
|
-
|
|
69549
|
+
extendedInformation: `
|
|
69550
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69551
|
+
|
|
69552
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
69553
|
+
|
|
69514
69554
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
69515
69555
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69516
69556
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69641,14 +69681,14 @@ class SelectPerformance {
|
|
|
69641
69681
|
key: "select_performance",
|
|
69642
69682
|
title: "SELECT performance",
|
|
69643
69683
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69644
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69645
|
-
|
|
69684
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69685
|
+
|
|
69646
69686
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69647
69687
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69648
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69649
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69688
|
+
badExample: `SELECT field1, field2 FROM table
|
|
69689
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69650
69690
|
ENDSELECT.`,
|
|
69651
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69691
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69652
69692
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69653
69693
|
};
|
|
69654
69694
|
}
|
|
@@ -69762,8 +69802,8 @@ class SelectSingleFullKey {
|
|
|
69762
69802
|
key: "select_single_full_key",
|
|
69763
69803
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69764
69804
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69765
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69766
|
-
|
|
69805
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69806
|
+
|
|
69767
69807
|
If the statement contains a JOIN it is not checked`,
|
|
69768
69808
|
pseudoComment: "EC CI_NOORDER",
|
|
69769
69809
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -70187,8 +70227,8 @@ class SICFConsistency {
|
|
|
70187
70227
|
key: "sicf_consistency",
|
|
70188
70228
|
title: "SICF consistency",
|
|
70189
70229
|
shortDescription: `Checks the validity of ICF services`,
|
|
70190
|
-
extendedInformation: `* Class defined in handler must exist
|
|
70191
|
-
* Class must not have any syntax errors
|
|
70230
|
+
extendedInformation: `* Class defined in handler must exist
|
|
70231
|
+
* Class must not have any syntax errors
|
|
70192
70232
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
70193
70233
|
};
|
|
70194
70234
|
}
|
|
@@ -70300,23 +70340,23 @@ class SlowParameterPassing {
|
|
|
70300
70340
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
70301
70341
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
70302
70342
|
tags: [_irule_1.RuleTag.Performance],
|
|
70303
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70304
|
-
PUBLIC SECTION.
|
|
70305
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70306
|
-
ENDCLASS.
|
|
70307
|
-
CLASS lcl IMPLEMENTATION.
|
|
70308
|
-
METHOD bar.
|
|
70309
|
-
WRITE sdf.
|
|
70310
|
-
ENDMETHOD.
|
|
70343
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70344
|
+
PUBLIC SECTION.
|
|
70345
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70346
|
+
ENDCLASS.
|
|
70347
|
+
CLASS lcl IMPLEMENTATION.
|
|
70348
|
+
METHOD bar.
|
|
70349
|
+
WRITE sdf.
|
|
70350
|
+
ENDMETHOD.
|
|
70311
70351
|
ENDCLASS.`,
|
|
70312
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
70313
|
-
PUBLIC SECTION.
|
|
70314
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
70315
|
-
ENDCLASS.
|
|
70316
|
-
CLASS lcl IMPLEMENTATION.
|
|
70317
|
-
METHOD bar.
|
|
70318
|
-
WRITE sdf.
|
|
70319
|
-
ENDMETHOD.
|
|
70352
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
70353
|
+
PUBLIC SECTION.
|
|
70354
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
70355
|
+
ENDCLASS.
|
|
70356
|
+
CLASS lcl IMPLEMENTATION.
|
|
70357
|
+
METHOD bar.
|
|
70358
|
+
WRITE sdf.
|
|
70359
|
+
ENDMETHOD.
|
|
70320
70360
|
ENDCLASS.`,
|
|
70321
70361
|
};
|
|
70322
70362
|
}
|
|
@@ -70573,8 +70613,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
70573
70613
|
key: "space_before_dot",
|
|
70574
70614
|
title: "Space before dot",
|
|
70575
70615
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
70576
|
-
extendedInformation: `
|
|
70577
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70616
|
+
extendedInformation: `
|
|
70617
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70578
70618
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
70579
70619
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70580
70620
|
badExample: `WRITE bar .`,
|
|
@@ -70760,12 +70800,12 @@ class SQLValueConversion {
|
|
|
70760
70800
|
key: "sql_value_conversion",
|
|
70761
70801
|
title: "Implicit SQL Value Conversion",
|
|
70762
70802
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70763
|
-
extendedInformation: `
|
|
70764
|
-
* Integer to CHAR conversion
|
|
70765
|
-
* Integer to NUMC conversion
|
|
70766
|
-
* NUMC to Integer conversion
|
|
70767
|
-
* CHAR to Integer conversion
|
|
70768
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
70803
|
+
extendedInformation: `
|
|
70804
|
+
* Integer to CHAR conversion
|
|
70805
|
+
* Integer to NUMC conversion
|
|
70806
|
+
* NUMC to Integer conversion
|
|
70807
|
+
* CHAR to Integer conversion
|
|
70808
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
70769
70809
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70770
70810
|
tags: [],
|
|
70771
70811
|
};
|
|
@@ -70837,7 +70877,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70837
70877
|
key: "start_at_tab",
|
|
70838
70878
|
title: "Start at tab",
|
|
70839
70879
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70840
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70880
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70841
70881
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70842
70882
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70843
70883
|
badExample: ` WRITE a.`,
|
|
@@ -71014,12 +71054,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
71014
71054
|
key: "strict_sql",
|
|
71015
71055
|
title: "Strict SQL",
|
|
71016
71056
|
shortDescription: `Strict SQL`,
|
|
71017
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
71018
|
-
|
|
71019
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
71020
|
-
|
|
71021
|
-
Also see separate rule sql_escape_host_variables
|
|
71022
|
-
|
|
71057
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
71058
|
+
|
|
71059
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
71060
|
+
|
|
71061
|
+
Also see separate rule sql_escape_host_variables
|
|
71062
|
+
|
|
71023
71063
|
Activates from v750 and up`,
|
|
71024
71064
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
71025
71065
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -71273,11 +71313,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
71273
71313
|
key: "sy_modification",
|
|
71274
71314
|
title: "Modification of SY fields",
|
|
71275
71315
|
shortDescription: `Finds modification of sy fields`,
|
|
71276
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71277
|
-
|
|
71316
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71317
|
+
|
|
71278
71318
|
Changes to SY-TVAR* fields are not reported`,
|
|
71279
71319
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71280
|
-
badExample: `sy-uname = 2.
|
|
71320
|
+
badExample: `sy-uname = 2.
|
|
71281
71321
|
sy = sy.`,
|
|
71282
71322
|
};
|
|
71283
71323
|
}
|
|
@@ -71339,8 +71379,8 @@ class TABLEnhancementCategory {
|
|
|
71339
71379
|
key: "tabl_enhancement_category",
|
|
71340
71380
|
title: "TABL enhancement category must be set",
|
|
71341
71381
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
71342
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71343
|
-
|
|
71382
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71383
|
+
|
|
71344
71384
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
71345
71385
|
tags: [],
|
|
71346
71386
|
};
|
|
@@ -71405,8 +71445,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
71405
71445
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
71406
71446
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
71407
71447
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71408
|
-
badExample: `FORM foo.
|
|
71409
|
-
TABLES t100.
|
|
71448
|
+
badExample: `FORM foo.
|
|
71449
|
+
TABLES t100.
|
|
71410
71450
|
ENDFORM.`,
|
|
71411
71451
|
goodExample: `TABLES t000.`,
|
|
71412
71452
|
};
|
|
@@ -71534,9 +71574,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
71534
71574
|
title: "Type FORM parameters",
|
|
71535
71575
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
71536
71576
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71537
|
-
badExample: `FORM foo USING bar.
|
|
71577
|
+
badExample: `FORM foo USING bar.
|
|
71538
71578
|
ENDFORM.`,
|
|
71539
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
71579
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
71540
71580
|
ENDFORM.`,
|
|
71541
71581
|
};
|
|
71542
71582
|
}
|
|
@@ -72209,38 +72249,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
72209
72249
|
key: "unnecessary_pragma",
|
|
72210
72250
|
title: "Unnecessary Pragma",
|
|
72211
72251
|
shortDescription: `Finds pragmas which can be removed`,
|
|
72212
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
72213
|
-
|
|
72214
|
-
* NEEDED without definition
|
|
72215
|
-
|
|
72216
|
-
* NO_TEXT without texts
|
|
72217
|
-
|
|
72218
|
-
* SUBRC_OK where sy-subrc is checked
|
|
72219
|
-
|
|
72252
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
72253
|
+
|
|
72254
|
+
* NEEDED without definition
|
|
72255
|
+
|
|
72256
|
+
* NO_TEXT without texts
|
|
72257
|
+
|
|
72258
|
+
* SUBRC_OK where sy-subrc is checked
|
|
72259
|
+
|
|
72220
72260
|
NO_HANDLER inside macros are not checked`,
|
|
72221
72261
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72222
|
-
badExample: `TRY.
|
|
72223
|
-
...
|
|
72224
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
72225
|
-
RETURN. " it has a handler
|
|
72226
|
-
ENDTRY.
|
|
72227
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
72228
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
72229
|
-
IF sy-subrc <> 0.
|
|
72262
|
+
badExample: `TRY.
|
|
72263
|
+
...
|
|
72264
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
72265
|
+
RETURN. " it has a handler
|
|
72266
|
+
ENDTRY.
|
|
72267
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
72268
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
72269
|
+
IF sy-subrc <> 0.
|
|
72230
72270
|
ENDIF.`,
|
|
72231
|
-
goodExample: `TRY.
|
|
72232
|
-
...
|
|
72233
|
-
CATCH zcx_abapgit_exception.
|
|
72234
|
-
RETURN.
|
|
72235
|
-
ENDTRY.
|
|
72236
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
72237
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
72238
|
-
IF sy-subrc <> 0.
|
|
72239
|
-
ENDIF.
|
|
72240
|
-
|
|
72241
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
72242
|
-
test1 TYPE string,
|
|
72243
|
-
test2 TYPE string,
|
|
72271
|
+
goodExample: `TRY.
|
|
72272
|
+
...
|
|
72273
|
+
CATCH zcx_abapgit_exception.
|
|
72274
|
+
RETURN.
|
|
72275
|
+
ENDTRY.
|
|
72276
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
72277
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
72278
|
+
IF sy-subrc <> 0.
|
|
72279
|
+
ENDIF.
|
|
72280
|
+
|
|
72281
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
72282
|
+
test1 TYPE string,
|
|
72283
|
+
test2 TYPE string,
|
|
72244
72284
|
END OF blah.`,
|
|
72245
72285
|
};
|
|
72246
72286
|
}
|
|
@@ -72407,18 +72447,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
72407
72447
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
72408
72448
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
72409
72449
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
72410
|
-
badExample: `FORM hello1.
|
|
72411
|
-
WRITE 'world'.
|
|
72412
|
-
RETURN.
|
|
72413
|
-
ENDFORM.
|
|
72414
|
-
|
|
72415
|
-
FORM foo.
|
|
72416
|
-
IF 1 = 2.
|
|
72417
|
-
RETURN.
|
|
72418
|
-
ENDIF.
|
|
72450
|
+
badExample: `FORM hello1.
|
|
72451
|
+
WRITE 'world'.
|
|
72452
|
+
RETURN.
|
|
72453
|
+
ENDFORM.
|
|
72454
|
+
|
|
72455
|
+
FORM foo.
|
|
72456
|
+
IF 1 = 2.
|
|
72457
|
+
RETURN.
|
|
72458
|
+
ENDIF.
|
|
72419
72459
|
ENDFORM.`,
|
|
72420
|
-
goodExample: `FORM hello2.
|
|
72421
|
-
WRITE 'world'.
|
|
72460
|
+
goodExample: `FORM hello2.
|
|
72461
|
+
WRITE 'world'.
|
|
72422
72462
|
ENDFORM.`,
|
|
72423
72463
|
};
|
|
72424
72464
|
}
|
|
@@ -72769,13 +72809,13 @@ class UnusedMacros {
|
|
|
72769
72809
|
title: "Unused macros",
|
|
72770
72810
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
72771
72811
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72772
|
-
badExample: `DEFINE foobar1.
|
|
72773
|
-
WRITE 'hello'.
|
|
72812
|
+
badExample: `DEFINE foobar1.
|
|
72813
|
+
WRITE 'hello'.
|
|
72774
72814
|
END-OF-DEFINITION.`,
|
|
72775
|
-
goodExample: `DEFINE foobar2.
|
|
72776
|
-
WRITE 'hello'.
|
|
72777
|
-
END-OF-DEFINITION.
|
|
72778
|
-
|
|
72815
|
+
goodExample: `DEFINE foobar2.
|
|
72816
|
+
WRITE 'hello'.
|
|
72817
|
+
END-OF-DEFINITION.
|
|
72818
|
+
|
|
72779
72819
|
foobar2.`,
|
|
72780
72820
|
};
|
|
72781
72821
|
}
|
|
@@ -72830,6 +72870,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
72830
72870
|
exports.UnusedMethods = exports.UnusedMethodsConf = void 0;
|
|
72831
72871
|
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
72832
72872
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
72873
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
72833
72874
|
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
|
|
72834
72875
|
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
72835
72876
|
const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
|
|
@@ -72838,6 +72879,8 @@ const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./n
|
|
|
72838
72879
|
const visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
|
|
72839
72880
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
72840
72881
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
72882
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
72883
|
+
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
72841
72884
|
class UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
72842
72885
|
}
|
|
72843
72886
|
exports.UnusedMethodsConf = UnusedMethodsConf;
|
|
@@ -72850,6 +72893,7 @@ class WorkArea {
|
|
|
72850
72893
|
this.list.push(id);
|
|
72851
72894
|
}
|
|
72852
72895
|
removeIfExists(id) {
|
|
72896
|
+
// todo: optimize
|
|
72853
72897
|
for (let i = 0; i < this.list.length; i++) {
|
|
72854
72898
|
if (id.equals(this.list[i].identifier)) {
|
|
72855
72899
|
this.list.splice(i, 1);
|
|
@@ -72883,19 +72927,20 @@ class UnusedMethods {
|
|
|
72883
72927
|
key: "unused_methods",
|
|
72884
72928
|
title: "Unused methods",
|
|
72885
72929
|
shortDescription: `Checks for unused methods`,
|
|
72886
|
-
extendedInformation: `Checks private and protected methods.
|
|
72887
|
-
|
|
72888
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72889
|
-
|
|
72890
|
-
|
|
72891
|
-
|
|
72892
|
-
* methods
|
|
72893
|
-
*
|
|
72894
|
-
*
|
|
72895
|
-
*
|
|
72896
|
-
*
|
|
72930
|
+
extendedInformation: `Checks private and protected methods.
|
|
72931
|
+
|
|
72932
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72933
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
72934
|
+
|
|
72935
|
+
Skips:
|
|
72936
|
+
* methods FOR TESTING
|
|
72937
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72938
|
+
* class_constructor + constructor methods
|
|
72939
|
+
* event handlers
|
|
72940
|
+
* methods that are redefined
|
|
72941
|
+
* INCLUDEs
|
|
72897
72942
|
`,
|
|
72898
|
-
tags: [],
|
|
72943
|
+
tags: [_irule_1.RuleTag.Quickfix],
|
|
72899
72944
|
pragma: "##CALLED",
|
|
72900
72945
|
pseudoComment: "EC CALLED",
|
|
72901
72946
|
};
|
|
@@ -72977,11 +73022,53 @@ Skips:
|
|
|
72977
73022
|
else if (this.suppressedbyPseudo(statement, file)) {
|
|
72978
73023
|
continue;
|
|
72979
73024
|
}
|
|
73025
|
+
let fix = undefined;
|
|
73026
|
+
if (i.visibility === visibility_1.Visibility.Private
|
|
73027
|
+
|| i.isFinal === true
|
|
73028
|
+
|| (i.visibility === visibility_1.Visibility.Protected && this.hasSubClass(obj) === false)) {
|
|
73029
|
+
const implementation = this.findMethodImplementation(i, file);
|
|
73030
|
+
if (implementation !== undefined) {
|
|
73031
|
+
const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);
|
|
73032
|
+
const fix2 = edit_helper_1.EditHelper.deleteRange(file, implementation.getFirstToken().getStart(), implementation.getLastToken().getEnd());
|
|
73033
|
+
fix = edit_helper_1.EditHelper.merge(fix1, fix2);
|
|
73034
|
+
}
|
|
73035
|
+
}
|
|
72980
73036
|
const message = "Method \"" + i.identifier.getName() + "\" not used";
|
|
72981
|
-
issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));
|
|
73037
|
+
issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity, fix));
|
|
72982
73038
|
}
|
|
72983
73039
|
return issues;
|
|
72984
73040
|
}
|
|
73041
|
+
hasSubClass(obj) {
|
|
73042
|
+
var _a, _b, _c;
|
|
73043
|
+
if (!(obj instanceof objects_1.Class)) {
|
|
73044
|
+
return false;
|
|
73045
|
+
}
|
|
73046
|
+
if (((_a = obj.getDefinition()) === null || _a === void 0 ? void 0 : _a.isFinal()) === true) {
|
|
73047
|
+
return false;
|
|
73048
|
+
}
|
|
73049
|
+
for (const r of this.reg.getObjects()) {
|
|
73050
|
+
if (r instanceof objects_1.Class
|
|
73051
|
+
&& ((_c = (_b = r.getDefinition()) === null || _b === void 0 ? void 0 : _b.getSuperClass()) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === obj.getName().toUpperCase()) {
|
|
73052
|
+
return true;
|
|
73053
|
+
}
|
|
73054
|
+
}
|
|
73055
|
+
return false;
|
|
73056
|
+
}
|
|
73057
|
+
findMethodImplementation(method, file) {
|
|
73058
|
+
var _a, _b;
|
|
73059
|
+
for (const classImplementation of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStructures(Structures.ClassImplementation)) || []) {
|
|
73060
|
+
// todo, this will break if there are class implemtations with the same method names
|
|
73061
|
+
// const className = classImplementation.findFirstExpression(Expressions.ClassName)?.concatTokens().toUpperCase();
|
|
73062
|
+
for (const methodImplementation of classImplementation.findAllStructures(Structures.Method)) {
|
|
73063
|
+
const methodName = ((_b = methodImplementation.findFirstExpression(Expressions.MethodName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) || "";
|
|
73064
|
+
if (methodName !== method.name.toUpperCase()) {
|
|
73065
|
+
continue;
|
|
73066
|
+
}
|
|
73067
|
+
return methodImplementation;
|
|
73068
|
+
}
|
|
73069
|
+
}
|
|
73070
|
+
return undefined;
|
|
73071
|
+
}
|
|
72985
73072
|
suppressedbyPseudo(statement, file) {
|
|
72986
73073
|
if (statement === undefined) {
|
|
72987
73074
|
return false;
|
|
@@ -73327,23 +73414,23 @@ class UnusedVariables {
|
|
|
73327
73414
|
key: "unused_variables",
|
|
73328
73415
|
title: "Unused variables",
|
|
73329
73416
|
shortDescription: `Checks for unused variables and constants`,
|
|
73330
|
-
extendedInformation: `Skips event parameters.
|
|
73331
|
-
|
|
73332
|
-
Note that this currently does not work if the source code uses macros.
|
|
73333
|
-
|
|
73334
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73335
|
-
|
|
73417
|
+
extendedInformation: `Skips event parameters.
|
|
73418
|
+
|
|
73419
|
+
Note that this currently does not work if the source code uses macros.
|
|
73420
|
+
|
|
73421
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73422
|
+
|
|
73336
73423
|
Errors found in INCLUDES are reported for the main program.`,
|
|
73337
73424
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73338
73425
|
pragma: "##NEEDED",
|
|
73339
73426
|
pseudoComment: "EC NEEDED",
|
|
73340
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
73341
|
-
test TYPE string,
|
|
73342
|
-
test2 TYPE string,
|
|
73427
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
73428
|
+
test TYPE string,
|
|
73429
|
+
test2 TYPE string,
|
|
73343
73430
|
END OF blah1.`,
|
|
73344
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73345
|
-
test TYPE string,
|
|
73346
|
-
test2 TYPE string,
|
|
73431
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73432
|
+
test TYPE string,
|
|
73433
|
+
test2 TYPE string,
|
|
73347
73434
|
END OF blah2.`,
|
|
73348
73435
|
};
|
|
73349
73436
|
}
|
|
@@ -73562,15 +73649,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
73562
73649
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
73563
73650
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
73564
73651
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
73565
|
-
badExample: `IF line IS INITIAL.
|
|
73566
|
-
has_entries = abap_false.
|
|
73567
|
-
ELSE.
|
|
73568
|
-
has_entries = abap_true.
|
|
73569
|
-
ENDIF.
|
|
73570
|
-
|
|
73652
|
+
badExample: `IF line IS INITIAL.
|
|
73653
|
+
has_entries = abap_false.
|
|
73654
|
+
ELSE.
|
|
73655
|
+
has_entries = abap_true.
|
|
73656
|
+
ENDIF.
|
|
73657
|
+
|
|
73571
73658
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
73572
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73573
|
-
|
|
73659
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73660
|
+
|
|
73574
73661
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
73575
73662
|
};
|
|
73576
73663
|
}
|
|
@@ -73688,15 +73775,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
73688
73775
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
73689
73776
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
73690
73777
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73691
|
-
badExample: `INTERFACE lif.
|
|
73692
|
-
METHODS load_data
|
|
73693
|
-
EXCEPTIONS
|
|
73694
|
-
invalid_parameter.
|
|
73778
|
+
badExample: `INTERFACE lif.
|
|
73779
|
+
METHODS load_data
|
|
73780
|
+
EXCEPTIONS
|
|
73781
|
+
invalid_parameter.
|
|
73695
73782
|
ENDINTERFACE.`,
|
|
73696
|
-
goodExample: `INTERFACE lif.
|
|
73697
|
-
METHODS load_data
|
|
73698
|
-
RAISING
|
|
73699
|
-
cx_something.
|
|
73783
|
+
goodExample: `INTERFACE lif.
|
|
73784
|
+
METHODS load_data
|
|
73785
|
+
RAISING
|
|
73786
|
+
cx_something.
|
|
73700
73787
|
ENDINTERFACE.`,
|
|
73701
73788
|
};
|
|
73702
73789
|
}
|
|
@@ -73756,15 +73843,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
73756
73843
|
key: "use_line_exists",
|
|
73757
73844
|
title: "Use line_exists",
|
|
73758
73845
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73759
|
-
extendedInformation: `
|
|
73760
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73761
|
-
|
|
73846
|
+
extendedInformation: `
|
|
73847
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73848
|
+
|
|
73762
73849
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73763
73850
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73764
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73765
|
-
IF sy-subrc = 0.
|
|
73851
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73852
|
+
IF sy-subrc = 0.
|
|
73766
73853
|
ENDIF.`,
|
|
73767
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73854
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73768
73855
|
ENDIF.`,
|
|
73769
73856
|
};
|
|
73770
73857
|
}
|
|
@@ -73874,10 +73961,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73874
73961
|
key: "use_new",
|
|
73875
73962
|
title: "Use NEW",
|
|
73876
73963
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73877
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73878
|
-
|
|
73879
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73880
|
-
|
|
73964
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73965
|
+
|
|
73966
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73967
|
+
|
|
73881
73968
|
Applicable from v740sp02 and up`,
|
|
73882
73969
|
badExample: `CREATE OBJECT ref.`,
|
|
73883
73970
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73975,13 +74062,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73975
74062
|
title: "WHEN OTHERS last",
|
|
73976
74063
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73977
74064
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73978
|
-
badExample: `CASE bar.
|
|
73979
|
-
WHEN OTHERS.
|
|
73980
|
-
WHEN 2.
|
|
74065
|
+
badExample: `CASE bar.
|
|
74066
|
+
WHEN OTHERS.
|
|
74067
|
+
WHEN 2.
|
|
73981
74068
|
ENDCASE.`,
|
|
73982
|
-
goodExample: `CASE bar.
|
|
73983
|
-
WHEN 2.
|
|
73984
|
-
WHEN OTHERS.
|
|
74069
|
+
goodExample: `CASE bar.
|
|
74070
|
+
WHEN 2.
|
|
74071
|
+
WHEN OTHERS.
|
|
73985
74072
|
ENDCASE.`,
|
|
73986
74073
|
};
|
|
73987
74074
|
}
|
|
@@ -81063,7 +81150,7 @@ class DeleteDatabaseTranspiler {
|
|
|
81063
81150
|
transpile(node, traversal) {
|
|
81064
81151
|
const dbtab = node.findFirstExpression(abaplint.Expressions.DatabaseTable);
|
|
81065
81152
|
if (dbtab === undefined) {
|
|
81066
|
-
throw new Error("internal error,
|
|
81153
|
+
throw new Error("internal error, DeleteDatabaseTranspiler");
|
|
81067
81154
|
}
|
|
81068
81155
|
const table = new expressions_1.DatabaseTableTranspiler(false).transpile(dbtab, traversal);
|
|
81069
81156
|
const options = [];
|
|
@@ -101140,7 +101227,7 @@ async function run() {
|
|
|
101140
101227
|
if (!fs.existsSync(outputFolder)) {
|
|
101141
101228
|
fs.mkdirSync(outputFolder);
|
|
101142
101229
|
}
|
|
101143
|
-
writeObjects(output.objects, config.write_source_map, outputFolder, files);
|
|
101230
|
+
writeObjects(output.objects, config.write_source_map || false, outputFolder, files);
|
|
101144
101231
|
console.log(output.objects.length + " objects written to disk");
|
|
101145
101232
|
if (config.write_unit_tests === true) {
|
|
101146
101233
|
// breaking change? rename this output file,
|