@abaplint/cli 2.113.30 → 2.113.32
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 +874 -846
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -4371,7 +4371,7 @@ class Compare extends combi_1.Expression {
|
|
|
4371
4371
|
const between = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "BETWEEN", _1.Source, "AND", _1.Source);
|
|
4372
4372
|
const predicate = (0, combi_1.ver)(version_1.Version.v740sp08, _1.MethodCallChain);
|
|
4373
4373
|
const rett = (0, combi_1.seq)(_1.Source, (0, combi_1.altPrio)((0, combi_1.seq)(_1.CompareOperator, _1.Source), inn, between, sopt));
|
|
4374
|
-
const fsassign = (0, combi_1.seq)(_1.
|
|
4374
|
+
const fsassign = (0, combi_1.seq)(_1.SourceFieldSymbolChain, "IS", (0, combi_1.optPrio)("NOT"), "ASSIGNED");
|
|
4375
4375
|
const ret = (0, combi_1.seq)((0, combi_1.opt)("NOT"), (0, combi_1.altPrio)(rett, predicate, fsassign));
|
|
4376
4376
|
return ret;
|
|
4377
4377
|
}
|
|
@@ -5922,6 +5922,7 @@ __exportStar(__webpack_require__(/*! ./simple_source2 */ "./node_modules/@abapli
|
|
|
5922
5922
|
__exportStar(__webpack_require__(/*! ./simple_source3 */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/simple_source3.js"), exports);
|
|
5923
5923
|
__exportStar(__webpack_require__(/*! ./simple_source4 */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/simple_source4.js"), exports);
|
|
5924
5924
|
__exportStar(__webpack_require__(/*! ./simple_target */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/simple_target.js"), exports);
|
|
5925
|
+
__exportStar(__webpack_require__(/*! ./source_field_symbol_chain */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source_field_symbol_chain.js"), exports);
|
|
5925
5926
|
__exportStar(__webpack_require__(/*! ./source_field_symbol */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source_field_symbol.js"), exports);
|
|
5926
5927
|
__exportStar(__webpack_require__(/*! ./source_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source_field.js"), exports);
|
|
5927
5928
|
__exportStar(__webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source.js"), exports);
|
|
@@ -7467,7 +7468,7 @@ class Select extends combi_1.Expression {
|
|
|
7467
7468
|
const fields = (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields);
|
|
7468
7469
|
// todo, HINTS cannot be anywhere, need an expression dedicated for strict sql
|
|
7469
7470
|
const perm = (0, combi_1.per)(_1.SQLFrom, into, _1.SQLForAllEntries, where, _1.SQLOrderBy, sql_up_to_1.SQLUpTo, offset, _1.SQLClient, _1.SQLHaving, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
|
|
7470
|
-
const permSingle = (0, combi_1.per)(_1.SQLFrom, (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList), where, _1.SQLClient, bypass, fields, _1.DatabaseConnection, _1.SQLHints);
|
|
7471
|
+
const permSingle = (0, combi_1.per)(_1.SQLFrom, (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList), where, _1.SQLClient, bypass, sql_group_by_1.SQLGroupBy, fields, _1.DatabaseConnection, _1.SQLHints);
|
|
7471
7472
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), sql_field_name_1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
7472
7473
|
const fieldList = (0, combi_1.optPrio)((0, combi_1.altPrio)(_1.SQLFieldList, paren));
|
|
7473
7474
|
const single = (0, combi_1.seq)("SINGLE", (0, combi_1.optPrio)("FOR UPDATE"), fieldList, permSingle);
|
|
@@ -7822,6 +7823,29 @@ exports.SourceFieldSymbol = SourceFieldSymbol;
|
|
|
7822
7823
|
|
|
7823
7824
|
/***/ }),
|
|
7824
7825
|
|
|
7826
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source_field_symbol_chain.js":
|
|
7827
|
+
/*!**********************************************************************************************************!*\
|
|
7828
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source_field_symbol_chain.js ***!
|
|
7829
|
+
\**********************************************************************************************************/
|
|
7830
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7831
|
+
|
|
7832
|
+
"use strict";
|
|
7833
|
+
|
|
7834
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7835
|
+
exports.SourceFieldSymbolChain = void 0;
|
|
7836
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
7837
|
+
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
7838
|
+
class SourceFieldSymbolChain extends combi_1.Expression {
|
|
7839
|
+
getRunnable() {
|
|
7840
|
+
const chain = (0, combi_1.seq)(new _1.ArrowOrDash(), _1.ComponentName);
|
|
7841
|
+
return (0, combi_1.seq)(_1.FieldSymbol, (0, combi_1.starPrio)(chain));
|
|
7842
|
+
}
|
|
7843
|
+
}
|
|
7844
|
+
exports.SourceFieldSymbolChain = SourceFieldSymbolChain;
|
|
7845
|
+
//# sourceMappingURL=source_field_symbol_chain.js.map
|
|
7846
|
+
|
|
7847
|
+
/***/ }),
|
|
7848
|
+
|
|
7825
7849
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js":
|
|
7826
7850
|
/*!************************************************************************************************!*\
|
|
7827
7851
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js ***!
|
|
@@ -8045,15 +8069,16 @@ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules
|
|
|
8045
8069
|
class SQLCompare extends combi_1.Expression {
|
|
8046
8070
|
getRunnable() {
|
|
8047
8071
|
const subSelect = (0, combi_1.seq)("(", _1.Select, ")");
|
|
8072
|
+
const subSelectDouble = (0, combi_1.seq)("(", "(", _1.Select, ")", ")");
|
|
8048
8073
|
const between = (0, combi_1.seq)("BETWEEN", _1.SQLSource, "AND", _1.SQLSource);
|
|
8049
8074
|
const like = (0, combi_1.seq)("LIKE", _1.SQLSource, (0, combi_1.optPrio)((0, combi_1.seq)("ESCAPE", _1.SQLSource)));
|
|
8050
8075
|
const nul = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("NULL", (0, combi_1.ver)(version_1.Version.v753, "INITIAL")));
|
|
8051
8076
|
const source = new _1.SQLSource();
|
|
8052
|
-
const sub = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("ALL", "ANY", "SOME")), subSelect);
|
|
8077
|
+
const sub = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("ALL", "ANY", "SOME")), (0, combi_1.altPrio)(subSelect, subSelectDouble));
|
|
8053
8078
|
const arith = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/"), _1.SQLFieldName)));
|
|
8054
8079
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8055
8080
|
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(_1.SimpleSource3, paren)));
|
|
8056
|
-
const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, (0, combi_1.seq)(_1.SQLFieldName, (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
|
|
8081
|
+
const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
|
|
8057
8082
|
const exists = (0, combi_1.seq)("EXISTS", subSelect);
|
|
8058
8083
|
return (0, combi_1.altPrio)(exists, _1.Dynamic, rett);
|
|
8059
8084
|
}
|
|
@@ -24199,7 +24224,7 @@ class Compare {
|
|
|
24199
24224
|
for (const t of node.findDirectExpressions(Expressions.Source)) {
|
|
24200
24225
|
new source_1.Source().runSyntax(t, input);
|
|
24201
24226
|
}
|
|
24202
|
-
for (const t of node.findDirectExpressions(Expressions.
|
|
24227
|
+
for (const t of node.findDirectExpressions(Expressions.SourceFieldSymbolChain)) {
|
|
24203
24228
|
new source_field_symbol_1.SourceFieldSymbol().runSyntax(t, input);
|
|
24204
24229
|
}
|
|
24205
24230
|
for (const t of node.findDirectExpressions(Expressions.MethodCallChain)) {
|
|
@@ -35174,13 +35199,13 @@ class FlowGraph {
|
|
|
35174
35199
|
this.label = label;
|
|
35175
35200
|
}
|
|
35176
35201
|
toDigraph() {
|
|
35177
|
-
return `digraph G {
|
|
35178
|
-
labelloc="t";
|
|
35179
|
-
label="${this.label}";
|
|
35180
|
-
graph [fontname = "helvetica"];
|
|
35181
|
-
node [fontname = "helvetica", shape="box"];
|
|
35182
|
-
edge [fontname = "helvetica"];
|
|
35183
|
-
${this.toTextEdges()}
|
|
35202
|
+
return `digraph G {
|
|
35203
|
+
labelloc="t";
|
|
35204
|
+
label="${this.label}";
|
|
35205
|
+
graph [fontname = "helvetica"];
|
|
35206
|
+
node [fontname = "helvetica", shape="box"];
|
|
35207
|
+
edge [fontname = "helvetica"];
|
|
35208
|
+
${this.toTextEdges()}
|
|
35184
35209
|
}`;
|
|
35185
35210
|
}
|
|
35186
35211
|
listSources(node) {
|
|
@@ -35602,6 +35627,9 @@ class StatementFlow {
|
|
|
35602
35627
|
graph.addEdge(caseName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.undefined);
|
|
35603
35628
|
}
|
|
35604
35629
|
}
|
|
35630
|
+
else if (type instanceof Structures.Define) {
|
|
35631
|
+
// do nothing
|
|
35632
|
+
}
|
|
35605
35633
|
else {
|
|
35606
35634
|
console.dir("StatementFlow,todo, " + n.get().constructor.name);
|
|
35607
35635
|
}
|
|
@@ -43479,13 +43507,13 @@ class Help {
|
|
|
43479
43507
|
/////////////////////////////////////////////////
|
|
43480
43508
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43481
43509
|
let content = "";
|
|
43482
|
-
content = `
|
|
43483
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43484
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43485
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43486
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43487
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43488
|
-
<hr>
|
|
43510
|
+
content = `
|
|
43511
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43512
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43513
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43514
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43515
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43516
|
+
<hr>
|
|
43489
43517
|
` +
|
|
43490
43518
|
"<tt>" + textDocument.uri + " (" +
|
|
43491
43519
|
(position.line + 1) + ", " +
|
|
@@ -52865,7 +52893,7 @@ class Registry {
|
|
|
52865
52893
|
}
|
|
52866
52894
|
static abaplintVersion() {
|
|
52867
52895
|
// magic, see build script "version.sh"
|
|
52868
|
-
return "2.113.
|
|
52896
|
+
return "2.113.32";
|
|
52869
52897
|
}
|
|
52870
52898
|
getDDICReferences() {
|
|
52871
52899
|
return this.ddicReferences;
|
|
@@ -53184,10 +53212,10 @@ class SevenBitAscii {
|
|
|
53184
53212
|
key: "7bit_ascii",
|
|
53185
53213
|
title: "Check for 7bit ascii",
|
|
53186
53214
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53187
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53188
|
-
|
|
53189
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53190
|
-
|
|
53215
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53216
|
+
|
|
53217
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53218
|
+
|
|
53191
53219
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53192
53220
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53193
53221
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53393,10 +53421,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53393
53421
|
key: "abapdoc",
|
|
53394
53422
|
title: "Check abapdoc",
|
|
53395
53423
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53396
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53397
|
-
|
|
53398
|
-
Plus class and interface definitions.
|
|
53399
|
-
|
|
53424
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53425
|
+
|
|
53426
|
+
Plus class and interface definitions.
|
|
53427
|
+
|
|
53400
53428
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53401
53429
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53402
53430
|
};
|
|
@@ -53533,27 +53561,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53533
53561
|
title: "Add test attributes for tests classes with test methods",
|
|
53534
53562
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53535
53563
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53536
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53537
|
-
PUBLIC SECTION.
|
|
53538
|
-
PROTECTED SECTION.
|
|
53539
|
-
PRIVATE SECTION.
|
|
53540
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53541
|
-
ENDCLASS.
|
|
53542
|
-
|
|
53543
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53544
|
-
METHOD test.
|
|
53545
|
-
ENDMETHOD.
|
|
53564
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53565
|
+
PUBLIC SECTION.
|
|
53566
|
+
PROTECTED SECTION.
|
|
53567
|
+
PRIVATE SECTION.
|
|
53568
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53569
|
+
ENDCLASS.
|
|
53570
|
+
|
|
53571
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53572
|
+
METHOD test.
|
|
53573
|
+
ENDMETHOD.
|
|
53546
53574
|
ENDCLASS.`,
|
|
53547
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53548
|
-
PUBLIC SECTION.
|
|
53549
|
-
PROTECTED SECTION.
|
|
53550
|
-
PRIVATE SECTION.
|
|
53551
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53552
|
-
ENDCLASS.
|
|
53553
|
-
|
|
53554
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53555
|
-
METHOD test.
|
|
53556
|
-
ENDMETHOD.
|
|
53575
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53576
|
+
PUBLIC SECTION.
|
|
53577
|
+
PROTECTED SECTION.
|
|
53578
|
+
PRIVATE SECTION.
|
|
53579
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53580
|
+
ENDCLASS.
|
|
53581
|
+
|
|
53582
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53583
|
+
METHOD test.
|
|
53584
|
+
ENDMETHOD.
|
|
53557
53585
|
ENDCLASS.`,
|
|
53558
53586
|
};
|
|
53559
53587
|
}
|
|
@@ -53639,49 +53667,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53639
53667
|
key: "align_parameters",
|
|
53640
53668
|
title: "Align Parameters",
|
|
53641
53669
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53642
|
-
extendedInformation: `Checks:
|
|
53643
|
-
* function module calls
|
|
53644
|
-
* method calls
|
|
53645
|
-
* VALUE constructors
|
|
53646
|
-
* NEW constructors
|
|
53647
|
-
* RAISE EXCEPTION statements
|
|
53648
|
-
* CREATE OBJECT statements
|
|
53649
|
-
* RAISE EVENT statements
|
|
53650
|
-
|
|
53651
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53652
|
-
|
|
53653
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53654
|
-
|
|
53655
|
-
If parameters are on the same row, no issues are reported, see
|
|
53670
|
+
extendedInformation: `Checks:
|
|
53671
|
+
* function module calls
|
|
53672
|
+
* method calls
|
|
53673
|
+
* VALUE constructors
|
|
53674
|
+
* NEW constructors
|
|
53675
|
+
* RAISE EXCEPTION statements
|
|
53676
|
+
* CREATE OBJECT statements
|
|
53677
|
+
* RAISE EVENT statements
|
|
53678
|
+
|
|
53679
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53680
|
+
|
|
53681
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53682
|
+
|
|
53683
|
+
If parameters are on the same row, no issues are reported, see
|
|
53656
53684
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53657
53685
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53658
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53659
|
-
EXPORTING
|
|
53660
|
-
foo = 2
|
|
53661
|
-
parameter = 3.
|
|
53662
|
-
|
|
53663
|
-
foobar( moo = 1
|
|
53664
|
-
param = 1 ).
|
|
53665
|
-
|
|
53666
|
-
foo = VALUE #(
|
|
53667
|
-
foo = bar
|
|
53686
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53687
|
+
EXPORTING
|
|
53688
|
+
foo = 2
|
|
53689
|
+
parameter = 3.
|
|
53690
|
+
|
|
53691
|
+
foobar( moo = 1
|
|
53692
|
+
param = 1 ).
|
|
53693
|
+
|
|
53694
|
+
foo = VALUE #(
|
|
53695
|
+
foo = bar
|
|
53668
53696
|
moo = 2 ).`,
|
|
53669
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53670
|
-
EXPORTING
|
|
53671
|
-
foo = 2
|
|
53672
|
-
parameter = 3.
|
|
53673
|
-
|
|
53674
|
-
foobar( moo = 1
|
|
53675
|
-
param = 1 ).
|
|
53676
|
-
|
|
53677
|
-
foo = VALUE #(
|
|
53678
|
-
foo = bar
|
|
53679
|
-
moo = 2 ).
|
|
53680
|
-
|
|
53681
|
-
DATA(sdf) = VALUE type(
|
|
53682
|
-
common_val = 2
|
|
53683
|
-
another_common = 5
|
|
53684
|
-
( row_value = 4
|
|
53697
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53698
|
+
EXPORTING
|
|
53699
|
+
foo = 2
|
|
53700
|
+
parameter = 3.
|
|
53701
|
+
|
|
53702
|
+
foobar( moo = 1
|
|
53703
|
+
param = 1 ).
|
|
53704
|
+
|
|
53705
|
+
foo = VALUE #(
|
|
53706
|
+
foo = bar
|
|
53707
|
+
moo = 2 ).
|
|
53708
|
+
|
|
53709
|
+
DATA(sdf) = VALUE type(
|
|
53710
|
+
common_val = 2
|
|
53711
|
+
another_common = 5
|
|
53712
|
+
( row_value = 4
|
|
53685
53713
|
value_foo = 5 ) ).`,
|
|
53686
53714
|
};
|
|
53687
53715
|
}
|
|
@@ -54115,37 +54143,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54115
54143
|
key: "align_type_expressions",
|
|
54116
54144
|
title: "Align TYPE expressions",
|
|
54117
54145
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54118
|
-
extendedInformation: `
|
|
54119
|
-
Currently works for METHODS + BEGIN OF
|
|
54120
|
-
|
|
54121
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54122
|
-
|
|
54123
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54146
|
+
extendedInformation: `
|
|
54147
|
+
Currently works for METHODS + BEGIN OF
|
|
54148
|
+
|
|
54149
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54150
|
+
|
|
54151
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54124
54152
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54125
54153
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54126
|
-
badExample: `
|
|
54127
|
-
TYPES: BEGIN OF foo,
|
|
54128
|
-
bar TYPE i,
|
|
54129
|
-
foobar TYPE i,
|
|
54130
|
-
END OF foo.
|
|
54131
|
-
|
|
54132
|
-
INTERFACE lif.
|
|
54133
|
-
METHODS bar
|
|
54134
|
-
IMPORTING
|
|
54135
|
-
foo TYPE i
|
|
54136
|
-
foobar TYPE i.
|
|
54154
|
+
badExample: `
|
|
54155
|
+
TYPES: BEGIN OF foo,
|
|
54156
|
+
bar TYPE i,
|
|
54157
|
+
foobar TYPE i,
|
|
54158
|
+
END OF foo.
|
|
54159
|
+
|
|
54160
|
+
INTERFACE lif.
|
|
54161
|
+
METHODS bar
|
|
54162
|
+
IMPORTING
|
|
54163
|
+
foo TYPE i
|
|
54164
|
+
foobar TYPE i.
|
|
54137
54165
|
ENDINTERFACE.`,
|
|
54138
|
-
goodExample: `
|
|
54139
|
-
TYPES: BEGIN OF foo,
|
|
54140
|
-
bar TYPE i,
|
|
54141
|
-
foobar TYPE i,
|
|
54142
|
-
END OF foo.
|
|
54143
|
-
|
|
54144
|
-
INTERFACE lif.
|
|
54145
|
-
METHODS bar
|
|
54146
|
-
IMPORTING
|
|
54147
|
-
foo TYPE i
|
|
54148
|
-
foobar TYPE i.
|
|
54166
|
+
goodExample: `
|
|
54167
|
+
TYPES: BEGIN OF foo,
|
|
54168
|
+
bar TYPE i,
|
|
54169
|
+
foobar TYPE i,
|
|
54170
|
+
END OF foo.
|
|
54171
|
+
|
|
54172
|
+
INTERFACE lif.
|
|
54173
|
+
METHODS bar
|
|
54174
|
+
IMPORTING
|
|
54175
|
+
foo TYPE i
|
|
54176
|
+
foobar TYPE i.
|
|
54149
54177
|
ENDINTERFACE.`,
|
|
54150
54178
|
};
|
|
54151
54179
|
}
|
|
@@ -54424,16 +54452,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54424
54452
|
return {
|
|
54425
54453
|
key: "ambiguous_statement",
|
|
54426
54454
|
title: "Check for ambigious statements",
|
|
54427
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54428
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54429
|
-
|
|
54455
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54456
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54457
|
+
|
|
54430
54458
|
Only works if the target version is 740sp05 or above`,
|
|
54431
54459
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54432
|
-
badExample: `DELETE foo FROM bar.
|
|
54460
|
+
badExample: `DELETE foo FROM bar.
|
|
54433
54461
|
MODIFY foo FROM bar.`,
|
|
54434
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54435
|
-
DELETE TABLE itab FROM 2.
|
|
54436
|
-
MODIFY zfoo FROM @wa.
|
|
54462
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54463
|
+
DELETE TABLE itab FROM 2.
|
|
54464
|
+
MODIFY zfoo FROM @wa.
|
|
54437
54465
|
MODIFY TABLE foo FROM bar.`,
|
|
54438
54466
|
};
|
|
54439
54467
|
}
|
|
@@ -54538,16 +54566,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54538
54566
|
key: "avoid_use",
|
|
54539
54567
|
title: "Avoid use of certain statements",
|
|
54540
54568
|
shortDescription: `Detects usage of certain statements.`,
|
|
54541
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54542
|
-
|
|
54543
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54544
|
-
|
|
54545
|
-
STATICS: use CLASS-DATA instead
|
|
54546
|
-
|
|
54547
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54548
|
-
|
|
54549
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54550
|
-
|
|
54569
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54570
|
+
|
|
54571
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54572
|
+
|
|
54573
|
+
STATICS: use CLASS-DATA instead
|
|
54574
|
+
|
|
54575
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54576
|
+
|
|
54577
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54578
|
+
|
|
54551
54579
|
BREAK points`,
|
|
54552
54580
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54553
54581
|
};
|
|
@@ -54679,11 +54707,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54679
54707
|
title: "Check BEGIN END names",
|
|
54680
54708
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54681
54709
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54682
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54683
|
-
field TYPE i,
|
|
54710
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54711
|
+
field TYPE i,
|
|
54684
54712
|
END OF structure_not_the_same.`,
|
|
54685
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54686
|
-
field TYPE i,
|
|
54713
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54714
|
+
field TYPE i,
|
|
54687
54715
|
END OF stru.`,
|
|
54688
54716
|
};
|
|
54689
54717
|
}
|
|
@@ -54780,20 +54808,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54780
54808
|
title: "BEGIN contains single INCLUDE",
|
|
54781
54809
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54782
54810
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54783
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54784
|
-
INCLUDE TYPE dselc.
|
|
54785
|
-
TYPES: END OF dummy1.
|
|
54786
|
-
|
|
54787
|
-
DATA BEGIN OF foo.
|
|
54788
|
-
INCLUDE STRUCTURE syst.
|
|
54789
|
-
DATA END OF foo.
|
|
54790
|
-
|
|
54791
|
-
STATICS BEGIN OF bar.
|
|
54792
|
-
INCLUDE STRUCTURE syst.
|
|
54811
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54812
|
+
INCLUDE TYPE dselc.
|
|
54813
|
+
TYPES: END OF dummy1.
|
|
54814
|
+
|
|
54815
|
+
DATA BEGIN OF foo.
|
|
54816
|
+
INCLUDE STRUCTURE syst.
|
|
54817
|
+
DATA END OF foo.
|
|
54818
|
+
|
|
54819
|
+
STATICS BEGIN OF bar.
|
|
54820
|
+
INCLUDE STRUCTURE syst.
|
|
54793
54821
|
STATICS END OF bar.`,
|
|
54794
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54795
|
-
DATA field TYPE i.
|
|
54796
|
-
INCLUDE STRUCTURE dselc.
|
|
54822
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54823
|
+
DATA field TYPE i.
|
|
54824
|
+
INCLUDE STRUCTURE dselc.
|
|
54797
54825
|
DATA END OF foo.`,
|
|
54798
54826
|
};
|
|
54799
54827
|
}
|
|
@@ -54883,9 +54911,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54883
54911
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54884
54912
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54885
54913
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54886
|
-
goodExample: `TRY.
|
|
54887
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54888
|
-
CATCH cx_sy_authorization_error.
|
|
54914
|
+
goodExample: `TRY.
|
|
54915
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54916
|
+
CATCH cx_sy_authorization_error.
|
|
54889
54917
|
ENDTRY.`,
|
|
54890
54918
|
};
|
|
54891
54919
|
}
|
|
@@ -54950,10 +54978,10 @@ class CDSCommentStyle {
|
|
|
54950
54978
|
key: "cds_comment_style",
|
|
54951
54979
|
title: "CDS Comment Style",
|
|
54952
54980
|
shortDescription: `Check for obsolete comment style`,
|
|
54953
|
-
extendedInformation: `Check for obsolete comment style
|
|
54954
|
-
|
|
54955
|
-
Comments starting with "--" are considered obsolete
|
|
54956
|
-
|
|
54981
|
+
extendedInformation: `Check for obsolete comment style
|
|
54982
|
+
|
|
54983
|
+
Comments starting with "--" are considered obsolete
|
|
54984
|
+
|
|
54957
54985
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54958
54986
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54959
54987
|
badExample: "-- this is a comment",
|
|
@@ -55019,10 +55047,10 @@ class CDSLegacyView {
|
|
|
55019
55047
|
key: "cds_legacy_view",
|
|
55020
55048
|
title: "CDS Legacy View",
|
|
55021
55049
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55022
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55023
|
-
|
|
55024
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55025
|
-
|
|
55050
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55051
|
+
|
|
55052
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55053
|
+
|
|
55026
55054
|
v755 and up`,
|
|
55027
55055
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55028
55056
|
};
|
|
@@ -55177,10 +55205,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55177
55205
|
key: "chain_mainly_declarations",
|
|
55178
55206
|
title: "Chain mainly declarations",
|
|
55179
55207
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55180
|
-
extendedInformation: `
|
|
55181
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55182
|
-
|
|
55183
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55208
|
+
extendedInformation: `
|
|
55209
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55210
|
+
|
|
55211
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55184
55212
|
`,
|
|
55185
55213
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55186
55214
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55356,17 +55384,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55356
55384
|
title: "Change IF to CASE",
|
|
55357
55385
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55358
55386
|
// eslint-disable-next-line max-len
|
|
55359
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55360
|
-
|
|
55387
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55388
|
+
|
|
55361
55389
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55362
55390
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55363
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55364
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55365
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55391
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55392
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55393
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55366
55394
|
ENDIF.`,
|
|
55367
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55368
|
-
WHEN 'FOO'.
|
|
55369
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55395
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55396
|
+
WHEN 'FOO'.
|
|
55397
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55370
55398
|
ENDCASE.`,
|
|
55371
55399
|
};
|
|
55372
55400
|
}
|
|
@@ -55503,8 +55531,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55503
55531
|
return {
|
|
55504
55532
|
key: "check_abstract",
|
|
55505
55533
|
title: "Check abstract methods and classes",
|
|
55506
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55507
|
-
- class defined as abstract and final,
|
|
55534
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55535
|
+
- class defined as abstract and final,
|
|
55508
55536
|
- non-abstract class contains abstract methods`,
|
|
55509
55537
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55510
55538
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55585,11 +55613,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55585
55613
|
return {
|
|
55586
55614
|
key: "check_comments",
|
|
55587
55615
|
title: "Check Comments",
|
|
55588
|
-
shortDescription: `
|
|
55616
|
+
shortDescription: `
|
|
55589
55617
|
Various checks for comment usage.`,
|
|
55590
|
-
extendedInformation: `
|
|
55591
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55592
|
-
|
|
55618
|
+
extendedInformation: `
|
|
55619
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55620
|
+
|
|
55593
55621
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55594
55622
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55595
55623
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55751,9 +55779,9 @@ class CheckInclude {
|
|
|
55751
55779
|
key: "check_include",
|
|
55752
55780
|
title: "Check INCLUDEs",
|
|
55753
55781
|
shortDescription: `Checks INCLUDE statements`,
|
|
55754
|
-
extendedInformation: `
|
|
55755
|
-
* Reports unused includes
|
|
55756
|
-
* Errors if the includes are not found
|
|
55782
|
+
extendedInformation: `
|
|
55783
|
+
* Reports unused includes
|
|
55784
|
+
* Errors if the includes are not found
|
|
55757
55785
|
* Error if including a main program`,
|
|
55758
55786
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55759
55787
|
};
|
|
@@ -55829,14 +55857,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55829
55857
|
key: "check_subrc",
|
|
55830
55858
|
title: "Check sy-subrc",
|
|
55831
55859
|
shortDescription: `Check sy-subrc`,
|
|
55832
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55833
|
-
|
|
55834
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55835
|
-
|
|
55836
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55837
|
-
|
|
55838
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55839
|
-
|
|
55860
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55861
|
+
|
|
55862
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55863
|
+
|
|
55864
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55865
|
+
|
|
55866
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55867
|
+
|
|
55840
55868
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55841
55869
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55842
55870
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56406,17 +56434,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56406
56434
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56407
56435
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56408
56436
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56409
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56410
|
-
EXCEPTIONS
|
|
56411
|
-
system_failure = 1 MESSAGE lv_message
|
|
56412
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56413
|
-
resource_failure = 1
|
|
56437
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56438
|
+
EXCEPTIONS
|
|
56439
|
+
system_failure = 1 MESSAGE lv_message
|
|
56440
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56441
|
+
resource_failure = 1
|
|
56414
56442
|
OTHERS = 1.`,
|
|
56415
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56416
|
-
EXCEPTIONS
|
|
56417
|
-
system_failure = 1 MESSAGE lv_message
|
|
56418
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56419
|
-
resource_failure = 3
|
|
56443
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56444
|
+
EXCEPTIONS
|
|
56445
|
+
system_failure = 1 MESSAGE lv_message
|
|
56446
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56447
|
+
resource_failure = 3
|
|
56420
56448
|
OTHERS = 4.`,
|
|
56421
56449
|
};
|
|
56422
56450
|
}
|
|
@@ -56662,7 +56690,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56662
56690
|
key: "commented_code",
|
|
56663
56691
|
title: "Find commented code",
|
|
56664
56692
|
shortDescription: `Detects usage of commented out code.`,
|
|
56665
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56693
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56666
56694
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56667
56695
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56668
56696
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56895,10 +56923,10 @@ class ConstructorVisibilityPublic {
|
|
|
56895
56923
|
key: "constructor_visibility_public",
|
|
56896
56924
|
title: "Check constructor visibility is public",
|
|
56897
56925
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
56898
|
-
extendedInformation: `
|
|
56899
|
-
This only applies to global classes.
|
|
56900
|
-
|
|
56901
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56926
|
+
extendedInformation: `
|
|
56927
|
+
This only applies to global classes.
|
|
56928
|
+
|
|
56929
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56902
56930
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56903
56931
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56904
56932
|
};
|
|
@@ -56973,8 +57001,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56973
57001
|
key: "contains_tab",
|
|
56974
57002
|
title: "Code contains tab",
|
|
56975
57003
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56976
|
-
extendedInformation: `
|
|
56977
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57004
|
+
extendedInformation: `
|
|
57005
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56978
57006
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56979
57007
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56980
57008
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57061,10 +57089,10 @@ class CyclicOO {
|
|
|
57061
57089
|
key: "cyclic_oo",
|
|
57062
57090
|
title: "Cyclic OO",
|
|
57063
57091
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57064
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57065
|
-
|
|
57066
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57067
|
-
|
|
57092
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57093
|
+
|
|
57094
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57095
|
+
|
|
57068
57096
|
References in testclass includes are ignored`,
|
|
57069
57097
|
};
|
|
57070
57098
|
}
|
|
@@ -57307,7 +57335,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57307
57335
|
key: "dangerous_statement",
|
|
57308
57336
|
title: "Dangerous statement",
|
|
57309
57337
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57310
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57338
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57311
57339
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57312
57340
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57313
57341
|
};
|
|
@@ -57514,13 +57542,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57514
57542
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57515
57543
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57516
57544
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57517
|
-
badExample: `FROM foo.
|
|
57518
|
-
WRITE 'hello'.
|
|
57519
|
-
DATA int TYPE i.
|
|
57545
|
+
badExample: `FROM foo.
|
|
57546
|
+
WRITE 'hello'.
|
|
57547
|
+
DATA int TYPE i.
|
|
57520
57548
|
ENDFORM.`,
|
|
57521
|
-
goodExample: `FROM foo.
|
|
57522
|
-
DATA int TYPE i.
|
|
57523
|
-
WRITE 'hello'.
|
|
57549
|
+
goodExample: `FROM foo.
|
|
57550
|
+
DATA int TYPE i.
|
|
57551
|
+
WRITE 'hello'.
|
|
57524
57552
|
ENDFORM.`,
|
|
57525
57553
|
};
|
|
57526
57554
|
}
|
|
@@ -58059,39 +58087,39 @@ class Downport {
|
|
|
58059
58087
|
key: "downport",
|
|
58060
58088
|
title: "Downport statement",
|
|
58061
58089
|
shortDescription: `Downport functionality`,
|
|
58062
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58063
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58064
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58065
|
-
|
|
58066
|
-
Current rules:
|
|
58067
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58068
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58069
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58070
|
-
* CONV is outlined
|
|
58071
|
-
* COND is outlined
|
|
58072
|
-
* REDUCE is outlined
|
|
58073
|
-
* SWITCH is outlined
|
|
58074
|
-
* FILTER is outlined
|
|
58075
|
-
* APPEND expression is outlined
|
|
58076
|
-
* INSERT expression is outlined
|
|
58077
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58078
|
-
* CAST changed to ?=
|
|
58079
|
-
* LOOP AT method_call( ) is outlined
|
|
58080
|
-
* VALUE # with structure fields
|
|
58081
|
-
* VALUE # with internal table lines
|
|
58082
|
-
* Table Expressions are outlined
|
|
58083
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58084
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58085
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58086
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58087
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58088
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58089
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58090
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58091
|
-
* MESSAGE with non simple source
|
|
58092
|
-
|
|
58093
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58094
|
-
|
|
58090
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58091
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58092
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58093
|
+
|
|
58094
|
+
Current rules:
|
|
58095
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58096
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58097
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58098
|
+
* CONV is outlined
|
|
58099
|
+
* COND is outlined
|
|
58100
|
+
* REDUCE is outlined
|
|
58101
|
+
* SWITCH is outlined
|
|
58102
|
+
* FILTER is outlined
|
|
58103
|
+
* APPEND expression is outlined
|
|
58104
|
+
* INSERT expression is outlined
|
|
58105
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58106
|
+
* CAST changed to ?=
|
|
58107
|
+
* LOOP AT method_call( ) is outlined
|
|
58108
|
+
* VALUE # with structure fields
|
|
58109
|
+
* VALUE # with internal table lines
|
|
58110
|
+
* Table Expressions are outlined
|
|
58111
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58112
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58113
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58114
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58115
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58116
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58117
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58118
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58119
|
+
* MESSAGE with non simple source
|
|
58120
|
+
|
|
58121
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58122
|
+
|
|
58095
58123
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58096
58124
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58097
58125
|
};
|
|
@@ -58669,10 +58697,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58669
58697
|
const fieldName = f.concatTokens();
|
|
58670
58698
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58671
58699
|
}
|
|
58672
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58700
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58673
58701
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58674
58702
|
}
|
|
58675
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58703
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58676
58704
|
${indentation}`);
|
|
58677
58705
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58678
58706
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58731,12 +58759,12 @@ ${indentation}`);
|
|
|
58731
58759
|
}
|
|
58732
58760
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58733
58761
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
58734
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58735
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58736
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58762
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58763
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58764
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58737
58765
|
${indentation}`);
|
|
58738
58766
|
if (fieldDefinitions === "") {
|
|
58739
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58767
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58740
58768
|
${indentation}`);
|
|
58741
58769
|
}
|
|
58742
58770
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58804,7 +58832,7 @@ ${indentation}`);
|
|
|
58804
58832
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58805
58833
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58806
58834
|
const firstToken = high.getFirstToken();
|
|
58807
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58835
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58808
58836
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58809
58837
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58810
58838
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58858,7 +58886,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58858
58886
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58859
58887
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58860
58888
|
const firstToken = high.getFirstToken();
|
|
58861
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58889
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58862
58890
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58863
58891
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58864
58892
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58900,14 +58928,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58900
58928
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58901
58929
|
const firstToken = high.getFirstToken();
|
|
58902
58930
|
// note that the tabix restore should be done before throwing the exception
|
|
58903
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58904
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58905
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58906
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58907
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58908
|
-
${indentation}IF sy-subrc <> 0.
|
|
58909
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58910
|
-
${indentation}ENDIF.
|
|
58931
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58932
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58933
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58934
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58935
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58936
|
+
${indentation}IF sy-subrc <> 0.
|
|
58937
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58938
|
+
${indentation}ENDIF.
|
|
58911
58939
|
${indentation}`);
|
|
58912
58940
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58913
58941
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58964,7 +58992,7 @@ ${indentation}`);
|
|
|
58964
58992
|
const className = classNames[0].concatTokens();
|
|
58965
58993
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58966
58994
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58967
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58995
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58968
58996
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58969
58997
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58970
58998
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59126,16 +59154,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59126
59154
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59127
59155
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59128
59156
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59129
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59130
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59157
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59158
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59131
59159
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59132
59160
|
if (withs.length > 0) {
|
|
59133
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59134
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59135
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59161
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59162
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59163
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59136
59164
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59137
59165
|
}
|
|
59138
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59166
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59139
59167
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59140
59168
|
if (withs.length > 0) {
|
|
59141
59169
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59247,10 +59275,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59247
59275
|
let code = "";
|
|
59248
59276
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59249
59277
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59250
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59251
|
-
IF sy-subrc <> 0.
|
|
59252
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59253
|
-
ENDIF.
|
|
59278
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59279
|
+
IF sy-subrc <> 0.
|
|
59280
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59281
|
+
ENDIF.
|
|
59254
59282
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59255
59283
|
}
|
|
59256
59284
|
else {
|
|
@@ -59339,20 +59367,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59339
59367
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59340
59368
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59341
59369
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59342
|
-
code += ` items LIKE ${loopSourceName},
|
|
59343
|
-
END OF ${groupTargetName}type.
|
|
59344
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59345
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59370
|
+
code += ` items LIKE ${loopSourceName},
|
|
59371
|
+
END OF ${groupTargetName}type.
|
|
59372
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59373
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59346
59374
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59347
59375
|
if (groupIndexName !== undefined) {
|
|
59348
59376
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59349
59377
|
}
|
|
59350
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59378
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59351
59379
|
IF sy-subrc = 0.\n`;
|
|
59352
59380
|
if (groupCountName !== undefined) {
|
|
59353
59381
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59354
59382
|
}
|
|
59355
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59383
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59356
59384
|
ELSE.\n`;
|
|
59357
59385
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59358
59386
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59373,8 +59401,8 @@ ELSE.\n`;
|
|
|
59373
59401
|
}
|
|
59374
59402
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59375
59403
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59376
|
-
code += `ENDIF.
|
|
59377
|
-
ENDLOOP.
|
|
59404
|
+
code += `ENDIF.
|
|
59405
|
+
ENDLOOP.
|
|
59378
59406
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59379
59407
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59380
59408
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59546,7 +59574,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59546
59574
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59547
59575
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59548
59576
|
// all ENUMS are char like?
|
|
59549
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59577
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59550
59578
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59551
59579
|
let count = 1;
|
|
59552
59580
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59590,14 +59618,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59590
59618
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59591
59619
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59592
59620
|
// restore tabix before exeption
|
|
59593
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59594
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59595
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59596
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59597
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59598
|
-
${indentation}IF sy-subrc <> 0.
|
|
59599
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59600
|
-
${indentation}ENDIF.
|
|
59621
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59622
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59623
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59624
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59625
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59626
|
+
${indentation}IF sy-subrc <> 0.
|
|
59627
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59628
|
+
${indentation}ENDIF.
|
|
59601
59629
|
${indentation}${uniqueName}`;
|
|
59602
59630
|
const start = target.getFirstToken().getStart();
|
|
59603
59631
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59677,11 +59705,11 @@ ${indentation}${uniqueName}`;
|
|
|
59677
59705
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59678
59706
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59679
59707
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59680
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59681
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59682
|
-
${indentation} EXPORTING
|
|
59683
|
-
${indentation} input = ${source}
|
|
59684
|
-
${indentation} IMPORTING
|
|
59708
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59709
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59710
|
+
${indentation} EXPORTING
|
|
59711
|
+
${indentation} input = ${source}
|
|
59712
|
+
${indentation} IMPORTING
|
|
59685
59713
|
${indentation} output = ${uniqueName}.\n`;
|
|
59686
59714
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59687
59715
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60993,12 +61021,12 @@ class EasyToFindMessages {
|
|
|
60993
61021
|
key: "easy_to_find_messages",
|
|
60994
61022
|
title: "Easy to find messages",
|
|
60995
61023
|
shortDescription: `Make messages easy to find`,
|
|
60996
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
60997
|
-
|
|
60998
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
60999
|
-
|
|
61000
|
-
Also see rule "message_exists"
|
|
61001
|
-
|
|
61024
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61025
|
+
|
|
61026
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61027
|
+
|
|
61028
|
+
Also see rule "message_exists"
|
|
61029
|
+
|
|
61002
61030
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61003
61031
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61004
61032
|
};
|
|
@@ -61079,13 +61107,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61079
61107
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61080
61108
|
extendedInformation: ``,
|
|
61081
61109
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61082
|
-
badExample: `
|
|
61083
|
-
INITIALIZATION.
|
|
61084
|
-
WRITE 'hello'.
|
|
61110
|
+
badExample: `
|
|
61111
|
+
INITIALIZATION.
|
|
61112
|
+
WRITE 'hello'.
|
|
61085
61113
|
END-OF-SELECTION.`,
|
|
61086
|
-
goodExample: `
|
|
61087
|
-
START-OF-SELECTION.
|
|
61088
|
-
PERFORM sdf.
|
|
61114
|
+
goodExample: `
|
|
61115
|
+
START-OF-SELECTION.
|
|
61116
|
+
PERFORM sdf.
|
|
61089
61117
|
COMMIT WORK.`,
|
|
61090
61118
|
};
|
|
61091
61119
|
}
|
|
@@ -61177,8 +61205,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61177
61205
|
key: "empty_line_in_statement",
|
|
61178
61206
|
title: "Find empty lines in statements",
|
|
61179
61207
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61180
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61181
|
-
|
|
61208
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61209
|
+
|
|
61182
61210
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61183
61211
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61184
61212
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61354,13 +61382,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61354
61382
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61355
61383
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61356
61384
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61357
|
-
badExample: `IF foo = bar.
|
|
61358
|
-
ENDIF.
|
|
61359
|
-
|
|
61360
|
-
DO 2 TIMES.
|
|
61385
|
+
badExample: `IF foo = bar.
|
|
61386
|
+
ENDIF.
|
|
61387
|
+
|
|
61388
|
+
DO 2 TIMES.
|
|
61361
61389
|
ENDDO.`,
|
|
61362
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61363
|
-
ENDLOOP.
|
|
61390
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61391
|
+
ENDLOOP.
|
|
61364
61392
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61365
61393
|
};
|
|
61366
61394
|
}
|
|
@@ -61502,10 +61530,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61502
61530
|
return {
|
|
61503
61531
|
key: "exit_or_check",
|
|
61504
61532
|
title: "Find EXIT or CHECK outside loops",
|
|
61505
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61533
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61506
61534
|
Use RETURN to leave procesing blocks instead.`,
|
|
61507
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61508
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61535
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61536
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61509
61537
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61510
61538
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61511
61539
|
};
|
|
@@ -61588,12 +61616,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61588
61616
|
key: "expand_macros",
|
|
61589
61617
|
title: "Expand Macros",
|
|
61590
61618
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61591
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61592
|
-
|
|
61619
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61620
|
+
|
|
61593
61621
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61594
|
-
badExample: `DEFINE _hello.
|
|
61595
|
-
WRITE 'hello'.
|
|
61596
|
-
END-OF-DEFINITION.
|
|
61622
|
+
badExample: `DEFINE _hello.
|
|
61623
|
+
WRITE 'hello'.
|
|
61624
|
+
END-OF-DEFINITION.
|
|
61597
61625
|
_hello.`,
|
|
61598
61626
|
goodExample: `WRITE 'hello'.`,
|
|
61599
61627
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61680,7 +61708,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61680
61708
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61681
61709
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61682
61710
|
goodExample: `call_method( foo = bar ).`,
|
|
61683
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61711
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61684
61712
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61685
61713
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61686
61714
|
};
|
|
@@ -61778,7 +61806,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61778
61806
|
key: "forbidden_identifier",
|
|
61779
61807
|
title: "Forbidden Identifier",
|
|
61780
61808
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61781
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61809
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61782
61810
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61783
61811
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61784
61812
|
};
|
|
@@ -62020,8 +62048,8 @@ class ForbiddenVoidType {
|
|
|
62020
62048
|
key: "forbidden_void_type",
|
|
62021
62049
|
title: "Forbidden Void Types",
|
|
62022
62050
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62023
|
-
extendedInformation: `Inspiration:
|
|
62024
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62051
|
+
extendedInformation: `Inspiration:
|
|
62052
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62025
62053
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62026
62054
|
};
|
|
62027
62055
|
}
|
|
@@ -62264,9 +62292,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62264
62292
|
key: "fully_type_itabs",
|
|
62265
62293
|
title: "Fully type internal tables",
|
|
62266
62294
|
shortDescription: `No implict table types or table keys`,
|
|
62267
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62295
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62268
62296
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62269
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62297
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62270
62298
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62271
62299
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62272
62300
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62451,26 +62479,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62451
62479
|
key: "functional_writing",
|
|
62452
62480
|
title: "Use functional writing",
|
|
62453
62481
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62454
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62482
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62455
62483
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62456
62484
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62457
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62458
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62459
|
-
EXPORTING
|
|
62460
|
-
p_name = 'NAME'
|
|
62461
|
-
RECEIVING
|
|
62462
|
-
p_descr_ref = lr_typedescr
|
|
62463
|
-
EXCEPTIONS
|
|
62464
|
-
type_not_found = 1
|
|
62485
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62486
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62487
|
+
EXPORTING
|
|
62488
|
+
p_name = 'NAME'
|
|
62489
|
+
RECEIVING
|
|
62490
|
+
p_descr_ref = lr_typedescr
|
|
62491
|
+
EXCEPTIONS
|
|
62492
|
+
type_not_found = 1
|
|
62465
62493
|
OTHERS = 2.`,
|
|
62466
|
-
goodExample: `zcl_class=>method( ).
|
|
62467
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62468
|
-
EXPORTING
|
|
62469
|
-
p_name = 'NAME'
|
|
62470
|
-
RECEIVING
|
|
62471
|
-
p_descr_ref = lr_typedescr
|
|
62472
|
-
EXCEPTIONS
|
|
62473
|
-
type_not_found = 1
|
|
62494
|
+
goodExample: `zcl_class=>method( ).
|
|
62495
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62496
|
+
EXPORTING
|
|
62497
|
+
p_name = 'NAME'
|
|
62498
|
+
RECEIVING
|
|
62499
|
+
p_descr_ref = lr_typedescr
|
|
62500
|
+
EXCEPTIONS
|
|
62501
|
+
type_not_found = 1
|
|
62474
62502
|
OTHERS = 2 ).`,
|
|
62475
62503
|
};
|
|
62476
62504
|
}
|
|
@@ -62581,14 +62609,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62581
62609
|
key: "global_class",
|
|
62582
62610
|
title: "Global class checks",
|
|
62583
62611
|
shortDescription: `Checks related to global classes`,
|
|
62584
|
-
extendedInformation: `* global classes must be in own files
|
|
62585
|
-
|
|
62586
|
-
* file names must match class name
|
|
62587
|
-
|
|
62588
|
-
* file names must match interface name
|
|
62589
|
-
|
|
62590
|
-
* global classes must be global definitions
|
|
62591
|
-
|
|
62612
|
+
extendedInformation: `* global classes must be in own files
|
|
62613
|
+
|
|
62614
|
+
* file names must match class name
|
|
62615
|
+
|
|
62616
|
+
* file names must match interface name
|
|
62617
|
+
|
|
62618
|
+
* global classes must be global definitions
|
|
62619
|
+
|
|
62592
62620
|
* global interfaces must be global definitions`,
|
|
62593
62621
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62594
62622
|
};
|
|
@@ -62687,21 +62715,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62687
62715
|
return {
|
|
62688
62716
|
key: "identical_conditions",
|
|
62689
62717
|
title: "Identical conditions",
|
|
62690
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62691
|
-
|
|
62718
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62719
|
+
|
|
62692
62720
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62693
62721
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62694
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62695
|
-
ENDIF.
|
|
62696
|
-
CASE bar.
|
|
62697
|
-
WHEN '1'.
|
|
62698
|
-
WHEN 'A' OR '1'.
|
|
62722
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62723
|
+
ENDIF.
|
|
62724
|
+
CASE bar.
|
|
62725
|
+
WHEN '1'.
|
|
62726
|
+
WHEN 'A' OR '1'.
|
|
62699
62727
|
ENDCASE.`,
|
|
62700
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62701
|
-
ENDIF.
|
|
62702
|
-
CASE bar.
|
|
62703
|
-
WHEN '1'.
|
|
62704
|
-
WHEN 'A'.
|
|
62728
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62729
|
+
ENDIF.
|
|
62730
|
+
CASE bar.
|
|
62731
|
+
WHEN '1'.
|
|
62732
|
+
WHEN 'A'.
|
|
62705
62733
|
ENDCASE.`,
|
|
62706
62734
|
};
|
|
62707
62735
|
}
|
|
@@ -62835,23 +62863,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62835
62863
|
key: "identical_contents",
|
|
62836
62864
|
title: "Identical contents",
|
|
62837
62865
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
62838
|
-
extendedInformation: `
|
|
62839
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
62840
|
-
|
|
62866
|
+
extendedInformation: `
|
|
62867
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62868
|
+
|
|
62841
62869
|
Chained statments are ignored`,
|
|
62842
62870
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62843
|
-
badExample: `IF foo = bar.
|
|
62844
|
-
WRITE 'bar'.
|
|
62845
|
-
WRITE 'world'.
|
|
62846
|
-
ELSE.
|
|
62847
|
-
WRITE 'foo'.
|
|
62848
|
-
WRITE 'world'.
|
|
62871
|
+
badExample: `IF foo = bar.
|
|
62872
|
+
WRITE 'bar'.
|
|
62873
|
+
WRITE 'world'.
|
|
62874
|
+
ELSE.
|
|
62875
|
+
WRITE 'foo'.
|
|
62876
|
+
WRITE 'world'.
|
|
62849
62877
|
ENDIF.`,
|
|
62850
|
-
goodExample: `IF foo = bar.
|
|
62851
|
-
WRITE 'bar'.
|
|
62852
|
-
ELSE.
|
|
62853
|
-
WRITE 'foo'.
|
|
62854
|
-
ENDIF.
|
|
62878
|
+
goodExample: `IF foo = bar.
|
|
62879
|
+
WRITE 'bar'.
|
|
62880
|
+
ELSE.
|
|
62881
|
+
WRITE 'foo'.
|
|
62882
|
+
ENDIF.
|
|
62855
62883
|
WRITE 'world'.`,
|
|
62856
62884
|
};
|
|
62857
62885
|
}
|
|
@@ -62959,12 +62987,12 @@ class IdenticalDescriptions {
|
|
|
62959
62987
|
key: "identical_descriptions",
|
|
62960
62988
|
title: "Identical descriptions",
|
|
62961
62989
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
62962
|
-
extendedInformation: `Case insensitive
|
|
62963
|
-
|
|
62964
|
-
Only checks the master language descriptions
|
|
62965
|
-
|
|
62966
|
-
Dependencies are skipped
|
|
62967
|
-
|
|
62990
|
+
extendedInformation: `Case insensitive
|
|
62991
|
+
|
|
62992
|
+
Only checks the master language descriptions
|
|
62993
|
+
|
|
62994
|
+
Dependencies are skipped
|
|
62995
|
+
|
|
62968
62996
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62969
62997
|
tags: [],
|
|
62970
62998
|
};
|
|
@@ -63138,43 +63166,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63138
63166
|
key: "if_in_if",
|
|
63139
63167
|
title: "IF in IF",
|
|
63140
63168
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63141
|
-
extendedInformation: `
|
|
63142
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63143
|
-
|
|
63144
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63145
|
-
|
|
63146
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63169
|
+
extendedInformation: `
|
|
63170
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63171
|
+
|
|
63172
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63173
|
+
|
|
63174
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63147
63175
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63148
|
-
badExample: `IF condition1.
|
|
63149
|
-
IF condition2.
|
|
63150
|
-
...
|
|
63151
|
-
ENDIF.
|
|
63152
|
-
ENDIF.
|
|
63153
|
-
|
|
63154
|
-
IF condition1.
|
|
63155
|
-
...
|
|
63156
|
-
ELSE.
|
|
63157
|
-
IF condition2.
|
|
63158
|
-
...
|
|
63159
|
-
ENDIF.
|
|
63176
|
+
badExample: `IF condition1.
|
|
63177
|
+
IF condition2.
|
|
63178
|
+
...
|
|
63179
|
+
ENDIF.
|
|
63180
|
+
ENDIF.
|
|
63181
|
+
|
|
63182
|
+
IF condition1.
|
|
63183
|
+
...
|
|
63184
|
+
ELSE.
|
|
63185
|
+
IF condition2.
|
|
63186
|
+
...
|
|
63187
|
+
ENDIF.
|
|
63160
63188
|
ENDIF.`,
|
|
63161
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63162
|
-
...
|
|
63163
|
-
ENDIF.
|
|
63164
|
-
|
|
63165
|
-
IF condition1.
|
|
63166
|
-
...
|
|
63167
|
-
ELSEIF condition2.
|
|
63168
|
-
...
|
|
63169
|
-
ENDIF.
|
|
63170
|
-
|
|
63171
|
-
CASE variable.
|
|
63172
|
-
WHEN value1.
|
|
63173
|
-
...
|
|
63174
|
-
WHEN value2.
|
|
63175
|
-
IF condition2.
|
|
63176
|
-
...
|
|
63177
|
-
ENDIF.
|
|
63189
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63190
|
+
...
|
|
63191
|
+
ENDIF.
|
|
63192
|
+
|
|
63193
|
+
IF condition1.
|
|
63194
|
+
...
|
|
63195
|
+
ELSEIF condition2.
|
|
63196
|
+
...
|
|
63197
|
+
ENDIF.
|
|
63198
|
+
|
|
63199
|
+
CASE variable.
|
|
63200
|
+
WHEN value1.
|
|
63201
|
+
...
|
|
63202
|
+
WHEN value2.
|
|
63203
|
+
IF condition2.
|
|
63204
|
+
...
|
|
63205
|
+
ENDIF.
|
|
63178
63206
|
ENDCASE.`,
|
|
63179
63207
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63180
63208
|
};
|
|
@@ -63359,9 +63387,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63359
63387
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63360
63388
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63361
63389
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63362
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63363
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63364
|
-
RETURN. " todo, implement method
|
|
63390
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63391
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63392
|
+
RETURN. " todo, implement method
|
|
63365
63393
|
ENDMETHOD.`);
|
|
63366
63394
|
}
|
|
63367
63395
|
}
|
|
@@ -63540,14 +63568,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63540
63568
|
key: "implicit_start_of_selection",
|
|
63541
63569
|
title: "Implicit START-OF-SELECTION",
|
|
63542
63570
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63543
|
-
extendedInformation: `Only runs for executable programs
|
|
63544
|
-
|
|
63571
|
+
extendedInformation: `Only runs for executable programs
|
|
63572
|
+
|
|
63545
63573
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63546
63574
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63547
|
-
badExample: `REPORT zfoo.
|
|
63575
|
+
badExample: `REPORT zfoo.
|
|
63548
63576
|
WRITE 'hello'.`,
|
|
63549
|
-
goodExample: `
|
|
63550
|
-
START-OF-SELECTION.
|
|
63577
|
+
goodExample: `
|
|
63578
|
+
START-OF-SELECTION.
|
|
63551
63579
|
WRITE 'hello'.`,
|
|
63552
63580
|
};
|
|
63553
63581
|
}
|
|
@@ -63652,19 +63680,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63652
63680
|
key: "in_statement_indentation",
|
|
63653
63681
|
title: "In-statement indentation",
|
|
63654
63682
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63655
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63656
|
-
|
|
63657
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63683
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63684
|
+
|
|
63685
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63658
63686
|
to distinguish them better from code within the block.`,
|
|
63659
|
-
badExample: `IF 1 = 1
|
|
63660
|
-
AND 2 = 2.
|
|
63661
|
-
WRITE 'hello' &&
|
|
63662
|
-
'world'.
|
|
63687
|
+
badExample: `IF 1 = 1
|
|
63688
|
+
AND 2 = 2.
|
|
63689
|
+
WRITE 'hello' &&
|
|
63690
|
+
'world'.
|
|
63663
63691
|
ENDIF.`,
|
|
63664
|
-
goodExample: `IF 1 = 1
|
|
63665
|
-
AND 2 = 2.
|
|
63666
|
-
WRITE 'hello' &&
|
|
63667
|
-
'world'.
|
|
63692
|
+
goodExample: `IF 1 = 1
|
|
63693
|
+
AND 2 = 2.
|
|
63694
|
+
WRITE 'hello' &&
|
|
63695
|
+
'world'.
|
|
63668
63696
|
ENDIF.`,
|
|
63669
63697
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63670
63698
|
};
|
|
@@ -63787,23 +63815,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63787
63815
|
title: "Indentation",
|
|
63788
63816
|
shortDescription: `Checks indentation`,
|
|
63789
63817
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63790
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63791
|
-
PRIVATE SECTION.
|
|
63792
|
-
METHODS constructor.
|
|
63793
|
-
ENDCLASS.
|
|
63794
|
-
|
|
63795
|
-
CLASS lcl IMPLEMENTATION.
|
|
63796
|
-
METHOD constructor.
|
|
63797
|
-
ENDMETHOD.
|
|
63818
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63819
|
+
PRIVATE SECTION.
|
|
63820
|
+
METHODS constructor.
|
|
63821
|
+
ENDCLASS.
|
|
63822
|
+
|
|
63823
|
+
CLASS lcl IMPLEMENTATION.
|
|
63824
|
+
METHOD constructor.
|
|
63825
|
+
ENDMETHOD.
|
|
63798
63826
|
ENDCLASS.`,
|
|
63799
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63800
|
-
PRIVATE SECTION.
|
|
63801
|
-
METHODS constructor.
|
|
63802
|
-
ENDCLASS.
|
|
63803
|
-
|
|
63804
|
-
CLASS lcl IMPLEMENTATION.
|
|
63805
|
-
METHOD constructor.
|
|
63806
|
-
ENDMETHOD.
|
|
63827
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63828
|
+
PRIVATE SECTION.
|
|
63829
|
+
METHODS constructor.
|
|
63830
|
+
ENDCLASS.
|
|
63831
|
+
|
|
63832
|
+
CLASS lcl IMPLEMENTATION.
|
|
63833
|
+
METHOD constructor.
|
|
63834
|
+
ENDMETHOD.
|
|
63807
63835
|
ENDCLASS.`,
|
|
63808
63836
|
};
|
|
63809
63837
|
}
|
|
@@ -64204,9 +64232,9 @@ class IntfReferencingClas {
|
|
|
64204
64232
|
key: "intf_referencing_clas",
|
|
64205
64233
|
title: "INTF referencing CLAS",
|
|
64206
64234
|
shortDescription: `Interface contains references to class`,
|
|
64207
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64208
|
-
Only first level references are checked.
|
|
64209
|
-
Exception class references are ignored.
|
|
64235
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64236
|
+
Only first level references are checked.
|
|
64237
|
+
Exception class references are ignored.
|
|
64210
64238
|
Void references are ignored.`,
|
|
64211
64239
|
};
|
|
64212
64240
|
}
|
|
@@ -64291,9 +64319,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64291
64319
|
title: "Invalid Table Index",
|
|
64292
64320
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64293
64321
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64294
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64322
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64295
64323
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64296
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64324
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64297
64325
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64298
64326
|
};
|
|
64299
64327
|
}
|
|
@@ -64894,8 +64922,8 @@ class LineBreakStyle {
|
|
|
64894
64922
|
return {
|
|
64895
64923
|
key: "line_break_style",
|
|
64896
64924
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64897
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64898
|
-
|
|
64925
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64926
|
+
|
|
64899
64927
|
abapGit does not work with CRLF`,
|
|
64900
64928
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64901
64929
|
};
|
|
@@ -64964,7 +64992,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64964
64992
|
key: "line_length",
|
|
64965
64993
|
title: "Line length",
|
|
64966
64994
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
64967
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64995
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64968
64996
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64969
64997
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64970
64998
|
};
|
|
@@ -65035,7 +65063,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65035
65063
|
key: "line_only_punc",
|
|
65036
65064
|
title: "Line containing only punctuation",
|
|
65037
65065
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65038
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65066
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65039
65067
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65040
65068
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65041
65069
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65298,15 +65326,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65298
65326
|
return {
|
|
65299
65327
|
key: "local_variable_names",
|
|
65300
65328
|
title: "Local variable naming conventions",
|
|
65301
|
-
shortDescription: `
|
|
65302
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65329
|
+
shortDescription: `
|
|
65330
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65303
65331
|
Regexes are case-insensitive.`,
|
|
65304
65332
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65305
|
-
badExample: `FORM bar.
|
|
65306
|
-
DATA foo.
|
|
65333
|
+
badExample: `FORM bar.
|
|
65334
|
+
DATA foo.
|
|
65307
65335
|
ENDFORM.`,
|
|
65308
|
-
goodExample: `FORM bar.
|
|
65309
|
-
DATA lv_foo.
|
|
65336
|
+
goodExample: `FORM bar.
|
|
65337
|
+
DATA lv_foo.
|
|
65310
65338
|
ENDFORM.`,
|
|
65311
65339
|
};
|
|
65312
65340
|
}
|
|
@@ -65458,9 +65486,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65458
65486
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65459
65487
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65460
65488
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65461
|
-
badExample: `DEFINE something.
|
|
65489
|
+
badExample: `DEFINE something.
|
|
65462
65490
|
END-OF-DEFINITION.`,
|
|
65463
|
-
goodExample: `DEFINE _something.
|
|
65491
|
+
goodExample: `DEFINE _something.
|
|
65464
65492
|
END-OF-DEFINITION.`,
|
|
65465
65493
|
};
|
|
65466
65494
|
}
|
|
@@ -65533,10 +65561,10 @@ class MainFileContents {
|
|
|
65533
65561
|
key: "main_file_contents",
|
|
65534
65562
|
title: "Main file contents",
|
|
65535
65563
|
shortDescription: `Checks related to report declarations.`,
|
|
65536
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65537
|
-
|
|
65538
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65539
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65564
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65565
|
+
|
|
65566
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65567
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65540
65568
|
`,
|
|
65541
65569
|
};
|
|
65542
65570
|
}
|
|
@@ -65652,17 +65680,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65652
65680
|
title: "Too many parentheses",
|
|
65653
65681
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65654
65682
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65655
|
-
badExample: `
|
|
65656
|
-
IF ( destination IS INITIAL ).
|
|
65657
|
-
ENDIF.
|
|
65658
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65659
|
-
ENDIF.
|
|
65683
|
+
badExample: `
|
|
65684
|
+
IF ( destination IS INITIAL ).
|
|
65685
|
+
ENDIF.
|
|
65686
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65687
|
+
ENDIF.
|
|
65660
65688
|
`,
|
|
65661
|
-
goodExample: `
|
|
65662
|
-
IF destination IS INITIAL.
|
|
65663
|
-
ENDIF.
|
|
65664
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65665
|
-
ENDIF.
|
|
65689
|
+
goodExample: `
|
|
65690
|
+
IF destination IS INITIAL.
|
|
65691
|
+
ENDIF.
|
|
65692
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65693
|
+
ENDIF.
|
|
65666
65694
|
`,
|
|
65667
65695
|
};
|
|
65668
65696
|
}
|
|
@@ -65836,14 +65864,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65836
65864
|
title: "Max one method parameter definition per line",
|
|
65837
65865
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65838
65866
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65839
|
-
badExample: `
|
|
65840
|
-
METHODS apps_scope_token
|
|
65841
|
-
IMPORTING
|
|
65867
|
+
badExample: `
|
|
65868
|
+
METHODS apps_scope_token
|
|
65869
|
+
IMPORTING
|
|
65842
65870
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65843
|
-
goodExample: `
|
|
65844
|
-
METHODS apps_scope_token
|
|
65845
|
-
IMPORTING
|
|
65846
|
-
body TYPE bodyapps_scope_token
|
|
65871
|
+
goodExample: `
|
|
65872
|
+
METHODS apps_scope_token
|
|
65873
|
+
IMPORTING
|
|
65874
|
+
body TYPE bodyapps_scope_token
|
|
65847
65875
|
client_id TYPE str.`,
|
|
65848
65876
|
};
|
|
65849
65877
|
}
|
|
@@ -65908,11 +65936,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65908
65936
|
key: "max_one_statement",
|
|
65909
65937
|
title: "Max one statement per line",
|
|
65910
65938
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
65911
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65912
|
-
|
|
65913
|
-
Does not report anything for chained statements.
|
|
65914
|
-
|
|
65915
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65939
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65940
|
+
|
|
65941
|
+
Does not report anything for chained statements.
|
|
65942
|
+
|
|
65943
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65916
65944
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65917
65945
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65918
65946
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66250,8 +66278,8 @@ class MethodLength {
|
|
|
66250
66278
|
key: "method_length",
|
|
66251
66279
|
title: "Method/Form Length",
|
|
66252
66280
|
shortDescription: `Checks relating to method/form length.`,
|
|
66253
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66254
|
-
|
|
66281
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66282
|
+
|
|
66255
66283
|
Abstract methods without statements are considered okay.`,
|
|
66256
66284
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66257
66285
|
};
|
|
@@ -66356,20 +66384,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66356
66384
|
key: "method_overwrites_builtin",
|
|
66357
66385
|
title: "Method name overwrites builtin function",
|
|
66358
66386
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66359
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66360
|
-
|
|
66361
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66362
|
-
|
|
66387
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66388
|
+
|
|
66389
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66390
|
+
|
|
66363
66391
|
Interface method names are ignored`,
|
|
66364
66392
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66365
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66366
|
-
PUBLIC SECTION.
|
|
66367
|
-
METHODS matches.
|
|
66368
|
-
ENDCLASS.
|
|
66369
|
-
|
|
66370
|
-
CLASS lcl IMPLEMENTATION.
|
|
66371
|
-
METHOD matches.
|
|
66372
|
-
ENDMETHOD.
|
|
66393
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66394
|
+
PUBLIC SECTION.
|
|
66395
|
+
METHODS matches.
|
|
66396
|
+
ENDCLASS.
|
|
66397
|
+
|
|
66398
|
+
CLASS lcl IMPLEMENTATION.
|
|
66399
|
+
METHOD matches.
|
|
66400
|
+
ENDMETHOD.
|
|
66373
66401
|
ENDCLASS.`,
|
|
66374
66402
|
};
|
|
66375
66403
|
}
|
|
@@ -66560,12 +66588,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66560
66588
|
// eslint-disable-next-line max-len
|
|
66561
66589
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66562
66590
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66563
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66564
|
-
PUBLIC SECTION.
|
|
66565
|
-
METHODS
|
|
66566
|
-
foobar
|
|
66567
|
-
EXPORTING foo TYPE i
|
|
66568
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66591
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66592
|
+
PUBLIC SECTION.
|
|
66593
|
+
METHODS
|
|
66594
|
+
foobar
|
|
66595
|
+
EXPORTING foo TYPE i
|
|
66596
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66569
66597
|
ENDCLASS.`,
|
|
66570
66598
|
};
|
|
66571
66599
|
}
|
|
@@ -66945,7 +66973,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66945
66973
|
key: "nesting",
|
|
66946
66974
|
title: "Check nesting depth",
|
|
66947
66975
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
66948
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66976
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66949
66977
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66950
66978
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66951
66979
|
};
|
|
@@ -67188,7 +67216,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67188
67216
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67189
67217
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67190
67218
|
badExample: `var1 = var2 = var3.`,
|
|
67191
|
-
goodExample: `var2 = var3.
|
|
67219
|
+
goodExample: `var2 = var3.
|
|
67192
67220
|
var1 = var2.`,
|
|
67193
67221
|
};
|
|
67194
67222
|
}
|
|
@@ -67247,8 +67275,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67247
67275
|
key: "no_external_form_calls",
|
|
67248
67276
|
title: "No external FORM calls",
|
|
67249
67277
|
shortDescription: `Detect external form calls`,
|
|
67250
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67251
|
-
|
|
67278
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67279
|
+
|
|
67252
67280
|
PERFORM foo(bar).`,
|
|
67253
67281
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67254
67282
|
};
|
|
@@ -67309,17 +67337,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67309
67337
|
key: "no_inline_in_optional_branches",
|
|
67310
67338
|
title: "Don't declare inline in optional branches",
|
|
67311
67339
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67312
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67313
|
-
|
|
67314
|
-
Considered optional branches:
|
|
67315
|
-
* inside IF/ELSEIF/ELSE
|
|
67316
|
-
* inside LOOP
|
|
67317
|
-
* inside WHILE
|
|
67318
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67319
|
-
* inside DO
|
|
67320
|
-
* inside SELECT loops
|
|
67321
|
-
|
|
67322
|
-
Not considered optional branches:
|
|
67340
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67341
|
+
|
|
67342
|
+
Considered optional branches:
|
|
67343
|
+
* inside IF/ELSEIF/ELSE
|
|
67344
|
+
* inside LOOP
|
|
67345
|
+
* inside WHILE
|
|
67346
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67347
|
+
* inside DO
|
|
67348
|
+
* inside SELECT loops
|
|
67349
|
+
|
|
67350
|
+
Not considered optional branches:
|
|
67323
67351
|
* TRY/CATCH/CLEANUP`,
|
|
67324
67352
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67325
67353
|
};
|
|
@@ -67419,12 +67447,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67419
67447
|
key: "no_prefixes",
|
|
67420
67448
|
title: "No Prefixes",
|
|
67421
67449
|
shortDescription: `Dont use hungarian notation`,
|
|
67422
|
-
extendedInformation: `
|
|
67423
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67424
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67425
|
-
|
|
67426
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67427
|
-
|
|
67450
|
+
extendedInformation: `
|
|
67451
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67452
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67453
|
+
|
|
67454
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67455
|
+
|
|
67428
67456
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67429
67457
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67430
67458
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67603,7 +67631,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67603
67631
|
return {
|
|
67604
67632
|
key: "no_public_attributes",
|
|
67605
67633
|
title: "No public attributes",
|
|
67606
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67634
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67607
67635
|
Exceptions are excluded from this rule.`,
|
|
67608
67636
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67609
67637
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67704,13 +67732,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67704
67732
|
key: "no_yoda_conditions",
|
|
67705
67733
|
title: "No Yoda conditions",
|
|
67706
67734
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67707
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67708
|
-
|
|
67735
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67736
|
+
|
|
67709
67737
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67710
67738
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67711
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67739
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67712
67740
|
ENDIF.`,
|
|
67713
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67741
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67714
67742
|
ENDIF.`,
|
|
67715
67743
|
};
|
|
67716
67744
|
}
|
|
@@ -67811,8 +67839,8 @@ class NROBConsistency {
|
|
|
67811
67839
|
key: "nrob_consistency",
|
|
67812
67840
|
title: "Number range consistency",
|
|
67813
67841
|
shortDescription: `Consistency checks for number ranges`,
|
|
67814
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67815
|
-
|
|
67842
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67843
|
+
|
|
67816
67844
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67817
67845
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67818
67846
|
};
|
|
@@ -68089,58 +68117,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68089
68117
|
title: "Obsolete statements",
|
|
68090
68118
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68091
68119
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68092
|
-
extendedInformation: `
|
|
68093
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68094
|
-
|
|
68095
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68096
|
-
|
|
68097
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68098
|
-
|
|
68099
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68100
|
-
|
|
68101
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68102
|
-
|
|
68103
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68104
|
-
|
|
68105
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68106
|
-
|
|
68107
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68108
|
-
|
|
68109
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68110
|
-
|
|
68111
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68112
|
-
|
|
68113
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68114
|
-
|
|
68115
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68116
|
-
|
|
68117
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68118
|
-
|
|
68119
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68120
|
-
|
|
68121
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68122
|
-
SELECT COUNT(*) is considered okay
|
|
68123
|
-
|
|
68124
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68125
|
-
|
|
68126
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68127
|
-
|
|
68128
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68129
|
-
|
|
68130
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68131
|
-
|
|
68132
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68133
|
-
|
|
68120
|
+
extendedInformation: `
|
|
68121
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68122
|
+
|
|
68123
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68124
|
+
|
|
68125
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68126
|
+
|
|
68127
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68128
|
+
|
|
68129
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68130
|
+
|
|
68131
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68132
|
+
|
|
68133
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68134
|
+
|
|
68135
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68136
|
+
|
|
68137
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68138
|
+
|
|
68139
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68140
|
+
|
|
68141
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68142
|
+
|
|
68143
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68144
|
+
|
|
68145
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68146
|
+
|
|
68147
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68148
|
+
|
|
68149
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68150
|
+
SELECT COUNT(*) is considered okay
|
|
68151
|
+
|
|
68152
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68153
|
+
|
|
68154
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68155
|
+
|
|
68156
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68157
|
+
|
|
68158
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68159
|
+
|
|
68160
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68161
|
+
|
|
68134
68162
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68135
|
-
badExample: `REFRESH itab.
|
|
68136
|
-
|
|
68137
|
-
COMPUTE foo = 2 + 2.
|
|
68138
|
-
|
|
68139
|
-
MULTIPLY lv_foo BY 2.
|
|
68140
|
-
|
|
68141
|
-
INTERFACE intf LOAD.
|
|
68142
|
-
|
|
68143
|
-
IF foo IS SUPPLIED.
|
|
68163
|
+
badExample: `REFRESH itab.
|
|
68164
|
+
|
|
68165
|
+
COMPUTE foo = 2 + 2.
|
|
68166
|
+
|
|
68167
|
+
MULTIPLY lv_foo BY 2.
|
|
68168
|
+
|
|
68169
|
+
INTERFACE intf LOAD.
|
|
68170
|
+
|
|
68171
|
+
IF foo IS SUPPLIED.
|
|
68144
68172
|
ENDIF.`,
|
|
68145
68173
|
};
|
|
68146
68174
|
}
|
|
@@ -68480,9 +68508,9 @@ class OmitParameterName {
|
|
|
68480
68508
|
key: "omit_parameter_name",
|
|
68481
68509
|
title: "Omit parameter name",
|
|
68482
68510
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68483
|
-
extendedInformation: `
|
|
68484
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68485
|
-
|
|
68511
|
+
extendedInformation: `
|
|
68512
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68513
|
+
|
|
68486
68514
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68487
68515
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68488
68516
|
badExample: `method( param = 2 ).`,
|
|
@@ -68688,20 +68716,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68688
68716
|
shortDescription: `Omit RECEIVING`,
|
|
68689
68717
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68690
68718
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68691
|
-
badExample: `
|
|
68692
|
-
upload_pack(
|
|
68693
|
-
EXPORTING
|
|
68694
|
-
io_client = lo_client
|
|
68695
|
-
iv_url = iv_url
|
|
68696
|
-
iv_deepen_level = iv_deepen_level
|
|
68697
|
-
it_hashes = lt_hashes
|
|
68698
|
-
RECEIVING
|
|
68719
|
+
badExample: `
|
|
68720
|
+
upload_pack(
|
|
68721
|
+
EXPORTING
|
|
68722
|
+
io_client = lo_client
|
|
68723
|
+
iv_url = iv_url
|
|
68724
|
+
iv_deepen_level = iv_deepen_level
|
|
68725
|
+
it_hashes = lt_hashes
|
|
68726
|
+
RECEIVING
|
|
68699
68727
|
rt_objects = et_objects ).`,
|
|
68700
|
-
goodExample: `
|
|
68701
|
-
et_objects = upload_pack(
|
|
68702
|
-
io_client = lo_client
|
|
68703
|
-
iv_url = iv_url
|
|
68704
|
-
iv_deepen_level = iv_deepen_level
|
|
68728
|
+
goodExample: `
|
|
68729
|
+
et_objects = upload_pack(
|
|
68730
|
+
io_client = lo_client
|
|
68731
|
+
iv_url = iv_url
|
|
68732
|
+
iv_deepen_level = iv_deepen_level
|
|
68705
68733
|
it_hashes = lt_hashes ).`,
|
|
68706
68734
|
};
|
|
68707
68735
|
}
|
|
@@ -68765,8 +68793,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68765
68793
|
return {
|
|
68766
68794
|
key: "parser_702_chaining",
|
|
68767
68795
|
title: "Parser Error, bad chanining on 702",
|
|
68768
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68769
|
-
this rule finds these and reports errors.
|
|
68796
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68797
|
+
this rule finds these and reports errors.
|
|
68770
68798
|
Only active on target version 702 and below.`,
|
|
68771
68799
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68772
68800
|
};
|
|
@@ -68846,8 +68874,8 @@ class ParserError {
|
|
|
68846
68874
|
return {
|
|
68847
68875
|
key: "parser_error",
|
|
68848
68876
|
title: "Parser error",
|
|
68849
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68850
|
-
|
|
68877
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68878
|
+
|
|
68851
68879
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68852
68880
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68853
68881
|
};
|
|
@@ -68932,7 +68960,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68932
68960
|
return {
|
|
68933
68961
|
key: "parser_missing_space",
|
|
68934
68962
|
title: "Parser Error, missing space",
|
|
68935
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68963
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68936
68964
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68937
68965
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68938
68966
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69355,25 +69383,25 @@ class PreferInline {
|
|
|
69355
69383
|
key: "prefer_inline",
|
|
69356
69384
|
title: "Prefer Inline Declarations",
|
|
69357
69385
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69358
|
-
extendedInformation: `EXPERIMENTAL
|
|
69359
|
-
|
|
69360
|
-
Activates if language version is v740sp02 or above.
|
|
69361
|
-
|
|
69362
|
-
Variables must be local(METHOD or FORM).
|
|
69363
|
-
|
|
69364
|
-
No generic or void typed variables. No syntax errors.
|
|
69365
|
-
|
|
69366
|
-
First position used must be a full/pure write.
|
|
69367
|
-
|
|
69368
|
-
Move statment is not a cast(?=)
|
|
69369
|
-
|
|
69386
|
+
extendedInformation: `EXPERIMENTAL
|
|
69387
|
+
|
|
69388
|
+
Activates if language version is v740sp02 or above.
|
|
69389
|
+
|
|
69390
|
+
Variables must be local(METHOD or FORM).
|
|
69391
|
+
|
|
69392
|
+
No generic or void typed variables. No syntax errors.
|
|
69393
|
+
|
|
69394
|
+
First position used must be a full/pure write.
|
|
69395
|
+
|
|
69396
|
+
Move statment is not a cast(?=)
|
|
69397
|
+
|
|
69370
69398
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69371
69399
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69372
|
-
badExample: `DATA foo TYPE i.
|
|
69373
|
-
foo = 2.
|
|
69374
|
-
DATA percentage TYPE decfloat34.
|
|
69400
|
+
badExample: `DATA foo TYPE i.
|
|
69401
|
+
foo = 2.
|
|
69402
|
+
DATA percentage TYPE decfloat34.
|
|
69375
69403
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69376
|
-
goodExample: `DATA(foo) = 2.
|
|
69404
|
+
goodExample: `DATA(foo) = 2.
|
|
69377
69405
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69378
69406
|
};
|
|
69379
69407
|
}
|
|
@@ -69587,18 +69615,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69587
69615
|
key: "prefer_is_not",
|
|
69588
69616
|
title: "Prefer IS NOT to NOT IS",
|
|
69589
69617
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69590
|
-
extendedInformation: `
|
|
69591
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69592
|
-
|
|
69618
|
+
extendedInformation: `
|
|
69619
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69620
|
+
|
|
69593
69621
|
"if not is_valid( )." examples are skipped`,
|
|
69594
69622
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69595
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69596
|
-
IF variable NP 'TODO*'.
|
|
69597
|
-
IF variable <> 42.
|
|
69623
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69624
|
+
IF variable NP 'TODO*'.
|
|
69625
|
+
IF variable <> 42.
|
|
69598
69626
|
IF variable CO 'hello'.`,
|
|
69599
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69600
|
-
IF NOT variable CP 'TODO*'.
|
|
69601
|
-
IF NOT variable = 42.
|
|
69627
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69628
|
+
IF NOT variable CP 'TODO*'.
|
|
69629
|
+
IF NOT variable = 42.
|
|
69602
69630
|
IF NOT variable CA 'hello'.`,
|
|
69603
69631
|
};
|
|
69604
69632
|
}
|
|
@@ -69786,14 +69814,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69786
69814
|
key: "prefer_raise_exception_new",
|
|
69787
69815
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69788
69816
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69789
|
-
extendedInformation: `
|
|
69790
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69791
|
-
|
|
69817
|
+
extendedInformation: `
|
|
69818
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69819
|
+
|
|
69792
69820
|
From 752 and up`,
|
|
69793
69821
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69794
69822
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69795
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69796
|
-
EXPORTING
|
|
69823
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69824
|
+
EXPORTING
|
|
69797
69825
|
previous = exception.`,
|
|
69798
69826
|
};
|
|
69799
69827
|
}
|
|
@@ -69871,12 +69899,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69871
69899
|
key: "prefer_returning_to_exporting",
|
|
69872
69900
|
title: "Prefer RETURNING to EXPORTING",
|
|
69873
69901
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
69874
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69902
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69875
69903
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69876
69904
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69877
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69878
|
-
PUBLIC SECTION.
|
|
69879
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
69905
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69906
|
+
PUBLIC SECTION.
|
|
69907
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69880
69908
|
ENDCLASS.`,
|
|
69881
69909
|
};
|
|
69882
69910
|
}
|
|
@@ -69972,8 +70000,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69972
70000
|
key: "prefer_xsdbool",
|
|
69973
70001
|
title: "Prefer xsdbool over boolc",
|
|
69974
70002
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69975
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69976
|
-
|
|
70003
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70004
|
+
|
|
69977
70005
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69978
70006
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69979
70007
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70045,9 +70073,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70045
70073
|
title: "Preferred compare operator",
|
|
70046
70074
|
shortDescription: `Configure undesired operator variants`,
|
|
70047
70075
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70048
|
-
badExample: `IF foo EQ bar.
|
|
70076
|
+
badExample: `IF foo EQ bar.
|
|
70049
70077
|
ENDIF.`,
|
|
70050
|
-
goodExample: `IF foo = bar.
|
|
70078
|
+
goodExample: `IF foo = bar.
|
|
70051
70079
|
ENDIF.`,
|
|
70052
70080
|
};
|
|
70053
70081
|
}
|
|
@@ -70271,26 +70299,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70271
70299
|
key: "reduce_procedural_code",
|
|
70272
70300
|
title: "Reduce procedural code",
|
|
70273
70301
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70274
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70275
|
-
|
|
70276
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70277
|
-
|
|
70302
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70303
|
+
|
|
70304
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70305
|
+
|
|
70278
70306
|
Comments are not counted as statements.`,
|
|
70279
70307
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70280
|
-
badExample: `FORM foo.
|
|
70281
|
-
DATA lv_bar TYPE i.
|
|
70282
|
-
lv_bar = 2 + 2.
|
|
70283
|
-
IF lv_bar = 4.
|
|
70284
|
-
WRITE 'hello world'.
|
|
70285
|
-
ENDIF.
|
|
70286
|
-
DATA lv_bar TYPE i.
|
|
70287
|
-
lv_bar = 2 + 2.
|
|
70288
|
-
IF lv_bar = 4.
|
|
70289
|
-
WRITE 'hello world'.
|
|
70290
|
-
ENDIF.
|
|
70308
|
+
badExample: `FORM foo.
|
|
70309
|
+
DATA lv_bar TYPE i.
|
|
70310
|
+
lv_bar = 2 + 2.
|
|
70311
|
+
IF lv_bar = 4.
|
|
70312
|
+
WRITE 'hello world'.
|
|
70313
|
+
ENDIF.
|
|
70314
|
+
DATA lv_bar TYPE i.
|
|
70315
|
+
lv_bar = 2 + 2.
|
|
70316
|
+
IF lv_bar = 4.
|
|
70317
|
+
WRITE 'hello world'.
|
|
70318
|
+
ENDIF.
|
|
70291
70319
|
ENDFORM.`,
|
|
70292
|
-
goodExample: `FORM foo.
|
|
70293
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70320
|
+
goodExample: `FORM foo.
|
|
70321
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70294
70322
|
ENDFORM.`,
|
|
70295
70323
|
};
|
|
70296
70324
|
}
|
|
@@ -70534,10 +70562,10 @@ class RemoveDescriptions {
|
|
|
70534
70562
|
return {
|
|
70535
70563
|
key: "remove_descriptions",
|
|
70536
70564
|
title: "Remove descriptions",
|
|
70537
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70538
|
-
|
|
70539
|
-
Class descriptions are required, see rule description_empty.
|
|
70540
|
-
|
|
70565
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70566
|
+
|
|
70567
|
+
Class descriptions are required, see rule description_empty.
|
|
70568
|
+
|
|
70541
70569
|
Consider using ABAP Doc for documentation.`,
|
|
70542
70570
|
tags: [],
|
|
70543
70571
|
};
|
|
@@ -70662,14 +70690,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70662
70690
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70663
70691
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70664
70692
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70665
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70693
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70666
70694
|
DESTINATION lv_rfc.`,
|
|
70667
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70668
|
-
DESTINATION lv_rfc
|
|
70669
|
-
EXCEPTIONS
|
|
70670
|
-
system_failure = 1 MESSAGE msg
|
|
70671
|
-
communication_failure = 2 MESSAGE msg
|
|
70672
|
-
resource_failure = 3
|
|
70695
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70696
|
+
DESTINATION lv_rfc
|
|
70697
|
+
EXCEPTIONS
|
|
70698
|
+
system_failure = 1 MESSAGE msg
|
|
70699
|
+
communication_failure = 2 MESSAGE msg
|
|
70700
|
+
resource_failure = 3
|
|
70673
70701
|
OTHERS = 4.`,
|
|
70674
70702
|
};
|
|
70675
70703
|
}
|
|
@@ -70753,11 +70781,11 @@ class SelectAddOrderBy {
|
|
|
70753
70781
|
key: "select_add_order_by",
|
|
70754
70782
|
title: "SELECT add ORDER BY",
|
|
70755
70783
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70756
|
-
extendedInformation: `
|
|
70757
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70758
|
-
|
|
70759
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70760
|
-
|
|
70784
|
+
extendedInformation: `
|
|
70785
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70786
|
+
|
|
70787
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70788
|
+
|
|
70761
70789
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70762
70790
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70763
70791
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70888,14 +70916,14 @@ class SelectPerformance {
|
|
|
70888
70916
|
key: "select_performance",
|
|
70889
70917
|
title: "SELECT performance",
|
|
70890
70918
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70891
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70892
|
-
|
|
70919
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70920
|
+
|
|
70893
70921
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70894
70922
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
70895
|
-
badExample: `SELECT field1, field2 FROM table
|
|
70896
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70923
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70924
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70897
70925
|
ENDSELECT.`,
|
|
70898
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70926
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70899
70927
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70900
70928
|
};
|
|
70901
70929
|
}
|
|
@@ -71009,8 +71037,8 @@ class SelectSingleFullKey {
|
|
|
71009
71037
|
key: "select_single_full_key",
|
|
71010
71038
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71011
71039
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71012
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71013
|
-
|
|
71040
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71041
|
+
|
|
71014
71042
|
If the statement contains a JOIN it is not checked`,
|
|
71015
71043
|
pseudoComment: "EC CI_NOORDER",
|
|
71016
71044
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71434,8 +71462,8 @@ class SICFConsistency {
|
|
|
71434
71462
|
key: "sicf_consistency",
|
|
71435
71463
|
title: "SICF consistency",
|
|
71436
71464
|
shortDescription: `Checks the validity of ICF services`,
|
|
71437
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71438
|
-
* Class must not have any syntax errors
|
|
71465
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71466
|
+
* Class must not have any syntax errors
|
|
71439
71467
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71440
71468
|
};
|
|
71441
71469
|
}
|
|
@@ -71547,23 +71575,23 @@ class SlowParameterPassing {
|
|
|
71547
71575
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71548
71576
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71549
71577
|
tags: [_irule_1.RuleTag.Performance],
|
|
71550
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71551
|
-
PUBLIC SECTION.
|
|
71552
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71553
|
-
ENDCLASS.
|
|
71554
|
-
CLASS lcl IMPLEMENTATION.
|
|
71555
|
-
METHOD bar.
|
|
71556
|
-
WRITE sdf.
|
|
71557
|
-
ENDMETHOD.
|
|
71578
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71579
|
+
PUBLIC SECTION.
|
|
71580
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71581
|
+
ENDCLASS.
|
|
71582
|
+
CLASS lcl IMPLEMENTATION.
|
|
71583
|
+
METHOD bar.
|
|
71584
|
+
WRITE sdf.
|
|
71585
|
+
ENDMETHOD.
|
|
71558
71586
|
ENDCLASS.`,
|
|
71559
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71560
|
-
PUBLIC SECTION.
|
|
71561
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71562
|
-
ENDCLASS.
|
|
71563
|
-
CLASS lcl IMPLEMENTATION.
|
|
71564
|
-
METHOD bar.
|
|
71565
|
-
WRITE sdf.
|
|
71566
|
-
ENDMETHOD.
|
|
71587
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71588
|
+
PUBLIC SECTION.
|
|
71589
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71590
|
+
ENDCLASS.
|
|
71591
|
+
CLASS lcl IMPLEMENTATION.
|
|
71592
|
+
METHOD bar.
|
|
71593
|
+
WRITE sdf.
|
|
71594
|
+
ENDMETHOD.
|
|
71567
71595
|
ENDCLASS.`,
|
|
71568
71596
|
};
|
|
71569
71597
|
}
|
|
@@ -71820,8 +71848,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71820
71848
|
key: "space_before_dot",
|
|
71821
71849
|
title: "Space before dot",
|
|
71822
71850
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71823
|
-
extendedInformation: `
|
|
71824
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71851
|
+
extendedInformation: `
|
|
71852
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71825
71853
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71826
71854
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71827
71855
|
badExample: `WRITE bar .`,
|
|
@@ -72007,12 +72035,12 @@ class SQLValueConversion {
|
|
|
72007
72035
|
key: "sql_value_conversion",
|
|
72008
72036
|
title: "Implicit SQL Value Conversion",
|
|
72009
72037
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72010
|
-
extendedInformation: `
|
|
72011
|
-
* Integer to CHAR conversion
|
|
72012
|
-
* Integer to NUMC conversion
|
|
72013
|
-
* NUMC to Integer conversion
|
|
72014
|
-
* CHAR to Integer conversion
|
|
72015
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72038
|
+
extendedInformation: `
|
|
72039
|
+
* Integer to CHAR conversion
|
|
72040
|
+
* Integer to NUMC conversion
|
|
72041
|
+
* NUMC to Integer conversion
|
|
72042
|
+
* CHAR to Integer conversion
|
|
72043
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72016
72044
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72017
72045
|
tags: [],
|
|
72018
72046
|
};
|
|
@@ -72084,7 +72112,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72084
72112
|
key: "start_at_tab",
|
|
72085
72113
|
title: "Start at tab",
|
|
72086
72114
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72087
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72115
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72088
72116
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72089
72117
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72090
72118
|
badExample: ` WRITE a.`,
|
|
@@ -72261,12 +72289,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72261
72289
|
key: "strict_sql",
|
|
72262
72290
|
title: "Strict SQL",
|
|
72263
72291
|
shortDescription: `Strict SQL`,
|
|
72264
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72265
|
-
|
|
72266
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72267
|
-
|
|
72268
|
-
Also see separate rule sql_escape_host_variables
|
|
72269
|
-
|
|
72292
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72293
|
+
|
|
72294
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72295
|
+
|
|
72296
|
+
Also see separate rule sql_escape_host_variables
|
|
72297
|
+
|
|
72270
72298
|
Activates from v750 and up`,
|
|
72271
72299
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72272
72300
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72520,11 +72548,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72520
72548
|
key: "sy_modification",
|
|
72521
72549
|
title: "Modification of SY fields",
|
|
72522
72550
|
shortDescription: `Finds modification of sy fields`,
|
|
72523
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72524
|
-
|
|
72551
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72552
|
+
|
|
72525
72553
|
Changes to SY-TVAR* fields are not reported`,
|
|
72526
72554
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72527
|
-
badExample: `sy-uname = 2.
|
|
72555
|
+
badExample: `sy-uname = 2.
|
|
72528
72556
|
sy = sy.`,
|
|
72529
72557
|
};
|
|
72530
72558
|
}
|
|
@@ -72586,8 +72614,8 @@ class TABLEnhancementCategory {
|
|
|
72586
72614
|
key: "tabl_enhancement_category",
|
|
72587
72615
|
title: "TABL enhancement category must be set",
|
|
72588
72616
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72589
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72590
|
-
|
|
72617
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72618
|
+
|
|
72591
72619
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72592
72620
|
tags: [],
|
|
72593
72621
|
};
|
|
@@ -72652,8 +72680,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72652
72680
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72653
72681
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72654
72682
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72655
|
-
badExample: `FORM foo.
|
|
72656
|
-
TABLES t100.
|
|
72683
|
+
badExample: `FORM foo.
|
|
72684
|
+
TABLES t100.
|
|
72657
72685
|
ENDFORM.`,
|
|
72658
72686
|
goodExample: `TABLES t000.`,
|
|
72659
72687
|
};
|
|
@@ -72781,9 +72809,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72781
72809
|
title: "Type FORM parameters",
|
|
72782
72810
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72783
72811
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72784
|
-
badExample: `FORM foo USING bar.
|
|
72812
|
+
badExample: `FORM foo USING bar.
|
|
72785
72813
|
ENDFORM.`,
|
|
72786
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72814
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72787
72815
|
ENDFORM.`,
|
|
72788
72816
|
};
|
|
72789
72817
|
}
|
|
@@ -73456,38 +73484,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73456
73484
|
key: "unnecessary_pragma",
|
|
73457
73485
|
title: "Unnecessary Pragma",
|
|
73458
73486
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73459
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73460
|
-
|
|
73461
|
-
* NEEDED without definition
|
|
73462
|
-
|
|
73463
|
-
* NO_TEXT without texts
|
|
73464
|
-
|
|
73465
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73466
|
-
|
|
73487
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73488
|
+
|
|
73489
|
+
* NEEDED without definition
|
|
73490
|
+
|
|
73491
|
+
* NO_TEXT without texts
|
|
73492
|
+
|
|
73493
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73494
|
+
|
|
73467
73495
|
NO_HANDLER inside macros are not checked`,
|
|
73468
73496
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73469
|
-
badExample: `TRY.
|
|
73470
|
-
...
|
|
73471
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73472
|
-
RETURN. " it has a handler
|
|
73473
|
-
ENDTRY.
|
|
73474
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73475
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73476
|
-
IF sy-subrc <> 0.
|
|
73497
|
+
badExample: `TRY.
|
|
73498
|
+
...
|
|
73499
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73500
|
+
RETURN. " it has a handler
|
|
73501
|
+
ENDTRY.
|
|
73502
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73503
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73504
|
+
IF sy-subrc <> 0.
|
|
73477
73505
|
ENDIF.`,
|
|
73478
|
-
goodExample: `TRY.
|
|
73479
|
-
...
|
|
73480
|
-
CATCH zcx_abapgit_exception.
|
|
73481
|
-
RETURN.
|
|
73482
|
-
ENDTRY.
|
|
73483
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73484
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73485
|
-
IF sy-subrc <> 0.
|
|
73486
|
-
ENDIF.
|
|
73487
|
-
|
|
73488
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73489
|
-
test1 TYPE string,
|
|
73490
|
-
test2 TYPE string,
|
|
73506
|
+
goodExample: `TRY.
|
|
73507
|
+
...
|
|
73508
|
+
CATCH zcx_abapgit_exception.
|
|
73509
|
+
RETURN.
|
|
73510
|
+
ENDTRY.
|
|
73511
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73512
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73513
|
+
IF sy-subrc <> 0.
|
|
73514
|
+
ENDIF.
|
|
73515
|
+
|
|
73516
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73517
|
+
test1 TYPE string,
|
|
73518
|
+
test2 TYPE string,
|
|
73491
73519
|
END OF blah.`,
|
|
73492
73520
|
};
|
|
73493
73521
|
}
|
|
@@ -73654,18 +73682,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73654
73682
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73655
73683
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73656
73684
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73657
|
-
badExample: `FORM hello1.
|
|
73658
|
-
WRITE 'world'.
|
|
73659
|
-
RETURN.
|
|
73660
|
-
ENDFORM.
|
|
73661
|
-
|
|
73662
|
-
FORM foo.
|
|
73663
|
-
IF 1 = 2.
|
|
73664
|
-
RETURN.
|
|
73665
|
-
ENDIF.
|
|
73685
|
+
badExample: `FORM hello1.
|
|
73686
|
+
WRITE 'world'.
|
|
73687
|
+
RETURN.
|
|
73688
|
+
ENDFORM.
|
|
73689
|
+
|
|
73690
|
+
FORM foo.
|
|
73691
|
+
IF 1 = 2.
|
|
73692
|
+
RETURN.
|
|
73693
|
+
ENDIF.
|
|
73666
73694
|
ENDFORM.`,
|
|
73667
|
-
goodExample: `FORM hello2.
|
|
73668
|
-
WRITE 'world'.
|
|
73695
|
+
goodExample: `FORM hello2.
|
|
73696
|
+
WRITE 'world'.
|
|
73669
73697
|
ENDFORM.`,
|
|
73670
73698
|
};
|
|
73671
73699
|
}
|
|
@@ -74016,13 +74044,13 @@ class UnusedMacros {
|
|
|
74016
74044
|
title: "Unused macros",
|
|
74017
74045
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74018
74046
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74019
|
-
badExample: `DEFINE foobar1.
|
|
74020
|
-
WRITE 'hello'.
|
|
74047
|
+
badExample: `DEFINE foobar1.
|
|
74048
|
+
WRITE 'hello'.
|
|
74021
74049
|
END-OF-DEFINITION.`,
|
|
74022
|
-
goodExample: `DEFINE foobar2.
|
|
74023
|
-
WRITE 'hello'.
|
|
74024
|
-
END-OF-DEFINITION.
|
|
74025
|
-
|
|
74050
|
+
goodExample: `DEFINE foobar2.
|
|
74051
|
+
WRITE 'hello'.
|
|
74052
|
+
END-OF-DEFINITION.
|
|
74053
|
+
|
|
74026
74054
|
foobar2.`,
|
|
74027
74055
|
};
|
|
74028
74056
|
}
|
|
@@ -74134,18 +74162,18 @@ class UnusedMethods {
|
|
|
74134
74162
|
key: "unused_methods",
|
|
74135
74163
|
title: "Unused methods",
|
|
74136
74164
|
shortDescription: `Checks for unused methods`,
|
|
74137
|
-
extendedInformation: `Checks private and protected methods.
|
|
74138
|
-
|
|
74139
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74140
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74141
|
-
|
|
74142
|
-
Skips:
|
|
74143
|
-
* methods FOR TESTING
|
|
74144
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74145
|
-
* class_constructor + constructor methods
|
|
74146
|
-
* event handlers
|
|
74147
|
-
* methods that are redefined
|
|
74148
|
-
* INCLUDEs
|
|
74165
|
+
extendedInformation: `Checks private and protected methods.
|
|
74166
|
+
|
|
74167
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74168
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74169
|
+
|
|
74170
|
+
Skips:
|
|
74171
|
+
* methods FOR TESTING
|
|
74172
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74173
|
+
* class_constructor + constructor methods
|
|
74174
|
+
* event handlers
|
|
74175
|
+
* methods that are redefined
|
|
74176
|
+
* INCLUDEs
|
|
74149
74177
|
`,
|
|
74150
74178
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74151
74179
|
pragma: "##CALLED",
|
|
@@ -74621,23 +74649,23 @@ class UnusedVariables {
|
|
|
74621
74649
|
key: "unused_variables",
|
|
74622
74650
|
title: "Unused variables",
|
|
74623
74651
|
shortDescription: `Checks for unused variables and constants`,
|
|
74624
|
-
extendedInformation: `Skips event parameters.
|
|
74625
|
-
|
|
74626
|
-
Note that this currently does not work if the source code uses macros.
|
|
74627
|
-
|
|
74628
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74629
|
-
|
|
74652
|
+
extendedInformation: `Skips event parameters.
|
|
74653
|
+
|
|
74654
|
+
Note that this currently does not work if the source code uses macros.
|
|
74655
|
+
|
|
74656
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74657
|
+
|
|
74630
74658
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74631
74659
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74632
74660
|
pragma: "##NEEDED",
|
|
74633
74661
|
pseudoComment: "EC NEEDED",
|
|
74634
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74635
|
-
test TYPE string,
|
|
74636
|
-
test2 TYPE string,
|
|
74662
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74663
|
+
test TYPE string,
|
|
74664
|
+
test2 TYPE string,
|
|
74637
74665
|
END OF blah1.`,
|
|
74638
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74639
|
-
test TYPE string,
|
|
74640
|
-
test2 TYPE string,
|
|
74666
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74667
|
+
test TYPE string,
|
|
74668
|
+
test2 TYPE string,
|
|
74641
74669
|
END OF blah2.`,
|
|
74642
74670
|
};
|
|
74643
74671
|
}
|
|
@@ -74856,15 +74884,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74856
74884
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74857
74885
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74858
74886
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74859
|
-
badExample: `IF line IS INITIAL.
|
|
74860
|
-
has_entries = abap_false.
|
|
74861
|
-
ELSE.
|
|
74862
|
-
has_entries = abap_true.
|
|
74863
|
-
ENDIF.
|
|
74864
|
-
|
|
74887
|
+
badExample: `IF line IS INITIAL.
|
|
74888
|
+
has_entries = abap_false.
|
|
74889
|
+
ELSE.
|
|
74890
|
+
has_entries = abap_true.
|
|
74891
|
+
ENDIF.
|
|
74892
|
+
|
|
74865
74893
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74866
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74867
|
-
|
|
74894
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74895
|
+
|
|
74868
74896
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74869
74897
|
};
|
|
74870
74898
|
}
|
|
@@ -74982,15 +75010,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74982
75010
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74983
75011
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74984
75012
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74985
|
-
badExample: `INTERFACE lif.
|
|
74986
|
-
METHODS load_data
|
|
74987
|
-
EXCEPTIONS
|
|
74988
|
-
invalid_parameter.
|
|
75013
|
+
badExample: `INTERFACE lif.
|
|
75014
|
+
METHODS load_data
|
|
75015
|
+
EXCEPTIONS
|
|
75016
|
+
invalid_parameter.
|
|
74989
75017
|
ENDINTERFACE.`,
|
|
74990
|
-
goodExample: `INTERFACE lif.
|
|
74991
|
-
METHODS load_data
|
|
74992
|
-
RAISING
|
|
74993
|
-
cx_something.
|
|
75018
|
+
goodExample: `INTERFACE lif.
|
|
75019
|
+
METHODS load_data
|
|
75020
|
+
RAISING
|
|
75021
|
+
cx_something.
|
|
74994
75022
|
ENDINTERFACE.`,
|
|
74995
75023
|
};
|
|
74996
75024
|
}
|
|
@@ -75050,15 +75078,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75050
75078
|
key: "use_line_exists",
|
|
75051
75079
|
title: "Use line_exists",
|
|
75052
75080
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75053
|
-
extendedInformation: `
|
|
75054
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75055
|
-
|
|
75081
|
+
extendedInformation: `
|
|
75082
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75083
|
+
|
|
75056
75084
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75057
75085
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75058
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75059
|
-
IF sy-subrc = 0.
|
|
75086
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75087
|
+
IF sy-subrc = 0.
|
|
75060
75088
|
ENDIF.`,
|
|
75061
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75089
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75062
75090
|
ENDIF.`,
|
|
75063
75091
|
};
|
|
75064
75092
|
}
|
|
@@ -75168,10 +75196,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75168
75196
|
key: "use_new",
|
|
75169
75197
|
title: "Use NEW",
|
|
75170
75198
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75171
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75172
|
-
|
|
75173
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75174
|
-
|
|
75199
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75200
|
+
|
|
75201
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75202
|
+
|
|
75175
75203
|
Applicable from v740sp02 and up`,
|
|
75176
75204
|
badExample: `CREATE OBJECT ref.`,
|
|
75177
75205
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75269,13 +75297,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75269
75297
|
title: "WHEN OTHERS last",
|
|
75270
75298
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75271
75299
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75272
|
-
badExample: `CASE bar.
|
|
75273
|
-
WHEN OTHERS.
|
|
75274
|
-
WHEN 2.
|
|
75300
|
+
badExample: `CASE bar.
|
|
75301
|
+
WHEN OTHERS.
|
|
75302
|
+
WHEN 2.
|
|
75275
75303
|
ENDCASE.`,
|
|
75276
|
-
goodExample: `CASE bar.
|
|
75277
|
-
WHEN 2.
|
|
75278
|
-
WHEN OTHERS.
|
|
75304
|
+
goodExample: `CASE bar.
|
|
75305
|
+
WHEN 2.
|
|
75306
|
+
WHEN OTHERS.
|
|
75279
75307
|
ENDCASE.`,
|
|
75280
75308
|
};
|
|
75281
75309
|
}
|