@abaplint/cli 2.113.66 → 2.113.67
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 +866 -850
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -5039,7 +5039,7 @@ exports.EntityAssociation = void 0;
|
|
|
5039
5039
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
5040
5040
|
class EntityAssociation extends combi_1.Expression {
|
|
5041
5041
|
getRunnable() {
|
|
5042
|
-
return (0, combi_1.regex)(
|
|
5042
|
+
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[\_\w\\~]+$/);
|
|
5043
5043
|
}
|
|
5044
5044
|
}
|
|
5045
5045
|
exports.EntityAssociation = EntityAssociation;
|
|
@@ -9408,10 +9408,16 @@ class TypeStructure extends combi_1.Expression {
|
|
|
9408
9408
|
const hier = (0, combi_1.seq)("HIERARCHY", _1.NamespaceSimpleName);
|
|
9409
9409
|
const create = (0, combi_1.seq)("CREATE", (0, combi_1.alt)(_1.NamespaceSimpleName, _1.EntityAssociation));
|
|
9410
9410
|
const update = (0, combi_1.seq)("UPDATE", (0, combi_1.alt)(_1.NamespaceSimpleName, _1.EntityAssociation));
|
|
9411
|
+
const readResult = (0, combi_1.seq)("READ RESULT", (0, combi_1.alt)(_1.NamespaceSimpleName, _1.EntityAssociation));
|
|
9411
9412
|
const action = (0, combi_1.seq)("ACTION IMPORT", _1.Source);
|
|
9412
9413
|
const permissionsRequest = (0, combi_1.seq)("PERMISSIONS REQUEST", _1.NamespaceSimpleName);
|
|
9413
9414
|
const evt = (0, combi_1.seq)("EVENT", _1.EventName);
|
|
9414
|
-
|
|
9415
|
+
const failedEarly = (0, combi_1.seq)("FAILED EARLY", _1.NamespaceSimpleName);
|
|
9416
|
+
const mappedEarly = (0, combi_1.seq)("MAPPED EARLY", _1.NamespaceSimpleName);
|
|
9417
|
+
const reportedEarly = (0, combi_1.seq)("REPORTED EARLY", _1.NamespaceSimpleName);
|
|
9418
|
+
const structure = (0, combi_1.seq)("STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt, create, update, action, permissionsRequest, readResult));
|
|
9419
|
+
const response = (0, combi_1.seq)("RESPONSE FOR", (0, combi_1.altPrio)(failedEarly, mappedEarly, reportedEarly));
|
|
9420
|
+
return (0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(structure, response));
|
|
9415
9421
|
}
|
|
9416
9422
|
}
|
|
9417
9423
|
exports.TypeStructure = TypeStructure;
|
|
@@ -9447,7 +9453,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
9447
9453
|
// "WITH" is not allowed as a field name in keys
|
|
9448
9454
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
9449
9455
|
const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(_1.Integer, field_chain_1.FieldChain));
|
|
9450
|
-
const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "FAILED", "LOCK", "READ RESULT", "UPDATE"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
|
|
9456
|
+
const derived = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("TABLE FOR", (0, combi_1.altPrio)("ACTION IMPORT", "ACTION RESULT", "CREATE", "EVENT", "REPORTED EARLY", "FAILED EARLY", "FAILED", "LOCK", "DETERMINATION", "READ RESULT", "UPDATE"), (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation)));
|
|
9451
9457
|
const oldType = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), _1.TypeName, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
|
|
9452
9458
|
const oldLike = (0, combi_1.seq)((0, combi_1.opt)("REF TO"), field_chain_1.FieldChain, (0, combi_1.alt)((0, combi_1.seq)(occurs, (0, combi_1.opt)(header)), header));
|
|
9453
9459
|
const typeLine = (0, combi_1.seq)("LINE OF", _1.TypeName, occurs, header);
|
|
@@ -11261,7 +11267,10 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
11261
11267
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
11262
11268
|
class CommitEntities {
|
|
11263
11269
|
getMatcher() {
|
|
11264
|
-
const
|
|
11270
|
+
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
11271
|
+
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
11272
|
+
const responses = (0, combi_1.seq)("RESPONSES", failed, reported);
|
|
11273
|
+
const s = (0, combi_1.seq)("COMMIT ENTITIES", (0, combi_1.optPrio)("IN SIMULATION MODE"), (0, combi_1.opt)(responses), (0, combi_1.opt)((0, combi_1.seq)("RESPONSE OF", expressions_1.NamespaceSimpleName, failed, reported)));
|
|
11265
11274
|
return (0, combi_1.ver)(version_1.Version.v754, s);
|
|
11266
11275
|
}
|
|
11267
11276
|
}
|
|
@@ -14834,8 +14843,15 @@ class ModifyEntities {
|
|
|
14834
14843
|
getMatcher() {
|
|
14835
14844
|
const fieldsWith = (0, combi_1.seq)("FIELDS (", (0, combi_1.plus)(expressions_1.SimpleName), ") WITH", expressions_1.Source);
|
|
14836
14845
|
const operation = (0, combi_1.alt)((0, combi_1.seq)("UPDATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("CREATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("UPDATE", fieldsWith), (0, combi_1.seq)("DELETE FROM", expressions_1.Source), (0, combi_1.seq)("EXECUTE", expressions_1.SimpleName, "FROM", expressions_1.Source), (0, combi_1.seq)("CREATE", (0, combi_1.optPrio)("AUTO FILL CID"), fieldsWith));
|
|
14837
|
-
const
|
|
14838
|
-
|
|
14846
|
+
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
14847
|
+
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
14848
|
+
const mapped = (0, combi_1.seq)("MAPPED", expressions_1.Target);
|
|
14849
|
+
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
14850
|
+
const from = (0, combi_1.seq)("FROM", expressions_1.Source);
|
|
14851
|
+
const execute = (0, combi_1.seq)("EXECUTE", expressions_1.NamespaceSimpleName);
|
|
14852
|
+
const entities = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, operation, (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported)));
|
|
14853
|
+
const entity = (0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, execute, from, mapped, failed, reported);
|
|
14854
|
+
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity)));
|
|
14839
14855
|
}
|
|
14840
14856
|
}
|
|
14841
14857
|
exports.ModifyEntities = ModifyEntities;
|
|
@@ -35374,13 +35390,13 @@ class FlowGraph {
|
|
|
35374
35390
|
this.label = label;
|
|
35375
35391
|
}
|
|
35376
35392
|
toDigraph() {
|
|
35377
|
-
return `digraph G {
|
|
35378
|
-
labelloc="t";
|
|
35379
|
-
label="${this.label}";
|
|
35380
|
-
graph [fontname = "helvetica"];
|
|
35381
|
-
node [fontname = "helvetica", shape="box"];
|
|
35382
|
-
edge [fontname = "helvetica"];
|
|
35383
|
-
${this.toTextEdges()}
|
|
35393
|
+
return `digraph G {
|
|
35394
|
+
labelloc="t";
|
|
35395
|
+
label="${this.label}";
|
|
35396
|
+
graph [fontname = "helvetica"];
|
|
35397
|
+
node [fontname = "helvetica", shape="box"];
|
|
35398
|
+
edge [fontname = "helvetica"];
|
|
35399
|
+
${this.toTextEdges()}
|
|
35384
35400
|
}`;
|
|
35385
35401
|
}
|
|
35386
35402
|
listSources(node) {
|
|
@@ -43800,13 +43816,13 @@ class Help {
|
|
|
43800
43816
|
/////////////////////////////////////////////////
|
|
43801
43817
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43802
43818
|
let content = "";
|
|
43803
|
-
content = `
|
|
43804
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43805
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43806
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43807
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43808
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43809
|
-
<hr>
|
|
43819
|
+
content = `
|
|
43820
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43821
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43822
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43823
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43824
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43825
|
+
<hr>
|
|
43810
43826
|
` +
|
|
43811
43827
|
"<tt>" + textDocument.uri + " (" +
|
|
43812
43828
|
(position.line + 1) + ", " +
|
|
@@ -43961,9 +43977,9 @@ class Help {
|
|
|
43961
43977
|
return ret + "</ul>";
|
|
43962
43978
|
}
|
|
43963
43979
|
static tokens(file) {
|
|
43964
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
43965
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
43966
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
43980
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
43981
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
43982
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
43967
43983
|
</tr>`;
|
|
43968
43984
|
for (const token of file.getTokens()) {
|
|
43969
43985
|
const tStart = token.getStart();
|
|
@@ -53218,7 +53234,7 @@ class Registry {
|
|
|
53218
53234
|
}
|
|
53219
53235
|
static abaplintVersion() {
|
|
53220
53236
|
// magic, see build script "version.sh"
|
|
53221
|
-
return "2.113.
|
|
53237
|
+
return "2.113.67";
|
|
53222
53238
|
}
|
|
53223
53239
|
getDDICReferences() {
|
|
53224
53240
|
return this.ddicReferences;
|
|
@@ -53537,10 +53553,10 @@ class SevenBitAscii {
|
|
|
53537
53553
|
key: "7bit_ascii",
|
|
53538
53554
|
title: "Check for 7bit ascii",
|
|
53539
53555
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53540
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53541
|
-
|
|
53542
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53543
|
-
|
|
53556
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53557
|
+
|
|
53558
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53559
|
+
|
|
53544
53560
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53545
53561
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53546
53562
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53746,10 +53762,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53746
53762
|
key: "abapdoc",
|
|
53747
53763
|
title: "Check abapdoc",
|
|
53748
53764
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53749
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53750
|
-
|
|
53751
|
-
Plus class and interface definitions.
|
|
53752
|
-
|
|
53765
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53766
|
+
|
|
53767
|
+
Plus class and interface definitions.
|
|
53768
|
+
|
|
53753
53769
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53754
53770
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53755
53771
|
};
|
|
@@ -53886,27 +53902,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53886
53902
|
title: "Add test attributes for tests classes with test methods",
|
|
53887
53903
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53888
53904
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53889
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53890
|
-
PUBLIC SECTION.
|
|
53891
|
-
PROTECTED SECTION.
|
|
53892
|
-
PRIVATE SECTION.
|
|
53893
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53894
|
-
ENDCLASS.
|
|
53895
|
-
|
|
53896
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53897
|
-
METHOD test.
|
|
53898
|
-
ENDMETHOD.
|
|
53905
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53906
|
+
PUBLIC SECTION.
|
|
53907
|
+
PROTECTED SECTION.
|
|
53908
|
+
PRIVATE SECTION.
|
|
53909
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53910
|
+
ENDCLASS.
|
|
53911
|
+
|
|
53912
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53913
|
+
METHOD test.
|
|
53914
|
+
ENDMETHOD.
|
|
53899
53915
|
ENDCLASS.`,
|
|
53900
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53901
|
-
PUBLIC SECTION.
|
|
53902
|
-
PROTECTED SECTION.
|
|
53903
|
-
PRIVATE SECTION.
|
|
53904
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53905
|
-
ENDCLASS.
|
|
53906
|
-
|
|
53907
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53908
|
-
METHOD test.
|
|
53909
|
-
ENDMETHOD.
|
|
53916
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53917
|
+
PUBLIC SECTION.
|
|
53918
|
+
PROTECTED SECTION.
|
|
53919
|
+
PRIVATE SECTION.
|
|
53920
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53921
|
+
ENDCLASS.
|
|
53922
|
+
|
|
53923
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53924
|
+
METHOD test.
|
|
53925
|
+
ENDMETHOD.
|
|
53910
53926
|
ENDCLASS.`,
|
|
53911
53927
|
};
|
|
53912
53928
|
}
|
|
@@ -53992,49 +54008,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53992
54008
|
key: "align_parameters",
|
|
53993
54009
|
title: "Align Parameters",
|
|
53994
54010
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53995
|
-
extendedInformation: `Checks:
|
|
53996
|
-
* function module calls
|
|
53997
|
-
* method calls
|
|
53998
|
-
* VALUE constructors
|
|
53999
|
-
* NEW constructors
|
|
54000
|
-
* RAISE EXCEPTION statements
|
|
54001
|
-
* CREATE OBJECT statements
|
|
54002
|
-
* RAISE EVENT statements
|
|
54003
|
-
|
|
54004
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54005
|
-
|
|
54006
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54007
|
-
|
|
54008
|
-
If parameters are on the same row, no issues are reported, see
|
|
54011
|
+
extendedInformation: `Checks:
|
|
54012
|
+
* function module calls
|
|
54013
|
+
* method calls
|
|
54014
|
+
* VALUE constructors
|
|
54015
|
+
* NEW constructors
|
|
54016
|
+
* RAISE EXCEPTION statements
|
|
54017
|
+
* CREATE OBJECT statements
|
|
54018
|
+
* RAISE EVENT statements
|
|
54019
|
+
|
|
54020
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54021
|
+
|
|
54022
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54023
|
+
|
|
54024
|
+
If parameters are on the same row, no issues are reported, see
|
|
54009
54025
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
54010
54026
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
54011
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54012
|
-
EXPORTING
|
|
54013
|
-
foo = 2
|
|
54014
|
-
parameter = 3.
|
|
54015
|
-
|
|
54016
|
-
foobar( moo = 1
|
|
54017
|
-
param = 1 ).
|
|
54018
|
-
|
|
54019
|
-
foo = VALUE #(
|
|
54020
|
-
foo = bar
|
|
54027
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54028
|
+
EXPORTING
|
|
54029
|
+
foo = 2
|
|
54030
|
+
parameter = 3.
|
|
54031
|
+
|
|
54032
|
+
foobar( moo = 1
|
|
54033
|
+
param = 1 ).
|
|
54034
|
+
|
|
54035
|
+
foo = VALUE #(
|
|
54036
|
+
foo = bar
|
|
54021
54037
|
moo = 2 ).`,
|
|
54022
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54023
|
-
EXPORTING
|
|
54024
|
-
foo = 2
|
|
54025
|
-
parameter = 3.
|
|
54026
|
-
|
|
54027
|
-
foobar( moo = 1
|
|
54028
|
-
param = 1 ).
|
|
54029
|
-
|
|
54030
|
-
foo = VALUE #(
|
|
54031
|
-
foo = bar
|
|
54032
|
-
moo = 2 ).
|
|
54033
|
-
|
|
54034
|
-
DATA(sdf) = VALUE type(
|
|
54035
|
-
common_val = 2
|
|
54036
|
-
another_common = 5
|
|
54037
|
-
( row_value = 4
|
|
54038
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54039
|
+
EXPORTING
|
|
54040
|
+
foo = 2
|
|
54041
|
+
parameter = 3.
|
|
54042
|
+
|
|
54043
|
+
foobar( moo = 1
|
|
54044
|
+
param = 1 ).
|
|
54045
|
+
|
|
54046
|
+
foo = VALUE #(
|
|
54047
|
+
foo = bar
|
|
54048
|
+
moo = 2 ).
|
|
54049
|
+
|
|
54050
|
+
DATA(sdf) = VALUE type(
|
|
54051
|
+
common_val = 2
|
|
54052
|
+
another_common = 5
|
|
54053
|
+
( row_value = 4
|
|
54038
54054
|
value_foo = 5 ) ).`,
|
|
54039
54055
|
};
|
|
54040
54056
|
}
|
|
@@ -54468,37 +54484,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54468
54484
|
key: "align_type_expressions",
|
|
54469
54485
|
title: "Align TYPE expressions",
|
|
54470
54486
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54471
|
-
extendedInformation: `
|
|
54472
|
-
Currently works for METHODS + BEGIN OF
|
|
54473
|
-
|
|
54474
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54475
|
-
|
|
54476
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54487
|
+
extendedInformation: `
|
|
54488
|
+
Currently works for METHODS + BEGIN OF
|
|
54489
|
+
|
|
54490
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54491
|
+
|
|
54492
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54477
54493
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54478
54494
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54479
|
-
badExample: `
|
|
54480
|
-
TYPES: BEGIN OF foo,
|
|
54481
|
-
bar TYPE i,
|
|
54482
|
-
foobar TYPE i,
|
|
54483
|
-
END OF foo.
|
|
54484
|
-
|
|
54485
|
-
INTERFACE lif.
|
|
54486
|
-
METHODS bar
|
|
54487
|
-
IMPORTING
|
|
54488
|
-
foo TYPE i
|
|
54489
|
-
foobar TYPE i.
|
|
54495
|
+
badExample: `
|
|
54496
|
+
TYPES: BEGIN OF foo,
|
|
54497
|
+
bar TYPE i,
|
|
54498
|
+
foobar TYPE i,
|
|
54499
|
+
END OF foo.
|
|
54500
|
+
|
|
54501
|
+
INTERFACE lif.
|
|
54502
|
+
METHODS bar
|
|
54503
|
+
IMPORTING
|
|
54504
|
+
foo TYPE i
|
|
54505
|
+
foobar TYPE i.
|
|
54490
54506
|
ENDINTERFACE.`,
|
|
54491
|
-
goodExample: `
|
|
54492
|
-
TYPES: BEGIN OF foo,
|
|
54493
|
-
bar TYPE i,
|
|
54494
|
-
foobar TYPE i,
|
|
54495
|
-
END OF foo.
|
|
54496
|
-
|
|
54497
|
-
INTERFACE lif.
|
|
54498
|
-
METHODS bar
|
|
54499
|
-
IMPORTING
|
|
54500
|
-
foo TYPE i
|
|
54501
|
-
foobar TYPE i.
|
|
54507
|
+
goodExample: `
|
|
54508
|
+
TYPES: BEGIN OF foo,
|
|
54509
|
+
bar TYPE i,
|
|
54510
|
+
foobar TYPE i,
|
|
54511
|
+
END OF foo.
|
|
54512
|
+
|
|
54513
|
+
INTERFACE lif.
|
|
54514
|
+
METHODS bar
|
|
54515
|
+
IMPORTING
|
|
54516
|
+
foo TYPE i
|
|
54517
|
+
foobar TYPE i.
|
|
54502
54518
|
ENDINTERFACE.`,
|
|
54503
54519
|
};
|
|
54504
54520
|
}
|
|
@@ -54777,16 +54793,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54777
54793
|
return {
|
|
54778
54794
|
key: "ambiguous_statement",
|
|
54779
54795
|
title: "Check for ambigious statements",
|
|
54780
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54781
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54782
|
-
|
|
54796
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54797
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54798
|
+
|
|
54783
54799
|
Only works if the target version is 740sp05 or above`,
|
|
54784
54800
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54785
|
-
badExample: `DELETE foo FROM bar.
|
|
54801
|
+
badExample: `DELETE foo FROM bar.
|
|
54786
54802
|
MODIFY foo FROM bar.`,
|
|
54787
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54788
|
-
DELETE TABLE itab FROM 2.
|
|
54789
|
-
MODIFY zfoo FROM @wa.
|
|
54803
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54804
|
+
DELETE TABLE itab FROM 2.
|
|
54805
|
+
MODIFY zfoo FROM @wa.
|
|
54790
54806
|
MODIFY TABLE foo FROM bar.`,
|
|
54791
54807
|
};
|
|
54792
54808
|
}
|
|
@@ -54891,16 +54907,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54891
54907
|
key: "avoid_use",
|
|
54892
54908
|
title: "Avoid use of certain statements",
|
|
54893
54909
|
shortDescription: `Detects usage of certain statements.`,
|
|
54894
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54895
|
-
|
|
54896
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54897
|
-
|
|
54898
|
-
STATICS: use CLASS-DATA instead
|
|
54899
|
-
|
|
54900
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54901
|
-
|
|
54902
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54903
|
-
|
|
54910
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54911
|
+
|
|
54912
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54913
|
+
|
|
54914
|
+
STATICS: use CLASS-DATA instead
|
|
54915
|
+
|
|
54916
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54917
|
+
|
|
54918
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54919
|
+
|
|
54904
54920
|
BREAK points`,
|
|
54905
54921
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54906
54922
|
};
|
|
@@ -55032,11 +55048,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
55032
55048
|
title: "Check BEGIN END names",
|
|
55033
55049
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
55034
55050
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55035
|
-
badExample: `DATA: BEGIN OF stru,
|
|
55036
|
-
field TYPE i,
|
|
55051
|
+
badExample: `DATA: BEGIN OF stru,
|
|
55052
|
+
field TYPE i,
|
|
55037
55053
|
END OF structure_not_the_same.`,
|
|
55038
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
55039
|
-
field TYPE i,
|
|
55054
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
55055
|
+
field TYPE i,
|
|
55040
55056
|
END OF stru.`,
|
|
55041
55057
|
};
|
|
55042
55058
|
}
|
|
@@ -55133,20 +55149,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
55133
55149
|
title: "BEGIN contains single INCLUDE",
|
|
55134
55150
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
55135
55151
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55136
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
55137
|
-
INCLUDE TYPE dselc.
|
|
55138
|
-
TYPES: END OF dummy1.
|
|
55139
|
-
|
|
55140
|
-
DATA BEGIN OF foo.
|
|
55141
|
-
INCLUDE STRUCTURE syst.
|
|
55142
|
-
DATA END OF foo.
|
|
55143
|
-
|
|
55144
|
-
STATICS BEGIN OF bar.
|
|
55145
|
-
INCLUDE STRUCTURE syst.
|
|
55152
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
55153
|
+
INCLUDE TYPE dselc.
|
|
55154
|
+
TYPES: END OF dummy1.
|
|
55155
|
+
|
|
55156
|
+
DATA BEGIN OF foo.
|
|
55157
|
+
INCLUDE STRUCTURE syst.
|
|
55158
|
+
DATA END OF foo.
|
|
55159
|
+
|
|
55160
|
+
STATICS BEGIN OF bar.
|
|
55161
|
+
INCLUDE STRUCTURE syst.
|
|
55146
55162
|
STATICS END OF bar.`,
|
|
55147
|
-
goodExample: `DATA BEGIN OF foo.
|
|
55148
|
-
DATA field TYPE i.
|
|
55149
|
-
INCLUDE STRUCTURE dselc.
|
|
55163
|
+
goodExample: `DATA BEGIN OF foo.
|
|
55164
|
+
DATA field TYPE i.
|
|
55165
|
+
INCLUDE STRUCTURE dselc.
|
|
55150
55166
|
DATA END OF foo.`,
|
|
55151
55167
|
};
|
|
55152
55168
|
}
|
|
@@ -55236,9 +55252,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
55236
55252
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
55237
55253
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55238
55254
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
55239
|
-
goodExample: `TRY.
|
|
55240
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55241
|
-
CATCH cx_sy_authorization_error.
|
|
55255
|
+
goodExample: `TRY.
|
|
55256
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55257
|
+
CATCH cx_sy_authorization_error.
|
|
55242
55258
|
ENDTRY.`,
|
|
55243
55259
|
};
|
|
55244
55260
|
}
|
|
@@ -55303,10 +55319,10 @@ class CDSCommentStyle {
|
|
|
55303
55319
|
key: "cds_comment_style",
|
|
55304
55320
|
title: "CDS Comment Style",
|
|
55305
55321
|
shortDescription: `Check for obsolete comment style`,
|
|
55306
|
-
extendedInformation: `Check for obsolete comment style
|
|
55307
|
-
|
|
55308
|
-
Comments starting with "--" are considered obsolete
|
|
55309
|
-
|
|
55322
|
+
extendedInformation: `Check for obsolete comment style
|
|
55323
|
+
|
|
55324
|
+
Comments starting with "--" are considered obsolete
|
|
55325
|
+
|
|
55310
55326
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
55311
55327
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55312
55328
|
badExample: "-- this is a comment",
|
|
@@ -55372,10 +55388,10 @@ class CDSLegacyView {
|
|
|
55372
55388
|
key: "cds_legacy_view",
|
|
55373
55389
|
title: "CDS Legacy View",
|
|
55374
55390
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55375
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55376
|
-
|
|
55377
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55378
|
-
|
|
55391
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55392
|
+
|
|
55393
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55394
|
+
|
|
55379
55395
|
v755 and up`,
|
|
55380
55396
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55381
55397
|
};
|
|
@@ -55530,10 +55546,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55530
55546
|
key: "chain_mainly_declarations",
|
|
55531
55547
|
title: "Chain mainly declarations",
|
|
55532
55548
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55533
|
-
extendedInformation: `
|
|
55534
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55535
|
-
|
|
55536
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55549
|
+
extendedInformation: `
|
|
55550
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55551
|
+
|
|
55552
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55537
55553
|
`,
|
|
55538
55554
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55539
55555
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55709,17 +55725,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55709
55725
|
title: "Change IF to CASE",
|
|
55710
55726
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55711
55727
|
// eslint-disable-next-line max-len
|
|
55712
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55713
|
-
|
|
55728
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55729
|
+
|
|
55714
55730
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55715
55731
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55716
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55717
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55718
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55732
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55733
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55734
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55719
55735
|
ENDIF.`,
|
|
55720
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55721
|
-
WHEN 'FOO'.
|
|
55722
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55736
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55737
|
+
WHEN 'FOO'.
|
|
55738
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55723
55739
|
ENDCASE.`,
|
|
55724
55740
|
};
|
|
55725
55741
|
}
|
|
@@ -55856,8 +55872,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55856
55872
|
return {
|
|
55857
55873
|
key: "check_abstract",
|
|
55858
55874
|
title: "Check abstract methods and classes",
|
|
55859
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55860
|
-
- class defined as abstract and final,
|
|
55875
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55876
|
+
- class defined as abstract and final,
|
|
55861
55877
|
- non-abstract class contains abstract methods`,
|
|
55862
55878
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55863
55879
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55938,11 +55954,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55938
55954
|
return {
|
|
55939
55955
|
key: "check_comments",
|
|
55940
55956
|
title: "Check Comments",
|
|
55941
|
-
shortDescription: `
|
|
55957
|
+
shortDescription: `
|
|
55942
55958
|
Various checks for comment usage.`,
|
|
55943
|
-
extendedInformation: `
|
|
55944
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55945
|
-
|
|
55959
|
+
extendedInformation: `
|
|
55960
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55961
|
+
|
|
55946
55962
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55947
55963
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55948
55964
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -56104,9 +56120,9 @@ class CheckInclude {
|
|
|
56104
56120
|
key: "check_include",
|
|
56105
56121
|
title: "Check INCLUDEs",
|
|
56106
56122
|
shortDescription: `Checks INCLUDE statements`,
|
|
56107
|
-
extendedInformation: `
|
|
56108
|
-
* Reports unused includes
|
|
56109
|
-
* Errors if the includes are not found
|
|
56123
|
+
extendedInformation: `
|
|
56124
|
+
* Reports unused includes
|
|
56125
|
+
* Errors if the includes are not found
|
|
56110
56126
|
* Error if including a main program`,
|
|
56111
56127
|
tags: [_irule_1.RuleTag.Syntax],
|
|
56112
56128
|
};
|
|
@@ -56182,14 +56198,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
56182
56198
|
key: "check_subrc",
|
|
56183
56199
|
title: "Check sy-subrc",
|
|
56184
56200
|
shortDescription: `Check sy-subrc`,
|
|
56185
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56186
|
-
|
|
56187
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56188
|
-
|
|
56189
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56190
|
-
|
|
56191
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56192
|
-
|
|
56201
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56202
|
+
|
|
56203
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56204
|
+
|
|
56205
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56206
|
+
|
|
56207
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56208
|
+
|
|
56193
56209
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
56194
56210
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56195
56211
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56759,17 +56775,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56759
56775
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56760
56776
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56761
56777
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56762
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56763
|
-
EXCEPTIONS
|
|
56764
|
-
system_failure = 1 MESSAGE lv_message
|
|
56765
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56766
|
-
resource_failure = 1
|
|
56778
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56779
|
+
EXCEPTIONS
|
|
56780
|
+
system_failure = 1 MESSAGE lv_message
|
|
56781
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56782
|
+
resource_failure = 1
|
|
56767
56783
|
OTHERS = 1.`,
|
|
56768
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56769
|
-
EXCEPTIONS
|
|
56770
|
-
system_failure = 1 MESSAGE lv_message
|
|
56771
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56772
|
-
resource_failure = 3
|
|
56784
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56785
|
+
EXCEPTIONS
|
|
56786
|
+
system_failure = 1 MESSAGE lv_message
|
|
56787
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56788
|
+
resource_failure = 3
|
|
56773
56789
|
OTHERS = 4.`,
|
|
56774
56790
|
};
|
|
56775
56791
|
}
|
|
@@ -57015,7 +57031,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
57015
57031
|
key: "commented_code",
|
|
57016
57032
|
title: "Find commented code",
|
|
57017
57033
|
shortDescription: `Detects usage of commented out code.`,
|
|
57018
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57034
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57019
57035
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
57020
57036
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
57021
57037
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -57248,10 +57264,10 @@ class ConstructorVisibilityPublic {
|
|
|
57248
57264
|
key: "constructor_visibility_public",
|
|
57249
57265
|
title: "Check constructor visibility is public",
|
|
57250
57266
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
57251
|
-
extendedInformation: `
|
|
57252
|
-
This only applies to global classes.
|
|
57253
|
-
|
|
57254
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57267
|
+
extendedInformation: `
|
|
57268
|
+
This only applies to global classes.
|
|
57269
|
+
|
|
57270
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57255
57271
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
57256
57272
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57257
57273
|
};
|
|
@@ -57326,8 +57342,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
57326
57342
|
key: "contains_tab",
|
|
57327
57343
|
title: "Code contains tab",
|
|
57328
57344
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
57329
|
-
extendedInformation: `
|
|
57330
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57345
|
+
extendedInformation: `
|
|
57346
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
57331
57347
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
57332
57348
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57333
57349
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57414,10 +57430,10 @@ class CyclicOO {
|
|
|
57414
57430
|
key: "cyclic_oo",
|
|
57415
57431
|
title: "Cyclic OO",
|
|
57416
57432
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57417
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57418
|
-
|
|
57419
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57420
|
-
|
|
57433
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57434
|
+
|
|
57435
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57436
|
+
|
|
57421
57437
|
References in testclass includes are ignored`,
|
|
57422
57438
|
};
|
|
57423
57439
|
}
|
|
@@ -57660,7 +57676,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57660
57676
|
key: "dangerous_statement",
|
|
57661
57677
|
title: "Dangerous statement",
|
|
57662
57678
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57663
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57679
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57664
57680
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57665
57681
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57666
57682
|
};
|
|
@@ -57867,13 +57883,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57867
57883
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57868
57884
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57869
57885
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57870
|
-
badExample: `FROM foo.
|
|
57871
|
-
WRITE 'hello'.
|
|
57872
|
-
DATA int TYPE i.
|
|
57886
|
+
badExample: `FROM foo.
|
|
57887
|
+
WRITE 'hello'.
|
|
57888
|
+
DATA int TYPE i.
|
|
57873
57889
|
ENDFORM.`,
|
|
57874
|
-
goodExample: `FROM foo.
|
|
57875
|
-
DATA int TYPE i.
|
|
57876
|
-
WRITE 'hello'.
|
|
57890
|
+
goodExample: `FROM foo.
|
|
57891
|
+
DATA int TYPE i.
|
|
57892
|
+
WRITE 'hello'.
|
|
57877
57893
|
ENDFORM.`,
|
|
57878
57894
|
};
|
|
57879
57895
|
}
|
|
@@ -58412,39 +58428,39 @@ class Downport {
|
|
|
58412
58428
|
key: "downport",
|
|
58413
58429
|
title: "Downport statement",
|
|
58414
58430
|
shortDescription: `Downport functionality`,
|
|
58415
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58416
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58417
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58418
|
-
|
|
58419
|
-
Current rules:
|
|
58420
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58421
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58422
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58423
|
-
* CONV is outlined
|
|
58424
|
-
* COND is outlined
|
|
58425
|
-
* REDUCE is outlined
|
|
58426
|
-
* SWITCH is outlined
|
|
58427
|
-
* FILTER is outlined
|
|
58428
|
-
* APPEND expression is outlined
|
|
58429
|
-
* INSERT expression is outlined
|
|
58430
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58431
|
-
* CAST changed to ?=
|
|
58432
|
-
* LOOP AT method_call( ) is outlined
|
|
58433
|
-
* VALUE # with structure fields
|
|
58434
|
-
* VALUE # with internal table lines
|
|
58435
|
-
* Table Expressions are outlined
|
|
58436
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58437
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58438
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58439
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58440
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58441
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58442
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58443
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58444
|
-
* MESSAGE with non simple source
|
|
58445
|
-
|
|
58446
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58447
|
-
|
|
58431
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58432
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58433
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58434
|
+
|
|
58435
|
+
Current rules:
|
|
58436
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58437
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58438
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58439
|
+
* CONV is outlined
|
|
58440
|
+
* COND is outlined
|
|
58441
|
+
* REDUCE is outlined
|
|
58442
|
+
* SWITCH is outlined
|
|
58443
|
+
* FILTER is outlined
|
|
58444
|
+
* APPEND expression is outlined
|
|
58445
|
+
* INSERT expression is outlined
|
|
58446
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58447
|
+
* CAST changed to ?=
|
|
58448
|
+
* LOOP AT method_call( ) is outlined
|
|
58449
|
+
* VALUE # with structure fields
|
|
58450
|
+
* VALUE # with internal table lines
|
|
58451
|
+
* Table Expressions are outlined
|
|
58452
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58453
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58454
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58455
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58456
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58457
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58458
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58459
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58460
|
+
* MESSAGE with non simple source
|
|
58461
|
+
|
|
58462
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58463
|
+
|
|
58448
58464
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58449
58465
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58450
58466
|
};
|
|
@@ -59022,10 +59038,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
59022
59038
|
const fieldName = f.concatTokens();
|
|
59023
59039
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
59024
59040
|
}
|
|
59025
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59041
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59026
59042
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
59027
59043
|
}
|
|
59028
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59044
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59029
59045
|
${indentation}`);
|
|
59030
59046
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
59031
59047
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59084,12 +59100,12 @@ ${indentation}`);
|
|
|
59084
59100
|
}
|
|
59085
59101
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59086
59102
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
59087
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59088
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59089
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59103
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59104
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59105
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59090
59106
|
${indentation}`);
|
|
59091
59107
|
if (fieldDefinitions === "") {
|
|
59092
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59108
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59093
59109
|
${indentation}`);
|
|
59094
59110
|
}
|
|
59095
59111
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -59157,7 +59173,7 @@ ${indentation}`);
|
|
|
59157
59173
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59158
59174
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59159
59175
|
const firstToken = high.getFirstToken();
|
|
59160
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59176
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59161
59177
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59162
59178
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59163
59179
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59211,7 +59227,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59211
59227
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59212
59228
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59213
59229
|
const firstToken = high.getFirstToken();
|
|
59214
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59230
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59215
59231
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59216
59232
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59217
59233
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59253,14 +59269,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59253
59269
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59254
59270
|
const firstToken = high.getFirstToken();
|
|
59255
59271
|
// note that the tabix restore should be done before throwing the exception
|
|
59256
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59257
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59258
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59259
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59260
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59261
|
-
${indentation}IF sy-subrc <> 0.
|
|
59262
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59263
|
-
${indentation}ENDIF.
|
|
59272
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59273
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59274
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59275
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59276
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59277
|
+
${indentation}IF sy-subrc <> 0.
|
|
59278
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59279
|
+
${indentation}ENDIF.
|
|
59264
59280
|
${indentation}`);
|
|
59265
59281
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
59266
59282
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59317,7 +59333,7 @@ ${indentation}`);
|
|
|
59317
59333
|
const className = classNames[0].concatTokens();
|
|
59318
59334
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59319
59335
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59320
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59336
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59321
59337
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
59322
59338
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
59323
59339
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59479,16 +59495,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59479
59495
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59480
59496
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59481
59497
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59482
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59483
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59498
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59499
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59484
59500
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59485
59501
|
if (withs.length > 0) {
|
|
59486
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59487
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59488
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59502
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59503
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59504
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59489
59505
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59490
59506
|
}
|
|
59491
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59507
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59492
59508
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59493
59509
|
if (withs.length > 0) {
|
|
59494
59510
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59600,10 +59616,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59600
59616
|
let code = "";
|
|
59601
59617
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59602
59618
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59603
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59604
|
-
IF sy-subrc <> 0.
|
|
59605
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59606
|
-
ENDIF.
|
|
59619
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59620
|
+
IF sy-subrc <> 0.
|
|
59621
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59622
|
+
ENDIF.
|
|
59607
59623
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59608
59624
|
}
|
|
59609
59625
|
else {
|
|
@@ -59692,20 +59708,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59692
59708
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59693
59709
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59694
59710
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59695
|
-
code += ` items LIKE ${loopSourceName},
|
|
59696
|
-
END OF ${groupTargetName}type.
|
|
59697
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59698
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59711
|
+
code += ` items LIKE ${loopSourceName},
|
|
59712
|
+
END OF ${groupTargetName}type.
|
|
59713
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59714
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59699
59715
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59700
59716
|
if (groupIndexName !== undefined) {
|
|
59701
59717
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59702
59718
|
}
|
|
59703
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59719
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59704
59720
|
IF sy-subrc = 0.\n`;
|
|
59705
59721
|
if (groupCountName !== undefined) {
|
|
59706
59722
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59707
59723
|
}
|
|
59708
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59724
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59709
59725
|
ELSE.\n`;
|
|
59710
59726
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59711
59727
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59726,8 +59742,8 @@ ELSE.\n`;
|
|
|
59726
59742
|
}
|
|
59727
59743
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59728
59744
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59729
|
-
code += `ENDIF.
|
|
59730
|
-
ENDLOOP.
|
|
59745
|
+
code += `ENDIF.
|
|
59746
|
+
ENDLOOP.
|
|
59731
59747
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59732
59748
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59733
59749
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59899,7 +59915,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59899
59915
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59900
59916
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59901
59917
|
// all ENUMS are char like?
|
|
59902
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59918
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59903
59919
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59904
59920
|
let count = 1;
|
|
59905
59921
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59943,14 +59959,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59943
59959
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59944
59960
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59945
59961
|
// restore tabix before exeption
|
|
59946
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59947
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59948
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59949
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59950
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59951
|
-
${indentation}IF sy-subrc <> 0.
|
|
59952
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59953
|
-
${indentation}ENDIF.
|
|
59962
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59963
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59964
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59965
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59966
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59967
|
+
${indentation}IF sy-subrc <> 0.
|
|
59968
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59969
|
+
${indentation}ENDIF.
|
|
59954
59970
|
${indentation}${uniqueName}`;
|
|
59955
59971
|
const start = target.getFirstToken().getStart();
|
|
59956
59972
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -60030,11 +60046,11 @@ ${indentation}${uniqueName}`;
|
|
|
60030
60046
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60031
60047
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60032
60048
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60033
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
60034
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
60035
|
-
${indentation} EXPORTING
|
|
60036
|
-
${indentation} input = ${source}
|
|
60037
|
-
${indentation} IMPORTING
|
|
60049
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
60050
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
60051
|
+
${indentation} EXPORTING
|
|
60052
|
+
${indentation} input = ${source}
|
|
60053
|
+
${indentation} IMPORTING
|
|
60038
60054
|
${indentation} output = ${uniqueName}.\n`;
|
|
60039
60055
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
60040
60056
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -61346,12 +61362,12 @@ class EasyToFindMessages {
|
|
|
61346
61362
|
key: "easy_to_find_messages",
|
|
61347
61363
|
title: "Easy to find messages",
|
|
61348
61364
|
shortDescription: `Make messages easy to find`,
|
|
61349
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
61350
|
-
|
|
61351
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
61352
|
-
|
|
61353
|
-
Also see rule "message_exists"
|
|
61354
|
-
|
|
61365
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61366
|
+
|
|
61367
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61368
|
+
|
|
61369
|
+
Also see rule "message_exists"
|
|
61370
|
+
|
|
61355
61371
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61356
61372
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61357
61373
|
};
|
|
@@ -61432,13 +61448,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61432
61448
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61433
61449
|
extendedInformation: ``,
|
|
61434
61450
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61435
|
-
badExample: `
|
|
61436
|
-
INITIALIZATION.
|
|
61437
|
-
WRITE 'hello'.
|
|
61451
|
+
badExample: `
|
|
61452
|
+
INITIALIZATION.
|
|
61453
|
+
WRITE 'hello'.
|
|
61438
61454
|
END-OF-SELECTION.`,
|
|
61439
|
-
goodExample: `
|
|
61440
|
-
START-OF-SELECTION.
|
|
61441
|
-
PERFORM sdf.
|
|
61455
|
+
goodExample: `
|
|
61456
|
+
START-OF-SELECTION.
|
|
61457
|
+
PERFORM sdf.
|
|
61442
61458
|
COMMIT WORK.`,
|
|
61443
61459
|
};
|
|
61444
61460
|
}
|
|
@@ -61530,8 +61546,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61530
61546
|
key: "empty_line_in_statement",
|
|
61531
61547
|
title: "Find empty lines in statements",
|
|
61532
61548
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61533
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61534
|
-
|
|
61549
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61550
|
+
|
|
61535
61551
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61536
61552
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61537
61553
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61707,13 +61723,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61707
61723
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61708
61724
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61709
61725
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61710
|
-
badExample: `IF foo = bar.
|
|
61711
|
-
ENDIF.
|
|
61712
|
-
|
|
61713
|
-
DO 2 TIMES.
|
|
61726
|
+
badExample: `IF foo = bar.
|
|
61727
|
+
ENDIF.
|
|
61728
|
+
|
|
61729
|
+
DO 2 TIMES.
|
|
61714
61730
|
ENDDO.`,
|
|
61715
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61716
|
-
ENDLOOP.
|
|
61731
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61732
|
+
ENDLOOP.
|
|
61717
61733
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61718
61734
|
};
|
|
61719
61735
|
}
|
|
@@ -61855,10 +61871,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61855
61871
|
return {
|
|
61856
61872
|
key: "exit_or_check",
|
|
61857
61873
|
title: "Find EXIT or CHECK outside loops",
|
|
61858
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61874
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61859
61875
|
Use RETURN to leave procesing blocks instead.`,
|
|
61860
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61861
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61876
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61877
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61862
61878
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61863
61879
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61864
61880
|
};
|
|
@@ -61941,12 +61957,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61941
61957
|
key: "expand_macros",
|
|
61942
61958
|
title: "Expand Macros",
|
|
61943
61959
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61944
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61945
|
-
|
|
61960
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61961
|
+
|
|
61946
61962
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61947
|
-
badExample: `DEFINE _hello.
|
|
61948
|
-
WRITE 'hello'.
|
|
61949
|
-
END-OF-DEFINITION.
|
|
61963
|
+
badExample: `DEFINE _hello.
|
|
61964
|
+
WRITE 'hello'.
|
|
61965
|
+
END-OF-DEFINITION.
|
|
61950
61966
|
_hello.`,
|
|
61951
61967
|
goodExample: `WRITE 'hello'.`,
|
|
61952
61968
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -62033,7 +62049,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
62033
62049
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
62034
62050
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
62035
62051
|
goodExample: `call_method( foo = bar ).`,
|
|
62036
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62052
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62037
62053
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
62038
62054
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62039
62055
|
};
|
|
@@ -62131,7 +62147,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
62131
62147
|
key: "forbidden_identifier",
|
|
62132
62148
|
title: "Forbidden Identifier",
|
|
62133
62149
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
62134
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62150
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62135
62151
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
62136
62152
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62137
62153
|
};
|
|
@@ -62373,8 +62389,8 @@ class ForbiddenVoidType {
|
|
|
62373
62389
|
key: "forbidden_void_type",
|
|
62374
62390
|
title: "Forbidden Void Types",
|
|
62375
62391
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62376
|
-
extendedInformation: `Inspiration:
|
|
62377
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62392
|
+
extendedInformation: `Inspiration:
|
|
62393
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62378
62394
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62379
62395
|
};
|
|
62380
62396
|
}
|
|
@@ -62617,9 +62633,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62617
62633
|
key: "fully_type_itabs",
|
|
62618
62634
|
title: "Fully type internal tables",
|
|
62619
62635
|
shortDescription: `No implict table types or table keys`,
|
|
62620
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62636
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62621
62637
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62622
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62638
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62623
62639
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62624
62640
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62625
62641
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62804,26 +62820,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62804
62820
|
key: "functional_writing",
|
|
62805
62821
|
title: "Use functional writing",
|
|
62806
62822
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62807
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62823
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62808
62824
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62809
62825
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62810
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62811
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62812
|
-
EXPORTING
|
|
62813
|
-
p_name = 'NAME'
|
|
62814
|
-
RECEIVING
|
|
62815
|
-
p_descr_ref = lr_typedescr
|
|
62816
|
-
EXCEPTIONS
|
|
62817
|
-
type_not_found = 1
|
|
62826
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62827
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62828
|
+
EXPORTING
|
|
62829
|
+
p_name = 'NAME'
|
|
62830
|
+
RECEIVING
|
|
62831
|
+
p_descr_ref = lr_typedescr
|
|
62832
|
+
EXCEPTIONS
|
|
62833
|
+
type_not_found = 1
|
|
62818
62834
|
OTHERS = 2.`,
|
|
62819
|
-
goodExample: `zcl_class=>method( ).
|
|
62820
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62821
|
-
EXPORTING
|
|
62822
|
-
p_name = 'NAME'
|
|
62823
|
-
RECEIVING
|
|
62824
|
-
p_descr_ref = lr_typedescr
|
|
62825
|
-
EXCEPTIONS
|
|
62826
|
-
type_not_found = 1
|
|
62835
|
+
goodExample: `zcl_class=>method( ).
|
|
62836
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62837
|
+
EXPORTING
|
|
62838
|
+
p_name = 'NAME'
|
|
62839
|
+
RECEIVING
|
|
62840
|
+
p_descr_ref = lr_typedescr
|
|
62841
|
+
EXCEPTIONS
|
|
62842
|
+
type_not_found = 1
|
|
62827
62843
|
OTHERS = 2 ).`,
|
|
62828
62844
|
};
|
|
62829
62845
|
}
|
|
@@ -62934,14 +62950,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62934
62950
|
key: "global_class",
|
|
62935
62951
|
title: "Global class checks",
|
|
62936
62952
|
shortDescription: `Checks related to global classes`,
|
|
62937
|
-
extendedInformation: `* global classes must be in own files
|
|
62938
|
-
|
|
62939
|
-
* file names must match class name
|
|
62940
|
-
|
|
62941
|
-
* file names must match interface name
|
|
62942
|
-
|
|
62943
|
-
* global classes must be global definitions
|
|
62944
|
-
|
|
62953
|
+
extendedInformation: `* global classes must be in own files
|
|
62954
|
+
|
|
62955
|
+
* file names must match class name
|
|
62956
|
+
|
|
62957
|
+
* file names must match interface name
|
|
62958
|
+
|
|
62959
|
+
* global classes must be global definitions
|
|
62960
|
+
|
|
62945
62961
|
* global interfaces must be global definitions`,
|
|
62946
62962
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62947
62963
|
};
|
|
@@ -63040,21 +63056,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
63040
63056
|
return {
|
|
63041
63057
|
key: "identical_conditions",
|
|
63042
63058
|
title: "Identical conditions",
|
|
63043
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63044
|
-
|
|
63059
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63060
|
+
|
|
63045
63061
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
63046
63062
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63047
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63048
|
-
ENDIF.
|
|
63049
|
-
CASE bar.
|
|
63050
|
-
WHEN '1'.
|
|
63051
|
-
WHEN 'A' OR '1'.
|
|
63063
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63064
|
+
ENDIF.
|
|
63065
|
+
CASE bar.
|
|
63066
|
+
WHEN '1'.
|
|
63067
|
+
WHEN 'A' OR '1'.
|
|
63052
63068
|
ENDCASE.`,
|
|
63053
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
63054
|
-
ENDIF.
|
|
63055
|
-
CASE bar.
|
|
63056
|
-
WHEN '1'.
|
|
63057
|
-
WHEN 'A'.
|
|
63069
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
63070
|
+
ENDIF.
|
|
63071
|
+
CASE bar.
|
|
63072
|
+
WHEN '1'.
|
|
63073
|
+
WHEN 'A'.
|
|
63058
63074
|
ENDCASE.`,
|
|
63059
63075
|
};
|
|
63060
63076
|
}
|
|
@@ -63188,23 +63204,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
63188
63204
|
key: "identical_contents",
|
|
63189
63205
|
title: "Identical contents",
|
|
63190
63206
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
63191
|
-
extendedInformation: `
|
|
63192
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
63193
|
-
|
|
63207
|
+
extendedInformation: `
|
|
63208
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
63209
|
+
|
|
63194
63210
|
Chained statments are ignored`,
|
|
63195
63211
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63196
|
-
badExample: `IF foo = bar.
|
|
63197
|
-
WRITE 'bar'.
|
|
63198
|
-
WRITE 'world'.
|
|
63199
|
-
ELSE.
|
|
63200
|
-
WRITE 'foo'.
|
|
63201
|
-
WRITE 'world'.
|
|
63212
|
+
badExample: `IF foo = bar.
|
|
63213
|
+
WRITE 'bar'.
|
|
63214
|
+
WRITE 'world'.
|
|
63215
|
+
ELSE.
|
|
63216
|
+
WRITE 'foo'.
|
|
63217
|
+
WRITE 'world'.
|
|
63202
63218
|
ENDIF.`,
|
|
63203
|
-
goodExample: `IF foo = bar.
|
|
63204
|
-
WRITE 'bar'.
|
|
63205
|
-
ELSE.
|
|
63206
|
-
WRITE 'foo'.
|
|
63207
|
-
ENDIF.
|
|
63219
|
+
goodExample: `IF foo = bar.
|
|
63220
|
+
WRITE 'bar'.
|
|
63221
|
+
ELSE.
|
|
63222
|
+
WRITE 'foo'.
|
|
63223
|
+
ENDIF.
|
|
63208
63224
|
WRITE 'world'.`,
|
|
63209
63225
|
};
|
|
63210
63226
|
}
|
|
@@ -63312,12 +63328,12 @@ class IdenticalDescriptions {
|
|
|
63312
63328
|
key: "identical_descriptions",
|
|
63313
63329
|
title: "Identical descriptions",
|
|
63314
63330
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
63315
|
-
extendedInformation: `Case insensitive
|
|
63316
|
-
|
|
63317
|
-
Only checks the master language descriptions
|
|
63318
|
-
|
|
63319
|
-
Dependencies are skipped
|
|
63320
|
-
|
|
63331
|
+
extendedInformation: `Case insensitive
|
|
63332
|
+
|
|
63333
|
+
Only checks the master language descriptions
|
|
63334
|
+
|
|
63335
|
+
Dependencies are skipped
|
|
63336
|
+
|
|
63321
63337
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
63322
63338
|
tags: [],
|
|
63323
63339
|
};
|
|
@@ -63491,43 +63507,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63491
63507
|
key: "if_in_if",
|
|
63492
63508
|
title: "IF in IF",
|
|
63493
63509
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63494
|
-
extendedInformation: `
|
|
63495
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63496
|
-
|
|
63497
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63498
|
-
|
|
63499
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63510
|
+
extendedInformation: `
|
|
63511
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63512
|
+
|
|
63513
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63514
|
+
|
|
63515
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63500
63516
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63501
|
-
badExample: `IF condition1.
|
|
63502
|
-
IF condition2.
|
|
63503
|
-
...
|
|
63504
|
-
ENDIF.
|
|
63505
|
-
ENDIF.
|
|
63506
|
-
|
|
63507
|
-
IF condition1.
|
|
63508
|
-
...
|
|
63509
|
-
ELSE.
|
|
63510
|
-
IF condition2.
|
|
63511
|
-
...
|
|
63512
|
-
ENDIF.
|
|
63517
|
+
badExample: `IF condition1.
|
|
63518
|
+
IF condition2.
|
|
63519
|
+
...
|
|
63520
|
+
ENDIF.
|
|
63521
|
+
ENDIF.
|
|
63522
|
+
|
|
63523
|
+
IF condition1.
|
|
63524
|
+
...
|
|
63525
|
+
ELSE.
|
|
63526
|
+
IF condition2.
|
|
63527
|
+
...
|
|
63528
|
+
ENDIF.
|
|
63513
63529
|
ENDIF.`,
|
|
63514
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63515
|
-
...
|
|
63516
|
-
ENDIF.
|
|
63517
|
-
|
|
63518
|
-
IF condition1.
|
|
63519
|
-
...
|
|
63520
|
-
ELSEIF condition2.
|
|
63521
|
-
...
|
|
63522
|
-
ENDIF.
|
|
63523
|
-
|
|
63524
|
-
CASE variable.
|
|
63525
|
-
WHEN value1.
|
|
63526
|
-
...
|
|
63527
|
-
WHEN value2.
|
|
63528
|
-
IF condition2.
|
|
63529
|
-
...
|
|
63530
|
-
ENDIF.
|
|
63530
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63531
|
+
...
|
|
63532
|
+
ENDIF.
|
|
63533
|
+
|
|
63534
|
+
IF condition1.
|
|
63535
|
+
...
|
|
63536
|
+
ELSEIF condition2.
|
|
63537
|
+
...
|
|
63538
|
+
ENDIF.
|
|
63539
|
+
|
|
63540
|
+
CASE variable.
|
|
63541
|
+
WHEN value1.
|
|
63542
|
+
...
|
|
63543
|
+
WHEN value2.
|
|
63544
|
+
IF condition2.
|
|
63545
|
+
...
|
|
63546
|
+
ENDIF.
|
|
63531
63547
|
ENDCASE.`,
|
|
63532
63548
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63533
63549
|
};
|
|
@@ -63712,9 +63728,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63712
63728
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63713
63729
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63714
63730
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63715
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63716
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63717
|
-
RETURN. " todo, implement method
|
|
63731
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63732
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63733
|
+
RETURN. " todo, implement method
|
|
63718
63734
|
ENDMETHOD.`);
|
|
63719
63735
|
}
|
|
63720
63736
|
}
|
|
@@ -63893,14 +63909,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63893
63909
|
key: "implicit_start_of_selection",
|
|
63894
63910
|
title: "Implicit START-OF-SELECTION",
|
|
63895
63911
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63896
|
-
extendedInformation: `Only runs for executable programs
|
|
63897
|
-
|
|
63912
|
+
extendedInformation: `Only runs for executable programs
|
|
63913
|
+
|
|
63898
63914
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63899
63915
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63900
|
-
badExample: `REPORT zfoo.
|
|
63916
|
+
badExample: `REPORT zfoo.
|
|
63901
63917
|
WRITE 'hello'.`,
|
|
63902
|
-
goodExample: `
|
|
63903
|
-
START-OF-SELECTION.
|
|
63918
|
+
goodExample: `
|
|
63919
|
+
START-OF-SELECTION.
|
|
63904
63920
|
WRITE 'hello'.`,
|
|
63905
63921
|
};
|
|
63906
63922
|
}
|
|
@@ -64005,19 +64021,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
64005
64021
|
key: "in_statement_indentation",
|
|
64006
64022
|
title: "In-statement indentation",
|
|
64007
64023
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
64008
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64009
|
-
|
|
64010
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64024
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64025
|
+
|
|
64026
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64011
64027
|
to distinguish them better from code within the block.`,
|
|
64012
|
-
badExample: `IF 1 = 1
|
|
64013
|
-
AND 2 = 2.
|
|
64014
|
-
WRITE 'hello' &&
|
|
64015
|
-
'world'.
|
|
64028
|
+
badExample: `IF 1 = 1
|
|
64029
|
+
AND 2 = 2.
|
|
64030
|
+
WRITE 'hello' &&
|
|
64031
|
+
'world'.
|
|
64016
64032
|
ENDIF.`,
|
|
64017
|
-
goodExample: `IF 1 = 1
|
|
64018
|
-
AND 2 = 2.
|
|
64019
|
-
WRITE 'hello' &&
|
|
64020
|
-
'world'.
|
|
64033
|
+
goodExample: `IF 1 = 1
|
|
64034
|
+
AND 2 = 2.
|
|
64035
|
+
WRITE 'hello' &&
|
|
64036
|
+
'world'.
|
|
64021
64037
|
ENDIF.`,
|
|
64022
64038
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64023
64039
|
};
|
|
@@ -64140,23 +64156,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
64140
64156
|
title: "Indentation",
|
|
64141
64157
|
shortDescription: `Checks indentation`,
|
|
64142
64158
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64143
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64144
|
-
PRIVATE SECTION.
|
|
64145
|
-
METHODS constructor.
|
|
64146
|
-
ENDCLASS.
|
|
64147
|
-
|
|
64148
|
-
CLASS lcl IMPLEMENTATION.
|
|
64149
|
-
METHOD constructor.
|
|
64150
|
-
ENDMETHOD.
|
|
64159
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64160
|
+
PRIVATE SECTION.
|
|
64161
|
+
METHODS constructor.
|
|
64162
|
+
ENDCLASS.
|
|
64163
|
+
|
|
64164
|
+
CLASS lcl IMPLEMENTATION.
|
|
64165
|
+
METHOD constructor.
|
|
64166
|
+
ENDMETHOD.
|
|
64151
64167
|
ENDCLASS.`,
|
|
64152
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
64153
|
-
PRIVATE SECTION.
|
|
64154
|
-
METHODS constructor.
|
|
64155
|
-
ENDCLASS.
|
|
64156
|
-
|
|
64157
|
-
CLASS lcl IMPLEMENTATION.
|
|
64158
|
-
METHOD constructor.
|
|
64159
|
-
ENDMETHOD.
|
|
64168
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
64169
|
+
PRIVATE SECTION.
|
|
64170
|
+
METHODS constructor.
|
|
64171
|
+
ENDCLASS.
|
|
64172
|
+
|
|
64173
|
+
CLASS lcl IMPLEMENTATION.
|
|
64174
|
+
METHOD constructor.
|
|
64175
|
+
ENDMETHOD.
|
|
64160
64176
|
ENDCLASS.`,
|
|
64161
64177
|
};
|
|
64162
64178
|
}
|
|
@@ -64557,9 +64573,9 @@ class IntfReferencingClas {
|
|
|
64557
64573
|
key: "intf_referencing_clas",
|
|
64558
64574
|
title: "INTF referencing CLAS",
|
|
64559
64575
|
shortDescription: `Interface contains references to class`,
|
|
64560
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64561
|
-
Only first level references are checked.
|
|
64562
|
-
Exception class references are ignored.
|
|
64576
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64577
|
+
Only first level references are checked.
|
|
64578
|
+
Exception class references are ignored.
|
|
64563
64579
|
Void references are ignored.`,
|
|
64564
64580
|
};
|
|
64565
64581
|
}
|
|
@@ -64644,9 +64660,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64644
64660
|
title: "Invalid Table Index",
|
|
64645
64661
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64646
64662
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64647
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64663
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64648
64664
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64649
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64665
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64650
64666
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64651
64667
|
};
|
|
64652
64668
|
}
|
|
@@ -65247,8 +65263,8 @@ class LineBreakStyle {
|
|
|
65247
65263
|
return {
|
|
65248
65264
|
key: "line_break_style",
|
|
65249
65265
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65250
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65251
|
-
|
|
65266
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65267
|
+
|
|
65252
65268
|
abapGit does not work with CRLF`,
|
|
65253
65269
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65254
65270
|
};
|
|
@@ -65317,7 +65333,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65317
65333
|
key: "line_length",
|
|
65318
65334
|
title: "Line length",
|
|
65319
65335
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65320
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65336
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65321
65337
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65322
65338
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65323
65339
|
};
|
|
@@ -65388,7 +65404,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65388
65404
|
key: "line_only_punc",
|
|
65389
65405
|
title: "Line containing only punctuation",
|
|
65390
65406
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65391
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65407
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65392
65408
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65393
65409
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65394
65410
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65651,15 +65667,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65651
65667
|
return {
|
|
65652
65668
|
key: "local_variable_names",
|
|
65653
65669
|
title: "Local variable naming conventions",
|
|
65654
|
-
shortDescription: `
|
|
65655
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65670
|
+
shortDescription: `
|
|
65671
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65656
65672
|
Regexes are case-insensitive.`,
|
|
65657
65673
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65658
|
-
badExample: `FORM bar.
|
|
65659
|
-
DATA foo.
|
|
65674
|
+
badExample: `FORM bar.
|
|
65675
|
+
DATA foo.
|
|
65660
65676
|
ENDFORM.`,
|
|
65661
|
-
goodExample: `FORM bar.
|
|
65662
|
-
DATA lv_foo.
|
|
65677
|
+
goodExample: `FORM bar.
|
|
65678
|
+
DATA lv_foo.
|
|
65663
65679
|
ENDFORM.`,
|
|
65664
65680
|
};
|
|
65665
65681
|
}
|
|
@@ -65811,9 +65827,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65811
65827
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65812
65828
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65813
65829
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65814
|
-
badExample: `DEFINE something.
|
|
65830
|
+
badExample: `DEFINE something.
|
|
65815
65831
|
END-OF-DEFINITION.`,
|
|
65816
|
-
goodExample: `DEFINE _something.
|
|
65832
|
+
goodExample: `DEFINE _something.
|
|
65817
65833
|
END-OF-DEFINITION.`,
|
|
65818
65834
|
};
|
|
65819
65835
|
}
|
|
@@ -65886,10 +65902,10 @@ class MainFileContents {
|
|
|
65886
65902
|
key: "main_file_contents",
|
|
65887
65903
|
title: "Main file contents",
|
|
65888
65904
|
shortDescription: `Checks related to report declarations.`,
|
|
65889
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65890
|
-
|
|
65891
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65892
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65905
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65906
|
+
|
|
65907
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65908
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65893
65909
|
`,
|
|
65894
65910
|
};
|
|
65895
65911
|
}
|
|
@@ -66005,17 +66021,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
66005
66021
|
title: "Too many parentheses",
|
|
66006
66022
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
66007
66023
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
66008
|
-
badExample: `
|
|
66009
|
-
IF ( destination IS INITIAL ).
|
|
66010
|
-
ENDIF.
|
|
66011
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66012
|
-
ENDIF.
|
|
66024
|
+
badExample: `
|
|
66025
|
+
IF ( destination IS INITIAL ).
|
|
66026
|
+
ENDIF.
|
|
66027
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66028
|
+
ENDIF.
|
|
66013
66029
|
`,
|
|
66014
|
-
goodExample: `
|
|
66015
|
-
IF destination IS INITIAL.
|
|
66016
|
-
ENDIF.
|
|
66017
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
66018
|
-
ENDIF.
|
|
66030
|
+
goodExample: `
|
|
66031
|
+
IF destination IS INITIAL.
|
|
66032
|
+
ENDIF.
|
|
66033
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
66034
|
+
ENDIF.
|
|
66019
66035
|
`,
|
|
66020
66036
|
};
|
|
66021
66037
|
}
|
|
@@ -66189,14 +66205,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66189
66205
|
title: "Max one method parameter definition per line",
|
|
66190
66206
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66191
66207
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66192
|
-
badExample: `
|
|
66193
|
-
METHODS apps_scope_token
|
|
66194
|
-
IMPORTING
|
|
66208
|
+
badExample: `
|
|
66209
|
+
METHODS apps_scope_token
|
|
66210
|
+
IMPORTING
|
|
66195
66211
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66196
|
-
goodExample: `
|
|
66197
|
-
METHODS apps_scope_token
|
|
66198
|
-
IMPORTING
|
|
66199
|
-
body TYPE bodyapps_scope_token
|
|
66212
|
+
goodExample: `
|
|
66213
|
+
METHODS apps_scope_token
|
|
66214
|
+
IMPORTING
|
|
66215
|
+
body TYPE bodyapps_scope_token
|
|
66200
66216
|
client_id TYPE str.`,
|
|
66201
66217
|
};
|
|
66202
66218
|
}
|
|
@@ -66261,11 +66277,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66261
66277
|
key: "max_one_statement",
|
|
66262
66278
|
title: "Max one statement per line",
|
|
66263
66279
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66264
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66265
|
-
|
|
66266
|
-
Does not report anything for chained statements.
|
|
66267
|
-
|
|
66268
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66280
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66281
|
+
|
|
66282
|
+
Does not report anything for chained statements.
|
|
66283
|
+
|
|
66284
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66269
66285
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66270
66286
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66271
66287
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66603,8 +66619,8 @@ class MethodLength {
|
|
|
66603
66619
|
key: "method_length",
|
|
66604
66620
|
title: "Method/Form Length",
|
|
66605
66621
|
shortDescription: `Checks relating to method/form length.`,
|
|
66606
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66607
|
-
|
|
66622
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66623
|
+
|
|
66608
66624
|
Abstract methods without statements are considered okay.`,
|
|
66609
66625
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66610
66626
|
};
|
|
@@ -66709,20 +66725,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66709
66725
|
key: "method_overwrites_builtin",
|
|
66710
66726
|
title: "Method name overwrites builtin function",
|
|
66711
66727
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66712
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66713
|
-
|
|
66714
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66715
|
-
|
|
66728
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66729
|
+
|
|
66730
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66731
|
+
|
|
66716
66732
|
Interface method names are ignored`,
|
|
66717
66733
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66718
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66719
|
-
PUBLIC SECTION.
|
|
66720
|
-
METHODS matches.
|
|
66721
|
-
ENDCLASS.
|
|
66722
|
-
|
|
66723
|
-
CLASS lcl IMPLEMENTATION.
|
|
66724
|
-
METHOD matches.
|
|
66725
|
-
ENDMETHOD.
|
|
66734
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66735
|
+
PUBLIC SECTION.
|
|
66736
|
+
METHODS matches.
|
|
66737
|
+
ENDCLASS.
|
|
66738
|
+
|
|
66739
|
+
CLASS lcl IMPLEMENTATION.
|
|
66740
|
+
METHOD matches.
|
|
66741
|
+
ENDMETHOD.
|
|
66726
66742
|
ENDCLASS.`,
|
|
66727
66743
|
};
|
|
66728
66744
|
}
|
|
@@ -66913,12 +66929,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66913
66929
|
// eslint-disable-next-line max-len
|
|
66914
66930
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66915
66931
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66916
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66917
|
-
PUBLIC SECTION.
|
|
66918
|
-
METHODS
|
|
66919
|
-
foobar
|
|
66920
|
-
EXPORTING foo TYPE i
|
|
66921
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66932
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66933
|
+
PUBLIC SECTION.
|
|
66934
|
+
METHODS
|
|
66935
|
+
foobar
|
|
66936
|
+
EXPORTING foo TYPE i
|
|
66937
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66922
66938
|
ENDCLASS.`,
|
|
66923
66939
|
};
|
|
66924
66940
|
}
|
|
@@ -67298,7 +67314,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67298
67314
|
key: "nesting",
|
|
67299
67315
|
title: "Check nesting depth",
|
|
67300
67316
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67301
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67317
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67302
67318
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67303
67319
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67304
67320
|
};
|
|
@@ -67541,7 +67557,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67541
67557
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67542
67558
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67543
67559
|
badExample: `var1 = var2 = var3.`,
|
|
67544
|
-
goodExample: `var2 = var3.
|
|
67560
|
+
goodExample: `var2 = var3.
|
|
67545
67561
|
var1 = var2.`,
|
|
67546
67562
|
};
|
|
67547
67563
|
}
|
|
@@ -67600,8 +67616,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67600
67616
|
key: "no_external_form_calls",
|
|
67601
67617
|
title: "No external FORM calls",
|
|
67602
67618
|
shortDescription: `Detect external form calls`,
|
|
67603
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67604
|
-
|
|
67619
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67620
|
+
|
|
67605
67621
|
PERFORM foo(bar).`,
|
|
67606
67622
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67607
67623
|
};
|
|
@@ -67662,17 +67678,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67662
67678
|
key: "no_inline_in_optional_branches",
|
|
67663
67679
|
title: "Don't declare inline in optional branches",
|
|
67664
67680
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67665
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67666
|
-
|
|
67667
|
-
Considered optional branches:
|
|
67668
|
-
* inside IF/ELSEIF/ELSE
|
|
67669
|
-
* inside LOOP
|
|
67670
|
-
* inside WHILE
|
|
67671
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67672
|
-
* inside DO
|
|
67673
|
-
* inside SELECT loops
|
|
67674
|
-
|
|
67675
|
-
Not considered optional branches:
|
|
67681
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67682
|
+
|
|
67683
|
+
Considered optional branches:
|
|
67684
|
+
* inside IF/ELSEIF/ELSE
|
|
67685
|
+
* inside LOOP
|
|
67686
|
+
* inside WHILE
|
|
67687
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67688
|
+
* inside DO
|
|
67689
|
+
* inside SELECT loops
|
|
67690
|
+
|
|
67691
|
+
Not considered optional branches:
|
|
67676
67692
|
* TRY/CATCH/CLEANUP`,
|
|
67677
67693
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67678
67694
|
};
|
|
@@ -67772,12 +67788,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67772
67788
|
key: "no_prefixes",
|
|
67773
67789
|
title: "No Prefixes",
|
|
67774
67790
|
shortDescription: `Dont use hungarian notation`,
|
|
67775
|
-
extendedInformation: `
|
|
67776
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67777
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67778
|
-
|
|
67779
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67780
|
-
|
|
67791
|
+
extendedInformation: `
|
|
67792
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67793
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67794
|
+
|
|
67795
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67796
|
+
|
|
67781
67797
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67782
67798
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67783
67799
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67956,7 +67972,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67956
67972
|
return {
|
|
67957
67973
|
key: "no_public_attributes",
|
|
67958
67974
|
title: "No public attributes",
|
|
67959
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67975
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67960
67976
|
Exceptions are excluded from this rule.`,
|
|
67961
67977
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67962
67978
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -68057,13 +68073,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
68057
68073
|
key: "no_yoda_conditions",
|
|
68058
68074
|
title: "No Yoda conditions",
|
|
68059
68075
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
68060
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68061
|
-
|
|
68076
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68077
|
+
|
|
68062
68078
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
68063
68079
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68064
|
-
badExample: `IF 0 <> sy-subrc.
|
|
68080
|
+
badExample: `IF 0 <> sy-subrc.
|
|
68065
68081
|
ENDIF.`,
|
|
68066
|
-
goodExample: `IF sy-subrc <> 0.
|
|
68082
|
+
goodExample: `IF sy-subrc <> 0.
|
|
68067
68083
|
ENDIF.`,
|
|
68068
68084
|
};
|
|
68069
68085
|
}
|
|
@@ -68164,8 +68180,8 @@ class NROBConsistency {
|
|
|
68164
68180
|
key: "nrob_consistency",
|
|
68165
68181
|
title: "Number range consistency",
|
|
68166
68182
|
shortDescription: `Consistency checks for number ranges`,
|
|
68167
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68168
|
-
|
|
68183
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68184
|
+
|
|
68169
68185
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
68170
68186
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68171
68187
|
};
|
|
@@ -68442,58 +68458,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68442
68458
|
title: "Obsolete statements",
|
|
68443
68459
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68444
68460
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68445
|
-
extendedInformation: `
|
|
68446
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68447
|
-
|
|
68448
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68449
|
-
|
|
68450
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68451
|
-
|
|
68452
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68453
|
-
|
|
68454
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68455
|
-
|
|
68456
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68457
|
-
|
|
68458
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68459
|
-
|
|
68460
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68461
|
-
|
|
68462
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68463
|
-
|
|
68464
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68465
|
-
|
|
68466
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68467
|
-
|
|
68468
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68469
|
-
|
|
68470
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68471
|
-
|
|
68472
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68473
|
-
|
|
68474
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68475
|
-
SELECT COUNT(*) is considered okay
|
|
68476
|
-
|
|
68477
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68478
|
-
|
|
68479
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68480
|
-
|
|
68481
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68482
|
-
|
|
68483
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68484
|
-
|
|
68485
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68486
|
-
|
|
68461
|
+
extendedInformation: `
|
|
68462
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68463
|
+
|
|
68464
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68465
|
+
|
|
68466
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68467
|
+
|
|
68468
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68469
|
+
|
|
68470
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68471
|
+
|
|
68472
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68473
|
+
|
|
68474
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68475
|
+
|
|
68476
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68477
|
+
|
|
68478
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68479
|
+
|
|
68480
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68481
|
+
|
|
68482
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68483
|
+
|
|
68484
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68485
|
+
|
|
68486
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68487
|
+
|
|
68488
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68489
|
+
|
|
68490
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68491
|
+
SELECT COUNT(*) is considered okay
|
|
68492
|
+
|
|
68493
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68494
|
+
|
|
68495
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68496
|
+
|
|
68497
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68498
|
+
|
|
68499
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68500
|
+
|
|
68501
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68502
|
+
|
|
68487
68503
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68488
|
-
badExample: `REFRESH itab.
|
|
68489
|
-
|
|
68490
|
-
COMPUTE foo = 2 + 2.
|
|
68491
|
-
|
|
68492
|
-
MULTIPLY lv_foo BY 2.
|
|
68493
|
-
|
|
68494
|
-
INTERFACE intf LOAD.
|
|
68495
|
-
|
|
68496
|
-
IF foo IS SUPPLIED.
|
|
68504
|
+
badExample: `REFRESH itab.
|
|
68505
|
+
|
|
68506
|
+
COMPUTE foo = 2 + 2.
|
|
68507
|
+
|
|
68508
|
+
MULTIPLY lv_foo BY 2.
|
|
68509
|
+
|
|
68510
|
+
INTERFACE intf LOAD.
|
|
68511
|
+
|
|
68512
|
+
IF foo IS SUPPLIED.
|
|
68497
68513
|
ENDIF.`,
|
|
68498
68514
|
};
|
|
68499
68515
|
}
|
|
@@ -68833,9 +68849,9 @@ class OmitParameterName {
|
|
|
68833
68849
|
key: "omit_parameter_name",
|
|
68834
68850
|
title: "Omit parameter name",
|
|
68835
68851
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68836
|
-
extendedInformation: `
|
|
68837
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68838
|
-
|
|
68852
|
+
extendedInformation: `
|
|
68853
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68854
|
+
|
|
68839
68855
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68840
68856
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68841
68857
|
badExample: `method( param = 2 ).`,
|
|
@@ -69041,20 +69057,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
69041
69057
|
shortDescription: `Omit RECEIVING`,
|
|
69042
69058
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
69043
69059
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69044
|
-
badExample: `
|
|
69045
|
-
upload_pack(
|
|
69046
|
-
EXPORTING
|
|
69047
|
-
io_client = lo_client
|
|
69048
|
-
iv_url = iv_url
|
|
69049
|
-
iv_deepen_level = iv_deepen_level
|
|
69050
|
-
it_hashes = lt_hashes
|
|
69051
|
-
RECEIVING
|
|
69060
|
+
badExample: `
|
|
69061
|
+
upload_pack(
|
|
69062
|
+
EXPORTING
|
|
69063
|
+
io_client = lo_client
|
|
69064
|
+
iv_url = iv_url
|
|
69065
|
+
iv_deepen_level = iv_deepen_level
|
|
69066
|
+
it_hashes = lt_hashes
|
|
69067
|
+
RECEIVING
|
|
69052
69068
|
rt_objects = et_objects ).`,
|
|
69053
|
-
goodExample: `
|
|
69054
|
-
et_objects = upload_pack(
|
|
69055
|
-
io_client = lo_client
|
|
69056
|
-
iv_url = iv_url
|
|
69057
|
-
iv_deepen_level = iv_deepen_level
|
|
69069
|
+
goodExample: `
|
|
69070
|
+
et_objects = upload_pack(
|
|
69071
|
+
io_client = lo_client
|
|
69072
|
+
iv_url = iv_url
|
|
69073
|
+
iv_deepen_level = iv_deepen_level
|
|
69058
69074
|
it_hashes = lt_hashes ).`,
|
|
69059
69075
|
};
|
|
69060
69076
|
}
|
|
@@ -69118,8 +69134,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
69118
69134
|
return {
|
|
69119
69135
|
key: "parser_702_chaining",
|
|
69120
69136
|
title: "Parser Error, bad chanining on 702",
|
|
69121
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69122
|
-
this rule finds these and reports errors.
|
|
69137
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69138
|
+
this rule finds these and reports errors.
|
|
69123
69139
|
Only active on target version 702 and below.`,
|
|
69124
69140
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69125
69141
|
};
|
|
@@ -69199,8 +69215,8 @@ class ParserError {
|
|
|
69199
69215
|
return {
|
|
69200
69216
|
key: "parser_error",
|
|
69201
69217
|
title: "Parser error",
|
|
69202
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69203
|
-
|
|
69218
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69219
|
+
|
|
69204
69220
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69205
69221
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69206
69222
|
};
|
|
@@ -69285,7 +69301,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69285
69301
|
return {
|
|
69286
69302
|
key: "parser_missing_space",
|
|
69287
69303
|
title: "Parser Error, missing space",
|
|
69288
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69304
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69289
69305
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69290
69306
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69291
69307
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69708,25 +69724,25 @@ class PreferInline {
|
|
|
69708
69724
|
key: "prefer_inline",
|
|
69709
69725
|
title: "Prefer Inline Declarations",
|
|
69710
69726
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69711
|
-
extendedInformation: `EXPERIMENTAL
|
|
69712
|
-
|
|
69713
|
-
Activates if language version is v740sp02 or above.
|
|
69714
|
-
|
|
69715
|
-
Variables must be local(METHOD or FORM).
|
|
69716
|
-
|
|
69717
|
-
No generic or void typed variables. No syntax errors.
|
|
69718
|
-
|
|
69719
|
-
First position used must be a full/pure write.
|
|
69720
|
-
|
|
69721
|
-
Move statment is not a cast(?=)
|
|
69722
|
-
|
|
69727
|
+
extendedInformation: `EXPERIMENTAL
|
|
69728
|
+
|
|
69729
|
+
Activates if language version is v740sp02 or above.
|
|
69730
|
+
|
|
69731
|
+
Variables must be local(METHOD or FORM).
|
|
69732
|
+
|
|
69733
|
+
No generic or void typed variables. No syntax errors.
|
|
69734
|
+
|
|
69735
|
+
First position used must be a full/pure write.
|
|
69736
|
+
|
|
69737
|
+
Move statment is not a cast(?=)
|
|
69738
|
+
|
|
69723
69739
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69724
69740
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69725
|
-
badExample: `DATA foo TYPE i.
|
|
69726
|
-
foo = 2.
|
|
69727
|
-
DATA percentage TYPE decfloat34.
|
|
69741
|
+
badExample: `DATA foo TYPE i.
|
|
69742
|
+
foo = 2.
|
|
69743
|
+
DATA percentage TYPE decfloat34.
|
|
69728
69744
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69729
|
-
goodExample: `DATA(foo) = 2.
|
|
69745
|
+
goodExample: `DATA(foo) = 2.
|
|
69730
69746
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69731
69747
|
};
|
|
69732
69748
|
}
|
|
@@ -69940,18 +69956,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69940
69956
|
key: "prefer_is_not",
|
|
69941
69957
|
title: "Prefer IS NOT to NOT IS",
|
|
69942
69958
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69943
|
-
extendedInformation: `
|
|
69944
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69945
|
-
|
|
69959
|
+
extendedInformation: `
|
|
69960
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69961
|
+
|
|
69946
69962
|
"if not is_valid( )." examples are skipped`,
|
|
69947
69963
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69948
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69949
|
-
IF variable NP 'TODO*'.
|
|
69950
|
-
IF variable <> 42.
|
|
69964
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69965
|
+
IF variable NP 'TODO*'.
|
|
69966
|
+
IF variable <> 42.
|
|
69951
69967
|
IF variable CO 'hello'.`,
|
|
69952
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69953
|
-
IF NOT variable CP 'TODO*'.
|
|
69954
|
-
IF NOT variable = 42.
|
|
69968
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69969
|
+
IF NOT variable CP 'TODO*'.
|
|
69970
|
+
IF NOT variable = 42.
|
|
69955
69971
|
IF NOT variable CA 'hello'.`,
|
|
69956
69972
|
};
|
|
69957
69973
|
}
|
|
@@ -70139,14 +70155,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
70139
70155
|
key: "prefer_raise_exception_new",
|
|
70140
70156
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
70141
70157
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
70142
|
-
extendedInformation: `
|
|
70143
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70144
|
-
|
|
70158
|
+
extendedInformation: `
|
|
70159
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70160
|
+
|
|
70145
70161
|
From 752 and up`,
|
|
70146
70162
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
70147
70163
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
70148
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70149
|
-
EXPORTING
|
|
70164
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70165
|
+
EXPORTING
|
|
70150
70166
|
previous = exception.`,
|
|
70151
70167
|
};
|
|
70152
70168
|
}
|
|
@@ -70224,12 +70240,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70224
70240
|
key: "prefer_returning_to_exporting",
|
|
70225
70241
|
title: "Prefer RETURNING to EXPORTING",
|
|
70226
70242
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70227
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70243
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70228
70244
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70229
70245
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70230
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70231
|
-
PUBLIC SECTION.
|
|
70232
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70246
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70247
|
+
PUBLIC SECTION.
|
|
70248
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70233
70249
|
ENDCLASS.`,
|
|
70234
70250
|
};
|
|
70235
70251
|
}
|
|
@@ -70325,8 +70341,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70325
70341
|
key: "prefer_xsdbool",
|
|
70326
70342
|
title: "Prefer xsdbool over boolc",
|
|
70327
70343
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70328
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70329
|
-
|
|
70344
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70345
|
+
|
|
70330
70346
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70331
70347
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70332
70348
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70398,9 +70414,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70398
70414
|
title: "Preferred compare operator",
|
|
70399
70415
|
shortDescription: `Configure undesired operator variants`,
|
|
70400
70416
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70401
|
-
badExample: `IF foo EQ bar.
|
|
70417
|
+
badExample: `IF foo EQ bar.
|
|
70402
70418
|
ENDIF.`,
|
|
70403
|
-
goodExample: `IF foo = bar.
|
|
70419
|
+
goodExample: `IF foo = bar.
|
|
70404
70420
|
ENDIF.`,
|
|
70405
70421
|
};
|
|
70406
70422
|
}
|
|
@@ -70624,26 +70640,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70624
70640
|
key: "reduce_procedural_code",
|
|
70625
70641
|
title: "Reduce procedural code",
|
|
70626
70642
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70627
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70628
|
-
|
|
70629
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70630
|
-
|
|
70643
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70644
|
+
|
|
70645
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70646
|
+
|
|
70631
70647
|
Comments are not counted as statements.`,
|
|
70632
70648
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70633
|
-
badExample: `FORM foo.
|
|
70634
|
-
DATA lv_bar TYPE i.
|
|
70635
|
-
lv_bar = 2 + 2.
|
|
70636
|
-
IF lv_bar = 4.
|
|
70637
|
-
WRITE 'hello world'.
|
|
70638
|
-
ENDIF.
|
|
70639
|
-
DATA lv_bar TYPE i.
|
|
70640
|
-
lv_bar = 2 + 2.
|
|
70641
|
-
IF lv_bar = 4.
|
|
70642
|
-
WRITE 'hello world'.
|
|
70643
|
-
ENDIF.
|
|
70649
|
+
badExample: `FORM foo.
|
|
70650
|
+
DATA lv_bar TYPE i.
|
|
70651
|
+
lv_bar = 2 + 2.
|
|
70652
|
+
IF lv_bar = 4.
|
|
70653
|
+
WRITE 'hello world'.
|
|
70654
|
+
ENDIF.
|
|
70655
|
+
DATA lv_bar TYPE i.
|
|
70656
|
+
lv_bar = 2 + 2.
|
|
70657
|
+
IF lv_bar = 4.
|
|
70658
|
+
WRITE 'hello world'.
|
|
70659
|
+
ENDIF.
|
|
70644
70660
|
ENDFORM.`,
|
|
70645
|
-
goodExample: `FORM foo.
|
|
70646
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70661
|
+
goodExample: `FORM foo.
|
|
70662
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70647
70663
|
ENDFORM.`,
|
|
70648
70664
|
};
|
|
70649
70665
|
}
|
|
@@ -70887,10 +70903,10 @@ class RemoveDescriptions {
|
|
|
70887
70903
|
return {
|
|
70888
70904
|
key: "remove_descriptions",
|
|
70889
70905
|
title: "Remove descriptions",
|
|
70890
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70891
|
-
|
|
70892
|
-
Class descriptions are required, see rule description_empty.
|
|
70893
|
-
|
|
70906
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70907
|
+
|
|
70908
|
+
Class descriptions are required, see rule description_empty.
|
|
70909
|
+
|
|
70894
70910
|
Consider using ABAP Doc for documentation.`,
|
|
70895
70911
|
tags: [],
|
|
70896
70912
|
};
|
|
@@ -71015,14 +71031,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
71015
71031
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71016
71032
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
71017
71033
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
71018
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
71034
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
71019
71035
|
DESTINATION lv_rfc.`,
|
|
71020
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71021
|
-
DESTINATION lv_rfc
|
|
71022
|
-
EXCEPTIONS
|
|
71023
|
-
system_failure = 1 MESSAGE msg
|
|
71024
|
-
communication_failure = 2 MESSAGE msg
|
|
71025
|
-
resource_failure = 3
|
|
71036
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71037
|
+
DESTINATION lv_rfc
|
|
71038
|
+
EXCEPTIONS
|
|
71039
|
+
system_failure = 1 MESSAGE msg
|
|
71040
|
+
communication_failure = 2 MESSAGE msg
|
|
71041
|
+
resource_failure = 3
|
|
71026
71042
|
OTHERS = 4.`,
|
|
71027
71043
|
};
|
|
71028
71044
|
}
|
|
@@ -71106,11 +71122,11 @@ class SelectAddOrderBy {
|
|
|
71106
71122
|
key: "select_add_order_by",
|
|
71107
71123
|
title: "SELECT add ORDER BY",
|
|
71108
71124
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
71109
|
-
extendedInformation: `
|
|
71110
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71111
|
-
|
|
71112
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
71113
|
-
|
|
71125
|
+
extendedInformation: `
|
|
71126
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71127
|
+
|
|
71128
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
71129
|
+
|
|
71114
71130
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
71115
71131
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71116
71132
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71241,14 +71257,14 @@ class SelectPerformance {
|
|
|
71241
71257
|
key: "select_performance",
|
|
71242
71258
|
title: "SELECT performance",
|
|
71243
71259
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71244
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71245
|
-
|
|
71260
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71261
|
+
|
|
71246
71262
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71247
71263
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71248
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71249
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71264
|
+
badExample: `SELECT field1, field2 FROM table
|
|
71265
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71250
71266
|
ENDSELECT.`,
|
|
71251
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71267
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71252
71268
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71253
71269
|
};
|
|
71254
71270
|
}
|
|
@@ -71362,8 +71378,8 @@ class SelectSingleFullKey {
|
|
|
71362
71378
|
key: "select_single_full_key",
|
|
71363
71379
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71364
71380
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71365
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71366
|
-
|
|
71381
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71382
|
+
|
|
71367
71383
|
If the statement contains a JOIN it is not checked`,
|
|
71368
71384
|
pseudoComment: "EC CI_NOORDER",
|
|
71369
71385
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71791,8 +71807,8 @@ class SICFConsistency {
|
|
|
71791
71807
|
key: "sicf_consistency",
|
|
71792
71808
|
title: "SICF consistency",
|
|
71793
71809
|
shortDescription: `Checks the validity of ICF services`,
|
|
71794
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71795
|
-
* Class must not have any syntax errors
|
|
71810
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71811
|
+
* Class must not have any syntax errors
|
|
71796
71812
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71797
71813
|
};
|
|
71798
71814
|
}
|
|
@@ -71904,23 +71920,23 @@ class SlowParameterPassing {
|
|
|
71904
71920
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71905
71921
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71906
71922
|
tags: [_irule_1.RuleTag.Performance],
|
|
71907
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71908
|
-
PUBLIC SECTION.
|
|
71909
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71910
|
-
ENDCLASS.
|
|
71911
|
-
CLASS lcl IMPLEMENTATION.
|
|
71912
|
-
METHOD bar.
|
|
71913
|
-
WRITE sdf.
|
|
71914
|
-
ENDMETHOD.
|
|
71923
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71924
|
+
PUBLIC SECTION.
|
|
71925
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71926
|
+
ENDCLASS.
|
|
71927
|
+
CLASS lcl IMPLEMENTATION.
|
|
71928
|
+
METHOD bar.
|
|
71929
|
+
WRITE sdf.
|
|
71930
|
+
ENDMETHOD.
|
|
71915
71931
|
ENDCLASS.`,
|
|
71916
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71917
|
-
PUBLIC SECTION.
|
|
71918
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71919
|
-
ENDCLASS.
|
|
71920
|
-
CLASS lcl IMPLEMENTATION.
|
|
71921
|
-
METHOD bar.
|
|
71922
|
-
WRITE sdf.
|
|
71923
|
-
ENDMETHOD.
|
|
71932
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71933
|
+
PUBLIC SECTION.
|
|
71934
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71935
|
+
ENDCLASS.
|
|
71936
|
+
CLASS lcl IMPLEMENTATION.
|
|
71937
|
+
METHOD bar.
|
|
71938
|
+
WRITE sdf.
|
|
71939
|
+
ENDMETHOD.
|
|
71924
71940
|
ENDCLASS.`,
|
|
71925
71941
|
};
|
|
71926
71942
|
}
|
|
@@ -72177,8 +72193,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
72177
72193
|
key: "space_before_dot",
|
|
72178
72194
|
title: "Space before dot",
|
|
72179
72195
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
72180
|
-
extendedInformation: `
|
|
72181
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72196
|
+
extendedInformation: `
|
|
72197
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72182
72198
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
72183
72199
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72184
72200
|
badExample: `WRITE bar .`,
|
|
@@ -72364,12 +72380,12 @@ class SQLValueConversion {
|
|
|
72364
72380
|
key: "sql_value_conversion",
|
|
72365
72381
|
title: "Implicit SQL Value Conversion",
|
|
72366
72382
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72367
|
-
extendedInformation: `
|
|
72368
|
-
* Integer to CHAR conversion
|
|
72369
|
-
* Integer to NUMC conversion
|
|
72370
|
-
* NUMC to Integer conversion
|
|
72371
|
-
* CHAR to Integer conversion
|
|
72372
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72383
|
+
extendedInformation: `
|
|
72384
|
+
* Integer to CHAR conversion
|
|
72385
|
+
* Integer to NUMC conversion
|
|
72386
|
+
* NUMC to Integer conversion
|
|
72387
|
+
* CHAR to Integer conversion
|
|
72388
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72373
72389
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72374
72390
|
tags: [],
|
|
72375
72391
|
};
|
|
@@ -72441,7 +72457,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72441
72457
|
key: "start_at_tab",
|
|
72442
72458
|
title: "Start at tab",
|
|
72443
72459
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72444
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72460
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72445
72461
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72446
72462
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72447
72463
|
badExample: ` WRITE a.`,
|
|
@@ -72618,12 +72634,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72618
72634
|
key: "strict_sql",
|
|
72619
72635
|
title: "Strict SQL",
|
|
72620
72636
|
shortDescription: `Strict SQL`,
|
|
72621
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72622
|
-
|
|
72623
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72624
|
-
|
|
72625
|
-
Also see separate rule sql_escape_host_variables
|
|
72626
|
-
|
|
72637
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72638
|
+
|
|
72639
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72640
|
+
|
|
72641
|
+
Also see separate rule sql_escape_host_variables
|
|
72642
|
+
|
|
72627
72643
|
Activates from v750 and up`,
|
|
72628
72644
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72629
72645
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72877,11 +72893,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72877
72893
|
key: "sy_modification",
|
|
72878
72894
|
title: "Modification of SY fields",
|
|
72879
72895
|
shortDescription: `Finds modification of sy fields`,
|
|
72880
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72881
|
-
|
|
72896
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72897
|
+
|
|
72882
72898
|
Changes to SY-TVAR* fields are not reported`,
|
|
72883
72899
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72884
|
-
badExample: `sy-uname = 2.
|
|
72900
|
+
badExample: `sy-uname = 2.
|
|
72885
72901
|
sy = sy.`,
|
|
72886
72902
|
};
|
|
72887
72903
|
}
|
|
@@ -72943,8 +72959,8 @@ class TABLEnhancementCategory {
|
|
|
72943
72959
|
key: "tabl_enhancement_category",
|
|
72944
72960
|
title: "TABL enhancement category must be set",
|
|
72945
72961
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72946
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72947
|
-
|
|
72962
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72963
|
+
|
|
72948
72964
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72949
72965
|
tags: [],
|
|
72950
72966
|
};
|
|
@@ -73009,8 +73025,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
73009
73025
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
73010
73026
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
73011
73027
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73012
|
-
badExample: `FORM foo.
|
|
73013
|
-
TABLES t100.
|
|
73028
|
+
badExample: `FORM foo.
|
|
73029
|
+
TABLES t100.
|
|
73014
73030
|
ENDFORM.`,
|
|
73015
73031
|
goodExample: `TABLES t000.`,
|
|
73016
73032
|
};
|
|
@@ -73138,9 +73154,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
73138
73154
|
title: "Type FORM parameters",
|
|
73139
73155
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
73140
73156
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73141
|
-
badExample: `FORM foo USING bar.
|
|
73157
|
+
badExample: `FORM foo USING bar.
|
|
73142
73158
|
ENDFORM.`,
|
|
73143
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
73159
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
73144
73160
|
ENDFORM.`,
|
|
73145
73161
|
};
|
|
73146
73162
|
}
|
|
@@ -73813,38 +73829,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73813
73829
|
key: "unnecessary_pragma",
|
|
73814
73830
|
title: "Unnecessary Pragma",
|
|
73815
73831
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73816
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73817
|
-
|
|
73818
|
-
* NEEDED without definition
|
|
73819
|
-
|
|
73820
|
-
* NO_TEXT without texts
|
|
73821
|
-
|
|
73822
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73823
|
-
|
|
73832
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73833
|
+
|
|
73834
|
+
* NEEDED without definition
|
|
73835
|
+
|
|
73836
|
+
* NO_TEXT without texts
|
|
73837
|
+
|
|
73838
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73839
|
+
|
|
73824
73840
|
NO_HANDLER inside macros are not checked`,
|
|
73825
73841
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73826
|
-
badExample: `TRY.
|
|
73827
|
-
...
|
|
73828
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73829
|
-
RETURN. " it has a handler
|
|
73830
|
-
ENDTRY.
|
|
73831
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73832
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73833
|
-
IF sy-subrc <> 0.
|
|
73842
|
+
badExample: `TRY.
|
|
73843
|
+
...
|
|
73844
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73845
|
+
RETURN. " it has a handler
|
|
73846
|
+
ENDTRY.
|
|
73847
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73848
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73849
|
+
IF sy-subrc <> 0.
|
|
73834
73850
|
ENDIF.`,
|
|
73835
|
-
goodExample: `TRY.
|
|
73836
|
-
...
|
|
73837
|
-
CATCH zcx_abapgit_exception.
|
|
73838
|
-
RETURN.
|
|
73839
|
-
ENDTRY.
|
|
73840
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73841
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73842
|
-
IF sy-subrc <> 0.
|
|
73843
|
-
ENDIF.
|
|
73844
|
-
|
|
73845
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73846
|
-
test1 TYPE string,
|
|
73847
|
-
test2 TYPE string,
|
|
73851
|
+
goodExample: `TRY.
|
|
73852
|
+
...
|
|
73853
|
+
CATCH zcx_abapgit_exception.
|
|
73854
|
+
RETURN.
|
|
73855
|
+
ENDTRY.
|
|
73856
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73857
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73858
|
+
IF sy-subrc <> 0.
|
|
73859
|
+
ENDIF.
|
|
73860
|
+
|
|
73861
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73862
|
+
test1 TYPE string,
|
|
73863
|
+
test2 TYPE string,
|
|
73848
73864
|
END OF blah.`,
|
|
73849
73865
|
};
|
|
73850
73866
|
}
|
|
@@ -74011,18 +74027,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
74011
74027
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
74012
74028
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
74013
74029
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
74014
|
-
badExample: `FORM hello1.
|
|
74015
|
-
WRITE 'world'.
|
|
74016
|
-
RETURN.
|
|
74017
|
-
ENDFORM.
|
|
74018
|
-
|
|
74019
|
-
FORM foo.
|
|
74020
|
-
IF 1 = 2.
|
|
74021
|
-
RETURN.
|
|
74022
|
-
ENDIF.
|
|
74030
|
+
badExample: `FORM hello1.
|
|
74031
|
+
WRITE 'world'.
|
|
74032
|
+
RETURN.
|
|
74033
|
+
ENDFORM.
|
|
74034
|
+
|
|
74035
|
+
FORM foo.
|
|
74036
|
+
IF 1 = 2.
|
|
74037
|
+
RETURN.
|
|
74038
|
+
ENDIF.
|
|
74023
74039
|
ENDFORM.`,
|
|
74024
|
-
goodExample: `FORM hello2.
|
|
74025
|
-
WRITE 'world'.
|
|
74040
|
+
goodExample: `FORM hello2.
|
|
74041
|
+
WRITE 'world'.
|
|
74026
74042
|
ENDFORM.`,
|
|
74027
74043
|
};
|
|
74028
74044
|
}
|
|
@@ -74373,13 +74389,13 @@ class UnusedMacros {
|
|
|
74373
74389
|
title: "Unused macros",
|
|
74374
74390
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74375
74391
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74376
|
-
badExample: `DEFINE foobar1.
|
|
74377
|
-
WRITE 'hello'.
|
|
74392
|
+
badExample: `DEFINE foobar1.
|
|
74393
|
+
WRITE 'hello'.
|
|
74378
74394
|
END-OF-DEFINITION.`,
|
|
74379
|
-
goodExample: `DEFINE foobar2.
|
|
74380
|
-
WRITE 'hello'.
|
|
74381
|
-
END-OF-DEFINITION.
|
|
74382
|
-
|
|
74395
|
+
goodExample: `DEFINE foobar2.
|
|
74396
|
+
WRITE 'hello'.
|
|
74397
|
+
END-OF-DEFINITION.
|
|
74398
|
+
|
|
74383
74399
|
foobar2.`,
|
|
74384
74400
|
};
|
|
74385
74401
|
}
|
|
@@ -74491,18 +74507,18 @@ class UnusedMethods {
|
|
|
74491
74507
|
key: "unused_methods",
|
|
74492
74508
|
title: "Unused methods",
|
|
74493
74509
|
shortDescription: `Checks for unused methods`,
|
|
74494
|
-
extendedInformation: `Checks private and protected methods.
|
|
74495
|
-
|
|
74496
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74497
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74498
|
-
|
|
74499
|
-
Skips:
|
|
74500
|
-
* methods FOR TESTING
|
|
74501
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74502
|
-
* class_constructor + constructor methods
|
|
74503
|
-
* event handlers
|
|
74504
|
-
* methods that are redefined
|
|
74505
|
-
* INCLUDEs
|
|
74510
|
+
extendedInformation: `Checks private and protected methods.
|
|
74511
|
+
|
|
74512
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74513
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74514
|
+
|
|
74515
|
+
Skips:
|
|
74516
|
+
* methods FOR TESTING
|
|
74517
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74518
|
+
* class_constructor + constructor methods
|
|
74519
|
+
* event handlers
|
|
74520
|
+
* methods that are redefined
|
|
74521
|
+
* INCLUDEs
|
|
74506
74522
|
`,
|
|
74507
74523
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74508
74524
|
pragma: "##CALLED",
|
|
@@ -74978,23 +74994,23 @@ class UnusedVariables {
|
|
|
74978
74994
|
key: "unused_variables",
|
|
74979
74995
|
title: "Unused variables",
|
|
74980
74996
|
shortDescription: `Checks for unused variables and constants`,
|
|
74981
|
-
extendedInformation: `Skips event parameters.
|
|
74982
|
-
|
|
74983
|
-
Note that this currently does not work if the source code uses macros.
|
|
74984
|
-
|
|
74985
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74986
|
-
|
|
74997
|
+
extendedInformation: `Skips event parameters.
|
|
74998
|
+
|
|
74999
|
+
Note that this currently does not work if the source code uses macros.
|
|
75000
|
+
|
|
75001
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75002
|
+
|
|
74987
75003
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74988
75004
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74989
75005
|
pragma: "##NEEDED",
|
|
74990
75006
|
pseudoComment: "EC NEEDED",
|
|
74991
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74992
|
-
test TYPE string,
|
|
74993
|
-
test2 TYPE string,
|
|
75007
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
75008
|
+
test TYPE string,
|
|
75009
|
+
test2 TYPE string,
|
|
74994
75010
|
END OF blah1.`,
|
|
74995
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74996
|
-
test TYPE string,
|
|
74997
|
-
test2 TYPE string,
|
|
75011
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75012
|
+
test TYPE string,
|
|
75013
|
+
test2 TYPE string,
|
|
74998
75014
|
END OF blah2.`,
|
|
74999
75015
|
};
|
|
75000
75016
|
}
|
|
@@ -75213,15 +75229,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75213
75229
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75214
75230
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75215
75231
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75216
|
-
badExample: `IF line IS INITIAL.
|
|
75217
|
-
has_entries = abap_false.
|
|
75218
|
-
ELSE.
|
|
75219
|
-
has_entries = abap_true.
|
|
75220
|
-
ENDIF.
|
|
75221
|
-
|
|
75232
|
+
badExample: `IF line IS INITIAL.
|
|
75233
|
+
has_entries = abap_false.
|
|
75234
|
+
ELSE.
|
|
75235
|
+
has_entries = abap_true.
|
|
75236
|
+
ENDIF.
|
|
75237
|
+
|
|
75222
75238
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75223
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75224
|
-
|
|
75239
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75240
|
+
|
|
75225
75241
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75226
75242
|
};
|
|
75227
75243
|
}
|
|
@@ -75339,15 +75355,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75339
75355
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75340
75356
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75341
75357
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75342
|
-
badExample: `INTERFACE lif.
|
|
75343
|
-
METHODS load_data
|
|
75344
|
-
EXCEPTIONS
|
|
75345
|
-
invalid_parameter.
|
|
75358
|
+
badExample: `INTERFACE lif.
|
|
75359
|
+
METHODS load_data
|
|
75360
|
+
EXCEPTIONS
|
|
75361
|
+
invalid_parameter.
|
|
75346
75362
|
ENDINTERFACE.`,
|
|
75347
|
-
goodExample: `INTERFACE lif.
|
|
75348
|
-
METHODS load_data
|
|
75349
|
-
RAISING
|
|
75350
|
-
cx_something.
|
|
75363
|
+
goodExample: `INTERFACE lif.
|
|
75364
|
+
METHODS load_data
|
|
75365
|
+
RAISING
|
|
75366
|
+
cx_something.
|
|
75351
75367
|
ENDINTERFACE.`,
|
|
75352
75368
|
};
|
|
75353
75369
|
}
|
|
@@ -75407,15 +75423,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75407
75423
|
key: "use_line_exists",
|
|
75408
75424
|
title: "Use line_exists",
|
|
75409
75425
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75410
|
-
extendedInformation: `
|
|
75411
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75412
|
-
|
|
75426
|
+
extendedInformation: `
|
|
75427
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75428
|
+
|
|
75413
75429
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75414
75430
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75415
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75416
|
-
IF sy-subrc = 0.
|
|
75431
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75432
|
+
IF sy-subrc = 0.
|
|
75417
75433
|
ENDIF.`,
|
|
75418
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75434
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75419
75435
|
ENDIF.`,
|
|
75420
75436
|
};
|
|
75421
75437
|
}
|
|
@@ -75525,10 +75541,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75525
75541
|
key: "use_new",
|
|
75526
75542
|
title: "Use NEW",
|
|
75527
75543
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75528
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75529
|
-
|
|
75530
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75531
|
-
|
|
75544
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75545
|
+
|
|
75546
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75547
|
+
|
|
75532
75548
|
Applicable from v740sp02 and up`,
|
|
75533
75549
|
badExample: `CREATE OBJECT ref.`,
|
|
75534
75550
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75626,13 +75642,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75626
75642
|
title: "WHEN OTHERS last",
|
|
75627
75643
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75628
75644
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75629
|
-
badExample: `CASE bar.
|
|
75630
|
-
WHEN OTHERS.
|
|
75631
|
-
WHEN 2.
|
|
75645
|
+
badExample: `CASE bar.
|
|
75646
|
+
WHEN OTHERS.
|
|
75647
|
+
WHEN 2.
|
|
75632
75648
|
ENDCASE.`,
|
|
75633
|
-
goodExample: `CASE bar.
|
|
75634
|
-
WHEN 2.
|
|
75635
|
-
WHEN OTHERS.
|
|
75649
|
+
goodExample: `CASE bar.
|
|
75650
|
+
WHEN 2.
|
|
75651
|
+
WHEN OTHERS.
|
|
75636
75652
|
ENDCASE.`,
|
|
75637
75653
|
};
|
|
75638
75654
|
}
|