@abaplint/cli 2.108.7 → 2.108.8
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 +844 -801
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -22676,6 +22676,16 @@ class TypeUtils {
|
|
|
22676
22676
|
return false;
|
|
22677
22677
|
}
|
|
22678
22678
|
}
|
|
22679
|
+
else if (source instanceof basic_1.TableType) {
|
|
22680
|
+
if (target instanceof basic_1.TableType) {
|
|
22681
|
+
return this.isAssignableStrict(source.getRowType(), target.getRowType());
|
|
22682
|
+
}
|
|
22683
|
+
else if (target instanceof basic_1.UnknownType
|
|
22684
|
+
|| target instanceof basic_1.AnyType
|
|
22685
|
+
|| target instanceof basic_1.VoidType) {
|
|
22686
|
+
return true;
|
|
22687
|
+
}
|
|
22688
|
+
}
|
|
22679
22689
|
return this.isAssignable(source, target);
|
|
22680
22690
|
}
|
|
22681
22691
|
isAssignable(source, target) {
|
|
@@ -34406,13 +34416,13 @@ class FlowGraph {
|
|
|
34406
34416
|
this.label = label;
|
|
34407
34417
|
}
|
|
34408
34418
|
toDigraph() {
|
|
34409
|
-
return `digraph G {
|
|
34410
|
-
labelloc="t";
|
|
34411
|
-
label="${this.label}";
|
|
34412
|
-
graph [fontname = "helvetica"];
|
|
34413
|
-
node [fontname = "helvetica", shape="box"];
|
|
34414
|
-
edge [fontname = "helvetica"];
|
|
34415
|
-
${this.toTextEdges()}
|
|
34419
|
+
return `digraph G {
|
|
34420
|
+
labelloc="t";
|
|
34421
|
+
label="${this.label}";
|
|
34422
|
+
graph [fontname = "helvetica"];
|
|
34423
|
+
node [fontname = "helvetica", shape="box"];
|
|
34424
|
+
edge [fontname = "helvetica"];
|
|
34425
|
+
${this.toTextEdges()}
|
|
34416
34426
|
}`;
|
|
34417
34427
|
}
|
|
34418
34428
|
listSources(node) {
|
|
@@ -42489,13 +42499,13 @@ class Help {
|
|
|
42489
42499
|
/////////////////////////////////////////////////
|
|
42490
42500
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42491
42501
|
let content = "";
|
|
42492
|
-
content = `
|
|
42493
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42494
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42495
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42496
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42497
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42498
|
-
<hr>
|
|
42502
|
+
content = `
|
|
42503
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
42504
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
42505
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
42506
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
42507
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
42508
|
+
<hr>
|
|
42499
42509
|
` +
|
|
42500
42510
|
"<tt>" + textDocument.uri + " (" +
|
|
42501
42511
|
(position.line + 1) + ", " +
|
|
@@ -46077,6 +46087,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
46077
46087
|
exports.ExtensionIndex = void 0;
|
|
46078
46088
|
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
46079
46089
|
class ExtensionIndex extends _abstract_object_1.AbstractObject {
|
|
46090
|
+
constructor() {
|
|
46091
|
+
super(...arguments);
|
|
46092
|
+
this.parsedXML = undefined;
|
|
46093
|
+
}
|
|
46080
46094
|
getType() {
|
|
46081
46095
|
return "XINX";
|
|
46082
46096
|
}
|
|
@@ -46086,9 +46100,38 @@ class ExtensionIndex extends _abstract_object_1.AbstractObject {
|
|
|
46086
46100
|
allowNamespace: true,
|
|
46087
46101
|
};
|
|
46088
46102
|
}
|
|
46103
|
+
setDirty() {
|
|
46104
|
+
this.parsedXML = undefined;
|
|
46105
|
+
super.setDirty();
|
|
46106
|
+
}
|
|
46089
46107
|
getDescription() {
|
|
46090
|
-
|
|
46091
|
-
|
|
46108
|
+
var _a;
|
|
46109
|
+
this.parse();
|
|
46110
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.ddtext;
|
|
46111
|
+
}
|
|
46112
|
+
getTableName() {
|
|
46113
|
+
var _a;
|
|
46114
|
+
this.parse();
|
|
46115
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.sqltab;
|
|
46116
|
+
}
|
|
46117
|
+
parse() {
|
|
46118
|
+
var _a, _b, _c, _d, _e;
|
|
46119
|
+
if (this.parsedXML !== undefined) {
|
|
46120
|
+
return { updated: false, runtime: 0 };
|
|
46121
|
+
}
|
|
46122
|
+
const start = Date.now();
|
|
46123
|
+
this.parsedXML = {};
|
|
46124
|
+
const parsed = super.parseRaw2();
|
|
46125
|
+
if (parsed === undefined) {
|
|
46126
|
+
return { updated: false, runtime: 0 };
|
|
46127
|
+
}
|
|
46128
|
+
const xinx = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.XINX;
|
|
46129
|
+
this.parsedXML = {
|
|
46130
|
+
sqltab: (_d = xinx === null || xinx === void 0 ? void 0 : xinx.DD12V) === null || _d === void 0 ? void 0 : _d.SQLTAB,
|
|
46131
|
+
ddtext: (_e = xinx === null || xinx === void 0 ? void 0 : xinx.DD12V) === null || _e === void 0 ? void 0 : _e.DDTEXT,
|
|
46132
|
+
};
|
|
46133
|
+
const end = Date.now();
|
|
46134
|
+
return { updated: true, runtime: end - start };
|
|
46092
46135
|
}
|
|
46093
46136
|
}
|
|
46094
46137
|
exports.ExtensionIndex = ExtensionIndex;
|
|
@@ -51549,7 +51592,7 @@ class Registry {
|
|
|
51549
51592
|
}
|
|
51550
51593
|
static abaplintVersion() {
|
|
51551
51594
|
// magic, see build script "version.sh"
|
|
51552
|
-
return "2.108.
|
|
51595
|
+
return "2.108.8";
|
|
51553
51596
|
}
|
|
51554
51597
|
getDDICReferences() {
|
|
51555
51598
|
return this.ddicReferences;
|
|
@@ -51865,10 +51908,10 @@ class SevenBitAscii {
|
|
|
51865
51908
|
key: "7bit_ascii",
|
|
51866
51909
|
title: "Check for 7bit ascii",
|
|
51867
51910
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
51868
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51869
|
-
|
|
51870
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51871
|
-
|
|
51911
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51912
|
+
|
|
51913
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51914
|
+
|
|
51872
51915
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
51873
51916
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
51874
51917
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52074,10 +52117,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52074
52117
|
key: "abapdoc",
|
|
52075
52118
|
title: "Check abapdoc",
|
|
52076
52119
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52077
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52078
|
-
|
|
52079
|
-
Plus class and interface definitions.
|
|
52080
|
-
|
|
52120
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52121
|
+
|
|
52122
|
+
Plus class and interface definitions.
|
|
52123
|
+
|
|
52081
52124
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52082
52125
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52083
52126
|
};
|
|
@@ -52215,49 +52258,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52215
52258
|
key: "align_parameters",
|
|
52216
52259
|
title: "Align Parameters",
|
|
52217
52260
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52218
|
-
extendedInformation: `Checks:
|
|
52219
|
-
* function module calls
|
|
52220
|
-
* method calls
|
|
52221
|
-
* VALUE constructors
|
|
52222
|
-
* NEW constructors
|
|
52223
|
-
* RAISE EXCEPTION statements
|
|
52224
|
-
* CREATE OBJECT statements
|
|
52225
|
-
* RAISE EVENT statements
|
|
52226
|
-
|
|
52227
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52228
|
-
|
|
52229
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52230
|
-
|
|
52231
|
-
If parameters are on the same row, no issues are reported, see
|
|
52261
|
+
extendedInformation: `Checks:
|
|
52262
|
+
* function module calls
|
|
52263
|
+
* method calls
|
|
52264
|
+
* VALUE constructors
|
|
52265
|
+
* NEW constructors
|
|
52266
|
+
* RAISE EXCEPTION statements
|
|
52267
|
+
* CREATE OBJECT statements
|
|
52268
|
+
* RAISE EVENT statements
|
|
52269
|
+
|
|
52270
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52271
|
+
|
|
52272
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52273
|
+
|
|
52274
|
+
If parameters are on the same row, no issues are reported, see
|
|
52232
52275
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52233
52276
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52234
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52235
|
-
EXPORTING
|
|
52236
|
-
foo = 2
|
|
52237
|
-
parameter = 3.
|
|
52238
|
-
|
|
52239
|
-
foobar( moo = 1
|
|
52240
|
-
param = 1 ).
|
|
52241
|
-
|
|
52242
|
-
foo = VALUE #(
|
|
52243
|
-
foo = bar
|
|
52277
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52278
|
+
EXPORTING
|
|
52279
|
+
foo = 2
|
|
52280
|
+
parameter = 3.
|
|
52281
|
+
|
|
52282
|
+
foobar( moo = 1
|
|
52283
|
+
param = 1 ).
|
|
52284
|
+
|
|
52285
|
+
foo = VALUE #(
|
|
52286
|
+
foo = bar
|
|
52244
52287
|
moo = 2 ).`,
|
|
52245
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52246
|
-
EXPORTING
|
|
52247
|
-
foo = 2
|
|
52248
|
-
parameter = 3.
|
|
52249
|
-
|
|
52250
|
-
foobar( moo = 1
|
|
52251
|
-
param = 1 ).
|
|
52252
|
-
|
|
52253
|
-
foo = VALUE #(
|
|
52254
|
-
foo = bar
|
|
52255
|
-
moo = 2 ).
|
|
52256
|
-
|
|
52257
|
-
DATA(sdf) = VALUE type(
|
|
52258
|
-
common_val = 2
|
|
52259
|
-
another_common = 5
|
|
52260
|
-
( row_value = 4
|
|
52288
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52289
|
+
EXPORTING
|
|
52290
|
+
foo = 2
|
|
52291
|
+
parameter = 3.
|
|
52292
|
+
|
|
52293
|
+
foobar( moo = 1
|
|
52294
|
+
param = 1 ).
|
|
52295
|
+
|
|
52296
|
+
foo = VALUE #(
|
|
52297
|
+
foo = bar
|
|
52298
|
+
moo = 2 ).
|
|
52299
|
+
|
|
52300
|
+
DATA(sdf) = VALUE type(
|
|
52301
|
+
common_val = 2
|
|
52302
|
+
another_common = 5
|
|
52303
|
+
( row_value = 4
|
|
52261
52304
|
value_foo = 5 ) ).`,
|
|
52262
52305
|
};
|
|
52263
52306
|
}
|
|
@@ -52691,37 +52734,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52691
52734
|
key: "align_type_expressions",
|
|
52692
52735
|
title: "Align TYPE expressions",
|
|
52693
52736
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52694
|
-
extendedInformation: `
|
|
52695
|
-
Currently works for METHODS + BEGIN OF
|
|
52696
|
-
|
|
52697
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52698
|
-
|
|
52699
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52737
|
+
extendedInformation: `
|
|
52738
|
+
Currently works for METHODS + BEGIN OF
|
|
52739
|
+
|
|
52740
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52741
|
+
|
|
52742
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52700
52743
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52701
52744
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52702
|
-
badExample: `
|
|
52703
|
-
TYPES: BEGIN OF foo,
|
|
52704
|
-
bar TYPE i,
|
|
52705
|
-
foobar TYPE i,
|
|
52706
|
-
END OF foo.
|
|
52707
|
-
|
|
52708
|
-
INTERFACE lif.
|
|
52709
|
-
METHODS bar
|
|
52710
|
-
IMPORTING
|
|
52711
|
-
foo TYPE i
|
|
52712
|
-
foobar TYPE i.
|
|
52745
|
+
badExample: `
|
|
52746
|
+
TYPES: BEGIN OF foo,
|
|
52747
|
+
bar TYPE i,
|
|
52748
|
+
foobar TYPE i,
|
|
52749
|
+
END OF foo.
|
|
52750
|
+
|
|
52751
|
+
INTERFACE lif.
|
|
52752
|
+
METHODS bar
|
|
52753
|
+
IMPORTING
|
|
52754
|
+
foo TYPE i
|
|
52755
|
+
foobar TYPE i.
|
|
52713
52756
|
ENDINTERFACE.`,
|
|
52714
|
-
goodExample: `
|
|
52715
|
-
TYPES: BEGIN OF foo,
|
|
52716
|
-
bar TYPE i,
|
|
52717
|
-
foobar TYPE i,
|
|
52718
|
-
END OF foo.
|
|
52719
|
-
|
|
52720
|
-
INTERFACE lif.
|
|
52721
|
-
METHODS bar
|
|
52722
|
-
IMPORTING
|
|
52723
|
-
foo TYPE i
|
|
52724
|
-
foobar TYPE i.
|
|
52757
|
+
goodExample: `
|
|
52758
|
+
TYPES: BEGIN OF foo,
|
|
52759
|
+
bar TYPE i,
|
|
52760
|
+
foobar TYPE i,
|
|
52761
|
+
END OF foo.
|
|
52762
|
+
|
|
52763
|
+
INTERFACE lif.
|
|
52764
|
+
METHODS bar
|
|
52765
|
+
IMPORTING
|
|
52766
|
+
foo TYPE i
|
|
52767
|
+
foobar TYPE i.
|
|
52725
52768
|
ENDINTERFACE.`,
|
|
52726
52769
|
};
|
|
52727
52770
|
}
|
|
@@ -53000,15 +53043,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
53000
53043
|
return {
|
|
53001
53044
|
key: "ambiguous_statement",
|
|
53002
53045
|
title: "Check for ambigious statements",
|
|
53003
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53004
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53005
|
-
|
|
53046
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53047
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53048
|
+
|
|
53006
53049
|
Only works if the target version is 740sp05 or above`,
|
|
53007
53050
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53008
|
-
badExample: `DELETE foo FROM bar.
|
|
53051
|
+
badExample: `DELETE foo FROM bar.
|
|
53009
53052
|
MODIFY foo FROM bar.`,
|
|
53010
|
-
goodExample: `DELETE foo FROM @bar.
|
|
53011
|
-
MODIFY TABLE foo FROM bar.
|
|
53053
|
+
goodExample: `DELETE foo FROM @bar.
|
|
53054
|
+
MODIFY TABLE foo FROM bar.
|
|
53012
53055
|
MODIFY zfoo FROM @wa.`,
|
|
53013
53056
|
};
|
|
53014
53057
|
}
|
|
@@ -53113,16 +53156,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53113
53156
|
key: "avoid_use",
|
|
53114
53157
|
title: "Avoid use of certain statements",
|
|
53115
53158
|
shortDescription: `Detects usage of certain statements.`,
|
|
53116
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53117
|
-
|
|
53118
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53119
|
-
|
|
53120
|
-
STATICS: use CLASS-DATA instead
|
|
53121
|
-
|
|
53122
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53123
|
-
|
|
53124
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53125
|
-
|
|
53159
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53160
|
+
|
|
53161
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53162
|
+
|
|
53163
|
+
STATICS: use CLASS-DATA instead
|
|
53164
|
+
|
|
53165
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53166
|
+
|
|
53167
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53168
|
+
|
|
53126
53169
|
BREAK points`,
|
|
53127
53170
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53128
53171
|
};
|
|
@@ -53254,11 +53297,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53254
53297
|
title: "Check BEGIN END names",
|
|
53255
53298
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53256
53299
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53257
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53258
|
-
field TYPE i,
|
|
53300
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53301
|
+
field TYPE i,
|
|
53259
53302
|
END OF structure_not_the_same.`,
|
|
53260
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53261
|
-
field TYPE i,
|
|
53303
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53304
|
+
field TYPE i,
|
|
53262
53305
|
END OF stru.`,
|
|
53263
53306
|
};
|
|
53264
53307
|
}
|
|
@@ -53355,20 +53398,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53355
53398
|
title: "BEGIN contains single INCLUDE",
|
|
53356
53399
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53357
53400
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53358
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53359
|
-
INCLUDE TYPE dselc.
|
|
53360
|
-
TYPES: END OF dummy1.
|
|
53361
|
-
|
|
53362
|
-
DATA BEGIN OF foo.
|
|
53363
|
-
INCLUDE STRUCTURE syst.
|
|
53364
|
-
DATA END OF foo.
|
|
53365
|
-
|
|
53366
|
-
STATICS BEGIN OF bar.
|
|
53367
|
-
INCLUDE STRUCTURE syst.
|
|
53401
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
53402
|
+
INCLUDE TYPE dselc.
|
|
53403
|
+
TYPES: END OF dummy1.
|
|
53404
|
+
|
|
53405
|
+
DATA BEGIN OF foo.
|
|
53406
|
+
INCLUDE STRUCTURE syst.
|
|
53407
|
+
DATA END OF foo.
|
|
53408
|
+
|
|
53409
|
+
STATICS BEGIN OF bar.
|
|
53410
|
+
INCLUDE STRUCTURE syst.
|
|
53368
53411
|
STATICS END OF bar.`,
|
|
53369
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53370
|
-
DATA field TYPE i.
|
|
53371
|
-
INCLUDE STRUCTURE dselc.
|
|
53412
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53413
|
+
DATA field TYPE i.
|
|
53414
|
+
INCLUDE STRUCTURE dselc.
|
|
53372
53415
|
DATA END OF foo.`,
|
|
53373
53416
|
};
|
|
53374
53417
|
}
|
|
@@ -53458,9 +53501,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53458
53501
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53459
53502
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53460
53503
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53461
|
-
goodExample: `TRY.
|
|
53462
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53463
|
-
CATCH cx_sy_authorization_error.
|
|
53504
|
+
goodExample: `TRY.
|
|
53505
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53506
|
+
CATCH cx_sy_authorization_error.
|
|
53464
53507
|
ENDTRY.`,
|
|
53465
53508
|
};
|
|
53466
53509
|
}
|
|
@@ -53525,10 +53568,10 @@ class CDSCommentStyle {
|
|
|
53525
53568
|
key: "cds_comment_style",
|
|
53526
53569
|
title: "CDS Comment Style",
|
|
53527
53570
|
shortDescription: `Check for obsolete comment style`,
|
|
53528
|
-
extendedInformation: `Check for obsolete comment style
|
|
53529
|
-
|
|
53530
|
-
Comments starting with "--" are considered obsolete
|
|
53531
|
-
|
|
53571
|
+
extendedInformation: `Check for obsolete comment style
|
|
53572
|
+
|
|
53573
|
+
Comments starting with "--" are considered obsolete
|
|
53574
|
+
|
|
53532
53575
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53533
53576
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53534
53577
|
badExample: "-- this is a comment",
|
|
@@ -53595,10 +53638,10 @@ class CDSLegacyView {
|
|
|
53595
53638
|
title: "CDS Legacy View",
|
|
53596
53639
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53597
53640
|
// eslint-disable-next-line max-len
|
|
53598
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53599
|
-
|
|
53600
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53601
|
-
|
|
53641
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53642
|
+
|
|
53643
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53644
|
+
|
|
53602
53645
|
v755 and up`,
|
|
53603
53646
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53604
53647
|
};
|
|
@@ -53753,10 +53796,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53753
53796
|
key: "chain_mainly_declarations",
|
|
53754
53797
|
title: "Chain mainly declarations",
|
|
53755
53798
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53756
|
-
extendedInformation: `
|
|
53757
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53758
|
-
|
|
53759
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53799
|
+
extendedInformation: `
|
|
53800
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53801
|
+
|
|
53802
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53760
53803
|
`,
|
|
53761
53804
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53762
53805
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -53932,17 +53975,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
53932
53975
|
title: "Change IF to CASE",
|
|
53933
53976
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
53934
53977
|
// eslint-disable-next-line max-len
|
|
53935
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53936
|
-
|
|
53978
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53979
|
+
|
|
53937
53980
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
53938
53981
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53939
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53940
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53941
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
53982
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53983
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53984
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
53942
53985
|
ENDIF.`,
|
|
53943
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
53944
|
-
WHEN 'FOO'.
|
|
53945
|
-
WHEN 'BAR' OR 'MOO'.
|
|
53986
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
53987
|
+
WHEN 'FOO'.
|
|
53988
|
+
WHEN 'BAR' OR 'MOO'.
|
|
53946
53989
|
ENDCASE.`,
|
|
53947
53990
|
};
|
|
53948
53991
|
}
|
|
@@ -54079,8 +54122,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54079
54122
|
return {
|
|
54080
54123
|
key: "check_abstract",
|
|
54081
54124
|
title: "Check abstract methods and classes",
|
|
54082
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54083
|
-
- class defined as abstract and final,
|
|
54125
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54126
|
+
- class defined as abstract and final,
|
|
54084
54127
|
- non-abstract class contains abstract methods`,
|
|
54085
54128
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54086
54129
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54161,11 +54204,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54161
54204
|
return {
|
|
54162
54205
|
key: "check_comments",
|
|
54163
54206
|
title: "Check Comments",
|
|
54164
|
-
shortDescription: `
|
|
54207
|
+
shortDescription: `
|
|
54165
54208
|
Various checks for comment usage.`,
|
|
54166
|
-
extendedInformation: `
|
|
54167
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54168
|
-
|
|
54209
|
+
extendedInformation: `
|
|
54210
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54211
|
+
|
|
54169
54212
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54170
54213
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54171
54214
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54327,9 +54370,9 @@ class CheckInclude {
|
|
|
54327
54370
|
key: "check_include",
|
|
54328
54371
|
title: "Check INCLUDEs",
|
|
54329
54372
|
shortDescription: `Checks INCLUDE statements`,
|
|
54330
|
-
extendedInformation: `
|
|
54331
|
-
* Reports unused includes
|
|
54332
|
-
* Errors if the includes are not found
|
|
54373
|
+
extendedInformation: `
|
|
54374
|
+
* Reports unused includes
|
|
54375
|
+
* Errors if the includes are not found
|
|
54333
54376
|
* Error if including a main program`,
|
|
54334
54377
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54335
54378
|
};
|
|
@@ -54405,14 +54448,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54405
54448
|
key: "check_subrc",
|
|
54406
54449
|
title: "Check sy-subrc",
|
|
54407
54450
|
shortDescription: `Check sy-subrc`,
|
|
54408
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54409
|
-
|
|
54410
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54411
|
-
|
|
54412
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54413
|
-
|
|
54414
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54415
|
-
|
|
54451
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54452
|
+
|
|
54453
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54454
|
+
|
|
54455
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54456
|
+
|
|
54457
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54458
|
+
|
|
54416
54459
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54417
54460
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54418
54461
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -54981,17 +55024,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
54981
55024
|
shortDescription: `Find overlapping classic exceptions`,
|
|
54982
55025
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
54983
55026
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54984
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54985
|
-
EXCEPTIONS
|
|
54986
|
-
system_failure = 1 MESSAGE lv_message
|
|
54987
|
-
communication_failure = 1 MESSAGE lv_message
|
|
54988
|
-
resource_failure = 1
|
|
55027
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
55028
|
+
EXCEPTIONS
|
|
55029
|
+
system_failure = 1 MESSAGE lv_message
|
|
55030
|
+
communication_failure = 1 MESSAGE lv_message
|
|
55031
|
+
resource_failure = 1
|
|
54989
55032
|
OTHERS = 1.`,
|
|
54990
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54991
|
-
EXCEPTIONS
|
|
54992
|
-
system_failure = 1 MESSAGE lv_message
|
|
54993
|
-
communication_failure = 2 MESSAGE lv_message
|
|
54994
|
-
resource_failure = 3
|
|
55033
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
55034
|
+
EXCEPTIONS
|
|
55035
|
+
system_failure = 1 MESSAGE lv_message
|
|
55036
|
+
communication_failure = 2 MESSAGE lv_message
|
|
55037
|
+
resource_failure = 3
|
|
54995
55038
|
OTHERS = 4.`,
|
|
54996
55039
|
};
|
|
54997
55040
|
}
|
|
@@ -55237,7 +55280,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55237
55280
|
key: "commented_code",
|
|
55238
55281
|
title: "Find commented code",
|
|
55239
55282
|
shortDescription: `Detects usage of commented out code.`,
|
|
55240
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55283
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55241
55284
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55242
55285
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55243
55286
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55470,10 +55513,10 @@ class ConstructorVisibilityPublic {
|
|
|
55470
55513
|
key: "constructor_visibility_public",
|
|
55471
55514
|
title: "Check constructor visibility is public",
|
|
55472
55515
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55473
|
-
extendedInformation: `
|
|
55474
|
-
This only applies to global classes.
|
|
55475
|
-
|
|
55476
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55516
|
+
extendedInformation: `
|
|
55517
|
+
This only applies to global classes.
|
|
55518
|
+
|
|
55519
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55477
55520
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55478
55521
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55479
55522
|
};
|
|
@@ -55548,8 +55591,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55548
55591
|
key: "contains_tab",
|
|
55549
55592
|
title: "Code contains tab",
|
|
55550
55593
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55551
|
-
extendedInformation: `
|
|
55552
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55594
|
+
extendedInformation: `
|
|
55595
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55553
55596
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55554
55597
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55555
55598
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55636,10 +55679,10 @@ class CyclicOO {
|
|
|
55636
55679
|
key: "cyclic_oo",
|
|
55637
55680
|
title: "Cyclic OO",
|
|
55638
55681
|
shortDescription: `Finds cyclic OO references`,
|
|
55639
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55640
|
-
|
|
55641
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55642
|
-
|
|
55682
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55683
|
+
|
|
55684
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55685
|
+
|
|
55643
55686
|
References in testclass includes are ignored`,
|
|
55644
55687
|
};
|
|
55645
55688
|
}
|
|
@@ -55881,7 +55924,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55881
55924
|
key: "dangerous_statement",
|
|
55882
55925
|
title: "Dangerous statement",
|
|
55883
55926
|
shortDescription: `Detects potentially dangerous statements`,
|
|
55884
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55927
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55885
55928
|
dynamic SQL can potentially create SQL injection problems`,
|
|
55886
55929
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55887
55930
|
};
|
|
@@ -56085,13 +56128,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56085
56128
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56086
56129
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56087
56130
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56088
|
-
badExample: `FROM foo.
|
|
56089
|
-
WRITE 'hello'.
|
|
56090
|
-
DATA int TYPE i.
|
|
56131
|
+
badExample: `FROM foo.
|
|
56132
|
+
WRITE 'hello'.
|
|
56133
|
+
DATA int TYPE i.
|
|
56091
56134
|
ENDFORM.`,
|
|
56092
|
-
goodExample: `FROM foo.
|
|
56093
|
-
DATA int TYPE i.
|
|
56094
|
-
WRITE 'hello'.
|
|
56135
|
+
goodExample: `FROM foo.
|
|
56136
|
+
DATA int TYPE i.
|
|
56137
|
+
WRITE 'hello'.
|
|
56095
56138
|
ENDFORM.`,
|
|
56096
56139
|
};
|
|
56097
56140
|
}
|
|
@@ -56627,39 +56670,39 @@ class Downport {
|
|
|
56627
56670
|
key: "downport",
|
|
56628
56671
|
title: "Downport statement",
|
|
56629
56672
|
shortDescription: `Downport functionality`,
|
|
56630
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56631
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56632
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56633
|
-
|
|
56634
|
-
Current rules:
|
|
56635
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56636
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56637
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56638
|
-
* CONV is outlined
|
|
56639
|
-
* COND is outlined
|
|
56640
|
-
* REDUCE is outlined
|
|
56641
|
-
* SWITCH is outlined
|
|
56642
|
-
* FILTER is outlined
|
|
56643
|
-
* APPEND expression is outlined
|
|
56644
|
-
* INSERT expression is outlined
|
|
56645
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56646
|
-
* CAST changed to ?=
|
|
56647
|
-
* LOOP AT method_call( ) is outlined
|
|
56648
|
-
* VALUE # with structure fields
|
|
56649
|
-
* VALUE # with internal table lines
|
|
56650
|
-
* Table Expressions are outlined
|
|
56651
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56652
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56653
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56654
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56655
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56656
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56657
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56658
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56659
|
-
* MESSAGE with non simple source
|
|
56660
|
-
|
|
56661
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56662
|
-
|
|
56673
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56674
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56675
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56676
|
+
|
|
56677
|
+
Current rules:
|
|
56678
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56679
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56680
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56681
|
+
* CONV is outlined
|
|
56682
|
+
* COND is outlined
|
|
56683
|
+
* REDUCE is outlined
|
|
56684
|
+
* SWITCH is outlined
|
|
56685
|
+
* FILTER is outlined
|
|
56686
|
+
* APPEND expression is outlined
|
|
56687
|
+
* INSERT expression is outlined
|
|
56688
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56689
|
+
* CAST changed to ?=
|
|
56690
|
+
* LOOP AT method_call( ) is outlined
|
|
56691
|
+
* VALUE # with structure fields
|
|
56692
|
+
* VALUE # with internal table lines
|
|
56693
|
+
* Table Expressions are outlined
|
|
56694
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56695
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56696
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56697
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56698
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56699
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56700
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56701
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56702
|
+
* MESSAGE with non simple source
|
|
56703
|
+
|
|
56704
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56705
|
+
|
|
56663
56706
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56664
56707
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56665
56708
|
};
|
|
@@ -57237,10 +57280,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57237
57280
|
const fieldName = f.concatTokens();
|
|
57238
57281
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57239
57282
|
}
|
|
57240
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57283
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57241
57284
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57242
57285
|
}
|
|
57243
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57286
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57244
57287
|
${indentation}`);
|
|
57245
57288
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57246
57289
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57284,12 +57327,12 @@ ${indentation}`);
|
|
|
57284
57327
|
}
|
|
57285
57328
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57286
57329
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
57287
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57288
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57289
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57330
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57331
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57332
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57290
57333
|
${indentation}`);
|
|
57291
57334
|
if (fieldDefinitions === "") {
|
|
57292
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57335
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57293
57336
|
${indentation}`);
|
|
57294
57337
|
}
|
|
57295
57338
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57357,7 +57400,7 @@ ${indentation}`);
|
|
|
57357
57400
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57358
57401
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57359
57402
|
const firstToken = high.getFirstToken();
|
|
57360
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57403
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57361
57404
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57362
57405
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57363
57406
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57411,7 +57454,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57411
57454
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57412
57455
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57413
57456
|
const firstToken = high.getFirstToken();
|
|
57414
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57457
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57415
57458
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57416
57459
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57417
57460
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57453,14 +57496,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57453
57496
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57454
57497
|
const firstToken = high.getFirstToken();
|
|
57455
57498
|
// note that the tabix restore should be done before throwing the exception
|
|
57456
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57457
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57458
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57459
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57460
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57461
|
-
${indentation}IF sy-subrc <> 0.
|
|
57462
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57463
|
-
${indentation}ENDIF.
|
|
57499
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57500
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57501
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57502
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57503
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57504
|
+
${indentation}IF sy-subrc <> 0.
|
|
57505
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57506
|
+
${indentation}ENDIF.
|
|
57464
57507
|
${indentation}`);
|
|
57465
57508
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57466
57509
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57517,7 +57560,7 @@ ${indentation}`);
|
|
|
57517
57560
|
const className = classNames[0].concatTokens();
|
|
57518
57561
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57519
57562
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57520
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57563
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57521
57564
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57522
57565
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57523
57566
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57679,16 +57722,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57679
57722
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57680
57723
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57681
57724
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57682
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57683
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57725
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57726
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57684
57727
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57685
57728
|
if (withs.length > 0) {
|
|
57686
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57687
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57688
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57729
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57730
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57731
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57689
57732
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57690
57733
|
}
|
|
57691
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57734
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57692
57735
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57693
57736
|
if (withs.length > 0) {
|
|
57694
57737
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -57800,10 +57843,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
57800
57843
|
let code = "";
|
|
57801
57844
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
57802
57845
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57803
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57804
|
-
IF sy-subrc <> 0.
|
|
57805
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57806
|
-
ENDIF.
|
|
57846
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57847
|
+
IF sy-subrc <> 0.
|
|
57848
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57849
|
+
ENDIF.
|
|
57807
57850
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
57808
57851
|
}
|
|
57809
57852
|
else {
|
|
@@ -57892,20 +57935,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
57892
57935
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57893
57936
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57894
57937
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57895
|
-
code += ` items LIKE ${loopSourceName},
|
|
57896
|
-
END OF ${groupTargetName}type.
|
|
57897
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57898
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57938
|
+
code += ` items LIKE ${loopSourceName},
|
|
57939
|
+
END OF ${groupTargetName}type.
|
|
57940
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57941
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57899
57942
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
57900
57943
|
if (groupIndexName !== undefined) {
|
|
57901
57944
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
57902
57945
|
}
|
|
57903
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57946
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57904
57947
|
IF sy-subrc = 0.\n`;
|
|
57905
57948
|
if (groupCountName !== undefined) {
|
|
57906
57949
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
57907
57950
|
}
|
|
57908
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57951
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57909
57952
|
ELSE.\n`;
|
|
57910
57953
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
57911
57954
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -57926,8 +57969,8 @@ ELSE.\n`;
|
|
|
57926
57969
|
}
|
|
57927
57970
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
57928
57971
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
57929
|
-
code += `ENDIF.
|
|
57930
|
-
ENDLOOP.
|
|
57972
|
+
code += `ENDIF.
|
|
57973
|
+
ENDLOOP.
|
|
57931
57974
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
57932
57975
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
57933
57976
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58099,7 +58142,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58099
58142
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58100
58143
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58101
58144
|
// all ENUMS are char like?
|
|
58102
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58145
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58103
58146
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58104
58147
|
let count = 1;
|
|
58105
58148
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58143,14 +58186,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58143
58186
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58144
58187
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58145
58188
|
// restore tabix before exeption
|
|
58146
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58147
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58148
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58149
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58150
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58151
|
-
${indentation}IF sy-subrc <> 0.
|
|
58152
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58153
|
-
${indentation}ENDIF.
|
|
58189
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58190
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58191
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58192
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58193
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58194
|
+
${indentation}IF sy-subrc <> 0.
|
|
58195
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58196
|
+
${indentation}ENDIF.
|
|
58154
58197
|
${indentation}${uniqueName}`;
|
|
58155
58198
|
const start = target.getFirstToken().getStart();
|
|
58156
58199
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58234,11 +58277,11 @@ ${indentation}${uniqueName}`;
|
|
|
58234
58277
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58235
58278
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58236
58279
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58237
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58238
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58239
|
-
${indentation} EXPORTING
|
|
58240
|
-
${indentation} input = ${source}
|
|
58241
|
-
${indentation} IMPORTING
|
|
58280
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58281
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58282
|
+
${indentation} EXPORTING
|
|
58283
|
+
${indentation} input = ${source}
|
|
58284
|
+
${indentation} IMPORTING
|
|
58242
58285
|
${indentation} output = ${uniqueName}.\n`;
|
|
58243
58286
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58244
58287
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59550,12 +59593,12 @@ class EasyToFindMessages {
|
|
|
59550
59593
|
key: "easy_to_find_messages",
|
|
59551
59594
|
title: "Easy to find messages",
|
|
59552
59595
|
shortDescription: `Make messages easy to find`,
|
|
59553
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59554
|
-
|
|
59555
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59556
|
-
|
|
59557
|
-
Also see rule "message_exists"
|
|
59558
|
-
|
|
59596
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
59597
|
+
|
|
59598
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
59599
|
+
|
|
59600
|
+
Also see rule "message_exists"
|
|
59601
|
+
|
|
59559
59602
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59560
59603
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59561
59604
|
};
|
|
@@ -59640,8 +59683,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59640
59683
|
key: "empty_line_in_statement",
|
|
59641
59684
|
title: "Find empty lines in statements",
|
|
59642
59685
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59643
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59644
|
-
|
|
59686
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59687
|
+
|
|
59645
59688
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59646
59689
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59647
59690
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -59817,13 +59860,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
59817
59860
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
59818
59861
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
59819
59862
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
59820
|
-
badExample: `IF foo = bar.
|
|
59821
|
-
ENDIF.
|
|
59822
|
-
|
|
59823
|
-
DO 2 TIMES.
|
|
59863
|
+
badExample: `IF foo = bar.
|
|
59864
|
+
ENDIF.
|
|
59865
|
+
|
|
59866
|
+
DO 2 TIMES.
|
|
59824
59867
|
ENDDO.`,
|
|
59825
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
59826
|
-
ENDLOOP.
|
|
59868
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
59869
|
+
ENDLOOP.
|
|
59827
59870
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
59828
59871
|
};
|
|
59829
59872
|
}
|
|
@@ -59965,10 +60008,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
59965
60008
|
return {
|
|
59966
60009
|
key: "exit_or_check",
|
|
59967
60010
|
title: "Find EXIT or CHECK outside loops",
|
|
59968
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60011
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59969
60012
|
Use RETURN to leave procesing blocks instead.`,
|
|
59970
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59971
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
60013
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
60014
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59972
60015
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
59973
60016
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59974
60017
|
};
|
|
@@ -60051,12 +60094,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
60051
60094
|
key: "expand_macros",
|
|
60052
60095
|
title: "Expand Macros",
|
|
60053
60096
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
60054
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60055
|
-
|
|
60097
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60098
|
+
|
|
60056
60099
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
60057
|
-
badExample: `DEFINE _hello.
|
|
60058
|
-
WRITE 'hello'.
|
|
60059
|
-
END-OF-DEFINITION.
|
|
60100
|
+
badExample: `DEFINE _hello.
|
|
60101
|
+
WRITE 'hello'.
|
|
60102
|
+
END-OF-DEFINITION.
|
|
60060
60103
|
_hello.`,
|
|
60061
60104
|
goodExample: `WRITE 'hello'.`,
|
|
60062
60105
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60143,7 +60186,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60143
60186
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60144
60187
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60145
60188
|
goodExample: `call_method( foo = bar ).`,
|
|
60146
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60189
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60147
60190
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60148
60191
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60149
60192
|
};
|
|
@@ -60241,7 +60284,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60241
60284
|
key: "forbidden_identifier",
|
|
60242
60285
|
title: "Forbidden Identifier",
|
|
60243
60286
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60244
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60287
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60245
60288
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60246
60289
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60247
60290
|
};
|
|
@@ -60483,8 +60526,8 @@ class ForbiddenVoidType {
|
|
|
60483
60526
|
key: "forbidden_void_type",
|
|
60484
60527
|
title: "Forbidden Void Types",
|
|
60485
60528
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60486
|
-
extendedInformation: `Inspiration:
|
|
60487
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60529
|
+
extendedInformation: `Inspiration:
|
|
60530
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60488
60531
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60489
60532
|
};
|
|
60490
60533
|
}
|
|
@@ -60727,7 +60770,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60727
60770
|
key: "fully_type_itabs",
|
|
60728
60771
|
title: "Fully type internal tables",
|
|
60729
60772
|
shortDescription: `No implict table types or table keys`,
|
|
60730
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60773
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60731
60774
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60732
60775
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60733
60776
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -60912,26 +60955,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
60912
60955
|
key: "functional_writing",
|
|
60913
60956
|
title: "Use functional writing",
|
|
60914
60957
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
60915
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60958
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60916
60959
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
60917
60960
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60918
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60919
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60920
|
-
EXPORTING
|
|
60921
|
-
p_name = 'NAME'
|
|
60922
|
-
RECEIVING
|
|
60923
|
-
p_descr_ref = lr_typedescr
|
|
60924
|
-
EXCEPTIONS
|
|
60925
|
-
type_not_found = 1
|
|
60961
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60962
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60963
|
+
EXPORTING
|
|
60964
|
+
p_name = 'NAME'
|
|
60965
|
+
RECEIVING
|
|
60966
|
+
p_descr_ref = lr_typedescr
|
|
60967
|
+
EXCEPTIONS
|
|
60968
|
+
type_not_found = 1
|
|
60926
60969
|
OTHERS = 2.`,
|
|
60927
|
-
goodExample: `zcl_class=>method( ).
|
|
60928
|
-
cl_abap_typedescr=>describe_by_name(
|
|
60929
|
-
EXPORTING
|
|
60930
|
-
p_name = 'NAME'
|
|
60931
|
-
RECEIVING
|
|
60932
|
-
p_descr_ref = lr_typedescr
|
|
60933
|
-
EXCEPTIONS
|
|
60934
|
-
type_not_found = 1
|
|
60970
|
+
goodExample: `zcl_class=>method( ).
|
|
60971
|
+
cl_abap_typedescr=>describe_by_name(
|
|
60972
|
+
EXPORTING
|
|
60973
|
+
p_name = 'NAME'
|
|
60974
|
+
RECEIVING
|
|
60975
|
+
p_descr_ref = lr_typedescr
|
|
60976
|
+
EXCEPTIONS
|
|
60977
|
+
type_not_found = 1
|
|
60935
60978
|
OTHERS = 2 ).`,
|
|
60936
60979
|
};
|
|
60937
60980
|
}
|
|
@@ -61042,14 +61085,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
61042
61085
|
key: "global_class",
|
|
61043
61086
|
title: "Global class checks",
|
|
61044
61087
|
shortDescription: `Checks related to global classes`,
|
|
61045
|
-
extendedInformation: `* global classes must be in own files
|
|
61046
|
-
|
|
61047
|
-
* file names must match class name
|
|
61048
|
-
|
|
61049
|
-
* file names must match interface name
|
|
61050
|
-
|
|
61051
|
-
* global classes must be global definitions
|
|
61052
|
-
|
|
61088
|
+
extendedInformation: `* global classes must be in own files
|
|
61089
|
+
|
|
61090
|
+
* file names must match class name
|
|
61091
|
+
|
|
61092
|
+
* file names must match interface name
|
|
61093
|
+
|
|
61094
|
+
* global classes must be global definitions
|
|
61095
|
+
|
|
61053
61096
|
* global interfaces must be global definitions`,
|
|
61054
61097
|
tags: [_irule_1.RuleTag.Syntax],
|
|
61055
61098
|
};
|
|
@@ -61148,21 +61191,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61148
61191
|
return {
|
|
61149
61192
|
key: "identical_conditions",
|
|
61150
61193
|
title: "Identical conditions",
|
|
61151
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61152
|
-
|
|
61194
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61195
|
+
|
|
61153
61196
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61154
61197
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61155
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61156
|
-
ENDIF.
|
|
61157
|
-
CASE bar.
|
|
61158
|
-
WHEN '1'.
|
|
61159
|
-
WHEN 'A' OR '1'.
|
|
61198
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61199
|
+
ENDIF.
|
|
61200
|
+
CASE bar.
|
|
61201
|
+
WHEN '1'.
|
|
61202
|
+
WHEN 'A' OR '1'.
|
|
61160
61203
|
ENDCASE.`,
|
|
61161
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61162
|
-
ENDIF.
|
|
61163
|
-
CASE bar.
|
|
61164
|
-
WHEN '1'.
|
|
61165
|
-
WHEN 'A'.
|
|
61204
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61205
|
+
ENDIF.
|
|
61206
|
+
CASE bar.
|
|
61207
|
+
WHEN '1'.
|
|
61208
|
+
WHEN 'A'.
|
|
61166
61209
|
ENDCASE.`,
|
|
61167
61210
|
};
|
|
61168
61211
|
}
|
|
@@ -61296,23 +61339,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61296
61339
|
key: "identical_contents",
|
|
61297
61340
|
title: "Identical contents",
|
|
61298
61341
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61299
|
-
extendedInformation: `
|
|
61300
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61301
|
-
|
|
61342
|
+
extendedInformation: `
|
|
61343
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61344
|
+
|
|
61302
61345
|
Chained statments are ignored`,
|
|
61303
61346
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61304
|
-
badExample: `IF foo = bar.
|
|
61305
|
-
WRITE 'bar'.
|
|
61306
|
-
WRITE 'world'.
|
|
61307
|
-
ELSE.
|
|
61308
|
-
WRITE 'foo'.
|
|
61309
|
-
WRITE 'world'.
|
|
61347
|
+
badExample: `IF foo = bar.
|
|
61348
|
+
WRITE 'bar'.
|
|
61349
|
+
WRITE 'world'.
|
|
61350
|
+
ELSE.
|
|
61351
|
+
WRITE 'foo'.
|
|
61352
|
+
WRITE 'world'.
|
|
61310
61353
|
ENDIF.`,
|
|
61311
|
-
goodExample: `IF foo = bar.
|
|
61312
|
-
WRITE 'bar'.
|
|
61313
|
-
ELSE.
|
|
61314
|
-
WRITE 'foo'.
|
|
61315
|
-
ENDIF.
|
|
61354
|
+
goodExample: `IF foo = bar.
|
|
61355
|
+
WRITE 'bar'.
|
|
61356
|
+
ELSE.
|
|
61357
|
+
WRITE 'foo'.
|
|
61358
|
+
ENDIF.
|
|
61316
61359
|
WRITE 'world'.`,
|
|
61317
61360
|
};
|
|
61318
61361
|
}
|
|
@@ -61420,12 +61463,12 @@ class IdenticalDescriptions {
|
|
|
61420
61463
|
key: "identical_descriptions",
|
|
61421
61464
|
title: "Identical descriptions",
|
|
61422
61465
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61423
|
-
extendedInformation: `Case insensitive
|
|
61424
|
-
|
|
61425
|
-
Only checks the master language descriptions
|
|
61426
|
-
|
|
61427
|
-
Dependencies are skipped
|
|
61428
|
-
|
|
61466
|
+
extendedInformation: `Case insensitive
|
|
61467
|
+
|
|
61468
|
+
Only checks the master language descriptions
|
|
61469
|
+
|
|
61470
|
+
Dependencies are skipped
|
|
61471
|
+
|
|
61429
61472
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61430
61473
|
tags: [],
|
|
61431
61474
|
};
|
|
@@ -61599,43 +61642,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61599
61642
|
key: "if_in_if",
|
|
61600
61643
|
title: "IF in IF",
|
|
61601
61644
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61602
|
-
extendedInformation: `
|
|
61603
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61604
|
-
|
|
61605
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61606
|
-
|
|
61607
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
61645
|
+
extendedInformation: `
|
|
61646
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61647
|
+
|
|
61648
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61649
|
+
|
|
61650
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
61608
61651
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61609
|
-
badExample: `IF condition1.
|
|
61610
|
-
IF condition2.
|
|
61611
|
-
...
|
|
61612
|
-
ENDIF.
|
|
61613
|
-
ENDIF.
|
|
61614
|
-
|
|
61615
|
-
IF condition1.
|
|
61616
|
-
...
|
|
61617
|
-
ELSE.
|
|
61618
|
-
IF condition2.
|
|
61619
|
-
...
|
|
61620
|
-
ENDIF.
|
|
61652
|
+
badExample: `IF condition1.
|
|
61653
|
+
IF condition2.
|
|
61654
|
+
...
|
|
61655
|
+
ENDIF.
|
|
61656
|
+
ENDIF.
|
|
61657
|
+
|
|
61658
|
+
IF condition1.
|
|
61659
|
+
...
|
|
61660
|
+
ELSE.
|
|
61661
|
+
IF condition2.
|
|
61662
|
+
...
|
|
61663
|
+
ENDIF.
|
|
61621
61664
|
ENDIF.`,
|
|
61622
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61623
|
-
...
|
|
61624
|
-
ENDIF.
|
|
61625
|
-
|
|
61626
|
-
IF condition1.
|
|
61627
|
-
...
|
|
61628
|
-
ELSEIF condition2.
|
|
61629
|
-
...
|
|
61630
|
-
ENDIF.
|
|
61631
|
-
|
|
61632
|
-
CASE variable.
|
|
61633
|
-
WHEN value1.
|
|
61634
|
-
...
|
|
61635
|
-
WHEN value2.
|
|
61636
|
-
IF condition2.
|
|
61637
|
-
...
|
|
61638
|
-
ENDIF.
|
|
61665
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61666
|
+
...
|
|
61667
|
+
ENDIF.
|
|
61668
|
+
|
|
61669
|
+
IF condition1.
|
|
61670
|
+
...
|
|
61671
|
+
ELSEIF condition2.
|
|
61672
|
+
...
|
|
61673
|
+
ENDIF.
|
|
61674
|
+
|
|
61675
|
+
CASE variable.
|
|
61676
|
+
WHEN value1.
|
|
61677
|
+
...
|
|
61678
|
+
WHEN value2.
|
|
61679
|
+
IF condition2.
|
|
61680
|
+
...
|
|
61681
|
+
ENDIF.
|
|
61639
61682
|
ENDCASE.`,
|
|
61640
61683
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61641
61684
|
};
|
|
@@ -61820,9 +61863,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
61820
61863
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
61821
61864
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
61822
61865
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
61823
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61824
|
-
METHOD ${methodName.toLowerCase()}.
|
|
61825
|
-
RETURN. " todo, implement method
|
|
61866
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61867
|
+
METHOD ${methodName.toLowerCase()}.
|
|
61868
|
+
RETURN. " todo, implement method
|
|
61826
61869
|
ENDMETHOD.`);
|
|
61827
61870
|
}
|
|
61828
61871
|
}
|
|
@@ -62010,19 +62053,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
62010
62053
|
key: "in_statement_indentation",
|
|
62011
62054
|
title: "In-statement indentation",
|
|
62012
62055
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
62013
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62014
|
-
|
|
62015
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62056
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
62057
|
+
|
|
62058
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
62016
62059
|
to distinguish them better from code within the block.`,
|
|
62017
|
-
badExample: `IF 1 = 1
|
|
62018
|
-
AND 2 = 2.
|
|
62019
|
-
WRITE 'hello' &&
|
|
62020
|
-
'world'.
|
|
62060
|
+
badExample: `IF 1 = 1
|
|
62061
|
+
AND 2 = 2.
|
|
62062
|
+
WRITE 'hello' &&
|
|
62063
|
+
'world'.
|
|
62021
62064
|
ENDIF.`,
|
|
62022
|
-
goodExample: `IF 1 = 1
|
|
62023
|
-
AND 2 = 2.
|
|
62024
|
-
WRITE 'hello' &&
|
|
62025
|
-
'world'.
|
|
62065
|
+
goodExample: `IF 1 = 1
|
|
62066
|
+
AND 2 = 2.
|
|
62067
|
+
WRITE 'hello' &&
|
|
62068
|
+
'world'.
|
|
62026
62069
|
ENDIF.`,
|
|
62027
62070
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62028
62071
|
};
|
|
@@ -62145,23 +62188,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62145
62188
|
title: "Indentation",
|
|
62146
62189
|
shortDescription: `Checks indentation`,
|
|
62147
62190
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62148
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62149
|
-
PRIVATE SECTION.
|
|
62150
|
-
METHODS constructor.
|
|
62151
|
-
ENDCLASS.
|
|
62152
|
-
|
|
62153
|
-
CLASS lcl IMPLEMENTATION.
|
|
62154
|
-
METHOD constructor.
|
|
62155
|
-
ENDMETHOD.
|
|
62191
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62192
|
+
PRIVATE SECTION.
|
|
62193
|
+
METHODS constructor.
|
|
62194
|
+
ENDCLASS.
|
|
62195
|
+
|
|
62196
|
+
CLASS lcl IMPLEMENTATION.
|
|
62197
|
+
METHOD constructor.
|
|
62198
|
+
ENDMETHOD.
|
|
62156
62199
|
ENDCLASS.`,
|
|
62157
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62158
|
-
PRIVATE SECTION.
|
|
62159
|
-
METHODS constructor.
|
|
62160
|
-
ENDCLASS.
|
|
62161
|
-
|
|
62162
|
-
CLASS lcl IMPLEMENTATION.
|
|
62163
|
-
METHOD constructor.
|
|
62164
|
-
ENDMETHOD.
|
|
62200
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62201
|
+
PRIVATE SECTION.
|
|
62202
|
+
METHODS constructor.
|
|
62203
|
+
ENDCLASS.
|
|
62204
|
+
|
|
62205
|
+
CLASS lcl IMPLEMENTATION.
|
|
62206
|
+
METHOD constructor.
|
|
62207
|
+
ENDMETHOD.
|
|
62165
62208
|
ENDCLASS.`,
|
|
62166
62209
|
};
|
|
62167
62210
|
}
|
|
@@ -62548,9 +62591,9 @@ class IntfReferencingClas {
|
|
|
62548
62591
|
key: "intf_referencing_clas",
|
|
62549
62592
|
title: "INTF referencing CLAS",
|
|
62550
62593
|
shortDescription: `Interface contains references to class`,
|
|
62551
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62552
|
-
Only first level references are checked.
|
|
62553
|
-
Exception class references are ignored.
|
|
62594
|
+
extendedInformation: `Only global interfaces are checked.
|
|
62595
|
+
Only first level references are checked.
|
|
62596
|
+
Exception class references are ignored.
|
|
62554
62597
|
Void references are ignored.`,
|
|
62555
62598
|
};
|
|
62556
62599
|
}
|
|
@@ -62635,9 +62678,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
62635
62678
|
title: "Invalid Table Index",
|
|
62636
62679
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
62637
62680
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62638
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
62681
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
62639
62682
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
62640
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
62683
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
62641
62684
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62642
62685
|
};
|
|
62643
62686
|
}
|
|
@@ -63238,8 +63281,8 @@ class LineBreakStyle {
|
|
|
63238
63281
|
return {
|
|
63239
63282
|
key: "line_break_style",
|
|
63240
63283
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63241
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63242
|
-
|
|
63284
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63285
|
+
|
|
63243
63286
|
abapGit does not work with CRLF`,
|
|
63244
63287
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63245
63288
|
};
|
|
@@ -63308,7 +63351,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63308
63351
|
key: "line_length",
|
|
63309
63352
|
title: "Line length",
|
|
63310
63353
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63311
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63354
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63312
63355
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63313
63356
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63314
63357
|
};
|
|
@@ -63379,7 +63422,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63379
63422
|
key: "line_only_punc",
|
|
63380
63423
|
title: "Line containing only punctuation",
|
|
63381
63424
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63382
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63425
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63383
63426
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63384
63427
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63385
63428
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -63639,15 +63682,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63639
63682
|
return {
|
|
63640
63683
|
key: "local_variable_names",
|
|
63641
63684
|
title: "Local variable naming conventions",
|
|
63642
|
-
shortDescription: `
|
|
63643
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63685
|
+
shortDescription: `
|
|
63686
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63644
63687
|
Regexes are case-insensitive.`,
|
|
63645
63688
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
63646
|
-
badExample: `FORM bar.
|
|
63647
|
-
DATA foo.
|
|
63689
|
+
badExample: `FORM bar.
|
|
63690
|
+
DATA foo.
|
|
63648
63691
|
ENDFORM.`,
|
|
63649
|
-
goodExample: `FORM bar.
|
|
63650
|
-
DATA lv_foo.
|
|
63692
|
+
goodExample: `FORM bar.
|
|
63693
|
+
DATA lv_foo.
|
|
63651
63694
|
ENDFORM.`,
|
|
63652
63695
|
};
|
|
63653
63696
|
}
|
|
@@ -63793,10 +63836,10 @@ class MainFileContents {
|
|
|
63793
63836
|
key: "main_file_contents",
|
|
63794
63837
|
title: "Main file contents",
|
|
63795
63838
|
shortDescription: `Checks related to report declarations.`,
|
|
63796
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
63797
|
-
|
|
63798
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63799
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
63839
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
63840
|
+
|
|
63841
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63842
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
63800
63843
|
`,
|
|
63801
63844
|
};
|
|
63802
63845
|
}
|
|
@@ -63912,17 +63955,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
63912
63955
|
title: "Too many parentheses",
|
|
63913
63956
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
63914
63957
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63915
|
-
badExample: `
|
|
63916
|
-
IF ( destination IS INITIAL ).
|
|
63917
|
-
ENDIF.
|
|
63918
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63919
|
-
ENDIF.
|
|
63958
|
+
badExample: `
|
|
63959
|
+
IF ( destination IS INITIAL ).
|
|
63960
|
+
ENDIF.
|
|
63961
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63962
|
+
ENDIF.
|
|
63920
63963
|
`,
|
|
63921
|
-
goodExample: `
|
|
63922
|
-
IF destination IS INITIAL.
|
|
63923
|
-
ENDIF.
|
|
63924
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
63925
|
-
ENDIF.
|
|
63964
|
+
goodExample: `
|
|
63965
|
+
IF destination IS INITIAL.
|
|
63966
|
+
ENDIF.
|
|
63967
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
63968
|
+
ENDIF.
|
|
63926
63969
|
`,
|
|
63927
63970
|
};
|
|
63928
63971
|
}
|
|
@@ -64096,14 +64139,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64096
64139
|
title: "Max one method parameter definition per line",
|
|
64097
64140
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64098
64141
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64099
|
-
badExample: `
|
|
64100
|
-
METHODS apps_scope_token
|
|
64101
|
-
IMPORTING
|
|
64142
|
+
badExample: `
|
|
64143
|
+
METHODS apps_scope_token
|
|
64144
|
+
IMPORTING
|
|
64102
64145
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64103
|
-
goodExample: `
|
|
64104
|
-
METHODS apps_scope_token
|
|
64105
|
-
IMPORTING
|
|
64106
|
-
body TYPE bodyapps_scope_token
|
|
64146
|
+
goodExample: `
|
|
64147
|
+
METHODS apps_scope_token
|
|
64148
|
+
IMPORTING
|
|
64149
|
+
body TYPE bodyapps_scope_token
|
|
64107
64150
|
client_id TYPE str.`,
|
|
64108
64151
|
};
|
|
64109
64152
|
}
|
|
@@ -64168,11 +64211,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64168
64211
|
key: "max_one_statement",
|
|
64169
64212
|
title: "Max one statement per line",
|
|
64170
64213
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64171
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64172
|
-
|
|
64173
|
-
Does not report anything for chained statements.
|
|
64174
|
-
|
|
64175
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64214
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64215
|
+
|
|
64216
|
+
Does not report anything for chained statements.
|
|
64217
|
+
|
|
64218
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64176
64219
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64177
64220
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64178
64221
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -64510,8 +64553,8 @@ class MethodLength {
|
|
|
64510
64553
|
key: "method_length",
|
|
64511
64554
|
title: "Method/Form Length",
|
|
64512
64555
|
shortDescription: `Checks relating to method/form length.`,
|
|
64513
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64514
|
-
|
|
64556
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64557
|
+
|
|
64515
64558
|
Abstract methods without statements are considered okay.`,
|
|
64516
64559
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64517
64560
|
};
|
|
@@ -64616,20 +64659,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
64616
64659
|
key: "method_overwrites_builtin",
|
|
64617
64660
|
title: "Method name overwrites builtin function",
|
|
64618
64661
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
64619
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64620
|
-
|
|
64621
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64622
|
-
|
|
64662
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64663
|
+
|
|
64664
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64665
|
+
|
|
64623
64666
|
Interface method names are ignored`,
|
|
64624
64667
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64625
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64626
|
-
PUBLIC SECTION.
|
|
64627
|
-
METHODS matches.
|
|
64628
|
-
ENDCLASS.
|
|
64629
|
-
|
|
64630
|
-
CLASS lcl IMPLEMENTATION.
|
|
64631
|
-
METHOD matches.
|
|
64632
|
-
ENDMETHOD.
|
|
64668
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64669
|
+
PUBLIC SECTION.
|
|
64670
|
+
METHODS matches.
|
|
64671
|
+
ENDCLASS.
|
|
64672
|
+
|
|
64673
|
+
CLASS lcl IMPLEMENTATION.
|
|
64674
|
+
METHOD matches.
|
|
64675
|
+
ENDMETHOD.
|
|
64633
64676
|
ENDCLASS.`,
|
|
64634
64677
|
};
|
|
64635
64678
|
}
|
|
@@ -64820,12 +64863,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
64820
64863
|
// eslint-disable-next-line max-len
|
|
64821
64864
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
64822
64865
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64823
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64824
|
-
PUBLIC SECTION.
|
|
64825
|
-
METHODS
|
|
64826
|
-
foobar
|
|
64827
|
-
EXPORTING foo TYPE i
|
|
64828
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
64866
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64867
|
+
PUBLIC SECTION.
|
|
64868
|
+
METHODS
|
|
64869
|
+
foobar
|
|
64870
|
+
EXPORTING foo TYPE i
|
|
64871
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
64829
64872
|
ENDCLASS.`,
|
|
64830
64873
|
};
|
|
64831
64874
|
}
|
|
@@ -65205,7 +65248,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65205
65248
|
key: "nesting",
|
|
65206
65249
|
title: "Check nesting depth",
|
|
65207
65250
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65208
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65251
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65209
65252
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65210
65253
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65211
65254
|
};
|
|
@@ -65448,7 +65491,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65448
65491
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65449
65492
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65450
65493
|
badExample: `var1 = var2 = var3.`,
|
|
65451
|
-
goodExample: `var2 = var3.
|
|
65494
|
+
goodExample: `var2 = var3.
|
|
65452
65495
|
var1 = var2.`,
|
|
65453
65496
|
};
|
|
65454
65497
|
}
|
|
@@ -65507,8 +65550,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
65507
65550
|
key: "no_external_form_calls",
|
|
65508
65551
|
title: "No external FORM calls",
|
|
65509
65552
|
shortDescription: `Detect external form calls`,
|
|
65510
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65511
|
-
|
|
65553
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65554
|
+
|
|
65512
65555
|
PERFORM foo(bar).`,
|
|
65513
65556
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65514
65557
|
};
|
|
@@ -65569,17 +65612,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
65569
65612
|
key: "no_inline_in_optional_branches",
|
|
65570
65613
|
title: "Don't declare inline in optional branches",
|
|
65571
65614
|
shortDescription: `Don't declare inline in optional branches`,
|
|
65572
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65573
|
-
|
|
65574
|
-
Considered optional branches:
|
|
65575
|
-
* inside IF/ELSEIF/ELSE
|
|
65576
|
-
* inside LOOP
|
|
65577
|
-
* inside WHILE
|
|
65578
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
65579
|
-
* inside DO
|
|
65580
|
-
* inside SELECT loops
|
|
65581
|
-
|
|
65582
|
-
Not considered optional branches:
|
|
65615
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65616
|
+
|
|
65617
|
+
Considered optional branches:
|
|
65618
|
+
* inside IF/ELSEIF/ELSE
|
|
65619
|
+
* inside LOOP
|
|
65620
|
+
* inside WHILE
|
|
65621
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
65622
|
+
* inside DO
|
|
65623
|
+
* inside SELECT loops
|
|
65624
|
+
|
|
65625
|
+
Not considered optional branches:
|
|
65583
65626
|
* TRY/CATCH/CLEANUP`,
|
|
65584
65627
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65585
65628
|
};
|
|
@@ -65679,12 +65722,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
65679
65722
|
key: "no_prefixes",
|
|
65680
65723
|
title: "No Prefixes",
|
|
65681
65724
|
shortDescription: `Dont use hungarian notation`,
|
|
65682
|
-
extendedInformation: `
|
|
65683
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65684
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65685
|
-
|
|
65686
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65687
|
-
|
|
65725
|
+
extendedInformation: `
|
|
65726
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65727
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65728
|
+
|
|
65729
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65730
|
+
|
|
65688
65731
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
65689
65732
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65690
65733
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -65863,7 +65906,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
65863
65906
|
return {
|
|
65864
65907
|
key: "no_public_attributes",
|
|
65865
65908
|
title: "No public attributes",
|
|
65866
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65909
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65867
65910
|
Exceptions are excluded from this rule.`,
|
|
65868
65911
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
65869
65912
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -65964,13 +66007,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
65964
66007
|
key: "no_yoda_conditions",
|
|
65965
66008
|
title: "No Yoda conditions",
|
|
65966
66009
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
65967
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65968
|
-
|
|
66010
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66011
|
+
|
|
65969
66012
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
65970
66013
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65971
|
-
badExample: `IF 0 <> sy-subrc.
|
|
66014
|
+
badExample: `IF 0 <> sy-subrc.
|
|
65972
66015
|
ENDIF.`,
|
|
65973
|
-
goodExample: `IF sy-subrc <> 0.
|
|
66016
|
+
goodExample: `IF sy-subrc <> 0.
|
|
65974
66017
|
ENDIF.`,
|
|
65975
66018
|
};
|
|
65976
66019
|
}
|
|
@@ -66071,8 +66114,8 @@ class NROBConsistency {
|
|
|
66071
66114
|
key: "nrob_consistency",
|
|
66072
66115
|
title: "Number range consistency",
|
|
66073
66116
|
shortDescription: `Consistency checks for number ranges`,
|
|
66074
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66075
|
-
|
|
66117
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66118
|
+
|
|
66076
66119
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
66077
66120
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66078
66121
|
};
|
|
@@ -66349,58 +66392,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66349
66392
|
title: "Obsolete statements",
|
|
66350
66393
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66351
66394
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66352
|
-
extendedInformation: `
|
|
66353
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66354
|
-
|
|
66355
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66356
|
-
|
|
66357
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66358
|
-
|
|
66359
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66360
|
-
|
|
66361
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66362
|
-
|
|
66363
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66364
|
-
|
|
66365
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66366
|
-
|
|
66367
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66368
|
-
|
|
66369
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66370
|
-
|
|
66371
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66372
|
-
|
|
66373
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66374
|
-
|
|
66375
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66376
|
-
|
|
66377
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66378
|
-
|
|
66379
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66380
|
-
|
|
66381
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66382
|
-
SELECT COUNT(*) is considered okay
|
|
66383
|
-
|
|
66384
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66385
|
-
|
|
66386
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66387
|
-
|
|
66388
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66389
|
-
|
|
66390
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66391
|
-
|
|
66392
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66393
|
-
|
|
66395
|
+
extendedInformation: `
|
|
66396
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66397
|
+
|
|
66398
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66399
|
+
|
|
66400
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66401
|
+
|
|
66402
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66403
|
+
|
|
66404
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66405
|
+
|
|
66406
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66407
|
+
|
|
66408
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66409
|
+
|
|
66410
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66411
|
+
|
|
66412
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66413
|
+
|
|
66414
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66415
|
+
|
|
66416
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66417
|
+
|
|
66418
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66419
|
+
|
|
66420
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66421
|
+
|
|
66422
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66423
|
+
|
|
66424
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66425
|
+
SELECT COUNT(*) is considered okay
|
|
66426
|
+
|
|
66427
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66428
|
+
|
|
66429
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66430
|
+
|
|
66431
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66432
|
+
|
|
66433
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66434
|
+
|
|
66435
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66436
|
+
|
|
66394
66437
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66395
|
-
badExample: `REFRESH itab.
|
|
66396
|
-
|
|
66397
|
-
COMPUTE foo = 2 + 2.
|
|
66398
|
-
|
|
66399
|
-
MULTIPLY lv_foo BY 2.
|
|
66400
|
-
|
|
66401
|
-
INTERFACE intf LOAD.
|
|
66402
|
-
|
|
66403
|
-
IF foo IS SUPPLIED.
|
|
66438
|
+
badExample: `REFRESH itab.
|
|
66439
|
+
|
|
66440
|
+
COMPUTE foo = 2 + 2.
|
|
66441
|
+
|
|
66442
|
+
MULTIPLY lv_foo BY 2.
|
|
66443
|
+
|
|
66444
|
+
INTERFACE intf LOAD.
|
|
66445
|
+
|
|
66446
|
+
IF foo IS SUPPLIED.
|
|
66404
66447
|
ENDIF.`,
|
|
66405
66448
|
};
|
|
66406
66449
|
}
|
|
@@ -66740,9 +66783,9 @@ class OmitParameterName {
|
|
|
66740
66783
|
key: "omit_parameter_name",
|
|
66741
66784
|
title: "Omit parameter name",
|
|
66742
66785
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
66743
|
-
extendedInformation: `
|
|
66744
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
66745
|
-
|
|
66786
|
+
extendedInformation: `
|
|
66787
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
66788
|
+
|
|
66746
66789
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
66747
66790
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66748
66791
|
badExample: `method( param = 2 ).`,
|
|
@@ -66948,20 +66991,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
66948
66991
|
shortDescription: `Omit RECEIVING`,
|
|
66949
66992
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
66950
66993
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66951
|
-
badExample: `
|
|
66952
|
-
upload_pack(
|
|
66953
|
-
EXPORTING
|
|
66954
|
-
io_client = lo_client
|
|
66955
|
-
iv_url = iv_url
|
|
66956
|
-
iv_deepen_level = iv_deepen_level
|
|
66957
|
-
it_hashes = lt_hashes
|
|
66958
|
-
RECEIVING
|
|
66994
|
+
badExample: `
|
|
66995
|
+
upload_pack(
|
|
66996
|
+
EXPORTING
|
|
66997
|
+
io_client = lo_client
|
|
66998
|
+
iv_url = iv_url
|
|
66999
|
+
iv_deepen_level = iv_deepen_level
|
|
67000
|
+
it_hashes = lt_hashes
|
|
67001
|
+
RECEIVING
|
|
66959
67002
|
rt_objects = et_objects ).`,
|
|
66960
|
-
goodExample: `
|
|
66961
|
-
et_objects = upload_pack(
|
|
66962
|
-
io_client = lo_client
|
|
66963
|
-
iv_url = iv_url
|
|
66964
|
-
iv_deepen_level = iv_deepen_level
|
|
67003
|
+
goodExample: `
|
|
67004
|
+
et_objects = upload_pack(
|
|
67005
|
+
io_client = lo_client
|
|
67006
|
+
iv_url = iv_url
|
|
67007
|
+
iv_deepen_level = iv_deepen_level
|
|
66965
67008
|
it_hashes = lt_hashes ).`,
|
|
66966
67009
|
};
|
|
66967
67010
|
}
|
|
@@ -67025,8 +67068,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
67025
67068
|
return {
|
|
67026
67069
|
key: "parser_702_chaining",
|
|
67027
67070
|
title: "Parser Error, bad chanining on 702",
|
|
67028
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67029
|
-
this rule finds these and reports errors.
|
|
67071
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67072
|
+
this rule finds these and reports errors.
|
|
67030
67073
|
Only active on target version 702 and below.`,
|
|
67031
67074
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67032
67075
|
};
|
|
@@ -67106,8 +67149,8 @@ class ParserError {
|
|
|
67106
67149
|
return {
|
|
67107
67150
|
key: "parser_error",
|
|
67108
67151
|
title: "Parser error",
|
|
67109
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67110
|
-
|
|
67152
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67153
|
+
|
|
67111
67154
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67112
67155
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67113
67156
|
};
|
|
@@ -67192,7 +67235,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67192
67235
|
return {
|
|
67193
67236
|
key: "parser_missing_space",
|
|
67194
67237
|
title: "Parser Error, missing space",
|
|
67195
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67238
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67196
67239
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67197
67240
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67198
67241
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -67604,25 +67647,25 @@ class PreferInline {
|
|
|
67604
67647
|
key: "prefer_inline",
|
|
67605
67648
|
title: "Prefer Inline Declarations",
|
|
67606
67649
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
67607
|
-
extendedInformation: `EXPERIMENTAL
|
|
67608
|
-
|
|
67609
|
-
Activates if language version is v740sp02 or above.
|
|
67610
|
-
|
|
67611
|
-
Variables must be local(METHOD or FORM).
|
|
67612
|
-
|
|
67613
|
-
No generic or void typed variables. No syntax errors.
|
|
67614
|
-
|
|
67615
|
-
First position used must be a full/pure write.
|
|
67616
|
-
|
|
67617
|
-
Move statment is not a cast(?=)
|
|
67618
|
-
|
|
67650
|
+
extendedInformation: `EXPERIMENTAL
|
|
67651
|
+
|
|
67652
|
+
Activates if language version is v740sp02 or above.
|
|
67653
|
+
|
|
67654
|
+
Variables must be local(METHOD or FORM).
|
|
67655
|
+
|
|
67656
|
+
No generic or void typed variables. No syntax errors.
|
|
67657
|
+
|
|
67658
|
+
First position used must be a full/pure write.
|
|
67659
|
+
|
|
67660
|
+
Move statment is not a cast(?=)
|
|
67661
|
+
|
|
67619
67662
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
67620
67663
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
67621
|
-
badExample: `DATA foo TYPE i.
|
|
67622
|
-
foo = 2.
|
|
67623
|
-
DATA percentage TYPE decfloat34.
|
|
67664
|
+
badExample: `DATA foo TYPE i.
|
|
67665
|
+
foo = 2.
|
|
67666
|
+
DATA percentage TYPE decfloat34.
|
|
67624
67667
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
67625
|
-
goodExample: `DATA(foo) = 2.
|
|
67668
|
+
goodExample: `DATA(foo) = 2.
|
|
67626
67669
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
67627
67670
|
};
|
|
67628
67671
|
}
|
|
@@ -67836,18 +67879,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
67836
67879
|
key: "prefer_is_not",
|
|
67837
67880
|
title: "Prefer IS NOT to NOT IS",
|
|
67838
67881
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
67839
|
-
extendedInformation: `
|
|
67840
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67841
|
-
|
|
67882
|
+
extendedInformation: `
|
|
67883
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67884
|
+
|
|
67842
67885
|
"if not is_valid( )." examples are skipped`,
|
|
67843
67886
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
67844
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
67845
|
-
IF variable NP 'TODO*'.
|
|
67846
|
-
IF variable <> 42.
|
|
67887
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
67888
|
+
IF variable NP 'TODO*'.
|
|
67889
|
+
IF variable <> 42.
|
|
67847
67890
|
IF variable CO 'hello'.`,
|
|
67848
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
67849
|
-
IF NOT variable CP 'TODO*'.
|
|
67850
|
-
IF NOT variable = 42.
|
|
67891
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
67892
|
+
IF NOT variable CP 'TODO*'.
|
|
67893
|
+
IF NOT variable = 42.
|
|
67851
67894
|
IF NOT variable CA 'hello'.`,
|
|
67852
67895
|
};
|
|
67853
67896
|
}
|
|
@@ -68035,14 +68078,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
68035
68078
|
key: "prefer_raise_exception_new",
|
|
68036
68079
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
68037
68080
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
68038
|
-
extendedInformation: `
|
|
68039
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68040
|
-
|
|
68081
|
+
extendedInformation: `
|
|
68082
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68083
|
+
|
|
68041
68084
|
From 752 and up`,
|
|
68042
68085
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
68043
68086
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
68044
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68045
|
-
EXPORTING
|
|
68087
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68088
|
+
EXPORTING
|
|
68046
68089
|
previous = exception.`,
|
|
68047
68090
|
};
|
|
68048
68091
|
}
|
|
@@ -68120,12 +68163,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68120
68163
|
key: "prefer_returning_to_exporting",
|
|
68121
68164
|
title: "Prefer RETURNING to EXPORTING",
|
|
68122
68165
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68123
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68166
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68124
68167
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68125
68168
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68126
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68127
|
-
PUBLIC SECTION.
|
|
68128
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68169
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68170
|
+
PUBLIC SECTION.
|
|
68171
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68129
68172
|
ENDCLASS.`,
|
|
68130
68173
|
};
|
|
68131
68174
|
}
|
|
@@ -68221,8 +68264,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68221
68264
|
key: "prefer_xsdbool",
|
|
68222
68265
|
title: "Prefer xsdbool over boolc",
|
|
68223
68266
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68224
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68225
|
-
|
|
68267
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68268
|
+
|
|
68226
68269
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68227
68270
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68228
68271
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68294,9 +68337,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68294
68337
|
title: "Preferred compare operator",
|
|
68295
68338
|
shortDescription: `Configure undesired operator variants`,
|
|
68296
68339
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68297
|
-
badExample: `IF foo EQ bar.
|
|
68340
|
+
badExample: `IF foo EQ bar.
|
|
68298
68341
|
ENDIF.`,
|
|
68299
|
-
goodExample: `IF foo = bar.
|
|
68342
|
+
goodExample: `IF foo = bar.
|
|
68300
68343
|
ENDIF.`,
|
|
68301
68344
|
};
|
|
68302
68345
|
}
|
|
@@ -68520,26 +68563,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
68520
68563
|
key: "reduce_procedural_code",
|
|
68521
68564
|
title: "Reduce procedural code",
|
|
68522
68565
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
68523
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68524
|
-
|
|
68525
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68526
|
-
|
|
68566
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68567
|
+
|
|
68568
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68569
|
+
|
|
68527
68570
|
Comments are not counted as statements.`,
|
|
68528
68571
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68529
|
-
badExample: `FORM foo.
|
|
68530
|
-
DATA lv_bar TYPE i.
|
|
68531
|
-
lv_bar = 2 + 2.
|
|
68532
|
-
IF lv_bar = 4.
|
|
68533
|
-
WRITE 'hello world'.
|
|
68534
|
-
ENDIF.
|
|
68535
|
-
DATA lv_bar TYPE i.
|
|
68536
|
-
lv_bar = 2 + 2.
|
|
68537
|
-
IF lv_bar = 4.
|
|
68538
|
-
WRITE 'hello world'.
|
|
68539
|
-
ENDIF.
|
|
68572
|
+
badExample: `FORM foo.
|
|
68573
|
+
DATA lv_bar TYPE i.
|
|
68574
|
+
lv_bar = 2 + 2.
|
|
68575
|
+
IF lv_bar = 4.
|
|
68576
|
+
WRITE 'hello world'.
|
|
68577
|
+
ENDIF.
|
|
68578
|
+
DATA lv_bar TYPE i.
|
|
68579
|
+
lv_bar = 2 + 2.
|
|
68580
|
+
IF lv_bar = 4.
|
|
68581
|
+
WRITE 'hello world'.
|
|
68582
|
+
ENDIF.
|
|
68540
68583
|
ENDFORM.`,
|
|
68541
|
-
goodExample: `FORM foo.
|
|
68542
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
68584
|
+
goodExample: `FORM foo.
|
|
68585
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
68543
68586
|
ENDFORM.`,
|
|
68544
68587
|
};
|
|
68545
68588
|
}
|
|
@@ -68783,10 +68826,10 @@ class RemoveDescriptions {
|
|
|
68783
68826
|
return {
|
|
68784
68827
|
key: "remove_descriptions",
|
|
68785
68828
|
title: "Remove descriptions",
|
|
68786
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
68787
|
-
|
|
68788
|
-
Class descriptions are required, see rule description_empty.
|
|
68789
|
-
|
|
68829
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
68830
|
+
|
|
68831
|
+
Class descriptions are required, see rule description_empty.
|
|
68832
|
+
|
|
68790
68833
|
Consider using ABAP Doc for documentation.`,
|
|
68791
68834
|
tags: [],
|
|
68792
68835
|
};
|
|
@@ -68911,16 +68954,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
68911
68954
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68912
68955
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
68913
68956
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
68914
|
-
badExample: `
|
|
68915
|
-
CALL FUNCTION 'ZRFC'
|
|
68957
|
+
badExample: `
|
|
68958
|
+
CALL FUNCTION 'ZRFC'
|
|
68916
68959
|
DESTINATION lv_rfc.`,
|
|
68917
|
-
goodExample: `
|
|
68918
|
-
CALL FUNCTION 'ZRFC'
|
|
68919
|
-
DESTINATION lv_rfc
|
|
68920
|
-
EXCEPTIONS
|
|
68921
|
-
system_failure = 1 MESSAGE msg
|
|
68922
|
-
communication_failure = 2 MESSAGE msg
|
|
68923
|
-
resource_failure = 3
|
|
68960
|
+
goodExample: `
|
|
68961
|
+
CALL FUNCTION 'ZRFC'
|
|
68962
|
+
DESTINATION lv_rfc
|
|
68963
|
+
EXCEPTIONS
|
|
68964
|
+
system_failure = 1 MESSAGE msg
|
|
68965
|
+
communication_failure = 2 MESSAGE msg
|
|
68966
|
+
resource_failure = 3
|
|
68924
68967
|
OTHERS = 4.`,
|
|
68925
68968
|
};
|
|
68926
68969
|
}
|
|
@@ -69004,11 +69047,11 @@ class SelectAddOrderBy {
|
|
|
69004
69047
|
key: "select_add_order_by",
|
|
69005
69048
|
title: "SELECT add ORDER BY",
|
|
69006
69049
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
69007
|
-
extendedInformation: `
|
|
69008
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69009
|
-
|
|
69010
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
69011
|
-
|
|
69050
|
+
extendedInformation: `
|
|
69051
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
69052
|
+
|
|
69053
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
69054
|
+
|
|
69012
69055
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
69013
69056
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
69014
69057
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69139,14 +69182,14 @@ class SelectPerformance {
|
|
|
69139
69182
|
key: "select_performance",
|
|
69140
69183
|
title: "SELECT performance",
|
|
69141
69184
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69142
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69143
|
-
|
|
69185
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69186
|
+
|
|
69144
69187
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69145
69188
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69146
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69147
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69189
|
+
badExample: `SELECT field1, field2 FROM table
|
|
69190
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69148
69191
|
ENDSELECT.`,
|
|
69149
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69192
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69150
69193
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69151
69194
|
};
|
|
69152
69195
|
}
|
|
@@ -69258,8 +69301,8 @@ class SelectSingleFullKey {
|
|
|
69258
69301
|
key: "select_single_full_key",
|
|
69259
69302
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69260
69303
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69261
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69262
|
-
|
|
69304
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69305
|
+
|
|
69263
69306
|
If the statement contains a JOIN it is not checked`,
|
|
69264
69307
|
pseudoComment: "EC CI_NOORDER",
|
|
69265
69308
|
tags: [],
|
|
@@ -69676,8 +69719,8 @@ class SICFConsistency {
|
|
|
69676
69719
|
key: "sicf_consistency",
|
|
69677
69720
|
title: "SICF consistency",
|
|
69678
69721
|
shortDescription: `Checks the validity of ICF services`,
|
|
69679
|
-
extendedInformation: `* Class defined in handler must exist
|
|
69680
|
-
* Class must not have any syntax errors
|
|
69722
|
+
extendedInformation: `* Class defined in handler must exist
|
|
69723
|
+
* Class must not have any syntax errors
|
|
69681
69724
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
69682
69725
|
};
|
|
69683
69726
|
}
|
|
@@ -69789,23 +69832,23 @@ class SlowParameterPassing {
|
|
|
69789
69832
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
69790
69833
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
69791
69834
|
tags: [_irule_1.RuleTag.Performance],
|
|
69792
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69793
|
-
PUBLIC SECTION.
|
|
69794
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
69795
|
-
ENDCLASS.
|
|
69796
|
-
CLASS lcl IMPLEMENTATION.
|
|
69797
|
-
METHOD bar.
|
|
69798
|
-
WRITE sdf.
|
|
69799
|
-
ENDMETHOD.
|
|
69835
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69836
|
+
PUBLIC SECTION.
|
|
69837
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
69838
|
+
ENDCLASS.
|
|
69839
|
+
CLASS lcl IMPLEMENTATION.
|
|
69840
|
+
METHOD bar.
|
|
69841
|
+
WRITE sdf.
|
|
69842
|
+
ENDMETHOD.
|
|
69800
69843
|
ENDCLASS.`,
|
|
69801
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
69802
|
-
PUBLIC SECTION.
|
|
69803
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
69804
|
-
ENDCLASS.
|
|
69805
|
-
CLASS lcl IMPLEMENTATION.
|
|
69806
|
-
METHOD bar.
|
|
69807
|
-
WRITE sdf.
|
|
69808
|
-
ENDMETHOD.
|
|
69844
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
69845
|
+
PUBLIC SECTION.
|
|
69846
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
69847
|
+
ENDCLASS.
|
|
69848
|
+
CLASS lcl IMPLEMENTATION.
|
|
69849
|
+
METHOD bar.
|
|
69850
|
+
WRITE sdf.
|
|
69851
|
+
ENDMETHOD.
|
|
69809
69852
|
ENDCLASS.`,
|
|
69810
69853
|
};
|
|
69811
69854
|
}
|
|
@@ -70062,8 +70105,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
70062
70105
|
key: "space_before_dot",
|
|
70063
70106
|
title: "Space before dot",
|
|
70064
70107
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
70065
|
-
extendedInformation: `
|
|
70066
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70108
|
+
extendedInformation: `
|
|
70109
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70067
70110
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
70068
70111
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70069
70112
|
badExample: `WRITE bar .`,
|
|
@@ -70249,12 +70292,12 @@ class SQLValueConversion {
|
|
|
70249
70292
|
key: "sql_value_conversion",
|
|
70250
70293
|
title: "Implicit SQL Value Conversion",
|
|
70251
70294
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70252
|
-
extendedInformation: `
|
|
70253
|
-
* Integer to CHAR conversion
|
|
70254
|
-
* Integer to NUMC conversion
|
|
70255
|
-
* NUMC to Integer conversion
|
|
70256
|
-
* CHAR to Integer conversion
|
|
70257
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
70295
|
+
extendedInformation: `
|
|
70296
|
+
* Integer to CHAR conversion
|
|
70297
|
+
* Integer to NUMC conversion
|
|
70298
|
+
* NUMC to Integer conversion
|
|
70299
|
+
* CHAR to Integer conversion
|
|
70300
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
70258
70301
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70259
70302
|
tags: [],
|
|
70260
70303
|
};
|
|
@@ -70326,7 +70369,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70326
70369
|
key: "start_at_tab",
|
|
70327
70370
|
title: "Start at tab",
|
|
70328
70371
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70329
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70372
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70330
70373
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70331
70374
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70332
70375
|
badExample: ` WRITE a.`,
|
|
@@ -70503,12 +70546,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
70503
70546
|
key: "strict_sql",
|
|
70504
70547
|
title: "Strict SQL",
|
|
70505
70548
|
shortDescription: `Strict SQL`,
|
|
70506
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70507
|
-
|
|
70508
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70509
|
-
|
|
70510
|
-
Also see separate rule sql_escape_host_variables
|
|
70511
|
-
|
|
70549
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70550
|
+
|
|
70551
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70552
|
+
|
|
70553
|
+
Also see separate rule sql_escape_host_variables
|
|
70554
|
+
|
|
70512
70555
|
Activates from v750 and up`,
|
|
70513
70556
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
70514
70557
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -70762,11 +70805,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
70762
70805
|
key: "sy_modification",
|
|
70763
70806
|
title: "Modification of SY fields",
|
|
70764
70807
|
shortDescription: `Finds modification of sy fields`,
|
|
70765
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
70766
|
-
|
|
70808
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
70809
|
+
|
|
70767
70810
|
Changes to SY-TVAR* fields are not reported`,
|
|
70768
70811
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70769
|
-
badExample: `sy-uname = 2.
|
|
70812
|
+
badExample: `sy-uname = 2.
|
|
70770
70813
|
sy = sy.`,
|
|
70771
70814
|
};
|
|
70772
70815
|
}
|
|
@@ -70828,8 +70871,8 @@ class TABLEnhancementCategory {
|
|
|
70828
70871
|
key: "tabl_enhancement_category",
|
|
70829
70872
|
title: "TABL enhancement category must be set",
|
|
70830
70873
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
70831
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
70832
|
-
|
|
70874
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
70875
|
+
|
|
70833
70876
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
70834
70877
|
tags: [],
|
|
70835
70878
|
};
|
|
@@ -70957,9 +71000,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
70957
71000
|
title: "Type FORM parameters",
|
|
70958
71001
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
70959
71002
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70960
|
-
badExample: `FORM foo USING bar.
|
|
71003
|
+
badExample: `FORM foo USING bar.
|
|
70961
71004
|
ENDFORM.`,
|
|
70962
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
71005
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
70963
71006
|
ENDFORM.`,
|
|
70964
71007
|
};
|
|
70965
71008
|
}
|
|
@@ -71632,38 +71675,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
71632
71675
|
key: "unnecessary_pragma",
|
|
71633
71676
|
title: "Unnecessary Pragma",
|
|
71634
71677
|
shortDescription: `Finds pragmas which can be removed`,
|
|
71635
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
71636
|
-
|
|
71637
|
-
* NEEDED without definition
|
|
71638
|
-
|
|
71639
|
-
* NO_TEXT without texts
|
|
71640
|
-
|
|
71641
|
-
* SUBRC_OK where sy-subrc is checked
|
|
71642
|
-
|
|
71678
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
71679
|
+
|
|
71680
|
+
* NEEDED without definition
|
|
71681
|
+
|
|
71682
|
+
* NO_TEXT without texts
|
|
71683
|
+
|
|
71684
|
+
* SUBRC_OK where sy-subrc is checked
|
|
71685
|
+
|
|
71643
71686
|
NO_HANDLER inside macros are not checked`,
|
|
71644
71687
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71645
|
-
badExample: `TRY.
|
|
71646
|
-
...
|
|
71647
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71648
|
-
RETURN. " it has a handler
|
|
71649
|
-
ENDTRY.
|
|
71650
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71651
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71652
|
-
IF sy-subrc <> 0.
|
|
71688
|
+
badExample: `TRY.
|
|
71689
|
+
...
|
|
71690
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71691
|
+
RETURN. " it has a handler
|
|
71692
|
+
ENDTRY.
|
|
71693
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71694
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71695
|
+
IF sy-subrc <> 0.
|
|
71653
71696
|
ENDIF.`,
|
|
71654
|
-
goodExample: `TRY.
|
|
71655
|
-
...
|
|
71656
|
-
CATCH zcx_abapgit_exception.
|
|
71657
|
-
RETURN.
|
|
71658
|
-
ENDTRY.
|
|
71659
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71660
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71661
|
-
IF sy-subrc <> 0.
|
|
71662
|
-
ENDIF.
|
|
71663
|
-
|
|
71664
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
71665
|
-
test1 TYPE string,
|
|
71666
|
-
test2 TYPE string,
|
|
71697
|
+
goodExample: `TRY.
|
|
71698
|
+
...
|
|
71699
|
+
CATCH zcx_abapgit_exception.
|
|
71700
|
+
RETURN.
|
|
71701
|
+
ENDTRY.
|
|
71702
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71703
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71704
|
+
IF sy-subrc <> 0.
|
|
71705
|
+
ENDIF.
|
|
71706
|
+
|
|
71707
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
71708
|
+
test1 TYPE string,
|
|
71709
|
+
test2 TYPE string,
|
|
71667
71710
|
END OF blah.`,
|
|
71668
71711
|
};
|
|
71669
71712
|
}
|
|
@@ -71824,18 +71867,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
71824
71867
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
71825
71868
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
71826
71869
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
71827
|
-
badExample: `FORM hello1.
|
|
71828
|
-
WRITE 'world'.
|
|
71829
|
-
RETURN.
|
|
71830
|
-
ENDFORM.
|
|
71831
|
-
|
|
71832
|
-
FORM foo.
|
|
71833
|
-
IF 1 = 2.
|
|
71834
|
-
RETURN.
|
|
71835
|
-
ENDIF.
|
|
71870
|
+
badExample: `FORM hello1.
|
|
71871
|
+
WRITE 'world'.
|
|
71872
|
+
RETURN.
|
|
71873
|
+
ENDFORM.
|
|
71874
|
+
|
|
71875
|
+
FORM foo.
|
|
71876
|
+
IF 1 = 2.
|
|
71877
|
+
RETURN.
|
|
71878
|
+
ENDIF.
|
|
71836
71879
|
ENDFORM.`,
|
|
71837
|
-
goodExample: `FORM hello2.
|
|
71838
|
-
WRITE 'world'.
|
|
71880
|
+
goodExample: `FORM hello2.
|
|
71881
|
+
WRITE 'world'.
|
|
71839
71882
|
ENDFORM.`,
|
|
71840
71883
|
};
|
|
71841
71884
|
}
|
|
@@ -72202,17 +72245,17 @@ class UnusedMethods {
|
|
|
72202
72245
|
key: "unused_methods",
|
|
72203
72246
|
title: "Unused methods",
|
|
72204
72247
|
shortDescription: `Checks for unused methods`,
|
|
72205
|
-
extendedInformation: `Checks private and protected methods.
|
|
72206
|
-
|
|
72207
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72208
|
-
|
|
72209
|
-
Skips:
|
|
72210
|
-
* methods FOR TESTING
|
|
72211
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72212
|
-
* class_constructor + constructor methods
|
|
72213
|
-
* event handlers
|
|
72214
|
-
* methods that are redefined
|
|
72215
|
-
* INCLUDEs
|
|
72248
|
+
extendedInformation: `Checks private and protected methods.
|
|
72249
|
+
|
|
72250
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72251
|
+
|
|
72252
|
+
Skips:
|
|
72253
|
+
* methods FOR TESTING
|
|
72254
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72255
|
+
* class_constructor + constructor methods
|
|
72256
|
+
* event handlers
|
|
72257
|
+
* methods that are redefined
|
|
72258
|
+
* INCLUDEs
|
|
72216
72259
|
`,
|
|
72217
72260
|
tags: [],
|
|
72218
72261
|
pragma: "##CALLED",
|
|
@@ -72646,23 +72689,23 @@ class UnusedVariables {
|
|
|
72646
72689
|
key: "unused_variables",
|
|
72647
72690
|
title: "Unused variables",
|
|
72648
72691
|
shortDescription: `Checks for unused variables and constants`,
|
|
72649
|
-
extendedInformation: `Skips event parameters.
|
|
72650
|
-
|
|
72651
|
-
Note that this currently does not work if the source code uses macros.
|
|
72652
|
-
|
|
72653
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
72654
|
-
|
|
72692
|
+
extendedInformation: `Skips event parameters.
|
|
72693
|
+
|
|
72694
|
+
Note that this currently does not work if the source code uses macros.
|
|
72695
|
+
|
|
72696
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
72697
|
+
|
|
72655
72698
|
Errors found in INCLUDES are reported for the main program.`,
|
|
72656
72699
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72657
72700
|
pragma: "##NEEDED",
|
|
72658
72701
|
pseudoComment: "EC NEEDED",
|
|
72659
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
72660
|
-
test TYPE string,
|
|
72661
|
-
test2 TYPE string,
|
|
72702
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
72703
|
+
test TYPE string,
|
|
72704
|
+
test2 TYPE string,
|
|
72662
72705
|
END OF blah1.`,
|
|
72663
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
72664
|
-
test TYPE string,
|
|
72665
|
-
test2 TYPE string,
|
|
72706
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
72707
|
+
test TYPE string,
|
|
72708
|
+
test2 TYPE string,
|
|
72666
72709
|
END OF blah2.`,
|
|
72667
72710
|
};
|
|
72668
72711
|
}
|
|
@@ -72881,15 +72924,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
72881
72924
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
72882
72925
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
72883
72926
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
72884
|
-
badExample: `IF line IS INITIAL.
|
|
72885
|
-
has_entries = abap_false.
|
|
72886
|
-
ELSE.
|
|
72887
|
-
has_entries = abap_true.
|
|
72888
|
-
ENDIF.
|
|
72889
|
-
|
|
72927
|
+
badExample: `IF line IS INITIAL.
|
|
72928
|
+
has_entries = abap_false.
|
|
72929
|
+
ELSE.
|
|
72930
|
+
has_entries = abap_true.
|
|
72931
|
+
ENDIF.
|
|
72932
|
+
|
|
72890
72933
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
72891
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
72892
|
-
|
|
72934
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
72935
|
+
|
|
72893
72936
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
72894
72937
|
};
|
|
72895
72938
|
}
|
|
@@ -73007,15 +73050,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
73007
73050
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
73008
73051
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
73009
73052
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73010
|
-
badExample: `INTERFACE lif.
|
|
73011
|
-
METHODS load_data
|
|
73012
|
-
EXCEPTIONS
|
|
73013
|
-
invalid_parameter.
|
|
73053
|
+
badExample: `INTERFACE lif.
|
|
73054
|
+
METHODS load_data
|
|
73055
|
+
EXCEPTIONS
|
|
73056
|
+
invalid_parameter.
|
|
73014
73057
|
ENDINTERFACE.`,
|
|
73015
|
-
goodExample: `INTERFACE lif.
|
|
73016
|
-
METHODS load_data
|
|
73017
|
-
RAISING
|
|
73018
|
-
cx_something.
|
|
73058
|
+
goodExample: `INTERFACE lif.
|
|
73059
|
+
METHODS load_data
|
|
73060
|
+
RAISING
|
|
73061
|
+
cx_something.
|
|
73019
73062
|
ENDINTERFACE.`,
|
|
73020
73063
|
};
|
|
73021
73064
|
}
|
|
@@ -73075,15 +73118,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
73075
73118
|
key: "use_line_exists",
|
|
73076
73119
|
title: "Use line_exists",
|
|
73077
73120
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73078
|
-
extendedInformation: `
|
|
73079
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73080
|
-
|
|
73121
|
+
extendedInformation: `
|
|
73122
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73123
|
+
|
|
73081
73124
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73082
73125
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73083
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73084
|
-
IF sy-subrc = 0.
|
|
73126
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73127
|
+
IF sy-subrc = 0.
|
|
73085
73128
|
ENDIF.`,
|
|
73086
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73129
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73087
73130
|
ENDIF.`,
|
|
73088
73131
|
};
|
|
73089
73132
|
}
|
|
@@ -73193,10 +73236,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73193
73236
|
key: "use_new",
|
|
73194
73237
|
title: "Use NEW",
|
|
73195
73238
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73196
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73197
|
-
|
|
73198
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73199
|
-
|
|
73239
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73240
|
+
|
|
73241
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73242
|
+
|
|
73200
73243
|
Applicable from v740sp02 and up`,
|
|
73201
73244
|
badExample: `CREATE OBJECT ref.`,
|
|
73202
73245
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73294,13 +73337,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73294
73337
|
title: "WHEN OTHERS last",
|
|
73295
73338
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73296
73339
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73297
|
-
badExample: `CASE bar.
|
|
73298
|
-
WHEN OTHERS.
|
|
73299
|
-
WHEN 2.
|
|
73340
|
+
badExample: `CASE bar.
|
|
73341
|
+
WHEN OTHERS.
|
|
73342
|
+
WHEN 2.
|
|
73300
73343
|
ENDCASE.`,
|
|
73301
|
-
goodExample: `CASE bar.
|
|
73302
|
-
WHEN 2.
|
|
73303
|
-
WHEN OTHERS.
|
|
73344
|
+
goodExample: `CASE bar.
|
|
73345
|
+
WHEN 2.
|
|
73346
|
+
WHEN OTHERS.
|
|
73304
73347
|
ENDCASE.`,
|
|
73305
73348
|
};
|
|
73306
73349
|
}
|