@abaplint/cli 2.113.30 → 2.113.31
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 +871 -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) {
|
|
@@ -43479,13 +43504,13 @@ class Help {
|
|
|
43479
43504
|
/////////////////////////////////////////////////
|
|
43480
43505
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43481
43506
|
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>
|
|
43507
|
+
content = `
|
|
43508
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43509
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43510
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43511
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43512
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43513
|
+
<hr>
|
|
43489
43514
|
` +
|
|
43490
43515
|
"<tt>" + textDocument.uri + " (" +
|
|
43491
43516
|
(position.line + 1) + ", " +
|
|
@@ -52865,7 +52890,7 @@ class Registry {
|
|
|
52865
52890
|
}
|
|
52866
52891
|
static abaplintVersion() {
|
|
52867
52892
|
// magic, see build script "version.sh"
|
|
52868
|
-
return "2.113.
|
|
52893
|
+
return "2.113.31";
|
|
52869
52894
|
}
|
|
52870
52895
|
getDDICReferences() {
|
|
52871
52896
|
return this.ddicReferences;
|
|
@@ -53184,10 +53209,10 @@ class SevenBitAscii {
|
|
|
53184
53209
|
key: "7bit_ascii",
|
|
53185
53210
|
title: "Check for 7bit ascii",
|
|
53186
53211
|
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
|
-
|
|
53212
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53213
|
+
|
|
53214
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53215
|
+
|
|
53191
53216
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53192
53217
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53193
53218
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53393,10 +53418,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53393
53418
|
key: "abapdoc",
|
|
53394
53419
|
title: "Check abapdoc",
|
|
53395
53420
|
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
|
-
|
|
53421
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53422
|
+
|
|
53423
|
+
Plus class and interface definitions.
|
|
53424
|
+
|
|
53400
53425
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53401
53426
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53402
53427
|
};
|
|
@@ -53533,27 +53558,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53533
53558
|
title: "Add test attributes for tests classes with test methods",
|
|
53534
53559
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53535
53560
|
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.
|
|
53561
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53562
|
+
PUBLIC SECTION.
|
|
53563
|
+
PROTECTED SECTION.
|
|
53564
|
+
PRIVATE SECTION.
|
|
53565
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53566
|
+
ENDCLASS.
|
|
53567
|
+
|
|
53568
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53569
|
+
METHOD test.
|
|
53570
|
+
ENDMETHOD.
|
|
53546
53571
|
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.
|
|
53572
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53573
|
+
PUBLIC SECTION.
|
|
53574
|
+
PROTECTED SECTION.
|
|
53575
|
+
PRIVATE SECTION.
|
|
53576
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53577
|
+
ENDCLASS.
|
|
53578
|
+
|
|
53579
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53580
|
+
METHOD test.
|
|
53581
|
+
ENDMETHOD.
|
|
53557
53582
|
ENDCLASS.`,
|
|
53558
53583
|
};
|
|
53559
53584
|
}
|
|
@@ -53639,49 +53664,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53639
53664
|
key: "align_parameters",
|
|
53640
53665
|
title: "Align Parameters",
|
|
53641
53666
|
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
|
|
53667
|
+
extendedInformation: `Checks:
|
|
53668
|
+
* function module calls
|
|
53669
|
+
* method calls
|
|
53670
|
+
* VALUE constructors
|
|
53671
|
+
* NEW constructors
|
|
53672
|
+
* RAISE EXCEPTION statements
|
|
53673
|
+
* CREATE OBJECT statements
|
|
53674
|
+
* RAISE EVENT statements
|
|
53675
|
+
|
|
53676
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53677
|
+
|
|
53678
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53679
|
+
|
|
53680
|
+
If parameters are on the same row, no issues are reported, see
|
|
53656
53681
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53657
53682
|
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
|
|
53683
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53684
|
+
EXPORTING
|
|
53685
|
+
foo = 2
|
|
53686
|
+
parameter = 3.
|
|
53687
|
+
|
|
53688
|
+
foobar( moo = 1
|
|
53689
|
+
param = 1 ).
|
|
53690
|
+
|
|
53691
|
+
foo = VALUE #(
|
|
53692
|
+
foo = bar
|
|
53668
53693
|
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
|
|
53694
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53695
|
+
EXPORTING
|
|
53696
|
+
foo = 2
|
|
53697
|
+
parameter = 3.
|
|
53698
|
+
|
|
53699
|
+
foobar( moo = 1
|
|
53700
|
+
param = 1 ).
|
|
53701
|
+
|
|
53702
|
+
foo = VALUE #(
|
|
53703
|
+
foo = bar
|
|
53704
|
+
moo = 2 ).
|
|
53705
|
+
|
|
53706
|
+
DATA(sdf) = VALUE type(
|
|
53707
|
+
common_val = 2
|
|
53708
|
+
another_common = 5
|
|
53709
|
+
( row_value = 4
|
|
53685
53710
|
value_foo = 5 ) ).`,
|
|
53686
53711
|
};
|
|
53687
53712
|
}
|
|
@@ -54115,37 +54140,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54115
54140
|
key: "align_type_expressions",
|
|
54116
54141
|
title: "Align TYPE expressions",
|
|
54117
54142
|
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:
|
|
54143
|
+
extendedInformation: `
|
|
54144
|
+
Currently works for METHODS + BEGIN OF
|
|
54145
|
+
|
|
54146
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54147
|
+
|
|
54148
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54124
54149
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54125
54150
|
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.
|
|
54151
|
+
badExample: `
|
|
54152
|
+
TYPES: BEGIN OF foo,
|
|
54153
|
+
bar TYPE i,
|
|
54154
|
+
foobar TYPE i,
|
|
54155
|
+
END OF foo.
|
|
54156
|
+
|
|
54157
|
+
INTERFACE lif.
|
|
54158
|
+
METHODS bar
|
|
54159
|
+
IMPORTING
|
|
54160
|
+
foo TYPE i
|
|
54161
|
+
foobar TYPE i.
|
|
54137
54162
|
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.
|
|
54163
|
+
goodExample: `
|
|
54164
|
+
TYPES: BEGIN OF foo,
|
|
54165
|
+
bar TYPE i,
|
|
54166
|
+
foobar TYPE i,
|
|
54167
|
+
END OF foo.
|
|
54168
|
+
|
|
54169
|
+
INTERFACE lif.
|
|
54170
|
+
METHODS bar
|
|
54171
|
+
IMPORTING
|
|
54172
|
+
foo TYPE i
|
|
54173
|
+
foobar TYPE i.
|
|
54149
54174
|
ENDINTERFACE.`,
|
|
54150
54175
|
};
|
|
54151
54176
|
}
|
|
@@ -54424,16 +54449,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54424
54449
|
return {
|
|
54425
54450
|
key: "ambiguous_statement",
|
|
54426
54451
|
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
|
-
|
|
54452
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54453
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54454
|
+
|
|
54430
54455
|
Only works if the target version is 740sp05 or above`,
|
|
54431
54456
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54432
|
-
badExample: `DELETE foo FROM bar.
|
|
54457
|
+
badExample: `DELETE foo FROM bar.
|
|
54433
54458
|
MODIFY foo FROM bar.`,
|
|
54434
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54435
|
-
DELETE TABLE itab FROM 2.
|
|
54436
|
-
MODIFY zfoo FROM @wa.
|
|
54459
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54460
|
+
DELETE TABLE itab FROM 2.
|
|
54461
|
+
MODIFY zfoo FROM @wa.
|
|
54437
54462
|
MODIFY TABLE foo FROM bar.`,
|
|
54438
54463
|
};
|
|
54439
54464
|
}
|
|
@@ -54538,16 +54563,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54538
54563
|
key: "avoid_use",
|
|
54539
54564
|
title: "Avoid use of certain statements",
|
|
54540
54565
|
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
|
-
|
|
54566
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54567
|
+
|
|
54568
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54569
|
+
|
|
54570
|
+
STATICS: use CLASS-DATA instead
|
|
54571
|
+
|
|
54572
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54573
|
+
|
|
54574
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54575
|
+
|
|
54551
54576
|
BREAK points`,
|
|
54552
54577
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54553
54578
|
};
|
|
@@ -54679,11 +54704,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54679
54704
|
title: "Check BEGIN END names",
|
|
54680
54705
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54681
54706
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54682
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54683
|
-
field TYPE i,
|
|
54707
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54708
|
+
field TYPE i,
|
|
54684
54709
|
END OF structure_not_the_same.`,
|
|
54685
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54686
|
-
field TYPE i,
|
|
54710
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54711
|
+
field TYPE i,
|
|
54687
54712
|
END OF stru.`,
|
|
54688
54713
|
};
|
|
54689
54714
|
}
|
|
@@ -54780,20 +54805,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54780
54805
|
title: "BEGIN contains single INCLUDE",
|
|
54781
54806
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54782
54807
|
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.
|
|
54808
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54809
|
+
INCLUDE TYPE dselc.
|
|
54810
|
+
TYPES: END OF dummy1.
|
|
54811
|
+
|
|
54812
|
+
DATA BEGIN OF foo.
|
|
54813
|
+
INCLUDE STRUCTURE syst.
|
|
54814
|
+
DATA END OF foo.
|
|
54815
|
+
|
|
54816
|
+
STATICS BEGIN OF bar.
|
|
54817
|
+
INCLUDE STRUCTURE syst.
|
|
54793
54818
|
STATICS END OF bar.`,
|
|
54794
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54795
|
-
DATA field TYPE i.
|
|
54796
|
-
INCLUDE STRUCTURE dselc.
|
|
54819
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54820
|
+
DATA field TYPE i.
|
|
54821
|
+
INCLUDE STRUCTURE dselc.
|
|
54797
54822
|
DATA END OF foo.`,
|
|
54798
54823
|
};
|
|
54799
54824
|
}
|
|
@@ -54883,9 +54908,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
54883
54908
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
54884
54909
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
54885
54910
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
54886
|
-
goodExample: `TRY.
|
|
54887
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54888
|
-
CATCH cx_sy_authorization_error.
|
|
54911
|
+
goodExample: `TRY.
|
|
54912
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
54913
|
+
CATCH cx_sy_authorization_error.
|
|
54889
54914
|
ENDTRY.`,
|
|
54890
54915
|
};
|
|
54891
54916
|
}
|
|
@@ -54950,10 +54975,10 @@ class CDSCommentStyle {
|
|
|
54950
54975
|
key: "cds_comment_style",
|
|
54951
54976
|
title: "CDS Comment Style",
|
|
54952
54977
|
shortDescription: `Check for obsolete comment style`,
|
|
54953
|
-
extendedInformation: `Check for obsolete comment style
|
|
54954
|
-
|
|
54955
|
-
Comments starting with "--" are considered obsolete
|
|
54956
|
-
|
|
54978
|
+
extendedInformation: `Check for obsolete comment style
|
|
54979
|
+
|
|
54980
|
+
Comments starting with "--" are considered obsolete
|
|
54981
|
+
|
|
54957
54982
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
54958
54983
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54959
54984
|
badExample: "-- this is a comment",
|
|
@@ -55019,10 +55044,10 @@ class CDSLegacyView {
|
|
|
55019
55044
|
key: "cds_legacy_view",
|
|
55020
55045
|
title: "CDS Legacy View",
|
|
55021
55046
|
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
|
-
|
|
55047
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55048
|
+
|
|
55049
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55050
|
+
|
|
55026
55051
|
v755 and up`,
|
|
55027
55052
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55028
55053
|
};
|
|
@@ -55177,10 +55202,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55177
55202
|
key: "chain_mainly_declarations",
|
|
55178
55203
|
title: "Chain mainly declarations",
|
|
55179
55204
|
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
|
|
55205
|
+
extendedInformation: `
|
|
55206
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55207
|
+
|
|
55208
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55184
55209
|
`,
|
|
55185
55210
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55186
55211
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55356,17 +55381,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55356
55381
|
title: "Change IF to CASE",
|
|
55357
55382
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55358
55383
|
// 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
|
-
|
|
55384
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55385
|
+
|
|
55361
55386
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55362
55387
|
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'.
|
|
55388
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55389
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55390
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55366
55391
|
ENDIF.`,
|
|
55367
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55368
|
-
WHEN 'FOO'.
|
|
55369
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55392
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55393
|
+
WHEN 'FOO'.
|
|
55394
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55370
55395
|
ENDCASE.`,
|
|
55371
55396
|
};
|
|
55372
55397
|
}
|
|
@@ -55503,8 +55528,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55503
55528
|
return {
|
|
55504
55529
|
key: "check_abstract",
|
|
55505
55530
|
title: "Check abstract methods and classes",
|
|
55506
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55507
|
-
- class defined as abstract and final,
|
|
55531
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55532
|
+
- class defined as abstract and final,
|
|
55508
55533
|
- non-abstract class contains abstract methods`,
|
|
55509
55534
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55510
55535
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55585,11 +55610,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55585
55610
|
return {
|
|
55586
55611
|
key: "check_comments",
|
|
55587
55612
|
title: "Check Comments",
|
|
55588
|
-
shortDescription: `
|
|
55613
|
+
shortDescription: `
|
|
55589
55614
|
Various checks for comment usage.`,
|
|
55590
|
-
extendedInformation: `
|
|
55591
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55592
|
-
|
|
55615
|
+
extendedInformation: `
|
|
55616
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55617
|
+
|
|
55593
55618
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55594
55619
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55595
55620
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55751,9 +55776,9 @@ class CheckInclude {
|
|
|
55751
55776
|
key: "check_include",
|
|
55752
55777
|
title: "Check INCLUDEs",
|
|
55753
55778
|
shortDescription: `Checks INCLUDE statements`,
|
|
55754
|
-
extendedInformation: `
|
|
55755
|
-
* Reports unused includes
|
|
55756
|
-
* Errors if the includes are not found
|
|
55779
|
+
extendedInformation: `
|
|
55780
|
+
* Reports unused includes
|
|
55781
|
+
* Errors if the includes are not found
|
|
55757
55782
|
* Error if including a main program`,
|
|
55758
55783
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55759
55784
|
};
|
|
@@ -55829,14 +55854,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55829
55854
|
key: "check_subrc",
|
|
55830
55855
|
title: "Check sy-subrc",
|
|
55831
55856
|
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
|
-
|
|
55857
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
55858
|
+
|
|
55859
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
55860
|
+
|
|
55861
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
55862
|
+
|
|
55863
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
55864
|
+
|
|
55840
55865
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
55841
55866
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55842
55867
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56406,17 +56431,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56406
56431
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56407
56432
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56408
56433
|
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
|
|
56434
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56435
|
+
EXCEPTIONS
|
|
56436
|
+
system_failure = 1 MESSAGE lv_message
|
|
56437
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56438
|
+
resource_failure = 1
|
|
56414
56439
|
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
|
|
56440
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56441
|
+
EXCEPTIONS
|
|
56442
|
+
system_failure = 1 MESSAGE lv_message
|
|
56443
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56444
|
+
resource_failure = 3
|
|
56420
56445
|
OTHERS = 4.`,
|
|
56421
56446
|
};
|
|
56422
56447
|
}
|
|
@@ -56662,7 +56687,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56662
56687
|
key: "commented_code",
|
|
56663
56688
|
title: "Find commented code",
|
|
56664
56689
|
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
|
|
56690
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56666
56691
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56667
56692
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56668
56693
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -56895,10 +56920,10 @@ class ConstructorVisibilityPublic {
|
|
|
56895
56920
|
key: "constructor_visibility_public",
|
|
56896
56921
|
title: "Check constructor visibility is public",
|
|
56897
56922
|
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
|
|
56923
|
+
extendedInformation: `
|
|
56924
|
+
This only applies to global classes.
|
|
56925
|
+
|
|
56926
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
56902
56927
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
56903
56928
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56904
56929
|
};
|
|
@@ -56973,8 +56998,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
56973
56998
|
key: "contains_tab",
|
|
56974
56999
|
title: "Code contains tab",
|
|
56975
57000
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
56976
|
-
extendedInformation: `
|
|
56977
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57001
|
+
extendedInformation: `
|
|
57002
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
56978
57003
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
56979
57004
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56980
57005
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57061,10 +57086,10 @@ class CyclicOO {
|
|
|
57061
57086
|
key: "cyclic_oo",
|
|
57062
57087
|
title: "Cyclic OO",
|
|
57063
57088
|
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
|
-
|
|
57089
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57090
|
+
|
|
57091
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57092
|
+
|
|
57068
57093
|
References in testclass includes are ignored`,
|
|
57069
57094
|
};
|
|
57070
57095
|
}
|
|
@@ -57307,7 +57332,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57307
57332
|
key: "dangerous_statement",
|
|
57308
57333
|
title: "Dangerous statement",
|
|
57309
57334
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57310
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57335
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57311
57336
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57312
57337
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57313
57338
|
};
|
|
@@ -57514,13 +57539,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57514
57539
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57515
57540
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57516
57541
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57517
|
-
badExample: `FROM foo.
|
|
57518
|
-
WRITE 'hello'.
|
|
57519
|
-
DATA int TYPE i.
|
|
57542
|
+
badExample: `FROM foo.
|
|
57543
|
+
WRITE 'hello'.
|
|
57544
|
+
DATA int TYPE i.
|
|
57520
57545
|
ENDFORM.`,
|
|
57521
|
-
goodExample: `FROM foo.
|
|
57522
|
-
DATA int TYPE i.
|
|
57523
|
-
WRITE 'hello'.
|
|
57546
|
+
goodExample: `FROM foo.
|
|
57547
|
+
DATA int TYPE i.
|
|
57548
|
+
WRITE 'hello'.
|
|
57524
57549
|
ENDFORM.`,
|
|
57525
57550
|
};
|
|
57526
57551
|
}
|
|
@@ -58059,39 +58084,39 @@ class Downport {
|
|
|
58059
58084
|
key: "downport",
|
|
58060
58085
|
title: "Downport statement",
|
|
58061
58086
|
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
|
-
|
|
58087
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58088
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58089
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58090
|
+
|
|
58091
|
+
Current rules:
|
|
58092
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58093
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58094
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58095
|
+
* CONV is outlined
|
|
58096
|
+
* COND is outlined
|
|
58097
|
+
* REDUCE is outlined
|
|
58098
|
+
* SWITCH is outlined
|
|
58099
|
+
* FILTER is outlined
|
|
58100
|
+
* APPEND expression is outlined
|
|
58101
|
+
* INSERT expression is outlined
|
|
58102
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58103
|
+
* CAST changed to ?=
|
|
58104
|
+
* LOOP AT method_call( ) is outlined
|
|
58105
|
+
* VALUE # with structure fields
|
|
58106
|
+
* VALUE # with internal table lines
|
|
58107
|
+
* Table Expressions are outlined
|
|
58108
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58109
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58110
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58111
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58112
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58113
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58114
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58115
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58116
|
+
* MESSAGE with non simple source
|
|
58117
|
+
|
|
58118
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58119
|
+
|
|
58095
58120
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58096
58121
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58097
58122
|
};
|
|
@@ -58669,10 +58694,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58669
58694
|
const fieldName = f.concatTokens();
|
|
58670
58695
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58671
58696
|
}
|
|
58672
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58697
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58673
58698
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58674
58699
|
}
|
|
58675
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58700
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58676
58701
|
${indentation}`);
|
|
58677
58702
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58678
58703
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58731,12 +58756,12 @@ ${indentation}`);
|
|
|
58731
58756
|
}
|
|
58732
58757
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58733
58758
|
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.
|
|
58759
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58760
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58761
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58737
58762
|
${indentation}`);
|
|
58738
58763
|
if (fieldDefinitions === "") {
|
|
58739
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58764
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58740
58765
|
${indentation}`);
|
|
58741
58766
|
}
|
|
58742
58767
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58804,7 +58829,7 @@ ${indentation}`);
|
|
|
58804
58829
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58805
58830
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58806
58831
|
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()}.
|
|
58832
|
+
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
58833
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58809
58834
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58810
58835
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58858,7 +58883,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58858
58883
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58859
58884
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58860
58885
|
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()}.
|
|
58886
|
+
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
58887
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58863
58888
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58864
58889
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58900,14 +58925,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
58900
58925
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58901
58926
|
const firstToken = high.getFirstToken();
|
|
58902
58927
|
// 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.
|
|
58928
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
58929
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58930
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58931
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
58932
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58933
|
+
${indentation}IF sy-subrc <> 0.
|
|
58934
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58935
|
+
${indentation}ENDIF.
|
|
58911
58936
|
${indentation}`);
|
|
58912
58937
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
58913
58938
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58964,7 +58989,7 @@ ${indentation}`);
|
|
|
58964
58989
|
const className = classNames[0].concatTokens();
|
|
58965
58990
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58966
58991
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
58967
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58992
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
58968
58993
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
58969
58994
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
58970
58995
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59126,16 +59151,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59126
59151
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59127
59152
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59128
59153
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59129
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59130
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59154
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59155
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59131
59156
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59132
59157
|
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'.
|
|
59158
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59159
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59160
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59136
59161
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59137
59162
|
}
|
|
59138
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59163
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59139
59164
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59140
59165
|
if (withs.length > 0) {
|
|
59141
59166
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59247,10 +59272,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59247
59272
|
let code = "";
|
|
59248
59273
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59249
59274
|
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.
|
|
59275
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59276
|
+
IF sy-subrc <> 0.
|
|
59277
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59278
|
+
ENDIF.
|
|
59254
59279
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59255
59280
|
}
|
|
59256
59281
|
else {
|
|
@@ -59339,20 +59364,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59339
59364
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59340
59365
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59341
59366
|
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.
|
|
59367
|
+
code += ` items LIKE ${loopSourceName},
|
|
59368
|
+
END OF ${groupTargetName}type.
|
|
59369
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59370
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59346
59371
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59347
59372
|
if (groupIndexName !== undefined) {
|
|
59348
59373
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59349
59374
|
}
|
|
59350
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59375
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59351
59376
|
IF sy-subrc = 0.\n`;
|
|
59352
59377
|
if (groupCountName !== undefined) {
|
|
59353
59378
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59354
59379
|
}
|
|
59355
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59380
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59356
59381
|
ELSE.\n`;
|
|
59357
59382
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59358
59383
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59373,8 +59398,8 @@ ELSE.\n`;
|
|
|
59373
59398
|
}
|
|
59374
59399
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59375
59400
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59376
|
-
code += `ENDIF.
|
|
59377
|
-
ENDLOOP.
|
|
59401
|
+
code += `ENDIF.
|
|
59402
|
+
ENDLOOP.
|
|
59378
59403
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59379
59404
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59380
59405
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59546,7 +59571,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59546
59571
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59547
59572
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59548
59573
|
// all ENUMS are char like?
|
|
59549
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59574
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59550
59575
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59551
59576
|
let count = 1;
|
|
59552
59577
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59590,14 +59615,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59590
59615
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59591
59616
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59592
59617
|
// 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.
|
|
59618
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59619
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59620
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59621
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59622
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59623
|
+
${indentation}IF sy-subrc <> 0.
|
|
59624
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59625
|
+
${indentation}ENDIF.
|
|
59601
59626
|
${indentation}${uniqueName}`;
|
|
59602
59627
|
const start = target.getFirstToken().getStart();
|
|
59603
59628
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59677,11 +59702,11 @@ ${indentation}${uniqueName}`;
|
|
|
59677
59702
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59678
59703
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59679
59704
|
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
|
|
59705
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59706
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59707
|
+
${indentation} EXPORTING
|
|
59708
|
+
${indentation} input = ${source}
|
|
59709
|
+
${indentation} IMPORTING
|
|
59685
59710
|
${indentation} output = ${uniqueName}.\n`;
|
|
59686
59711
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59687
59712
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60993,12 +61018,12 @@ class EasyToFindMessages {
|
|
|
60993
61018
|
key: "easy_to_find_messages",
|
|
60994
61019
|
title: "Easy to find messages",
|
|
60995
61020
|
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
|
-
|
|
61021
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61022
|
+
|
|
61023
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61024
|
+
|
|
61025
|
+
Also see rule "message_exists"
|
|
61026
|
+
|
|
61002
61027
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61003
61028
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61004
61029
|
};
|
|
@@ -61079,13 +61104,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61079
61104
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61080
61105
|
extendedInformation: ``,
|
|
61081
61106
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61082
|
-
badExample: `
|
|
61083
|
-
INITIALIZATION.
|
|
61084
|
-
WRITE 'hello'.
|
|
61107
|
+
badExample: `
|
|
61108
|
+
INITIALIZATION.
|
|
61109
|
+
WRITE 'hello'.
|
|
61085
61110
|
END-OF-SELECTION.`,
|
|
61086
|
-
goodExample: `
|
|
61087
|
-
START-OF-SELECTION.
|
|
61088
|
-
PERFORM sdf.
|
|
61111
|
+
goodExample: `
|
|
61112
|
+
START-OF-SELECTION.
|
|
61113
|
+
PERFORM sdf.
|
|
61089
61114
|
COMMIT WORK.`,
|
|
61090
61115
|
};
|
|
61091
61116
|
}
|
|
@@ -61177,8 +61202,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61177
61202
|
key: "empty_line_in_statement",
|
|
61178
61203
|
title: "Find empty lines in statements",
|
|
61179
61204
|
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
|
-
|
|
61205
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61206
|
+
|
|
61182
61207
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61183
61208
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61184
61209
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61354,13 +61379,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61354
61379
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61355
61380
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61356
61381
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61357
|
-
badExample: `IF foo = bar.
|
|
61358
|
-
ENDIF.
|
|
61359
|
-
|
|
61360
|
-
DO 2 TIMES.
|
|
61382
|
+
badExample: `IF foo = bar.
|
|
61383
|
+
ENDIF.
|
|
61384
|
+
|
|
61385
|
+
DO 2 TIMES.
|
|
61361
61386
|
ENDDO.`,
|
|
61362
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61363
|
-
ENDLOOP.
|
|
61387
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61388
|
+
ENDLOOP.
|
|
61364
61389
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61365
61390
|
};
|
|
61366
61391
|
}
|
|
@@ -61502,10 +61527,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61502
61527
|
return {
|
|
61503
61528
|
key: "exit_or_check",
|
|
61504
61529
|
title: "Find EXIT or CHECK outside loops",
|
|
61505
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61530
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61506
61531
|
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
|
|
61532
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61533
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61509
61534
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61510
61535
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61511
61536
|
};
|
|
@@ -61588,12 +61613,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61588
61613
|
key: "expand_macros",
|
|
61589
61614
|
title: "Expand Macros",
|
|
61590
61615
|
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
|
-
|
|
61616
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61617
|
+
|
|
61593
61618
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61594
|
-
badExample: `DEFINE _hello.
|
|
61595
|
-
WRITE 'hello'.
|
|
61596
|
-
END-OF-DEFINITION.
|
|
61619
|
+
badExample: `DEFINE _hello.
|
|
61620
|
+
WRITE 'hello'.
|
|
61621
|
+
END-OF-DEFINITION.
|
|
61597
61622
|
_hello.`,
|
|
61598
61623
|
goodExample: `WRITE 'hello'.`,
|
|
61599
61624
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61680,7 +61705,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61680
61705
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61681
61706
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61682
61707
|
goodExample: `call_method( foo = bar ).`,
|
|
61683
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61708
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61684
61709
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61685
61710
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61686
61711
|
};
|
|
@@ -61778,7 +61803,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61778
61803
|
key: "forbidden_identifier",
|
|
61779
61804
|
title: "Forbidden Identifier",
|
|
61780
61805
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61781
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61806
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61782
61807
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61783
61808
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61784
61809
|
};
|
|
@@ -62020,8 +62045,8 @@ class ForbiddenVoidType {
|
|
|
62020
62045
|
key: "forbidden_void_type",
|
|
62021
62046
|
title: "Forbidden Void Types",
|
|
62022
62047
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62023
|
-
extendedInformation: `Inspiration:
|
|
62024
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62048
|
+
extendedInformation: `Inspiration:
|
|
62049
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62025
62050
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62026
62051
|
};
|
|
62027
62052
|
}
|
|
@@ -62264,9 +62289,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62264
62289
|
key: "fully_type_itabs",
|
|
62265
62290
|
title: "Fully type internal tables",
|
|
62266
62291
|
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
|
|
62292
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62268
62293
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62269
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62294
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62270
62295
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62271
62296
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62272
62297
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62451,26 +62476,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62451
62476
|
key: "functional_writing",
|
|
62452
62477
|
title: "Use functional writing",
|
|
62453
62478
|
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
|
|
62479
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62455
62480
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62456
62481
|
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
|
|
62482
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62483
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62484
|
+
EXPORTING
|
|
62485
|
+
p_name = 'NAME'
|
|
62486
|
+
RECEIVING
|
|
62487
|
+
p_descr_ref = lr_typedescr
|
|
62488
|
+
EXCEPTIONS
|
|
62489
|
+
type_not_found = 1
|
|
62465
62490
|
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
|
|
62491
|
+
goodExample: `zcl_class=>method( ).
|
|
62492
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62493
|
+
EXPORTING
|
|
62494
|
+
p_name = 'NAME'
|
|
62495
|
+
RECEIVING
|
|
62496
|
+
p_descr_ref = lr_typedescr
|
|
62497
|
+
EXCEPTIONS
|
|
62498
|
+
type_not_found = 1
|
|
62474
62499
|
OTHERS = 2 ).`,
|
|
62475
62500
|
};
|
|
62476
62501
|
}
|
|
@@ -62581,14 +62606,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62581
62606
|
key: "global_class",
|
|
62582
62607
|
title: "Global class checks",
|
|
62583
62608
|
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
|
-
|
|
62609
|
+
extendedInformation: `* global classes must be in own files
|
|
62610
|
+
|
|
62611
|
+
* file names must match class name
|
|
62612
|
+
|
|
62613
|
+
* file names must match interface name
|
|
62614
|
+
|
|
62615
|
+
* global classes must be global definitions
|
|
62616
|
+
|
|
62592
62617
|
* global interfaces must be global definitions`,
|
|
62593
62618
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62594
62619
|
};
|
|
@@ -62687,21 +62712,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62687
62712
|
return {
|
|
62688
62713
|
key: "identical_conditions",
|
|
62689
62714
|
title: "Identical conditions",
|
|
62690
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62691
|
-
|
|
62715
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62716
|
+
|
|
62692
62717
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62693
62718
|
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'.
|
|
62719
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62720
|
+
ENDIF.
|
|
62721
|
+
CASE bar.
|
|
62722
|
+
WHEN '1'.
|
|
62723
|
+
WHEN 'A' OR '1'.
|
|
62699
62724
|
ENDCASE.`,
|
|
62700
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62701
|
-
ENDIF.
|
|
62702
|
-
CASE bar.
|
|
62703
|
-
WHEN '1'.
|
|
62704
|
-
WHEN 'A'.
|
|
62725
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62726
|
+
ENDIF.
|
|
62727
|
+
CASE bar.
|
|
62728
|
+
WHEN '1'.
|
|
62729
|
+
WHEN 'A'.
|
|
62705
62730
|
ENDCASE.`,
|
|
62706
62731
|
};
|
|
62707
62732
|
}
|
|
@@ -62835,23 +62860,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
62835
62860
|
key: "identical_contents",
|
|
62836
62861
|
title: "Identical contents",
|
|
62837
62862
|
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
|
-
|
|
62863
|
+
extendedInformation: `
|
|
62864
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
62865
|
+
|
|
62841
62866
|
Chained statments are ignored`,
|
|
62842
62867
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62843
|
-
badExample: `IF foo = bar.
|
|
62844
|
-
WRITE 'bar'.
|
|
62845
|
-
WRITE 'world'.
|
|
62846
|
-
ELSE.
|
|
62847
|
-
WRITE 'foo'.
|
|
62848
|
-
WRITE 'world'.
|
|
62868
|
+
badExample: `IF foo = bar.
|
|
62869
|
+
WRITE 'bar'.
|
|
62870
|
+
WRITE 'world'.
|
|
62871
|
+
ELSE.
|
|
62872
|
+
WRITE 'foo'.
|
|
62873
|
+
WRITE 'world'.
|
|
62849
62874
|
ENDIF.`,
|
|
62850
|
-
goodExample: `IF foo = bar.
|
|
62851
|
-
WRITE 'bar'.
|
|
62852
|
-
ELSE.
|
|
62853
|
-
WRITE 'foo'.
|
|
62854
|
-
ENDIF.
|
|
62875
|
+
goodExample: `IF foo = bar.
|
|
62876
|
+
WRITE 'bar'.
|
|
62877
|
+
ELSE.
|
|
62878
|
+
WRITE 'foo'.
|
|
62879
|
+
ENDIF.
|
|
62855
62880
|
WRITE 'world'.`,
|
|
62856
62881
|
};
|
|
62857
62882
|
}
|
|
@@ -62959,12 +62984,12 @@ class IdenticalDescriptions {
|
|
|
62959
62984
|
key: "identical_descriptions",
|
|
62960
62985
|
title: "Identical descriptions",
|
|
62961
62986
|
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
|
-
|
|
62987
|
+
extendedInformation: `Case insensitive
|
|
62988
|
+
|
|
62989
|
+
Only checks the master language descriptions
|
|
62990
|
+
|
|
62991
|
+
Dependencies are skipped
|
|
62992
|
+
|
|
62968
62993
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
62969
62994
|
tags: [],
|
|
62970
62995
|
};
|
|
@@ -63138,43 +63163,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63138
63163
|
key: "if_in_if",
|
|
63139
63164
|
title: "IF in IF",
|
|
63140
63165
|
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/
|
|
63166
|
+
extendedInformation: `
|
|
63167
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63168
|
+
|
|
63169
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63170
|
+
|
|
63171
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63147
63172
|
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.
|
|
63173
|
+
badExample: `IF condition1.
|
|
63174
|
+
IF condition2.
|
|
63175
|
+
...
|
|
63176
|
+
ENDIF.
|
|
63177
|
+
ENDIF.
|
|
63178
|
+
|
|
63179
|
+
IF condition1.
|
|
63180
|
+
...
|
|
63181
|
+
ELSE.
|
|
63182
|
+
IF condition2.
|
|
63183
|
+
...
|
|
63184
|
+
ENDIF.
|
|
63160
63185
|
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.
|
|
63186
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63187
|
+
...
|
|
63188
|
+
ENDIF.
|
|
63189
|
+
|
|
63190
|
+
IF condition1.
|
|
63191
|
+
...
|
|
63192
|
+
ELSEIF condition2.
|
|
63193
|
+
...
|
|
63194
|
+
ENDIF.
|
|
63195
|
+
|
|
63196
|
+
CASE variable.
|
|
63197
|
+
WHEN value1.
|
|
63198
|
+
...
|
|
63199
|
+
WHEN value2.
|
|
63200
|
+
IF condition2.
|
|
63201
|
+
...
|
|
63202
|
+
ENDIF.
|
|
63178
63203
|
ENDCASE.`,
|
|
63179
63204
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63180
63205
|
};
|
|
@@ -63359,9 +63384,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63359
63384
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63360
63385
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63361
63386
|
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
|
|
63387
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63388
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63389
|
+
RETURN. " todo, implement method
|
|
63365
63390
|
ENDMETHOD.`);
|
|
63366
63391
|
}
|
|
63367
63392
|
}
|
|
@@ -63540,14 +63565,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63540
63565
|
key: "implicit_start_of_selection",
|
|
63541
63566
|
title: "Implicit START-OF-SELECTION",
|
|
63542
63567
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63543
|
-
extendedInformation: `Only runs for executable programs
|
|
63544
|
-
|
|
63568
|
+
extendedInformation: `Only runs for executable programs
|
|
63569
|
+
|
|
63545
63570
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63546
63571
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63547
|
-
badExample: `REPORT zfoo.
|
|
63572
|
+
badExample: `REPORT zfoo.
|
|
63548
63573
|
WRITE 'hello'.`,
|
|
63549
|
-
goodExample: `
|
|
63550
|
-
START-OF-SELECTION.
|
|
63574
|
+
goodExample: `
|
|
63575
|
+
START-OF-SELECTION.
|
|
63551
63576
|
WRITE 'hello'.`,
|
|
63552
63577
|
};
|
|
63553
63578
|
}
|
|
@@ -63652,19 +63677,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63652
63677
|
key: "in_statement_indentation",
|
|
63653
63678
|
title: "In-statement indentation",
|
|
63654
63679
|
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)
|
|
63680
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63681
|
+
|
|
63682
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63658
63683
|
to distinguish them better from code within the block.`,
|
|
63659
|
-
badExample: `IF 1 = 1
|
|
63660
|
-
AND 2 = 2.
|
|
63661
|
-
WRITE 'hello' &&
|
|
63662
|
-
'world'.
|
|
63684
|
+
badExample: `IF 1 = 1
|
|
63685
|
+
AND 2 = 2.
|
|
63686
|
+
WRITE 'hello' &&
|
|
63687
|
+
'world'.
|
|
63663
63688
|
ENDIF.`,
|
|
63664
|
-
goodExample: `IF 1 = 1
|
|
63665
|
-
AND 2 = 2.
|
|
63666
|
-
WRITE 'hello' &&
|
|
63667
|
-
'world'.
|
|
63689
|
+
goodExample: `IF 1 = 1
|
|
63690
|
+
AND 2 = 2.
|
|
63691
|
+
WRITE 'hello' &&
|
|
63692
|
+
'world'.
|
|
63668
63693
|
ENDIF.`,
|
|
63669
63694
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63670
63695
|
};
|
|
@@ -63787,23 +63812,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63787
63812
|
title: "Indentation",
|
|
63788
63813
|
shortDescription: `Checks indentation`,
|
|
63789
63814
|
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.
|
|
63815
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63816
|
+
PRIVATE SECTION.
|
|
63817
|
+
METHODS constructor.
|
|
63818
|
+
ENDCLASS.
|
|
63819
|
+
|
|
63820
|
+
CLASS lcl IMPLEMENTATION.
|
|
63821
|
+
METHOD constructor.
|
|
63822
|
+
ENDMETHOD.
|
|
63798
63823
|
ENDCLASS.`,
|
|
63799
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63800
|
-
PRIVATE SECTION.
|
|
63801
|
-
METHODS constructor.
|
|
63802
|
-
ENDCLASS.
|
|
63803
|
-
|
|
63804
|
-
CLASS lcl IMPLEMENTATION.
|
|
63805
|
-
METHOD constructor.
|
|
63806
|
-
ENDMETHOD.
|
|
63824
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63825
|
+
PRIVATE SECTION.
|
|
63826
|
+
METHODS constructor.
|
|
63827
|
+
ENDCLASS.
|
|
63828
|
+
|
|
63829
|
+
CLASS lcl IMPLEMENTATION.
|
|
63830
|
+
METHOD constructor.
|
|
63831
|
+
ENDMETHOD.
|
|
63807
63832
|
ENDCLASS.`,
|
|
63808
63833
|
};
|
|
63809
63834
|
}
|
|
@@ -64204,9 +64229,9 @@ class IntfReferencingClas {
|
|
|
64204
64229
|
key: "intf_referencing_clas",
|
|
64205
64230
|
title: "INTF referencing CLAS",
|
|
64206
64231
|
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.
|
|
64232
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64233
|
+
Only first level references are checked.
|
|
64234
|
+
Exception class references are ignored.
|
|
64210
64235
|
Void references are ignored.`,
|
|
64211
64236
|
};
|
|
64212
64237
|
}
|
|
@@ -64291,9 +64316,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64291
64316
|
title: "Invalid Table Index",
|
|
64292
64317
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64293
64318
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64294
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64319
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64295
64320
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64296
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64321
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64297
64322
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64298
64323
|
};
|
|
64299
64324
|
}
|
|
@@ -64894,8 +64919,8 @@ class LineBreakStyle {
|
|
|
64894
64919
|
return {
|
|
64895
64920
|
key: "line_break_style",
|
|
64896
64921
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
64897
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64898
|
-
|
|
64922
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
64923
|
+
|
|
64899
64924
|
abapGit does not work with CRLF`,
|
|
64900
64925
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
64901
64926
|
};
|
|
@@ -64964,7 +64989,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
64964
64989
|
key: "line_length",
|
|
64965
64990
|
title: "Line length",
|
|
64966
64991
|
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
|
|
64992
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
64968
64993
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
64969
64994
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64970
64995
|
};
|
|
@@ -65035,7 +65060,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65035
65060
|
key: "line_only_punc",
|
|
65036
65061
|
title: "Line containing only punctuation",
|
|
65037
65062
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65038
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65063
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65039
65064
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65040
65065
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65041
65066
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65298,15 +65323,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65298
65323
|
return {
|
|
65299
65324
|
key: "local_variable_names",
|
|
65300
65325
|
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.
|
|
65326
|
+
shortDescription: `
|
|
65327
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65303
65328
|
Regexes are case-insensitive.`,
|
|
65304
65329
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65305
|
-
badExample: `FORM bar.
|
|
65306
|
-
DATA foo.
|
|
65330
|
+
badExample: `FORM bar.
|
|
65331
|
+
DATA foo.
|
|
65307
65332
|
ENDFORM.`,
|
|
65308
|
-
goodExample: `FORM bar.
|
|
65309
|
-
DATA lv_foo.
|
|
65333
|
+
goodExample: `FORM bar.
|
|
65334
|
+
DATA lv_foo.
|
|
65310
65335
|
ENDFORM.`,
|
|
65311
65336
|
};
|
|
65312
65337
|
}
|
|
@@ -65458,9 +65483,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65458
65483
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65459
65484
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65460
65485
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65461
|
-
badExample: `DEFINE something.
|
|
65486
|
+
badExample: `DEFINE something.
|
|
65462
65487
|
END-OF-DEFINITION.`,
|
|
65463
|
-
goodExample: `DEFINE _something.
|
|
65488
|
+
goodExample: `DEFINE _something.
|
|
65464
65489
|
END-OF-DEFINITION.`,
|
|
65465
65490
|
};
|
|
65466
65491
|
}
|
|
@@ -65533,10 +65558,10 @@ class MainFileContents {
|
|
|
65533
65558
|
key: "main_file_contents",
|
|
65534
65559
|
title: "Main file contents",
|
|
65535
65560
|
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>."
|
|
65561
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65562
|
+
|
|
65563
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65564
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65540
65565
|
`,
|
|
65541
65566
|
};
|
|
65542
65567
|
}
|
|
@@ -65652,17 +65677,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65652
65677
|
title: "Too many parentheses",
|
|
65653
65678
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65654
65679
|
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.
|
|
65680
|
+
badExample: `
|
|
65681
|
+
IF ( destination IS INITIAL ).
|
|
65682
|
+
ENDIF.
|
|
65683
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65684
|
+
ENDIF.
|
|
65660
65685
|
`,
|
|
65661
|
-
goodExample: `
|
|
65662
|
-
IF destination IS INITIAL.
|
|
65663
|
-
ENDIF.
|
|
65664
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65665
|
-
ENDIF.
|
|
65686
|
+
goodExample: `
|
|
65687
|
+
IF destination IS INITIAL.
|
|
65688
|
+
ENDIF.
|
|
65689
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65690
|
+
ENDIF.
|
|
65666
65691
|
`,
|
|
65667
65692
|
};
|
|
65668
65693
|
}
|
|
@@ -65836,14 +65861,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
65836
65861
|
title: "Max one method parameter definition per line",
|
|
65837
65862
|
shortDescription: `Keep max one method parameter description per line`,
|
|
65838
65863
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
65839
|
-
badExample: `
|
|
65840
|
-
METHODS apps_scope_token
|
|
65841
|
-
IMPORTING
|
|
65864
|
+
badExample: `
|
|
65865
|
+
METHODS apps_scope_token
|
|
65866
|
+
IMPORTING
|
|
65842
65867
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
65843
|
-
goodExample: `
|
|
65844
|
-
METHODS apps_scope_token
|
|
65845
|
-
IMPORTING
|
|
65846
|
-
body TYPE bodyapps_scope_token
|
|
65868
|
+
goodExample: `
|
|
65869
|
+
METHODS apps_scope_token
|
|
65870
|
+
IMPORTING
|
|
65871
|
+
body TYPE bodyapps_scope_token
|
|
65847
65872
|
client_id TYPE str.`,
|
|
65848
65873
|
};
|
|
65849
65874
|
}
|
|
@@ -65908,11 +65933,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
65908
65933
|
key: "max_one_statement",
|
|
65909
65934
|
title: "Max one statement per line",
|
|
65910
65935
|
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
|
|
65936
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
65937
|
+
|
|
65938
|
+
Does not report anything for chained statements.
|
|
65939
|
+
|
|
65940
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
65916
65941
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
65917
65942
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65918
65943
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66250,8 +66275,8 @@ class MethodLength {
|
|
|
66250
66275
|
key: "method_length",
|
|
66251
66276
|
title: "Method/Form Length",
|
|
66252
66277
|
shortDescription: `Checks relating to method/form length.`,
|
|
66253
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66254
|
-
|
|
66278
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66279
|
+
|
|
66255
66280
|
Abstract methods without statements are considered okay.`,
|
|
66256
66281
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66257
66282
|
};
|
|
@@ -66356,20 +66381,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66356
66381
|
key: "method_overwrites_builtin",
|
|
66357
66382
|
title: "Method name overwrites builtin function",
|
|
66358
66383
|
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
|
-
|
|
66384
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66385
|
+
|
|
66386
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66387
|
+
|
|
66363
66388
|
Interface method names are ignored`,
|
|
66364
66389
|
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.
|
|
66390
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66391
|
+
PUBLIC SECTION.
|
|
66392
|
+
METHODS matches.
|
|
66393
|
+
ENDCLASS.
|
|
66394
|
+
|
|
66395
|
+
CLASS lcl IMPLEMENTATION.
|
|
66396
|
+
METHOD matches.
|
|
66397
|
+
ENDMETHOD.
|
|
66373
66398
|
ENDCLASS.`,
|
|
66374
66399
|
};
|
|
66375
66400
|
}
|
|
@@ -66560,12 +66585,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66560
66585
|
// eslint-disable-next-line max-len
|
|
66561
66586
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66562
66587
|
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.
|
|
66588
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66589
|
+
PUBLIC SECTION.
|
|
66590
|
+
METHODS
|
|
66591
|
+
foobar
|
|
66592
|
+
EXPORTING foo TYPE i
|
|
66593
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66569
66594
|
ENDCLASS.`,
|
|
66570
66595
|
};
|
|
66571
66596
|
}
|
|
@@ -66945,7 +66970,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
66945
66970
|
key: "nesting",
|
|
66946
66971
|
title: "Check nesting depth",
|
|
66947
66972
|
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
|
|
66973
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
66949
66974
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
66950
66975
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66951
66976
|
};
|
|
@@ -67188,7 +67213,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67188
67213
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67189
67214
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67190
67215
|
badExample: `var1 = var2 = var3.`,
|
|
67191
|
-
goodExample: `var2 = var3.
|
|
67216
|
+
goodExample: `var2 = var3.
|
|
67192
67217
|
var1 = var2.`,
|
|
67193
67218
|
};
|
|
67194
67219
|
}
|
|
@@ -67247,8 +67272,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67247
67272
|
key: "no_external_form_calls",
|
|
67248
67273
|
title: "No external FORM calls",
|
|
67249
67274
|
shortDescription: `Detect external form calls`,
|
|
67250
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67251
|
-
|
|
67275
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67276
|
+
|
|
67252
67277
|
PERFORM foo(bar).`,
|
|
67253
67278
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67254
67279
|
};
|
|
@@ -67309,17 +67334,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67309
67334
|
key: "no_inline_in_optional_branches",
|
|
67310
67335
|
title: "Don't declare inline in optional branches",
|
|
67311
67336
|
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:
|
|
67337
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67338
|
+
|
|
67339
|
+
Considered optional branches:
|
|
67340
|
+
* inside IF/ELSEIF/ELSE
|
|
67341
|
+
* inside LOOP
|
|
67342
|
+
* inside WHILE
|
|
67343
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67344
|
+
* inside DO
|
|
67345
|
+
* inside SELECT loops
|
|
67346
|
+
|
|
67347
|
+
Not considered optional branches:
|
|
67323
67348
|
* TRY/CATCH/CLEANUP`,
|
|
67324
67349
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67325
67350
|
};
|
|
@@ -67419,12 +67444,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67419
67444
|
key: "no_prefixes",
|
|
67420
67445
|
title: "No Prefixes",
|
|
67421
67446
|
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
|
-
|
|
67447
|
+
extendedInformation: `
|
|
67448
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67449
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67450
|
+
|
|
67451
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67452
|
+
|
|
67428
67453
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67429
67454
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67430
67455
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67603,7 +67628,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67603
67628
|
return {
|
|
67604
67629
|
key: "no_public_attributes",
|
|
67605
67630
|
title: "No public attributes",
|
|
67606
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67631
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67607
67632
|
Exceptions are excluded from this rule.`,
|
|
67608
67633
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67609
67634
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67704,13 +67729,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67704
67729
|
key: "no_yoda_conditions",
|
|
67705
67730
|
title: "No Yoda conditions",
|
|
67706
67731
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67707
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67708
|
-
|
|
67732
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67733
|
+
|
|
67709
67734
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67710
67735
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67711
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67736
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67712
67737
|
ENDIF.`,
|
|
67713
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67738
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67714
67739
|
ENDIF.`,
|
|
67715
67740
|
};
|
|
67716
67741
|
}
|
|
@@ -67811,8 +67836,8 @@ class NROBConsistency {
|
|
|
67811
67836
|
key: "nrob_consistency",
|
|
67812
67837
|
title: "Number range consistency",
|
|
67813
67838
|
shortDescription: `Consistency checks for number ranges`,
|
|
67814
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67815
|
-
|
|
67839
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67840
|
+
|
|
67816
67841
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67817
67842
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67818
67843
|
};
|
|
@@ -68089,58 +68114,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68089
68114
|
title: "Obsolete statements",
|
|
68090
68115
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68091
68116
|
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
|
-
|
|
68117
|
+
extendedInformation: `
|
|
68118
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68119
|
+
|
|
68120
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68121
|
+
|
|
68122
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68123
|
+
|
|
68124
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68125
|
+
|
|
68126
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68127
|
+
|
|
68128
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68129
|
+
|
|
68130
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68131
|
+
|
|
68132
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68133
|
+
|
|
68134
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68135
|
+
|
|
68136
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68137
|
+
|
|
68138
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68139
|
+
|
|
68140
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68141
|
+
|
|
68142
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68143
|
+
|
|
68144
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68145
|
+
|
|
68146
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68147
|
+
SELECT COUNT(*) is considered okay
|
|
68148
|
+
|
|
68149
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68150
|
+
|
|
68151
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68152
|
+
|
|
68153
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68154
|
+
|
|
68155
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68156
|
+
|
|
68157
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68158
|
+
|
|
68134
68159
|
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.
|
|
68160
|
+
badExample: `REFRESH itab.
|
|
68161
|
+
|
|
68162
|
+
COMPUTE foo = 2 + 2.
|
|
68163
|
+
|
|
68164
|
+
MULTIPLY lv_foo BY 2.
|
|
68165
|
+
|
|
68166
|
+
INTERFACE intf LOAD.
|
|
68167
|
+
|
|
68168
|
+
IF foo IS SUPPLIED.
|
|
68144
68169
|
ENDIF.`,
|
|
68145
68170
|
};
|
|
68146
68171
|
}
|
|
@@ -68480,9 +68505,9 @@ class OmitParameterName {
|
|
|
68480
68505
|
key: "omit_parameter_name",
|
|
68481
68506
|
title: "Omit parameter name",
|
|
68482
68507
|
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
|
-
|
|
68508
|
+
extendedInformation: `
|
|
68509
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68510
|
+
|
|
68486
68511
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68487
68512
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68488
68513
|
badExample: `method( param = 2 ).`,
|
|
@@ -68688,20 +68713,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68688
68713
|
shortDescription: `Omit RECEIVING`,
|
|
68689
68714
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68690
68715
|
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
|
|
68716
|
+
badExample: `
|
|
68717
|
+
upload_pack(
|
|
68718
|
+
EXPORTING
|
|
68719
|
+
io_client = lo_client
|
|
68720
|
+
iv_url = iv_url
|
|
68721
|
+
iv_deepen_level = iv_deepen_level
|
|
68722
|
+
it_hashes = lt_hashes
|
|
68723
|
+
RECEIVING
|
|
68699
68724
|
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
|
|
68725
|
+
goodExample: `
|
|
68726
|
+
et_objects = upload_pack(
|
|
68727
|
+
io_client = lo_client
|
|
68728
|
+
iv_url = iv_url
|
|
68729
|
+
iv_deepen_level = iv_deepen_level
|
|
68705
68730
|
it_hashes = lt_hashes ).`,
|
|
68706
68731
|
};
|
|
68707
68732
|
}
|
|
@@ -68765,8 +68790,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68765
68790
|
return {
|
|
68766
68791
|
key: "parser_702_chaining",
|
|
68767
68792
|
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.
|
|
68793
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68794
|
+
this rule finds these and reports errors.
|
|
68770
68795
|
Only active on target version 702 and below.`,
|
|
68771
68796
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68772
68797
|
};
|
|
@@ -68846,8 +68871,8 @@ class ParserError {
|
|
|
68846
68871
|
return {
|
|
68847
68872
|
key: "parser_error",
|
|
68848
68873
|
title: "Parser error",
|
|
68849
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68850
|
-
|
|
68874
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
68875
|
+
|
|
68851
68876
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
68852
68877
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68853
68878
|
};
|
|
@@ -68932,7 +68957,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
68932
68957
|
return {
|
|
68933
68958
|
key: "parser_missing_space",
|
|
68934
68959
|
title: "Parser Error, missing space",
|
|
68935
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68960
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
68936
68961
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
68937
68962
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
68938
68963
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69355,25 +69380,25 @@ class PreferInline {
|
|
|
69355
69380
|
key: "prefer_inline",
|
|
69356
69381
|
title: "Prefer Inline Declarations",
|
|
69357
69382
|
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
|
-
|
|
69383
|
+
extendedInformation: `EXPERIMENTAL
|
|
69384
|
+
|
|
69385
|
+
Activates if language version is v740sp02 or above.
|
|
69386
|
+
|
|
69387
|
+
Variables must be local(METHOD or FORM).
|
|
69388
|
+
|
|
69389
|
+
No generic or void typed variables. No syntax errors.
|
|
69390
|
+
|
|
69391
|
+
First position used must be a full/pure write.
|
|
69392
|
+
|
|
69393
|
+
Move statment is not a cast(?=)
|
|
69394
|
+
|
|
69370
69395
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69371
69396
|
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.
|
|
69397
|
+
badExample: `DATA foo TYPE i.
|
|
69398
|
+
foo = 2.
|
|
69399
|
+
DATA percentage TYPE decfloat34.
|
|
69375
69400
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69376
|
-
goodExample: `DATA(foo) = 2.
|
|
69401
|
+
goodExample: `DATA(foo) = 2.
|
|
69377
69402
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69378
69403
|
};
|
|
69379
69404
|
}
|
|
@@ -69587,18 +69612,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69587
69612
|
key: "prefer_is_not",
|
|
69588
69613
|
title: "Prefer IS NOT to NOT IS",
|
|
69589
69614
|
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
|
-
|
|
69615
|
+
extendedInformation: `
|
|
69616
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69617
|
+
|
|
69593
69618
|
"if not is_valid( )." examples are skipped`,
|
|
69594
69619
|
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.
|
|
69620
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69621
|
+
IF variable NP 'TODO*'.
|
|
69622
|
+
IF variable <> 42.
|
|
69598
69623
|
IF variable CO 'hello'.`,
|
|
69599
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69600
|
-
IF NOT variable CP 'TODO*'.
|
|
69601
|
-
IF NOT variable = 42.
|
|
69624
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69625
|
+
IF NOT variable CP 'TODO*'.
|
|
69626
|
+
IF NOT variable = 42.
|
|
69602
69627
|
IF NOT variable CA 'hello'.`,
|
|
69603
69628
|
};
|
|
69604
69629
|
}
|
|
@@ -69786,14 +69811,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69786
69811
|
key: "prefer_raise_exception_new",
|
|
69787
69812
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69788
69813
|
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
|
-
|
|
69814
|
+
extendedInformation: `
|
|
69815
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69816
|
+
|
|
69792
69817
|
From 752 and up`,
|
|
69793
69818
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69794
69819
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69795
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69796
|
-
EXPORTING
|
|
69820
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69821
|
+
EXPORTING
|
|
69797
69822
|
previous = exception.`,
|
|
69798
69823
|
};
|
|
69799
69824
|
}
|
|
@@ -69871,12 +69896,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
69871
69896
|
key: "prefer_returning_to_exporting",
|
|
69872
69897
|
title: "Prefer RETURNING to EXPORTING",
|
|
69873
69898
|
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
|
|
69899
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
69875
69900
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
69876
69901
|
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.
|
|
69902
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69903
|
+
PUBLIC SECTION.
|
|
69904
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
69880
69905
|
ENDCLASS.`,
|
|
69881
69906
|
};
|
|
69882
69907
|
}
|
|
@@ -69972,8 +69997,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
69972
69997
|
key: "prefer_xsdbool",
|
|
69973
69998
|
title: "Prefer xsdbool over boolc",
|
|
69974
69999
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
69975
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
69976
|
-
|
|
70000
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70001
|
+
|
|
69977
70002
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
69978
70003
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69979
70004
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70045,9 +70070,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70045
70070
|
title: "Preferred compare operator",
|
|
70046
70071
|
shortDescription: `Configure undesired operator variants`,
|
|
70047
70072
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70048
|
-
badExample: `IF foo EQ bar.
|
|
70073
|
+
badExample: `IF foo EQ bar.
|
|
70049
70074
|
ENDIF.`,
|
|
70050
|
-
goodExample: `IF foo = bar.
|
|
70075
|
+
goodExample: `IF foo = bar.
|
|
70051
70076
|
ENDIF.`,
|
|
70052
70077
|
};
|
|
70053
70078
|
}
|
|
@@ -70271,26 +70296,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70271
70296
|
key: "reduce_procedural_code",
|
|
70272
70297
|
title: "Reduce procedural code",
|
|
70273
70298
|
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
|
-
|
|
70299
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70300
|
+
|
|
70301
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70302
|
+
|
|
70278
70303
|
Comments are not counted as statements.`,
|
|
70279
70304
|
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.
|
|
70305
|
+
badExample: `FORM foo.
|
|
70306
|
+
DATA lv_bar TYPE i.
|
|
70307
|
+
lv_bar = 2 + 2.
|
|
70308
|
+
IF lv_bar = 4.
|
|
70309
|
+
WRITE 'hello world'.
|
|
70310
|
+
ENDIF.
|
|
70311
|
+
DATA lv_bar TYPE i.
|
|
70312
|
+
lv_bar = 2 + 2.
|
|
70313
|
+
IF lv_bar = 4.
|
|
70314
|
+
WRITE 'hello world'.
|
|
70315
|
+
ENDIF.
|
|
70291
70316
|
ENDFORM.`,
|
|
70292
|
-
goodExample: `FORM foo.
|
|
70293
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70317
|
+
goodExample: `FORM foo.
|
|
70318
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70294
70319
|
ENDFORM.`,
|
|
70295
70320
|
};
|
|
70296
70321
|
}
|
|
@@ -70534,10 +70559,10 @@ class RemoveDescriptions {
|
|
|
70534
70559
|
return {
|
|
70535
70560
|
key: "remove_descriptions",
|
|
70536
70561
|
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
|
-
|
|
70562
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70563
|
+
|
|
70564
|
+
Class descriptions are required, see rule description_empty.
|
|
70565
|
+
|
|
70541
70566
|
Consider using ABAP Doc for documentation.`,
|
|
70542
70567
|
tags: [],
|
|
70543
70568
|
};
|
|
@@ -70662,14 +70687,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70662
70687
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70663
70688
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70664
70689
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70665
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70690
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70666
70691
|
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
|
|
70692
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70693
|
+
DESTINATION lv_rfc
|
|
70694
|
+
EXCEPTIONS
|
|
70695
|
+
system_failure = 1 MESSAGE msg
|
|
70696
|
+
communication_failure = 2 MESSAGE msg
|
|
70697
|
+
resource_failure = 3
|
|
70673
70698
|
OTHERS = 4.`,
|
|
70674
70699
|
};
|
|
70675
70700
|
}
|
|
@@ -70753,11 +70778,11 @@ class SelectAddOrderBy {
|
|
|
70753
70778
|
key: "select_add_order_by",
|
|
70754
70779
|
title: "SELECT add ORDER BY",
|
|
70755
70780
|
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
|
-
|
|
70781
|
+
extendedInformation: `
|
|
70782
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70783
|
+
|
|
70784
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70785
|
+
|
|
70761
70786
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70762
70787
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70763
70788
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -70888,14 +70913,14 @@ class SelectPerformance {
|
|
|
70888
70913
|
key: "select_performance",
|
|
70889
70914
|
title: "SELECT performance",
|
|
70890
70915
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
70891
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70892
|
-
|
|
70916
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
70917
|
+
|
|
70893
70918
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
70894
70919
|
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.
|
|
70920
|
+
badExample: `SELECT field1, field2 FROM table
|
|
70921
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
70897
70922
|
ENDSELECT.`,
|
|
70898
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70923
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
70899
70924
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
70900
70925
|
};
|
|
70901
70926
|
}
|
|
@@ -71009,8 +71034,8 @@ class SelectSingleFullKey {
|
|
|
71009
71034
|
key: "select_single_full_key",
|
|
71010
71035
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71011
71036
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71012
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71013
|
-
|
|
71037
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71038
|
+
|
|
71014
71039
|
If the statement contains a JOIN it is not checked`,
|
|
71015
71040
|
pseudoComment: "EC CI_NOORDER",
|
|
71016
71041
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71434,8 +71459,8 @@ class SICFConsistency {
|
|
|
71434
71459
|
key: "sicf_consistency",
|
|
71435
71460
|
title: "SICF consistency",
|
|
71436
71461
|
shortDescription: `Checks the validity of ICF services`,
|
|
71437
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71438
|
-
* Class must not have any syntax errors
|
|
71462
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71463
|
+
* Class must not have any syntax errors
|
|
71439
71464
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71440
71465
|
};
|
|
71441
71466
|
}
|
|
@@ -71547,23 +71572,23 @@ class SlowParameterPassing {
|
|
|
71547
71572
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71548
71573
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71549
71574
|
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.
|
|
71575
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71576
|
+
PUBLIC SECTION.
|
|
71577
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71578
|
+
ENDCLASS.
|
|
71579
|
+
CLASS lcl IMPLEMENTATION.
|
|
71580
|
+
METHOD bar.
|
|
71581
|
+
WRITE sdf.
|
|
71582
|
+
ENDMETHOD.
|
|
71558
71583
|
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.
|
|
71584
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71585
|
+
PUBLIC SECTION.
|
|
71586
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71587
|
+
ENDCLASS.
|
|
71588
|
+
CLASS lcl IMPLEMENTATION.
|
|
71589
|
+
METHOD bar.
|
|
71590
|
+
WRITE sdf.
|
|
71591
|
+
ENDMETHOD.
|
|
71567
71592
|
ENDCLASS.`,
|
|
71568
71593
|
};
|
|
71569
71594
|
}
|
|
@@ -71820,8 +71845,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71820
71845
|
key: "space_before_dot",
|
|
71821
71846
|
title: "Space before dot",
|
|
71822
71847
|
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
|
|
71848
|
+
extendedInformation: `
|
|
71849
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71825
71850
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71826
71851
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71827
71852
|
badExample: `WRITE bar .`,
|
|
@@ -72007,12 +72032,12 @@ class SQLValueConversion {
|
|
|
72007
72032
|
key: "sql_value_conversion",
|
|
72008
72033
|
title: "Implicit SQL Value Conversion",
|
|
72009
72034
|
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
|
|
72035
|
+
extendedInformation: `
|
|
72036
|
+
* Integer to CHAR conversion
|
|
72037
|
+
* Integer to NUMC conversion
|
|
72038
|
+
* NUMC to Integer conversion
|
|
72039
|
+
* CHAR to Integer conversion
|
|
72040
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72016
72041
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72017
72042
|
tags: [],
|
|
72018
72043
|
};
|
|
@@ -72084,7 +72109,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72084
72109
|
key: "start_at_tab",
|
|
72085
72110
|
title: "Start at tab",
|
|
72086
72111
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72087
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72112
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72088
72113
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72089
72114
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72090
72115
|
badExample: ` WRITE a.`,
|
|
@@ -72261,12 +72286,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72261
72286
|
key: "strict_sql",
|
|
72262
72287
|
title: "Strict SQL",
|
|
72263
72288
|
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
|
-
|
|
72289
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72290
|
+
|
|
72291
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72292
|
+
|
|
72293
|
+
Also see separate rule sql_escape_host_variables
|
|
72294
|
+
|
|
72270
72295
|
Activates from v750 and up`,
|
|
72271
72296
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72272
72297
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72520,11 +72545,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72520
72545
|
key: "sy_modification",
|
|
72521
72546
|
title: "Modification of SY fields",
|
|
72522
72547
|
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
|
-
|
|
72548
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72549
|
+
|
|
72525
72550
|
Changes to SY-TVAR* fields are not reported`,
|
|
72526
72551
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72527
|
-
badExample: `sy-uname = 2.
|
|
72552
|
+
badExample: `sy-uname = 2.
|
|
72528
72553
|
sy = sy.`,
|
|
72529
72554
|
};
|
|
72530
72555
|
}
|
|
@@ -72586,8 +72611,8 @@ class TABLEnhancementCategory {
|
|
|
72586
72611
|
key: "tabl_enhancement_category",
|
|
72587
72612
|
title: "TABL enhancement category must be set",
|
|
72588
72613
|
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
|
-
|
|
72614
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72615
|
+
|
|
72591
72616
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72592
72617
|
tags: [],
|
|
72593
72618
|
};
|
|
@@ -72652,8 +72677,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72652
72677
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72653
72678
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72654
72679
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72655
|
-
badExample: `FORM foo.
|
|
72656
|
-
TABLES t100.
|
|
72680
|
+
badExample: `FORM foo.
|
|
72681
|
+
TABLES t100.
|
|
72657
72682
|
ENDFORM.`,
|
|
72658
72683
|
goodExample: `TABLES t000.`,
|
|
72659
72684
|
};
|
|
@@ -72781,9 +72806,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72781
72806
|
title: "Type FORM parameters",
|
|
72782
72807
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72783
72808
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72784
|
-
badExample: `FORM foo USING bar.
|
|
72809
|
+
badExample: `FORM foo USING bar.
|
|
72785
72810
|
ENDFORM.`,
|
|
72786
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72811
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72787
72812
|
ENDFORM.`,
|
|
72788
72813
|
};
|
|
72789
72814
|
}
|
|
@@ -73456,38 +73481,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73456
73481
|
key: "unnecessary_pragma",
|
|
73457
73482
|
title: "Unnecessary Pragma",
|
|
73458
73483
|
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
|
-
|
|
73484
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73485
|
+
|
|
73486
|
+
* NEEDED without definition
|
|
73487
|
+
|
|
73488
|
+
* NO_TEXT without texts
|
|
73489
|
+
|
|
73490
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73491
|
+
|
|
73467
73492
|
NO_HANDLER inside macros are not checked`,
|
|
73468
73493
|
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.
|
|
73494
|
+
badExample: `TRY.
|
|
73495
|
+
...
|
|
73496
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73497
|
+
RETURN. " it has a handler
|
|
73498
|
+
ENDTRY.
|
|
73499
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73500
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73501
|
+
IF sy-subrc <> 0.
|
|
73477
73502
|
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,
|
|
73503
|
+
goodExample: `TRY.
|
|
73504
|
+
...
|
|
73505
|
+
CATCH zcx_abapgit_exception.
|
|
73506
|
+
RETURN.
|
|
73507
|
+
ENDTRY.
|
|
73508
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73509
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73510
|
+
IF sy-subrc <> 0.
|
|
73511
|
+
ENDIF.
|
|
73512
|
+
|
|
73513
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73514
|
+
test1 TYPE string,
|
|
73515
|
+
test2 TYPE string,
|
|
73491
73516
|
END OF blah.`,
|
|
73492
73517
|
};
|
|
73493
73518
|
}
|
|
@@ -73654,18 +73679,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73654
73679
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73655
73680
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73656
73681
|
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.
|
|
73682
|
+
badExample: `FORM hello1.
|
|
73683
|
+
WRITE 'world'.
|
|
73684
|
+
RETURN.
|
|
73685
|
+
ENDFORM.
|
|
73686
|
+
|
|
73687
|
+
FORM foo.
|
|
73688
|
+
IF 1 = 2.
|
|
73689
|
+
RETURN.
|
|
73690
|
+
ENDIF.
|
|
73666
73691
|
ENDFORM.`,
|
|
73667
|
-
goodExample: `FORM hello2.
|
|
73668
|
-
WRITE 'world'.
|
|
73692
|
+
goodExample: `FORM hello2.
|
|
73693
|
+
WRITE 'world'.
|
|
73669
73694
|
ENDFORM.`,
|
|
73670
73695
|
};
|
|
73671
73696
|
}
|
|
@@ -74016,13 +74041,13 @@ class UnusedMacros {
|
|
|
74016
74041
|
title: "Unused macros",
|
|
74017
74042
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74018
74043
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74019
|
-
badExample: `DEFINE foobar1.
|
|
74020
|
-
WRITE 'hello'.
|
|
74044
|
+
badExample: `DEFINE foobar1.
|
|
74045
|
+
WRITE 'hello'.
|
|
74021
74046
|
END-OF-DEFINITION.`,
|
|
74022
|
-
goodExample: `DEFINE foobar2.
|
|
74023
|
-
WRITE 'hello'.
|
|
74024
|
-
END-OF-DEFINITION.
|
|
74025
|
-
|
|
74047
|
+
goodExample: `DEFINE foobar2.
|
|
74048
|
+
WRITE 'hello'.
|
|
74049
|
+
END-OF-DEFINITION.
|
|
74050
|
+
|
|
74026
74051
|
foobar2.`,
|
|
74027
74052
|
};
|
|
74028
74053
|
}
|
|
@@ -74134,18 +74159,18 @@ class UnusedMethods {
|
|
|
74134
74159
|
key: "unused_methods",
|
|
74135
74160
|
title: "Unused methods",
|
|
74136
74161
|
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
|
|
74162
|
+
extendedInformation: `Checks private and protected methods.
|
|
74163
|
+
|
|
74164
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74165
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74166
|
+
|
|
74167
|
+
Skips:
|
|
74168
|
+
* methods FOR TESTING
|
|
74169
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74170
|
+
* class_constructor + constructor methods
|
|
74171
|
+
* event handlers
|
|
74172
|
+
* methods that are redefined
|
|
74173
|
+
* INCLUDEs
|
|
74149
74174
|
`,
|
|
74150
74175
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74151
74176
|
pragma: "##CALLED",
|
|
@@ -74621,23 +74646,23 @@ class UnusedVariables {
|
|
|
74621
74646
|
key: "unused_variables",
|
|
74622
74647
|
title: "Unused variables",
|
|
74623
74648
|
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
|
-
|
|
74649
|
+
extendedInformation: `Skips event parameters.
|
|
74650
|
+
|
|
74651
|
+
Note that this currently does not work if the source code uses macros.
|
|
74652
|
+
|
|
74653
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74654
|
+
|
|
74630
74655
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74631
74656
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74632
74657
|
pragma: "##NEEDED",
|
|
74633
74658
|
pseudoComment: "EC NEEDED",
|
|
74634
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74635
|
-
test TYPE string,
|
|
74636
|
-
test2 TYPE string,
|
|
74659
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74660
|
+
test TYPE string,
|
|
74661
|
+
test2 TYPE string,
|
|
74637
74662
|
END OF blah1.`,
|
|
74638
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74639
|
-
test TYPE string,
|
|
74640
|
-
test2 TYPE string,
|
|
74663
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74664
|
+
test TYPE string,
|
|
74665
|
+
test2 TYPE string,
|
|
74641
74666
|
END OF blah2.`,
|
|
74642
74667
|
};
|
|
74643
74668
|
}
|
|
@@ -74856,15 +74881,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
74856
74881
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
74857
74882
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
74858
74883
|
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
|
-
|
|
74884
|
+
badExample: `IF line IS INITIAL.
|
|
74885
|
+
has_entries = abap_false.
|
|
74886
|
+
ELSE.
|
|
74887
|
+
has_entries = abap_true.
|
|
74888
|
+
ENDIF.
|
|
74889
|
+
|
|
74865
74890
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
74866
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74867
|
-
|
|
74891
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
74892
|
+
|
|
74868
74893
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
74869
74894
|
};
|
|
74870
74895
|
}
|
|
@@ -74982,15 +75007,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
74982
75007
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
74983
75008
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
74984
75009
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74985
|
-
badExample: `INTERFACE lif.
|
|
74986
|
-
METHODS load_data
|
|
74987
|
-
EXCEPTIONS
|
|
74988
|
-
invalid_parameter.
|
|
75010
|
+
badExample: `INTERFACE lif.
|
|
75011
|
+
METHODS load_data
|
|
75012
|
+
EXCEPTIONS
|
|
75013
|
+
invalid_parameter.
|
|
74989
75014
|
ENDINTERFACE.`,
|
|
74990
|
-
goodExample: `INTERFACE lif.
|
|
74991
|
-
METHODS load_data
|
|
74992
|
-
RAISING
|
|
74993
|
-
cx_something.
|
|
75015
|
+
goodExample: `INTERFACE lif.
|
|
75016
|
+
METHODS load_data
|
|
75017
|
+
RAISING
|
|
75018
|
+
cx_something.
|
|
74994
75019
|
ENDINTERFACE.`,
|
|
74995
75020
|
};
|
|
74996
75021
|
}
|
|
@@ -75050,15 +75075,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75050
75075
|
key: "use_line_exists",
|
|
75051
75076
|
title: "Use line_exists",
|
|
75052
75077
|
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
|
-
|
|
75078
|
+
extendedInformation: `
|
|
75079
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75080
|
+
|
|
75056
75081
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75057
75082
|
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.
|
|
75083
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75084
|
+
IF sy-subrc = 0.
|
|
75060
75085
|
ENDIF.`,
|
|
75061
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75086
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75062
75087
|
ENDIF.`,
|
|
75063
75088
|
};
|
|
75064
75089
|
}
|
|
@@ -75168,10 +75193,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75168
75193
|
key: "use_new",
|
|
75169
75194
|
title: "Use NEW",
|
|
75170
75195
|
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
|
-
|
|
75196
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75197
|
+
|
|
75198
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75199
|
+
|
|
75175
75200
|
Applicable from v740sp02 and up`,
|
|
75176
75201
|
badExample: `CREATE OBJECT ref.`,
|
|
75177
75202
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75269,13 +75294,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75269
75294
|
title: "WHEN OTHERS last",
|
|
75270
75295
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75271
75296
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75272
|
-
badExample: `CASE bar.
|
|
75273
|
-
WHEN OTHERS.
|
|
75274
|
-
WHEN 2.
|
|
75297
|
+
badExample: `CASE bar.
|
|
75298
|
+
WHEN OTHERS.
|
|
75299
|
+
WHEN 2.
|
|
75275
75300
|
ENDCASE.`,
|
|
75276
|
-
goodExample: `CASE bar.
|
|
75277
|
-
WHEN 2.
|
|
75278
|
-
WHEN OTHERS.
|
|
75301
|
+
goodExample: `CASE bar.
|
|
75302
|
+
WHEN 2.
|
|
75303
|
+
WHEN OTHERS.
|
|
75279
75304
|
ENDCASE.`,
|
|
75280
75305
|
};
|
|
75281
75306
|
}
|