@abaplint/cli 2.110.3 → 2.110.5
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 +812 -809
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -7922,9 +7922,9 @@ class SQLCase extends combi_1.Expression {
|
|
|
7922
7922
|
const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
|
|
7923
7923
|
const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7924
7924
|
const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource);
|
|
7925
|
-
const when = (0, combi_1.seq)("WHEN", (0, combi_1.
|
|
7925
|
+
const when = (0, combi_1.seq)("WHEN", (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant), "THEN", sourc, (0, combi_1.starPrio)(sub));
|
|
7926
7926
|
const els = (0, combi_1.seq)("ELSE", sourc);
|
|
7927
|
-
return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.
|
|
7927
|
+
return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)(sql_field_name_1.SQLFieldName), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"));
|
|
7928
7928
|
}
|
|
7929
7929
|
}
|
|
7930
7930
|
exports.SQLCase = SQLCase;
|
|
@@ -9276,7 +9276,7 @@ class TypeTable extends combi_1.Expression {
|
|
|
9276
9276
|
const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), _1.TypeName);
|
|
9277
9277
|
const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
|
|
9278
9278
|
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
9279
|
-
const rangeLike = (0, combi_1.seq)("RANGE OF",
|
|
9279
|
+
const rangeLike = (0, combi_1.seq)("RANGE OF", field_chain_1.FieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
9280
9280
|
// a maximum of 15 secondary table keys can be defined
|
|
9281
9281
|
// "WITH" is not allowed as a field name in keys
|
|
9282
9282
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
@@ -23287,7 +23287,7 @@ class BasicTypes {
|
|
|
23287
23287
|
return new Types.TableType(structure, options, name);
|
|
23288
23288
|
}
|
|
23289
23289
|
else if (text.startsWith("LIKE RANGE OF ")) {
|
|
23290
|
-
const sub = node.findFirstExpression(Expressions.
|
|
23290
|
+
const sub = node.findFirstExpression(Expressions.FieldChain);
|
|
23291
23291
|
found = this.resolveLikeName(sub);
|
|
23292
23292
|
if (found === undefined) {
|
|
23293
23293
|
return new Types.UnknownType("LIKE RANGE OF, could not resolve type");
|
|
@@ -34468,13 +34468,13 @@ class FlowGraph {
|
|
|
34468
34468
|
this.label = label;
|
|
34469
34469
|
}
|
|
34470
34470
|
toDigraph() {
|
|
34471
|
-
return `digraph G {
|
|
34472
|
-
labelloc="t";
|
|
34473
|
-
label="${this.label}";
|
|
34474
|
-
graph [fontname = "helvetica"];
|
|
34475
|
-
node [fontname = "helvetica", shape="box"];
|
|
34476
|
-
edge [fontname = "helvetica"];
|
|
34477
|
-
${this.toTextEdges()}
|
|
34471
|
+
return `digraph G {
|
|
34472
|
+
labelloc="t";
|
|
34473
|
+
label="${this.label}";
|
|
34474
|
+
graph [fontname = "helvetica"];
|
|
34475
|
+
node [fontname = "helvetica", shape="box"];
|
|
34476
|
+
edge [fontname = "helvetica"];
|
|
34477
|
+
${this.toTextEdges()}
|
|
34478
34478
|
}`;
|
|
34479
34479
|
}
|
|
34480
34480
|
listSources(node) {
|
|
@@ -41349,8 +41349,8 @@ exports.MemoryFile = MemoryFile;
|
|
|
41349
41349
|
"use strict";
|
|
41350
41350
|
|
|
41351
41351
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
41352
|
-
exports.
|
|
41353
|
-
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = void 0;
|
|
41352
|
+
exports.PrettyPrinter = exports.Position = exports.CurrentScope = exports.ABAPFile = exports.RulesRunner = exports.SpaghettiScope = exports.SyntaxLogic = exports.ABAPObject = exports.Tokens = exports.ExpressionsCDS = exports.CDSParser = exports.LanguageServerTypes = exports.DDLParser = exports.NativeSQL = exports.MacroContent = exports.MacroCall = exports.applyEditList = exports.applyEditSingle = exports.SpaghettiScopeNode = exports.AbstractFile = exports.Token = exports.ScopeType = exports.BasicTypes = exports.TypedIdentifier = exports.AbstractType = exports.VirtualPosition = exports.Comment = exports.Unknown = exports.Empty = exports.Identifier = exports.Nodes = exports.Types = exports.Expressions = exports.Statements = exports.Structures = exports.SkipLogic = exports.Objects = exports.ArtifactsRules = exports.ArtifactsObjects = exports.ArtifactsABAP = exports.BuiltIn = exports.MethodLengthStats = exports.LanguageServer = exports.Registry = exports.CyclomaticComplexityStats = exports.ReferenceType = exports.Version = exports.Config = exports.Issue = exports.MemoryFile = void 0;
|
|
41353
|
+
exports.LSPEdit = exports.RuleTag = exports.Severity = exports.Visibility = exports.Info = exports.Diagnostics = exports.Rename = void 0;
|
|
41354
41354
|
const issue_1 = __webpack_require__(/*! ./issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
41355
41355
|
Object.defineProperty(exports, "Issue", ({ enumerable: true, get: function () { return issue_1.Issue; } }));
|
|
41356
41356
|
const config_1 = __webpack_require__(/*! ./config */ "./node_modules/@abaplint/core/build/src/config.js");
|
|
@@ -41418,6 +41418,9 @@ const _statement_1 = __webpack_require__(/*! ./abap/2_statements/statements/_sta
|
|
|
41418
41418
|
Object.defineProperty(exports, "Empty", ({ enumerable: true, get: function () { return _statement_1.Empty; } }));
|
|
41419
41419
|
Object.defineProperty(exports, "Unknown", ({ enumerable: true, get: function () { return _statement_1.Unknown; } }));
|
|
41420
41420
|
Object.defineProperty(exports, "Comment", ({ enumerable: true, get: function () { return _statement_1.Comment; } }));
|
|
41421
|
+
Object.defineProperty(exports, "MacroCall", ({ enumerable: true, get: function () { return _statement_1.MacroCall; } }));
|
|
41422
|
+
Object.defineProperty(exports, "MacroContent", ({ enumerable: true, get: function () { return _statement_1.MacroContent; } }));
|
|
41423
|
+
Object.defineProperty(exports, "NativeSQL", ({ enumerable: true, get: function () { return _statement_1.NativeSQL; } }));
|
|
41421
41424
|
const edit_helper_1 = __webpack_require__(/*! ./edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
41422
41425
|
Object.defineProperty(exports, "applyEditSingle", ({ enumerable: true, get: function () { return edit_helper_1.applyEditSingle; } }));
|
|
41423
41426
|
Object.defineProperty(exports, "applyEditList", ({ enumerable: true, get: function () { return edit_helper_1.applyEditList; } }));
|
|
@@ -42570,13 +42573,13 @@ class Help {
|
|
|
42570
42573
|
/////////////////////////////////////////////////
|
|
42571
42574
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42572
42575
|
let content = "";
|
|
42573
|
-
content = `
|
|
42574
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42575
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42576
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42577
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42578
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42579
|
-
<hr>
|
|
42576
|
+
content = `
|
|
42577
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42578
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42579
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42580
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42581
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42582
|
+
<hr>
|
|
42580
42583
|
` +
|
|
42581
42584
|
"<tt>" + textDocument.uri + " (" +
|
|
42582
42585
|
(position.line + 1) + ", " +
|
|
@@ -51778,7 +51781,7 @@ class Registry {
|
|
|
51778
51781
|
}
|
|
51779
51782
|
static abaplintVersion() {
|
|
51780
51783
|
// magic, see build script "version.sh"
|
|
51781
|
-
return "2.110.
|
|
51784
|
+
return "2.110.5";
|
|
51782
51785
|
}
|
|
51783
51786
|
getDDICReferences() {
|
|
51784
51787
|
return this.ddicReferences;
|
|
@@ -52097,10 +52100,10 @@ class SevenBitAscii {
|
|
|
52097
52100
|
key: "7bit_ascii",
|
|
52098
52101
|
title: "Check for 7bit ascii",
|
|
52099
52102
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
52100
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52101
|
-
|
|
52102
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52103
|
-
|
|
52103
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
52104
|
+
|
|
52105
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
52106
|
+
|
|
52104
52107
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
52105
52108
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52106
52109
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52306,10 +52309,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52306
52309
|
key: "abapdoc",
|
|
52307
52310
|
title: "Check abapdoc",
|
|
52308
52311
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52309
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52310
|
-
|
|
52311
|
-
Plus class and interface definitions.
|
|
52312
|
-
|
|
52312
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52313
|
+
|
|
52314
|
+
Plus class and interface definitions.
|
|
52315
|
+
|
|
52313
52316
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52314
52317
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52315
52318
|
};
|
|
@@ -52447,49 +52450,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52447
52450
|
key: "align_parameters",
|
|
52448
52451
|
title: "Align Parameters",
|
|
52449
52452
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52450
|
-
extendedInformation: `Checks:
|
|
52451
|
-
* function module calls
|
|
52452
|
-
* method calls
|
|
52453
|
-
* VALUE constructors
|
|
52454
|
-
* NEW constructors
|
|
52455
|
-
* RAISE EXCEPTION statements
|
|
52456
|
-
* CREATE OBJECT statements
|
|
52457
|
-
* RAISE EVENT statements
|
|
52458
|
-
|
|
52459
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52460
|
-
|
|
52461
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52462
|
-
|
|
52463
|
-
If parameters are on the same row, no issues are reported, see
|
|
52453
|
+
extendedInformation: `Checks:
|
|
52454
|
+
* function module calls
|
|
52455
|
+
* method calls
|
|
52456
|
+
* VALUE constructors
|
|
52457
|
+
* NEW constructors
|
|
52458
|
+
* RAISE EXCEPTION statements
|
|
52459
|
+
* CREATE OBJECT statements
|
|
52460
|
+
* RAISE EVENT statements
|
|
52461
|
+
|
|
52462
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52463
|
+
|
|
52464
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52465
|
+
|
|
52466
|
+
If parameters are on the same row, no issues are reported, see
|
|
52464
52467
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52465
52468
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52466
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52467
|
-
EXPORTING
|
|
52468
|
-
foo = 2
|
|
52469
|
-
parameter = 3.
|
|
52470
|
-
|
|
52471
|
-
foobar( moo = 1
|
|
52472
|
-
param = 1 ).
|
|
52473
|
-
|
|
52474
|
-
foo = VALUE #(
|
|
52475
|
-
foo = bar
|
|
52469
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52470
|
+
EXPORTING
|
|
52471
|
+
foo = 2
|
|
52472
|
+
parameter = 3.
|
|
52473
|
+
|
|
52474
|
+
foobar( moo = 1
|
|
52475
|
+
param = 1 ).
|
|
52476
|
+
|
|
52477
|
+
foo = VALUE #(
|
|
52478
|
+
foo = bar
|
|
52476
52479
|
moo = 2 ).`,
|
|
52477
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52478
|
-
EXPORTING
|
|
52479
|
-
foo = 2
|
|
52480
|
-
parameter = 3.
|
|
52481
|
-
|
|
52482
|
-
foobar( moo = 1
|
|
52483
|
-
param = 1 ).
|
|
52484
|
-
|
|
52485
|
-
foo = VALUE #(
|
|
52486
|
-
foo = bar
|
|
52487
|
-
moo = 2 ).
|
|
52488
|
-
|
|
52489
|
-
DATA(sdf) = VALUE type(
|
|
52490
|
-
common_val = 2
|
|
52491
|
-
another_common = 5
|
|
52492
|
-
( row_value = 4
|
|
52480
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52481
|
+
EXPORTING
|
|
52482
|
+
foo = 2
|
|
52483
|
+
parameter = 3.
|
|
52484
|
+
|
|
52485
|
+
foobar( moo = 1
|
|
52486
|
+
param = 1 ).
|
|
52487
|
+
|
|
52488
|
+
foo = VALUE #(
|
|
52489
|
+
foo = bar
|
|
52490
|
+
moo = 2 ).
|
|
52491
|
+
|
|
52492
|
+
DATA(sdf) = VALUE type(
|
|
52493
|
+
common_val = 2
|
|
52494
|
+
another_common = 5
|
|
52495
|
+
( row_value = 4
|
|
52493
52496
|
value_foo = 5 ) ).`,
|
|
52494
52497
|
};
|
|
52495
52498
|
}
|
|
@@ -52923,37 +52926,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52923
52926
|
key: "align_type_expressions",
|
|
52924
52927
|
title: "Align TYPE expressions",
|
|
52925
52928
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52926
|
-
extendedInformation: `
|
|
52927
|
-
Currently works for METHODS + BEGIN OF
|
|
52928
|
-
|
|
52929
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52930
|
-
|
|
52931
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52929
|
+
extendedInformation: `
|
|
52930
|
+
Currently works for METHODS + BEGIN OF
|
|
52931
|
+
|
|
52932
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52933
|
+
|
|
52934
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52932
52935
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52933
52936
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52934
|
-
badExample: `
|
|
52935
|
-
TYPES: BEGIN OF foo,
|
|
52936
|
-
bar TYPE i,
|
|
52937
|
-
foobar TYPE i,
|
|
52938
|
-
END OF foo.
|
|
52939
|
-
|
|
52940
|
-
INTERFACE lif.
|
|
52941
|
-
METHODS bar
|
|
52942
|
-
IMPORTING
|
|
52943
|
-
foo TYPE i
|
|
52944
|
-
foobar TYPE i.
|
|
52937
|
+
badExample: `
|
|
52938
|
+
TYPES: BEGIN OF foo,
|
|
52939
|
+
bar TYPE i,
|
|
52940
|
+
foobar TYPE i,
|
|
52941
|
+
END OF foo.
|
|
52942
|
+
|
|
52943
|
+
INTERFACE lif.
|
|
52944
|
+
METHODS bar
|
|
52945
|
+
IMPORTING
|
|
52946
|
+
foo TYPE i
|
|
52947
|
+
foobar TYPE i.
|
|
52945
52948
|
ENDINTERFACE.`,
|
|
52946
|
-
goodExample: `
|
|
52947
|
-
TYPES: BEGIN OF foo,
|
|
52948
|
-
bar TYPE i,
|
|
52949
|
-
foobar TYPE i,
|
|
52950
|
-
END OF foo.
|
|
52951
|
-
|
|
52952
|
-
INTERFACE lif.
|
|
52953
|
-
METHODS bar
|
|
52954
|
-
IMPORTING
|
|
52955
|
-
foo TYPE i
|
|
52956
|
-
foobar TYPE i.
|
|
52949
|
+
goodExample: `
|
|
52950
|
+
TYPES: BEGIN OF foo,
|
|
52951
|
+
bar TYPE i,
|
|
52952
|
+
foobar TYPE i,
|
|
52953
|
+
END OF foo.
|
|
52954
|
+
|
|
52955
|
+
INTERFACE lif.
|
|
52956
|
+
METHODS bar
|
|
52957
|
+
IMPORTING
|
|
52958
|
+
foo TYPE i
|
|
52959
|
+
foobar TYPE i.
|
|
52957
52960
|
ENDINTERFACE.`,
|
|
52958
52961
|
};
|
|
52959
52962
|
}
|
|
@@ -53232,15 +53235,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
53232
53235
|
return {
|
|
53233
53236
|
key: "ambiguous_statement",
|
|
53234
53237
|
title: "Check for ambigious statements",
|
|
53235
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53236
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53237
|
-
|
|
53238
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53239
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53240
|
+
|
|
53238
53241
|
Only works if the target version is 740sp05 or above`,
|
|
53239
53242
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53240
|
-
badExample: `DELETE foo FROM bar.
|
|
53243
|
+
badExample: `DELETE foo FROM bar.
|
|
53241
53244
|
MODIFY foo FROM bar.`,
|
|
53242
|
-
goodExample: `DELETE foo FROM @bar.
|
|
53243
|
-
MODIFY TABLE foo FROM bar.
|
|
53245
|
+
goodExample: `DELETE foo FROM @bar.
|
|
53246
|
+
MODIFY TABLE foo FROM bar.
|
|
53244
53247
|
MODIFY zfoo FROM @wa.`,
|
|
53245
53248
|
};
|
|
53246
53249
|
}
|
|
@@ -53345,16 +53348,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53345
53348
|
key: "avoid_use",
|
|
53346
53349
|
title: "Avoid use of certain statements",
|
|
53347
53350
|
shortDescription: `Detects usage of certain statements.`,
|
|
53348
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53349
|
-
|
|
53350
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53351
|
-
|
|
53352
|
-
STATICS: use CLASS-DATA instead
|
|
53353
|
-
|
|
53354
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53355
|
-
|
|
53356
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53357
|
-
|
|
53351
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53352
|
+
|
|
53353
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53354
|
+
|
|
53355
|
+
STATICS: use CLASS-DATA instead
|
|
53356
|
+
|
|
53357
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53358
|
+
|
|
53359
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53360
|
+
|
|
53358
53361
|
BREAK points`,
|
|
53359
53362
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53360
53363
|
};
|
|
@@ -53486,11 +53489,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53486
53489
|
title: "Check BEGIN END names",
|
|
53487
53490
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53488
53491
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53489
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53490
|
-
field TYPE i,
|
|
53492
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53493
|
+
field TYPE i,
|
|
53491
53494
|
END OF structure_not_the_same.`,
|
|
53492
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53493
|
-
field TYPE i,
|
|
53495
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53496
|
+
field TYPE i,
|
|
53494
53497
|
END OF stru.`,
|
|
53495
53498
|
};
|
|
53496
53499
|
}
|
|
@@ -53587,20 +53590,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53587
53590
|
title: "BEGIN contains single INCLUDE",
|
|
53588
53591
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53589
53592
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53590
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53591
|
-
INCLUDE TYPE dselc.
|
|
53592
|
-
TYPES: END OF dummy1.
|
|
53593
|
-
|
|
53594
|
-
DATA BEGIN OF foo.
|
|
53595
|
-
INCLUDE STRUCTURE syst.
|
|
53596
|
-
DATA END OF foo.
|
|
53597
|
-
|
|
53598
|
-
STATICS BEGIN OF bar.
|
|
53599
|
-
INCLUDE STRUCTURE syst.
|
|
53593
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
53594
|
+
INCLUDE TYPE dselc.
|
|
53595
|
+
TYPES: END OF dummy1.
|
|
53596
|
+
|
|
53597
|
+
DATA BEGIN OF foo.
|
|
53598
|
+
INCLUDE STRUCTURE syst.
|
|
53599
|
+
DATA END OF foo.
|
|
53600
|
+
|
|
53601
|
+
STATICS BEGIN OF bar.
|
|
53602
|
+
INCLUDE STRUCTURE syst.
|
|
53600
53603
|
STATICS END OF bar.`,
|
|
53601
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53602
|
-
DATA field TYPE i.
|
|
53603
|
-
INCLUDE STRUCTURE dselc.
|
|
53604
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53605
|
+
DATA field TYPE i.
|
|
53606
|
+
INCLUDE STRUCTURE dselc.
|
|
53604
53607
|
DATA END OF foo.`,
|
|
53605
53608
|
};
|
|
53606
53609
|
}
|
|
@@ -53690,9 +53693,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53690
53693
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53691
53694
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53692
53695
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53693
|
-
goodExample: `TRY.
|
|
53694
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53695
|
-
CATCH cx_sy_authorization_error.
|
|
53696
|
+
goodExample: `TRY.
|
|
53697
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53698
|
+
CATCH cx_sy_authorization_error.
|
|
53696
53699
|
ENDTRY.`,
|
|
53697
53700
|
};
|
|
53698
53701
|
}
|
|
@@ -53757,10 +53760,10 @@ class CDSCommentStyle {
|
|
|
53757
53760
|
key: "cds_comment_style",
|
|
53758
53761
|
title: "CDS Comment Style",
|
|
53759
53762
|
shortDescription: `Check for obsolete comment style`,
|
|
53760
|
-
extendedInformation: `Check for obsolete comment style
|
|
53761
|
-
|
|
53762
|
-
Comments starting with "--" are considered obsolete
|
|
53763
|
-
|
|
53763
|
+
extendedInformation: `Check for obsolete comment style
|
|
53764
|
+
|
|
53765
|
+
Comments starting with "--" are considered obsolete
|
|
53766
|
+
|
|
53764
53767
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53765
53768
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53766
53769
|
badExample: "-- this is a comment",
|
|
@@ -53827,10 +53830,10 @@ class CDSLegacyView {
|
|
|
53827
53830
|
title: "CDS Legacy View",
|
|
53828
53831
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53829
53832
|
// eslint-disable-next-line max-len
|
|
53830
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53831
|
-
|
|
53832
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53833
|
-
|
|
53833
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53834
|
+
|
|
53835
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53836
|
+
|
|
53834
53837
|
v755 and up`,
|
|
53835
53838
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53836
53839
|
};
|
|
@@ -53985,10 +53988,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53985
53988
|
key: "chain_mainly_declarations",
|
|
53986
53989
|
title: "Chain mainly declarations",
|
|
53987
53990
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53988
|
-
extendedInformation: `
|
|
53989
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53990
|
-
|
|
53991
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53991
|
+
extendedInformation: `
|
|
53992
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53993
|
+
|
|
53994
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53992
53995
|
`,
|
|
53993
53996
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53994
53997
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -54164,17 +54167,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
54164
54167
|
title: "Change IF to CASE",
|
|
54165
54168
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
54166
54169
|
// eslint-disable-next-line max-len
|
|
54167
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54168
|
-
|
|
54170
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
54171
|
+
|
|
54169
54172
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
54170
54173
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54171
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54172
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54173
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
54174
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
54175
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
54176
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
54174
54177
|
ENDIF.`,
|
|
54175
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
54176
|
-
WHEN 'FOO'.
|
|
54177
|
-
WHEN 'BAR' OR 'MOO'.
|
|
54178
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
54179
|
+
WHEN 'FOO'.
|
|
54180
|
+
WHEN 'BAR' OR 'MOO'.
|
|
54178
54181
|
ENDCASE.`,
|
|
54179
54182
|
};
|
|
54180
54183
|
}
|
|
@@ -54311,8 +54314,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54311
54314
|
return {
|
|
54312
54315
|
key: "check_abstract",
|
|
54313
54316
|
title: "Check abstract methods and classes",
|
|
54314
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54315
|
-
- class defined as abstract and final,
|
|
54317
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54318
|
+
- class defined as abstract and final,
|
|
54316
54319
|
- non-abstract class contains abstract methods`,
|
|
54317
54320
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54318
54321
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54393,11 +54396,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54393
54396
|
return {
|
|
54394
54397
|
key: "check_comments",
|
|
54395
54398
|
title: "Check Comments",
|
|
54396
|
-
shortDescription: `
|
|
54399
|
+
shortDescription: `
|
|
54397
54400
|
Various checks for comment usage.`,
|
|
54398
|
-
extendedInformation: `
|
|
54399
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54400
|
-
|
|
54401
|
+
extendedInformation: `
|
|
54402
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54403
|
+
|
|
54401
54404
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54402
54405
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54403
54406
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54559,9 +54562,9 @@ class CheckInclude {
|
|
|
54559
54562
|
key: "check_include",
|
|
54560
54563
|
title: "Check INCLUDEs",
|
|
54561
54564
|
shortDescription: `Checks INCLUDE statements`,
|
|
54562
|
-
extendedInformation: `
|
|
54563
|
-
* Reports unused includes
|
|
54564
|
-
* Errors if the includes are not found
|
|
54565
|
+
extendedInformation: `
|
|
54566
|
+
* Reports unused includes
|
|
54567
|
+
* Errors if the includes are not found
|
|
54565
54568
|
* Error if including a main program`,
|
|
54566
54569
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54567
54570
|
};
|
|
@@ -54637,14 +54640,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54637
54640
|
key: "check_subrc",
|
|
54638
54641
|
title: "Check sy-subrc",
|
|
54639
54642
|
shortDescription: `Check sy-subrc`,
|
|
54640
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54641
|
-
|
|
54642
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54643
|
-
|
|
54644
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54645
|
-
|
|
54646
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54647
|
-
|
|
54643
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54644
|
+
|
|
54645
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54646
|
+
|
|
54647
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54648
|
+
|
|
54649
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54650
|
+
|
|
54648
54651
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54649
54652
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
54650
54653
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -55213,17 +55216,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
55213
55216
|
shortDescription: `Find overlapping classic exceptions`,
|
|
55214
55217
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
55215
55218
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55216
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55217
|
-
EXCEPTIONS
|
|
55218
|
-
system_failure = 1 MESSAGE lv_message
|
|
55219
|
-
communication_failure = 1 MESSAGE lv_message
|
|
55220
|
-
resource_failure = 1
|
|
55219
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55220
|
+
EXCEPTIONS
|
|
55221
|
+
system_failure = 1 MESSAGE lv_message
|
|
55222
|
+
communication_failure = 1 MESSAGE lv_message
|
|
55223
|
+
resource_failure = 1
|
|
55221
55224
|
OTHERS = 1.`,
|
|
55222
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55223
|
-
EXCEPTIONS
|
|
55224
|
-
system_failure = 1 MESSAGE lv_message
|
|
55225
|
-
communication_failure = 2 MESSAGE lv_message
|
|
55226
|
-
resource_failure = 3
|
|
55225
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55226
|
+
EXCEPTIONS
|
|
55227
|
+
system_failure = 1 MESSAGE lv_message
|
|
55228
|
+
communication_failure = 2 MESSAGE lv_message
|
|
55229
|
+
resource_failure = 3
|
|
55227
55230
|
OTHERS = 4.`,
|
|
55228
55231
|
};
|
|
55229
55232
|
}
|
|
@@ -55469,7 +55472,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55469
55472
|
key: "commented_code",
|
|
55470
55473
|
title: "Find commented code",
|
|
55471
55474
|
shortDescription: `Detects usage of commented out code.`,
|
|
55472
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55475
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55473
55476
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55474
55477
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55475
55478
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55702,10 +55705,10 @@ class ConstructorVisibilityPublic {
|
|
|
55702
55705
|
key: "constructor_visibility_public",
|
|
55703
55706
|
title: "Check constructor visibility is public",
|
|
55704
55707
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55705
|
-
extendedInformation: `
|
|
55706
|
-
This only applies to global classes.
|
|
55707
|
-
|
|
55708
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55708
|
+
extendedInformation: `
|
|
55709
|
+
This only applies to global classes.
|
|
55710
|
+
|
|
55711
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55709
55712
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55710
55713
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55711
55714
|
};
|
|
@@ -55780,8 +55783,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55780
55783
|
key: "contains_tab",
|
|
55781
55784
|
title: "Code contains tab",
|
|
55782
55785
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55783
|
-
extendedInformation: `
|
|
55784
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55786
|
+
extendedInformation: `
|
|
55787
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55785
55788
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55786
55789
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55787
55790
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55868,10 +55871,10 @@ class CyclicOO {
|
|
|
55868
55871
|
key: "cyclic_oo",
|
|
55869
55872
|
title: "Cyclic OO",
|
|
55870
55873
|
shortDescription: `Finds cyclic OO references`,
|
|
55871
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55872
|
-
|
|
55873
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55874
|
-
|
|
55874
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55875
|
+
|
|
55876
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55877
|
+
|
|
55875
55878
|
References in testclass includes are ignored`,
|
|
55876
55879
|
};
|
|
55877
55880
|
}
|
|
@@ -56113,7 +56116,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
56113
56116
|
key: "dangerous_statement",
|
|
56114
56117
|
title: "Dangerous statement",
|
|
56115
56118
|
shortDescription: `Detects potentially dangerous statements`,
|
|
56116
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56119
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
56117
56120
|
dynamic SQL can potentially create SQL injection problems`,
|
|
56118
56121
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
56119
56122
|
};
|
|
@@ -56317,13 +56320,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56317
56320
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56318
56321
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56319
56322
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56320
|
-
badExample: `FROM foo.
|
|
56321
|
-
WRITE 'hello'.
|
|
56322
|
-
DATA int TYPE i.
|
|
56323
|
+
badExample: `FROM foo.
|
|
56324
|
+
WRITE 'hello'.
|
|
56325
|
+
DATA int TYPE i.
|
|
56323
56326
|
ENDFORM.`,
|
|
56324
|
-
goodExample: `FROM foo.
|
|
56325
|
-
DATA int TYPE i.
|
|
56326
|
-
WRITE 'hello'.
|
|
56327
|
+
goodExample: `FROM foo.
|
|
56328
|
+
DATA int TYPE i.
|
|
56329
|
+
WRITE 'hello'.
|
|
56327
56330
|
ENDFORM.`,
|
|
56328
56331
|
};
|
|
56329
56332
|
}
|
|
@@ -56859,39 +56862,39 @@ class Downport {
|
|
|
56859
56862
|
key: "downport",
|
|
56860
56863
|
title: "Downport statement",
|
|
56861
56864
|
shortDescription: `Downport functionality`,
|
|
56862
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56863
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56864
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56865
|
-
|
|
56866
|
-
Current rules:
|
|
56867
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56868
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56869
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56870
|
-
* CONV is outlined
|
|
56871
|
-
* COND is outlined
|
|
56872
|
-
* REDUCE is outlined
|
|
56873
|
-
* SWITCH is outlined
|
|
56874
|
-
* FILTER is outlined
|
|
56875
|
-
* APPEND expression is outlined
|
|
56876
|
-
* INSERT expression is outlined
|
|
56877
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56878
|
-
* CAST changed to ?=
|
|
56879
|
-
* LOOP AT method_call( ) is outlined
|
|
56880
|
-
* VALUE # with structure fields
|
|
56881
|
-
* VALUE # with internal table lines
|
|
56882
|
-
* Table Expressions are outlined
|
|
56883
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56884
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56885
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56886
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56887
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56888
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56889
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56890
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56891
|
-
* MESSAGE with non simple source
|
|
56892
|
-
|
|
56893
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56894
|
-
|
|
56865
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56866
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56867
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56868
|
+
|
|
56869
|
+
Current rules:
|
|
56870
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56871
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56872
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56873
|
+
* CONV is outlined
|
|
56874
|
+
* COND is outlined
|
|
56875
|
+
* REDUCE is outlined
|
|
56876
|
+
* SWITCH is outlined
|
|
56877
|
+
* FILTER is outlined
|
|
56878
|
+
* APPEND expression is outlined
|
|
56879
|
+
* INSERT expression is outlined
|
|
56880
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56881
|
+
* CAST changed to ?=
|
|
56882
|
+
* LOOP AT method_call( ) is outlined
|
|
56883
|
+
* VALUE # with structure fields
|
|
56884
|
+
* VALUE # with internal table lines
|
|
56885
|
+
* Table Expressions are outlined
|
|
56886
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56887
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56888
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56889
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56890
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56891
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56892
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56893
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56894
|
+
* MESSAGE with non simple source
|
|
56895
|
+
|
|
56896
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56897
|
+
|
|
56895
56898
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56896
56899
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56897
56900
|
};
|
|
@@ -57469,10 +57472,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57469
57472
|
const fieldName = f.concatTokens();
|
|
57470
57473
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57471
57474
|
}
|
|
57472
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57475
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57473
57476
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57474
57477
|
}
|
|
57475
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57478
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57476
57479
|
${indentation}`);
|
|
57477
57480
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57478
57481
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57516,12 +57519,12 @@ ${indentation}`);
|
|
|
57516
57519
|
}
|
|
57517
57520
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57518
57521
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
57519
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57520
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57521
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57522
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57523
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57524
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57522
57525
|
${indentation}`);
|
|
57523
57526
|
if (fieldDefinitions === "") {
|
|
57524
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57527
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57525
57528
|
${indentation}`);
|
|
57526
57529
|
}
|
|
57527
57530
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57589,7 +57592,7 @@ ${indentation}`);
|
|
|
57589
57592
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57590
57593
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57591
57594
|
const firstToken = high.getFirstToken();
|
|
57592
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57595
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57593
57596
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57594
57597
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57595
57598
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57643,7 +57646,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57643
57646
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57644
57647
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57645
57648
|
const firstToken = high.getFirstToken();
|
|
57646
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57649
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57647
57650
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57648
57651
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57649
57652
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57685,14 +57688,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57685
57688
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57686
57689
|
const firstToken = high.getFirstToken();
|
|
57687
57690
|
// note that the tabix restore should be done before throwing the exception
|
|
57688
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57689
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57690
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57691
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57692
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57693
|
-
${indentation}IF sy-subrc <> 0.
|
|
57694
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57695
|
-
${indentation}ENDIF.
|
|
57691
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57692
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57693
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57694
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57695
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57696
|
+
${indentation}IF sy-subrc <> 0.
|
|
57697
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57698
|
+
${indentation}ENDIF.
|
|
57696
57699
|
${indentation}`);
|
|
57697
57700
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57698
57701
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57749,7 +57752,7 @@ ${indentation}`);
|
|
|
57749
57752
|
const className = classNames[0].concatTokens();
|
|
57750
57753
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57751
57754
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57752
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57755
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57753
57756
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57754
57757
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57755
57758
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57911,16 +57914,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57911
57914
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57912
57915
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57913
57916
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57914
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57915
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57917
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57918
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57916
57919
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57917
57920
|
if (withs.length > 0) {
|
|
57918
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57919
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57920
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57921
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57922
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57923
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57921
57924
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57922
57925
|
}
|
|
57923
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57926
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57924
57927
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57925
57928
|
if (withs.length > 0) {
|
|
57926
57929
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -58032,10 +58035,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
58032
58035
|
let code = "";
|
|
58033
58036
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
58034
58037
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58035
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58036
|
-
IF sy-subrc <> 0.
|
|
58037
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58038
|
-
ENDIF.
|
|
58038
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
58039
|
+
IF sy-subrc <> 0.
|
|
58040
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58041
|
+
ENDIF.
|
|
58039
58042
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
58040
58043
|
}
|
|
58041
58044
|
else {
|
|
@@ -58124,20 +58127,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
58124
58127
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58125
58128
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58126
58129
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58127
|
-
code += ` items LIKE ${loopSourceName},
|
|
58128
|
-
END OF ${groupTargetName}type.
|
|
58129
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58130
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58130
|
+
code += ` items LIKE ${loopSourceName},
|
|
58131
|
+
END OF ${groupTargetName}type.
|
|
58132
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
58133
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
58131
58134
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
58132
58135
|
if (groupIndexName !== undefined) {
|
|
58133
58136
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
58134
58137
|
}
|
|
58135
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58138
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
58136
58139
|
IF sy-subrc = 0.\n`;
|
|
58137
58140
|
if (groupCountName !== undefined) {
|
|
58138
58141
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
58139
58142
|
}
|
|
58140
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58143
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
58141
58144
|
ELSE.\n`;
|
|
58142
58145
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
58143
58146
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -58158,8 +58161,8 @@ ELSE.\n`;
|
|
|
58158
58161
|
}
|
|
58159
58162
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
58160
58163
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
58161
|
-
code += `ENDIF.
|
|
58162
|
-
ENDLOOP.
|
|
58164
|
+
code += `ENDIF.
|
|
58165
|
+
ENDLOOP.
|
|
58163
58166
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
58164
58167
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
58165
58168
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58331,7 +58334,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58331
58334
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58332
58335
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58333
58336
|
// all ENUMS are char like?
|
|
58334
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58337
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58335
58338
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58336
58339
|
let count = 1;
|
|
58337
58340
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58375,14 +58378,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58375
58378
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58376
58379
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58377
58380
|
// restore tabix before exeption
|
|
58378
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58379
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58380
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58381
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58382
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58383
|
-
${indentation}IF sy-subrc <> 0.
|
|
58384
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58385
|
-
${indentation}ENDIF.
|
|
58381
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58382
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58383
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58384
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58385
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58386
|
+
${indentation}IF sy-subrc <> 0.
|
|
58387
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58388
|
+
${indentation}ENDIF.
|
|
58386
58389
|
${indentation}${uniqueName}`;
|
|
58387
58390
|
const start = target.getFirstToken().getStart();
|
|
58388
58391
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58466,11 +58469,11 @@ ${indentation}${uniqueName}`;
|
|
|
58466
58469
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58467
58470
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58468
58471
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58469
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58470
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58471
|
-
${indentation} EXPORTING
|
|
58472
|
-
${indentation} input = ${source}
|
|
58473
|
-
${indentation} IMPORTING
|
|
58472
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58473
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58474
|
+
${indentation} EXPORTING
|
|
58475
|
+
${indentation} input = ${source}
|
|
58476
|
+
${indentation} IMPORTING
|
|
58474
58477
|
${indentation} output = ${uniqueName}.\n`;
|
|
58475
58478
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58476
58479
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59782,12 +59785,12 @@ class EasyToFindMessages {
|
|
|
59782
59785
|
key: "easy_to_find_messages",
|
|
59783
59786
|
title: "Easy to find messages",
|
|
59784
59787
|
shortDescription: `Make messages easy to find`,
|
|
59785
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59786
|
-
|
|
59787
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59788
|
-
|
|
59789
|
-
Also see rule "message_exists"
|
|
59790
|
-
|
|
59788
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
59789
|
+
|
|
59790
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
59791
|
+
|
|
59792
|
+
Also see rule "message_exists"
|
|
59793
|
+
|
|
59791
59794
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59792
59795
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59793
59796
|
};
|
|
@@ -59872,8 +59875,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59872
59875
|
key: "empty_line_in_statement",
|
|
59873
59876
|
title: "Find empty lines in statements",
|
|
59874
59877
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59875
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59876
|
-
|
|
59878
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59879
|
+
|
|
59877
59880
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59878
59881
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59879
59882
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -60049,13 +60052,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
60049
60052
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
60050
60053
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
60051
60054
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60052
|
-
badExample: `IF foo = bar.
|
|
60053
|
-
ENDIF.
|
|
60054
|
-
|
|
60055
|
-
DO 2 TIMES.
|
|
60055
|
+
badExample: `IF foo = bar.
|
|
60056
|
+
ENDIF.
|
|
60057
|
+
|
|
60058
|
+
DO 2 TIMES.
|
|
60056
60059
|
ENDDO.`,
|
|
60057
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60058
|
-
ENDLOOP.
|
|
60060
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
60061
|
+
ENDLOOP.
|
|
60059
60062
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
60060
60063
|
};
|
|
60061
60064
|
}
|
|
@@ -60197,10 +60200,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
60197
60200
|
return {
|
|
60198
60201
|
key: "exit_or_check",
|
|
60199
60202
|
title: "Find EXIT or CHECK outside loops",
|
|
60200
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60203
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60201
60204
|
Use RETURN to leave procesing blocks instead.`,
|
|
60202
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60203
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60205
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60206
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60204
60207
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
60205
60208
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60206
60209
|
};
|
|
@@ -60283,12 +60286,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
60283
60286
|
key: "expand_macros",
|
|
60284
60287
|
title: "Expand Macros",
|
|
60285
60288
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
60286
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60287
|
-
|
|
60289
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60290
|
+
|
|
60288
60291
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
60289
|
-
badExample: `DEFINE _hello.
|
|
60290
|
-
WRITE 'hello'.
|
|
60291
|
-
END-OF-DEFINITION.
|
|
60292
|
+
badExample: `DEFINE _hello.
|
|
60293
|
+
WRITE 'hello'.
|
|
60294
|
+
END-OF-DEFINITION.
|
|
60292
60295
|
_hello.`,
|
|
60293
60296
|
goodExample: `WRITE 'hello'.`,
|
|
60294
60297
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60375,7 +60378,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60375
60378
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60376
60379
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60377
60380
|
goodExample: `call_method( foo = bar ).`,
|
|
60378
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60381
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60379
60382
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60380
60383
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60381
60384
|
};
|
|
@@ -60473,7 +60476,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60473
60476
|
key: "forbidden_identifier",
|
|
60474
60477
|
title: "Forbidden Identifier",
|
|
60475
60478
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60476
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60479
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60477
60480
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60478
60481
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60479
60482
|
};
|
|
@@ -60715,8 +60718,8 @@ class ForbiddenVoidType {
|
|
|
60715
60718
|
key: "forbidden_void_type",
|
|
60716
60719
|
title: "Forbidden Void Types",
|
|
60717
60720
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60718
|
-
extendedInformation: `Inspiration:
|
|
60719
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60721
|
+
extendedInformation: `Inspiration:
|
|
60722
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60720
60723
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60721
60724
|
};
|
|
60722
60725
|
}
|
|
@@ -60959,7 +60962,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60959
60962
|
key: "fully_type_itabs",
|
|
60960
60963
|
title: "Fully type internal tables",
|
|
60961
60964
|
shortDescription: `No implict table types or table keys`,
|
|
60962
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60965
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60963
60966
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60964
60967
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60965
60968
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -61144,26 +61147,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
61144
61147
|
key: "functional_writing",
|
|
61145
61148
|
title: "Use functional writing",
|
|
61146
61149
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
61147
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61150
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
61148
61151
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
61149
61152
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61150
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61151
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61152
|
-
EXPORTING
|
|
61153
|
-
p_name = 'NAME'
|
|
61154
|
-
RECEIVING
|
|
61155
|
-
p_descr_ref = lr_typedescr
|
|
61156
|
-
EXCEPTIONS
|
|
61157
|
-
type_not_found = 1
|
|
61153
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
61154
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
61155
|
+
EXPORTING
|
|
61156
|
+
p_name = 'NAME'
|
|
61157
|
+
RECEIVING
|
|
61158
|
+
p_descr_ref = lr_typedescr
|
|
61159
|
+
EXCEPTIONS
|
|
61160
|
+
type_not_found = 1
|
|
61158
61161
|
OTHERS = 2.`,
|
|
61159
|
-
goodExample: `zcl_class=>method( ).
|
|
61160
|
-
cl_abap_typedescr=>describe_by_name(
|
|
61161
|
-
EXPORTING
|
|
61162
|
-
p_name = 'NAME'
|
|
61163
|
-
RECEIVING
|
|
61164
|
-
p_descr_ref = lr_typedescr
|
|
61165
|
-
EXCEPTIONS
|
|
61166
|
-
type_not_found = 1
|
|
61162
|
+
goodExample: `zcl_class=>method( ).
|
|
61163
|
+
cl_abap_typedescr=>describe_by_name(
|
|
61164
|
+
EXPORTING
|
|
61165
|
+
p_name = 'NAME'
|
|
61166
|
+
RECEIVING
|
|
61167
|
+
p_descr_ref = lr_typedescr
|
|
61168
|
+
EXCEPTIONS
|
|
61169
|
+
type_not_found = 1
|
|
61167
61170
|
OTHERS = 2 ).`,
|
|
61168
61171
|
};
|
|
61169
61172
|
}
|
|
@@ -61274,14 +61277,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
61274
61277
|
key: "global_class",
|
|
61275
61278
|
title: "Global class checks",
|
|
61276
61279
|
shortDescription: `Checks related to global classes`,
|
|
61277
|
-
extendedInformation: `* global classes must be in own files
|
|
61278
|
-
|
|
61279
|
-
* file names must match class name
|
|
61280
|
-
|
|
61281
|
-
* file names must match interface name
|
|
61282
|
-
|
|
61283
|
-
* global classes must be global definitions
|
|
61284
|
-
|
|
61280
|
+
extendedInformation: `* global classes must be in own files
|
|
61281
|
+
|
|
61282
|
+
* file names must match class name
|
|
61283
|
+
|
|
61284
|
+
* file names must match interface name
|
|
61285
|
+
|
|
61286
|
+
* global classes must be global definitions
|
|
61287
|
+
|
|
61285
61288
|
* global interfaces must be global definitions`,
|
|
61286
61289
|
tags: [_irule_1.RuleTag.Syntax],
|
|
61287
61290
|
};
|
|
@@ -61380,21 +61383,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61380
61383
|
return {
|
|
61381
61384
|
key: "identical_conditions",
|
|
61382
61385
|
title: "Identical conditions",
|
|
61383
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61384
|
-
|
|
61386
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61387
|
+
|
|
61385
61388
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61386
61389
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61387
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61388
|
-
ENDIF.
|
|
61389
|
-
CASE bar.
|
|
61390
|
-
WHEN '1'.
|
|
61391
|
-
WHEN 'A' OR '1'.
|
|
61390
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61391
|
+
ENDIF.
|
|
61392
|
+
CASE bar.
|
|
61393
|
+
WHEN '1'.
|
|
61394
|
+
WHEN 'A' OR '1'.
|
|
61392
61395
|
ENDCASE.`,
|
|
61393
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61394
|
-
ENDIF.
|
|
61395
|
-
CASE bar.
|
|
61396
|
-
WHEN '1'.
|
|
61397
|
-
WHEN 'A'.
|
|
61396
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61397
|
+
ENDIF.
|
|
61398
|
+
CASE bar.
|
|
61399
|
+
WHEN '1'.
|
|
61400
|
+
WHEN 'A'.
|
|
61398
61401
|
ENDCASE.`,
|
|
61399
61402
|
};
|
|
61400
61403
|
}
|
|
@@ -61528,23 +61531,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61528
61531
|
key: "identical_contents",
|
|
61529
61532
|
title: "Identical contents",
|
|
61530
61533
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61531
|
-
extendedInformation: `
|
|
61532
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61533
|
-
|
|
61534
|
+
extendedInformation: `
|
|
61535
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61536
|
+
|
|
61534
61537
|
Chained statments are ignored`,
|
|
61535
61538
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61536
|
-
badExample: `IF foo = bar.
|
|
61537
|
-
WRITE 'bar'.
|
|
61538
|
-
WRITE 'world'.
|
|
61539
|
-
ELSE.
|
|
61540
|
-
WRITE 'foo'.
|
|
61541
|
-
WRITE 'world'.
|
|
61539
|
+
badExample: `IF foo = bar.
|
|
61540
|
+
WRITE 'bar'.
|
|
61541
|
+
WRITE 'world'.
|
|
61542
|
+
ELSE.
|
|
61543
|
+
WRITE 'foo'.
|
|
61544
|
+
WRITE 'world'.
|
|
61542
61545
|
ENDIF.`,
|
|
61543
|
-
goodExample: `IF foo = bar.
|
|
61544
|
-
WRITE 'bar'.
|
|
61545
|
-
ELSE.
|
|
61546
|
-
WRITE 'foo'.
|
|
61547
|
-
ENDIF.
|
|
61546
|
+
goodExample: `IF foo = bar.
|
|
61547
|
+
WRITE 'bar'.
|
|
61548
|
+
ELSE.
|
|
61549
|
+
WRITE 'foo'.
|
|
61550
|
+
ENDIF.
|
|
61548
61551
|
WRITE 'world'.`,
|
|
61549
61552
|
};
|
|
61550
61553
|
}
|
|
@@ -61652,12 +61655,12 @@ class IdenticalDescriptions {
|
|
|
61652
61655
|
key: "identical_descriptions",
|
|
61653
61656
|
title: "Identical descriptions",
|
|
61654
61657
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61655
|
-
extendedInformation: `Case insensitive
|
|
61656
|
-
|
|
61657
|
-
Only checks the master language descriptions
|
|
61658
|
-
|
|
61659
|
-
Dependencies are skipped
|
|
61660
|
-
|
|
61658
|
+
extendedInformation: `Case insensitive
|
|
61659
|
+
|
|
61660
|
+
Only checks the master language descriptions
|
|
61661
|
+
|
|
61662
|
+
Dependencies are skipped
|
|
61663
|
+
|
|
61661
61664
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61662
61665
|
tags: [],
|
|
61663
61666
|
};
|
|
@@ -61831,43 +61834,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61831
61834
|
key: "if_in_if",
|
|
61832
61835
|
title: "IF in IF",
|
|
61833
61836
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61834
|
-
extendedInformation: `
|
|
61835
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61836
|
-
|
|
61837
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61838
|
-
|
|
61839
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
61837
|
+
extendedInformation: `
|
|
61838
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61839
|
+
|
|
61840
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61841
|
+
|
|
61842
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
61840
61843
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61841
|
-
badExample: `IF condition1.
|
|
61842
|
-
IF condition2.
|
|
61843
|
-
...
|
|
61844
|
-
ENDIF.
|
|
61845
|
-
ENDIF.
|
|
61846
|
-
|
|
61847
|
-
IF condition1.
|
|
61848
|
-
...
|
|
61849
|
-
ELSE.
|
|
61850
|
-
IF condition2.
|
|
61851
|
-
...
|
|
61852
|
-
ENDIF.
|
|
61844
|
+
badExample: `IF condition1.
|
|
61845
|
+
IF condition2.
|
|
61846
|
+
...
|
|
61847
|
+
ENDIF.
|
|
61848
|
+
ENDIF.
|
|
61849
|
+
|
|
61850
|
+
IF condition1.
|
|
61851
|
+
...
|
|
61852
|
+
ELSE.
|
|
61853
|
+
IF condition2.
|
|
61854
|
+
...
|
|
61855
|
+
ENDIF.
|
|
61853
61856
|
ENDIF.`,
|
|
61854
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61855
|
-
...
|
|
61856
|
-
ENDIF.
|
|
61857
|
-
|
|
61858
|
-
IF condition1.
|
|
61859
|
-
...
|
|
61860
|
-
ELSEIF condition2.
|
|
61861
|
-
...
|
|
61862
|
-
ENDIF.
|
|
61863
|
-
|
|
61864
|
-
CASE variable.
|
|
61865
|
-
WHEN value1.
|
|
61866
|
-
...
|
|
61867
|
-
WHEN value2.
|
|
61868
|
-
IF condition2.
|
|
61869
|
-
...
|
|
61870
|
-
ENDIF.
|
|
61857
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61858
|
+
...
|
|
61859
|
+
ENDIF.
|
|
61860
|
+
|
|
61861
|
+
IF condition1.
|
|
61862
|
+
...
|
|
61863
|
+
ELSEIF condition2.
|
|
61864
|
+
...
|
|
61865
|
+
ENDIF.
|
|
61866
|
+
|
|
61867
|
+
CASE variable.
|
|
61868
|
+
WHEN value1.
|
|
61869
|
+
...
|
|
61870
|
+
WHEN value2.
|
|
61871
|
+
IF condition2.
|
|
61872
|
+
...
|
|
61873
|
+
ENDIF.
|
|
61871
61874
|
ENDCASE.`,
|
|
61872
61875
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61873
61876
|
};
|
|
@@ -62052,9 +62055,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
62052
62055
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
62053
62056
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
62054
62057
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
62055
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62056
|
-
METHOD ${methodName.toLowerCase()}.
|
|
62057
|
-
RETURN. " todo, implement method
|
|
62058
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
62059
|
+
METHOD ${methodName.toLowerCase()}.
|
|
62060
|
+
RETURN. " todo, implement method
|
|
62058
62061
|
ENDMETHOD.`);
|
|
62059
62062
|
}
|
|
62060
62063
|
}
|
|
@@ -62242,19 +62245,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
62242
62245
|
key: "in_statement_indentation",
|
|
62243
62246
|
title: "In-statement indentation",
|
|
62244
62247
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
62245
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62246
|
-
|
|
62247
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62248
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62249
|
+
|
|
62250
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62248
62251
|
to distinguish them better from code within the block.`,
|
|
62249
|
-
badExample: `IF 1 = 1
|
|
62250
|
-
AND 2 = 2.
|
|
62251
|
-
WRITE 'hello' &&
|
|
62252
|
-
'world'.
|
|
62252
|
+
badExample: `IF 1 = 1
|
|
62253
|
+
AND 2 = 2.
|
|
62254
|
+
WRITE 'hello' &&
|
|
62255
|
+
'world'.
|
|
62253
62256
|
ENDIF.`,
|
|
62254
|
-
goodExample: `IF 1 = 1
|
|
62255
|
-
AND 2 = 2.
|
|
62256
|
-
WRITE 'hello' &&
|
|
62257
|
-
'world'.
|
|
62257
|
+
goodExample: `IF 1 = 1
|
|
62258
|
+
AND 2 = 2.
|
|
62259
|
+
WRITE 'hello' &&
|
|
62260
|
+
'world'.
|
|
62258
62261
|
ENDIF.`,
|
|
62259
62262
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62260
62263
|
};
|
|
@@ -62377,23 +62380,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62377
62380
|
title: "Indentation",
|
|
62378
62381
|
shortDescription: `Checks indentation`,
|
|
62379
62382
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62380
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62381
|
-
PRIVATE SECTION.
|
|
62382
|
-
METHODS constructor.
|
|
62383
|
-
ENDCLASS.
|
|
62384
|
-
|
|
62385
|
-
CLASS lcl IMPLEMENTATION.
|
|
62386
|
-
METHOD constructor.
|
|
62387
|
-
ENDMETHOD.
|
|
62383
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62384
|
+
PRIVATE SECTION.
|
|
62385
|
+
METHODS constructor.
|
|
62386
|
+
ENDCLASS.
|
|
62387
|
+
|
|
62388
|
+
CLASS lcl IMPLEMENTATION.
|
|
62389
|
+
METHOD constructor.
|
|
62390
|
+
ENDMETHOD.
|
|
62388
62391
|
ENDCLASS.`,
|
|
62389
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62390
|
-
PRIVATE SECTION.
|
|
62391
|
-
METHODS constructor.
|
|
62392
|
-
ENDCLASS.
|
|
62393
|
-
|
|
62394
|
-
CLASS lcl IMPLEMENTATION.
|
|
62395
|
-
METHOD constructor.
|
|
62396
|
-
ENDMETHOD.
|
|
62392
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62393
|
+
PRIVATE SECTION.
|
|
62394
|
+
METHODS constructor.
|
|
62395
|
+
ENDCLASS.
|
|
62396
|
+
|
|
62397
|
+
CLASS lcl IMPLEMENTATION.
|
|
62398
|
+
METHOD constructor.
|
|
62399
|
+
ENDMETHOD.
|
|
62397
62400
|
ENDCLASS.`,
|
|
62398
62401
|
};
|
|
62399
62402
|
}
|
|
@@ -62782,9 +62785,9 @@ class IntfReferencingClas {
|
|
|
62782
62785
|
key: "intf_referencing_clas",
|
|
62783
62786
|
title: "INTF referencing CLAS",
|
|
62784
62787
|
shortDescription: `Interface contains references to class`,
|
|
62785
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62786
|
-
Only first level references are checked.
|
|
62787
|
-
Exception class references are ignored.
|
|
62788
|
+
extendedInformation: `Only global interfaces are checked.
|
|
62789
|
+
Only first level references are checked.
|
|
62790
|
+
Exception class references are ignored.
|
|
62788
62791
|
Void references are ignored.`,
|
|
62789
62792
|
};
|
|
62790
62793
|
}
|
|
@@ -62869,9 +62872,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
62869
62872
|
title: "Invalid Table Index",
|
|
62870
62873
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
62871
62874
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62872
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
62875
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
62873
62876
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
62874
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
62877
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
62875
62878
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62876
62879
|
};
|
|
62877
62880
|
}
|
|
@@ -63472,8 +63475,8 @@ class LineBreakStyle {
|
|
|
63472
63475
|
return {
|
|
63473
63476
|
key: "line_break_style",
|
|
63474
63477
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63475
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63476
|
-
|
|
63478
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63479
|
+
|
|
63477
63480
|
abapGit does not work with CRLF`,
|
|
63478
63481
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63479
63482
|
};
|
|
@@ -63542,7 +63545,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63542
63545
|
key: "line_length",
|
|
63543
63546
|
title: "Line length",
|
|
63544
63547
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63545
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63548
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63546
63549
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63547
63550
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63548
63551
|
};
|
|
@@ -63613,7 +63616,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63613
63616
|
key: "line_only_punc",
|
|
63614
63617
|
title: "Line containing only punctuation",
|
|
63615
63618
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63616
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63619
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63617
63620
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63618
63621
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63619
63622
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -63873,15 +63876,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63873
63876
|
return {
|
|
63874
63877
|
key: "local_variable_names",
|
|
63875
63878
|
title: "Local variable naming conventions",
|
|
63876
|
-
shortDescription: `
|
|
63877
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63879
|
+
shortDescription: `
|
|
63880
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63878
63881
|
Regexes are case-insensitive.`,
|
|
63879
63882
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
63880
|
-
badExample: `FORM bar.
|
|
63881
|
-
DATA foo.
|
|
63883
|
+
badExample: `FORM bar.
|
|
63884
|
+
DATA foo.
|
|
63882
63885
|
ENDFORM.`,
|
|
63883
|
-
goodExample: `FORM bar.
|
|
63884
|
-
DATA lv_foo.
|
|
63886
|
+
goodExample: `FORM bar.
|
|
63887
|
+
DATA lv_foo.
|
|
63885
63888
|
ENDFORM.`,
|
|
63886
63889
|
};
|
|
63887
63890
|
}
|
|
@@ -64104,10 +64107,10 @@ class MainFileContents {
|
|
|
64104
64107
|
key: "main_file_contents",
|
|
64105
64108
|
title: "Main file contents",
|
|
64106
64109
|
shortDescription: `Checks related to report declarations.`,
|
|
64107
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
64108
|
-
|
|
64109
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64110
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64110
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
64111
|
+
|
|
64112
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
64113
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
64111
64114
|
`,
|
|
64112
64115
|
};
|
|
64113
64116
|
}
|
|
@@ -64223,17 +64226,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
64223
64226
|
title: "Too many parentheses",
|
|
64224
64227
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
64225
64228
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64226
|
-
badExample: `
|
|
64227
|
-
IF ( destination IS INITIAL ).
|
|
64228
|
-
ENDIF.
|
|
64229
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64230
|
-
ENDIF.
|
|
64229
|
+
badExample: `
|
|
64230
|
+
IF ( destination IS INITIAL ).
|
|
64231
|
+
ENDIF.
|
|
64232
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
64233
|
+
ENDIF.
|
|
64231
64234
|
`,
|
|
64232
|
-
goodExample: `
|
|
64233
|
-
IF destination IS INITIAL.
|
|
64234
|
-
ENDIF.
|
|
64235
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
64236
|
-
ENDIF.
|
|
64235
|
+
goodExample: `
|
|
64236
|
+
IF destination IS INITIAL.
|
|
64237
|
+
ENDIF.
|
|
64238
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
64239
|
+
ENDIF.
|
|
64237
64240
|
`,
|
|
64238
64241
|
};
|
|
64239
64242
|
}
|
|
@@ -64407,14 +64410,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64407
64410
|
title: "Max one method parameter definition per line",
|
|
64408
64411
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64409
64412
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64410
|
-
badExample: `
|
|
64411
|
-
METHODS apps_scope_token
|
|
64412
|
-
IMPORTING
|
|
64413
|
+
badExample: `
|
|
64414
|
+
METHODS apps_scope_token
|
|
64415
|
+
IMPORTING
|
|
64413
64416
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64414
|
-
goodExample: `
|
|
64415
|
-
METHODS apps_scope_token
|
|
64416
|
-
IMPORTING
|
|
64417
|
-
body TYPE bodyapps_scope_token
|
|
64417
|
+
goodExample: `
|
|
64418
|
+
METHODS apps_scope_token
|
|
64419
|
+
IMPORTING
|
|
64420
|
+
body TYPE bodyapps_scope_token
|
|
64418
64421
|
client_id TYPE str.`,
|
|
64419
64422
|
};
|
|
64420
64423
|
}
|
|
@@ -64479,11 +64482,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64479
64482
|
key: "max_one_statement",
|
|
64480
64483
|
title: "Max one statement per line",
|
|
64481
64484
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64482
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64483
|
-
|
|
64484
|
-
Does not report anything for chained statements.
|
|
64485
|
-
|
|
64486
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64485
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64486
|
+
|
|
64487
|
+
Does not report anything for chained statements.
|
|
64488
|
+
|
|
64489
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64487
64490
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64488
64491
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64489
64492
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -64821,8 +64824,8 @@ class MethodLength {
|
|
|
64821
64824
|
key: "method_length",
|
|
64822
64825
|
title: "Method/Form Length",
|
|
64823
64826
|
shortDescription: `Checks relating to method/form length.`,
|
|
64824
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64825
|
-
|
|
64827
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64828
|
+
|
|
64826
64829
|
Abstract methods without statements are considered okay.`,
|
|
64827
64830
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64828
64831
|
};
|
|
@@ -64927,20 +64930,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
64927
64930
|
key: "method_overwrites_builtin",
|
|
64928
64931
|
title: "Method name overwrites builtin function",
|
|
64929
64932
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
64930
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64931
|
-
|
|
64932
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64933
|
-
|
|
64933
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64934
|
+
|
|
64935
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64936
|
+
|
|
64934
64937
|
Interface method names are ignored`,
|
|
64935
64938
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64936
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64937
|
-
PUBLIC SECTION.
|
|
64938
|
-
METHODS matches.
|
|
64939
|
-
ENDCLASS.
|
|
64940
|
-
|
|
64941
|
-
CLASS lcl IMPLEMENTATION.
|
|
64942
|
-
METHOD matches.
|
|
64943
|
-
ENDMETHOD.
|
|
64939
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64940
|
+
PUBLIC SECTION.
|
|
64941
|
+
METHODS matches.
|
|
64942
|
+
ENDCLASS.
|
|
64943
|
+
|
|
64944
|
+
CLASS lcl IMPLEMENTATION.
|
|
64945
|
+
METHOD matches.
|
|
64946
|
+
ENDMETHOD.
|
|
64944
64947
|
ENDCLASS.`,
|
|
64945
64948
|
};
|
|
64946
64949
|
}
|
|
@@ -65131,12 +65134,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
65131
65134
|
// eslint-disable-next-line max-len
|
|
65132
65135
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
65133
65136
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65134
|
-
badExample: `CLASS lcl DEFINITION.
|
|
65135
|
-
PUBLIC SECTION.
|
|
65136
|
-
METHODS
|
|
65137
|
-
foobar
|
|
65138
|
-
EXPORTING foo TYPE i
|
|
65139
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
65137
|
+
badExample: `CLASS lcl DEFINITION.
|
|
65138
|
+
PUBLIC SECTION.
|
|
65139
|
+
METHODS
|
|
65140
|
+
foobar
|
|
65141
|
+
EXPORTING foo TYPE i
|
|
65142
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
65140
65143
|
ENDCLASS.`,
|
|
65141
65144
|
};
|
|
65142
65145
|
}
|
|
@@ -65516,7 +65519,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65516
65519
|
key: "nesting",
|
|
65517
65520
|
title: "Check nesting depth",
|
|
65518
65521
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65519
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65522
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65520
65523
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65521
65524
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65522
65525
|
};
|
|
@@ -65759,7 +65762,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65759
65762
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65760
65763
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65761
65764
|
badExample: `var1 = var2 = var3.`,
|
|
65762
|
-
goodExample: `var2 = var3.
|
|
65765
|
+
goodExample: `var2 = var3.
|
|
65763
65766
|
var1 = var2.`,
|
|
65764
65767
|
};
|
|
65765
65768
|
}
|
|
@@ -65818,8 +65821,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
65818
65821
|
key: "no_external_form_calls",
|
|
65819
65822
|
title: "No external FORM calls",
|
|
65820
65823
|
shortDescription: `Detect external form calls`,
|
|
65821
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65822
|
-
|
|
65824
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65825
|
+
|
|
65823
65826
|
PERFORM foo(bar).`,
|
|
65824
65827
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65825
65828
|
};
|
|
@@ -65880,17 +65883,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
65880
65883
|
key: "no_inline_in_optional_branches",
|
|
65881
65884
|
title: "Don't declare inline in optional branches",
|
|
65882
65885
|
shortDescription: `Don't declare inline in optional branches`,
|
|
65883
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65884
|
-
|
|
65885
|
-
Considered optional branches:
|
|
65886
|
-
* inside IF/ELSEIF/ELSE
|
|
65887
|
-
* inside LOOP
|
|
65888
|
-
* inside WHILE
|
|
65889
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
65890
|
-
* inside DO
|
|
65891
|
-
* inside SELECT loops
|
|
65892
|
-
|
|
65893
|
-
Not considered optional branches:
|
|
65886
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65887
|
+
|
|
65888
|
+
Considered optional branches:
|
|
65889
|
+
* inside IF/ELSEIF/ELSE
|
|
65890
|
+
* inside LOOP
|
|
65891
|
+
* inside WHILE
|
|
65892
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
65893
|
+
* inside DO
|
|
65894
|
+
* inside SELECT loops
|
|
65895
|
+
|
|
65896
|
+
Not considered optional branches:
|
|
65894
65897
|
* TRY/CATCH/CLEANUP`,
|
|
65895
65898
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65896
65899
|
};
|
|
@@ -65990,12 +65993,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
65990
65993
|
key: "no_prefixes",
|
|
65991
65994
|
title: "No Prefixes",
|
|
65992
65995
|
shortDescription: `Dont use hungarian notation`,
|
|
65993
|
-
extendedInformation: `
|
|
65994
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65995
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65996
|
-
|
|
65997
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65998
|
-
|
|
65996
|
+
extendedInformation: `
|
|
65997
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65998
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65999
|
+
|
|
66000
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
66001
|
+
|
|
65999
66002
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
66000
66003
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66001
66004
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -66174,7 +66177,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
66174
66177
|
return {
|
|
66175
66178
|
key: "no_public_attributes",
|
|
66176
66179
|
title: "No public attributes",
|
|
66177
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66180
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
66178
66181
|
Exceptions are excluded from this rule.`,
|
|
66179
66182
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
66180
66183
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -66275,13 +66278,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
66275
66278
|
key: "no_yoda_conditions",
|
|
66276
66279
|
title: "No Yoda conditions",
|
|
66277
66280
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
66278
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66279
|
-
|
|
66281
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66282
|
+
|
|
66280
66283
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
66281
66284
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66282
|
-
badExample: `IF 0 <> sy-subrc.
|
|
66285
|
+
badExample: `IF 0 <> sy-subrc.
|
|
66283
66286
|
ENDIF.`,
|
|
66284
|
-
goodExample: `IF sy-subrc <> 0.
|
|
66287
|
+
goodExample: `IF sy-subrc <> 0.
|
|
66285
66288
|
ENDIF.`,
|
|
66286
66289
|
};
|
|
66287
66290
|
}
|
|
@@ -66382,8 +66385,8 @@ class NROBConsistency {
|
|
|
66382
66385
|
key: "nrob_consistency",
|
|
66383
66386
|
title: "Number range consistency",
|
|
66384
66387
|
shortDescription: `Consistency checks for number ranges`,
|
|
66385
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66386
|
-
|
|
66388
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66389
|
+
|
|
66387
66390
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
66388
66391
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66389
66392
|
};
|
|
@@ -66660,58 +66663,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66660
66663
|
title: "Obsolete statements",
|
|
66661
66664
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66662
66665
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66663
|
-
extendedInformation: `
|
|
66664
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66665
|
-
|
|
66666
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66667
|
-
|
|
66668
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66669
|
-
|
|
66670
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66671
|
-
|
|
66672
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66673
|
-
|
|
66674
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66675
|
-
|
|
66676
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66677
|
-
|
|
66678
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66679
|
-
|
|
66680
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66681
|
-
|
|
66682
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66683
|
-
|
|
66684
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66685
|
-
|
|
66686
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66687
|
-
|
|
66688
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66689
|
-
|
|
66690
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66691
|
-
|
|
66692
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66693
|
-
SELECT COUNT(*) is considered okay
|
|
66694
|
-
|
|
66695
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66696
|
-
|
|
66697
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66698
|
-
|
|
66699
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66700
|
-
|
|
66701
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66702
|
-
|
|
66703
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66704
|
-
|
|
66666
|
+
extendedInformation: `
|
|
66667
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66668
|
+
|
|
66669
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66670
|
+
|
|
66671
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66672
|
+
|
|
66673
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66674
|
+
|
|
66675
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66676
|
+
|
|
66677
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66678
|
+
|
|
66679
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66680
|
+
|
|
66681
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66682
|
+
|
|
66683
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66684
|
+
|
|
66685
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66686
|
+
|
|
66687
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66688
|
+
|
|
66689
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66690
|
+
|
|
66691
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66692
|
+
|
|
66693
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66694
|
+
|
|
66695
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66696
|
+
SELECT COUNT(*) is considered okay
|
|
66697
|
+
|
|
66698
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66699
|
+
|
|
66700
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66701
|
+
|
|
66702
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66703
|
+
|
|
66704
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66705
|
+
|
|
66706
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66707
|
+
|
|
66705
66708
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66706
|
-
badExample: `REFRESH itab.
|
|
66707
|
-
|
|
66708
|
-
COMPUTE foo = 2 + 2.
|
|
66709
|
-
|
|
66710
|
-
MULTIPLY lv_foo BY 2.
|
|
66711
|
-
|
|
66712
|
-
INTERFACE intf LOAD.
|
|
66713
|
-
|
|
66714
|
-
IF foo IS SUPPLIED.
|
|
66709
|
+
badExample: `REFRESH itab.
|
|
66710
|
+
|
|
66711
|
+
COMPUTE foo = 2 + 2.
|
|
66712
|
+
|
|
66713
|
+
MULTIPLY lv_foo BY 2.
|
|
66714
|
+
|
|
66715
|
+
INTERFACE intf LOAD.
|
|
66716
|
+
|
|
66717
|
+
IF foo IS SUPPLIED.
|
|
66715
66718
|
ENDIF.`,
|
|
66716
66719
|
};
|
|
66717
66720
|
}
|
|
@@ -67051,9 +67054,9 @@ class OmitParameterName {
|
|
|
67051
67054
|
key: "omit_parameter_name",
|
|
67052
67055
|
title: "Omit parameter name",
|
|
67053
67056
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
67054
|
-
extendedInformation: `
|
|
67055
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67056
|
-
|
|
67057
|
+
extendedInformation: `
|
|
67058
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
67059
|
+
|
|
67057
67060
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
67058
67061
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
67059
67062
|
badExample: `method( param = 2 ).`,
|
|
@@ -67259,20 +67262,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
67259
67262
|
shortDescription: `Omit RECEIVING`,
|
|
67260
67263
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
67261
67264
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67262
|
-
badExample: `
|
|
67263
|
-
upload_pack(
|
|
67264
|
-
EXPORTING
|
|
67265
|
-
io_client = lo_client
|
|
67266
|
-
iv_url = iv_url
|
|
67267
|
-
iv_deepen_level = iv_deepen_level
|
|
67268
|
-
it_hashes = lt_hashes
|
|
67269
|
-
RECEIVING
|
|
67265
|
+
badExample: `
|
|
67266
|
+
upload_pack(
|
|
67267
|
+
EXPORTING
|
|
67268
|
+
io_client = lo_client
|
|
67269
|
+
iv_url = iv_url
|
|
67270
|
+
iv_deepen_level = iv_deepen_level
|
|
67271
|
+
it_hashes = lt_hashes
|
|
67272
|
+
RECEIVING
|
|
67270
67273
|
rt_objects = et_objects ).`,
|
|
67271
|
-
goodExample: `
|
|
67272
|
-
et_objects = upload_pack(
|
|
67273
|
-
io_client = lo_client
|
|
67274
|
-
iv_url = iv_url
|
|
67275
|
-
iv_deepen_level = iv_deepen_level
|
|
67274
|
+
goodExample: `
|
|
67275
|
+
et_objects = upload_pack(
|
|
67276
|
+
io_client = lo_client
|
|
67277
|
+
iv_url = iv_url
|
|
67278
|
+
iv_deepen_level = iv_deepen_level
|
|
67276
67279
|
it_hashes = lt_hashes ).`,
|
|
67277
67280
|
};
|
|
67278
67281
|
}
|
|
@@ -67336,8 +67339,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
67336
67339
|
return {
|
|
67337
67340
|
key: "parser_702_chaining",
|
|
67338
67341
|
title: "Parser Error, bad chanining on 702",
|
|
67339
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67340
|
-
this rule finds these and reports errors.
|
|
67342
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67343
|
+
this rule finds these and reports errors.
|
|
67341
67344
|
Only active on target version 702 and below.`,
|
|
67342
67345
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67343
67346
|
};
|
|
@@ -67417,8 +67420,8 @@ class ParserError {
|
|
|
67417
67420
|
return {
|
|
67418
67421
|
key: "parser_error",
|
|
67419
67422
|
title: "Parser error",
|
|
67420
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67421
|
-
|
|
67423
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67424
|
+
|
|
67422
67425
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67423
67426
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67424
67427
|
};
|
|
@@ -67503,7 +67506,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67503
67506
|
return {
|
|
67504
67507
|
key: "parser_missing_space",
|
|
67505
67508
|
title: "Parser Error, missing space",
|
|
67506
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67509
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67507
67510
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67508
67511
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67509
67512
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -67915,25 +67918,25 @@ class PreferInline {
|
|
|
67915
67918
|
key: "prefer_inline",
|
|
67916
67919
|
title: "Prefer Inline Declarations",
|
|
67917
67920
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
67918
|
-
extendedInformation: `EXPERIMENTAL
|
|
67919
|
-
|
|
67920
|
-
Activates if language version is v740sp02 or above.
|
|
67921
|
-
|
|
67922
|
-
Variables must be local(METHOD or FORM).
|
|
67923
|
-
|
|
67924
|
-
No generic or void typed variables. No syntax errors.
|
|
67925
|
-
|
|
67926
|
-
First position used must be a full/pure write.
|
|
67927
|
-
|
|
67928
|
-
Move statment is not a cast(?=)
|
|
67929
|
-
|
|
67921
|
+
extendedInformation: `EXPERIMENTAL
|
|
67922
|
+
|
|
67923
|
+
Activates if language version is v740sp02 or above.
|
|
67924
|
+
|
|
67925
|
+
Variables must be local(METHOD or FORM).
|
|
67926
|
+
|
|
67927
|
+
No generic or void typed variables. No syntax errors.
|
|
67928
|
+
|
|
67929
|
+
First position used must be a full/pure write.
|
|
67930
|
+
|
|
67931
|
+
Move statment is not a cast(?=)
|
|
67932
|
+
|
|
67930
67933
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
67931
67934
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
67932
|
-
badExample: `DATA foo TYPE i.
|
|
67933
|
-
foo = 2.
|
|
67934
|
-
DATA percentage TYPE decfloat34.
|
|
67935
|
+
badExample: `DATA foo TYPE i.
|
|
67936
|
+
foo = 2.
|
|
67937
|
+
DATA percentage TYPE decfloat34.
|
|
67935
67938
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
67936
|
-
goodExample: `DATA(foo) = 2.
|
|
67939
|
+
goodExample: `DATA(foo) = 2.
|
|
67937
67940
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
67938
67941
|
};
|
|
67939
67942
|
}
|
|
@@ -68147,18 +68150,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
68147
68150
|
key: "prefer_is_not",
|
|
68148
68151
|
title: "Prefer IS NOT to NOT IS",
|
|
68149
68152
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
68150
|
-
extendedInformation: `
|
|
68151
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68152
|
-
|
|
68153
|
+
extendedInformation: `
|
|
68154
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
68155
|
+
|
|
68153
68156
|
"if not is_valid( )." examples are skipped`,
|
|
68154
68157
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68155
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
68156
|
-
IF variable NP 'TODO*'.
|
|
68157
|
-
IF variable <> 42.
|
|
68158
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
68159
|
+
IF variable NP 'TODO*'.
|
|
68160
|
+
IF variable <> 42.
|
|
68158
68161
|
IF variable CO 'hello'.`,
|
|
68159
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
68160
|
-
IF NOT variable CP 'TODO*'.
|
|
68161
|
-
IF NOT variable = 42.
|
|
68162
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
68163
|
+
IF NOT variable CP 'TODO*'.
|
|
68164
|
+
IF NOT variable = 42.
|
|
68162
68165
|
IF NOT variable CA 'hello'.`,
|
|
68163
68166
|
};
|
|
68164
68167
|
}
|
|
@@ -68346,14 +68349,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
68346
68349
|
key: "prefer_raise_exception_new",
|
|
68347
68350
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
68348
68351
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
68349
|
-
extendedInformation: `
|
|
68350
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68351
|
-
|
|
68352
|
+
extendedInformation: `
|
|
68353
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68354
|
+
|
|
68352
68355
|
From 752 and up`,
|
|
68353
68356
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
68354
68357
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
68355
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68356
|
-
EXPORTING
|
|
68358
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68359
|
+
EXPORTING
|
|
68357
68360
|
previous = exception.`,
|
|
68358
68361
|
};
|
|
68359
68362
|
}
|
|
@@ -68431,12 +68434,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68431
68434
|
key: "prefer_returning_to_exporting",
|
|
68432
68435
|
title: "Prefer RETURNING to EXPORTING",
|
|
68433
68436
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68434
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68437
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68435
68438
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68436
68439
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68437
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68438
|
-
PUBLIC SECTION.
|
|
68439
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68440
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68441
|
+
PUBLIC SECTION.
|
|
68442
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68440
68443
|
ENDCLASS.`,
|
|
68441
68444
|
};
|
|
68442
68445
|
}
|
|
@@ -68532,8 +68535,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68532
68535
|
key: "prefer_xsdbool",
|
|
68533
68536
|
title: "Prefer xsdbool over boolc",
|
|
68534
68537
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68535
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68536
|
-
|
|
68538
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68539
|
+
|
|
68537
68540
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68538
68541
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68539
68542
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68605,9 +68608,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68605
68608
|
title: "Preferred compare operator",
|
|
68606
68609
|
shortDescription: `Configure undesired operator variants`,
|
|
68607
68610
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68608
|
-
badExample: `IF foo EQ bar.
|
|
68611
|
+
badExample: `IF foo EQ bar.
|
|
68609
68612
|
ENDIF.`,
|
|
68610
|
-
goodExample: `IF foo = bar.
|
|
68613
|
+
goodExample: `IF foo = bar.
|
|
68611
68614
|
ENDIF.`,
|
|
68612
68615
|
};
|
|
68613
68616
|
}
|
|
@@ -68831,26 +68834,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
68831
68834
|
key: "reduce_procedural_code",
|
|
68832
68835
|
title: "Reduce procedural code",
|
|
68833
68836
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
68834
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68835
|
-
|
|
68836
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68837
|
-
|
|
68837
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68838
|
+
|
|
68839
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68840
|
+
|
|
68838
68841
|
Comments are not counted as statements.`,
|
|
68839
68842
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68840
|
-
badExample: `FORM foo.
|
|
68841
|
-
DATA lv_bar TYPE i.
|
|
68842
|
-
lv_bar = 2 + 2.
|
|
68843
|
-
IF lv_bar = 4.
|
|
68844
|
-
WRITE 'hello world'.
|
|
68845
|
-
ENDIF.
|
|
68846
|
-
DATA lv_bar TYPE i.
|
|
68847
|
-
lv_bar = 2 + 2.
|
|
68848
|
-
IF lv_bar = 4.
|
|
68849
|
-
WRITE 'hello world'.
|
|
68850
|
-
ENDIF.
|
|
68843
|
+
badExample: `FORM foo.
|
|
68844
|
+
DATA lv_bar TYPE i.
|
|
68845
|
+
lv_bar = 2 + 2.
|
|
68846
|
+
IF lv_bar = 4.
|
|
68847
|
+
WRITE 'hello world'.
|
|
68848
|
+
ENDIF.
|
|
68849
|
+
DATA lv_bar TYPE i.
|
|
68850
|
+
lv_bar = 2 + 2.
|
|
68851
|
+
IF lv_bar = 4.
|
|
68852
|
+
WRITE 'hello world'.
|
|
68853
|
+
ENDIF.
|
|
68851
68854
|
ENDFORM.`,
|
|
68852
|
-
goodExample: `FORM foo.
|
|
68853
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
68855
|
+
goodExample: `FORM foo.
|
|
68856
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
68854
68857
|
ENDFORM.`,
|
|
68855
68858
|
};
|
|
68856
68859
|
}
|
|
@@ -69094,10 +69097,10 @@ class RemoveDescriptions {
|
|
|
69094
69097
|
return {
|
|
69095
69098
|
key: "remove_descriptions",
|
|
69096
69099
|
title: "Remove descriptions",
|
|
69097
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69098
|
-
|
|
69099
|
-
Class descriptions are required, see rule description_empty.
|
|
69100
|
-
|
|
69100
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
69101
|
+
|
|
69102
|
+
Class descriptions are required, see rule description_empty.
|
|
69103
|
+
|
|
69101
69104
|
Consider using ABAP Doc for documentation.`,
|
|
69102
69105
|
tags: [],
|
|
69103
69106
|
};
|
|
@@ -69222,14 +69225,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
69222
69225
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69223
69226
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
69224
69227
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
69225
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
69228
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
69226
69229
|
DESTINATION lv_rfc.`,
|
|
69227
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69228
|
-
DESTINATION lv_rfc
|
|
69229
|
-
EXCEPTIONS
|
|
69230
|
-
system_failure = 1 MESSAGE msg
|
|
69231
|
-
communication_failure = 2 MESSAGE msg
|
|
69232
|
-
resource_failure = 3
|
|
69230
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
69231
|
+
DESTINATION lv_rfc
|
|
69232
|
+
EXCEPTIONS
|
|
69233
|
+
system_failure = 1 MESSAGE msg
|
|
69234
|
+
communication_failure = 2 MESSAGE msg
|
|
69235
|
+
resource_failure = 3
|
|
69233
69236
|
OTHERS = 4.`,
|
|
69234
69237
|
};
|
|
69235
69238
|
}
|
|
@@ -69313,11 +69316,11 @@ class SelectAddOrderBy {
|
|
|
69313
69316
|
key: "select_add_order_by",
|
|
69314
69317
|
title: "SELECT add ORDER BY",
|
|
69315
69318
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
69316
|
-
extendedInformation: `
|
|
69317
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69318
|
-
|
|
69319
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
69320
|
-
|
|
69319
|
+
extendedInformation: `
|
|
69320
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69321
|
+
|
|
69322
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
69323
|
+
|
|
69321
69324
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
69322
69325
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69323
69326
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69448,14 +69451,14 @@ class SelectPerformance {
|
|
|
69448
69451
|
key: "select_performance",
|
|
69449
69452
|
title: "SELECT performance",
|
|
69450
69453
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69451
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69452
|
-
|
|
69454
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69455
|
+
|
|
69453
69456
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69454
69457
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69455
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69456
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69458
|
+
badExample: `SELECT field1, field2 FROM table
|
|
69459
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69457
69460
|
ENDSELECT.`,
|
|
69458
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69461
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69459
69462
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69460
69463
|
};
|
|
69461
69464
|
}
|
|
@@ -69569,8 +69572,8 @@ class SelectSingleFullKey {
|
|
|
69569
69572
|
key: "select_single_full_key",
|
|
69570
69573
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69571
69574
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69572
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69573
|
-
|
|
69575
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69576
|
+
|
|
69574
69577
|
If the statement contains a JOIN it is not checked`,
|
|
69575
69578
|
pseudoComment: "EC CI_NOORDER",
|
|
69576
69579
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -69994,8 +69997,8 @@ class SICFConsistency {
|
|
|
69994
69997
|
key: "sicf_consistency",
|
|
69995
69998
|
title: "SICF consistency",
|
|
69996
69999
|
shortDescription: `Checks the validity of ICF services`,
|
|
69997
|
-
extendedInformation: `* Class defined in handler must exist
|
|
69998
|
-
* Class must not have any syntax errors
|
|
70000
|
+
extendedInformation: `* Class defined in handler must exist
|
|
70001
|
+
* Class must not have any syntax errors
|
|
69999
70002
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
70000
70003
|
};
|
|
70001
70004
|
}
|
|
@@ -70107,23 +70110,23 @@ class SlowParameterPassing {
|
|
|
70107
70110
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
70108
70111
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
70109
70112
|
tags: [_irule_1.RuleTag.Performance],
|
|
70110
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70111
|
-
PUBLIC SECTION.
|
|
70112
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70113
|
-
ENDCLASS.
|
|
70114
|
-
CLASS lcl IMPLEMENTATION.
|
|
70115
|
-
METHOD bar.
|
|
70116
|
-
WRITE sdf.
|
|
70117
|
-
ENDMETHOD.
|
|
70113
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70114
|
+
PUBLIC SECTION.
|
|
70115
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
70116
|
+
ENDCLASS.
|
|
70117
|
+
CLASS lcl IMPLEMENTATION.
|
|
70118
|
+
METHOD bar.
|
|
70119
|
+
WRITE sdf.
|
|
70120
|
+
ENDMETHOD.
|
|
70118
70121
|
ENDCLASS.`,
|
|
70119
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
70120
|
-
PUBLIC SECTION.
|
|
70121
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
70122
|
-
ENDCLASS.
|
|
70123
|
-
CLASS lcl IMPLEMENTATION.
|
|
70124
|
-
METHOD bar.
|
|
70125
|
-
WRITE sdf.
|
|
70126
|
-
ENDMETHOD.
|
|
70122
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
70123
|
+
PUBLIC SECTION.
|
|
70124
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
70125
|
+
ENDCLASS.
|
|
70126
|
+
CLASS lcl IMPLEMENTATION.
|
|
70127
|
+
METHOD bar.
|
|
70128
|
+
WRITE sdf.
|
|
70129
|
+
ENDMETHOD.
|
|
70127
70130
|
ENDCLASS.`,
|
|
70128
70131
|
};
|
|
70129
70132
|
}
|
|
@@ -70380,8 +70383,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
70380
70383
|
key: "space_before_dot",
|
|
70381
70384
|
title: "Space before dot",
|
|
70382
70385
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
70383
|
-
extendedInformation: `
|
|
70384
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70386
|
+
extendedInformation: `
|
|
70387
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70385
70388
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
70386
70389
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70387
70390
|
badExample: `WRITE bar .`,
|
|
@@ -70567,12 +70570,12 @@ class SQLValueConversion {
|
|
|
70567
70570
|
key: "sql_value_conversion",
|
|
70568
70571
|
title: "Implicit SQL Value Conversion",
|
|
70569
70572
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70570
|
-
extendedInformation: `
|
|
70571
|
-
* Integer to CHAR conversion
|
|
70572
|
-
* Integer to NUMC conversion
|
|
70573
|
-
* NUMC to Integer conversion
|
|
70574
|
-
* CHAR to Integer conversion
|
|
70575
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
70573
|
+
extendedInformation: `
|
|
70574
|
+
* Integer to CHAR conversion
|
|
70575
|
+
* Integer to NUMC conversion
|
|
70576
|
+
* NUMC to Integer conversion
|
|
70577
|
+
* CHAR to Integer conversion
|
|
70578
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
70576
70579
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70577
70580
|
tags: [],
|
|
70578
70581
|
};
|
|
@@ -70644,7 +70647,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70644
70647
|
key: "start_at_tab",
|
|
70645
70648
|
title: "Start at tab",
|
|
70646
70649
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70647
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70650
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70648
70651
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70649
70652
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70650
70653
|
badExample: ` WRITE a.`,
|
|
@@ -70821,12 +70824,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
70821
70824
|
key: "strict_sql",
|
|
70822
70825
|
title: "Strict SQL",
|
|
70823
70826
|
shortDescription: `Strict SQL`,
|
|
70824
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70825
|
-
|
|
70826
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70827
|
-
|
|
70828
|
-
Also see separate rule sql_escape_host_variables
|
|
70829
|
-
|
|
70827
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70828
|
+
|
|
70829
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70830
|
+
|
|
70831
|
+
Also see separate rule sql_escape_host_variables
|
|
70832
|
+
|
|
70830
70833
|
Activates from v750 and up`,
|
|
70831
70834
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
70832
70835
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -71080,11 +71083,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
71080
71083
|
key: "sy_modification",
|
|
71081
71084
|
title: "Modification of SY fields",
|
|
71082
71085
|
shortDescription: `Finds modification of sy fields`,
|
|
71083
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71084
|
-
|
|
71086
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
71087
|
+
|
|
71085
71088
|
Changes to SY-TVAR* fields are not reported`,
|
|
71086
71089
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71087
|
-
badExample: `sy-uname = 2.
|
|
71090
|
+
badExample: `sy-uname = 2.
|
|
71088
71091
|
sy = sy.`,
|
|
71089
71092
|
};
|
|
71090
71093
|
}
|
|
@@ -71146,8 +71149,8 @@ class TABLEnhancementCategory {
|
|
|
71146
71149
|
key: "tabl_enhancement_category",
|
|
71147
71150
|
title: "TABL enhancement category must be set",
|
|
71148
71151
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
71149
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71150
|
-
|
|
71152
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
71153
|
+
|
|
71151
71154
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
71152
71155
|
tags: [],
|
|
71153
71156
|
};
|
|
@@ -71275,9 +71278,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
71275
71278
|
title: "Type FORM parameters",
|
|
71276
71279
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
71277
71280
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71278
|
-
badExample: `FORM foo USING bar.
|
|
71281
|
+
badExample: `FORM foo USING bar.
|
|
71279
71282
|
ENDFORM.`,
|
|
71280
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
71283
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
71281
71284
|
ENDFORM.`,
|
|
71282
71285
|
};
|
|
71283
71286
|
}
|
|
@@ -71950,38 +71953,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
71950
71953
|
key: "unnecessary_pragma",
|
|
71951
71954
|
title: "Unnecessary Pragma",
|
|
71952
71955
|
shortDescription: `Finds pragmas which can be removed`,
|
|
71953
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
71954
|
-
|
|
71955
|
-
* NEEDED without definition
|
|
71956
|
-
|
|
71957
|
-
* NO_TEXT without texts
|
|
71958
|
-
|
|
71959
|
-
* SUBRC_OK where sy-subrc is checked
|
|
71960
|
-
|
|
71956
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
71957
|
+
|
|
71958
|
+
* NEEDED without definition
|
|
71959
|
+
|
|
71960
|
+
* NO_TEXT without texts
|
|
71961
|
+
|
|
71962
|
+
* SUBRC_OK where sy-subrc is checked
|
|
71963
|
+
|
|
71961
71964
|
NO_HANDLER inside macros are not checked`,
|
|
71962
71965
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71963
|
-
badExample: `TRY.
|
|
71964
|
-
...
|
|
71965
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71966
|
-
RETURN. " it has a handler
|
|
71967
|
-
ENDTRY.
|
|
71968
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71969
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71970
|
-
IF sy-subrc <> 0.
|
|
71966
|
+
badExample: `TRY.
|
|
71967
|
+
...
|
|
71968
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71969
|
+
RETURN. " it has a handler
|
|
71970
|
+
ENDTRY.
|
|
71971
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71972
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71973
|
+
IF sy-subrc <> 0.
|
|
71971
71974
|
ENDIF.`,
|
|
71972
|
-
goodExample: `TRY.
|
|
71973
|
-
...
|
|
71974
|
-
CATCH zcx_abapgit_exception.
|
|
71975
|
-
RETURN.
|
|
71976
|
-
ENDTRY.
|
|
71977
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71978
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71979
|
-
IF sy-subrc <> 0.
|
|
71980
|
-
ENDIF.
|
|
71981
|
-
|
|
71982
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
71983
|
-
test1 TYPE string,
|
|
71984
|
-
test2 TYPE string,
|
|
71975
|
+
goodExample: `TRY.
|
|
71976
|
+
...
|
|
71977
|
+
CATCH zcx_abapgit_exception.
|
|
71978
|
+
RETURN.
|
|
71979
|
+
ENDTRY.
|
|
71980
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71981
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71982
|
+
IF sy-subrc <> 0.
|
|
71983
|
+
ENDIF.
|
|
71984
|
+
|
|
71985
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
71986
|
+
test1 TYPE string,
|
|
71987
|
+
test2 TYPE string,
|
|
71985
71988
|
END OF blah.`,
|
|
71986
71989
|
};
|
|
71987
71990
|
}
|
|
@@ -72148,18 +72151,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
72148
72151
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
72149
72152
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
72150
72153
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
72151
|
-
badExample: `FORM hello1.
|
|
72152
|
-
WRITE 'world'.
|
|
72153
|
-
RETURN.
|
|
72154
|
-
ENDFORM.
|
|
72155
|
-
|
|
72156
|
-
FORM foo.
|
|
72157
|
-
IF 1 = 2.
|
|
72158
|
-
RETURN.
|
|
72159
|
-
ENDIF.
|
|
72154
|
+
badExample: `FORM hello1.
|
|
72155
|
+
WRITE 'world'.
|
|
72156
|
+
RETURN.
|
|
72157
|
+
ENDFORM.
|
|
72158
|
+
|
|
72159
|
+
FORM foo.
|
|
72160
|
+
IF 1 = 2.
|
|
72161
|
+
RETURN.
|
|
72162
|
+
ENDIF.
|
|
72160
72163
|
ENDFORM.`,
|
|
72161
|
-
goodExample: `FORM hello2.
|
|
72162
|
-
WRITE 'world'.
|
|
72164
|
+
goodExample: `FORM hello2.
|
|
72165
|
+
WRITE 'world'.
|
|
72163
72166
|
ENDFORM.`,
|
|
72164
72167
|
};
|
|
72165
72168
|
}
|
|
@@ -72510,13 +72513,13 @@ class UnusedMacros {
|
|
|
72510
72513
|
title: "Unused macros",
|
|
72511
72514
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
72512
72515
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72513
|
-
badExample: `DEFINE foobar1.
|
|
72514
|
-
WRITE 'hello'.
|
|
72516
|
+
badExample: `DEFINE foobar1.
|
|
72517
|
+
WRITE 'hello'.
|
|
72515
72518
|
END-OF-DEFINITION.`,
|
|
72516
|
-
goodExample: `DEFINE foobar2.
|
|
72517
|
-
WRITE 'hello'.
|
|
72518
|
-
END-OF-DEFINITION.
|
|
72519
|
-
|
|
72519
|
+
goodExample: `DEFINE foobar2.
|
|
72520
|
+
WRITE 'hello'.
|
|
72521
|
+
END-OF-DEFINITION.
|
|
72522
|
+
|
|
72520
72523
|
foobar2.`,
|
|
72521
72524
|
};
|
|
72522
72525
|
}
|
|
@@ -72624,17 +72627,17 @@ class UnusedMethods {
|
|
|
72624
72627
|
key: "unused_methods",
|
|
72625
72628
|
title: "Unused methods",
|
|
72626
72629
|
shortDescription: `Checks for unused methods`,
|
|
72627
|
-
extendedInformation: `Checks private and protected methods.
|
|
72628
|
-
|
|
72629
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72630
|
-
|
|
72631
|
-
Skips:
|
|
72632
|
-
* methods FOR TESTING
|
|
72633
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72634
|
-
* class_constructor + constructor methods
|
|
72635
|
-
* event handlers
|
|
72636
|
-
* methods that are redefined
|
|
72637
|
-
* INCLUDEs
|
|
72630
|
+
extendedInformation: `Checks private and protected methods.
|
|
72631
|
+
|
|
72632
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72633
|
+
|
|
72634
|
+
Skips:
|
|
72635
|
+
* methods FOR TESTING
|
|
72636
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72637
|
+
* class_constructor + constructor methods
|
|
72638
|
+
* event handlers
|
|
72639
|
+
* methods that are redefined
|
|
72640
|
+
* INCLUDEs
|
|
72638
72641
|
`,
|
|
72639
72642
|
tags: [],
|
|
72640
72643
|
pragma: "##CALLED",
|
|
@@ -73068,23 +73071,23 @@ class UnusedVariables {
|
|
|
73068
73071
|
key: "unused_variables",
|
|
73069
73072
|
title: "Unused variables",
|
|
73070
73073
|
shortDescription: `Checks for unused variables and constants`,
|
|
73071
|
-
extendedInformation: `Skips event parameters.
|
|
73072
|
-
|
|
73073
|
-
Note that this currently does not work if the source code uses macros.
|
|
73074
|
-
|
|
73075
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73076
|
-
|
|
73074
|
+
extendedInformation: `Skips event parameters.
|
|
73075
|
+
|
|
73076
|
+
Note that this currently does not work if the source code uses macros.
|
|
73077
|
+
|
|
73078
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
73079
|
+
|
|
73077
73080
|
Errors found in INCLUDES are reported for the main program.`,
|
|
73078
73081
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
73079
73082
|
pragma: "##NEEDED",
|
|
73080
73083
|
pseudoComment: "EC NEEDED",
|
|
73081
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
73082
|
-
test TYPE string,
|
|
73083
|
-
test2 TYPE string,
|
|
73084
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
73085
|
+
test TYPE string,
|
|
73086
|
+
test2 TYPE string,
|
|
73084
73087
|
END OF blah1.`,
|
|
73085
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73086
|
-
test TYPE string,
|
|
73087
|
-
test2 TYPE string,
|
|
73088
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
73089
|
+
test TYPE string,
|
|
73090
|
+
test2 TYPE string,
|
|
73088
73091
|
END OF blah2.`,
|
|
73089
73092
|
};
|
|
73090
73093
|
}
|
|
@@ -73303,15 +73306,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
73303
73306
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
73304
73307
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
73305
73308
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
73306
|
-
badExample: `IF line IS INITIAL.
|
|
73307
|
-
has_entries = abap_false.
|
|
73308
|
-
ELSE.
|
|
73309
|
-
has_entries = abap_true.
|
|
73310
|
-
ENDIF.
|
|
73311
|
-
|
|
73309
|
+
badExample: `IF line IS INITIAL.
|
|
73310
|
+
has_entries = abap_false.
|
|
73311
|
+
ELSE.
|
|
73312
|
+
has_entries = abap_true.
|
|
73313
|
+
ENDIF.
|
|
73314
|
+
|
|
73312
73315
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
73313
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73314
|
-
|
|
73316
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
73317
|
+
|
|
73315
73318
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
73316
73319
|
};
|
|
73317
73320
|
}
|
|
@@ -73429,15 +73432,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
73429
73432
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
73430
73433
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
73431
73434
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73432
|
-
badExample: `INTERFACE lif.
|
|
73433
|
-
METHODS load_data
|
|
73434
|
-
EXCEPTIONS
|
|
73435
|
-
invalid_parameter.
|
|
73435
|
+
badExample: `INTERFACE lif.
|
|
73436
|
+
METHODS load_data
|
|
73437
|
+
EXCEPTIONS
|
|
73438
|
+
invalid_parameter.
|
|
73436
73439
|
ENDINTERFACE.`,
|
|
73437
|
-
goodExample: `INTERFACE lif.
|
|
73438
|
-
METHODS load_data
|
|
73439
|
-
RAISING
|
|
73440
|
-
cx_something.
|
|
73440
|
+
goodExample: `INTERFACE lif.
|
|
73441
|
+
METHODS load_data
|
|
73442
|
+
RAISING
|
|
73443
|
+
cx_something.
|
|
73441
73444
|
ENDINTERFACE.`,
|
|
73442
73445
|
};
|
|
73443
73446
|
}
|
|
@@ -73497,15 +73500,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
73497
73500
|
key: "use_line_exists",
|
|
73498
73501
|
title: "Use line_exists",
|
|
73499
73502
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73500
|
-
extendedInformation: `
|
|
73501
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73502
|
-
|
|
73503
|
+
extendedInformation: `
|
|
73504
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73505
|
+
|
|
73503
73506
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73504
73507
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73505
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73506
|
-
IF sy-subrc = 0.
|
|
73508
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73509
|
+
IF sy-subrc = 0.
|
|
73507
73510
|
ENDIF.`,
|
|
73508
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73511
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73509
73512
|
ENDIF.`,
|
|
73510
73513
|
};
|
|
73511
73514
|
}
|
|
@@ -73615,10 +73618,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73615
73618
|
key: "use_new",
|
|
73616
73619
|
title: "Use NEW",
|
|
73617
73620
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73618
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73619
|
-
|
|
73620
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73621
|
-
|
|
73621
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73622
|
+
|
|
73623
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73624
|
+
|
|
73622
73625
|
Applicable from v740sp02 and up`,
|
|
73623
73626
|
badExample: `CREATE OBJECT ref.`,
|
|
73624
73627
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73716,13 +73719,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73716
73719
|
title: "WHEN OTHERS last",
|
|
73717
73720
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73718
73721
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73719
|
-
badExample: `CASE bar.
|
|
73720
|
-
WHEN OTHERS.
|
|
73721
|
-
WHEN 2.
|
|
73722
|
+
badExample: `CASE bar.
|
|
73723
|
+
WHEN OTHERS.
|
|
73724
|
+
WHEN 2.
|
|
73722
73725
|
ENDCASE.`,
|
|
73723
|
-
goodExample: `CASE bar.
|
|
73724
|
-
WHEN 2.
|
|
73725
|
-
WHEN OTHERS.
|
|
73726
|
+
goodExample: `CASE bar.
|
|
73727
|
+
WHEN 2.
|
|
73728
|
+
WHEN OTHERS.
|
|
73726
73729
|
ENDCASE.`,
|
|
73727
73730
|
};
|
|
73728
73731
|
}
|