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