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