@abaplint/cli 2.105.16 → 2.105.17
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 +765 -698
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -7196,7 +7196,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
|
|
|
7196
7196
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
7197
7197
|
class RaiseWith extends combi_1.Expression {
|
|
7198
7198
|
getRunnable() {
|
|
7199
|
-
const wit = (0, combi_1.seq)("WITH", _1.
|
|
7199
|
+
const wit = (0, combi_1.seq)("WITH", _1.SimpleSource3, (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3), (0, combi_1.opt)(_1.SimpleSource3));
|
|
7200
7200
|
return wit;
|
|
7201
7201
|
}
|
|
7202
7202
|
}
|
|
@@ -26283,7 +26283,7 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
|
|
|
26283
26283
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
26284
26284
|
class RaiseWith {
|
|
26285
26285
|
runSyntax(node, scope, filename) {
|
|
26286
|
-
for (const f of node.findDirectExpressions(Expressions.
|
|
26286
|
+
for (const f of node.findDirectExpressions(Expressions.SimpleSource3)) {
|
|
26287
26287
|
new source_1.Source().runSyntax(f, scope, filename);
|
|
26288
26288
|
}
|
|
26289
26289
|
}
|
|
@@ -30959,13 +30959,33 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_module
|
|
|
30959
30959
|
const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js");
|
|
30960
30960
|
const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
|
|
30961
30961
|
const component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js");
|
|
30962
|
+
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
30962
30963
|
class ModifyInternal {
|
|
30963
30964
|
runSyntax(node, scope, filename) {
|
|
30964
30965
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
30965
30966
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
30966
30967
|
}
|
|
30967
|
-
|
|
30968
|
-
|
|
30968
|
+
// there is only one
|
|
30969
|
+
const targetExpression = node.findFirstExpression(Expressions.Target);
|
|
30970
|
+
if (targetExpression) {
|
|
30971
|
+
// it might be a dynamic target
|
|
30972
|
+
const targetType = new target_1.Target().runSyntax(targetExpression, scope, filename);
|
|
30973
|
+
if (targetType instanceof basic_1.VoidType
|
|
30974
|
+
|| targetType instanceof basic_1.AnyType
|
|
30975
|
+
|| targetType instanceof basic_1.UnknownType) {
|
|
30976
|
+
// ok
|
|
30977
|
+
}
|
|
30978
|
+
else if (targetType instanceof basic_1.TableType) {
|
|
30979
|
+
if (node.findDirectTokenByText("TABLE")
|
|
30980
|
+
&& node.findDirectTokenByText("INDEX")
|
|
30981
|
+
&& targetType.isWithHeader() === false) {
|
|
30982
|
+
// MODIFY TABLE INDEX
|
|
30983
|
+
throw new Error("Table does not have header line");
|
|
30984
|
+
}
|
|
30985
|
+
}
|
|
30986
|
+
else {
|
|
30987
|
+
throw new Error("Not an internal table");
|
|
30988
|
+
}
|
|
30969
30989
|
}
|
|
30970
30990
|
const target = node.findDirectExpression(Expressions.FSTarget);
|
|
30971
30991
|
if (target) {
|
|
@@ -31203,6 +31223,9 @@ class Parameter {
|
|
|
31203
31223
|
if (nameToken && nameToken.getStr().length > 8) {
|
|
31204
31224
|
throw new Error("Parameter name too long, " + nameToken.getStr());
|
|
31205
31225
|
}
|
|
31226
|
+
if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
|
|
31227
|
+
throw new Error("RADIOBUTTON and LENGTH not possible together");
|
|
31228
|
+
}
|
|
31206
31229
|
const bfound = new basic_types_1.BasicTypes(filename, scope).parseType(node);
|
|
31207
31230
|
if (nameToken && bfound) {
|
|
31208
31231
|
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, bfound));
|
|
@@ -34146,13 +34169,13 @@ class FlowGraph {
|
|
|
34146
34169
|
this.label = label;
|
|
34147
34170
|
}
|
|
34148
34171
|
toDigraph() {
|
|
34149
|
-
return `digraph G {
|
|
34150
|
-
labelloc="t";
|
|
34151
|
-
label="${this.label}";
|
|
34152
|
-
graph [fontname = "helvetica"];
|
|
34153
|
-
node [fontname = "helvetica", shape="box"];
|
|
34154
|
-
edge [fontname = "helvetica"];
|
|
34155
|
-
${this.toTextEdges()}
|
|
34172
|
+
return `digraph G {
|
|
34173
|
+
labelloc="t";
|
|
34174
|
+
label="${this.label}";
|
|
34175
|
+
graph [fontname = "helvetica"];
|
|
34176
|
+
node [fontname = "helvetica", shape="box"];
|
|
34177
|
+
edge [fontname = "helvetica"];
|
|
34178
|
+
${this.toTextEdges()}
|
|
34156
34179
|
}`;
|
|
34157
34180
|
}
|
|
34158
34181
|
listSources(node) {
|
|
@@ -34519,6 +34542,32 @@ class ExpressionNode extends _abstract_node_1.AbstractNode {
|
|
|
34519
34542
|
}
|
|
34520
34543
|
throw new Error("ExpressionNode, getFirstToken, no children");
|
|
34521
34544
|
}
|
|
34545
|
+
concatTokensWithLinebreaks() {
|
|
34546
|
+
let str = "";
|
|
34547
|
+
let prev;
|
|
34548
|
+
for (const token of this.getTokens()) {
|
|
34549
|
+
if (token instanceof tokens_1.Pragma) {
|
|
34550
|
+
continue;
|
|
34551
|
+
}
|
|
34552
|
+
if (str === "") {
|
|
34553
|
+
str = token.getStr();
|
|
34554
|
+
}
|
|
34555
|
+
else if (prev && prev.getStr().length + prev.getCol() === token.getCol()
|
|
34556
|
+
&& prev.getRow() === token.getRow()) {
|
|
34557
|
+
str = str + token.getStr();
|
|
34558
|
+
}
|
|
34559
|
+
else {
|
|
34560
|
+
if (prev && prev.getRow() !== token.getRow()) {
|
|
34561
|
+
str = str + "\n" + token.getStr();
|
|
34562
|
+
}
|
|
34563
|
+
else {
|
|
34564
|
+
str = str + " " + token.getStr();
|
|
34565
|
+
}
|
|
34566
|
+
}
|
|
34567
|
+
prev = token;
|
|
34568
|
+
}
|
|
34569
|
+
return str;
|
|
34570
|
+
}
|
|
34522
34571
|
concatTokens() {
|
|
34523
34572
|
let str = "";
|
|
34524
34573
|
let prev;
|
|
@@ -42164,13 +42213,13 @@ class Help {
|
|
|
42164
42213
|
/////////////////////////////////////////////////
|
|
42165
42214
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42166
42215
|
let content = "";
|
|
42167
|
-
content = `
|
|
42168
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42169
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42170
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42171
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42172
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42173
|
-
<hr>
|
|
42216
|
+
content = `
|
|
42217
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42218
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42219
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42220
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42221
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42222
|
+
<hr>
|
|
42174
42223
|
` +
|
|
42175
42224
|
"<tt>" + textDocument.uri + " (" +
|
|
42176
42225
|
(position.line + 1) + ", " +
|
|
@@ -51167,7 +51216,7 @@ class Registry {
|
|
|
51167
51216
|
}
|
|
51168
51217
|
static abaplintVersion() {
|
|
51169
51218
|
// magic, see build script "version.sh"
|
|
51170
|
-
return "2.105.
|
|
51219
|
+
return "2.105.17";
|
|
51171
51220
|
}
|
|
51172
51221
|
getDDICReferences() {
|
|
51173
51222
|
return this.ddicReferences;
|
|
@@ -51483,10 +51532,10 @@ class SevenBitAscii {
|
|
|
51483
51532
|
key: "7bit_ascii",
|
|
51484
51533
|
title: "Check for 7bit ascii",
|
|
51485
51534
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
51486
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51487
|
-
|
|
51488
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51489
|
-
|
|
51535
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51536
|
+
|
|
51537
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51538
|
+
|
|
51490
51539
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
51491
51540
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
51492
51541
|
};
|
|
@@ -51690,10 +51739,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
51690
51739
|
key: "abapdoc",
|
|
51691
51740
|
title: "Check abapdoc",
|
|
51692
51741
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
51693
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
51694
|
-
|
|
51695
|
-
Plus class and interface definitions.
|
|
51696
|
-
|
|
51742
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
51743
|
+
|
|
51744
|
+
Plus class and interface definitions.
|
|
51745
|
+
|
|
51697
51746
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
51698
51747
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
51699
51748
|
};
|
|
@@ -51831,49 +51880,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
51831
51880
|
key: "align_parameters",
|
|
51832
51881
|
title: "Align Parameters",
|
|
51833
51882
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
51834
|
-
extendedInformation: `Checks:
|
|
51835
|
-
* function module calls
|
|
51836
|
-
* method calls
|
|
51837
|
-
* VALUE constructors
|
|
51838
|
-
* NEW constructors
|
|
51839
|
-
* RAISE EXCEPTION statements
|
|
51840
|
-
* CREATE OBJECT statements
|
|
51841
|
-
* RAISE EVENT statements
|
|
51842
|
-
|
|
51843
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
51844
|
-
|
|
51845
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
51846
|
-
|
|
51847
|
-
If parameters are on the same row, no issues are reported, see
|
|
51883
|
+
extendedInformation: `Checks:
|
|
51884
|
+
* function module calls
|
|
51885
|
+
* method calls
|
|
51886
|
+
* VALUE constructors
|
|
51887
|
+
* NEW constructors
|
|
51888
|
+
* RAISE EXCEPTION statements
|
|
51889
|
+
* CREATE OBJECT statements
|
|
51890
|
+
* RAISE EVENT statements
|
|
51891
|
+
|
|
51892
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
51893
|
+
|
|
51894
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
51895
|
+
|
|
51896
|
+
If parameters are on the same row, no issues are reported, see
|
|
51848
51897
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
51849
51898
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
51850
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
51851
|
-
EXPORTING
|
|
51852
|
-
foo = 2
|
|
51853
|
-
parameter = 3.
|
|
51854
|
-
|
|
51855
|
-
foobar( moo = 1
|
|
51856
|
-
param = 1 ).
|
|
51857
|
-
|
|
51858
|
-
foo = VALUE #(
|
|
51859
|
-
foo = bar
|
|
51899
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
51900
|
+
EXPORTING
|
|
51901
|
+
foo = 2
|
|
51902
|
+
parameter = 3.
|
|
51903
|
+
|
|
51904
|
+
foobar( moo = 1
|
|
51905
|
+
param = 1 ).
|
|
51906
|
+
|
|
51907
|
+
foo = VALUE #(
|
|
51908
|
+
foo = bar
|
|
51860
51909
|
moo = 2 ).`,
|
|
51861
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
51862
|
-
EXPORTING
|
|
51863
|
-
foo = 2
|
|
51864
|
-
parameter = 3.
|
|
51865
|
-
|
|
51866
|
-
foobar( moo = 1
|
|
51867
|
-
param = 1 ).
|
|
51868
|
-
|
|
51869
|
-
foo = VALUE #(
|
|
51870
|
-
foo = bar
|
|
51871
|
-
moo = 2 ).
|
|
51872
|
-
|
|
51873
|
-
DATA(sdf) = VALUE type(
|
|
51874
|
-
common_val = 2
|
|
51875
|
-
another_common = 5
|
|
51876
|
-
( row_value = 4
|
|
51910
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
51911
|
+
EXPORTING
|
|
51912
|
+
foo = 2
|
|
51913
|
+
parameter = 3.
|
|
51914
|
+
|
|
51915
|
+
foobar( moo = 1
|
|
51916
|
+
param = 1 ).
|
|
51917
|
+
|
|
51918
|
+
foo = VALUE #(
|
|
51919
|
+
foo = bar
|
|
51920
|
+
moo = 2 ).
|
|
51921
|
+
|
|
51922
|
+
DATA(sdf) = VALUE type(
|
|
51923
|
+
common_val = 2
|
|
51924
|
+
another_common = 5
|
|
51925
|
+
( row_value = 4
|
|
51877
51926
|
value_foo = 5 ) ).`,
|
|
51878
51927
|
};
|
|
51879
51928
|
}
|
|
@@ -52349,15 +52398,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
52349
52398
|
return {
|
|
52350
52399
|
key: "ambiguous_statement",
|
|
52351
52400
|
title: "Check for ambigious statements",
|
|
52352
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52353
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52354
|
-
|
|
52401
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52402
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52403
|
+
|
|
52355
52404
|
Only works if the target version is 740sp05 or above`,
|
|
52356
52405
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52357
|
-
badExample: `DELETE foo FROM bar.
|
|
52406
|
+
badExample: `DELETE foo FROM bar.
|
|
52358
52407
|
MODIFY foo FROM bar.`,
|
|
52359
|
-
goodExample: `DELETE foo FROM @bar.
|
|
52360
|
-
MODIFY TABLE foo FROM bar.
|
|
52408
|
+
goodExample: `DELETE foo FROM @bar.
|
|
52409
|
+
MODIFY TABLE foo FROM bar.
|
|
52361
52410
|
MODIFY zfoo FROM @wa.`,
|
|
52362
52411
|
};
|
|
52363
52412
|
}
|
|
@@ -52427,6 +52476,7 @@ const expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions *
|
|
|
52427
52476
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
52428
52477
|
const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
52429
52478
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
52479
|
+
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
52430
52480
|
class AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
52431
52481
|
constructor() {
|
|
52432
52482
|
super(...arguments);
|
|
@@ -52436,11 +52486,11 @@ class AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
52436
52486
|
this.define = true;
|
|
52437
52487
|
/** Detects statics */
|
|
52438
52488
|
this.statics = true;
|
|
52439
|
-
/** Detects DEFAULT KEY definitions, from version v740sp02 and up */
|
|
52489
|
+
/** Detects DEFAULT KEY definitions, from version v740sp02 and up. Use pseudo comment DEFAULT_KEY to ignore */
|
|
52440
52490
|
this.defaultKey = true;
|
|
52441
52491
|
/** Detects BREAK and BREAK-POINTS */
|
|
52442
52492
|
this.break = true;
|
|
52443
|
-
/** Detects TEST SEAMS */
|
|
52493
|
+
/** Detects TEST SEAMS. Use pseudo comment TEST_SEAM_USAGE to ignore */
|
|
52444
52494
|
this.testSeams = true;
|
|
52445
52495
|
/** Detects DESCRIBE TABLE LINES, use lines() instead */
|
|
52446
52496
|
this.describeLines = true;
|
|
@@ -52461,16 +52511,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
52461
52511
|
key: "avoid_use",
|
|
52462
52512
|
title: "Avoid use of certain statements",
|
|
52463
52513
|
shortDescription: `Detects usage of certain statements.`,
|
|
52464
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
52465
|
-
|
|
52466
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
52467
|
-
|
|
52468
|
-
STATICS: use CLASS-DATA instead
|
|
52469
|
-
|
|
52470
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
52471
|
-
|
|
52472
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
52473
|
-
|
|
52514
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
52515
|
+
|
|
52516
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
52517
|
+
|
|
52518
|
+
STATICS: use CLASS-DATA instead
|
|
52519
|
+
|
|
52520
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
52521
|
+
|
|
52522
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
52523
|
+
|
|
52474
52524
|
BREAK points`,
|
|
52475
52525
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
52476
52526
|
};
|
|
@@ -52488,7 +52538,9 @@ BREAK points`,
|
|
|
52488
52538
|
var _a;
|
|
52489
52539
|
const issues = [];
|
|
52490
52540
|
let isStaticsBlock = false;
|
|
52491
|
-
|
|
52541
|
+
const statements = file.getStatements();
|
|
52542
|
+
for (let i = 0; i < statements.length; i++) {
|
|
52543
|
+
const statementNode = statements[i];
|
|
52492
52544
|
const statement = statementNode.get();
|
|
52493
52545
|
let message = undefined;
|
|
52494
52546
|
let fix = undefined;
|
|
@@ -52516,6 +52568,10 @@ BREAK points`,
|
|
|
52516
52568
|
message = "EXPORT TO DATABASE";
|
|
52517
52569
|
}
|
|
52518
52570
|
else if (this.conf.testSeams && statement instanceof Statements.TestSeam) {
|
|
52571
|
+
const next = statements[i + 1];
|
|
52572
|
+
if ((next === null || next === void 0 ? void 0 : next.get()) instanceof _statement_1.Comment && next.concatTokens().includes("EC TEST_SEAM_USAGE")) {
|
|
52573
|
+
continue;
|
|
52574
|
+
}
|
|
52519
52575
|
message = "TEST-SEAM";
|
|
52520
52576
|
}
|
|
52521
52577
|
else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {
|
|
@@ -52535,6 +52591,10 @@ BREAK points`,
|
|
|
52535
52591
|
const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);
|
|
52536
52592
|
const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText("DEFAULT");
|
|
52537
52593
|
if (tt && token) {
|
|
52594
|
+
const next = statements[i + 1];
|
|
52595
|
+
if ((next === null || next === void 0 ? void 0 : next.get()) instanceof _statement_1.Comment && next.concatTokens().includes("EC DEFAULT_KEY")) {
|
|
52596
|
+
continue;
|
|
52597
|
+
}
|
|
52538
52598
|
message = "DEFAULT KEY";
|
|
52539
52599
|
issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));
|
|
52540
52600
|
}
|
|
@@ -52591,11 +52651,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
52591
52651
|
title: "Check BEGIN END names",
|
|
52592
52652
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
52593
52653
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
52594
|
-
badExample: `DATA: BEGIN OF stru,
|
|
52595
|
-
field TYPE i,
|
|
52654
|
+
badExample: `DATA: BEGIN OF stru,
|
|
52655
|
+
field TYPE i,
|
|
52596
52656
|
END OF structure_not_the_same.`,
|
|
52597
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
52598
|
-
field TYPE i,
|
|
52657
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
52658
|
+
field TYPE i,
|
|
52599
52659
|
END OF stru.`,
|
|
52600
52660
|
};
|
|
52601
52661
|
}
|
|
@@ -52688,19 +52748,19 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
52688
52748
|
title: "BEGIN contains single INCLUDE",
|
|
52689
52749
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
52690
52750
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52691
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
52692
|
-
INCLUDE TYPE dselc.
|
|
52693
|
-
TYPES: END OF dummy1.
|
|
52694
|
-
|
|
52695
|
-
DATA BEGIN OF foo.
|
|
52696
|
-
INCLUDE STRUCTURE syst.
|
|
52697
|
-
DATA END OF foo.
|
|
52698
|
-
|
|
52699
|
-
STATICS BEGIN OF bar.
|
|
52700
|
-
INCLUDE STRUCTURE syst.
|
|
52751
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
52752
|
+
INCLUDE TYPE dselc.
|
|
52753
|
+
TYPES: END OF dummy1.
|
|
52754
|
+
|
|
52755
|
+
DATA BEGIN OF foo.
|
|
52756
|
+
INCLUDE STRUCTURE syst.
|
|
52757
|
+
DATA END OF foo.
|
|
52758
|
+
|
|
52759
|
+
STATICS BEGIN OF bar.
|
|
52760
|
+
INCLUDE STRUCTURE syst.
|
|
52701
52761
|
STATICS END OF bar.`,
|
|
52702
|
-
goodExample: `DATA BEGIN OF foo.
|
|
52703
|
-
INCLUDE STRUCTURE dselc.
|
|
52762
|
+
goodExample: `DATA BEGIN OF foo.
|
|
52763
|
+
INCLUDE STRUCTURE dselc.
|
|
52704
52764
|
DATA END OF foo.`,
|
|
52705
52765
|
};
|
|
52706
52766
|
}
|
|
@@ -52790,9 +52850,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
52790
52850
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
52791
52851
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
52792
52852
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
52793
|
-
goodExample: `TRY.
|
|
52794
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
52795
|
-
CATCH cx_sy_authorization_error.
|
|
52853
|
+
goodExample: `TRY.
|
|
52854
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
52855
|
+
CATCH cx_sy_authorization_error.
|
|
52796
52856
|
ENDTRY.`,
|
|
52797
52857
|
};
|
|
52798
52858
|
}
|
|
@@ -52857,10 +52917,10 @@ class CDSCommentStyle {
|
|
|
52857
52917
|
key: "cds_comment_style",
|
|
52858
52918
|
title: "CDS Comment Style",
|
|
52859
52919
|
shortDescription: `Check for obsolete comment style`,
|
|
52860
|
-
extendedInformation: `Check for obsolete comment style
|
|
52861
|
-
|
|
52862
|
-
Comments starting with "--" are considered obsolete
|
|
52863
|
-
|
|
52920
|
+
extendedInformation: `Check for obsolete comment style
|
|
52921
|
+
|
|
52922
|
+
Comments starting with "--" are considered obsolete
|
|
52923
|
+
|
|
52864
52924
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
52865
52925
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52866
52926
|
badExample: "-- this is a comment",
|
|
@@ -52927,10 +52987,10 @@ class CDSLegacyView {
|
|
|
52927
52987
|
title: "CDS Legacy View",
|
|
52928
52988
|
shortDescription: `Identify CDS Legacy Views`,
|
|
52929
52989
|
// eslint-disable-next-line max-len
|
|
52930
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
52931
|
-
|
|
52932
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
52933
|
-
|
|
52990
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
52991
|
+
|
|
52992
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
52993
|
+
|
|
52934
52994
|
v755 and up`,
|
|
52935
52995
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
52936
52996
|
};
|
|
@@ -53085,10 +53145,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53085
53145
|
key: "chain_mainly_declarations",
|
|
53086
53146
|
title: "Chain mainly declarations",
|
|
53087
53147
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53088
|
-
extendedInformation: `
|
|
53089
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53090
|
-
|
|
53091
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53148
|
+
extendedInformation: `
|
|
53149
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53150
|
+
|
|
53151
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53092
53152
|
`,
|
|
53093
53153
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53094
53154
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -53264,17 +53324,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
53264
53324
|
title: "Change IF to CASE",
|
|
53265
53325
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
53266
53326
|
// eslint-disable-next-line max-len
|
|
53267
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53268
|
-
|
|
53327
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53328
|
+
|
|
53269
53329
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
53270
53330
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53271
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53272
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53273
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
53331
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53332
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53333
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
53274
53334
|
ENDIF.`,
|
|
53275
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
53276
|
-
WHEN 'FOO'.
|
|
53277
|
-
WHEN 'BAR' OR 'MOO'.
|
|
53335
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
53336
|
+
WHEN 'FOO'.
|
|
53337
|
+
WHEN 'BAR' OR 'MOO'.
|
|
53278
53338
|
ENDCASE.`,
|
|
53279
53339
|
};
|
|
53280
53340
|
}
|
|
@@ -53411,8 +53471,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
53411
53471
|
return {
|
|
53412
53472
|
key: "check_abstract",
|
|
53413
53473
|
title: "Check abstract methods and classes",
|
|
53414
|
-
shortDescription: `Checks abstract methods and classes:
|
|
53415
|
-
- class defined as abstract and final,
|
|
53474
|
+
shortDescription: `Checks abstract methods and classes:
|
|
53475
|
+
- class defined as abstract and final,
|
|
53416
53476
|
- non-abstract class contains abstract methods`,
|
|
53417
53477
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
53418
53478
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -53493,11 +53553,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
53493
53553
|
return {
|
|
53494
53554
|
key: "check_comments",
|
|
53495
53555
|
title: "Check Comments",
|
|
53496
|
-
shortDescription: `
|
|
53556
|
+
shortDescription: `
|
|
53497
53557
|
Various checks for comment usage.`,
|
|
53498
|
-
extendedInformation: `
|
|
53499
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
53500
|
-
|
|
53558
|
+
extendedInformation: `
|
|
53559
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
53560
|
+
|
|
53501
53561
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
53502
53562
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53503
53563
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -53659,9 +53719,9 @@ class CheckInclude {
|
|
|
53659
53719
|
key: "check_include",
|
|
53660
53720
|
title: "Check INCLUDEs",
|
|
53661
53721
|
shortDescription: `Checks INCLUDE statements`,
|
|
53662
|
-
extendedInformation: `
|
|
53663
|
-
* Reports unused includes
|
|
53664
|
-
* Errors if the includes are not found
|
|
53722
|
+
extendedInformation: `
|
|
53723
|
+
* Reports unused includes
|
|
53724
|
+
* Errors if the includes are not found
|
|
53665
53725
|
* Error if including a main program`,
|
|
53666
53726
|
tags: [_irule_1.RuleTag.Syntax],
|
|
53667
53727
|
};
|
|
@@ -53736,14 +53796,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
53736
53796
|
key: "check_subrc",
|
|
53737
53797
|
title: "Check sy-subrc",
|
|
53738
53798
|
shortDescription: `Check sy-subrc`,
|
|
53739
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
53740
|
-
|
|
53741
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
53742
|
-
|
|
53743
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
53744
|
-
|
|
53745
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
53746
|
-
|
|
53799
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
53800
|
+
|
|
53801
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
53802
|
+
|
|
53803
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
53804
|
+
|
|
53805
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
53806
|
+
|
|
53747
53807
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
53748
53808
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53749
53809
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -54296,17 +54356,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
54296
54356
|
shortDescription: `Find overlapping classic exceptions`,
|
|
54297
54357
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
54298
54358
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54299
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54300
|
-
EXCEPTIONS
|
|
54301
|
-
system_failure = 1 MESSAGE lv_message
|
|
54302
|
-
communication_failure = 1 MESSAGE lv_message
|
|
54303
|
-
resource_failure = 1
|
|
54359
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54360
|
+
EXCEPTIONS
|
|
54361
|
+
system_failure = 1 MESSAGE lv_message
|
|
54362
|
+
communication_failure = 1 MESSAGE lv_message
|
|
54363
|
+
resource_failure = 1
|
|
54304
54364
|
OTHERS = 1.`,
|
|
54305
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54306
|
-
EXCEPTIONS
|
|
54307
|
-
system_failure = 1 MESSAGE lv_message
|
|
54308
|
-
communication_failure = 2 MESSAGE lv_message
|
|
54309
|
-
resource_failure = 3
|
|
54365
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54366
|
+
EXCEPTIONS
|
|
54367
|
+
system_failure = 1 MESSAGE lv_message
|
|
54368
|
+
communication_failure = 2 MESSAGE lv_message
|
|
54369
|
+
resource_failure = 3
|
|
54310
54370
|
OTHERS = 4.`,
|
|
54311
54371
|
};
|
|
54312
54372
|
}
|
|
@@ -54552,7 +54612,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
54552
54612
|
key: "commented_code",
|
|
54553
54613
|
title: "Find commented code",
|
|
54554
54614
|
shortDescription: `Detects usage of commented out code.`,
|
|
54555
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
54615
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
54556
54616
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
54557
54617
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54558
54618
|
};
|
|
@@ -54784,10 +54844,10 @@ class ConstructorVisibilityPublic {
|
|
|
54784
54844
|
key: "constructor_visibility_public",
|
|
54785
54845
|
title: "Check constructor visibility is public",
|
|
54786
54846
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
54787
|
-
extendedInformation: `
|
|
54788
|
-
This only applies to global classes.
|
|
54789
|
-
|
|
54790
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
54847
|
+
extendedInformation: `
|
|
54848
|
+
This only applies to global classes.
|
|
54849
|
+
|
|
54850
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
54791
54851
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
54792
54852
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54793
54853
|
};
|
|
@@ -54862,8 +54922,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
54862
54922
|
key: "contains_tab",
|
|
54863
54923
|
title: "Code contains tab",
|
|
54864
54924
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
54865
|
-
extendedInformation: `
|
|
54866
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
54925
|
+
extendedInformation: `
|
|
54926
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
54867
54927
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
54868
54928
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54869
54929
|
};
|
|
@@ -54948,10 +55008,10 @@ class CyclicOO {
|
|
|
54948
55008
|
key: "cyclic_oo",
|
|
54949
55009
|
title: "Cyclic OO",
|
|
54950
55010
|
shortDescription: `Finds cyclic OO references`,
|
|
54951
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
54952
|
-
|
|
54953
|
-
Objects must be without syntax errors for this rule to take effect
|
|
54954
|
-
|
|
55011
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55012
|
+
|
|
55013
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55014
|
+
|
|
54955
55015
|
References in testclass includes are ignored`,
|
|
54956
55016
|
};
|
|
54957
55017
|
}
|
|
@@ -55193,7 +55253,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55193
55253
|
key: "dangerous_statement",
|
|
55194
55254
|
title: "Dangerous statement",
|
|
55195
55255
|
shortDescription: `Detects potentially dangerous statements`,
|
|
55196
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55256
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55197
55257
|
dynamic SQL can potentially create SQL injection problems`,
|
|
55198
55258
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55199
55259
|
};
|
|
@@ -55397,13 +55457,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
55397
55457
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
55398
55458
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
55399
55459
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55400
|
-
badExample: `FROM foo.
|
|
55401
|
-
WRITE 'hello'.
|
|
55402
|
-
DATA int TYPE i.
|
|
55460
|
+
badExample: `FROM foo.
|
|
55461
|
+
WRITE 'hello'.
|
|
55462
|
+
DATA int TYPE i.
|
|
55403
55463
|
ENDFORM.`,
|
|
55404
|
-
goodExample: `FROM foo.
|
|
55405
|
-
DATA int TYPE i.
|
|
55406
|
-
WRITE 'hello'.
|
|
55464
|
+
goodExample: `FROM foo.
|
|
55465
|
+
DATA int TYPE i.
|
|
55466
|
+
WRITE 'hello'.
|
|
55407
55467
|
ENDFORM.`,
|
|
55408
55468
|
};
|
|
55409
55469
|
}
|
|
@@ -55939,39 +55999,39 @@ class Downport {
|
|
|
55939
55999
|
key: "downport",
|
|
55940
56000
|
title: "Downport statement",
|
|
55941
56001
|
shortDescription: `Downport functionality`,
|
|
55942
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
55943
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
55944
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
55945
|
-
|
|
55946
|
-
Current rules:
|
|
55947
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
55948
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
55949
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
55950
|
-
* CONV is outlined
|
|
55951
|
-
* COND is outlined
|
|
55952
|
-
* REDUCE is outlined
|
|
55953
|
-
* SWITCH is outlined
|
|
55954
|
-
* FILTER is outlined
|
|
55955
|
-
* APPEND expression is outlined
|
|
55956
|
-
* INSERT expression is outlined
|
|
55957
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
55958
|
-
* CAST changed to ?=
|
|
55959
|
-
* LOOP AT method_call( ) is outlined
|
|
55960
|
-
* VALUE # with structure fields
|
|
55961
|
-
* VALUE # with internal table lines
|
|
55962
|
-
* Table Expressions are outlined
|
|
55963
|
-
* SELECT INTO @DATA definitions are outlined
|
|
55964
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
55965
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
55966
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
55967
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
55968
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
55969
|
-
* line_exists and line_index is downported to READ TABLE
|
|
55970
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
55971
|
-
* MESSAGE with non simple source
|
|
55972
|
-
|
|
55973
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
55974
|
-
|
|
56002
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56003
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56004
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56005
|
+
|
|
56006
|
+
Current rules:
|
|
56007
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56008
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56009
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56010
|
+
* CONV is outlined
|
|
56011
|
+
* COND is outlined
|
|
56012
|
+
* REDUCE is outlined
|
|
56013
|
+
* SWITCH is outlined
|
|
56014
|
+
* FILTER is outlined
|
|
56015
|
+
* APPEND expression is outlined
|
|
56016
|
+
* INSERT expression is outlined
|
|
56017
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56018
|
+
* CAST changed to ?=
|
|
56019
|
+
* LOOP AT method_call( ) is outlined
|
|
56020
|
+
* VALUE # with structure fields
|
|
56021
|
+
* VALUE # with internal table lines
|
|
56022
|
+
* Table Expressions are outlined
|
|
56023
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56024
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56025
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56026
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56027
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56028
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56029
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56030
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56031
|
+
* MESSAGE with non simple source
|
|
56032
|
+
|
|
56033
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56034
|
+
|
|
55975
56035
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
55976
56036
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
55977
56037
|
};
|
|
@@ -56545,10 +56605,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
56545
56605
|
const fieldName = f.concatTokens();
|
|
56546
56606
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
56547
56607
|
}
|
|
56548
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
56608
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
56549
56609
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
56550
56610
|
}
|
|
56551
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
56611
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
56552
56612
|
${indentation}`);
|
|
56553
56613
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
56554
56614
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56592,12 +56652,12 @@ ${indentation}`);
|
|
|
56592
56652
|
}
|
|
56593
56653
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56594
56654
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
56595
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
56596
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
56597
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
56655
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
56656
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
56657
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
56598
56658
|
${indentation}`);
|
|
56599
56659
|
if (fieldDefinitions === "") {
|
|
56600
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
56660
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
56601
56661
|
${indentation}`);
|
|
56602
56662
|
}
|
|
56603
56663
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -56665,7 +56725,7 @@ ${indentation}`);
|
|
|
56665
56725
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56666
56726
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
56667
56727
|
const firstToken = high.getFirstToken();
|
|
56668
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56728
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56669
56729
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
56670
56730
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
56671
56731
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56703,7 +56763,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
56703
56763
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56704
56764
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
56705
56765
|
const firstToken = high.getFirstToken();
|
|
56706
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56766
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
56707
56767
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
56708
56768
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
56709
56769
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56745,14 +56805,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
56745
56805
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
56746
56806
|
const firstToken = high.getFirstToken();
|
|
56747
56807
|
// note that the tabix restore should be done before throwing the exception
|
|
56748
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
56749
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
56750
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
56751
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
56752
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
56753
|
-
${indentation}IF sy-subrc <> 0.
|
|
56754
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
56755
|
-
${indentation}ENDIF.
|
|
56808
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
56809
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
56810
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
56811
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
56812
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
56813
|
+
${indentation}IF sy-subrc <> 0.
|
|
56814
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
56815
|
+
${indentation}ENDIF.
|
|
56756
56816
|
${indentation}`);
|
|
56757
56817
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
56758
56818
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -56809,7 +56869,7 @@ ${indentation}`);
|
|
|
56809
56869
|
const className = classNames[0].concatTokens();
|
|
56810
56870
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
56811
56871
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
56812
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
56872
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
56813
56873
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
56814
56874
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
56815
56875
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -56966,21 +57026,21 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
56966
57026
|
}
|
|
56967
57027
|
startToken = node.getFirstToken();
|
|
56968
57028
|
}
|
|
56969
|
-
const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.
|
|
57029
|
+
const withs = ((_f = node.findDirectExpression(Expressions.RaiseWith)) === null || _f === void 0 ? void 0 : _f.findDirectExpressions(Expressions.SimpleSource3)) || [];
|
|
56970
57030
|
const className = ((_g = node.findDirectExpression(Expressions.ClassName)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "ERROR";
|
|
56971
57031
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56972
57032
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
56973
57033
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
56974
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
56975
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57034
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57035
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
56976
57036
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
56977
57037
|
if (withs.length > 0) {
|
|
56978
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
56979
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
56980
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57038
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57039
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57040
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
56981
57041
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
56982
57042
|
}
|
|
56983
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57043
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
56984
57044
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
56985
57045
|
if (withs.length > 0) {
|
|
56986
57046
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -57092,10 +57152,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
57092
57152
|
let code = "";
|
|
57093
57153
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
57094
57154
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57095
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57096
|
-
IF sy-subrc <> 0.
|
|
57097
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57098
|
-
ENDIF.
|
|
57155
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57156
|
+
IF sy-subrc <> 0.
|
|
57157
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57158
|
+
ENDIF.
|
|
57099
57159
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
57100
57160
|
}
|
|
57101
57161
|
else {
|
|
@@ -57171,20 +57231,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
57171
57231
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57172
57232
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57173
57233
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57174
|
-
code += ` items LIKE ${loopSourceName},
|
|
57175
|
-
END OF ${groupTargetName}type.
|
|
57176
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57177
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57234
|
+
code += ` items LIKE ${loopSourceName},
|
|
57235
|
+
END OF ${groupTargetName}type.
|
|
57236
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57237
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57178
57238
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
57179
57239
|
if (groupIndexName !== undefined) {
|
|
57180
57240
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
57181
57241
|
}
|
|
57182
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57242
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57183
57243
|
IF sy-subrc = 0.\n`;
|
|
57184
57244
|
if (groupCountName !== undefined) {
|
|
57185
57245
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
57186
57246
|
}
|
|
57187
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57247
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57188
57248
|
ELSE.\n`;
|
|
57189
57249
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
57190
57250
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -57205,8 +57265,8 @@ ELSE.\n`;
|
|
|
57205
57265
|
}
|
|
57206
57266
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
57207
57267
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
57208
|
-
code += `ENDIF.
|
|
57209
|
-
ENDLOOP.
|
|
57268
|
+
code += `ENDIF.
|
|
57269
|
+
ENDLOOP.
|
|
57210
57270
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
57211
57271
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
57212
57272
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -57354,7 +57414,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
57354
57414
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57355
57415
|
let code = `CLEAR ${target.concatTokens()}.\n`;
|
|
57356
57416
|
for (const fieldAssignment of fieldAssignments) {
|
|
57357
|
-
code += indentation + target.concatTokens() + "-" + fieldAssignment.
|
|
57417
|
+
code += indentation + target.concatTokens() + "-" + fieldAssignment.concatTokensWithLinebreaks() + `.\n`;
|
|
57358
57418
|
}
|
|
57359
57419
|
code = code.trimEnd();
|
|
57360
57420
|
const start = high.getFirstToken().getStart();
|
|
@@ -57378,7 +57438,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
57378
57438
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57379
57439
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
57380
57440
|
// all ENUMS are char like?
|
|
57381
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
57441
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
57382
57442
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
57383
57443
|
let count = 1;
|
|
57384
57444
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -57422,14 +57482,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
57422
57482
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57423
57483
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57424
57484
|
// restore tabix before exeption
|
|
57425
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
57426
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57427
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57428
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
57429
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57430
|
-
${indentation}IF sy-subrc <> 0.
|
|
57431
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57432
|
-
${indentation}ENDIF.
|
|
57485
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
57486
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57487
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57488
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
57489
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57490
|
+
${indentation}IF sy-subrc <> 0.
|
|
57491
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57492
|
+
${indentation}ENDIF.
|
|
57433
57493
|
${indentation}${uniqueName}`;
|
|
57434
57494
|
const start = target.getFirstToken().getStart();
|
|
57435
57495
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -57513,11 +57573,11 @@ ${indentation}${uniqueName}`;
|
|
|
57513
57573
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57514
57574
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57515
57575
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57516
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
57517
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
57518
|
-
${indentation} EXPORTING
|
|
57519
|
-
${indentation} input = ${source}
|
|
57520
|
-
${indentation} IMPORTING
|
|
57576
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
57577
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
57578
|
+
${indentation} EXPORTING
|
|
57579
|
+
${indentation} input = ${source}
|
|
57580
|
+
${indentation} IMPORTING
|
|
57521
57581
|
${indentation} output = ${uniqueName}.\n`;
|
|
57522
57582
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
57523
57583
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -58829,12 +58889,12 @@ class EasyToFindMessages {
|
|
|
58829
58889
|
key: "easy_to_find_messages",
|
|
58830
58890
|
title: "Easy to find messages",
|
|
58831
58891
|
shortDescription: `Make messages easy to find`,
|
|
58832
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
58833
|
-
|
|
58834
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
58835
|
-
|
|
58836
|
-
Also see rule "message_exists"
|
|
58837
|
-
|
|
58892
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
58893
|
+
|
|
58894
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
58895
|
+
|
|
58896
|
+
Also see rule "message_exists"
|
|
58897
|
+
|
|
58838
58898
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
58839
58899
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
58840
58900
|
};
|
|
@@ -58919,8 +58979,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
58919
58979
|
key: "empty_line_in_statement",
|
|
58920
58980
|
title: "Find empty lines in statements",
|
|
58921
58981
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
58922
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
58923
|
-
|
|
58982
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
58983
|
+
|
|
58924
58984
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
58925
58985
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
58926
58986
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -59212,10 +59272,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
59212
59272
|
return {
|
|
59213
59273
|
key: "exit_or_check",
|
|
59214
59274
|
title: "Find EXIT or CHECK outside loops",
|
|
59215
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59275
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59216
59276
|
Use RETURN to leave procesing blocks instead.`,
|
|
59217
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59218
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59277
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59278
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59219
59279
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
59220
59280
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59221
59281
|
};
|
|
@@ -59298,12 +59358,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
59298
59358
|
key: "expand_macros",
|
|
59299
59359
|
title: "Expand Macros",
|
|
59300
59360
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
59301
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
59302
|
-
|
|
59361
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
59362
|
+
|
|
59303
59363
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
59304
|
-
badExample: `DEFINE _hello.
|
|
59305
|
-
WRITE 'hello'.
|
|
59306
|
-
END-OF-DEFINITION.
|
|
59364
|
+
badExample: `DEFINE _hello.
|
|
59365
|
+
WRITE 'hello'.
|
|
59366
|
+
END-OF-DEFINITION.
|
|
59307
59367
|
_hello.`,
|
|
59308
59368
|
goodExample: `WRITE 'hello'.`,
|
|
59309
59369
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -59390,7 +59450,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
59390
59450
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
59391
59451
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
59392
59452
|
goodExample: `call_method( foo = bar ).`,
|
|
59393
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
59453
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
59394
59454
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
59395
59455
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
59396
59456
|
};
|
|
@@ -59488,7 +59548,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
59488
59548
|
key: "forbidden_identifier",
|
|
59489
59549
|
title: "Forbidden Identifier",
|
|
59490
59550
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
59491
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
59551
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
59492
59552
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
59493
59553
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
59494
59554
|
};
|
|
@@ -59730,8 +59790,8 @@ class ForbiddenVoidType {
|
|
|
59730
59790
|
key: "forbidden_void_type",
|
|
59731
59791
|
title: "Forbidden Void Types",
|
|
59732
59792
|
shortDescription: `Avoid usage of specified void types.`,
|
|
59733
|
-
extendedInformation: `Inspiration:
|
|
59734
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
59793
|
+
extendedInformation: `Inspiration:
|
|
59794
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
59735
59795
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
59736
59796
|
};
|
|
59737
59797
|
}
|
|
@@ -59974,7 +60034,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
59974
60034
|
key: "fully_type_itabs",
|
|
59975
60035
|
title: "Fully type internal tables",
|
|
59976
60036
|
shortDescription: `No implict table types or table keys`,
|
|
59977
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60037
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
59978
60038
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
59979
60039
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
59980
60040
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -60159,26 +60219,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
60159
60219
|
key: "functional_writing",
|
|
60160
60220
|
title: "Use functional writing",
|
|
60161
60221
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
60162
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60222
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60163
60223
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
60164
60224
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60165
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60166
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60167
|
-
EXPORTING
|
|
60168
|
-
p_name = 'NAME'
|
|
60169
|
-
RECEIVING
|
|
60170
|
-
p_descr_ref = lr_typedescr
|
|
60171
|
-
EXCEPTIONS
|
|
60172
|
-
type_not_found = 1
|
|
60225
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60226
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60227
|
+
EXPORTING
|
|
60228
|
+
p_name = 'NAME'
|
|
60229
|
+
RECEIVING
|
|
60230
|
+
p_descr_ref = lr_typedescr
|
|
60231
|
+
EXCEPTIONS
|
|
60232
|
+
type_not_found = 1
|
|
60173
60233
|
OTHERS = 2.`,
|
|
60174
|
-
goodExample: `zcl_class=>method( ).
|
|
60175
|
-
cl_abap_typedescr=>describe_by_name(
|
|
60176
|
-
EXPORTING
|
|
60177
|
-
p_name = 'NAME'
|
|
60178
|
-
RECEIVING
|
|
60179
|
-
p_descr_ref = lr_typedescr
|
|
60180
|
-
EXCEPTIONS
|
|
60181
|
-
type_not_found = 1
|
|
60234
|
+
goodExample: `zcl_class=>method( ).
|
|
60235
|
+
cl_abap_typedescr=>describe_by_name(
|
|
60236
|
+
EXPORTING
|
|
60237
|
+
p_name = 'NAME'
|
|
60238
|
+
RECEIVING
|
|
60239
|
+
p_descr_ref = lr_typedescr
|
|
60240
|
+
EXCEPTIONS
|
|
60241
|
+
type_not_found = 1
|
|
60182
60242
|
OTHERS = 2 ).`,
|
|
60183
60243
|
};
|
|
60184
60244
|
}
|
|
@@ -60289,14 +60349,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
60289
60349
|
key: "global_class",
|
|
60290
60350
|
title: "Global class checks",
|
|
60291
60351
|
shortDescription: `Checks related to global classes`,
|
|
60292
|
-
extendedInformation: `* global classes must be in own files
|
|
60293
|
-
|
|
60294
|
-
* file names must match class name
|
|
60295
|
-
|
|
60296
|
-
* file names must match interface name
|
|
60297
|
-
|
|
60298
|
-
* global classes must be global definitions
|
|
60299
|
-
|
|
60352
|
+
extendedInformation: `* global classes must be in own files
|
|
60353
|
+
|
|
60354
|
+
* file names must match class name
|
|
60355
|
+
|
|
60356
|
+
* file names must match interface name
|
|
60357
|
+
|
|
60358
|
+
* global classes must be global definitions
|
|
60359
|
+
|
|
60300
60360
|
* global interfaces must be global definitions`,
|
|
60301
60361
|
tags: [_irule_1.RuleTag.Syntax],
|
|
60302
60362
|
};
|
|
@@ -60395,8 +60455,8 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
60395
60455
|
return {
|
|
60396
60456
|
key: "identical_conditions",
|
|
60397
60457
|
title: "Identical conditions",
|
|
60398
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
60399
|
-
|
|
60458
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
60459
|
+
|
|
60400
60460
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
60401
60461
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60402
60462
|
};
|
|
@@ -60530,23 +60590,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
60530
60590
|
key: "identical_contents",
|
|
60531
60591
|
title: "Identical contents",
|
|
60532
60592
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
60533
|
-
extendedInformation: `
|
|
60534
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
60535
|
-
|
|
60593
|
+
extendedInformation: `
|
|
60594
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
60595
|
+
|
|
60536
60596
|
Chained statments are ignored`,
|
|
60537
60597
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60538
|
-
badExample: `IF foo = bar.
|
|
60539
|
-
WRITE 'bar'.
|
|
60540
|
-
WRITE 'world'.
|
|
60541
|
-
ELSE.
|
|
60542
|
-
WRITE 'foo'.
|
|
60543
|
-
WRITE 'world'.
|
|
60598
|
+
badExample: `IF foo = bar.
|
|
60599
|
+
WRITE 'bar'.
|
|
60600
|
+
WRITE 'world'.
|
|
60601
|
+
ELSE.
|
|
60602
|
+
WRITE 'foo'.
|
|
60603
|
+
WRITE 'world'.
|
|
60544
60604
|
ENDIF.`,
|
|
60545
|
-
goodExample: `IF foo = bar.
|
|
60546
|
-
WRITE 'bar'.
|
|
60547
|
-
ELSE.
|
|
60548
|
-
WRITE 'foo'.
|
|
60549
|
-
ENDIF.
|
|
60605
|
+
goodExample: `IF foo = bar.
|
|
60606
|
+
WRITE 'bar'.
|
|
60607
|
+
ELSE.
|
|
60608
|
+
WRITE 'foo'.
|
|
60609
|
+
ENDIF.
|
|
60550
60610
|
WRITE 'world'.`,
|
|
60551
60611
|
};
|
|
60552
60612
|
}
|
|
@@ -60649,12 +60709,12 @@ class IdenticalDescriptions {
|
|
|
60649
60709
|
key: "identical_descriptions",
|
|
60650
60710
|
title: "Identical descriptions",
|
|
60651
60711
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
60652
|
-
extendedInformation: `Case insensitive
|
|
60653
|
-
|
|
60654
|
-
Only checks the master language descriptions
|
|
60655
|
-
|
|
60656
|
-
Dependencies are skipped
|
|
60657
|
-
|
|
60712
|
+
extendedInformation: `Case insensitive
|
|
60713
|
+
|
|
60714
|
+
Only checks the master language descriptions
|
|
60715
|
+
|
|
60716
|
+
Dependencies are skipped
|
|
60717
|
+
|
|
60658
60718
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
60659
60719
|
tags: [],
|
|
60660
60720
|
};
|
|
@@ -60828,43 +60888,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
60828
60888
|
key: "if_in_if",
|
|
60829
60889
|
title: "IF in IF",
|
|
60830
60890
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
60831
|
-
extendedInformation: `
|
|
60832
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
60833
|
-
|
|
60834
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
60835
|
-
|
|
60836
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
60891
|
+
extendedInformation: `
|
|
60892
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
60893
|
+
|
|
60894
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
60895
|
+
|
|
60896
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
60837
60897
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
60838
|
-
badExample: `IF condition1.
|
|
60839
|
-
IF condition2.
|
|
60840
|
-
...
|
|
60841
|
-
ENDIF.
|
|
60842
|
-
ENDIF.
|
|
60843
|
-
|
|
60844
|
-
IF condition1.
|
|
60845
|
-
...
|
|
60846
|
-
ELSE.
|
|
60847
|
-
IF condition2.
|
|
60848
|
-
...
|
|
60849
|
-
ENDIF.
|
|
60898
|
+
badExample: `IF condition1.
|
|
60899
|
+
IF condition2.
|
|
60900
|
+
...
|
|
60901
|
+
ENDIF.
|
|
60902
|
+
ENDIF.
|
|
60903
|
+
|
|
60904
|
+
IF condition1.
|
|
60905
|
+
...
|
|
60906
|
+
ELSE.
|
|
60907
|
+
IF condition2.
|
|
60908
|
+
...
|
|
60909
|
+
ENDIF.
|
|
60850
60910
|
ENDIF.`,
|
|
60851
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
60852
|
-
...
|
|
60853
|
-
ENDIF.
|
|
60854
|
-
|
|
60855
|
-
IF condition1.
|
|
60856
|
-
...
|
|
60857
|
-
ELSEIF condition2.
|
|
60858
|
-
...
|
|
60859
|
-
ENDIF.
|
|
60860
|
-
|
|
60861
|
-
CASE variable.
|
|
60862
|
-
WHEN value1.
|
|
60863
|
-
...
|
|
60864
|
-
WHEN value2.
|
|
60865
|
-
IF condition2.
|
|
60866
|
-
...
|
|
60867
|
-
ENDIF.
|
|
60911
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
60912
|
+
...
|
|
60913
|
+
ENDIF.
|
|
60914
|
+
|
|
60915
|
+
IF condition1.
|
|
60916
|
+
...
|
|
60917
|
+
ELSEIF condition2.
|
|
60918
|
+
...
|
|
60919
|
+
ENDIF.
|
|
60920
|
+
|
|
60921
|
+
CASE variable.
|
|
60922
|
+
WHEN value1.
|
|
60923
|
+
...
|
|
60924
|
+
WHEN value2.
|
|
60925
|
+
IF condition2.
|
|
60926
|
+
...
|
|
60927
|
+
ENDIF.
|
|
60868
60928
|
ENDCASE.`,
|
|
60869
60929
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60870
60930
|
};
|
|
@@ -61049,9 +61109,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
61049
61109
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
61050
61110
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
61051
61111
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
61052
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61053
|
-
METHOD ${methodName.toLowerCase()}.
|
|
61054
|
-
RETURN. " todo, implement method
|
|
61112
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61113
|
+
METHOD ${methodName.toLowerCase()}.
|
|
61114
|
+
RETURN. " todo, implement method
|
|
61055
61115
|
ENDMETHOD.`);
|
|
61056
61116
|
}
|
|
61057
61117
|
}
|
|
@@ -61239,19 +61299,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
61239
61299
|
key: "in_statement_indentation",
|
|
61240
61300
|
title: "In-statement indentation",
|
|
61241
61301
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
61242
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61243
|
-
|
|
61244
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
61302
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61303
|
+
|
|
61304
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
61245
61305
|
to distinguish them better from code within the block.`,
|
|
61246
|
-
badExample: `IF 1 = 1
|
|
61247
|
-
AND 2 = 2.
|
|
61248
|
-
WRITE 'hello' &&
|
|
61249
|
-
'world'.
|
|
61306
|
+
badExample: `IF 1 = 1
|
|
61307
|
+
AND 2 = 2.
|
|
61308
|
+
WRITE 'hello' &&
|
|
61309
|
+
'world'.
|
|
61250
61310
|
ENDIF.`,
|
|
61251
|
-
goodExample: `IF 1 = 1
|
|
61252
|
-
AND 2 = 2.
|
|
61253
|
-
WRITE 'hello' &&
|
|
61254
|
-
'world'.
|
|
61311
|
+
goodExample: `IF 1 = 1
|
|
61312
|
+
AND 2 = 2.
|
|
61313
|
+
WRITE 'hello' &&
|
|
61314
|
+
'world'.
|
|
61255
61315
|
ENDIF.`,
|
|
61256
61316
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61257
61317
|
};
|
|
@@ -61756,9 +61816,9 @@ class IntfReferencingClas {
|
|
|
61756
61816
|
key: "intf_referencing_clas",
|
|
61757
61817
|
title: "INTF referencing CLAS",
|
|
61758
61818
|
shortDescription: `Interface contains references to class`,
|
|
61759
|
-
extendedInformation: `Only global interfaces are checked.
|
|
61760
|
-
Only first level references are checked.
|
|
61761
|
-
Exception class references are ignored.
|
|
61819
|
+
extendedInformation: `Only global interfaces are checked.
|
|
61820
|
+
Only first level references are checked.
|
|
61821
|
+
Exception class references are ignored.
|
|
61762
61822
|
Void references are ignored.`,
|
|
61763
61823
|
};
|
|
61764
61824
|
}
|
|
@@ -62353,8 +62413,8 @@ class LineBreakStyle {
|
|
|
62353
62413
|
return {
|
|
62354
62414
|
key: "line_break_style",
|
|
62355
62415
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
62356
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
62357
|
-
|
|
62416
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
62417
|
+
|
|
62358
62418
|
abapGit does not work with CRLF`,
|
|
62359
62419
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
62360
62420
|
};
|
|
@@ -62423,7 +62483,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
62423
62483
|
key: "line_length",
|
|
62424
62484
|
title: "Line length",
|
|
62425
62485
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
62426
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
62486
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
62427
62487
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
62428
62488
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
62429
62489
|
};
|
|
@@ -62494,7 +62554,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
62494
62554
|
key: "line_only_punc",
|
|
62495
62555
|
title: "Line containing only punctuation",
|
|
62496
62556
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
62497
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
62557
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
62498
62558
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
62499
62559
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62500
62560
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -62754,8 +62814,8 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
62754
62814
|
return {
|
|
62755
62815
|
key: "local_variable_names",
|
|
62756
62816
|
title: "Local variable naming conventions",
|
|
62757
|
-
shortDescription: `
|
|
62758
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
62817
|
+
shortDescription: `
|
|
62818
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
62759
62819
|
Regexes are case-insensitive.`,
|
|
62760
62820
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
62761
62821
|
};
|
|
@@ -62902,10 +62962,10 @@ class MainFileContents {
|
|
|
62902
62962
|
key: "main_file_contents",
|
|
62903
62963
|
title: "Main file contents",
|
|
62904
62964
|
shortDescription: `Checks related to report declarations.`,
|
|
62905
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
62906
|
-
|
|
62907
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
62908
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
62965
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
62966
|
+
|
|
62967
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
62968
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
62909
62969
|
`,
|
|
62910
62970
|
};
|
|
62911
62971
|
}
|
|
@@ -63021,17 +63081,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
63021
63081
|
title: "Too many parentheses",
|
|
63022
63082
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
63023
63083
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63024
|
-
badExample: `
|
|
63025
|
-
IF ( destination IS INITIAL ).
|
|
63026
|
-
ENDIF.
|
|
63027
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63028
|
-
ENDIF.
|
|
63084
|
+
badExample: `
|
|
63085
|
+
IF ( destination IS INITIAL ).
|
|
63086
|
+
ENDIF.
|
|
63087
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63088
|
+
ENDIF.
|
|
63029
63089
|
`,
|
|
63030
|
-
goodExample: `
|
|
63031
|
-
IF destination IS INITIAL.
|
|
63032
|
-
ENDIF.
|
|
63033
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
63034
|
-
ENDIF.
|
|
63090
|
+
goodExample: `
|
|
63091
|
+
IF destination IS INITIAL.
|
|
63092
|
+
ENDIF.
|
|
63093
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
63094
|
+
ENDIF.
|
|
63035
63095
|
`,
|
|
63036
63096
|
};
|
|
63037
63097
|
}
|
|
@@ -63205,14 +63265,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
63205
63265
|
title: "Max one method parameter definition per line",
|
|
63206
63266
|
shortDescription: `Keep max one method parameter description per line`,
|
|
63207
63267
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
63208
|
-
badExample: `
|
|
63209
|
-
METHODS apps_scope_token
|
|
63210
|
-
IMPORTING
|
|
63268
|
+
badExample: `
|
|
63269
|
+
METHODS apps_scope_token
|
|
63270
|
+
IMPORTING
|
|
63211
63271
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
63212
|
-
goodExample: `
|
|
63213
|
-
METHODS apps_scope_token
|
|
63214
|
-
IMPORTING
|
|
63215
|
-
body TYPE bodyapps_scope_token
|
|
63272
|
+
goodExample: `
|
|
63273
|
+
METHODS apps_scope_token
|
|
63274
|
+
IMPORTING
|
|
63275
|
+
body TYPE bodyapps_scope_token
|
|
63216
63276
|
client_id TYPE str.`,
|
|
63217
63277
|
};
|
|
63218
63278
|
}
|
|
@@ -63277,11 +63337,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
63277
63337
|
key: "max_one_statement",
|
|
63278
63338
|
title: "Max one statement per line",
|
|
63279
63339
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
63280
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
63281
|
-
|
|
63282
|
-
Does not report anything for chained statements.
|
|
63283
|
-
|
|
63284
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
63340
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
63341
|
+
|
|
63342
|
+
Does not report anything for chained statements.
|
|
63343
|
+
|
|
63344
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
63285
63345
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
63286
63346
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63287
63347
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -63586,6 +63646,7 @@ exports.MethodImplementedTwice = MethodImplementedTwice;
|
|
|
63586
63646
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
63587
63647
|
exports.MethodLength = exports.MethodLengthConf = void 0;
|
|
63588
63648
|
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
63649
|
+
const Objects = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
63589
63650
|
const method_length_stats_1 = __webpack_require__(/*! ../utils/method_length_stats */ "./node_modules/@abaplint/core/build/src/utils/method_length_stats.js");
|
|
63590
63651
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
63591
63652
|
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
@@ -63618,8 +63679,8 @@ class MethodLength {
|
|
|
63618
63679
|
key: "method_length",
|
|
63619
63680
|
title: "Method/Form Length",
|
|
63620
63681
|
shortDescription: `Checks relating to method/form length.`,
|
|
63621
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
63622
|
-
|
|
63682
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
63683
|
+
|
|
63623
63684
|
Abstract methods without statements are considered okay.`,
|
|
63624
63685
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63625
63686
|
};
|
|
@@ -63647,6 +63708,12 @@ Abstract methods without statements are considered okay.`,
|
|
|
63647
63708
|
return this;
|
|
63648
63709
|
}
|
|
63649
63710
|
run(obj) {
|
|
63711
|
+
var _a;
|
|
63712
|
+
if (this.conf.ignoreTestClasses === true
|
|
63713
|
+
&& obj instanceof Objects.Class
|
|
63714
|
+
&& ((_a = obj.getClassDefinition()) === null || _a === void 0 ? void 0 : _a.isForTesting) === true) {
|
|
63715
|
+
return [];
|
|
63716
|
+
}
|
|
63650
63717
|
const methodStats = method_length_stats_1.MethodLengthStats.run(obj);
|
|
63651
63718
|
const methodIssues = this.check(methodStats, "METHOD");
|
|
63652
63719
|
let formIssues = [];
|
|
@@ -63718,10 +63785,10 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
63718
63785
|
key: "method_overwrites_builtin",
|
|
63719
63786
|
title: "Method name overwrites builtin function",
|
|
63720
63787
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
63721
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
63722
|
-
|
|
63723
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
63724
|
-
|
|
63788
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
63789
|
+
|
|
63790
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
63791
|
+
|
|
63725
63792
|
Interface method names are ignored`,
|
|
63726
63793
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
63727
63794
|
};
|
|
@@ -64291,7 +64358,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
64291
64358
|
key: "nesting",
|
|
64292
64359
|
title: "Check nesting depth",
|
|
64293
64360
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
64294
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
64361
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
64295
64362
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
64296
64363
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64297
64364
|
};
|
|
@@ -64534,7 +64601,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
64534
64601
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
64535
64602
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64536
64603
|
badExample: `var1 = var2 = var3.`,
|
|
64537
|
-
goodExample: `var2 = var3.
|
|
64604
|
+
goodExample: `var2 = var3.
|
|
64538
64605
|
var1 = var2.`,
|
|
64539
64606
|
};
|
|
64540
64607
|
}
|
|
@@ -64593,8 +64660,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
64593
64660
|
key: "no_external_form_calls",
|
|
64594
64661
|
title: "No external FORM calls",
|
|
64595
64662
|
shortDescription: `Detect external form calls`,
|
|
64596
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
64597
|
-
|
|
64663
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
64664
|
+
|
|
64598
64665
|
PERFORM foo(bar).`,
|
|
64599
64666
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
64600
64667
|
};
|
|
@@ -64655,17 +64722,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
64655
64722
|
key: "no_inline_in_optional_branches",
|
|
64656
64723
|
title: "Don't declare inline in optional branches",
|
|
64657
64724
|
shortDescription: `Don't declare inline in optional branches`,
|
|
64658
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
64659
|
-
|
|
64660
|
-
Considered optional branches:
|
|
64661
|
-
* inside IF/ELSEIF/ELSE
|
|
64662
|
-
* inside LOOP
|
|
64663
|
-
* inside WHILE
|
|
64664
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
64665
|
-
* inside DO
|
|
64666
|
-
* inside SELECT loops
|
|
64667
|
-
|
|
64668
|
-
Not considered optional branches:
|
|
64725
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
64726
|
+
|
|
64727
|
+
Considered optional branches:
|
|
64728
|
+
* inside IF/ELSEIF/ELSE
|
|
64729
|
+
* inside LOOP
|
|
64730
|
+
* inside WHILE
|
|
64731
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
64732
|
+
* inside DO
|
|
64733
|
+
* inside SELECT loops
|
|
64734
|
+
|
|
64735
|
+
Not considered optional branches:
|
|
64669
64736
|
* TRY/CATCH/CLEANUP`,
|
|
64670
64737
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64671
64738
|
};
|
|
@@ -64764,12 +64831,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
64764
64831
|
key: "no_prefixes",
|
|
64765
64832
|
title: "No Prefixes",
|
|
64766
64833
|
shortDescription: `Dont use hungarian notation`,
|
|
64767
|
-
extendedInformation: `
|
|
64768
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
64769
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
64770
|
-
|
|
64771
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
64772
|
-
|
|
64834
|
+
extendedInformation: `
|
|
64835
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
64836
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
64837
|
+
|
|
64838
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
64839
|
+
|
|
64773
64840
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
64774
64841
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64775
64842
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -64942,7 +65009,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
64942
65009
|
return {
|
|
64943
65010
|
key: "no_public_attributes",
|
|
64944
65011
|
title: "No public attributes",
|
|
64945
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65012
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
64946
65013
|
Exceptions are excluded from this rule.`,
|
|
64947
65014
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
64948
65015
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -65043,13 +65110,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
65043
65110
|
key: "no_yoda_conditions",
|
|
65044
65111
|
title: "No Yoda conditions",
|
|
65045
65112
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
65046
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65047
|
-
|
|
65113
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65114
|
+
|
|
65048
65115
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
65049
65116
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65050
|
-
badExample: `IF 0 <> sy-subrc.
|
|
65117
|
+
badExample: `IF 0 <> sy-subrc.
|
|
65051
65118
|
ENDIF.`,
|
|
65052
|
-
goodExample: `IF sy-subrc <> 0.
|
|
65119
|
+
goodExample: `IF sy-subrc <> 0.
|
|
65053
65120
|
ENDIF.`,
|
|
65054
65121
|
};
|
|
65055
65122
|
}
|
|
@@ -65150,8 +65217,8 @@ class NROBConsistency {
|
|
|
65150
65217
|
key: "nrob_consistency",
|
|
65151
65218
|
title: "Number range consistency",
|
|
65152
65219
|
shortDescription: `Consistency checks for number ranges`,
|
|
65153
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
65154
|
-
|
|
65220
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
65221
|
+
|
|
65155
65222
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
65156
65223
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65157
65224
|
};
|
|
@@ -65428,58 +65495,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
65428
65495
|
title: "Obsolete statements",
|
|
65429
65496
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
65430
65497
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
65431
|
-
extendedInformation: `
|
|
65432
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
65433
|
-
|
|
65434
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
65435
|
-
|
|
65436
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
65437
|
-
|
|
65438
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
65439
|
-
|
|
65440
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
65441
|
-
|
|
65442
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
65443
|
-
|
|
65444
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65445
|
-
|
|
65446
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65447
|
-
|
|
65448
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
65449
|
-
|
|
65450
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
65451
|
-
|
|
65452
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
65453
|
-
|
|
65454
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
65455
|
-
|
|
65456
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
65457
|
-
|
|
65458
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
65459
|
-
|
|
65460
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
65461
|
-
SELECT COUNT(*) is considered okay
|
|
65462
|
-
|
|
65463
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
65464
|
-
|
|
65465
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
65466
|
-
|
|
65467
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
65468
|
-
|
|
65469
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
65470
|
-
|
|
65471
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
65472
|
-
|
|
65498
|
+
extendedInformation: `
|
|
65499
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
65500
|
+
|
|
65501
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
65502
|
+
|
|
65503
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
65504
|
+
|
|
65505
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
65506
|
+
|
|
65507
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
65508
|
+
|
|
65509
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
65510
|
+
|
|
65511
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65512
|
+
|
|
65513
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
65514
|
+
|
|
65515
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
65516
|
+
|
|
65517
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
65518
|
+
|
|
65519
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
65520
|
+
|
|
65521
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
65522
|
+
|
|
65523
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
65524
|
+
|
|
65525
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
65526
|
+
|
|
65527
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
65528
|
+
SELECT COUNT(*) is considered okay
|
|
65529
|
+
|
|
65530
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
65531
|
+
|
|
65532
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
65533
|
+
|
|
65534
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
65535
|
+
|
|
65536
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
65537
|
+
|
|
65538
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
65539
|
+
|
|
65473
65540
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
65474
|
-
badExample: `REFRESH itab.
|
|
65475
|
-
|
|
65476
|
-
COMPUTE foo = 2 + 2.
|
|
65477
|
-
|
|
65478
|
-
MULTIPLY lv_foo BY 2.
|
|
65479
|
-
|
|
65480
|
-
INTERFACE intf LOAD.
|
|
65481
|
-
|
|
65482
|
-
IF foo IS SUPPLIED.
|
|
65541
|
+
badExample: `REFRESH itab.
|
|
65542
|
+
|
|
65543
|
+
COMPUTE foo = 2 + 2.
|
|
65544
|
+
|
|
65545
|
+
MULTIPLY lv_foo BY 2.
|
|
65546
|
+
|
|
65547
|
+
INTERFACE intf LOAD.
|
|
65548
|
+
|
|
65549
|
+
IF foo IS SUPPLIED.
|
|
65483
65550
|
ENDIF.`,
|
|
65484
65551
|
};
|
|
65485
65552
|
}
|
|
@@ -65819,9 +65886,9 @@ class OmitParameterName {
|
|
|
65819
65886
|
key: "omit_parameter_name",
|
|
65820
65887
|
title: "Omit parameter name",
|
|
65821
65888
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
65822
|
-
extendedInformation: `
|
|
65823
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
65824
|
-
|
|
65889
|
+
extendedInformation: `
|
|
65890
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
65891
|
+
|
|
65825
65892
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
65826
65893
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
65827
65894
|
badExample: `method( param = 2 ).`,
|
|
@@ -66027,20 +66094,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
66027
66094
|
shortDescription: `Omit RECEIVING`,
|
|
66028
66095
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
66029
66096
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66030
|
-
badExample: `
|
|
66031
|
-
upload_pack(
|
|
66032
|
-
EXPORTING
|
|
66033
|
-
io_client = lo_client
|
|
66034
|
-
iv_url = iv_url
|
|
66035
|
-
iv_deepen_level = iv_deepen_level
|
|
66036
|
-
it_hashes = lt_hashes
|
|
66037
|
-
RECEIVING
|
|
66097
|
+
badExample: `
|
|
66098
|
+
upload_pack(
|
|
66099
|
+
EXPORTING
|
|
66100
|
+
io_client = lo_client
|
|
66101
|
+
iv_url = iv_url
|
|
66102
|
+
iv_deepen_level = iv_deepen_level
|
|
66103
|
+
it_hashes = lt_hashes
|
|
66104
|
+
RECEIVING
|
|
66038
66105
|
rt_objects = et_objects ).`,
|
|
66039
|
-
goodExample: `
|
|
66040
|
-
et_objects = upload_pack(
|
|
66041
|
-
io_client = lo_client
|
|
66042
|
-
iv_url = iv_url
|
|
66043
|
-
iv_deepen_level = iv_deepen_level
|
|
66106
|
+
goodExample: `
|
|
66107
|
+
et_objects = upload_pack(
|
|
66108
|
+
io_client = lo_client
|
|
66109
|
+
iv_url = iv_url
|
|
66110
|
+
iv_deepen_level = iv_deepen_level
|
|
66044
66111
|
it_hashes = lt_hashes ).`,
|
|
66045
66112
|
};
|
|
66046
66113
|
}
|
|
@@ -66104,8 +66171,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
66104
66171
|
return {
|
|
66105
66172
|
key: "parser_702_chaining",
|
|
66106
66173
|
title: "Parser Error, bad chanining on 702",
|
|
66107
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
66108
|
-
this rule finds these and reports errors.
|
|
66174
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
66175
|
+
this rule finds these and reports errors.
|
|
66109
66176
|
Only active on target version 702 and below.`,
|
|
66110
66177
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
66111
66178
|
};
|
|
@@ -66185,8 +66252,8 @@ class ParserError {
|
|
|
66185
66252
|
return {
|
|
66186
66253
|
key: "parser_error",
|
|
66187
66254
|
title: "Parser error",
|
|
66188
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
66189
|
-
|
|
66255
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
66256
|
+
|
|
66190
66257
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
66191
66258
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
66192
66259
|
};
|
|
@@ -66271,7 +66338,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
66271
66338
|
return {
|
|
66272
66339
|
key: "parser_missing_space",
|
|
66273
66340
|
title: "Parser Error, missing space",
|
|
66274
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
66341
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
66275
66342
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
66276
66343
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
66277
66344
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -66683,25 +66750,25 @@ class PreferInline {
|
|
|
66683
66750
|
key: "prefer_inline",
|
|
66684
66751
|
title: "Prefer Inline Declarations",
|
|
66685
66752
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
66686
|
-
extendedInformation: `EXPERIMENTAL
|
|
66687
|
-
|
|
66688
|
-
Activates if language version is v740sp02 or above.
|
|
66689
|
-
|
|
66690
|
-
Variables must be local(METHOD or FORM).
|
|
66691
|
-
|
|
66692
|
-
No generic or void typed variables. No syntax errors.
|
|
66693
|
-
|
|
66694
|
-
First position used must be a full/pure write.
|
|
66695
|
-
|
|
66696
|
-
Move statment is not a cast(?=)
|
|
66697
|
-
|
|
66753
|
+
extendedInformation: `EXPERIMENTAL
|
|
66754
|
+
|
|
66755
|
+
Activates if language version is v740sp02 or above.
|
|
66756
|
+
|
|
66757
|
+
Variables must be local(METHOD or FORM).
|
|
66758
|
+
|
|
66759
|
+
No generic or void typed variables. No syntax errors.
|
|
66760
|
+
|
|
66761
|
+
First position used must be a full/pure write.
|
|
66762
|
+
|
|
66763
|
+
Move statment is not a cast(?=)
|
|
66764
|
+
|
|
66698
66765
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
66699
66766
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
66700
|
-
badExample: `DATA foo TYPE i.
|
|
66701
|
-
foo = 2.
|
|
66702
|
-
DATA percentage TYPE decfloat34.
|
|
66767
|
+
badExample: `DATA foo TYPE i.
|
|
66768
|
+
foo = 2.
|
|
66769
|
+
DATA percentage TYPE decfloat34.
|
|
66703
66770
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
66704
|
-
goodExample: `DATA(foo) = 2.
|
|
66771
|
+
goodExample: `DATA(foo) = 2.
|
|
66705
66772
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
66706
66773
|
};
|
|
66707
66774
|
}
|
|
@@ -66915,18 +66982,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
66915
66982
|
key: "prefer_is_not",
|
|
66916
66983
|
title: "Prefer IS NOT to NOT IS",
|
|
66917
66984
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
66918
|
-
extendedInformation: `
|
|
66919
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
66920
|
-
|
|
66985
|
+
extendedInformation: `
|
|
66986
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
66987
|
+
|
|
66921
66988
|
"if not is_valid( )." examples are skipped`,
|
|
66922
66989
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66923
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
66924
|
-
IF variable NP 'TODO*'.
|
|
66925
|
-
IF variable <> 42.
|
|
66990
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
66991
|
+
IF variable NP 'TODO*'.
|
|
66992
|
+
IF variable <> 42.
|
|
66926
66993
|
IF variable CO 'hello'.`,
|
|
66927
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
66928
|
-
IF NOT variable CP 'TODO*'.
|
|
66929
|
-
IF NOT variable = 42.
|
|
66994
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
66995
|
+
IF NOT variable CP 'TODO*'.
|
|
66996
|
+
IF NOT variable = 42.
|
|
66930
66997
|
IF NOT variable CA 'hello'.`,
|
|
66931
66998
|
};
|
|
66932
66999
|
}
|
|
@@ -67114,14 +67181,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
67114
67181
|
key: "prefer_raise_exception_new",
|
|
67115
67182
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
67116
67183
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
67117
|
-
extendedInformation: `
|
|
67118
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
67119
|
-
|
|
67184
|
+
extendedInformation: `
|
|
67185
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
67186
|
+
|
|
67120
67187
|
From 752 and up`,
|
|
67121
67188
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
67122
67189
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
67123
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
67124
|
-
EXPORTING
|
|
67190
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
67191
|
+
EXPORTING
|
|
67125
67192
|
previous = exception.`,
|
|
67126
67193
|
};
|
|
67127
67194
|
}
|
|
@@ -67199,7 +67266,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
67199
67266
|
key: "prefer_returning_to_exporting",
|
|
67200
67267
|
title: "Prefer RETURNING to EXPORTING",
|
|
67201
67268
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
67202
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
67269
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
67203
67270
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
67204
67271
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67205
67272
|
};
|
|
@@ -67296,8 +67363,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
67296
67363
|
key: "prefer_xsdbool",
|
|
67297
67364
|
title: "Prefer xsdbool over boolc",
|
|
67298
67365
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
67299
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
67300
|
-
|
|
67366
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
67367
|
+
|
|
67301
67368
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
67302
67369
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
67303
67370
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -67591,26 +67658,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
67591
67658
|
key: "reduce_procedural_code",
|
|
67592
67659
|
title: "Reduce procedural code",
|
|
67593
67660
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
67594
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
67595
|
-
|
|
67596
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
67597
|
-
|
|
67661
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
67662
|
+
|
|
67663
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
67664
|
+
|
|
67598
67665
|
Comments are not counted as statements.`,
|
|
67599
67666
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67600
|
-
badExample: `FORM foo.
|
|
67601
|
-
DATA lv_bar TYPE i.
|
|
67602
|
-
lv_bar = 2 + 2.
|
|
67603
|
-
IF lv_bar = 4.
|
|
67604
|
-
WRITE 'hello world'.
|
|
67605
|
-
ENDIF.
|
|
67606
|
-
DATA lv_bar TYPE i.
|
|
67607
|
-
lv_bar = 2 + 2.
|
|
67608
|
-
IF lv_bar = 4.
|
|
67609
|
-
WRITE 'hello world'.
|
|
67610
|
-
ENDIF.
|
|
67667
|
+
badExample: `FORM foo.
|
|
67668
|
+
DATA lv_bar TYPE i.
|
|
67669
|
+
lv_bar = 2 + 2.
|
|
67670
|
+
IF lv_bar = 4.
|
|
67671
|
+
WRITE 'hello world'.
|
|
67672
|
+
ENDIF.
|
|
67673
|
+
DATA lv_bar TYPE i.
|
|
67674
|
+
lv_bar = 2 + 2.
|
|
67675
|
+
IF lv_bar = 4.
|
|
67676
|
+
WRITE 'hello world'.
|
|
67677
|
+
ENDIF.
|
|
67611
67678
|
ENDFORM.`,
|
|
67612
|
-
goodExample: `FORM foo.
|
|
67613
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
67679
|
+
goodExample: `FORM foo.
|
|
67680
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
67614
67681
|
ENDFORM.`,
|
|
67615
67682
|
};
|
|
67616
67683
|
}
|
|
@@ -67854,10 +67921,10 @@ class RemoveDescriptions {
|
|
|
67854
67921
|
return {
|
|
67855
67922
|
key: "remove_descriptions",
|
|
67856
67923
|
title: "Remove descriptions",
|
|
67857
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
67858
|
-
|
|
67859
|
-
Class descriptions are required, see rule description_empty.
|
|
67860
|
-
|
|
67924
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
67925
|
+
|
|
67926
|
+
Class descriptions are required, see rule description_empty.
|
|
67927
|
+
|
|
67861
67928
|
Consider using ABAP Doc for documentation.`,
|
|
67862
67929
|
tags: [],
|
|
67863
67930
|
};
|
|
@@ -67982,16 +68049,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
67982
68049
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67983
68050
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
67984
68051
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
67985
|
-
badExample: `
|
|
67986
|
-
CALL FUNCTION 'ZRFC'
|
|
68052
|
+
badExample: `
|
|
68053
|
+
CALL FUNCTION 'ZRFC'
|
|
67987
68054
|
DESTINATION lv_rfc.`,
|
|
67988
|
-
goodExample: `
|
|
67989
|
-
CALL FUNCTION 'ZRFC'
|
|
67990
|
-
DESTINATION lv_rfc
|
|
67991
|
-
EXCEPTIONS
|
|
67992
|
-
system_failure = 1 MESSAGE msg
|
|
67993
|
-
communication_failure = 2 MESSAGE msg
|
|
67994
|
-
resource_failure = 3
|
|
68055
|
+
goodExample: `
|
|
68056
|
+
CALL FUNCTION 'ZRFC'
|
|
68057
|
+
DESTINATION lv_rfc
|
|
68058
|
+
EXCEPTIONS
|
|
68059
|
+
system_failure = 1 MESSAGE msg
|
|
68060
|
+
communication_failure = 2 MESSAGE msg
|
|
68061
|
+
resource_failure = 3
|
|
67995
68062
|
OTHERS = 4.`,
|
|
67996
68063
|
};
|
|
67997
68064
|
}
|
|
@@ -68075,11 +68142,11 @@ class SelectAddOrderBy {
|
|
|
68075
68142
|
key: "select_add_order_by",
|
|
68076
68143
|
title: "SELECT add ORDER BY",
|
|
68077
68144
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
68078
|
-
extendedInformation: `
|
|
68079
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68080
|
-
|
|
68081
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
68082
|
-
|
|
68145
|
+
extendedInformation: `
|
|
68146
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68147
|
+
|
|
68148
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
68149
|
+
|
|
68083
68150
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
68084
68151
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68085
68152
|
};
|
|
@@ -68208,14 +68275,14 @@ class SelectPerformance {
|
|
|
68208
68275
|
key: "select_performance",
|
|
68209
68276
|
title: "SELECT performance",
|
|
68210
68277
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
68211
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
68212
|
-
|
|
68278
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
68279
|
+
|
|
68213
68280
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
68214
68281
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
68215
|
-
badExample: `SELECT field1, field2 FROM table
|
|
68216
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
68282
|
+
badExample: `SELECT field1, field2 FROM table
|
|
68283
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
68217
68284
|
ENDSELECT.`,
|
|
68218
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
68285
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
68219
68286
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
68220
68287
|
};
|
|
68221
68288
|
}
|
|
@@ -68327,8 +68394,8 @@ class SelectSingleFullKey {
|
|
|
68327
68394
|
key: "select_single_full_key",
|
|
68328
68395
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
68329
68396
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
68330
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
68331
|
-
|
|
68397
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
68398
|
+
|
|
68332
68399
|
If the statement contains a JOIN it is not checked`,
|
|
68333
68400
|
pseudoComment: "EC CI_NOORDER",
|
|
68334
68401
|
tags: [],
|
|
@@ -68745,8 +68812,8 @@ class SICFConsistency {
|
|
|
68745
68812
|
key: "sicf_consistency",
|
|
68746
68813
|
title: "SICF consistency",
|
|
68747
68814
|
shortDescription: `Checks the validity of ICF services`,
|
|
68748
|
-
extendedInformation: `* Class defined in handler must exist
|
|
68749
|
-
* Class must not have any syntax errors
|
|
68815
|
+
extendedInformation: `* Class defined in handler must exist
|
|
68816
|
+
* Class must not have any syntax errors
|
|
68750
68817
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
68751
68818
|
};
|
|
68752
68819
|
}
|
|
@@ -69113,8 +69180,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
69113
69180
|
key: "space_before_dot",
|
|
69114
69181
|
title: "Space before dot",
|
|
69115
69182
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
69116
|
-
extendedInformation: `
|
|
69117
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
69183
|
+
extendedInformation: `
|
|
69184
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
69118
69185
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
69119
69186
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69120
69187
|
badExample: `WRITE bar .`,
|
|
@@ -69300,12 +69367,12 @@ class SQLValueConversion {
|
|
|
69300
69367
|
key: "sql_value_conversion",
|
|
69301
69368
|
title: "Implicit SQL Value Conversion",
|
|
69302
69369
|
shortDescription: `Ensure types match when selecting from database`,
|
|
69303
|
-
extendedInformation: `
|
|
69304
|
-
* Integer to CHAR conversion
|
|
69305
|
-
* Integer to NUMC conversion
|
|
69306
|
-
* NUMC to Integer conversion
|
|
69307
|
-
* CHAR to Integer conversion
|
|
69308
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
69370
|
+
extendedInformation: `
|
|
69371
|
+
* Integer to CHAR conversion
|
|
69372
|
+
* Integer to NUMC conversion
|
|
69373
|
+
* NUMC to Integer conversion
|
|
69374
|
+
* CHAR to Integer conversion
|
|
69375
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
69309
69376
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
69310
69377
|
tags: [],
|
|
69311
69378
|
};
|
|
@@ -69377,7 +69444,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
69377
69444
|
key: "start_at_tab",
|
|
69378
69445
|
title: "Start at tab",
|
|
69379
69446
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
69380
|
-
extendedInformation: `Reports max 100 issues per file
|
|
69447
|
+
extendedInformation: `Reports max 100 issues per file
|
|
69381
69448
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
69382
69449
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69383
69450
|
badExample: ` WRITE a.`,
|
|
@@ -69554,12 +69621,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
69554
69621
|
key: "strict_sql",
|
|
69555
69622
|
title: "Strict SQL",
|
|
69556
69623
|
shortDescription: `Strict SQL`,
|
|
69557
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
69558
|
-
|
|
69559
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
69560
|
-
|
|
69561
|
-
Also see separate rule sql_escape_host_variables
|
|
69562
|
-
|
|
69624
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
69625
|
+
|
|
69626
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
69627
|
+
|
|
69628
|
+
Also see separate rule sql_escape_host_variables
|
|
69629
|
+
|
|
69563
69630
|
Activates from v750 and up`,
|
|
69564
69631
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
69565
69632
|
};
|
|
@@ -69811,11 +69878,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
69811
69878
|
key: "sy_modification",
|
|
69812
69879
|
title: "Modification of SY fields",
|
|
69813
69880
|
shortDescription: `Finds modification of sy fields`,
|
|
69814
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
69815
|
-
|
|
69881
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
69882
|
+
|
|
69816
69883
|
Changes to SY-TVAR* fields are not reported`,
|
|
69817
69884
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69818
|
-
badExample: `sy-uname = 2.
|
|
69885
|
+
badExample: `sy-uname = 2.
|
|
69819
69886
|
sy = sy.`,
|
|
69820
69887
|
};
|
|
69821
69888
|
}
|
|
@@ -69877,8 +69944,8 @@ class TABLEnhancementCategory {
|
|
|
69877
69944
|
key: "tabl_enhancement_category",
|
|
69878
69945
|
title: "TABL enhancement category must be set",
|
|
69879
69946
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
69880
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
69881
|
-
|
|
69947
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
69948
|
+
|
|
69882
69949
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
69883
69950
|
tags: [],
|
|
69884
69951
|
};
|
|
@@ -70006,9 +70073,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
70006
70073
|
title: "Type FORM parameters",
|
|
70007
70074
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
70008
70075
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70009
|
-
badExample: `FORM foo USING bar.
|
|
70076
|
+
badExample: `FORM foo USING bar.
|
|
70010
70077
|
ENDFORM.`,
|
|
70011
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
70078
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
70012
70079
|
ENDFORM.`,
|
|
70013
70080
|
};
|
|
70014
70081
|
}
|
|
@@ -70678,38 +70745,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
70678
70745
|
key: "unnecessary_pragma",
|
|
70679
70746
|
title: "Unnecessary Pragma",
|
|
70680
70747
|
shortDescription: `Finds pragmas which can be removed`,
|
|
70681
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
70682
|
-
|
|
70683
|
-
* NEEDED without definition
|
|
70684
|
-
|
|
70685
|
-
* NO_TEXT without texts
|
|
70686
|
-
|
|
70687
|
-
* SUBRC_OK where sy-subrc is checked
|
|
70688
|
-
|
|
70748
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
70749
|
+
|
|
70750
|
+
* NEEDED without definition
|
|
70751
|
+
|
|
70752
|
+
* NO_TEXT without texts
|
|
70753
|
+
|
|
70754
|
+
* SUBRC_OK where sy-subrc is checked
|
|
70755
|
+
|
|
70689
70756
|
NO_HANDLER inside macros are not checked`,
|
|
70690
70757
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70691
|
-
badExample: `TRY.
|
|
70692
|
-
...
|
|
70693
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
70694
|
-
RETURN. " it has a handler
|
|
70695
|
-
ENDTRY.
|
|
70696
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
70697
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
70698
|
-
IF sy-subrc <> 0.
|
|
70758
|
+
badExample: `TRY.
|
|
70759
|
+
...
|
|
70760
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
70761
|
+
RETURN. " it has a handler
|
|
70762
|
+
ENDTRY.
|
|
70763
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
70764
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
70765
|
+
IF sy-subrc <> 0.
|
|
70699
70766
|
ENDIF.`,
|
|
70700
|
-
goodExample: `TRY.
|
|
70701
|
-
...
|
|
70702
|
-
CATCH zcx_abapgit_exception.
|
|
70703
|
-
RETURN.
|
|
70704
|
-
ENDTRY.
|
|
70705
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
70706
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
70707
|
-
IF sy-subrc <> 0.
|
|
70708
|
-
ENDIF.
|
|
70709
|
-
|
|
70710
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
70711
|
-
test1 TYPE string,
|
|
70712
|
-
test2 TYPE string,
|
|
70767
|
+
goodExample: `TRY.
|
|
70768
|
+
...
|
|
70769
|
+
CATCH zcx_abapgit_exception.
|
|
70770
|
+
RETURN.
|
|
70771
|
+
ENDTRY.
|
|
70772
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
70773
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
70774
|
+
IF sy-subrc <> 0.
|
|
70775
|
+
ENDIF.
|
|
70776
|
+
|
|
70777
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
70778
|
+
test1 TYPE string,
|
|
70779
|
+
test2 TYPE string,
|
|
70713
70780
|
END OF blah.`,
|
|
70714
70781
|
};
|
|
70715
70782
|
}
|
|
@@ -70867,18 +70934,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
70867
70934
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
70868
70935
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
70869
70936
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70870
|
-
badExample: `FORM hello1.
|
|
70871
|
-
WRITE 'world'.
|
|
70872
|
-
RETURN.
|
|
70873
|
-
ENDFORM.
|
|
70874
|
-
|
|
70875
|
-
FORM foo.
|
|
70876
|
-
IF 1 = 2.
|
|
70877
|
-
RETURN.
|
|
70878
|
-
ENDIF.
|
|
70937
|
+
badExample: `FORM hello1.
|
|
70938
|
+
WRITE 'world'.
|
|
70939
|
+
RETURN.
|
|
70940
|
+
ENDFORM.
|
|
70941
|
+
|
|
70942
|
+
FORM foo.
|
|
70943
|
+
IF 1 = 2.
|
|
70944
|
+
RETURN.
|
|
70945
|
+
ENDIF.
|
|
70879
70946
|
ENDFORM.`,
|
|
70880
|
-
goodExample: `FORM hello2.
|
|
70881
|
-
WRITE 'world'.
|
|
70947
|
+
goodExample: `FORM hello2.
|
|
70948
|
+
WRITE 'world'.
|
|
70882
70949
|
ENDFORM.`,
|
|
70883
70950
|
};
|
|
70884
70951
|
}
|
|
@@ -71245,17 +71312,17 @@ class UnusedMethods {
|
|
|
71245
71312
|
key: "unused_methods",
|
|
71246
71313
|
title: "Unused methods",
|
|
71247
71314
|
shortDescription: `Checks for unused methods`,
|
|
71248
|
-
extendedInformation: `Checks private and protected methods.
|
|
71249
|
-
|
|
71250
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
71251
|
-
|
|
71252
|
-
Skips:
|
|
71253
|
-
* methods FOR TESTING
|
|
71254
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
71255
|
-
* class_constructor + constructor methods
|
|
71256
|
-
* event handlers
|
|
71257
|
-
* methods that are redefined
|
|
71258
|
-
* INCLUDEs
|
|
71315
|
+
extendedInformation: `Checks private and protected methods.
|
|
71316
|
+
|
|
71317
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
71318
|
+
|
|
71319
|
+
Skips:
|
|
71320
|
+
* methods FOR TESTING
|
|
71321
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
71322
|
+
* class_constructor + constructor methods
|
|
71323
|
+
* event handlers
|
|
71324
|
+
* methods that are redefined
|
|
71325
|
+
* INCLUDEs
|
|
71259
71326
|
`,
|
|
71260
71327
|
tags: [],
|
|
71261
71328
|
pragma: "##CALLED",
|
|
@@ -71645,23 +71712,23 @@ class UnusedVariables {
|
|
|
71645
71712
|
key: "unused_variables",
|
|
71646
71713
|
title: "Unused variables",
|
|
71647
71714
|
shortDescription: `Checks for unused variables and constants`,
|
|
71648
|
-
extendedInformation: `Skips event parameters.
|
|
71649
|
-
|
|
71650
|
-
Note that this currently does not work if the source code uses macros.
|
|
71651
|
-
|
|
71652
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
71653
|
-
|
|
71715
|
+
extendedInformation: `Skips event parameters.
|
|
71716
|
+
|
|
71717
|
+
Note that this currently does not work if the source code uses macros.
|
|
71718
|
+
|
|
71719
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
71720
|
+
|
|
71654
71721
|
Errors found in INCLUDES are reported for the main program.`,
|
|
71655
71722
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
71656
71723
|
pragma: "##NEEDED",
|
|
71657
71724
|
pseudoComment: "EC NEEDED",
|
|
71658
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
71659
|
-
test TYPE string,
|
|
71660
|
-
test2 TYPE string,
|
|
71725
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
71726
|
+
test TYPE string,
|
|
71727
|
+
test2 TYPE string,
|
|
71661
71728
|
END OF blah1.`,
|
|
71662
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
71663
|
-
test TYPE string,
|
|
71664
|
-
test2 TYPE string,
|
|
71729
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
71730
|
+
test TYPE string,
|
|
71731
|
+
test2 TYPE string,
|
|
71665
71732
|
END OF blah2.`,
|
|
71666
71733
|
};
|
|
71667
71734
|
}
|
|
@@ -71880,15 +71947,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
71880
71947
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
71881
71948
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
71882
71949
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
71883
|
-
badExample: `IF line IS INITIAL.
|
|
71884
|
-
has_entries = abap_false.
|
|
71885
|
-
ELSE.
|
|
71886
|
-
has_entries = abap_true.
|
|
71887
|
-
ENDIF.
|
|
71888
|
-
|
|
71950
|
+
badExample: `IF line IS INITIAL.
|
|
71951
|
+
has_entries = abap_false.
|
|
71952
|
+
ELSE.
|
|
71953
|
+
has_entries = abap_true.
|
|
71954
|
+
ENDIF.
|
|
71955
|
+
|
|
71889
71956
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
71890
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
71891
|
-
|
|
71957
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
71958
|
+
|
|
71892
71959
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
71893
71960
|
};
|
|
71894
71961
|
}
|
|
@@ -72064,15 +72131,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
72064
72131
|
key: "use_line_exists",
|
|
72065
72132
|
title: "Use line_exists",
|
|
72066
72133
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
72067
|
-
extendedInformation: `
|
|
72068
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
72069
|
-
|
|
72134
|
+
extendedInformation: `
|
|
72135
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
72136
|
+
|
|
72070
72137
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
72071
72138
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72072
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
72073
|
-
IF sy-subrc = 0.
|
|
72139
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
72140
|
+
IF sy-subrc = 0.
|
|
72074
72141
|
ENDIF.`,
|
|
72075
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
72142
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
72076
72143
|
ENDIF.`,
|
|
72077
72144
|
};
|
|
72078
72145
|
}
|
|
@@ -72182,10 +72249,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
72182
72249
|
key: "use_new",
|
|
72183
72250
|
title: "Use NEW",
|
|
72184
72251
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
72185
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
72186
|
-
|
|
72187
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
72188
|
-
|
|
72252
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
72253
|
+
|
|
72254
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
72255
|
+
|
|
72189
72256
|
Applicable from v740sp02 and up`,
|
|
72190
72257
|
badExample: `CREATE OBJECT ref.`,
|
|
72191
72258
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -72283,13 +72350,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
72283
72350
|
title: "WHEN OTHERS last",
|
|
72284
72351
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
72285
72352
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72286
|
-
badExample: `CASE bar.
|
|
72287
|
-
WHEN OTHERS.
|
|
72288
|
-
WHEN 2.
|
|
72353
|
+
badExample: `CASE bar.
|
|
72354
|
+
WHEN OTHERS.
|
|
72355
|
+
WHEN 2.
|
|
72289
72356
|
ENDCASE.`,
|
|
72290
|
-
goodExample: `CASE bar.
|
|
72291
|
-
WHEN 2.
|
|
72292
|
-
WHEN OTHERS.
|
|
72357
|
+
goodExample: `CASE bar.
|
|
72358
|
+
WHEN 2.
|
|
72359
|
+
WHEN OTHERS.
|
|
72293
72360
|
ENDCASE.`,
|
|
72294
72361
|
};
|
|
72295
72362
|
}
|