@abaplint/cli 2.105.17 → 2.105.18
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 +730 -697
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -21373,11 +21373,11 @@ class CurrentScope {
|
|
|
21373
21373
|
}
|
|
21374
21374
|
this.addNamedIdentifier(identifier.getName(), identifier);
|
|
21375
21375
|
}
|
|
21376
|
-
addDeferred(token) {
|
|
21376
|
+
addDeferred(token, type) {
|
|
21377
21377
|
if (token === undefined) {
|
|
21378
21378
|
return;
|
|
21379
21379
|
}
|
|
21380
|
-
this.current.getData().deferred[token.getStr().toUpperCase()] = token;
|
|
21380
|
+
this.current.getData().deferred[token.getStr().toUpperCase()] = { token, ooType: type };
|
|
21381
21381
|
}
|
|
21382
21382
|
addListPrefix(identifiers, prefix) {
|
|
21383
21383
|
for (const id of identifiers) {
|
|
@@ -21482,7 +21482,16 @@ class CurrentScope {
|
|
|
21482
21482
|
}
|
|
21483
21483
|
const def = (_c = this.current) === null || _c === void 0 ? void 0 : _c.findDeferred(name);
|
|
21484
21484
|
if (def !== undefined) {
|
|
21485
|
-
|
|
21485
|
+
let rttiName = prefixRTTI;
|
|
21486
|
+
switch (def.ooType) {
|
|
21487
|
+
case "INTF":
|
|
21488
|
+
rttiName = rttiName + "\\INTERFACE=" + name;
|
|
21489
|
+
break;
|
|
21490
|
+
default:
|
|
21491
|
+
rttiName = rttiName + "\\CLASS=" + name;
|
|
21492
|
+
break;
|
|
21493
|
+
}
|
|
21494
|
+
return { id: def.id, ooType: def.ooType, RTTIName: rttiName };
|
|
21486
21495
|
}
|
|
21487
21496
|
return undefined;
|
|
21488
21497
|
}
|
|
@@ -21512,6 +21521,11 @@ class CurrentScope {
|
|
|
21512
21521
|
if (typePoolName.length <= 1 || typePoolName.length > 5) {
|
|
21513
21522
|
return undefined;
|
|
21514
21523
|
}
|
|
21524
|
+
if (this.parentObj.getType() === "TYPE"
|
|
21525
|
+
&& this.parentObj.getName().toUpperCase() === typePoolName.toUpperCase()) {
|
|
21526
|
+
// dont recurse into itself
|
|
21527
|
+
return undefined;
|
|
21528
|
+
}
|
|
21515
21529
|
const typePool = this.reg.getObject("TYPE", typePoolName);
|
|
21516
21530
|
if (typePool === undefined) {
|
|
21517
21531
|
return undefined;
|
|
@@ -21529,6 +21543,11 @@ class CurrentScope {
|
|
|
21529
21543
|
if (typePoolName.length <= 2 || typePoolName.length > 5) {
|
|
21530
21544
|
return undefined;
|
|
21531
21545
|
}
|
|
21546
|
+
if (this.parentObj.getType() === "TYPE"
|
|
21547
|
+
&& this.parentObj.getName().toUpperCase() === typePoolName.toUpperCase()) {
|
|
21548
|
+
// dont recurse into itself
|
|
21549
|
+
return undefined;
|
|
21550
|
+
}
|
|
21532
21551
|
if (new ddic_1.DDIC(this.reg).lookupNoVoid(name) !== undefined) {
|
|
21533
21552
|
// this is tricky, it should not do recursion when parsing the type pool itself,
|
|
21534
21553
|
// think about DTEL ABAP_ENCOD vs TYPE ABAP
|
|
@@ -26743,6 +26762,11 @@ class Source {
|
|
|
26743
26762
|
else {
|
|
26744
26763
|
this.addIfInferred(node, scope, filename, foundType);
|
|
26745
26764
|
}
|
|
26765
|
+
children.shift();
|
|
26766
|
+
children.shift();
|
|
26767
|
+
children.shift();
|
|
26768
|
+
children.shift();
|
|
26769
|
+
this.traverseRemainingChildren(children, scope, filename);
|
|
26746
26770
|
return foundType ? foundType : bodyType;
|
|
26747
26771
|
}
|
|
26748
26772
|
case "CONV":
|
|
@@ -26859,6 +26883,12 @@ class Source {
|
|
|
26859
26883
|
return context;
|
|
26860
26884
|
}
|
|
26861
26885
|
////////////////////////////////
|
|
26886
|
+
traverseRemainingChildren(children, scope, filename) {
|
|
26887
|
+
const last = children[children.length - 1];
|
|
26888
|
+
if (last && last.get() instanceof Expressions.Source) {
|
|
26889
|
+
new Source().runSyntax(last, scope, filename);
|
|
26890
|
+
}
|
|
26891
|
+
}
|
|
26862
26892
|
infer(context, found) {
|
|
26863
26893
|
if (context instanceof basic_1.FloatType && found instanceof basic_1.IntegerType) {
|
|
26864
26894
|
return context;
|
|
@@ -27880,7 +27910,10 @@ class SpaghettiScopeNode extends ScopeData {
|
|
|
27880
27910
|
while (search !== undefined) {
|
|
27881
27911
|
const found = search.getData().deferred[name.toUpperCase()];
|
|
27882
27912
|
if (found) {
|
|
27883
|
-
return
|
|
27913
|
+
return {
|
|
27914
|
+
id: new _identifier_1.Identifier(found.token, search.identifier.filename),
|
|
27915
|
+
ooType: found.ooType,
|
|
27916
|
+
};
|
|
27884
27917
|
}
|
|
27885
27918
|
search = search.getParent();
|
|
27886
27919
|
}
|
|
@@ -28781,7 +28814,7 @@ class ClassDeferred {
|
|
|
28781
28814
|
runSyntax(node, scope, _filename) {
|
|
28782
28815
|
var _a;
|
|
28783
28816
|
const name = (_a = node.findFirstExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
28784
|
-
scope.addDeferred(name);
|
|
28817
|
+
scope.addDeferred(name, "CLAS");
|
|
28785
28818
|
}
|
|
28786
28819
|
}
|
|
28787
28820
|
exports.ClassDeferred = ClassDeferred;
|
|
@@ -30591,7 +30624,7 @@ class InterfaceDeferred {
|
|
|
30591
30624
|
runSyntax(node, scope, _filename) {
|
|
30592
30625
|
var _a;
|
|
30593
30626
|
const name = (_a = node.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
30594
|
-
scope.addDeferred(name);
|
|
30627
|
+
scope.addDeferred(name, "INTF");
|
|
30595
30628
|
}
|
|
30596
30629
|
}
|
|
30597
30630
|
exports.InterfaceDeferred = InterfaceDeferred;
|
|
@@ -34169,13 +34202,13 @@ class FlowGraph {
|
|
|
34169
34202
|
this.label = label;
|
|
34170
34203
|
}
|
|
34171
34204
|
toDigraph() {
|
|
34172
|
-
return `digraph G {
|
|
34173
|
-
labelloc="t";
|
|
34174
|
-
label="${this.label}";
|
|
34175
|
-
graph [fontname = "helvetica"];
|
|
34176
|
-
node [fontname = "helvetica", shape="box"];
|
|
34177
|
-
edge [fontname = "helvetica"];
|
|
34178
|
-
${this.toTextEdges()}
|
|
34205
|
+
return `digraph G {
|
|
34206
|
+
labelloc="t";
|
|
34207
|
+
label="${this.label}";
|
|
34208
|
+
graph [fontname = "helvetica"];
|
|
34209
|
+
node [fontname = "helvetica", shape="box"];
|
|
34210
|
+
edge [fontname = "helvetica"];
|
|
34211
|
+
${this.toTextEdges()}
|
|
34179
34212
|
}`;
|
|
34180
34213
|
}
|
|
34181
34214
|
listSources(node) {
|
|
@@ -42213,13 +42246,13 @@ class Help {
|
|
|
42213
42246
|
/////////////////////////////////////////////////
|
|
42214
42247
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42215
42248
|
let content = "";
|
|
42216
|
-
content = `
|
|
42217
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42218
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42219
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42220
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42221
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42222
|
-
<hr>
|
|
42249
|
+
content = `
|
|
42250
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42251
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42252
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42253
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42254
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42255
|
+
<hr>
|
|
42223
42256
|
` +
|
|
42224
42257
|
"<tt>" + textDocument.uri + " (" +
|
|
42225
42258
|
(position.line + 1) + ", " +
|
|
@@ -51216,7 +51249,7 @@ class Registry {
|
|
|
51216
51249
|
}
|
|
51217
51250
|
static abaplintVersion() {
|
|
51218
51251
|
// magic, see build script "version.sh"
|
|
51219
|
-
return "2.105.
|
|
51252
|
+
return "2.105.18";
|
|
51220
51253
|
}
|
|
51221
51254
|
getDDICReferences() {
|
|
51222
51255
|
return this.ddicReferences;
|
|
@@ -51532,10 +51565,10 @@ class SevenBitAscii {
|
|
|
51532
51565
|
key: "7bit_ascii",
|
|
51533
51566
|
title: "Check for 7bit ascii",
|
|
51534
51567
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
51535
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51536
|
-
|
|
51537
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51538
|
-
|
|
51568
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51569
|
+
|
|
51570
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51571
|
+
|
|
51539
51572
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
51540
51573
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
51541
51574
|
};
|
|
@@ -51739,10 +51772,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
51739
51772
|
key: "abapdoc",
|
|
51740
51773
|
title: "Check abapdoc",
|
|
51741
51774
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
51742
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
51743
|
-
|
|
51744
|
-
Plus class and interface definitions.
|
|
51745
|
-
|
|
51775
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
51776
|
+
|
|
51777
|
+
Plus class and interface definitions.
|
|
51778
|
+
|
|
51746
51779
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
51747
51780
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
51748
51781
|
};
|
|
@@ -51880,49 +51913,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
51880
51913
|
key: "align_parameters",
|
|
51881
51914
|
title: "Align Parameters",
|
|
51882
51915
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
51883
|
-
extendedInformation: `Checks:
|
|
51884
|
-
* function module calls
|
|
51885
|
-
* method calls
|
|
51886
|
-
* VALUE constructors
|
|
51887
|
-
* NEW constructors
|
|
51888
|
-
* RAISE EXCEPTION statements
|
|
51889
|
-
* CREATE OBJECT statements
|
|
51890
|
-
* RAISE EVENT statements
|
|
51891
|
-
|
|
51892
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
51893
|
-
|
|
51894
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
51895
|
-
|
|
51896
|
-
If parameters are on the same row, no issues are reported, see
|
|
51916
|
+
extendedInformation: `Checks:
|
|
51917
|
+
* function module calls
|
|
51918
|
+
* method calls
|
|
51919
|
+
* VALUE constructors
|
|
51920
|
+
* NEW constructors
|
|
51921
|
+
* RAISE EXCEPTION statements
|
|
51922
|
+
* CREATE OBJECT statements
|
|
51923
|
+
* RAISE EVENT statements
|
|
51924
|
+
|
|
51925
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
51926
|
+
|
|
51927
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
51928
|
+
|
|
51929
|
+
If parameters are on the same row, no issues are reported, see
|
|
51897
51930
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
51898
51931
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
51899
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
51900
|
-
EXPORTING
|
|
51901
|
-
foo = 2
|
|
51902
|
-
parameter = 3.
|
|
51903
|
-
|
|
51904
|
-
foobar( moo = 1
|
|
51905
|
-
param = 1 ).
|
|
51906
|
-
|
|
51907
|
-
foo = VALUE #(
|
|
51908
|
-
foo = bar
|
|
51932
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
51933
|
+
EXPORTING
|
|
51934
|
+
foo = 2
|
|
51935
|
+
parameter = 3.
|
|
51936
|
+
|
|
51937
|
+
foobar( moo = 1
|
|
51938
|
+
param = 1 ).
|
|
51939
|
+
|
|
51940
|
+
foo = VALUE #(
|
|
51941
|
+
foo = bar
|
|
51909
51942
|
moo = 2 ).`,
|
|
51910
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
51911
|
-
EXPORTING
|
|
51912
|
-
foo = 2
|
|
51913
|
-
parameter = 3.
|
|
51914
|
-
|
|
51915
|
-
foobar( moo = 1
|
|
51916
|
-
param = 1 ).
|
|
51917
|
-
|
|
51918
|
-
foo = VALUE #(
|
|
51919
|
-
foo = bar
|
|
51920
|
-
moo = 2 ).
|
|
51921
|
-
|
|
51922
|
-
DATA(sdf) = VALUE type(
|
|
51923
|
-
common_val = 2
|
|
51924
|
-
another_common = 5
|
|
51925
|
-
( row_value = 4
|
|
51943
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
51944
|
+
EXPORTING
|
|
51945
|
+
foo = 2
|
|
51946
|
+
parameter = 3.
|
|
51947
|
+
|
|
51948
|
+
foobar( moo = 1
|
|
51949
|
+
param = 1 ).
|
|
51950
|
+
|
|
51951
|
+
foo = VALUE #(
|
|
51952
|
+
foo = bar
|
|
51953
|
+
moo = 2 ).
|
|
51954
|
+
|
|
51955
|
+
DATA(sdf) = VALUE type(
|
|
51956
|
+
common_val = 2
|
|
51957
|
+
another_common = 5
|
|
51958
|
+
( row_value = 4
|
|
51926
51959
|
value_foo = 5 ) ).`,
|
|
51927
51960
|
};
|
|
51928
51961
|
}
|
|
@@ -52398,15 +52431,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
52398
52431
|
return {
|
|
52399
52432
|
key: "ambiguous_statement",
|
|
52400
52433
|
title: "Check for ambigious statements",
|
|
52401
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52402
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52403
|
-
|
|
52434
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52435
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52436
|
+
|
|
52404
52437
|
Only works if the target version is 740sp05 or above`,
|
|
52405
52438
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52406
|
-
badExample: `DELETE foo FROM bar.
|
|
52439
|
+
badExample: `DELETE foo FROM bar.
|
|
52407
52440
|
MODIFY foo FROM bar.`,
|
|
52408
|
-
goodExample: `DELETE foo FROM @bar.
|
|
52409
|
-
MODIFY TABLE foo FROM bar.
|
|
52441
|
+
goodExample: `DELETE foo FROM @bar.
|
|
52442
|
+
MODIFY TABLE foo FROM bar.
|
|
52410
52443
|
MODIFY zfoo FROM @wa.`,
|
|
52411
52444
|
};
|
|
52412
52445
|
}
|
|
@@ -52511,16 +52544,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
52511
52544
|
key: "avoid_use",
|
|
52512
52545
|
title: "Avoid use of certain statements",
|
|
52513
52546
|
shortDescription: `Detects usage of certain statements.`,
|
|
52514
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
52515
|
-
|
|
52516
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
52517
|
-
|
|
52518
|
-
STATICS: use CLASS-DATA instead
|
|
52519
|
-
|
|
52520
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
52521
|
-
|
|
52522
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
52523
|
-
|
|
52547
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
52548
|
+
|
|
52549
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
52550
|
+
|
|
52551
|
+
STATICS: use CLASS-DATA instead
|
|
52552
|
+
|
|
52553
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
52554
|
+
|
|
52555
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
52556
|
+
|
|
52524
52557
|
BREAK points`,
|
|
52525
52558
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
52526
52559
|
};
|
|
@@ -52651,11 +52684,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
52651
52684
|
title: "Check BEGIN END names",
|
|
52652
52685
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
52653
52686
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
52654
|
-
badExample: `DATA: BEGIN OF stru,
|
|
52655
|
-
field TYPE i,
|
|
52687
|
+
badExample: `DATA: BEGIN OF stru,
|
|
52688
|
+
field TYPE i,
|
|
52656
52689
|
END OF structure_not_the_same.`,
|
|
52657
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
52658
|
-
field TYPE i,
|
|
52690
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
52691
|
+
field TYPE i,
|
|
52659
52692
|
END OF stru.`,
|
|
52660
52693
|
};
|
|
52661
52694
|
}
|
|
@@ -52748,19 +52781,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
52748
52781
|
title: "BEGIN contains single INCLUDE",
|
|
52749
52782
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
52750
52783
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52751
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
52752
|
-
INCLUDE TYPE dselc.
|
|
52753
|
-
TYPES: END OF dummy1.
|
|
52754
|
-
|
|
52755
|
-
DATA BEGIN OF foo.
|
|
52756
|
-
INCLUDE STRUCTURE syst.
|
|
52757
|
-
DATA END OF foo.
|
|
52758
|
-
|
|
52759
|
-
STATICS BEGIN OF bar.
|
|
52760
|
-
INCLUDE STRUCTURE syst.
|
|
52784
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
52785
|
+
INCLUDE TYPE dselc.
|
|
52786
|
+
TYPES: END OF dummy1.
|
|
52787
|
+
|
|
52788
|
+
DATA BEGIN OF foo.
|
|
52789
|
+
INCLUDE STRUCTURE syst.
|
|
52790
|
+
DATA END OF foo.
|
|
52791
|
+
|
|
52792
|
+
STATICS BEGIN OF bar.
|
|
52793
|
+
INCLUDE STRUCTURE syst.
|
|
52761
52794
|
STATICS END OF bar.`,
|
|
52762
|
-
goodExample: `DATA BEGIN OF foo.
|
|
52763
|
-
INCLUDE STRUCTURE dselc.
|
|
52795
|
+
goodExample: `DATA BEGIN OF foo.
|
|
52796
|
+
INCLUDE STRUCTURE dselc.
|
|
52764
52797
|
DATA END OF foo.`,
|
|
52765
52798
|
};
|
|
52766
52799
|
}
|
|
@@ -52850,9 +52883,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
52850
52883
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
52851
52884
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
52852
52885
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
52853
|
-
goodExample: `TRY.
|
|
52854
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
52855
|
-
CATCH cx_sy_authorization_error.
|
|
52886
|
+
goodExample: `TRY.
|
|
52887
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
52888
|
+
CATCH cx_sy_authorization_error.
|
|
52856
52889
|
ENDTRY.`,
|
|
52857
52890
|
};
|
|
52858
52891
|
}
|
|
@@ -52917,10 +52950,10 @@ class CDSCommentStyle {
|
|
|
52917
52950
|
key: "cds_comment_style",
|
|
52918
52951
|
title: "CDS Comment Style",
|
|
52919
52952
|
shortDescription: `Check for obsolete comment style`,
|
|
52920
|
-
extendedInformation: `Check for obsolete comment style
|
|
52921
|
-
|
|
52922
|
-
Comments starting with "--" are considered obsolete
|
|
52923
|
-
|
|
52953
|
+
extendedInformation: `Check for obsolete comment style
|
|
52954
|
+
|
|
52955
|
+
Comments starting with "--" are considered obsolete
|
|
52956
|
+
|
|
52924
52957
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
52925
52958
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52926
52959
|
badExample: "-- this is a comment",
|
|
@@ -52987,10 +53020,10 @@ class CDSLegacyView {
|
|
|
52987
53020
|
title: "CDS Legacy View",
|
|
52988
53021
|
shortDescription: `Identify CDS Legacy Views`,
|
|
52989
53022
|
// eslint-disable-next-line max-len
|
|
52990
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
52991
|
-
|
|
52992
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
52993
|
-
|
|
53023
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53024
|
+
|
|
53025
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53026
|
+
|
|
52994
53027
|
v755 and up`,
|
|
52995
53028
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
52996
53029
|
};
|
|
@@ -53145,10 +53178,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53145
53178
|
key: "chain_mainly_declarations",
|
|
53146
53179
|
title: "Chain mainly declarations",
|
|
53147
53180
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53148
|
-
extendedInformation: `
|
|
53149
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53150
|
-
|
|
53151
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53181
|
+
extendedInformation: `
|
|
53182
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53183
|
+
|
|
53184
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53152
53185
|
`,
|
|
53153
53186
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53154
53187
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -53324,17 +53357,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
53324
53357
|
title: "Change IF to CASE",
|
|
53325
53358
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
53326
53359
|
// eslint-disable-next-line max-len
|
|
53327
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53328
|
-
|
|
53360
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53361
|
+
|
|
53329
53362
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
53330
53363
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53331
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53332
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53333
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
53364
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53365
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53366
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
53334
53367
|
ENDIF.`,
|
|
53335
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
53336
|
-
WHEN 'FOO'.
|
|
53337
|
-
WHEN 'BAR' OR 'MOO'.
|
|
53368
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
53369
|
+
WHEN 'FOO'.
|
|
53370
|
+
WHEN 'BAR' OR 'MOO'.
|
|
53338
53371
|
ENDCASE.`,
|
|
53339
53372
|
};
|
|
53340
53373
|
}
|
|
@@ -53471,8 +53504,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
53471
53504
|
return {
|
|
53472
53505
|
key: "check_abstract",
|
|
53473
53506
|
title: "Check abstract methods and classes",
|
|
53474
|
-
shortDescription: `Checks abstract methods and classes:
|
|
53475
|
-
- class defined as abstract and final,
|
|
53507
|
+
shortDescription: `Checks abstract methods and classes:
|
|
53508
|
+
- class defined as abstract and final,
|
|
53476
53509
|
- non-abstract class contains abstract methods`,
|
|
53477
53510
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
53478
53511
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -53553,11 +53586,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
53553
53586
|
return {
|
|
53554
53587
|
key: "check_comments",
|
|
53555
53588
|
title: "Check Comments",
|
|
53556
|
-
shortDescription: `
|
|
53589
|
+
shortDescription: `
|
|
53557
53590
|
Various checks for comment usage.`,
|
|
53558
|
-
extendedInformation: `
|
|
53559
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
53560
|
-
|
|
53591
|
+
extendedInformation: `
|
|
53592
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
53593
|
+
|
|
53561
53594
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
53562
53595
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53563
53596
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -53719,9 +53752,9 @@ class CheckInclude {
|
|
|
53719
53752
|
key: "check_include",
|
|
53720
53753
|
title: "Check INCLUDEs",
|
|
53721
53754
|
shortDescription: `Checks INCLUDE statements`,
|
|
53722
|
-
extendedInformation: `
|
|
53723
|
-
* Reports unused includes
|
|
53724
|
-
* Errors if the includes are not found
|
|
53755
|
+
extendedInformation: `
|
|
53756
|
+
* Reports unused includes
|
|
53757
|
+
* Errors if the includes are not found
|
|
53725
53758
|
* Error if including a main program`,
|
|
53726
53759
|
tags: [_irule_1.RuleTag.Syntax],
|
|
53727
53760
|
};
|
|
@@ -53796,14 +53829,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
53796
53829
|
key: "check_subrc",
|
|
53797
53830
|
title: "Check sy-subrc",
|
|
53798
53831
|
shortDescription: `Check sy-subrc`,
|
|
53799
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
53800
|
-
|
|
53801
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
53802
|
-
|
|
53803
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
53804
|
-
|
|
53805
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
53806
|
-
|
|
53832
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
53833
|
+
|
|
53834
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
53835
|
+
|
|
53836
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
53837
|
+
|
|
53838
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
53839
|
+
|
|
53807
53840
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
53808
53841
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53809
53842
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -54356,17 +54389,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
54356
54389
|
shortDescription: `Find overlapping classic exceptions`,
|
|
54357
54390
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
54358
54391
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54359
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54360
|
-
EXCEPTIONS
|
|
54361
|
-
system_failure = 1 MESSAGE lv_message
|
|
54362
|
-
communication_failure = 1 MESSAGE lv_message
|
|
54363
|
-
resource_failure = 1
|
|
54392
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54393
|
+
EXCEPTIONS
|
|
54394
|
+
system_failure = 1 MESSAGE lv_message
|
|
54395
|
+
communication_failure = 1 MESSAGE lv_message
|
|
54396
|
+
resource_failure = 1
|
|
54364
54397
|
OTHERS = 1.`,
|
|
54365
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54366
|
-
EXCEPTIONS
|
|
54367
|
-
system_failure = 1 MESSAGE lv_message
|
|
54368
|
-
communication_failure = 2 MESSAGE lv_message
|
|
54369
|
-
resource_failure = 3
|
|
54398
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54399
|
+
EXCEPTIONS
|
|
54400
|
+
system_failure = 1 MESSAGE lv_message
|
|
54401
|
+
communication_failure = 2 MESSAGE lv_message
|
|
54402
|
+
resource_failure = 3
|
|
54370
54403
|
OTHERS = 4.`,
|
|
54371
54404
|
};
|
|
54372
54405
|
}
|
|
@@ -54612,7 +54645,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
54612
54645
|
key: "commented_code",
|
|
54613
54646
|
title: "Find commented code",
|
|
54614
54647
|
shortDescription: `Detects usage of commented out code.`,
|
|
54615
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
54648
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
54616
54649
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
54617
54650
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54618
54651
|
};
|
|
@@ -54844,10 +54877,10 @@ class ConstructorVisibilityPublic {
|
|
|
54844
54877
|
key: "constructor_visibility_public",
|
|
54845
54878
|
title: "Check constructor visibility is public",
|
|
54846
54879
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
54847
|
-
extendedInformation: `
|
|
54848
|
-
This only applies to global classes.
|
|
54849
|
-
|
|
54850
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
54880
|
+
extendedInformation: `
|
|
54881
|
+
This only applies to global classes.
|
|
54882
|
+
|
|
54883
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
54851
54884
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
54852
54885
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54853
54886
|
};
|
|
@@ -54922,8 +54955,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
54922
54955
|
key: "contains_tab",
|
|
54923
54956
|
title: "Code contains tab",
|
|
54924
54957
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
54925
|
-
extendedInformation: `
|
|
54926
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
54958
|
+
extendedInformation: `
|
|
54959
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
54927
54960
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
54928
54961
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54929
54962
|
};
|
|
@@ -55008,10 +55041,10 @@ class CyclicOO {
|
|
|
55008
55041
|
key: "cyclic_oo",
|
|
55009
55042
|
title: "Cyclic OO",
|
|
55010
55043
|
shortDescription: `Finds cyclic OO references`,
|
|
55011
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55012
|
-
|
|
55013
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55014
|
-
|
|
55044
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55045
|
+
|
|
55046
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55047
|
+
|
|
55015
55048
|
References in testclass includes are ignored`,
|
|
55016
55049
|
};
|
|
55017
55050
|
}
|
|
@@ -55253,7 +55286,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55253
55286
|
key: "dangerous_statement",
|
|
55254
55287
|
title: "Dangerous statement",
|
|
55255
55288
|
shortDescription: `Detects potentially dangerous statements`,
|
|
55256
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55289
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55257
55290
|
dynamic SQL can potentially create SQL injection problems`,
|
|
55258
55291
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55259
55292
|
};
|
|
@@ -55457,13 +55490,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
55457
55490
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
55458
55491
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
55459
55492
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55460
|
-
badExample: `FROM foo.
|
|
55461
|
-
WRITE 'hello'.
|
|
55462
|
-
DATA int TYPE i.
|
|
55493
|
+
badExample: `FROM foo.
|
|
55494
|
+
WRITE 'hello'.
|
|
55495
|
+
DATA int TYPE i.
|
|
55463
55496
|
ENDFORM.`,
|
|
55464
|
-
goodExample: `FROM foo.
|
|
55465
|
-
DATA int TYPE i.
|
|
55466
|
-
WRITE 'hello'.
|
|
55497
|
+
goodExample: `FROM foo.
|
|
55498
|
+
DATA int TYPE i.
|
|
55499
|
+
WRITE 'hello'.
|
|
55467
55500
|
ENDFORM.`,
|
|
55468
55501
|
};
|
|
55469
55502
|
}
|
|
@@ -55999,39 +56032,39 @@ class Downport {
|
|
|
55999
56032
|
key: "downport",
|
|
56000
56033
|
title: "Downport statement",
|
|
56001
56034
|
shortDescription: `Downport functionality`,
|
|
56002
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56003
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56004
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56005
|
-
|
|
56006
|
-
Current rules:
|
|
56007
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56008
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56009
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56010
|
-
* CONV is outlined
|
|
56011
|
-
* COND is outlined
|
|
56012
|
-
* REDUCE is outlined
|
|
56013
|
-
* SWITCH is outlined
|
|
56014
|
-
* FILTER is outlined
|
|
56015
|
-
* APPEND expression is outlined
|
|
56016
|
-
* INSERT expression is outlined
|
|
56017
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56018
|
-
* CAST changed to ?=
|
|
56019
|
-
* LOOP AT method_call( ) is outlined
|
|
56020
|
-
* VALUE # with structure fields
|
|
56021
|
-
* VALUE # with internal table lines
|
|
56022
|
-
* Table Expressions are outlined
|
|
56023
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56024
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56025
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56026
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56027
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56028
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56029
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56030
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56031
|
-
* MESSAGE with non simple source
|
|
56032
|
-
|
|
56033
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56034
|
-
|
|
56035
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56036
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56037
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56038
|
+
|
|
56039
|
+
Current rules:
|
|
56040
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56041
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56042
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56043
|
+
* CONV is outlined
|
|
56044
|
+
* COND is outlined
|
|
56045
|
+
* REDUCE is outlined
|
|
56046
|
+
* SWITCH is outlined
|
|
56047
|
+
* FILTER is outlined
|
|
56048
|
+
* APPEND expression is outlined
|
|
56049
|
+
* INSERT expression is outlined
|
|
56050
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56051
|
+
* CAST changed to ?=
|
|
56052
|
+
* LOOP AT method_call( ) is outlined
|
|
56053
|
+
* VALUE # with structure fields
|
|
56054
|
+
* VALUE # with internal table lines
|
|
56055
|
+
* Table Expressions are outlined
|
|
56056
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56057
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56058
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56059
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56060
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56061
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56062
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56063
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56064
|
+
* MESSAGE with non simple source
|
|
56065
|
+
|
|
56066
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56067
|
+
|
|
56035
56068
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56036
56069
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56037
56070
|
};
|
|
@@ -56605,10 +56638,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
56605
56638
|
const fieldName = f.concatTokens();
|
|
56606
56639
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
56607
56640
|
}
|
|
56608
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
56641
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
56609
56642
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
56610
56643
|
}
|
|
56611
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
56644
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
56612
56645
|
${indentation}`);
|
|
56613
56646
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
56614
56647
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56652,12 +56685,12 @@ ${indentation}`);
|
|
|
56652
56685
|
}
|
|
56653
56686
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56654
56687
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
56655
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
56656
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
56657
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
56688
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
56689
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
56690
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
56658
56691
|
${indentation}`);
|
|
56659
56692
|
if (fieldDefinitions === "") {
|
|
56660
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
56693
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
56661
56694
|
${indentation}`);
|
|
56662
56695
|
}
|
|
56663
56696
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -56725,7 +56758,7 @@ ${indentation}`);
|
|
|
56725
56758
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56726
56759
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
56727
56760
|
const firstToken = high.getFirstToken();
|
|
56728
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56761
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56729
56762
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
56730
56763
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
56731
56764
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56763,7 +56796,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
56763
56796
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56764
56797
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
56765
56798
|
const firstToken = high.getFirstToken();
|
|
56766
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56799
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56767
56800
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
56768
56801
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
56769
56802
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56805,14 +56838,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
56805
56838
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
56806
56839
|
const firstToken = high.getFirstToken();
|
|
56807
56840
|
// note that the tabix restore should be done before throwing the exception
|
|
56808
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
56809
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
56810
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
56811
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
56812
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
56813
|
-
${indentation}IF sy-subrc <> 0.
|
|
56814
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
56815
|
-
${indentation}ENDIF.
|
|
56841
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
56842
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
56843
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
56844
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
56845
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
56846
|
+
${indentation}IF sy-subrc <> 0.
|
|
56847
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
56848
|
+
${indentation}ENDIF.
|
|
56816
56849
|
${indentation}`);
|
|
56817
56850
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
56818
56851
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56869,7 +56902,7 @@ ${indentation}`);
|
|
|
56869
56902
|
const className = classNames[0].concatTokens();
|
|
56870
56903
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
56871
56904
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
56872
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
56905
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
56873
56906
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
56874
56907
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
56875
56908
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57031,16 +57064,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57031
57064
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57032
57065
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57033
57066
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57034
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57035
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57067
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57068
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57036
57069
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57037
57070
|
if (withs.length > 0) {
|
|
57038
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57039
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57040
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57071
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57072
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57073
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57041
57074
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57042
57075
|
}
|
|
57043
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57076
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57044
57077
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57045
57078
|
if (withs.length > 0) {
|
|
57046
57079
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -57152,10 +57185,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
57152
57185
|
let code = "";
|
|
57153
57186
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
57154
57187
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57155
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57156
|
-
IF sy-subrc <> 0.
|
|
57157
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57158
|
-
ENDIF.
|
|
57188
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57189
|
+
IF sy-subrc <> 0.
|
|
57190
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57191
|
+
ENDIF.
|
|
57159
57192
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
57160
57193
|
}
|
|
57161
57194
|
else {
|
|
@@ -57231,20 +57264,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
57231
57264
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57232
57265
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57233
57266
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57234
|
-
code += ` items LIKE ${loopSourceName},
|
|
57235
|
-
END OF ${groupTargetName}type.
|
|
57236
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57237
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57267
|
+
code += ` items LIKE ${loopSourceName},
|
|
57268
|
+
END OF ${groupTargetName}type.
|
|
57269
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57270
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57238
57271
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
57239
57272
|
if (groupIndexName !== undefined) {
|
|
57240
57273
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
57241
57274
|
}
|
|
57242
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57275
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57243
57276
|
IF sy-subrc = 0.\n`;
|
|
57244
57277
|
if (groupCountName !== undefined) {
|
|
57245
57278
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
57246
57279
|
}
|
|
57247
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57280
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57248
57281
|
ELSE.\n`;
|
|
57249
57282
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
57250
57283
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -57265,8 +57298,8 @@ ELSE.\n`;
|
|
|
57265
57298
|
}
|
|
57266
57299
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
57267
57300
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
57268
|
-
code += `ENDIF.
|
|
57269
|
-
ENDLOOP.
|
|
57301
|
+
code += `ENDIF.
|
|
57302
|
+
ENDLOOP.
|
|
57270
57303
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
57271
57304
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
57272
57305
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -57438,7 +57471,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
57438
57471
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57439
57472
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
57440
57473
|
// all ENUMS are char like?
|
|
57441
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
57474
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
57442
57475
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
57443
57476
|
let count = 1;
|
|
57444
57477
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -57482,14 +57515,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
57482
57515
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57483
57516
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57484
57517
|
// restore tabix before exeption
|
|
57485
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
57486
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57487
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57488
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
57489
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57490
|
-
${indentation}IF sy-subrc <> 0.
|
|
57491
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57492
|
-
${indentation}ENDIF.
|
|
57518
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
57519
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57520
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57521
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
57522
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57523
|
+
${indentation}IF sy-subrc <> 0.
|
|
57524
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57525
|
+
${indentation}ENDIF.
|
|
57493
57526
|
${indentation}${uniqueName}`;
|
|
57494
57527
|
const start = target.getFirstToken().getStart();
|
|
57495
57528
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -57573,11 +57606,11 @@ ${indentation}${uniqueName}`;
|
|
|
57573
57606
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57574
57607
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57575
57608
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57576
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
57577
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
57578
|
-
${indentation} EXPORTING
|
|
57579
|
-
${indentation} input = ${source}
|
|
57580
|
-
${indentation} IMPORTING
|
|
57609
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
57610
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
57611
|
+
${indentation} EXPORTING
|
|
57612
|
+
${indentation} input = ${source}
|
|
57613
|
+
${indentation} IMPORTING
|
|
57581
57614
|
${indentation} output = ${uniqueName}.\n`;
|
|
57582
57615
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
57583
57616
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -58084,7 +58117,7 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
58084
58117
|
body += data;
|
|
58085
58118
|
added = true;
|
|
58086
58119
|
}
|
|
58087
|
-
body += indentation + structureName + "-" + b.
|
|
58120
|
+
body += indentation + structureName + "-" + b.concatTokensWithLinebreaks() + ".\n";
|
|
58088
58121
|
}
|
|
58089
58122
|
else if (b.get() instanceof Expressions.Source) {
|
|
58090
58123
|
// note: it wont work with APPEND for Hashed/Sorted Tables, so use INSERT,
|
|
@@ -58889,12 +58922,12 @@ class EasyToFindMessages {
|
|
|
58889
58922
|
key: "easy_to_find_messages",
|
|
58890
58923
|
title: "Easy to find messages",
|
|
58891
58924
|
shortDescription: `Make messages easy to find`,
|
|
58892
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
58893
|
-
|
|
58894
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
58895
|
-
|
|
58896
|
-
Also see rule "message_exists"
|
|
58897
|
-
|
|
58925
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
58926
|
+
|
|
58927
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
58928
|
+
|
|
58929
|
+
Also see rule "message_exists"
|
|
58930
|
+
|
|
58898
58931
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
58899
58932
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
58900
58933
|
};
|
|
@@ -58979,8 +59012,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
58979
59012
|
key: "empty_line_in_statement",
|
|
58980
59013
|
title: "Find empty lines in statements",
|
|
58981
59014
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
58982
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
58983
|
-
|
|
59015
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59016
|
+
|
|
58984
59017
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
58985
59018
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
58986
59019
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -59272,10 +59305,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
59272
59305
|
return {
|
|
59273
59306
|
key: "exit_or_check",
|
|
59274
59307
|
title: "Find EXIT or CHECK outside loops",
|
|
59275
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59308
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59276
59309
|
Use RETURN to leave procesing blocks instead.`,
|
|
59277
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59278
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59310
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59311
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59279
59312
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
59280
59313
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59281
59314
|
};
|
|
@@ -59358,12 +59391,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
59358
59391
|
key: "expand_macros",
|
|
59359
59392
|
title: "Expand Macros",
|
|
59360
59393
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
59361
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
59362
|
-
|
|
59394
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
59395
|
+
|
|
59363
59396
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
59364
|
-
badExample: `DEFINE _hello.
|
|
59365
|
-
WRITE 'hello'.
|
|
59366
|
-
END-OF-DEFINITION.
|
|
59397
|
+
badExample: `DEFINE _hello.
|
|
59398
|
+
WRITE 'hello'.
|
|
59399
|
+
END-OF-DEFINITION.
|
|
59367
59400
|
_hello.`,
|
|
59368
59401
|
goodExample: `WRITE 'hello'.`,
|
|
59369
59402
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -59450,7 +59483,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
59450
59483
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
59451
59484
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
59452
59485
|
goodExample: `call_method( foo = bar ).`,
|
|
59453
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
59486
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
59454
59487
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
59455
59488
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
59456
59489
|
};
|
|
@@ -59548,7 +59581,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
59548
59581
|
key: "forbidden_identifier",
|
|
59549
59582
|
title: "Forbidden Identifier",
|
|
59550
59583
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
59551
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
59584
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
59552
59585
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
59553
59586
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
59554
59587
|
};
|
|
@@ -59790,8 +59823,8 @@ class ForbiddenVoidType {
|
|
|
59790
59823
|
key: "forbidden_void_type",
|
|
59791
59824
|
title: "Forbidden Void Types",
|
|
59792
59825
|
shortDescription: `Avoid usage of specified void types.`,
|
|
59793
|
-
extendedInformation: `Inspiration:
|
|
59794
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
59826
|
+
extendedInformation: `Inspiration:
|
|
59827
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
59795
59828
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
59796
59829
|
};
|
|
59797
59830
|
}
|
|
@@ -60034,7 +60067,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60034
60067
|
key: "fully_type_itabs",
|
|
60035
60068
|
title: "Fully type internal tables",
|
|
60036
60069
|
shortDescription: `No implict table types or table keys`,
|
|
60037
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60070
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60038
60071
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60039
60072
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60040
60073
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -60219,26 +60252,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
60219
60252
|
key: "functional_writing",
|
|
60220
60253
|
title: "Use functional writing",
|
|
60221
60254
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
60222
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60255
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60223
60256
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
60224
60257
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60225
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60226
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60227
|
-
EXPORTING
|
|
60228
|
-
p_name = 'NAME'
|
|
60229
|
-
RECEIVING
|
|
60230
|
-
p_descr_ref = lr_typedescr
|
|
60231
|
-
EXCEPTIONS
|
|
60232
|
-
type_not_found = 1
|
|
60258
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60259
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60260
|
+
EXPORTING
|
|
60261
|
+
p_name = 'NAME'
|
|
60262
|
+
RECEIVING
|
|
60263
|
+
p_descr_ref = lr_typedescr
|
|
60264
|
+
EXCEPTIONS
|
|
60265
|
+
type_not_found = 1
|
|
60233
60266
|
OTHERS = 2.`,
|
|
60234
|
-
goodExample: `zcl_class=>method( ).
|
|
60235
|
-
cl_abap_typedescr=>describe_by_name(
|
|
60236
|
-
EXPORTING
|
|
60237
|
-
p_name = 'NAME'
|
|
60238
|
-
RECEIVING
|
|
60239
|
-
p_descr_ref = lr_typedescr
|
|
60240
|
-
EXCEPTIONS
|
|
60241
|
-
type_not_found = 1
|
|
60267
|
+
goodExample: `zcl_class=>method( ).
|
|
60268
|
+
cl_abap_typedescr=>describe_by_name(
|
|
60269
|
+
EXPORTING
|
|
60270
|
+
p_name = 'NAME'
|
|
60271
|
+
RECEIVING
|
|
60272
|
+
p_descr_ref = lr_typedescr
|
|
60273
|
+
EXCEPTIONS
|
|
60274
|
+
type_not_found = 1
|
|
60242
60275
|
OTHERS = 2 ).`,
|
|
60243
60276
|
};
|
|
60244
60277
|
}
|
|
@@ -60349,14 +60382,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
60349
60382
|
key: "global_class",
|
|
60350
60383
|
title: "Global class checks",
|
|
60351
60384
|
shortDescription: `Checks related to global classes`,
|
|
60352
|
-
extendedInformation: `* global classes must be in own files
|
|
60353
|
-
|
|
60354
|
-
* file names must match class name
|
|
60355
|
-
|
|
60356
|
-
* file names must match interface name
|
|
60357
|
-
|
|
60358
|
-
* global classes must be global definitions
|
|
60359
|
-
|
|
60385
|
+
extendedInformation: `* global classes must be in own files
|
|
60386
|
+
|
|
60387
|
+
* file names must match class name
|
|
60388
|
+
|
|
60389
|
+
* file names must match interface name
|
|
60390
|
+
|
|
60391
|
+
* global classes must be global definitions
|
|
60392
|
+
|
|
60360
60393
|
* global interfaces must be global definitions`,
|
|
60361
60394
|
tags: [_irule_1.RuleTag.Syntax],
|
|
60362
60395
|
};
|
|
@@ -60455,8 +60488,8 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
60455
60488
|
return {
|
|
60456
60489
|
key: "identical_conditions",
|
|
60457
60490
|
title: "Identical conditions",
|
|
60458
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
60459
|
-
|
|
60491
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
60492
|
+
|
|
60460
60493
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
60461
60494
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60462
60495
|
};
|
|
@@ -60590,23 +60623,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
60590
60623
|
key: "identical_contents",
|
|
60591
60624
|
title: "Identical contents",
|
|
60592
60625
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
60593
|
-
extendedInformation: `
|
|
60594
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
60595
|
-
|
|
60626
|
+
extendedInformation: `
|
|
60627
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
60628
|
+
|
|
60596
60629
|
Chained statments are ignored`,
|
|
60597
60630
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60598
|
-
badExample: `IF foo = bar.
|
|
60599
|
-
WRITE 'bar'.
|
|
60600
|
-
WRITE 'world'.
|
|
60601
|
-
ELSE.
|
|
60602
|
-
WRITE 'foo'.
|
|
60603
|
-
WRITE 'world'.
|
|
60631
|
+
badExample: `IF foo = bar.
|
|
60632
|
+
WRITE 'bar'.
|
|
60633
|
+
WRITE 'world'.
|
|
60634
|
+
ELSE.
|
|
60635
|
+
WRITE 'foo'.
|
|
60636
|
+
WRITE 'world'.
|
|
60604
60637
|
ENDIF.`,
|
|
60605
|
-
goodExample: `IF foo = bar.
|
|
60606
|
-
WRITE 'bar'.
|
|
60607
|
-
ELSE.
|
|
60608
|
-
WRITE 'foo'.
|
|
60609
|
-
ENDIF.
|
|
60638
|
+
goodExample: `IF foo = bar.
|
|
60639
|
+
WRITE 'bar'.
|
|
60640
|
+
ELSE.
|
|
60641
|
+
WRITE 'foo'.
|
|
60642
|
+
ENDIF.
|
|
60610
60643
|
WRITE 'world'.`,
|
|
60611
60644
|
};
|
|
60612
60645
|
}
|
|
@@ -60709,12 +60742,12 @@ class IdenticalDescriptions {
|
|
|
60709
60742
|
key: "identical_descriptions",
|
|
60710
60743
|
title: "Identical descriptions",
|
|
60711
60744
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
60712
|
-
extendedInformation: `Case insensitive
|
|
60713
|
-
|
|
60714
|
-
Only checks the master language descriptions
|
|
60715
|
-
|
|
60716
|
-
Dependencies are skipped
|
|
60717
|
-
|
|
60745
|
+
extendedInformation: `Case insensitive
|
|
60746
|
+
|
|
60747
|
+
Only checks the master language descriptions
|
|
60748
|
+
|
|
60749
|
+
Dependencies are skipped
|
|
60750
|
+
|
|
60718
60751
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
60719
60752
|
tags: [],
|
|
60720
60753
|
};
|
|
@@ -60888,43 +60921,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
60888
60921
|
key: "if_in_if",
|
|
60889
60922
|
title: "IF in IF",
|
|
60890
60923
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
60891
|
-
extendedInformation: `
|
|
60892
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
60893
|
-
|
|
60894
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
60895
|
-
|
|
60896
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
60924
|
+
extendedInformation: `
|
|
60925
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
60926
|
+
|
|
60927
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
60928
|
+
|
|
60929
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
60897
60930
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
60898
|
-
badExample: `IF condition1.
|
|
60899
|
-
IF condition2.
|
|
60900
|
-
...
|
|
60901
|
-
ENDIF.
|
|
60902
|
-
ENDIF.
|
|
60903
|
-
|
|
60904
|
-
IF condition1.
|
|
60905
|
-
...
|
|
60906
|
-
ELSE.
|
|
60907
|
-
IF condition2.
|
|
60908
|
-
...
|
|
60909
|
-
ENDIF.
|
|
60931
|
+
badExample: `IF condition1.
|
|
60932
|
+
IF condition2.
|
|
60933
|
+
...
|
|
60934
|
+
ENDIF.
|
|
60935
|
+
ENDIF.
|
|
60936
|
+
|
|
60937
|
+
IF condition1.
|
|
60938
|
+
...
|
|
60939
|
+
ELSE.
|
|
60940
|
+
IF condition2.
|
|
60941
|
+
...
|
|
60942
|
+
ENDIF.
|
|
60910
60943
|
ENDIF.`,
|
|
60911
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
60912
|
-
...
|
|
60913
|
-
ENDIF.
|
|
60914
|
-
|
|
60915
|
-
IF condition1.
|
|
60916
|
-
...
|
|
60917
|
-
ELSEIF condition2.
|
|
60918
|
-
...
|
|
60919
|
-
ENDIF.
|
|
60920
|
-
|
|
60921
|
-
CASE variable.
|
|
60922
|
-
WHEN value1.
|
|
60923
|
-
...
|
|
60924
|
-
WHEN value2.
|
|
60925
|
-
IF condition2.
|
|
60926
|
-
...
|
|
60927
|
-
ENDIF.
|
|
60944
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
60945
|
+
...
|
|
60946
|
+
ENDIF.
|
|
60947
|
+
|
|
60948
|
+
IF condition1.
|
|
60949
|
+
...
|
|
60950
|
+
ELSEIF condition2.
|
|
60951
|
+
...
|
|
60952
|
+
ENDIF.
|
|
60953
|
+
|
|
60954
|
+
CASE variable.
|
|
60955
|
+
WHEN value1.
|
|
60956
|
+
...
|
|
60957
|
+
WHEN value2.
|
|
60958
|
+
IF condition2.
|
|
60959
|
+
...
|
|
60960
|
+
ENDIF.
|
|
60928
60961
|
ENDCASE.`,
|
|
60929
60962
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60930
60963
|
};
|
|
@@ -61109,9 +61142,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
61109
61142
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
61110
61143
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
61111
61144
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
61112
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61113
|
-
METHOD ${methodName.toLowerCase()}.
|
|
61114
|
-
RETURN. " todo, implement method
|
|
61145
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61146
|
+
METHOD ${methodName.toLowerCase()}.
|
|
61147
|
+
RETURN. " todo, implement method
|
|
61115
61148
|
ENDMETHOD.`);
|
|
61116
61149
|
}
|
|
61117
61150
|
}
|
|
@@ -61299,19 +61332,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
61299
61332
|
key: "in_statement_indentation",
|
|
61300
61333
|
title: "In-statement indentation",
|
|
61301
61334
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
61302
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61303
|
-
|
|
61304
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
61335
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61336
|
+
|
|
61337
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
61305
61338
|
to distinguish them better from code within the block.`,
|
|
61306
|
-
badExample: `IF 1 = 1
|
|
61307
|
-
AND 2 = 2.
|
|
61308
|
-
WRITE 'hello' &&
|
|
61309
|
-
'world'.
|
|
61339
|
+
badExample: `IF 1 = 1
|
|
61340
|
+
AND 2 = 2.
|
|
61341
|
+
WRITE 'hello' &&
|
|
61342
|
+
'world'.
|
|
61310
61343
|
ENDIF.`,
|
|
61311
|
-
goodExample: `IF 1 = 1
|
|
61312
|
-
AND 2 = 2.
|
|
61313
|
-
WRITE 'hello' &&
|
|
61314
|
-
'world'.
|
|
61344
|
+
goodExample: `IF 1 = 1
|
|
61345
|
+
AND 2 = 2.
|
|
61346
|
+
WRITE 'hello' &&
|
|
61347
|
+
'world'.
|
|
61315
61348
|
ENDIF.`,
|
|
61316
61349
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61317
61350
|
};
|
|
@@ -61816,9 +61849,9 @@ class IntfReferencingClas {
|
|
|
61816
61849
|
key: "intf_referencing_clas",
|
|
61817
61850
|
title: "INTF referencing CLAS",
|
|
61818
61851
|
shortDescription: `Interface contains references to class`,
|
|
61819
|
-
extendedInformation: `Only global interfaces are checked.
|
|
61820
|
-
Only first level references are checked.
|
|
61821
|
-
Exception class references are ignored.
|
|
61852
|
+
extendedInformation: `Only global interfaces are checked.
|
|
61853
|
+
Only first level references are checked.
|
|
61854
|
+
Exception class references are ignored.
|
|
61822
61855
|
Void references are ignored.`,
|
|
61823
61856
|
};
|
|
61824
61857
|
}
|
|
@@ -62413,8 +62446,8 @@ class LineBreakStyle {
|
|
|
62413
62446
|
return {
|
|
62414
62447
|
key: "line_break_style",
|
|
62415
62448
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
62416
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
62417
|
-
|
|
62449
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
62450
|
+
|
|
62418
62451
|
abapGit does not work with CRLF`,
|
|
62419
62452
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
62420
62453
|
};
|
|
@@ -62483,7 +62516,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
62483
62516
|
key: "line_length",
|
|
62484
62517
|
title: "Line length",
|
|
62485
62518
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
62486
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
62519
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
62487
62520
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
62488
62521
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
62489
62522
|
};
|
|
@@ -62554,7 +62587,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
62554
62587
|
key: "line_only_punc",
|
|
62555
62588
|
title: "Line containing only punctuation",
|
|
62556
62589
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
62557
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
62590
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
62558
62591
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
62559
62592
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62560
62593
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -62814,8 +62847,8 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
62814
62847
|
return {
|
|
62815
62848
|
key: "local_variable_names",
|
|
62816
62849
|
title: "Local variable naming conventions",
|
|
62817
|
-
shortDescription: `
|
|
62818
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
62850
|
+
shortDescription: `
|
|
62851
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
62819
62852
|
Regexes are case-insensitive.`,
|
|
62820
62853
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
62821
62854
|
};
|
|
@@ -62962,10 +62995,10 @@ class MainFileContents {
|
|
|
62962
62995
|
key: "main_file_contents",
|
|
62963
62996
|
title: "Main file contents",
|
|
62964
62997
|
shortDescription: `Checks related to report declarations.`,
|
|
62965
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
62966
|
-
|
|
62967
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
62968
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
62998
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
62999
|
+
|
|
63000
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63001
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
62969
63002
|
`,
|
|
62970
63003
|
};
|
|
62971
63004
|
}
|
|
@@ -63081,17 +63114,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
63081
63114
|
title: "Too many parentheses",
|
|
63082
63115
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
63083
63116
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63084
|
-
badExample: `
|
|
63085
|
-
IF ( destination IS INITIAL ).
|
|
63086
|
-
ENDIF.
|
|
63087
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63088
|
-
ENDIF.
|
|
63117
|
+
badExample: `
|
|
63118
|
+
IF ( destination IS INITIAL ).
|
|
63119
|
+
ENDIF.
|
|
63120
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63121
|
+
ENDIF.
|
|
63089
63122
|
`,
|
|
63090
|
-
goodExample: `
|
|
63091
|
-
IF destination IS INITIAL.
|
|
63092
|
-
ENDIF.
|
|
63093
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
63094
|
-
ENDIF.
|
|
63123
|
+
goodExample: `
|
|
63124
|
+
IF destination IS INITIAL.
|
|
63125
|
+
ENDIF.
|
|
63126
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
63127
|
+
ENDIF.
|
|
63095
63128
|
`,
|
|
63096
63129
|
};
|
|
63097
63130
|
}
|
|
@@ -63265,14 +63298,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
63265
63298
|
title: "Max one method parameter definition per line",
|
|
63266
63299
|
shortDescription: `Keep max one method parameter description per line`,
|
|
63267
63300
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
63268
|
-
badExample: `
|
|
63269
|
-
METHODS apps_scope_token
|
|
63270
|
-
IMPORTING
|
|
63301
|
+
badExample: `
|
|
63302
|
+
METHODS apps_scope_token
|
|
63303
|
+
IMPORTING
|
|
63271
63304
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
63272
|
-
goodExample: `
|
|
63273
|
-
METHODS apps_scope_token
|
|
63274
|
-
IMPORTING
|
|
63275
|
-
body TYPE bodyapps_scope_token
|
|
63305
|
+
goodExample: `
|
|
63306
|
+
METHODS apps_scope_token
|
|
63307
|
+
IMPORTING
|
|
63308
|
+
body TYPE bodyapps_scope_token
|
|
63276
63309
|
client_id TYPE str.`,
|
|
63277
63310
|
};
|
|
63278
63311
|
}
|
|
@@ -63337,11 +63370,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
63337
63370
|
key: "max_one_statement",
|
|
63338
63371
|
title: "Max one statement per line",
|
|
63339
63372
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
63340
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
63341
|
-
|
|
63342
|
-
Does not report anything for chained statements.
|
|
63343
|
-
|
|
63344
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
63373
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
63374
|
+
|
|
63375
|
+
Does not report anything for chained statements.
|
|
63376
|
+
|
|
63377
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
63345
63378
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
63346
63379
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63347
63380
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -63679,8 +63712,8 @@ class MethodLength {
|
|
|
63679
63712
|
key: "method_length",
|
|
63680
63713
|
title: "Method/Form Length",
|
|
63681
63714
|
shortDescription: `Checks relating to method/form length.`,
|
|
63682
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
63683
|
-
|
|
63715
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
63716
|
+
|
|
63684
63717
|
Abstract methods without statements are considered okay.`,
|
|
63685
63718
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63686
63719
|
};
|
|
@@ -63785,10 +63818,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
63785
63818
|
key: "method_overwrites_builtin",
|
|
63786
63819
|
title: "Method name overwrites builtin function",
|
|
63787
63820
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
63788
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
63789
|
-
|
|
63790
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
63791
|
-
|
|
63821
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
63822
|
+
|
|
63823
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
63824
|
+
|
|
63792
63825
|
Interface method names are ignored`,
|
|
63793
63826
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
63794
63827
|
};
|
|
@@ -64358,7 +64391,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
64358
64391
|
key: "nesting",
|
|
64359
64392
|
title: "Check nesting depth",
|
|
64360
64393
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
64361
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
64394
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
64362
64395
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
64363
64396
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64364
64397
|
};
|
|
@@ -64601,7 +64634,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
64601
64634
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
64602
64635
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64603
64636
|
badExample: `var1 = var2 = var3.`,
|
|
64604
|
-
goodExample: `var2 = var3.
|
|
64637
|
+
goodExample: `var2 = var3.
|
|
64605
64638
|
var1 = var2.`,
|
|
64606
64639
|
};
|
|
64607
64640
|
}
|
|
@@ -64660,8 +64693,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
64660
64693
|
key: "no_external_form_calls",
|
|
64661
64694
|
title: "No external FORM calls",
|
|
64662
64695
|
shortDescription: `Detect external form calls`,
|
|
64663
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
64664
|
-
|
|
64696
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
64697
|
+
|
|
64665
64698
|
PERFORM foo(bar).`,
|
|
64666
64699
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
64667
64700
|
};
|
|
@@ -64722,17 +64755,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
64722
64755
|
key: "no_inline_in_optional_branches",
|
|
64723
64756
|
title: "Don't declare inline in optional branches",
|
|
64724
64757
|
shortDescription: `Don't declare inline in optional branches`,
|
|
64725
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
64726
|
-
|
|
64727
|
-
Considered optional branches:
|
|
64728
|
-
* inside IF/ELSEIF/ELSE
|
|
64729
|
-
* inside LOOP
|
|
64730
|
-
* inside WHILE
|
|
64731
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
64732
|
-
* inside DO
|
|
64733
|
-
* inside SELECT loops
|
|
64734
|
-
|
|
64735
|
-
Not considered optional branches:
|
|
64758
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
64759
|
+
|
|
64760
|
+
Considered optional branches:
|
|
64761
|
+
* inside IF/ELSEIF/ELSE
|
|
64762
|
+
* inside LOOP
|
|
64763
|
+
* inside WHILE
|
|
64764
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
64765
|
+
* inside DO
|
|
64766
|
+
* inside SELECT loops
|
|
64767
|
+
|
|
64768
|
+
Not considered optional branches:
|
|
64736
64769
|
* TRY/CATCH/CLEANUP`,
|
|
64737
64770
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64738
64771
|
};
|
|
@@ -64831,12 +64864,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
64831
64864
|
key: "no_prefixes",
|
|
64832
64865
|
title: "No Prefixes",
|
|
64833
64866
|
shortDescription: `Dont use hungarian notation`,
|
|
64834
|
-
extendedInformation: `
|
|
64835
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
64836
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
64837
|
-
|
|
64838
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
64839
|
-
|
|
64867
|
+
extendedInformation: `
|
|
64868
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
64869
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
64870
|
+
|
|
64871
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
64872
|
+
|
|
64840
64873
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
64841
64874
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64842
64875
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -65009,7 +65042,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
65009
65042
|
return {
|
|
65010
65043
|
key: "no_public_attributes",
|
|
65011
65044
|
title: "No public attributes",
|
|
65012
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65045
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65013
65046
|
Exceptions are excluded from this rule.`,
|
|
65014
65047
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
65015
65048
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -65110,13 +65143,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
65110
65143
|
key: "no_yoda_conditions",
|
|
65111
65144
|
title: "No Yoda conditions",
|
|
65112
65145
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
65113
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65114
|
-
|
|
65146
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65147
|
+
|
|
65115
65148
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
65116
65149
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65117
|
-
badExample: `IF 0 <> sy-subrc.
|
|
65150
|
+
badExample: `IF 0 <> sy-subrc.
|
|
65118
65151
|
ENDIF.`,
|
|
65119
|
-
goodExample: `IF sy-subrc <> 0.
|
|
65152
|
+
goodExample: `IF sy-subrc <> 0.
|
|
65120
65153
|
ENDIF.`,
|
|
65121
65154
|
};
|
|
65122
65155
|
}
|
|
@@ -65217,8 +65250,8 @@ class NROBConsistency {
|
|
|
65217
65250
|
key: "nrob_consistency",
|
|
65218
65251
|
title: "Number range consistency",
|
|
65219
65252
|
shortDescription: `Consistency checks for number ranges`,
|
|
65220
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
65221
|
-
|
|
65253
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
65254
|
+
|
|
65222
65255
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
65223
65256
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65224
65257
|
};
|
|
@@ -65495,58 +65528,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
65495
65528
|
title: "Obsolete statements",
|
|
65496
65529
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
65497
65530
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
65498
|
-
extendedInformation: `
|
|
65499
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
65500
|
-
|
|
65501
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
65502
|
-
|
|
65503
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
65504
|
-
|
|
65505
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
65506
|
-
|
|
65507
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
65508
|
-
|
|
65509
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
65510
|
-
|
|
65511
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65512
|
-
|
|
65513
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65514
|
-
|
|
65515
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
65516
|
-
|
|
65517
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
65518
|
-
|
|
65519
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
65520
|
-
|
|
65521
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
65522
|
-
|
|
65523
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
65524
|
-
|
|
65525
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
65526
|
-
|
|
65527
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
65528
|
-
SELECT COUNT(*) is considered okay
|
|
65529
|
-
|
|
65530
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
65531
|
-
|
|
65532
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
65533
|
-
|
|
65534
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
65535
|
-
|
|
65536
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
65537
|
-
|
|
65538
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
65539
|
-
|
|
65531
|
+
extendedInformation: `
|
|
65532
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
65533
|
+
|
|
65534
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
65535
|
+
|
|
65536
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
65537
|
+
|
|
65538
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
65539
|
+
|
|
65540
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
65541
|
+
|
|
65542
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
65543
|
+
|
|
65544
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65545
|
+
|
|
65546
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65547
|
+
|
|
65548
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
65549
|
+
|
|
65550
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
65551
|
+
|
|
65552
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
65553
|
+
|
|
65554
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
65555
|
+
|
|
65556
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
65557
|
+
|
|
65558
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
65559
|
+
|
|
65560
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
65561
|
+
SELECT COUNT(*) is considered okay
|
|
65562
|
+
|
|
65563
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
65564
|
+
|
|
65565
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
65566
|
+
|
|
65567
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
65568
|
+
|
|
65569
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
65570
|
+
|
|
65571
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
65572
|
+
|
|
65540
65573
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
65541
|
-
badExample: `REFRESH itab.
|
|
65542
|
-
|
|
65543
|
-
COMPUTE foo = 2 + 2.
|
|
65544
|
-
|
|
65545
|
-
MULTIPLY lv_foo BY 2.
|
|
65546
|
-
|
|
65547
|
-
INTERFACE intf LOAD.
|
|
65548
|
-
|
|
65549
|
-
IF foo IS SUPPLIED.
|
|
65574
|
+
badExample: `REFRESH itab.
|
|
65575
|
+
|
|
65576
|
+
COMPUTE foo = 2 + 2.
|
|
65577
|
+
|
|
65578
|
+
MULTIPLY lv_foo BY 2.
|
|
65579
|
+
|
|
65580
|
+
INTERFACE intf LOAD.
|
|
65581
|
+
|
|
65582
|
+
IF foo IS SUPPLIED.
|
|
65550
65583
|
ENDIF.`,
|
|
65551
65584
|
};
|
|
65552
65585
|
}
|
|
@@ -65886,9 +65919,9 @@ class OmitParameterName {
|
|
|
65886
65919
|
key: "omit_parameter_name",
|
|
65887
65920
|
title: "Omit parameter name",
|
|
65888
65921
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
65889
|
-
extendedInformation: `
|
|
65890
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
65891
|
-
|
|
65922
|
+
extendedInformation: `
|
|
65923
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
65924
|
+
|
|
65892
65925
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
65893
65926
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
65894
65927
|
badExample: `method( param = 2 ).`,
|
|
@@ -66094,20 +66127,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
66094
66127
|
shortDescription: `Omit RECEIVING`,
|
|
66095
66128
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
66096
66129
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66097
|
-
badExample: `
|
|
66098
|
-
upload_pack(
|
|
66099
|
-
EXPORTING
|
|
66100
|
-
io_client = lo_client
|
|
66101
|
-
iv_url = iv_url
|
|
66102
|
-
iv_deepen_level = iv_deepen_level
|
|
66103
|
-
it_hashes = lt_hashes
|
|
66104
|
-
RECEIVING
|
|
66130
|
+
badExample: `
|
|
66131
|
+
upload_pack(
|
|
66132
|
+
EXPORTING
|
|
66133
|
+
io_client = lo_client
|
|
66134
|
+
iv_url = iv_url
|
|
66135
|
+
iv_deepen_level = iv_deepen_level
|
|
66136
|
+
it_hashes = lt_hashes
|
|
66137
|
+
RECEIVING
|
|
66105
66138
|
rt_objects = et_objects ).`,
|
|
66106
|
-
goodExample: `
|
|
66107
|
-
et_objects = upload_pack(
|
|
66108
|
-
io_client = lo_client
|
|
66109
|
-
iv_url = iv_url
|
|
66110
|
-
iv_deepen_level = iv_deepen_level
|
|
66139
|
+
goodExample: `
|
|
66140
|
+
et_objects = upload_pack(
|
|
66141
|
+
io_client = lo_client
|
|
66142
|
+
iv_url = iv_url
|
|
66143
|
+
iv_deepen_level = iv_deepen_level
|
|
66111
66144
|
it_hashes = lt_hashes ).`,
|
|
66112
66145
|
};
|
|
66113
66146
|
}
|
|
@@ -66171,8 +66204,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
66171
66204
|
return {
|
|
66172
66205
|
key: "parser_702_chaining",
|
|
66173
66206
|
title: "Parser Error, bad chanining on 702",
|
|
66174
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
66175
|
-
this rule finds these and reports errors.
|
|
66207
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
66208
|
+
this rule finds these and reports errors.
|
|
66176
66209
|
Only active on target version 702 and below.`,
|
|
66177
66210
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
66178
66211
|
};
|
|
@@ -66252,8 +66285,8 @@ class ParserError {
|
|
|
66252
66285
|
return {
|
|
66253
66286
|
key: "parser_error",
|
|
66254
66287
|
title: "Parser error",
|
|
66255
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
66256
|
-
|
|
66288
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
66289
|
+
|
|
66257
66290
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
66258
66291
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
66259
66292
|
};
|
|
@@ -66338,7 +66371,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
66338
66371
|
return {
|
|
66339
66372
|
key: "parser_missing_space",
|
|
66340
66373
|
title: "Parser Error, missing space",
|
|
66341
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
66374
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
66342
66375
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
66343
66376
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
66344
66377
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -66750,25 +66783,25 @@ class PreferInline {
|
|
|
66750
66783
|
key: "prefer_inline",
|
|
66751
66784
|
title: "Prefer Inline Declarations",
|
|
66752
66785
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
66753
|
-
extendedInformation: `EXPERIMENTAL
|
|
66754
|
-
|
|
66755
|
-
Activates if language version is v740sp02 or above.
|
|
66756
|
-
|
|
66757
|
-
Variables must be local(METHOD or FORM).
|
|
66758
|
-
|
|
66759
|
-
No generic or void typed variables. No syntax errors.
|
|
66760
|
-
|
|
66761
|
-
First position used must be a full/pure write.
|
|
66762
|
-
|
|
66763
|
-
Move statment is not a cast(?=)
|
|
66764
|
-
|
|
66786
|
+
extendedInformation: `EXPERIMENTAL
|
|
66787
|
+
|
|
66788
|
+
Activates if language version is v740sp02 or above.
|
|
66789
|
+
|
|
66790
|
+
Variables must be local(METHOD or FORM).
|
|
66791
|
+
|
|
66792
|
+
No generic or void typed variables. No syntax errors.
|
|
66793
|
+
|
|
66794
|
+
First position used must be a full/pure write.
|
|
66795
|
+
|
|
66796
|
+
Move statment is not a cast(?=)
|
|
66797
|
+
|
|
66765
66798
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
66766
66799
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
66767
|
-
badExample: `DATA foo TYPE i.
|
|
66768
|
-
foo = 2.
|
|
66769
|
-
DATA percentage TYPE decfloat34.
|
|
66800
|
+
badExample: `DATA foo TYPE i.
|
|
66801
|
+
foo = 2.
|
|
66802
|
+
DATA percentage TYPE decfloat34.
|
|
66770
66803
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
66771
|
-
goodExample: `DATA(foo) = 2.
|
|
66804
|
+
goodExample: `DATA(foo) = 2.
|
|
66772
66805
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
66773
66806
|
};
|
|
66774
66807
|
}
|
|
@@ -66982,18 +67015,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
66982
67015
|
key: "prefer_is_not",
|
|
66983
67016
|
title: "Prefer IS NOT to NOT IS",
|
|
66984
67017
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
66985
|
-
extendedInformation: `
|
|
66986
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
66987
|
-
|
|
67018
|
+
extendedInformation: `
|
|
67019
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67020
|
+
|
|
66988
67021
|
"if not is_valid( )." examples are skipped`,
|
|
66989
67022
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66990
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
66991
|
-
IF variable NP 'TODO*'.
|
|
66992
|
-
IF variable <> 42.
|
|
67023
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
67024
|
+
IF variable NP 'TODO*'.
|
|
67025
|
+
IF variable <> 42.
|
|
66993
67026
|
IF variable CO 'hello'.`,
|
|
66994
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
66995
|
-
IF NOT variable CP 'TODO*'.
|
|
66996
|
-
IF NOT variable = 42.
|
|
67027
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
67028
|
+
IF NOT variable CP 'TODO*'.
|
|
67029
|
+
IF NOT variable = 42.
|
|
66997
67030
|
IF NOT variable CA 'hello'.`,
|
|
66998
67031
|
};
|
|
66999
67032
|
}
|
|
@@ -67181,14 +67214,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
67181
67214
|
key: "prefer_raise_exception_new",
|
|
67182
67215
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
67183
67216
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
67184
|
-
extendedInformation: `
|
|
67185
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
67186
|
-
|
|
67217
|
+
extendedInformation: `
|
|
67218
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
67219
|
+
|
|
67187
67220
|
From 752 and up`,
|
|
67188
67221
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
67189
67222
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
67190
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
67191
|
-
EXPORTING
|
|
67223
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
67224
|
+
EXPORTING
|
|
67192
67225
|
previous = exception.`,
|
|
67193
67226
|
};
|
|
67194
67227
|
}
|
|
@@ -67266,7 +67299,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
67266
67299
|
key: "prefer_returning_to_exporting",
|
|
67267
67300
|
title: "Prefer RETURNING to EXPORTING",
|
|
67268
67301
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
67269
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
67302
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
67270
67303
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
67271
67304
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67272
67305
|
};
|
|
@@ -67363,8 +67396,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
67363
67396
|
key: "prefer_xsdbool",
|
|
67364
67397
|
title: "Prefer xsdbool over boolc",
|
|
67365
67398
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
67366
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
67367
|
-
|
|
67399
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
67400
|
+
|
|
67368
67401
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
67369
67402
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
67370
67403
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -67658,26 +67691,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
67658
67691
|
key: "reduce_procedural_code",
|
|
67659
67692
|
title: "Reduce procedural code",
|
|
67660
67693
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
67661
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
67662
|
-
|
|
67663
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
67664
|
-
|
|
67694
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
67695
|
+
|
|
67696
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
67697
|
+
|
|
67665
67698
|
Comments are not counted as statements.`,
|
|
67666
67699
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67667
|
-
badExample: `FORM foo.
|
|
67668
|
-
DATA lv_bar TYPE i.
|
|
67669
|
-
lv_bar = 2 + 2.
|
|
67670
|
-
IF lv_bar = 4.
|
|
67671
|
-
WRITE 'hello world'.
|
|
67672
|
-
ENDIF.
|
|
67673
|
-
DATA lv_bar TYPE i.
|
|
67674
|
-
lv_bar = 2 + 2.
|
|
67675
|
-
IF lv_bar = 4.
|
|
67676
|
-
WRITE 'hello world'.
|
|
67677
|
-
ENDIF.
|
|
67700
|
+
badExample: `FORM foo.
|
|
67701
|
+
DATA lv_bar TYPE i.
|
|
67702
|
+
lv_bar = 2 + 2.
|
|
67703
|
+
IF lv_bar = 4.
|
|
67704
|
+
WRITE 'hello world'.
|
|
67705
|
+
ENDIF.
|
|
67706
|
+
DATA lv_bar TYPE i.
|
|
67707
|
+
lv_bar = 2 + 2.
|
|
67708
|
+
IF lv_bar = 4.
|
|
67709
|
+
WRITE 'hello world'.
|
|
67710
|
+
ENDIF.
|
|
67678
67711
|
ENDFORM.`,
|
|
67679
|
-
goodExample: `FORM foo.
|
|
67680
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
67712
|
+
goodExample: `FORM foo.
|
|
67713
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
67681
67714
|
ENDFORM.`,
|
|
67682
67715
|
};
|
|
67683
67716
|
}
|
|
@@ -67921,10 +67954,10 @@ class RemoveDescriptions {
|
|
|
67921
67954
|
return {
|
|
67922
67955
|
key: "remove_descriptions",
|
|
67923
67956
|
title: "Remove descriptions",
|
|
67924
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
67925
|
-
|
|
67926
|
-
Class descriptions are required, see rule description_empty.
|
|
67927
|
-
|
|
67957
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
67958
|
+
|
|
67959
|
+
Class descriptions are required, see rule description_empty.
|
|
67960
|
+
|
|
67928
67961
|
Consider using ABAP Doc for documentation.`,
|
|
67929
67962
|
tags: [],
|
|
67930
67963
|
};
|
|
@@ -68049,16 +68082,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
68049
68082
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68050
68083
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
68051
68084
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
68052
|
-
badExample: `
|
|
68053
|
-
CALL FUNCTION 'ZRFC'
|
|
68085
|
+
badExample: `
|
|
68086
|
+
CALL FUNCTION 'ZRFC'
|
|
68054
68087
|
DESTINATION lv_rfc.`,
|
|
68055
|
-
goodExample: `
|
|
68056
|
-
CALL FUNCTION 'ZRFC'
|
|
68057
|
-
DESTINATION lv_rfc
|
|
68058
|
-
EXCEPTIONS
|
|
68059
|
-
system_failure = 1 MESSAGE msg
|
|
68060
|
-
communication_failure = 2 MESSAGE msg
|
|
68061
|
-
resource_failure = 3
|
|
68088
|
+
goodExample: `
|
|
68089
|
+
CALL FUNCTION 'ZRFC'
|
|
68090
|
+
DESTINATION lv_rfc
|
|
68091
|
+
EXCEPTIONS
|
|
68092
|
+
system_failure = 1 MESSAGE msg
|
|
68093
|
+
communication_failure = 2 MESSAGE msg
|
|
68094
|
+
resource_failure = 3
|
|
68062
68095
|
OTHERS = 4.`,
|
|
68063
68096
|
};
|
|
68064
68097
|
}
|
|
@@ -68142,11 +68175,11 @@ class SelectAddOrderBy {
|
|
|
68142
68175
|
key: "select_add_order_by",
|
|
68143
68176
|
title: "SELECT add ORDER BY",
|
|
68144
68177
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
68145
|
-
extendedInformation: `
|
|
68146
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68147
|
-
|
|
68148
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
68149
|
-
|
|
68178
|
+
extendedInformation: `
|
|
68179
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68180
|
+
|
|
68181
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
68182
|
+
|
|
68150
68183
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
68151
68184
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68152
68185
|
};
|
|
@@ -68275,14 +68308,14 @@ class SelectPerformance {
|
|
|
68275
68308
|
key: "select_performance",
|
|
68276
68309
|
title: "SELECT performance",
|
|
68277
68310
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
68278
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
68279
|
-
|
|
68311
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
68312
|
+
|
|
68280
68313
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
68281
68314
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
68282
|
-
badExample: `SELECT field1, field2 FROM table
|
|
68283
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
68315
|
+
badExample: `SELECT field1, field2 FROM table
|
|
68316
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
68284
68317
|
ENDSELECT.`,
|
|
68285
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
68318
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
68286
68319
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
68287
68320
|
};
|
|
68288
68321
|
}
|
|
@@ -68394,8 +68427,8 @@ class SelectSingleFullKey {
|
|
|
68394
68427
|
key: "select_single_full_key",
|
|
68395
68428
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
68396
68429
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
68397
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
68398
|
-
|
|
68430
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
68431
|
+
|
|
68399
68432
|
If the statement contains a JOIN it is not checked`,
|
|
68400
68433
|
pseudoComment: "EC CI_NOORDER",
|
|
68401
68434
|
tags: [],
|
|
@@ -68812,8 +68845,8 @@ class SICFConsistency {
|
|
|
68812
68845
|
key: "sicf_consistency",
|
|
68813
68846
|
title: "SICF consistency",
|
|
68814
68847
|
shortDescription: `Checks the validity of ICF services`,
|
|
68815
|
-
extendedInformation: `* Class defined in handler must exist
|
|
68816
|
-
* Class must not have any syntax errors
|
|
68848
|
+
extendedInformation: `* Class defined in handler must exist
|
|
68849
|
+
* Class must not have any syntax errors
|
|
68817
68850
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
68818
68851
|
};
|
|
68819
68852
|
}
|
|
@@ -69180,8 +69213,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
69180
69213
|
key: "space_before_dot",
|
|
69181
69214
|
title: "Space before dot",
|
|
69182
69215
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
69183
|
-
extendedInformation: `
|
|
69184
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
69216
|
+
extendedInformation: `
|
|
69217
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
69185
69218
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
69186
69219
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69187
69220
|
badExample: `WRITE bar .`,
|
|
@@ -69367,12 +69400,12 @@ class SQLValueConversion {
|
|
|
69367
69400
|
key: "sql_value_conversion",
|
|
69368
69401
|
title: "Implicit SQL Value Conversion",
|
|
69369
69402
|
shortDescription: `Ensure types match when selecting from database`,
|
|
69370
|
-
extendedInformation: `
|
|
69371
|
-
* Integer to CHAR conversion
|
|
69372
|
-
* Integer to NUMC conversion
|
|
69373
|
-
* NUMC to Integer conversion
|
|
69374
|
-
* CHAR to Integer conversion
|
|
69375
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
69403
|
+
extendedInformation: `
|
|
69404
|
+
* Integer to CHAR conversion
|
|
69405
|
+
* Integer to NUMC conversion
|
|
69406
|
+
* NUMC to Integer conversion
|
|
69407
|
+
* CHAR to Integer conversion
|
|
69408
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
69376
69409
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
69377
69410
|
tags: [],
|
|
69378
69411
|
};
|
|
@@ -69444,7 +69477,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
69444
69477
|
key: "start_at_tab",
|
|
69445
69478
|
title: "Start at tab",
|
|
69446
69479
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
69447
|
-
extendedInformation: `Reports max 100 issues per file
|
|
69480
|
+
extendedInformation: `Reports max 100 issues per file
|
|
69448
69481
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
69449
69482
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69450
69483
|
badExample: ` WRITE a.`,
|
|
@@ -69621,12 +69654,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
69621
69654
|
key: "strict_sql",
|
|
69622
69655
|
title: "Strict SQL",
|
|
69623
69656
|
shortDescription: `Strict SQL`,
|
|
69624
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
69625
|
-
|
|
69626
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
69627
|
-
|
|
69628
|
-
Also see separate rule sql_escape_host_variables
|
|
69629
|
-
|
|
69657
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
69658
|
+
|
|
69659
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
69660
|
+
|
|
69661
|
+
Also see separate rule sql_escape_host_variables
|
|
69662
|
+
|
|
69630
69663
|
Activates from v750 and up`,
|
|
69631
69664
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
69632
69665
|
};
|
|
@@ -69878,11 +69911,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
69878
69911
|
key: "sy_modification",
|
|
69879
69912
|
title: "Modification of SY fields",
|
|
69880
69913
|
shortDescription: `Finds modification of sy fields`,
|
|
69881
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
69882
|
-
|
|
69914
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
69915
|
+
|
|
69883
69916
|
Changes to SY-TVAR* fields are not reported`,
|
|
69884
69917
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69885
|
-
badExample: `sy-uname = 2.
|
|
69918
|
+
badExample: `sy-uname = 2.
|
|
69886
69919
|
sy = sy.`,
|
|
69887
69920
|
};
|
|
69888
69921
|
}
|
|
@@ -69944,8 +69977,8 @@ class TABLEnhancementCategory {
|
|
|
69944
69977
|
key: "tabl_enhancement_category",
|
|
69945
69978
|
title: "TABL enhancement category must be set",
|
|
69946
69979
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
69947
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
69948
|
-
|
|
69980
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
69981
|
+
|
|
69949
69982
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
69950
69983
|
tags: [],
|
|
69951
69984
|
};
|
|
@@ -70073,9 +70106,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
70073
70106
|
title: "Type FORM parameters",
|
|
70074
70107
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
70075
70108
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70076
|
-
badExample: `FORM foo USING bar.
|
|
70109
|
+
badExample: `FORM foo USING bar.
|
|
70077
70110
|
ENDFORM.`,
|
|
70078
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
70111
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
70079
70112
|
ENDFORM.`,
|
|
70080
70113
|
};
|
|
70081
70114
|
}
|
|
@@ -70685,7 +70718,7 @@ class UnnecessaryChaining extends _abap_rule_1.ABAPRule {
|
|
|
70685
70718
|
j = 1;
|
|
70686
70719
|
let prevStatement = statements[i - j];
|
|
70687
70720
|
while ((prevStatement === null || prevStatement === void 0 ? void 0 : prevStatement.get()) instanceof _statement_1.Comment) {
|
|
70688
|
-
j
|
|
70721
|
+
j++;
|
|
70689
70722
|
prevStatement = statements[i - j];
|
|
70690
70723
|
}
|
|
70691
70724
|
const next = nextStatement === null || nextStatement === void 0 ? void 0 : nextStatement.getColon();
|
|
@@ -70745,38 +70778,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
70745
70778
|
key: "unnecessary_pragma",
|
|
70746
70779
|
title: "Unnecessary Pragma",
|
|
70747
70780
|
shortDescription: `Finds pragmas which can be removed`,
|
|
70748
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
70749
|
-
|
|
70750
|
-
* NEEDED without definition
|
|
70751
|
-
|
|
70752
|
-
* NO_TEXT without texts
|
|
70753
|
-
|
|
70754
|
-
* SUBRC_OK where sy-subrc is checked
|
|
70755
|
-
|
|
70781
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
70782
|
+
|
|
70783
|
+
* NEEDED without definition
|
|
70784
|
+
|
|
70785
|
+
* NO_TEXT without texts
|
|
70786
|
+
|
|
70787
|
+
* SUBRC_OK where sy-subrc is checked
|
|
70788
|
+
|
|
70756
70789
|
NO_HANDLER inside macros are not checked`,
|
|
70757
70790
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70758
|
-
badExample: `TRY.
|
|
70759
|
-
...
|
|
70760
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
70761
|
-
RETURN. " it has a handler
|
|
70762
|
-
ENDTRY.
|
|
70763
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
70764
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
70765
|
-
IF sy-subrc <> 0.
|
|
70791
|
+
badExample: `TRY.
|
|
70792
|
+
...
|
|
70793
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
70794
|
+
RETURN. " it has a handler
|
|
70795
|
+
ENDTRY.
|
|
70796
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
70797
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
70798
|
+
IF sy-subrc <> 0.
|
|
70766
70799
|
ENDIF.`,
|
|
70767
|
-
goodExample: `TRY.
|
|
70768
|
-
...
|
|
70769
|
-
CATCH zcx_abapgit_exception.
|
|
70770
|
-
RETURN.
|
|
70771
|
-
ENDTRY.
|
|
70772
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
70773
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
70774
|
-
IF sy-subrc <> 0.
|
|
70775
|
-
ENDIF.
|
|
70776
|
-
|
|
70777
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
70778
|
-
test1 TYPE string,
|
|
70779
|
-
test2 TYPE string,
|
|
70800
|
+
goodExample: `TRY.
|
|
70801
|
+
...
|
|
70802
|
+
CATCH zcx_abapgit_exception.
|
|
70803
|
+
RETURN.
|
|
70804
|
+
ENDTRY.
|
|
70805
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
70806
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
70807
|
+
IF sy-subrc <> 0.
|
|
70808
|
+
ENDIF.
|
|
70809
|
+
|
|
70810
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
70811
|
+
test1 TYPE string,
|
|
70812
|
+
test2 TYPE string,
|
|
70780
70813
|
END OF blah.`,
|
|
70781
70814
|
};
|
|
70782
70815
|
}
|
|
@@ -70934,18 +70967,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
70934
70967
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
70935
70968
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
70936
70969
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70937
|
-
badExample: `FORM hello1.
|
|
70938
|
-
WRITE 'world'.
|
|
70939
|
-
RETURN.
|
|
70940
|
-
ENDFORM.
|
|
70941
|
-
|
|
70942
|
-
FORM foo.
|
|
70943
|
-
IF 1 = 2.
|
|
70944
|
-
RETURN.
|
|
70945
|
-
ENDIF.
|
|
70970
|
+
badExample: `FORM hello1.
|
|
70971
|
+
WRITE 'world'.
|
|
70972
|
+
RETURN.
|
|
70973
|
+
ENDFORM.
|
|
70974
|
+
|
|
70975
|
+
FORM foo.
|
|
70976
|
+
IF 1 = 2.
|
|
70977
|
+
RETURN.
|
|
70978
|
+
ENDIF.
|
|
70946
70979
|
ENDFORM.`,
|
|
70947
|
-
goodExample: `FORM hello2.
|
|
70948
|
-
WRITE 'world'.
|
|
70980
|
+
goodExample: `FORM hello2.
|
|
70981
|
+
WRITE 'world'.
|
|
70949
70982
|
ENDFORM.`,
|
|
70950
70983
|
};
|
|
70951
70984
|
}
|
|
@@ -71312,17 +71345,17 @@ class UnusedMethods {
|
|
|
71312
71345
|
key: "unused_methods",
|
|
71313
71346
|
title: "Unused methods",
|
|
71314
71347
|
shortDescription: `Checks for unused methods`,
|
|
71315
|
-
extendedInformation: `Checks private and protected methods.
|
|
71316
|
-
|
|
71317
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
71318
|
-
|
|
71319
|
-
Skips:
|
|
71320
|
-
* methods FOR TESTING
|
|
71321
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
71322
|
-
* class_constructor + constructor methods
|
|
71323
|
-
* event handlers
|
|
71324
|
-
* methods that are redefined
|
|
71325
|
-
* INCLUDEs
|
|
71348
|
+
extendedInformation: `Checks private and protected methods.
|
|
71349
|
+
|
|
71350
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
71351
|
+
|
|
71352
|
+
Skips:
|
|
71353
|
+
* methods FOR TESTING
|
|
71354
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
71355
|
+
* class_constructor + constructor methods
|
|
71356
|
+
* event handlers
|
|
71357
|
+
* methods that are redefined
|
|
71358
|
+
* INCLUDEs
|
|
71326
71359
|
`,
|
|
71327
71360
|
tags: [],
|
|
71328
71361
|
pragma: "##CALLED",
|
|
@@ -71712,23 +71745,23 @@ class UnusedVariables {
|
|
|
71712
71745
|
key: "unused_variables",
|
|
71713
71746
|
title: "Unused variables",
|
|
71714
71747
|
shortDescription: `Checks for unused variables and constants`,
|
|
71715
|
-
extendedInformation: `Skips event parameters.
|
|
71716
|
-
|
|
71717
|
-
Note that this currently does not work if the source code uses macros.
|
|
71718
|
-
|
|
71719
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
71720
|
-
|
|
71748
|
+
extendedInformation: `Skips event parameters.
|
|
71749
|
+
|
|
71750
|
+
Note that this currently does not work if the source code uses macros.
|
|
71751
|
+
|
|
71752
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
71753
|
+
|
|
71721
71754
|
Errors found in INCLUDES are reported for the main program.`,
|
|
71722
71755
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
71723
71756
|
pragma: "##NEEDED",
|
|
71724
71757
|
pseudoComment: "EC NEEDED",
|
|
71725
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
71726
|
-
test TYPE string,
|
|
71727
|
-
test2 TYPE string,
|
|
71758
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
71759
|
+
test TYPE string,
|
|
71760
|
+
test2 TYPE string,
|
|
71728
71761
|
END OF blah1.`,
|
|
71729
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
71730
|
-
test TYPE string,
|
|
71731
|
-
test2 TYPE string,
|
|
71762
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
71763
|
+
test TYPE string,
|
|
71764
|
+
test2 TYPE string,
|
|
71732
71765
|
END OF blah2.`,
|
|
71733
71766
|
};
|
|
71734
71767
|
}
|
|
@@ -71947,15 +71980,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
71947
71980
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
71948
71981
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
71949
71982
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
71950
|
-
badExample: `IF line IS INITIAL.
|
|
71951
|
-
has_entries = abap_false.
|
|
71952
|
-
ELSE.
|
|
71953
|
-
has_entries = abap_true.
|
|
71954
|
-
ENDIF.
|
|
71955
|
-
|
|
71983
|
+
badExample: `IF line IS INITIAL.
|
|
71984
|
+
has_entries = abap_false.
|
|
71985
|
+
ELSE.
|
|
71986
|
+
has_entries = abap_true.
|
|
71987
|
+
ENDIF.
|
|
71988
|
+
|
|
71956
71989
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
71957
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
71958
|
-
|
|
71990
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
71991
|
+
|
|
71959
71992
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
71960
71993
|
};
|
|
71961
71994
|
}
|
|
@@ -72131,15 +72164,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
72131
72164
|
key: "use_line_exists",
|
|
72132
72165
|
title: "Use line_exists",
|
|
72133
72166
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
72134
|
-
extendedInformation: `
|
|
72135
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
72136
|
-
|
|
72167
|
+
extendedInformation: `
|
|
72168
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
72169
|
+
|
|
72137
72170
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
72138
72171
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72139
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
72140
|
-
IF sy-subrc = 0.
|
|
72172
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
72173
|
+
IF sy-subrc = 0.
|
|
72141
72174
|
ENDIF.`,
|
|
72142
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
72175
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
72143
72176
|
ENDIF.`,
|
|
72144
72177
|
};
|
|
72145
72178
|
}
|
|
@@ -72249,10 +72282,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
72249
72282
|
key: "use_new",
|
|
72250
72283
|
title: "Use NEW",
|
|
72251
72284
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
72252
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
72253
|
-
|
|
72254
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
72255
|
-
|
|
72285
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
72286
|
+
|
|
72287
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
72288
|
+
|
|
72256
72289
|
Applicable from v740sp02 and up`,
|
|
72257
72290
|
badExample: `CREATE OBJECT ref.`,
|
|
72258
72291
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -72350,13 +72383,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
72350
72383
|
title: "WHEN OTHERS last",
|
|
72351
72384
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
72352
72385
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72353
|
-
badExample: `CASE bar.
|
|
72354
|
-
WHEN OTHERS.
|
|
72355
|
-
WHEN 2.
|
|
72386
|
+
badExample: `CASE bar.
|
|
72387
|
+
WHEN OTHERS.
|
|
72388
|
+
WHEN 2.
|
|
72356
72389
|
ENDCASE.`,
|
|
72357
|
-
goodExample: `CASE bar.
|
|
72358
|
-
WHEN 2.
|
|
72359
|
-
WHEN OTHERS.
|
|
72390
|
+
goodExample: `CASE bar.
|
|
72391
|
+
WHEN 2.
|
|
72392
|
+
WHEN OTHERS.
|
|
72360
72393
|
ENDCASE.`,
|
|
72361
72394
|
};
|
|
72362
72395
|
}
|