@abaplint/cli 2.113.18 → 2.113.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/abaplint +2 -2
- package/build/cli.js +846 -845
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -33403,7 +33403,7 @@ class Tables {
|
|
|
33403
33403
|
}
|
|
33404
33404
|
let name = nameToken.getStr();
|
|
33405
33405
|
if (name.startsWith("*")) {
|
|
33406
|
-
name = name.
|
|
33406
|
+
name = name.substring(1);
|
|
33407
33407
|
}
|
|
33408
33408
|
// lookupTableOrView will also give Unknown and Void
|
|
33409
33409
|
const found = (_b = input.scope.getDDIC()) === null || _b === void 0 ? void 0 : _b.lookupTableOrView(name);
|
|
@@ -33411,10 +33411,10 @@ class Tables {
|
|
|
33411
33411
|
input.scope.getDDICReferences().addUsing(input.scope.getParentObj(), { object: found.object, filename: input.filename, token: nameToken });
|
|
33412
33412
|
if (input.scope.getType() === _scope_type_1.ScopeType.Form || input.scope.getType() === _scope_type_1.ScopeType.FunctionModule) {
|
|
33413
33413
|
// hoist TABLES definitions to global scope
|
|
33414
|
-
input.scope.addNamedIdentifierToParent(nameToken.getStr(), new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, found.type));
|
|
33414
|
+
input.scope.addNamedIdentifierToParent(nameToken.getStr(), new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, found.type, ["tables" /* IdentifierMeta.Tables */]));
|
|
33415
33415
|
}
|
|
33416
33416
|
else {
|
|
33417
|
-
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, found.type));
|
|
33417
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, found.type, ["tables" /* IdentifierMeta.Tables */]));
|
|
33418
33418
|
}
|
|
33419
33419
|
return;
|
|
33420
33420
|
}
|
|
@@ -35173,13 +35173,13 @@ class FlowGraph {
|
|
|
35173
35173
|
this.label = label;
|
|
35174
35174
|
}
|
|
35175
35175
|
toDigraph() {
|
|
35176
|
-
return `digraph G {
|
|
35177
|
-
labelloc="t";
|
|
35178
|
-
label="${this.label}";
|
|
35179
|
-
graph [fontname = "helvetica"];
|
|
35180
|
-
node [fontname = "helvetica", shape="box"];
|
|
35181
|
-
edge [fontname = "helvetica"];
|
|
35182
|
-
${this.toTextEdges()}
|
|
35176
|
+
return `digraph G {
|
|
35177
|
+
labelloc="t";
|
|
35178
|
+
label="${this.label}";
|
|
35179
|
+
graph [fontname = "helvetica"];
|
|
35180
|
+
node [fontname = "helvetica", shape="box"];
|
|
35181
|
+
edge [fontname = "helvetica"];
|
|
35182
|
+
${this.toTextEdges()}
|
|
35183
35183
|
}`;
|
|
35184
35184
|
}
|
|
35185
35185
|
listSources(node) {
|
|
@@ -35335,7 +35335,7 @@ class StatementFlow {
|
|
|
35335
35335
|
throw new Error("StatementFlow, unknown structure");
|
|
35336
35336
|
}
|
|
35337
35337
|
}
|
|
35338
|
-
if (obj instanceof objects_1.Program) {
|
|
35338
|
+
if (obj instanceof objects_1.Program || obj instanceof objects_1.FunctionGroup) {
|
|
35339
35339
|
// find the top level events
|
|
35340
35340
|
let inEvent = false;
|
|
35341
35341
|
let collected = [];
|
|
@@ -43429,13 +43429,13 @@ class Help {
|
|
|
43429
43429
|
/////////////////////////////////////////////////
|
|
43430
43430
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43431
43431
|
let content = "";
|
|
43432
|
-
content = `
|
|
43433
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43434
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43435
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43436
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43437
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43438
|
-
<hr>
|
|
43432
|
+
content = `
|
|
43433
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43434
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43435
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43436
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43437
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43438
|
+
<hr>
|
|
43439
43439
|
` +
|
|
43440
43440
|
"<tt>" + textDocument.uri + " (" +
|
|
43441
43441
|
(position.line + 1) + ", " +
|
|
@@ -43930,7 +43930,8 @@ class InlayHints {
|
|
|
43930
43930
|
findImplicitReferences(node) {
|
|
43931
43931
|
const ret = [];
|
|
43932
43932
|
for (const r of node.getData().references) {
|
|
43933
|
-
if (r.referenceType === _reference_1.ReferenceType.InferredType
|
|
43933
|
+
if (r.referenceType === _reference_1.ReferenceType.InferredType ||
|
|
43934
|
+
r.referenceType === _reference_1.ReferenceType.DataWriteReference) {
|
|
43934
43935
|
ret.push(r);
|
|
43935
43936
|
}
|
|
43936
43937
|
}
|
|
@@ -52755,7 +52756,7 @@ class Registry {
|
|
|
52755
52756
|
}
|
|
52756
52757
|
static abaplintVersion() {
|
|
52757
52758
|
// magic, see build script "version.sh"
|
|
52758
|
-
return "2.113.
|
|
52759
|
+
return "2.113.20";
|
|
52759
52760
|
}
|
|
52760
52761
|
getDDICReferences() {
|
|
52761
52762
|
return this.ddicReferences;
|
|
@@ -53074,10 +53075,10 @@ class SevenBitAscii {
|
|
|
53074
53075
|
key: "7bit_ascii",
|
|
53075
53076
|
title: "Check for 7bit ascii",
|
|
53076
53077
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53077
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53078
|
-
|
|
53079
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53080
|
-
|
|
53078
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53079
|
+
|
|
53080
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53081
|
+
|
|
53081
53082
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53082
53083
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53083
53084
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53283,10 +53284,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53283
53284
|
key: "abapdoc",
|
|
53284
53285
|
title: "Check abapdoc",
|
|
53285
53286
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53286
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53287
|
-
|
|
53288
|
-
Plus class and interface definitions.
|
|
53289
|
-
|
|
53287
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53288
|
+
|
|
53289
|
+
Plus class and interface definitions.
|
|
53290
|
+
|
|
53290
53291
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53291
53292
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53292
53293
|
};
|
|
@@ -53423,27 +53424,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53423
53424
|
title: "Add test attributes for tests classes with test methods",
|
|
53424
53425
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53425
53426
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53426
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53427
|
-
PUBLIC SECTION.
|
|
53428
|
-
PROTECTED SECTION.
|
|
53429
|
-
PRIVATE SECTION.
|
|
53430
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53431
|
-
ENDCLASS.
|
|
53432
|
-
|
|
53433
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53434
|
-
METHOD test.
|
|
53435
|
-
ENDMETHOD.
|
|
53427
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53428
|
+
PUBLIC SECTION.
|
|
53429
|
+
PROTECTED SECTION.
|
|
53430
|
+
PRIVATE SECTION.
|
|
53431
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53432
|
+
ENDCLASS.
|
|
53433
|
+
|
|
53434
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53435
|
+
METHOD test.
|
|
53436
|
+
ENDMETHOD.
|
|
53436
53437
|
ENDCLASS.`,
|
|
53437
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53438
|
-
PUBLIC SECTION.
|
|
53439
|
-
PROTECTED SECTION.
|
|
53440
|
-
PRIVATE SECTION.
|
|
53441
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53442
|
-
ENDCLASS.
|
|
53443
|
-
|
|
53444
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53445
|
-
METHOD test.
|
|
53446
|
-
ENDMETHOD.
|
|
53438
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53439
|
+
PUBLIC SECTION.
|
|
53440
|
+
PROTECTED SECTION.
|
|
53441
|
+
PRIVATE SECTION.
|
|
53442
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53443
|
+
ENDCLASS.
|
|
53444
|
+
|
|
53445
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53446
|
+
METHOD test.
|
|
53447
|
+
ENDMETHOD.
|
|
53447
53448
|
ENDCLASS.`,
|
|
53448
53449
|
};
|
|
53449
53450
|
}
|
|
@@ -53529,49 +53530,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53529
53530
|
key: "align_parameters",
|
|
53530
53531
|
title: "Align Parameters",
|
|
53531
53532
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53532
|
-
extendedInformation: `Checks:
|
|
53533
|
-
* function module calls
|
|
53534
|
-
* method calls
|
|
53535
|
-
* VALUE constructors
|
|
53536
|
-
* NEW constructors
|
|
53537
|
-
* RAISE EXCEPTION statements
|
|
53538
|
-
* CREATE OBJECT statements
|
|
53539
|
-
* RAISE EVENT statements
|
|
53540
|
-
|
|
53541
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53542
|
-
|
|
53543
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53544
|
-
|
|
53545
|
-
If parameters are on the same row, no issues are reported, see
|
|
53533
|
+
extendedInformation: `Checks:
|
|
53534
|
+
* function module calls
|
|
53535
|
+
* method calls
|
|
53536
|
+
* VALUE constructors
|
|
53537
|
+
* NEW constructors
|
|
53538
|
+
* RAISE EXCEPTION statements
|
|
53539
|
+
* CREATE OBJECT statements
|
|
53540
|
+
* RAISE EVENT statements
|
|
53541
|
+
|
|
53542
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53543
|
+
|
|
53544
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53545
|
+
|
|
53546
|
+
If parameters are on the same row, no issues are reported, see
|
|
53546
53547
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53547
53548
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53548
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53549
|
-
EXPORTING
|
|
53550
|
-
foo = 2
|
|
53551
|
-
parameter = 3.
|
|
53552
|
-
|
|
53553
|
-
foobar( moo = 1
|
|
53554
|
-
param = 1 ).
|
|
53555
|
-
|
|
53556
|
-
foo = VALUE #(
|
|
53557
|
-
foo = bar
|
|
53549
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53550
|
+
EXPORTING
|
|
53551
|
+
foo = 2
|
|
53552
|
+
parameter = 3.
|
|
53553
|
+
|
|
53554
|
+
foobar( moo = 1
|
|
53555
|
+
param = 1 ).
|
|
53556
|
+
|
|
53557
|
+
foo = VALUE #(
|
|
53558
|
+
foo = bar
|
|
53558
53559
|
moo = 2 ).`,
|
|
53559
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53560
|
-
EXPORTING
|
|
53561
|
-
foo = 2
|
|
53562
|
-
parameter = 3.
|
|
53563
|
-
|
|
53564
|
-
foobar( moo = 1
|
|
53565
|
-
param = 1 ).
|
|
53566
|
-
|
|
53567
|
-
foo = VALUE #(
|
|
53568
|
-
foo = bar
|
|
53569
|
-
moo = 2 ).
|
|
53570
|
-
|
|
53571
|
-
DATA(sdf) = VALUE type(
|
|
53572
|
-
common_val = 2
|
|
53573
|
-
another_common = 5
|
|
53574
|
-
( row_value = 4
|
|
53560
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53561
|
+
EXPORTING
|
|
53562
|
+
foo = 2
|
|
53563
|
+
parameter = 3.
|
|
53564
|
+
|
|
53565
|
+
foobar( moo = 1
|
|
53566
|
+
param = 1 ).
|
|
53567
|
+
|
|
53568
|
+
foo = VALUE #(
|
|
53569
|
+
foo = bar
|
|
53570
|
+
moo = 2 ).
|
|
53571
|
+
|
|
53572
|
+
DATA(sdf) = VALUE type(
|
|
53573
|
+
common_val = 2
|
|
53574
|
+
another_common = 5
|
|
53575
|
+
( row_value = 4
|
|
53575
53576
|
value_foo = 5 ) ).`,
|
|
53576
53577
|
};
|
|
53577
53578
|
}
|
|
@@ -54005,37 +54006,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54005
54006
|
key: "align_type_expressions",
|
|
54006
54007
|
title: "Align TYPE expressions",
|
|
54007
54008
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54008
|
-
extendedInformation: `
|
|
54009
|
-
Currently works for METHODS + BEGIN OF
|
|
54010
|
-
|
|
54011
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54012
|
-
|
|
54013
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54009
|
+
extendedInformation: `
|
|
54010
|
+
Currently works for METHODS + BEGIN OF
|
|
54011
|
+
|
|
54012
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54013
|
+
|
|
54014
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54014
54015
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54015
54016
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54016
|
-
badExample: `
|
|
54017
|
-
TYPES: BEGIN OF foo,
|
|
54018
|
-
bar TYPE i,
|
|
54019
|
-
foobar TYPE i,
|
|
54020
|
-
END OF foo.
|
|
54021
|
-
|
|
54022
|
-
INTERFACE lif.
|
|
54023
|
-
METHODS bar
|
|
54024
|
-
IMPORTING
|
|
54025
|
-
foo TYPE i
|
|
54026
|
-
foobar TYPE i.
|
|
54017
|
+
badExample: `
|
|
54018
|
+
TYPES: BEGIN OF foo,
|
|
54019
|
+
bar TYPE i,
|
|
54020
|
+
foobar TYPE i,
|
|
54021
|
+
END OF foo.
|
|
54022
|
+
|
|
54023
|
+
INTERFACE lif.
|
|
54024
|
+
METHODS bar
|
|
54025
|
+
IMPORTING
|
|
54026
|
+
foo TYPE i
|
|
54027
|
+
foobar TYPE i.
|
|
54027
54028
|
ENDINTERFACE.`,
|
|
54028
|
-
goodExample: `
|
|
54029
|
-
TYPES: BEGIN OF foo,
|
|
54030
|
-
bar TYPE i,
|
|
54031
|
-
foobar TYPE i,
|
|
54032
|
-
END OF foo.
|
|
54033
|
-
|
|
54034
|
-
INTERFACE lif.
|
|
54035
|
-
METHODS bar
|
|
54036
|
-
IMPORTING
|
|
54037
|
-
foo TYPE i
|
|
54038
|
-
foobar TYPE i.
|
|
54029
|
+
goodExample: `
|
|
54030
|
+
TYPES: BEGIN OF foo,
|
|
54031
|
+
bar TYPE i,
|
|
54032
|
+
foobar TYPE i,
|
|
54033
|
+
END OF foo.
|
|
54034
|
+
|
|
54035
|
+
INTERFACE lif.
|
|
54036
|
+
METHODS bar
|
|
54037
|
+
IMPORTING
|
|
54038
|
+
foo TYPE i
|
|
54039
|
+
foobar TYPE i.
|
|
54039
54040
|
ENDINTERFACE.`,
|
|
54040
54041
|
};
|
|
54041
54042
|
}
|
|
@@ -54314,16 +54315,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54314
54315
|
return {
|
|
54315
54316
|
key: "ambiguous_statement",
|
|
54316
54317
|
title: "Check for ambigious statements",
|
|
54317
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54318
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54319
|
-
|
|
54318
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54319
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54320
|
+
|
|
54320
54321
|
Only works if the target version is 740sp05 or above`,
|
|
54321
54322
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54322
|
-
badExample: `DELETE foo FROM bar.
|
|
54323
|
+
badExample: `DELETE foo FROM bar.
|
|
54323
54324
|
MODIFY foo FROM bar.`,
|
|
54324
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54325
|
-
DELETE TABLE itab FROM 2.
|
|
54326
|
-
MODIFY zfoo FROM @wa.
|
|
54325
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54326
|
+
DELETE TABLE itab FROM 2.
|
|
54327
|
+
MODIFY zfoo FROM @wa.
|
|
54327
54328
|
MODIFY TABLE foo FROM bar.`,
|
|
54328
54329
|
};
|
|
54329
54330
|
}
|
|
@@ -54428,16 +54429,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54428
54429
|
key: "avoid_use",
|
|
54429
54430
|
title: "Avoid use of certain statements",
|
|
54430
54431
|
shortDescription: `Detects usage of certain statements.`,
|
|
54431
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54432
|
-
|
|
54433
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54434
|
-
|
|
54435
|
-
STATICS: use CLASS-DATA instead
|
|
54436
|
-
|
|
54437
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54438
|
-
|
|
54439
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54440
|
-
|
|
54432
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54433
|
+
|
|
54434
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54435
|
+
|
|
54436
|
+
STATICS: use CLASS-DATA instead
|
|
54437
|
+
|
|
54438
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54439
|
+
|
|
54440
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54441
|
+
|
|
54441
54442
|
BREAK points`,
|
|
54442
54443
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54443
54444
|
};
|
|
@@ -54569,11 +54570,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54569
54570
|
title: "Check BEGIN END names",
|
|
54570
54571
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54571
54572
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54572
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54573
|
-
field TYPE i,
|
|
54573
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54574
|
+
field TYPE i,
|
|
54574
54575
|
END OF structure_not_the_same.`,
|
|
54575
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54576
|
-
field TYPE i,
|
|
54576
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54577
|
+
field TYPE i,
|
|
54577
54578
|
END OF stru.`,
|
|
54578
54579
|
};
|
|
54579
54580
|
}
|
|
@@ -54670,20 +54671,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54670
54671
|
title: "BEGIN contains single INCLUDE",
|
|
54671
54672
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54672
54673
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54673
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54674
|
-
INCLUDE TYPE dselc.
|
|
54675
|
-
TYPES: END OF dummy1.
|
|
54676
|
-
|
|
54677
|
-
DATA BEGIN OF foo.
|
|
54678
|
-
INCLUDE STRUCTURE syst.
|
|
54679
|
-
DATA END OF foo.
|
|
54680
|
-
|
|
54681
|
-
STATICS BEGIN OF bar.
|
|
54682
|
-
INCLUDE STRUCTURE syst.
|
|
54674
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54675
|
+
INCLUDE TYPE dselc.
|
|
54676
|
+
TYPES: END OF dummy1.
|
|
54677
|
+
|
|
54678
|
+
DATA BEGIN OF foo.
|
|
54679
|
+
INCLUDE STRUCTURE syst.
|
|
54680
|
+
DATA END OF foo.
|
|
54681
|
+
|
|
54682
|
+
STATICS BEGIN OF bar.
|
|
54683
|
+
INCLUDE STRUCTURE syst.
|
|
54683
54684
|
STATICS END OF bar.`,
|
|
54684
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54685
|
-
DATA field TYPE i.
|
|
54686
|
-
INCLUDE STRUCTURE dselc.
|
|
54685
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54686
|
+
DATA field TYPE i.
|
|
54687
|
+
INCLUDE STRUCTURE dselc.
|
|
54687
54688
|
DATA END OF foo.`,
|
|
54688
54689
|
};
|
|
54689
54690
|
}
|
|
@@ -54773,9 +54774,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54773
54774
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54774
54775
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54775
54776
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54776
|
-
goodExample: `TRY.
|
|
54777
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54778
|
-
CATCH cx_sy_authorization_error.
|
|
54777
|
+
goodExample: `TRY.
|
|
54778
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54779
|
+
CATCH cx_sy_authorization_error.
|
|
54779
54780
|
ENDTRY.`,
|
|
54780
54781
|
};
|
|
54781
54782
|
}
|
|
@@ -54840,10 +54841,10 @@ class CDSCommentStyle {
|
|
|
54840
54841
|
key: "cds_comment_style",
|
|
54841
54842
|
title: "CDS Comment Style",
|
|
54842
54843
|
shortDescription: `Check for obsolete comment style`,
|
|
54843
|
-
extendedInformation: `Check for obsolete comment style
|
|
54844
|
-
|
|
54845
|
-
Comments starting with "--" are considered obsolete
|
|
54846
|
-
|
|
54844
|
+
extendedInformation: `Check for obsolete comment style
|
|
54845
|
+
|
|
54846
|
+
Comments starting with "--" are considered obsolete
|
|
54847
|
+
|
|
54847
54848
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54848
54849
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54849
54850
|
badExample: "-- this is a comment",
|
|
@@ -54909,10 +54910,10 @@ class CDSLegacyView {
|
|
|
54909
54910
|
key: "cds_legacy_view",
|
|
54910
54911
|
title: "CDS Legacy View",
|
|
54911
54912
|
shortDescription: `Identify CDS Legacy Views`,
|
|
54912
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54913
|
-
|
|
54914
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54915
|
-
|
|
54913
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
54914
|
+
|
|
54915
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
54916
|
+
|
|
54916
54917
|
v755 and up`,
|
|
54917
54918
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
54918
54919
|
};
|
|
@@ -55067,10 +55068,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55067
55068
|
key: "chain_mainly_declarations",
|
|
55068
55069
|
title: "Chain mainly declarations",
|
|
55069
55070
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55070
|
-
extendedInformation: `
|
|
55071
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55072
|
-
|
|
55073
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55071
|
+
extendedInformation: `
|
|
55072
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55073
|
+
|
|
55074
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55074
55075
|
`,
|
|
55075
55076
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55076
55077
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55246,17 +55247,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55246
55247
|
title: "Change IF to CASE",
|
|
55247
55248
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55248
55249
|
// eslint-disable-next-line max-len
|
|
55249
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55250
|
-
|
|
55250
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55251
|
+
|
|
55251
55252
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55252
55253
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55253
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55254
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55255
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55254
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55255
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55256
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55256
55257
|
ENDIF.`,
|
|
55257
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55258
|
-
WHEN 'FOO'.
|
|
55259
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55258
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55259
|
+
WHEN 'FOO'.
|
|
55260
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55260
55261
|
ENDCASE.`,
|
|
55261
55262
|
};
|
|
55262
55263
|
}
|
|
@@ -55393,8 +55394,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55393
55394
|
return {
|
|
55394
55395
|
key: "check_abstract",
|
|
55395
55396
|
title: "Check abstract methods and classes",
|
|
55396
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55397
|
-
- class defined as abstract and final,
|
|
55397
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55398
|
+
- class defined as abstract and final,
|
|
55398
55399
|
- non-abstract class contains abstract methods`,
|
|
55399
55400
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55400
55401
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55475,11 +55476,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55475
55476
|
return {
|
|
55476
55477
|
key: "check_comments",
|
|
55477
55478
|
title: "Check Comments",
|
|
55478
|
-
shortDescription: `
|
|
55479
|
+
shortDescription: `
|
|
55479
55480
|
Various checks for comment usage.`,
|
|
55480
|
-
extendedInformation: `
|
|
55481
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55482
|
-
|
|
55481
|
+
extendedInformation: `
|
|
55482
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55483
|
+
|
|
55483
55484
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55484
55485
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55485
55486
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55641,9 +55642,9 @@ class CheckInclude {
|
|
|
55641
55642
|
key: "check_include",
|
|
55642
55643
|
title: "Check INCLUDEs",
|
|
55643
55644
|
shortDescription: `Checks INCLUDE statements`,
|
|
55644
|
-
extendedInformation: `
|
|
55645
|
-
* Reports unused includes
|
|
55646
|
-
* Errors if the includes are not found
|
|
55645
|
+
extendedInformation: `
|
|
55646
|
+
* Reports unused includes
|
|
55647
|
+
* Errors if the includes are not found
|
|
55647
55648
|
* Error if including a main program`,
|
|
55648
55649
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55649
55650
|
};
|
|
@@ -55719,14 +55720,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55719
55720
|
key: "check_subrc",
|
|
55720
55721
|
title: "Check sy-subrc",
|
|
55721
55722
|
shortDescription: `Check sy-subrc`,
|
|
55722
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55723
|
-
|
|
55724
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55725
|
-
|
|
55726
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55727
|
-
|
|
55728
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55729
|
-
|
|
55723
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55724
|
+
|
|
55725
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55726
|
+
|
|
55727
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55728
|
+
|
|
55729
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55730
|
+
|
|
55730
55731
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55731
55732
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55732
55733
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56296,17 +56297,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56296
56297
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56297
56298
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56298
56299
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56299
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56300
|
-
EXCEPTIONS
|
|
56301
|
-
system_failure = 1 MESSAGE lv_message
|
|
56302
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56303
|
-
resource_failure = 1
|
|
56300
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56301
|
+
EXCEPTIONS
|
|
56302
|
+
system_failure = 1 MESSAGE lv_message
|
|
56303
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56304
|
+
resource_failure = 1
|
|
56304
56305
|
OTHERS = 1.`,
|
|
56305
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56306
|
-
EXCEPTIONS
|
|
56307
|
-
system_failure = 1 MESSAGE lv_message
|
|
56308
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56309
|
-
resource_failure = 3
|
|
56306
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56307
|
+
EXCEPTIONS
|
|
56308
|
+
system_failure = 1 MESSAGE lv_message
|
|
56309
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56310
|
+
resource_failure = 3
|
|
56310
56311
|
OTHERS = 4.`,
|
|
56311
56312
|
};
|
|
56312
56313
|
}
|
|
@@ -56552,7 +56553,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56552
56553
|
key: "commented_code",
|
|
56553
56554
|
title: "Find commented code",
|
|
56554
56555
|
shortDescription: `Detects usage of commented out code.`,
|
|
56555
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56556
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56556
56557
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56557
56558
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56558
56559
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56785,10 +56786,10 @@ class ConstructorVisibilityPublic {
|
|
|
56785
56786
|
key: "constructor_visibility_public",
|
|
56786
56787
|
title: "Check constructor visibility is public",
|
|
56787
56788
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56788
|
-
extendedInformation: `
|
|
56789
|
-
This only applies to global classes.
|
|
56790
|
-
|
|
56791
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56789
|
+
extendedInformation: `
|
|
56790
|
+
This only applies to global classes.
|
|
56791
|
+
|
|
56792
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56792
56793
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56793
56794
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56794
56795
|
};
|
|
@@ -56863,8 +56864,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56863
56864
|
key: "contains_tab",
|
|
56864
56865
|
title: "Code contains tab",
|
|
56865
56866
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56866
|
-
extendedInformation: `
|
|
56867
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
56867
|
+
extendedInformation: `
|
|
56868
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56868
56869
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56869
56870
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56870
56871
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -56951,10 +56952,10 @@ class CyclicOO {
|
|
|
56951
56952
|
key: "cyclic_oo",
|
|
56952
56953
|
title: "Cyclic OO",
|
|
56953
56954
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
56954
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56955
|
-
|
|
56956
|
-
Objects must be without syntax errors for this rule to take effect
|
|
56957
|
-
|
|
56955
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
56956
|
+
|
|
56957
|
+
Objects must be without syntax errors for this rule to take effect
|
|
56958
|
+
|
|
56958
56959
|
References in testclass includes are ignored`,
|
|
56959
56960
|
};
|
|
56960
56961
|
}
|
|
@@ -57197,7 +57198,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57197
57198
|
key: "dangerous_statement",
|
|
57198
57199
|
title: "Dangerous statement",
|
|
57199
57200
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57200
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57201
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57201
57202
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57202
57203
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57203
57204
|
};
|
|
@@ -57404,13 +57405,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57404
57405
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57405
57406
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57406
57407
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57407
|
-
badExample: `FROM foo.
|
|
57408
|
-
WRITE 'hello'.
|
|
57409
|
-
DATA int TYPE i.
|
|
57408
|
+
badExample: `FROM foo.
|
|
57409
|
+
WRITE 'hello'.
|
|
57410
|
+
DATA int TYPE i.
|
|
57410
57411
|
ENDFORM.`,
|
|
57411
|
-
goodExample: `FROM foo.
|
|
57412
|
-
DATA int TYPE i.
|
|
57413
|
-
WRITE 'hello'.
|
|
57412
|
+
goodExample: `FROM foo.
|
|
57413
|
+
DATA int TYPE i.
|
|
57414
|
+
WRITE 'hello'.
|
|
57414
57415
|
ENDFORM.`,
|
|
57415
57416
|
};
|
|
57416
57417
|
}
|
|
@@ -57949,39 +57950,39 @@ class Downport {
|
|
|
57949
57950
|
key: "downport",
|
|
57950
57951
|
title: "Downport statement",
|
|
57951
57952
|
shortDescription: `Downport functionality`,
|
|
57952
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57953
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57954
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57955
|
-
|
|
57956
|
-
Current rules:
|
|
57957
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57958
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57959
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
57960
|
-
* CONV is outlined
|
|
57961
|
-
* COND is outlined
|
|
57962
|
-
* REDUCE is outlined
|
|
57963
|
-
* SWITCH is outlined
|
|
57964
|
-
* FILTER is outlined
|
|
57965
|
-
* APPEND expression is outlined
|
|
57966
|
-
* INSERT expression is outlined
|
|
57967
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57968
|
-
* CAST changed to ?=
|
|
57969
|
-
* LOOP AT method_call( ) is outlined
|
|
57970
|
-
* VALUE # with structure fields
|
|
57971
|
-
* VALUE # with internal table lines
|
|
57972
|
-
* Table Expressions are outlined
|
|
57973
|
-
* SELECT INTO @DATA definitions are outlined
|
|
57974
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57975
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57976
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57977
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
57978
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57979
|
-
* line_exists and line_index is downported to READ TABLE
|
|
57980
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
57981
|
-
* MESSAGE with non simple source
|
|
57982
|
-
|
|
57983
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57984
|
-
|
|
57953
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
57954
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
57955
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
57956
|
+
|
|
57957
|
+
Current rules:
|
|
57958
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
57959
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
57960
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
57961
|
+
* CONV is outlined
|
|
57962
|
+
* COND is outlined
|
|
57963
|
+
* REDUCE is outlined
|
|
57964
|
+
* SWITCH is outlined
|
|
57965
|
+
* FILTER is outlined
|
|
57966
|
+
* APPEND expression is outlined
|
|
57967
|
+
* INSERT expression is outlined
|
|
57968
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
57969
|
+
* CAST changed to ?=
|
|
57970
|
+
* LOOP AT method_call( ) is outlined
|
|
57971
|
+
* VALUE # with structure fields
|
|
57972
|
+
* VALUE # with internal table lines
|
|
57973
|
+
* Table Expressions are outlined
|
|
57974
|
+
* SELECT INTO @DATA definitions are outlined
|
|
57975
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
57976
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
57977
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
57978
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
57979
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
57980
|
+
* line_exists and line_index is downported to READ TABLE
|
|
57981
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
57982
|
+
* MESSAGE with non simple source
|
|
57983
|
+
|
|
57984
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
57985
|
+
|
|
57985
57986
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
57986
57987
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
57987
57988
|
};
|
|
@@ -58559,10 +58560,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58559
58560
|
const fieldName = f.concatTokens();
|
|
58560
58561
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58561
58562
|
}
|
|
58562
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58563
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58563
58564
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58564
58565
|
}
|
|
58565
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58566
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58566
58567
|
${indentation}`);
|
|
58567
58568
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58568
58569
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58621,12 +58622,12 @@ ${indentation}`);
|
|
|
58621
58622
|
}
|
|
58622
58623
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58623
58624
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
58624
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58625
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58626
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58625
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58626
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58627
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58627
58628
|
${indentation}`);
|
|
58628
58629
|
if (fieldDefinitions === "") {
|
|
58629
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58630
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58630
58631
|
${indentation}`);
|
|
58631
58632
|
}
|
|
58632
58633
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58694,7 +58695,7 @@ ${indentation}`);
|
|
|
58694
58695
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58695
58696
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58696
58697
|
const firstToken = high.getFirstToken();
|
|
58697
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58698
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58698
58699
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58699
58700
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58700
58701
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58748,7 +58749,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58748
58749
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58749
58750
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58750
58751
|
const firstToken = high.getFirstToken();
|
|
58751
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58752
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58752
58753
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58753
58754
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58754
58755
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58790,14 +58791,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58790
58791
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58791
58792
|
const firstToken = high.getFirstToken();
|
|
58792
58793
|
// note that the tabix restore should be done before throwing the exception
|
|
58793
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58794
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58795
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58796
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58797
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58798
|
-
${indentation}IF sy-subrc <> 0.
|
|
58799
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58800
|
-
${indentation}ENDIF.
|
|
58794
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58795
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58796
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58797
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58798
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58799
|
+
${indentation}IF sy-subrc <> 0.
|
|
58800
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58801
|
+
${indentation}ENDIF.
|
|
58801
58802
|
${indentation}`);
|
|
58802
58803
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58803
58804
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58854,7 +58855,7 @@ ${indentation}`);
|
|
|
58854
58855
|
const className = classNames[0].concatTokens();
|
|
58855
58856
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58856
58857
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58857
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58858
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58858
58859
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58859
58860
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58860
58861
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59016,16 +59017,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59016
59017
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59017
59018
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59018
59019
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59019
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59020
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59020
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59021
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59021
59022
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59022
59023
|
if (withs.length > 0) {
|
|
59023
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59024
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59025
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59024
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59025
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59026
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59026
59027
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59027
59028
|
}
|
|
59028
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59029
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59029
59030
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59030
59031
|
if (withs.length > 0) {
|
|
59031
59032
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59137,10 +59138,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59137
59138
|
let code = "";
|
|
59138
59139
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59139
59140
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59140
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59141
|
-
IF sy-subrc <> 0.
|
|
59142
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59143
|
-
ENDIF.
|
|
59141
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59142
|
+
IF sy-subrc <> 0.
|
|
59143
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59144
|
+
ENDIF.
|
|
59144
59145
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59145
59146
|
}
|
|
59146
59147
|
else {
|
|
@@ -59229,20 +59230,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59229
59230
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59230
59231
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59231
59232
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59232
|
-
code += ` items LIKE ${loopSourceName},
|
|
59233
|
-
END OF ${groupTargetName}type.
|
|
59234
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59235
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59233
|
+
code += ` items LIKE ${loopSourceName},
|
|
59234
|
+
END OF ${groupTargetName}type.
|
|
59235
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59236
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59236
59237
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59237
59238
|
if (groupIndexName !== undefined) {
|
|
59238
59239
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59239
59240
|
}
|
|
59240
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59241
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59241
59242
|
IF sy-subrc = 0.\n`;
|
|
59242
59243
|
if (groupCountName !== undefined) {
|
|
59243
59244
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59244
59245
|
}
|
|
59245
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59246
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59246
59247
|
ELSE.\n`;
|
|
59247
59248
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59248
59249
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59263,8 +59264,8 @@ ELSE.\n`;
|
|
|
59263
59264
|
}
|
|
59264
59265
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59265
59266
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59266
|
-
code += `ENDIF.
|
|
59267
|
-
ENDLOOP.
|
|
59267
|
+
code += `ENDIF.
|
|
59268
|
+
ENDLOOP.
|
|
59268
59269
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59269
59270
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59270
59271
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59436,7 +59437,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59436
59437
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59437
59438
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59438
59439
|
// all ENUMS are char like?
|
|
59439
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59440
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59440
59441
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59441
59442
|
let count = 1;
|
|
59442
59443
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59480,14 +59481,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59480
59481
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59481
59482
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59482
59483
|
// restore tabix before exeption
|
|
59483
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59484
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59485
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59486
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59487
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59488
|
-
${indentation}IF sy-subrc <> 0.
|
|
59489
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59490
|
-
${indentation}ENDIF.
|
|
59484
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59485
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59486
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59487
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59488
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59489
|
+
${indentation}IF sy-subrc <> 0.
|
|
59490
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59491
|
+
${indentation}ENDIF.
|
|
59491
59492
|
${indentation}${uniqueName}`;
|
|
59492
59493
|
const start = target.getFirstToken().getStart();
|
|
59493
59494
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59571,11 +59572,11 @@ ${indentation}${uniqueName}`;
|
|
|
59571
59572
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59572
59573
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59573
59574
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59574
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59575
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59576
|
-
${indentation} EXPORTING
|
|
59577
|
-
${indentation} input = ${source}
|
|
59578
|
-
${indentation} IMPORTING
|
|
59575
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59576
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59577
|
+
${indentation} EXPORTING
|
|
59578
|
+
${indentation} input = ${source}
|
|
59579
|
+
${indentation} IMPORTING
|
|
59579
59580
|
${indentation} output = ${uniqueName}.\n`;
|
|
59580
59581
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59581
59582
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60887,12 +60888,12 @@ class EasyToFindMessages {
|
|
|
60887
60888
|
key: "easy_to_find_messages",
|
|
60888
60889
|
title: "Easy to find messages",
|
|
60889
60890
|
shortDescription: `Make messages easy to find`,
|
|
60890
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60891
|
-
|
|
60892
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60893
|
-
|
|
60894
|
-
Also see rule "message_exists"
|
|
60895
|
-
|
|
60891
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
60892
|
+
|
|
60893
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
60894
|
+
|
|
60895
|
+
Also see rule "message_exists"
|
|
60896
|
+
|
|
60896
60897
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
60897
60898
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
60898
60899
|
};
|
|
@@ -60973,13 +60974,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
60973
60974
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
60974
60975
|
extendedInformation: ``,
|
|
60975
60976
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60976
|
-
badExample: `
|
|
60977
|
-
INITIALIZATION.
|
|
60978
|
-
WRITE 'hello'.
|
|
60977
|
+
badExample: `
|
|
60978
|
+
INITIALIZATION.
|
|
60979
|
+
WRITE 'hello'.
|
|
60979
60980
|
END-OF-SELECTION.`,
|
|
60980
|
-
goodExample: `
|
|
60981
|
-
START-OF-SELECTION.
|
|
60982
|
-
PERFORM sdf.
|
|
60981
|
+
goodExample: `
|
|
60982
|
+
START-OF-SELECTION.
|
|
60983
|
+
PERFORM sdf.
|
|
60983
60984
|
COMMIT WORK.`,
|
|
60984
60985
|
};
|
|
60985
60986
|
}
|
|
@@ -61071,8 +61072,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61071
61072
|
key: "empty_line_in_statement",
|
|
61072
61073
|
title: "Find empty lines in statements",
|
|
61073
61074
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61074
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61075
|
-
|
|
61075
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61076
|
+
|
|
61076
61077
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61077
61078
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61078
61079
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61248,13 +61249,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61248
61249
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61249
61250
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61250
61251
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61251
|
-
badExample: `IF foo = bar.
|
|
61252
|
-
ENDIF.
|
|
61253
|
-
|
|
61254
|
-
DO 2 TIMES.
|
|
61252
|
+
badExample: `IF foo = bar.
|
|
61253
|
+
ENDIF.
|
|
61254
|
+
|
|
61255
|
+
DO 2 TIMES.
|
|
61255
61256
|
ENDDO.`,
|
|
61256
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61257
|
-
ENDLOOP.
|
|
61257
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61258
|
+
ENDLOOP.
|
|
61258
61259
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61259
61260
|
};
|
|
61260
61261
|
}
|
|
@@ -61396,10 +61397,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61396
61397
|
return {
|
|
61397
61398
|
key: "exit_or_check",
|
|
61398
61399
|
title: "Find EXIT or CHECK outside loops",
|
|
61399
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61400
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61400
61401
|
Use RETURN to leave procesing blocks instead.`,
|
|
61401
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61402
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61402
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61403
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61403
61404
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61404
61405
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61405
61406
|
};
|
|
@@ -61482,12 +61483,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61482
61483
|
key: "expand_macros",
|
|
61483
61484
|
title: "Expand Macros",
|
|
61484
61485
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61485
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61486
|
-
|
|
61486
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61487
|
+
|
|
61487
61488
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61488
|
-
badExample: `DEFINE _hello.
|
|
61489
|
-
WRITE 'hello'.
|
|
61490
|
-
END-OF-DEFINITION.
|
|
61489
|
+
badExample: `DEFINE _hello.
|
|
61490
|
+
WRITE 'hello'.
|
|
61491
|
+
END-OF-DEFINITION.
|
|
61491
61492
|
_hello.`,
|
|
61492
61493
|
goodExample: `WRITE 'hello'.`,
|
|
61493
61494
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61574,7 +61575,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61574
61575
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61575
61576
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61576
61577
|
goodExample: `call_method( foo = bar ).`,
|
|
61577
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61578
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61578
61579
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61579
61580
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61580
61581
|
};
|
|
@@ -61672,7 +61673,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61672
61673
|
key: "forbidden_identifier",
|
|
61673
61674
|
title: "Forbidden Identifier",
|
|
61674
61675
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61675
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61676
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61676
61677
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61677
61678
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61678
61679
|
};
|
|
@@ -61914,8 +61915,8 @@ class ForbiddenVoidType {
|
|
|
61914
61915
|
key: "forbidden_void_type",
|
|
61915
61916
|
title: "Forbidden Void Types",
|
|
61916
61917
|
shortDescription: `Avoid usage of specified void types.`,
|
|
61917
|
-
extendedInformation: `Inspiration:
|
|
61918
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61918
|
+
extendedInformation: `Inspiration:
|
|
61919
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
61919
61920
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
61920
61921
|
};
|
|
61921
61922
|
}
|
|
@@ -62158,7 +62159,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62158
62159
|
key: "fully_type_itabs",
|
|
62159
62160
|
title: "Fully type internal tables",
|
|
62160
62161
|
shortDescription: `No implict table types or table keys`,
|
|
62161
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62162
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62162
62163
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62163
62164
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62164
62165
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62343,26 +62344,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62343
62344
|
key: "functional_writing",
|
|
62344
62345
|
title: "Use functional writing",
|
|
62345
62346
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62346
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62347
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62347
62348
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62348
62349
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62349
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62350
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62351
|
-
EXPORTING
|
|
62352
|
-
p_name = 'NAME'
|
|
62353
|
-
RECEIVING
|
|
62354
|
-
p_descr_ref = lr_typedescr
|
|
62355
|
-
EXCEPTIONS
|
|
62356
|
-
type_not_found = 1
|
|
62350
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62351
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62352
|
+
EXPORTING
|
|
62353
|
+
p_name = 'NAME'
|
|
62354
|
+
RECEIVING
|
|
62355
|
+
p_descr_ref = lr_typedescr
|
|
62356
|
+
EXCEPTIONS
|
|
62357
|
+
type_not_found = 1
|
|
62357
62358
|
OTHERS = 2.`,
|
|
62358
|
-
goodExample: `zcl_class=>method( ).
|
|
62359
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62360
|
-
EXPORTING
|
|
62361
|
-
p_name = 'NAME'
|
|
62362
|
-
RECEIVING
|
|
62363
|
-
p_descr_ref = lr_typedescr
|
|
62364
|
-
EXCEPTIONS
|
|
62365
|
-
type_not_found = 1
|
|
62359
|
+
goodExample: `zcl_class=>method( ).
|
|
62360
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62361
|
+
EXPORTING
|
|
62362
|
+
p_name = 'NAME'
|
|
62363
|
+
RECEIVING
|
|
62364
|
+
p_descr_ref = lr_typedescr
|
|
62365
|
+
EXCEPTIONS
|
|
62366
|
+
type_not_found = 1
|
|
62366
62367
|
OTHERS = 2 ).`,
|
|
62367
62368
|
};
|
|
62368
62369
|
}
|
|
@@ -62473,14 +62474,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62473
62474
|
key: "global_class",
|
|
62474
62475
|
title: "Global class checks",
|
|
62475
62476
|
shortDescription: `Checks related to global classes`,
|
|
62476
|
-
extendedInformation: `* global classes must be in own files
|
|
62477
|
-
|
|
62478
|
-
* file names must match class name
|
|
62479
|
-
|
|
62480
|
-
* file names must match interface name
|
|
62481
|
-
|
|
62482
|
-
* global classes must be global definitions
|
|
62483
|
-
|
|
62477
|
+
extendedInformation: `* global classes must be in own files
|
|
62478
|
+
|
|
62479
|
+
* file names must match class name
|
|
62480
|
+
|
|
62481
|
+
* file names must match interface name
|
|
62482
|
+
|
|
62483
|
+
* global classes must be global definitions
|
|
62484
|
+
|
|
62484
62485
|
* global interfaces must be global definitions`,
|
|
62485
62486
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62486
62487
|
};
|
|
@@ -62579,21 +62580,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62579
62580
|
return {
|
|
62580
62581
|
key: "identical_conditions",
|
|
62581
62582
|
title: "Identical conditions",
|
|
62582
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62583
|
-
|
|
62583
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62584
|
+
|
|
62584
62585
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62585
62586
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62586
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62587
|
-
ENDIF.
|
|
62588
|
-
CASE bar.
|
|
62589
|
-
WHEN '1'.
|
|
62590
|
-
WHEN 'A' OR '1'.
|
|
62587
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62588
|
+
ENDIF.
|
|
62589
|
+
CASE bar.
|
|
62590
|
+
WHEN '1'.
|
|
62591
|
+
WHEN 'A' OR '1'.
|
|
62591
62592
|
ENDCASE.`,
|
|
62592
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62593
|
-
ENDIF.
|
|
62594
|
-
CASE bar.
|
|
62595
|
-
WHEN '1'.
|
|
62596
|
-
WHEN 'A'.
|
|
62593
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62594
|
+
ENDIF.
|
|
62595
|
+
CASE bar.
|
|
62596
|
+
WHEN '1'.
|
|
62597
|
+
WHEN 'A'.
|
|
62597
62598
|
ENDCASE.`,
|
|
62598
62599
|
};
|
|
62599
62600
|
}
|
|
@@ -62727,23 +62728,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62727
62728
|
key: "identical_contents",
|
|
62728
62729
|
title: "Identical contents",
|
|
62729
62730
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62730
|
-
extendedInformation: `
|
|
62731
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62732
|
-
|
|
62731
|
+
extendedInformation: `
|
|
62732
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62733
|
+
|
|
62733
62734
|
Chained statments are ignored`,
|
|
62734
62735
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62735
|
-
badExample: `IF foo = bar.
|
|
62736
|
-
WRITE 'bar'.
|
|
62737
|
-
WRITE 'world'.
|
|
62738
|
-
ELSE.
|
|
62739
|
-
WRITE 'foo'.
|
|
62740
|
-
WRITE 'world'.
|
|
62736
|
+
badExample: `IF foo = bar.
|
|
62737
|
+
WRITE 'bar'.
|
|
62738
|
+
WRITE 'world'.
|
|
62739
|
+
ELSE.
|
|
62740
|
+
WRITE 'foo'.
|
|
62741
|
+
WRITE 'world'.
|
|
62741
62742
|
ENDIF.`,
|
|
62742
|
-
goodExample: `IF foo = bar.
|
|
62743
|
-
WRITE 'bar'.
|
|
62744
|
-
ELSE.
|
|
62745
|
-
WRITE 'foo'.
|
|
62746
|
-
ENDIF.
|
|
62743
|
+
goodExample: `IF foo = bar.
|
|
62744
|
+
WRITE 'bar'.
|
|
62745
|
+
ELSE.
|
|
62746
|
+
WRITE 'foo'.
|
|
62747
|
+
ENDIF.
|
|
62747
62748
|
WRITE 'world'.`,
|
|
62748
62749
|
};
|
|
62749
62750
|
}
|
|
@@ -62851,12 +62852,12 @@ class IdenticalDescriptions {
|
|
|
62851
62852
|
key: "identical_descriptions",
|
|
62852
62853
|
title: "Identical descriptions",
|
|
62853
62854
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62854
|
-
extendedInformation: `Case insensitive
|
|
62855
|
-
|
|
62856
|
-
Only checks the master language descriptions
|
|
62857
|
-
|
|
62858
|
-
Dependencies are skipped
|
|
62859
|
-
|
|
62855
|
+
extendedInformation: `Case insensitive
|
|
62856
|
+
|
|
62857
|
+
Only checks the master language descriptions
|
|
62858
|
+
|
|
62859
|
+
Dependencies are skipped
|
|
62860
|
+
|
|
62860
62861
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62861
62862
|
tags: [],
|
|
62862
62863
|
};
|
|
@@ -63030,43 +63031,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63030
63031
|
key: "if_in_if",
|
|
63031
63032
|
title: "IF in IF",
|
|
63032
63033
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63033
|
-
extendedInformation: `
|
|
63034
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63035
|
-
|
|
63036
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63037
|
-
|
|
63038
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63034
|
+
extendedInformation: `
|
|
63035
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63036
|
+
|
|
63037
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63038
|
+
|
|
63039
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63039
63040
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63040
|
-
badExample: `IF condition1.
|
|
63041
|
-
IF condition2.
|
|
63042
|
-
...
|
|
63043
|
-
ENDIF.
|
|
63044
|
-
ENDIF.
|
|
63045
|
-
|
|
63046
|
-
IF condition1.
|
|
63047
|
-
...
|
|
63048
|
-
ELSE.
|
|
63049
|
-
IF condition2.
|
|
63050
|
-
...
|
|
63051
|
-
ENDIF.
|
|
63041
|
+
badExample: `IF condition1.
|
|
63042
|
+
IF condition2.
|
|
63043
|
+
...
|
|
63044
|
+
ENDIF.
|
|
63045
|
+
ENDIF.
|
|
63046
|
+
|
|
63047
|
+
IF condition1.
|
|
63048
|
+
...
|
|
63049
|
+
ELSE.
|
|
63050
|
+
IF condition2.
|
|
63051
|
+
...
|
|
63052
|
+
ENDIF.
|
|
63052
63053
|
ENDIF.`,
|
|
63053
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63054
|
-
...
|
|
63055
|
-
ENDIF.
|
|
63056
|
-
|
|
63057
|
-
IF condition1.
|
|
63058
|
-
...
|
|
63059
|
-
ELSEIF condition2.
|
|
63060
|
-
...
|
|
63061
|
-
ENDIF.
|
|
63062
|
-
|
|
63063
|
-
CASE variable.
|
|
63064
|
-
WHEN value1.
|
|
63065
|
-
...
|
|
63066
|
-
WHEN value2.
|
|
63067
|
-
IF condition2.
|
|
63068
|
-
...
|
|
63069
|
-
ENDIF.
|
|
63054
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63055
|
+
...
|
|
63056
|
+
ENDIF.
|
|
63057
|
+
|
|
63058
|
+
IF condition1.
|
|
63059
|
+
...
|
|
63060
|
+
ELSEIF condition2.
|
|
63061
|
+
...
|
|
63062
|
+
ENDIF.
|
|
63063
|
+
|
|
63064
|
+
CASE variable.
|
|
63065
|
+
WHEN value1.
|
|
63066
|
+
...
|
|
63067
|
+
WHEN value2.
|
|
63068
|
+
IF condition2.
|
|
63069
|
+
...
|
|
63070
|
+
ENDIF.
|
|
63070
63071
|
ENDCASE.`,
|
|
63071
63072
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63072
63073
|
};
|
|
@@ -63251,9 +63252,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63251
63252
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63252
63253
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63253
63254
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63254
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63255
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63256
|
-
RETURN. " todo, implement method
|
|
63255
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63256
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63257
|
+
RETURN. " todo, implement method
|
|
63257
63258
|
ENDMETHOD.`);
|
|
63258
63259
|
}
|
|
63259
63260
|
}
|
|
@@ -63432,14 +63433,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63432
63433
|
key: "implicit_start_of_selection",
|
|
63433
63434
|
title: "Implicit START-OF-SELECTION",
|
|
63434
63435
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63435
|
-
extendedInformation: `Only runs for executable programs
|
|
63436
|
-
|
|
63436
|
+
extendedInformation: `Only runs for executable programs
|
|
63437
|
+
|
|
63437
63438
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63438
63439
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63439
|
-
badExample: `REPORT zfoo.
|
|
63440
|
+
badExample: `REPORT zfoo.
|
|
63440
63441
|
WRITE 'hello'.`,
|
|
63441
|
-
goodExample: `
|
|
63442
|
-
START-OF-SELECTION.
|
|
63442
|
+
goodExample: `
|
|
63443
|
+
START-OF-SELECTION.
|
|
63443
63444
|
WRITE 'hello'.`,
|
|
63444
63445
|
};
|
|
63445
63446
|
}
|
|
@@ -63544,19 +63545,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63544
63545
|
key: "in_statement_indentation",
|
|
63545
63546
|
title: "In-statement indentation",
|
|
63546
63547
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63547
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63548
|
-
|
|
63549
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63548
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63549
|
+
|
|
63550
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63550
63551
|
to distinguish them better from code within the block.`,
|
|
63551
|
-
badExample: `IF 1 = 1
|
|
63552
|
-
AND 2 = 2.
|
|
63553
|
-
WRITE 'hello' &&
|
|
63554
|
-
'world'.
|
|
63552
|
+
badExample: `IF 1 = 1
|
|
63553
|
+
AND 2 = 2.
|
|
63554
|
+
WRITE 'hello' &&
|
|
63555
|
+
'world'.
|
|
63555
63556
|
ENDIF.`,
|
|
63556
|
-
goodExample: `IF 1 = 1
|
|
63557
|
-
AND 2 = 2.
|
|
63558
|
-
WRITE 'hello' &&
|
|
63559
|
-
'world'.
|
|
63557
|
+
goodExample: `IF 1 = 1
|
|
63558
|
+
AND 2 = 2.
|
|
63559
|
+
WRITE 'hello' &&
|
|
63560
|
+
'world'.
|
|
63560
63561
|
ENDIF.`,
|
|
63561
63562
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63562
63563
|
};
|
|
@@ -63679,23 +63680,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63679
63680
|
title: "Indentation",
|
|
63680
63681
|
shortDescription: `Checks indentation`,
|
|
63681
63682
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63682
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63683
|
-
PRIVATE SECTION.
|
|
63684
|
-
METHODS constructor.
|
|
63685
|
-
ENDCLASS.
|
|
63686
|
-
|
|
63687
|
-
CLASS lcl IMPLEMENTATION.
|
|
63688
|
-
METHOD constructor.
|
|
63689
|
-
ENDMETHOD.
|
|
63683
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63684
|
+
PRIVATE SECTION.
|
|
63685
|
+
METHODS constructor.
|
|
63686
|
+
ENDCLASS.
|
|
63687
|
+
|
|
63688
|
+
CLASS lcl IMPLEMENTATION.
|
|
63689
|
+
METHOD constructor.
|
|
63690
|
+
ENDMETHOD.
|
|
63690
63691
|
ENDCLASS.`,
|
|
63691
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63692
|
-
PRIVATE SECTION.
|
|
63693
|
-
METHODS constructor.
|
|
63694
|
-
ENDCLASS.
|
|
63695
|
-
|
|
63696
|
-
CLASS lcl IMPLEMENTATION.
|
|
63697
|
-
METHOD constructor.
|
|
63698
|
-
ENDMETHOD.
|
|
63692
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63693
|
+
PRIVATE SECTION.
|
|
63694
|
+
METHODS constructor.
|
|
63695
|
+
ENDCLASS.
|
|
63696
|
+
|
|
63697
|
+
CLASS lcl IMPLEMENTATION.
|
|
63698
|
+
METHOD constructor.
|
|
63699
|
+
ENDMETHOD.
|
|
63699
63700
|
ENDCLASS.`,
|
|
63700
63701
|
};
|
|
63701
63702
|
}
|
|
@@ -64096,9 +64097,9 @@ class IntfReferencingClas {
|
|
|
64096
64097
|
key: "intf_referencing_clas",
|
|
64097
64098
|
title: "INTF referencing CLAS",
|
|
64098
64099
|
shortDescription: `Interface contains references to class`,
|
|
64099
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64100
|
-
Only first level references are checked.
|
|
64101
|
-
Exception class references are ignored.
|
|
64100
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64101
|
+
Only first level references are checked.
|
|
64102
|
+
Exception class references are ignored.
|
|
64102
64103
|
Void references are ignored.`,
|
|
64103
64104
|
};
|
|
64104
64105
|
}
|
|
@@ -64183,9 +64184,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64183
64184
|
title: "Invalid Table Index",
|
|
64184
64185
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64185
64186
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64186
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64187
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64187
64188
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64188
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64189
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64189
64190
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64190
64191
|
};
|
|
64191
64192
|
}
|
|
@@ -64786,8 +64787,8 @@ class LineBreakStyle {
|
|
|
64786
64787
|
return {
|
|
64787
64788
|
key: "line_break_style",
|
|
64788
64789
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64789
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64790
|
-
|
|
64790
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64791
|
+
|
|
64791
64792
|
abapGit does not work with CRLF`,
|
|
64792
64793
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64793
64794
|
};
|
|
@@ -64856,7 +64857,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64856
64857
|
key: "line_length",
|
|
64857
64858
|
title: "Line length",
|
|
64858
64859
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64859
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64860
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64860
64861
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64861
64862
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64862
64863
|
};
|
|
@@ -64927,7 +64928,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
64927
64928
|
key: "line_only_punc",
|
|
64928
64929
|
title: "Line containing only punctuation",
|
|
64929
64930
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
64930
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64931
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
64931
64932
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
64932
64933
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64933
64934
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65190,15 +65191,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65190
65191
|
return {
|
|
65191
65192
|
key: "local_variable_names",
|
|
65192
65193
|
title: "Local variable naming conventions",
|
|
65193
|
-
shortDescription: `
|
|
65194
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65194
|
+
shortDescription: `
|
|
65195
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65195
65196
|
Regexes are case-insensitive.`,
|
|
65196
65197
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65197
|
-
badExample: `FORM bar.
|
|
65198
|
-
DATA foo.
|
|
65198
|
+
badExample: `FORM bar.
|
|
65199
|
+
DATA foo.
|
|
65199
65200
|
ENDFORM.`,
|
|
65200
|
-
goodExample: `FORM bar.
|
|
65201
|
-
DATA lv_foo.
|
|
65201
|
+
goodExample: `FORM bar.
|
|
65202
|
+
DATA lv_foo.
|
|
65202
65203
|
ENDFORM.`,
|
|
65203
65204
|
};
|
|
65204
65205
|
}
|
|
@@ -65350,9 +65351,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65350
65351
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65351
65352
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65352
65353
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65353
|
-
badExample: `DEFINE something.
|
|
65354
|
+
badExample: `DEFINE something.
|
|
65354
65355
|
END-OF-DEFINITION.`,
|
|
65355
|
-
goodExample: `DEFINE _something.
|
|
65356
|
+
goodExample: `DEFINE _something.
|
|
65356
65357
|
END-OF-DEFINITION.`,
|
|
65357
65358
|
};
|
|
65358
65359
|
}
|
|
@@ -65425,10 +65426,10 @@ class MainFileContents {
|
|
|
65425
65426
|
key: "main_file_contents",
|
|
65426
65427
|
title: "Main file contents",
|
|
65427
65428
|
shortDescription: `Checks related to report declarations.`,
|
|
65428
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65429
|
-
|
|
65430
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65431
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65429
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65430
|
+
|
|
65431
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65432
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65432
65433
|
`,
|
|
65433
65434
|
};
|
|
65434
65435
|
}
|
|
@@ -65544,17 +65545,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65544
65545
|
title: "Too many parentheses",
|
|
65545
65546
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65546
65547
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65547
|
-
badExample: `
|
|
65548
|
-
IF ( destination IS INITIAL ).
|
|
65549
|
-
ENDIF.
|
|
65550
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65551
|
-
ENDIF.
|
|
65548
|
+
badExample: `
|
|
65549
|
+
IF ( destination IS INITIAL ).
|
|
65550
|
+
ENDIF.
|
|
65551
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65552
|
+
ENDIF.
|
|
65552
65553
|
`,
|
|
65553
|
-
goodExample: `
|
|
65554
|
-
IF destination IS INITIAL.
|
|
65555
|
-
ENDIF.
|
|
65556
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65557
|
-
ENDIF.
|
|
65554
|
+
goodExample: `
|
|
65555
|
+
IF destination IS INITIAL.
|
|
65556
|
+
ENDIF.
|
|
65557
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65558
|
+
ENDIF.
|
|
65558
65559
|
`,
|
|
65559
65560
|
};
|
|
65560
65561
|
}
|
|
@@ -65728,14 +65729,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65728
65729
|
title: "Max one method parameter definition per line",
|
|
65729
65730
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65730
65731
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65731
|
-
badExample: `
|
|
65732
|
-
METHODS apps_scope_token
|
|
65733
|
-
IMPORTING
|
|
65732
|
+
badExample: `
|
|
65733
|
+
METHODS apps_scope_token
|
|
65734
|
+
IMPORTING
|
|
65734
65735
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65735
|
-
goodExample: `
|
|
65736
|
-
METHODS apps_scope_token
|
|
65737
|
-
IMPORTING
|
|
65738
|
-
body TYPE bodyapps_scope_token
|
|
65736
|
+
goodExample: `
|
|
65737
|
+
METHODS apps_scope_token
|
|
65738
|
+
IMPORTING
|
|
65739
|
+
body TYPE bodyapps_scope_token
|
|
65739
65740
|
client_id TYPE str.`,
|
|
65740
65741
|
};
|
|
65741
65742
|
}
|
|
@@ -65800,11 +65801,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65800
65801
|
key: "max_one_statement",
|
|
65801
65802
|
title: "Max one statement per line",
|
|
65802
65803
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65803
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65804
|
-
|
|
65805
|
-
Does not report anything for chained statements.
|
|
65806
|
-
|
|
65807
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65804
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65805
|
+
|
|
65806
|
+
Does not report anything for chained statements.
|
|
65807
|
+
|
|
65808
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65808
65809
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65809
65810
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65810
65811
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66142,8 +66143,8 @@ class MethodLength {
|
|
|
66142
66143
|
key: "method_length",
|
|
66143
66144
|
title: "Method/Form Length",
|
|
66144
66145
|
shortDescription: `Checks relating to method/form length.`,
|
|
66145
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66146
|
-
|
|
66146
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66147
|
+
|
|
66147
66148
|
Abstract methods without statements are considered okay.`,
|
|
66148
66149
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66149
66150
|
};
|
|
@@ -66248,20 +66249,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66248
66249
|
key: "method_overwrites_builtin",
|
|
66249
66250
|
title: "Method name overwrites builtin function",
|
|
66250
66251
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66251
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66252
|
-
|
|
66253
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66254
|
-
|
|
66252
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66253
|
+
|
|
66254
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66255
|
+
|
|
66255
66256
|
Interface method names are ignored`,
|
|
66256
66257
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66257
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66258
|
-
PUBLIC SECTION.
|
|
66259
|
-
METHODS matches.
|
|
66260
|
-
ENDCLASS.
|
|
66261
|
-
|
|
66262
|
-
CLASS lcl IMPLEMENTATION.
|
|
66263
|
-
METHOD matches.
|
|
66264
|
-
ENDMETHOD.
|
|
66258
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66259
|
+
PUBLIC SECTION.
|
|
66260
|
+
METHODS matches.
|
|
66261
|
+
ENDCLASS.
|
|
66262
|
+
|
|
66263
|
+
CLASS lcl IMPLEMENTATION.
|
|
66264
|
+
METHOD matches.
|
|
66265
|
+
ENDMETHOD.
|
|
66265
66266
|
ENDCLASS.`,
|
|
66266
66267
|
};
|
|
66267
66268
|
}
|
|
@@ -66452,12 +66453,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66452
66453
|
// eslint-disable-next-line max-len
|
|
66453
66454
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66454
66455
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66455
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66456
|
-
PUBLIC SECTION.
|
|
66457
|
-
METHODS
|
|
66458
|
-
foobar
|
|
66459
|
-
EXPORTING foo TYPE i
|
|
66460
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66456
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66457
|
+
PUBLIC SECTION.
|
|
66458
|
+
METHODS
|
|
66459
|
+
foobar
|
|
66460
|
+
EXPORTING foo TYPE i
|
|
66461
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66461
66462
|
ENDCLASS.`,
|
|
66462
66463
|
};
|
|
66463
66464
|
}
|
|
@@ -66837,7 +66838,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66837
66838
|
key: "nesting",
|
|
66838
66839
|
title: "Check nesting depth",
|
|
66839
66840
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66840
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66841
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66841
66842
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66842
66843
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66843
66844
|
};
|
|
@@ -67080,7 +67081,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67080
67081
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67081
67082
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67082
67083
|
badExample: `var1 = var2 = var3.`,
|
|
67083
|
-
goodExample: `var2 = var3.
|
|
67084
|
+
goodExample: `var2 = var3.
|
|
67084
67085
|
var1 = var2.`,
|
|
67085
67086
|
};
|
|
67086
67087
|
}
|
|
@@ -67139,8 +67140,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67139
67140
|
key: "no_external_form_calls",
|
|
67140
67141
|
title: "No external FORM calls",
|
|
67141
67142
|
shortDescription: `Detect external form calls`,
|
|
67142
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67143
|
-
|
|
67143
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67144
|
+
|
|
67144
67145
|
PERFORM foo(bar).`,
|
|
67145
67146
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67146
67147
|
};
|
|
@@ -67201,17 +67202,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67201
67202
|
key: "no_inline_in_optional_branches",
|
|
67202
67203
|
title: "Don't declare inline in optional branches",
|
|
67203
67204
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67204
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67205
|
-
|
|
67206
|
-
Considered optional branches:
|
|
67207
|
-
* inside IF/ELSEIF/ELSE
|
|
67208
|
-
* inside LOOP
|
|
67209
|
-
* inside WHILE
|
|
67210
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67211
|
-
* inside DO
|
|
67212
|
-
* inside SELECT loops
|
|
67213
|
-
|
|
67214
|
-
Not considered optional branches:
|
|
67205
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67206
|
+
|
|
67207
|
+
Considered optional branches:
|
|
67208
|
+
* inside IF/ELSEIF/ELSE
|
|
67209
|
+
* inside LOOP
|
|
67210
|
+
* inside WHILE
|
|
67211
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67212
|
+
* inside DO
|
|
67213
|
+
* inside SELECT loops
|
|
67214
|
+
|
|
67215
|
+
Not considered optional branches:
|
|
67215
67216
|
* TRY/CATCH/CLEANUP`,
|
|
67216
67217
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67217
67218
|
};
|
|
@@ -67311,12 +67312,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67311
67312
|
key: "no_prefixes",
|
|
67312
67313
|
title: "No Prefixes",
|
|
67313
67314
|
shortDescription: `Dont use hungarian notation`,
|
|
67314
|
-
extendedInformation: `
|
|
67315
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67316
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67317
|
-
|
|
67318
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67319
|
-
|
|
67315
|
+
extendedInformation: `
|
|
67316
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67317
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67318
|
+
|
|
67319
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67320
|
+
|
|
67320
67321
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67321
67322
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67322
67323
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67495,7 +67496,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67495
67496
|
return {
|
|
67496
67497
|
key: "no_public_attributes",
|
|
67497
67498
|
title: "No public attributes",
|
|
67498
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67499
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67499
67500
|
Exceptions are excluded from this rule.`,
|
|
67500
67501
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67501
67502
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67596,13 +67597,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67596
67597
|
key: "no_yoda_conditions",
|
|
67597
67598
|
title: "No Yoda conditions",
|
|
67598
67599
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67599
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67600
|
-
|
|
67600
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67601
|
+
|
|
67601
67602
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67602
67603
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67603
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67604
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67604
67605
|
ENDIF.`,
|
|
67605
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67606
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67606
67607
|
ENDIF.`,
|
|
67607
67608
|
};
|
|
67608
67609
|
}
|
|
@@ -67703,8 +67704,8 @@ class NROBConsistency {
|
|
|
67703
67704
|
key: "nrob_consistency",
|
|
67704
67705
|
title: "Number range consistency",
|
|
67705
67706
|
shortDescription: `Consistency checks for number ranges`,
|
|
67706
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67707
|
-
|
|
67707
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67708
|
+
|
|
67708
67709
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67709
67710
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67710
67711
|
};
|
|
@@ -67981,58 +67982,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
67981
67982
|
title: "Obsolete statements",
|
|
67982
67983
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
67983
67984
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67984
|
-
extendedInformation: `
|
|
67985
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67986
|
-
|
|
67987
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67988
|
-
|
|
67989
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67990
|
-
|
|
67991
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67992
|
-
|
|
67993
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67994
|
-
|
|
67995
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67996
|
-
|
|
67997
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67998
|
-
|
|
67999
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68000
|
-
|
|
68001
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68002
|
-
|
|
68003
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68004
|
-
|
|
68005
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68006
|
-
|
|
68007
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68008
|
-
|
|
68009
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68010
|
-
|
|
68011
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68012
|
-
|
|
68013
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68014
|
-
SELECT COUNT(*) is considered okay
|
|
68015
|
-
|
|
68016
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68017
|
-
|
|
68018
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68019
|
-
|
|
68020
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68021
|
-
|
|
68022
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68023
|
-
|
|
68024
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68025
|
-
|
|
67985
|
+
extendedInformation: `
|
|
67986
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
67987
|
+
|
|
67988
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
67989
|
+
|
|
67990
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
67991
|
+
|
|
67992
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
67993
|
+
|
|
67994
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
67995
|
+
|
|
67996
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
67997
|
+
|
|
67998
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
67999
|
+
|
|
68000
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68001
|
+
|
|
68002
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68003
|
+
|
|
68004
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68005
|
+
|
|
68006
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68007
|
+
|
|
68008
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68009
|
+
|
|
68010
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68011
|
+
|
|
68012
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68013
|
+
|
|
68014
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68015
|
+
SELECT COUNT(*) is considered okay
|
|
68016
|
+
|
|
68017
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68018
|
+
|
|
68019
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68020
|
+
|
|
68021
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68022
|
+
|
|
68023
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68024
|
+
|
|
68025
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68026
|
+
|
|
68026
68027
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68027
|
-
badExample: `REFRESH itab.
|
|
68028
|
-
|
|
68029
|
-
COMPUTE foo = 2 + 2.
|
|
68030
|
-
|
|
68031
|
-
MULTIPLY lv_foo BY 2.
|
|
68032
|
-
|
|
68033
|
-
INTERFACE intf LOAD.
|
|
68034
|
-
|
|
68035
|
-
IF foo IS SUPPLIED.
|
|
68028
|
+
badExample: `REFRESH itab.
|
|
68029
|
+
|
|
68030
|
+
COMPUTE foo = 2 + 2.
|
|
68031
|
+
|
|
68032
|
+
MULTIPLY lv_foo BY 2.
|
|
68033
|
+
|
|
68034
|
+
INTERFACE intf LOAD.
|
|
68035
|
+
|
|
68036
|
+
IF foo IS SUPPLIED.
|
|
68036
68037
|
ENDIF.`,
|
|
68037
68038
|
};
|
|
68038
68039
|
}
|
|
@@ -68372,9 +68373,9 @@ class OmitParameterName {
|
|
|
68372
68373
|
key: "omit_parameter_name",
|
|
68373
68374
|
title: "Omit parameter name",
|
|
68374
68375
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68375
|
-
extendedInformation: `
|
|
68376
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68377
|
-
|
|
68376
|
+
extendedInformation: `
|
|
68377
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68378
|
+
|
|
68378
68379
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68379
68380
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68380
68381
|
badExample: `method( param = 2 ).`,
|
|
@@ -68580,20 +68581,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68580
68581
|
shortDescription: `Omit RECEIVING`,
|
|
68581
68582
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68582
68583
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68583
|
-
badExample: `
|
|
68584
|
-
upload_pack(
|
|
68585
|
-
EXPORTING
|
|
68586
|
-
io_client = lo_client
|
|
68587
|
-
iv_url = iv_url
|
|
68588
|
-
iv_deepen_level = iv_deepen_level
|
|
68589
|
-
it_hashes = lt_hashes
|
|
68590
|
-
RECEIVING
|
|
68584
|
+
badExample: `
|
|
68585
|
+
upload_pack(
|
|
68586
|
+
EXPORTING
|
|
68587
|
+
io_client = lo_client
|
|
68588
|
+
iv_url = iv_url
|
|
68589
|
+
iv_deepen_level = iv_deepen_level
|
|
68590
|
+
it_hashes = lt_hashes
|
|
68591
|
+
RECEIVING
|
|
68591
68592
|
rt_objects = et_objects ).`,
|
|
68592
|
-
goodExample: `
|
|
68593
|
-
et_objects = upload_pack(
|
|
68594
|
-
io_client = lo_client
|
|
68595
|
-
iv_url = iv_url
|
|
68596
|
-
iv_deepen_level = iv_deepen_level
|
|
68593
|
+
goodExample: `
|
|
68594
|
+
et_objects = upload_pack(
|
|
68595
|
+
io_client = lo_client
|
|
68596
|
+
iv_url = iv_url
|
|
68597
|
+
iv_deepen_level = iv_deepen_level
|
|
68597
68598
|
it_hashes = lt_hashes ).`,
|
|
68598
68599
|
};
|
|
68599
68600
|
}
|
|
@@ -68657,8 +68658,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68657
68658
|
return {
|
|
68658
68659
|
key: "parser_702_chaining",
|
|
68659
68660
|
title: "Parser Error, bad chanining on 702",
|
|
68660
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68661
|
-
this rule finds these and reports errors.
|
|
68661
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68662
|
+
this rule finds these and reports errors.
|
|
68662
68663
|
Only active on target version 702 and below.`,
|
|
68663
68664
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68664
68665
|
};
|
|
@@ -68738,8 +68739,8 @@ class ParserError {
|
|
|
68738
68739
|
return {
|
|
68739
68740
|
key: "parser_error",
|
|
68740
68741
|
title: "Parser error",
|
|
68741
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68742
|
-
|
|
68742
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68743
|
+
|
|
68743
68744
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68744
68745
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68745
68746
|
};
|
|
@@ -68824,7 +68825,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68824
68825
|
return {
|
|
68825
68826
|
key: "parser_missing_space",
|
|
68826
68827
|
title: "Parser Error, missing space",
|
|
68827
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68828
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68828
68829
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68829
68830
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68830
68831
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69236,25 +69237,25 @@ class PreferInline {
|
|
|
69236
69237
|
key: "prefer_inline",
|
|
69237
69238
|
title: "Prefer Inline Declarations",
|
|
69238
69239
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69239
|
-
extendedInformation: `EXPERIMENTAL
|
|
69240
|
-
|
|
69241
|
-
Activates if language version is v740sp02 or above.
|
|
69242
|
-
|
|
69243
|
-
Variables must be local(METHOD or FORM).
|
|
69244
|
-
|
|
69245
|
-
No generic or void typed variables. No syntax errors.
|
|
69246
|
-
|
|
69247
|
-
First position used must be a full/pure write.
|
|
69248
|
-
|
|
69249
|
-
Move statment is not a cast(?=)
|
|
69250
|
-
|
|
69240
|
+
extendedInformation: `EXPERIMENTAL
|
|
69241
|
+
|
|
69242
|
+
Activates if language version is v740sp02 or above.
|
|
69243
|
+
|
|
69244
|
+
Variables must be local(METHOD or FORM).
|
|
69245
|
+
|
|
69246
|
+
No generic or void typed variables. No syntax errors.
|
|
69247
|
+
|
|
69248
|
+
First position used must be a full/pure write.
|
|
69249
|
+
|
|
69250
|
+
Move statment is not a cast(?=)
|
|
69251
|
+
|
|
69251
69252
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69252
69253
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69253
|
-
badExample: `DATA foo TYPE i.
|
|
69254
|
-
foo = 2.
|
|
69255
|
-
DATA percentage TYPE decfloat34.
|
|
69254
|
+
badExample: `DATA foo TYPE i.
|
|
69255
|
+
foo = 2.
|
|
69256
|
+
DATA percentage TYPE decfloat34.
|
|
69256
69257
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69257
|
-
goodExample: `DATA(foo) = 2.
|
|
69258
|
+
goodExample: `DATA(foo) = 2.
|
|
69258
69259
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69259
69260
|
};
|
|
69260
69261
|
}
|
|
@@ -69468,18 +69469,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69468
69469
|
key: "prefer_is_not",
|
|
69469
69470
|
title: "Prefer IS NOT to NOT IS",
|
|
69470
69471
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69471
|
-
extendedInformation: `
|
|
69472
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69473
|
-
|
|
69472
|
+
extendedInformation: `
|
|
69473
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69474
|
+
|
|
69474
69475
|
"if not is_valid( )." examples are skipped`,
|
|
69475
69476
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69476
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69477
|
-
IF variable NP 'TODO*'.
|
|
69478
|
-
IF variable <> 42.
|
|
69477
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69478
|
+
IF variable NP 'TODO*'.
|
|
69479
|
+
IF variable <> 42.
|
|
69479
69480
|
IF variable CO 'hello'.`,
|
|
69480
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69481
|
-
IF NOT variable CP 'TODO*'.
|
|
69482
|
-
IF NOT variable = 42.
|
|
69481
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69482
|
+
IF NOT variable CP 'TODO*'.
|
|
69483
|
+
IF NOT variable = 42.
|
|
69483
69484
|
IF NOT variable CA 'hello'.`,
|
|
69484
69485
|
};
|
|
69485
69486
|
}
|
|
@@ -69667,14 +69668,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69667
69668
|
key: "prefer_raise_exception_new",
|
|
69668
69669
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69669
69670
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69670
|
-
extendedInformation: `
|
|
69671
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69672
|
-
|
|
69671
|
+
extendedInformation: `
|
|
69672
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69673
|
+
|
|
69673
69674
|
From 752 and up`,
|
|
69674
69675
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69675
69676
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69676
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69677
|
-
EXPORTING
|
|
69677
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69678
|
+
EXPORTING
|
|
69678
69679
|
previous = exception.`,
|
|
69679
69680
|
};
|
|
69680
69681
|
}
|
|
@@ -69752,12 +69753,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69752
69753
|
key: "prefer_returning_to_exporting",
|
|
69753
69754
|
title: "Prefer RETURNING to EXPORTING",
|
|
69754
69755
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69755
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69756
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69756
69757
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69757
69758
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69758
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69759
|
-
PUBLIC SECTION.
|
|
69760
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69759
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69760
|
+
PUBLIC SECTION.
|
|
69761
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69761
69762
|
ENDCLASS.`,
|
|
69762
69763
|
};
|
|
69763
69764
|
}
|
|
@@ -69853,8 +69854,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69853
69854
|
key: "prefer_xsdbool",
|
|
69854
69855
|
title: "Prefer xsdbool over boolc",
|
|
69855
69856
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69856
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69857
|
-
|
|
69857
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69858
|
+
|
|
69858
69859
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69859
69860
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69860
69861
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -69926,9 +69927,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
69926
69927
|
title: "Preferred compare operator",
|
|
69927
69928
|
shortDescription: `Configure undesired operator variants`,
|
|
69928
69929
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
69929
|
-
badExample: `IF foo EQ bar.
|
|
69930
|
+
badExample: `IF foo EQ bar.
|
|
69930
69931
|
ENDIF.`,
|
|
69931
|
-
goodExample: `IF foo = bar.
|
|
69932
|
+
goodExample: `IF foo = bar.
|
|
69932
69933
|
ENDIF.`,
|
|
69933
69934
|
};
|
|
69934
69935
|
}
|
|
@@ -70152,26 +70153,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70152
70153
|
key: "reduce_procedural_code",
|
|
70153
70154
|
title: "Reduce procedural code",
|
|
70154
70155
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70155
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70156
|
-
|
|
70157
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70158
|
-
|
|
70156
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70157
|
+
|
|
70158
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70159
|
+
|
|
70159
70160
|
Comments are not counted as statements.`,
|
|
70160
70161
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70161
|
-
badExample: `FORM foo.
|
|
70162
|
-
DATA lv_bar TYPE i.
|
|
70163
|
-
lv_bar = 2 + 2.
|
|
70164
|
-
IF lv_bar = 4.
|
|
70165
|
-
WRITE 'hello world'.
|
|
70166
|
-
ENDIF.
|
|
70167
|
-
DATA lv_bar TYPE i.
|
|
70168
|
-
lv_bar = 2 + 2.
|
|
70169
|
-
IF lv_bar = 4.
|
|
70170
|
-
WRITE 'hello world'.
|
|
70171
|
-
ENDIF.
|
|
70162
|
+
badExample: `FORM foo.
|
|
70163
|
+
DATA lv_bar TYPE i.
|
|
70164
|
+
lv_bar = 2 + 2.
|
|
70165
|
+
IF lv_bar = 4.
|
|
70166
|
+
WRITE 'hello world'.
|
|
70167
|
+
ENDIF.
|
|
70168
|
+
DATA lv_bar TYPE i.
|
|
70169
|
+
lv_bar = 2 + 2.
|
|
70170
|
+
IF lv_bar = 4.
|
|
70171
|
+
WRITE 'hello world'.
|
|
70172
|
+
ENDIF.
|
|
70172
70173
|
ENDFORM.`,
|
|
70173
|
-
goodExample: `FORM foo.
|
|
70174
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70174
|
+
goodExample: `FORM foo.
|
|
70175
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70175
70176
|
ENDFORM.`,
|
|
70176
70177
|
};
|
|
70177
70178
|
}
|
|
@@ -70415,10 +70416,10 @@ class RemoveDescriptions {
|
|
|
70415
70416
|
return {
|
|
70416
70417
|
key: "remove_descriptions",
|
|
70417
70418
|
title: "Remove descriptions",
|
|
70418
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70419
|
-
|
|
70420
|
-
Class descriptions are required, see rule description_empty.
|
|
70421
|
-
|
|
70419
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70420
|
+
|
|
70421
|
+
Class descriptions are required, see rule description_empty.
|
|
70422
|
+
|
|
70422
70423
|
Consider using ABAP Doc for documentation.`,
|
|
70423
70424
|
tags: [],
|
|
70424
70425
|
};
|
|
@@ -70543,14 +70544,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70543
70544
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70544
70545
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70545
70546
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70546
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70547
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70547
70548
|
DESTINATION lv_rfc.`,
|
|
70548
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70549
|
-
DESTINATION lv_rfc
|
|
70550
|
-
EXCEPTIONS
|
|
70551
|
-
system_failure = 1 MESSAGE msg
|
|
70552
|
-
communication_failure = 2 MESSAGE msg
|
|
70553
|
-
resource_failure = 3
|
|
70549
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70550
|
+
DESTINATION lv_rfc
|
|
70551
|
+
EXCEPTIONS
|
|
70552
|
+
system_failure = 1 MESSAGE msg
|
|
70553
|
+
communication_failure = 2 MESSAGE msg
|
|
70554
|
+
resource_failure = 3
|
|
70554
70555
|
OTHERS = 4.`,
|
|
70555
70556
|
};
|
|
70556
70557
|
}
|
|
@@ -70634,11 +70635,11 @@ class SelectAddOrderBy {
|
|
|
70634
70635
|
key: "select_add_order_by",
|
|
70635
70636
|
title: "SELECT add ORDER BY",
|
|
70636
70637
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70637
|
-
extendedInformation: `
|
|
70638
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70639
|
-
|
|
70640
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70641
|
-
|
|
70638
|
+
extendedInformation: `
|
|
70639
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70640
|
+
|
|
70641
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70642
|
+
|
|
70642
70643
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70643
70644
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70644
70645
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70769,14 +70770,14 @@ class SelectPerformance {
|
|
|
70769
70770
|
key: "select_performance",
|
|
70770
70771
|
title: "SELECT performance",
|
|
70771
70772
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70772
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70773
|
-
|
|
70773
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70774
|
+
|
|
70774
70775
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70775
70776
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70776
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70777
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70777
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70778
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70778
70779
|
ENDSELECT.`,
|
|
70779
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70780
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70780
70781
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70781
70782
|
};
|
|
70782
70783
|
}
|
|
@@ -70890,8 +70891,8 @@ class SelectSingleFullKey {
|
|
|
70890
70891
|
key: "select_single_full_key",
|
|
70891
70892
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
70892
70893
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
70893
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70894
|
-
|
|
70894
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
70895
|
+
|
|
70895
70896
|
If the statement contains a JOIN it is not checked`,
|
|
70896
70897
|
pseudoComment: "EC CI_NOORDER",
|
|
70897
70898
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71315,8 +71316,8 @@ class SICFConsistency {
|
|
|
71315
71316
|
key: "sicf_consistency",
|
|
71316
71317
|
title: "SICF consistency",
|
|
71317
71318
|
shortDescription: `Checks the validity of ICF services`,
|
|
71318
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71319
|
-
* Class must not have any syntax errors
|
|
71319
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71320
|
+
* Class must not have any syntax errors
|
|
71320
71321
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71321
71322
|
};
|
|
71322
71323
|
}
|
|
@@ -71428,23 +71429,23 @@ class SlowParameterPassing {
|
|
|
71428
71429
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71429
71430
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71430
71431
|
tags: [_irule_1.RuleTag.Performance],
|
|
71431
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71432
|
-
PUBLIC SECTION.
|
|
71433
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71434
|
-
ENDCLASS.
|
|
71435
|
-
CLASS lcl IMPLEMENTATION.
|
|
71436
|
-
METHOD bar.
|
|
71437
|
-
WRITE sdf.
|
|
71438
|
-
ENDMETHOD.
|
|
71432
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71433
|
+
PUBLIC SECTION.
|
|
71434
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71435
|
+
ENDCLASS.
|
|
71436
|
+
CLASS lcl IMPLEMENTATION.
|
|
71437
|
+
METHOD bar.
|
|
71438
|
+
WRITE sdf.
|
|
71439
|
+
ENDMETHOD.
|
|
71439
71440
|
ENDCLASS.`,
|
|
71440
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71441
|
-
PUBLIC SECTION.
|
|
71442
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71443
|
-
ENDCLASS.
|
|
71444
|
-
CLASS lcl IMPLEMENTATION.
|
|
71445
|
-
METHOD bar.
|
|
71446
|
-
WRITE sdf.
|
|
71447
|
-
ENDMETHOD.
|
|
71441
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71442
|
+
PUBLIC SECTION.
|
|
71443
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71444
|
+
ENDCLASS.
|
|
71445
|
+
CLASS lcl IMPLEMENTATION.
|
|
71446
|
+
METHOD bar.
|
|
71447
|
+
WRITE sdf.
|
|
71448
|
+
ENDMETHOD.
|
|
71448
71449
|
ENDCLASS.`,
|
|
71449
71450
|
};
|
|
71450
71451
|
}
|
|
@@ -71701,8 +71702,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71701
71702
|
key: "space_before_dot",
|
|
71702
71703
|
title: "Space before dot",
|
|
71703
71704
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71704
|
-
extendedInformation: `
|
|
71705
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71705
|
+
extendedInformation: `
|
|
71706
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71706
71707
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71707
71708
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71708
71709
|
badExample: `WRITE bar .`,
|
|
@@ -71888,12 +71889,12 @@ class SQLValueConversion {
|
|
|
71888
71889
|
key: "sql_value_conversion",
|
|
71889
71890
|
title: "Implicit SQL Value Conversion",
|
|
71890
71891
|
shortDescription: `Ensure types match when selecting from database`,
|
|
71891
|
-
extendedInformation: `
|
|
71892
|
-
* Integer to CHAR conversion
|
|
71893
|
-
* Integer to NUMC conversion
|
|
71894
|
-
* NUMC to Integer conversion
|
|
71895
|
-
* CHAR to Integer conversion
|
|
71896
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
71892
|
+
extendedInformation: `
|
|
71893
|
+
* Integer to CHAR conversion
|
|
71894
|
+
* Integer to NUMC conversion
|
|
71895
|
+
* NUMC to Integer conversion
|
|
71896
|
+
* CHAR to Integer conversion
|
|
71897
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
71897
71898
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
71898
71899
|
tags: [],
|
|
71899
71900
|
};
|
|
@@ -71965,7 +71966,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
71965
71966
|
key: "start_at_tab",
|
|
71966
71967
|
title: "Start at tab",
|
|
71967
71968
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
71968
|
-
extendedInformation: `Reports max 100 issues per file
|
|
71969
|
+
extendedInformation: `Reports max 100 issues per file
|
|
71969
71970
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
71970
71971
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71971
71972
|
badExample: ` WRITE a.`,
|
|
@@ -72142,12 +72143,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72142
72143
|
key: "strict_sql",
|
|
72143
72144
|
title: "Strict SQL",
|
|
72144
72145
|
shortDescription: `Strict SQL`,
|
|
72145
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72146
|
-
|
|
72147
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72148
|
-
|
|
72149
|
-
Also see separate rule sql_escape_host_variables
|
|
72150
|
-
|
|
72146
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72147
|
+
|
|
72148
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72149
|
+
|
|
72150
|
+
Also see separate rule sql_escape_host_variables
|
|
72151
|
+
|
|
72151
72152
|
Activates from v750 and up`,
|
|
72152
72153
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72153
72154
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72401,11 +72402,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72401
72402
|
key: "sy_modification",
|
|
72402
72403
|
title: "Modification of SY fields",
|
|
72403
72404
|
shortDescription: `Finds modification of sy fields`,
|
|
72404
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72405
|
-
|
|
72405
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72406
|
+
|
|
72406
72407
|
Changes to SY-TVAR* fields are not reported`,
|
|
72407
72408
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72408
|
-
badExample: `sy-uname = 2.
|
|
72409
|
+
badExample: `sy-uname = 2.
|
|
72409
72410
|
sy = sy.`,
|
|
72410
72411
|
};
|
|
72411
72412
|
}
|
|
@@ -72467,8 +72468,8 @@ class TABLEnhancementCategory {
|
|
|
72467
72468
|
key: "tabl_enhancement_category",
|
|
72468
72469
|
title: "TABL enhancement category must be set",
|
|
72469
72470
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72470
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72471
|
-
|
|
72471
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72472
|
+
|
|
72472
72473
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72473
72474
|
tags: [],
|
|
72474
72475
|
};
|
|
@@ -72533,8 +72534,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72533
72534
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72534
72535
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72535
72536
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72536
|
-
badExample: `FORM foo.
|
|
72537
|
-
TABLES t100.
|
|
72537
|
+
badExample: `FORM foo.
|
|
72538
|
+
TABLES t100.
|
|
72538
72539
|
ENDFORM.`,
|
|
72539
72540
|
goodExample: `TABLES t000.`,
|
|
72540
72541
|
};
|
|
@@ -72662,9 +72663,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72662
72663
|
title: "Type FORM parameters",
|
|
72663
72664
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72664
72665
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72665
|
-
badExample: `FORM foo USING bar.
|
|
72666
|
+
badExample: `FORM foo USING bar.
|
|
72666
72667
|
ENDFORM.`,
|
|
72667
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72668
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72668
72669
|
ENDFORM.`,
|
|
72669
72670
|
};
|
|
72670
72671
|
}
|
|
@@ -73337,38 +73338,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73337
73338
|
key: "unnecessary_pragma",
|
|
73338
73339
|
title: "Unnecessary Pragma",
|
|
73339
73340
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73340
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73341
|
-
|
|
73342
|
-
* NEEDED without definition
|
|
73343
|
-
|
|
73344
|
-
* NO_TEXT without texts
|
|
73345
|
-
|
|
73346
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73347
|
-
|
|
73341
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73342
|
+
|
|
73343
|
+
* NEEDED without definition
|
|
73344
|
+
|
|
73345
|
+
* NO_TEXT without texts
|
|
73346
|
+
|
|
73347
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73348
|
+
|
|
73348
73349
|
NO_HANDLER inside macros are not checked`,
|
|
73349
73350
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73350
|
-
badExample: `TRY.
|
|
73351
|
-
...
|
|
73352
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73353
|
-
RETURN. " it has a handler
|
|
73354
|
-
ENDTRY.
|
|
73355
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73356
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73357
|
-
IF sy-subrc <> 0.
|
|
73351
|
+
badExample: `TRY.
|
|
73352
|
+
...
|
|
73353
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73354
|
+
RETURN. " it has a handler
|
|
73355
|
+
ENDTRY.
|
|
73356
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73357
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73358
|
+
IF sy-subrc <> 0.
|
|
73358
73359
|
ENDIF.`,
|
|
73359
|
-
goodExample: `TRY.
|
|
73360
|
-
...
|
|
73361
|
-
CATCH zcx_abapgit_exception.
|
|
73362
|
-
RETURN.
|
|
73363
|
-
ENDTRY.
|
|
73364
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73365
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73366
|
-
IF sy-subrc <> 0.
|
|
73367
|
-
ENDIF.
|
|
73368
|
-
|
|
73369
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73370
|
-
test1 TYPE string,
|
|
73371
|
-
test2 TYPE string,
|
|
73360
|
+
goodExample: `TRY.
|
|
73361
|
+
...
|
|
73362
|
+
CATCH zcx_abapgit_exception.
|
|
73363
|
+
RETURN.
|
|
73364
|
+
ENDTRY.
|
|
73365
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73366
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73367
|
+
IF sy-subrc <> 0.
|
|
73368
|
+
ENDIF.
|
|
73369
|
+
|
|
73370
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73371
|
+
test1 TYPE string,
|
|
73372
|
+
test2 TYPE string,
|
|
73372
73373
|
END OF blah.`,
|
|
73373
73374
|
};
|
|
73374
73375
|
}
|
|
@@ -73535,18 +73536,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73535
73536
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73536
73537
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73537
73538
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73538
|
-
badExample: `FORM hello1.
|
|
73539
|
-
WRITE 'world'.
|
|
73540
|
-
RETURN.
|
|
73541
|
-
ENDFORM.
|
|
73542
|
-
|
|
73543
|
-
FORM foo.
|
|
73544
|
-
IF 1 = 2.
|
|
73545
|
-
RETURN.
|
|
73546
|
-
ENDIF.
|
|
73539
|
+
badExample: `FORM hello1.
|
|
73540
|
+
WRITE 'world'.
|
|
73541
|
+
RETURN.
|
|
73542
|
+
ENDFORM.
|
|
73543
|
+
|
|
73544
|
+
FORM foo.
|
|
73545
|
+
IF 1 = 2.
|
|
73546
|
+
RETURN.
|
|
73547
|
+
ENDIF.
|
|
73547
73548
|
ENDFORM.`,
|
|
73548
|
-
goodExample: `FORM hello2.
|
|
73549
|
-
WRITE 'world'.
|
|
73549
|
+
goodExample: `FORM hello2.
|
|
73550
|
+
WRITE 'world'.
|
|
73550
73551
|
ENDFORM.`,
|
|
73551
73552
|
};
|
|
73552
73553
|
}
|
|
@@ -73897,13 +73898,13 @@ class UnusedMacros {
|
|
|
73897
73898
|
title: "Unused macros",
|
|
73898
73899
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
73899
73900
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73900
|
-
badExample: `DEFINE foobar1.
|
|
73901
|
-
WRITE 'hello'.
|
|
73901
|
+
badExample: `DEFINE foobar1.
|
|
73902
|
+
WRITE 'hello'.
|
|
73902
73903
|
END-OF-DEFINITION.`,
|
|
73903
|
-
goodExample: `DEFINE foobar2.
|
|
73904
|
-
WRITE 'hello'.
|
|
73905
|
-
END-OF-DEFINITION.
|
|
73906
|
-
|
|
73904
|
+
goodExample: `DEFINE foobar2.
|
|
73905
|
+
WRITE 'hello'.
|
|
73906
|
+
END-OF-DEFINITION.
|
|
73907
|
+
|
|
73907
73908
|
foobar2.`,
|
|
73908
73909
|
};
|
|
73909
73910
|
}
|
|
@@ -74015,18 +74016,18 @@ class UnusedMethods {
|
|
|
74015
74016
|
key: "unused_methods",
|
|
74016
74017
|
title: "Unused methods",
|
|
74017
74018
|
shortDescription: `Checks for unused methods`,
|
|
74018
|
-
extendedInformation: `Checks private and protected methods.
|
|
74019
|
-
|
|
74020
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74021
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74022
|
-
|
|
74023
|
-
Skips:
|
|
74024
|
-
* methods FOR TESTING
|
|
74025
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74026
|
-
* class_constructor + constructor methods
|
|
74027
|
-
* event handlers
|
|
74028
|
-
* methods that are redefined
|
|
74029
|
-
* INCLUDEs
|
|
74019
|
+
extendedInformation: `Checks private and protected methods.
|
|
74020
|
+
|
|
74021
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74022
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74023
|
+
|
|
74024
|
+
Skips:
|
|
74025
|
+
* methods FOR TESTING
|
|
74026
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74027
|
+
* class_constructor + constructor methods
|
|
74028
|
+
* event handlers
|
|
74029
|
+
* methods that are redefined
|
|
74030
|
+
* INCLUDEs
|
|
74030
74031
|
`,
|
|
74031
74032
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74032
74033
|
pragma: "##CALLED",
|
|
@@ -74502,23 +74503,23 @@ class UnusedVariables {
|
|
|
74502
74503
|
key: "unused_variables",
|
|
74503
74504
|
title: "Unused variables",
|
|
74504
74505
|
shortDescription: `Checks for unused variables and constants`,
|
|
74505
|
-
extendedInformation: `Skips event parameters.
|
|
74506
|
-
|
|
74507
|
-
Note that this currently does not work if the source code uses macros.
|
|
74508
|
-
|
|
74509
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74510
|
-
|
|
74506
|
+
extendedInformation: `Skips event parameters.
|
|
74507
|
+
|
|
74508
|
+
Note that this currently does not work if the source code uses macros.
|
|
74509
|
+
|
|
74510
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74511
|
+
|
|
74511
74512
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74512
74513
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74513
74514
|
pragma: "##NEEDED",
|
|
74514
74515
|
pseudoComment: "EC NEEDED",
|
|
74515
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74516
|
-
test TYPE string,
|
|
74517
|
-
test2 TYPE string,
|
|
74516
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74517
|
+
test TYPE string,
|
|
74518
|
+
test2 TYPE string,
|
|
74518
74519
|
END OF blah1.`,
|
|
74519
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74520
|
-
test TYPE string,
|
|
74521
|
-
test2 TYPE string,
|
|
74520
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74521
|
+
test TYPE string,
|
|
74522
|
+
test2 TYPE string,
|
|
74522
74523
|
END OF blah2.`,
|
|
74523
74524
|
};
|
|
74524
74525
|
}
|
|
@@ -74737,15 +74738,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74737
74738
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74738
74739
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74739
74740
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74740
|
-
badExample: `IF line IS INITIAL.
|
|
74741
|
-
has_entries = abap_false.
|
|
74742
|
-
ELSE.
|
|
74743
|
-
has_entries = abap_true.
|
|
74744
|
-
ENDIF.
|
|
74745
|
-
|
|
74741
|
+
badExample: `IF line IS INITIAL.
|
|
74742
|
+
has_entries = abap_false.
|
|
74743
|
+
ELSE.
|
|
74744
|
+
has_entries = abap_true.
|
|
74745
|
+
ENDIF.
|
|
74746
|
+
|
|
74746
74747
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74747
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74748
|
-
|
|
74748
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74749
|
+
|
|
74749
74750
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74750
74751
|
};
|
|
74751
74752
|
}
|
|
@@ -74863,15 +74864,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74863
74864
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74864
74865
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74865
74866
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74866
|
-
badExample: `INTERFACE lif.
|
|
74867
|
-
METHODS load_data
|
|
74868
|
-
EXCEPTIONS
|
|
74869
|
-
invalid_parameter.
|
|
74867
|
+
badExample: `INTERFACE lif.
|
|
74868
|
+
METHODS load_data
|
|
74869
|
+
EXCEPTIONS
|
|
74870
|
+
invalid_parameter.
|
|
74870
74871
|
ENDINTERFACE.`,
|
|
74871
|
-
goodExample: `INTERFACE lif.
|
|
74872
|
-
METHODS load_data
|
|
74873
|
-
RAISING
|
|
74874
|
-
cx_something.
|
|
74872
|
+
goodExample: `INTERFACE lif.
|
|
74873
|
+
METHODS load_data
|
|
74874
|
+
RAISING
|
|
74875
|
+
cx_something.
|
|
74875
74876
|
ENDINTERFACE.`,
|
|
74876
74877
|
};
|
|
74877
74878
|
}
|
|
@@ -74931,15 +74932,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
74931
74932
|
key: "use_line_exists",
|
|
74932
74933
|
title: "Use line_exists",
|
|
74933
74934
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
74934
|
-
extendedInformation: `
|
|
74935
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74936
|
-
|
|
74935
|
+
extendedInformation: `
|
|
74936
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
74937
|
+
|
|
74937
74938
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
74938
74939
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74939
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74940
|
-
IF sy-subrc = 0.
|
|
74940
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
74941
|
+
IF sy-subrc = 0.
|
|
74941
74942
|
ENDIF.`,
|
|
74942
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74943
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
74943
74944
|
ENDIF.`,
|
|
74944
74945
|
};
|
|
74945
74946
|
}
|
|
@@ -75049,10 +75050,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75049
75050
|
key: "use_new",
|
|
75050
75051
|
title: "Use NEW",
|
|
75051
75052
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75052
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75053
|
-
|
|
75054
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75055
|
-
|
|
75053
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75054
|
+
|
|
75055
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75056
|
+
|
|
75056
75057
|
Applicable from v740sp02 and up`,
|
|
75057
75058
|
badExample: `CREATE OBJECT ref.`,
|
|
75058
75059
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75150,13 +75151,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75150
75151
|
title: "WHEN OTHERS last",
|
|
75151
75152
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75152
75153
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75153
|
-
badExample: `CASE bar.
|
|
75154
|
-
WHEN OTHERS.
|
|
75155
|
-
WHEN 2.
|
|
75154
|
+
badExample: `CASE bar.
|
|
75155
|
+
WHEN OTHERS.
|
|
75156
|
+
WHEN 2.
|
|
75156
75157
|
ENDCASE.`,
|
|
75157
|
-
goodExample: `CASE bar.
|
|
75158
|
-
WHEN 2.
|
|
75159
|
-
WHEN OTHERS.
|
|
75158
|
+
goodExample: `CASE bar.
|
|
75159
|
+
WHEN 2.
|
|
75160
|
+
WHEN OTHERS.
|
|
75160
75161
|
ENDCASE.`,
|
|
75161
75162
|
};
|
|
75162
75163
|
}
|