@abaplint/cli 2.108.6 → 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 +873 -803
- 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) + ", " +
|
|
@@ -45902,15 +45912,42 @@ class EnhancementImplementation extends _abstract_object_1.AbstractObject {
|
|
|
45902
45912
|
getType() {
|
|
45903
45913
|
return "ENHO";
|
|
45904
45914
|
}
|
|
45915
|
+
setDirty() {
|
|
45916
|
+
this.parsedXML = undefined;
|
|
45917
|
+
super.setDirty();
|
|
45918
|
+
}
|
|
45905
45919
|
getAllowedNaming() {
|
|
45906
45920
|
return {
|
|
45907
45921
|
maxLength: 30,
|
|
45908
45922
|
allowNamespace: true,
|
|
45909
45923
|
};
|
|
45910
45924
|
}
|
|
45925
|
+
getClassName() {
|
|
45926
|
+
var _a;
|
|
45927
|
+
this.parse();
|
|
45928
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.className;
|
|
45929
|
+
}
|
|
45911
45930
|
getDescription() {
|
|
45912
|
-
|
|
45913
|
-
|
|
45931
|
+
var _a;
|
|
45932
|
+
this.parse();
|
|
45933
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
|
|
45934
|
+
}
|
|
45935
|
+
parse() {
|
|
45936
|
+
if (this.parsedXML) {
|
|
45937
|
+
return { updated: false, runtime: 0 };
|
|
45938
|
+
}
|
|
45939
|
+
const start = Date.now();
|
|
45940
|
+
this.parsedXML = {};
|
|
45941
|
+
const parsed = super.parseRaw2();
|
|
45942
|
+
if (parsed === undefined
|
|
45943
|
+
|| parsed.abapGit === undefined
|
|
45944
|
+
|| parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
|
|
45945
|
+
return { updated: false, runtime: 0 };
|
|
45946
|
+
}
|
|
45947
|
+
this.parsedXML.className = parsed.abapGit["asx:abap"]["asx:values"].CLASS;
|
|
45948
|
+
this.parsedXML.description = parsed.abapGit["asx:abap"]["asx:values"].SHORTTEXT;
|
|
45949
|
+
const end = Date.now();
|
|
45950
|
+
return { updated: true, runtime: end - start };
|
|
45914
45951
|
}
|
|
45915
45952
|
}
|
|
45916
45953
|
exports.EnhancementImplementation = EnhancementImplementation;
|
|
@@ -46050,6 +46087,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
46050
46087
|
exports.ExtensionIndex = void 0;
|
|
46051
46088
|
const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
|
|
46052
46089
|
class ExtensionIndex extends _abstract_object_1.AbstractObject {
|
|
46090
|
+
constructor() {
|
|
46091
|
+
super(...arguments);
|
|
46092
|
+
this.parsedXML = undefined;
|
|
46093
|
+
}
|
|
46053
46094
|
getType() {
|
|
46054
46095
|
return "XINX";
|
|
46055
46096
|
}
|
|
@@ -46059,9 +46100,38 @@ class ExtensionIndex extends _abstract_object_1.AbstractObject {
|
|
|
46059
46100
|
allowNamespace: true,
|
|
46060
46101
|
};
|
|
46061
46102
|
}
|
|
46103
|
+
setDirty() {
|
|
46104
|
+
this.parsedXML = undefined;
|
|
46105
|
+
super.setDirty();
|
|
46106
|
+
}
|
|
46062
46107
|
getDescription() {
|
|
46063
|
-
|
|
46064
|
-
|
|
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 };
|
|
46065
46135
|
}
|
|
46066
46136
|
}
|
|
46067
46137
|
exports.ExtensionIndex = ExtensionIndex;
|
|
@@ -51522,7 +51592,7 @@ class Registry {
|
|
|
51522
51592
|
}
|
|
51523
51593
|
static abaplintVersion() {
|
|
51524
51594
|
// magic, see build script "version.sh"
|
|
51525
|
-
return "2.108.
|
|
51595
|
+
return "2.108.8";
|
|
51526
51596
|
}
|
|
51527
51597
|
getDDICReferences() {
|
|
51528
51598
|
return this.ddicReferences;
|
|
@@ -51838,10 +51908,10 @@ class SevenBitAscii {
|
|
|
51838
51908
|
key: "7bit_ascii",
|
|
51839
51909
|
title: "Check for 7bit ascii",
|
|
51840
51910
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
51841
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51842
|
-
|
|
51843
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51844
|
-
|
|
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
|
+
|
|
51845
51915
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
51846
51916
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
51847
51917
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52047,10 +52117,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52047
52117
|
key: "abapdoc",
|
|
52048
52118
|
title: "Check abapdoc",
|
|
52049
52119
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52050
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52051
|
-
|
|
52052
|
-
Plus class and interface definitions.
|
|
52053
|
-
|
|
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
|
+
|
|
52054
52124
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52055
52125
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52056
52126
|
};
|
|
@@ -52188,49 +52258,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52188
52258
|
key: "align_parameters",
|
|
52189
52259
|
title: "Align Parameters",
|
|
52190
52260
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52191
|
-
extendedInformation: `Checks:
|
|
52192
|
-
* function module calls
|
|
52193
|
-
* method calls
|
|
52194
|
-
* VALUE constructors
|
|
52195
|
-
* NEW constructors
|
|
52196
|
-
* RAISE EXCEPTION statements
|
|
52197
|
-
* CREATE OBJECT statements
|
|
52198
|
-
* RAISE EVENT statements
|
|
52199
|
-
|
|
52200
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52201
|
-
|
|
52202
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52203
|
-
|
|
52204
|
-
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
|
|
52205
52275
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52206
52276
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52207
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52208
|
-
EXPORTING
|
|
52209
|
-
foo = 2
|
|
52210
|
-
parameter = 3.
|
|
52211
|
-
|
|
52212
|
-
foobar( moo = 1
|
|
52213
|
-
param = 1 ).
|
|
52214
|
-
|
|
52215
|
-
foo = VALUE #(
|
|
52216
|
-
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
|
|
52217
52287
|
moo = 2 ).`,
|
|
52218
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52219
|
-
EXPORTING
|
|
52220
|
-
foo = 2
|
|
52221
|
-
parameter = 3.
|
|
52222
|
-
|
|
52223
|
-
foobar( moo = 1
|
|
52224
|
-
param = 1 ).
|
|
52225
|
-
|
|
52226
|
-
foo = VALUE #(
|
|
52227
|
-
foo = bar
|
|
52228
|
-
moo = 2 ).
|
|
52229
|
-
|
|
52230
|
-
DATA(sdf) = VALUE type(
|
|
52231
|
-
common_val = 2
|
|
52232
|
-
another_common = 5
|
|
52233
|
-
( 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
|
|
52234
52304
|
value_foo = 5 ) ).`,
|
|
52235
52305
|
};
|
|
52236
52306
|
}
|
|
@@ -52664,37 +52734,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52664
52734
|
key: "align_type_expressions",
|
|
52665
52735
|
title: "Align TYPE expressions",
|
|
52666
52736
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52667
|
-
extendedInformation: `
|
|
52668
|
-
Currently works for METHODS + BEGIN OF
|
|
52669
|
-
|
|
52670
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52671
|
-
|
|
52672
|
-
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:
|
|
52673
52743
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52674
52744
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52675
|
-
badExample: `
|
|
52676
|
-
TYPES: BEGIN OF foo,
|
|
52677
|
-
bar TYPE i,
|
|
52678
|
-
foobar TYPE i,
|
|
52679
|
-
END OF foo.
|
|
52680
|
-
|
|
52681
|
-
INTERFACE lif.
|
|
52682
|
-
METHODS bar
|
|
52683
|
-
IMPORTING
|
|
52684
|
-
foo TYPE i
|
|
52685
|
-
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.
|
|
52686
52756
|
ENDINTERFACE.`,
|
|
52687
|
-
goodExample: `
|
|
52688
|
-
TYPES: BEGIN OF foo,
|
|
52689
|
-
bar TYPE i,
|
|
52690
|
-
foobar TYPE i,
|
|
52691
|
-
END OF foo.
|
|
52692
|
-
|
|
52693
|
-
INTERFACE lif.
|
|
52694
|
-
METHODS bar
|
|
52695
|
-
IMPORTING
|
|
52696
|
-
foo TYPE i
|
|
52697
|
-
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.
|
|
52698
52768
|
ENDINTERFACE.`,
|
|
52699
52769
|
};
|
|
52700
52770
|
}
|
|
@@ -52973,15 +53043,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
52973
53043
|
return {
|
|
52974
53044
|
key: "ambiguous_statement",
|
|
52975
53045
|
title: "Check for ambigious statements",
|
|
52976
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52977
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52978
|
-
|
|
53046
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
53047
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
53048
|
+
|
|
52979
53049
|
Only works if the target version is 740sp05 or above`,
|
|
52980
53050
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52981
|
-
badExample: `DELETE foo FROM bar.
|
|
53051
|
+
badExample: `DELETE foo FROM bar.
|
|
52982
53052
|
MODIFY foo FROM bar.`,
|
|
52983
|
-
goodExample: `DELETE foo FROM @bar.
|
|
52984
|
-
MODIFY TABLE foo FROM bar.
|
|
53053
|
+
goodExample: `DELETE foo FROM @bar.
|
|
53054
|
+
MODIFY TABLE foo FROM bar.
|
|
52985
53055
|
MODIFY zfoo FROM @wa.`,
|
|
52986
53056
|
};
|
|
52987
53057
|
}
|
|
@@ -53086,16 +53156,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53086
53156
|
key: "avoid_use",
|
|
53087
53157
|
title: "Avoid use of certain statements",
|
|
53088
53158
|
shortDescription: `Detects usage of certain statements.`,
|
|
53089
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53090
|
-
|
|
53091
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53092
|
-
|
|
53093
|
-
STATICS: use CLASS-DATA instead
|
|
53094
|
-
|
|
53095
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53096
|
-
|
|
53097
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53098
|
-
|
|
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
|
+
|
|
53099
53169
|
BREAK points`,
|
|
53100
53170
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53101
53171
|
};
|
|
@@ -53227,11 +53297,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53227
53297
|
title: "Check BEGIN END names",
|
|
53228
53298
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53229
53299
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53230
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53231
|
-
field TYPE i,
|
|
53300
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53301
|
+
field TYPE i,
|
|
53232
53302
|
END OF structure_not_the_same.`,
|
|
53233
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53234
|
-
field TYPE i,
|
|
53303
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53304
|
+
field TYPE i,
|
|
53235
53305
|
END OF stru.`,
|
|
53236
53306
|
};
|
|
53237
53307
|
}
|
|
@@ -53328,20 +53398,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53328
53398
|
title: "BEGIN contains single INCLUDE",
|
|
53329
53399
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53330
53400
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53331
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53332
|
-
INCLUDE TYPE dselc.
|
|
53333
|
-
TYPES: END OF dummy1.
|
|
53334
|
-
|
|
53335
|
-
DATA BEGIN OF foo.
|
|
53336
|
-
INCLUDE STRUCTURE syst.
|
|
53337
|
-
DATA END OF foo.
|
|
53338
|
-
|
|
53339
|
-
STATICS BEGIN OF bar.
|
|
53340
|
-
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.
|
|
53341
53411
|
STATICS END OF bar.`,
|
|
53342
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53343
|
-
DATA field TYPE i.
|
|
53344
|
-
INCLUDE STRUCTURE dselc.
|
|
53412
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53413
|
+
DATA field TYPE i.
|
|
53414
|
+
INCLUDE STRUCTURE dselc.
|
|
53345
53415
|
DATA END OF foo.`,
|
|
53346
53416
|
};
|
|
53347
53417
|
}
|
|
@@ -53431,9 +53501,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53431
53501
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53432
53502
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53433
53503
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53434
|
-
goodExample: `TRY.
|
|
53435
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53436
|
-
CATCH cx_sy_authorization_error.
|
|
53504
|
+
goodExample: `TRY.
|
|
53505
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53506
|
+
CATCH cx_sy_authorization_error.
|
|
53437
53507
|
ENDTRY.`,
|
|
53438
53508
|
};
|
|
53439
53509
|
}
|
|
@@ -53498,10 +53568,10 @@ class CDSCommentStyle {
|
|
|
53498
53568
|
key: "cds_comment_style",
|
|
53499
53569
|
title: "CDS Comment Style",
|
|
53500
53570
|
shortDescription: `Check for obsolete comment style`,
|
|
53501
|
-
extendedInformation: `Check for obsolete comment style
|
|
53502
|
-
|
|
53503
|
-
Comments starting with "--" are considered obsolete
|
|
53504
|
-
|
|
53571
|
+
extendedInformation: `Check for obsolete comment style
|
|
53572
|
+
|
|
53573
|
+
Comments starting with "--" are considered obsolete
|
|
53574
|
+
|
|
53505
53575
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53506
53576
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53507
53577
|
badExample: "-- this is a comment",
|
|
@@ -53568,10 +53638,10 @@ class CDSLegacyView {
|
|
|
53568
53638
|
title: "CDS Legacy View",
|
|
53569
53639
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53570
53640
|
// eslint-disable-next-line max-len
|
|
53571
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53572
|
-
|
|
53573
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53574
|
-
|
|
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
|
+
|
|
53575
53645
|
v755 and up`,
|
|
53576
53646
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53577
53647
|
};
|
|
@@ -53726,10 +53796,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53726
53796
|
key: "chain_mainly_declarations",
|
|
53727
53797
|
title: "Chain mainly declarations",
|
|
53728
53798
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53729
|
-
extendedInformation: `
|
|
53730
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53731
|
-
|
|
53732
|
-
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
|
|
53733
53803
|
`,
|
|
53734
53804
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53735
53805
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -53905,17 +53975,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
53905
53975
|
title: "Change IF to CASE",
|
|
53906
53976
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
53907
53977
|
// eslint-disable-next-line max-len
|
|
53908
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53909
|
-
|
|
53978
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53979
|
+
|
|
53910
53980
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
53911
53981
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53912
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53913
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53914
|
-
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'.
|
|
53915
53985
|
ENDIF.`,
|
|
53916
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
53917
|
-
WHEN 'FOO'.
|
|
53918
|
-
WHEN 'BAR' OR 'MOO'.
|
|
53986
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
53987
|
+
WHEN 'FOO'.
|
|
53988
|
+
WHEN 'BAR' OR 'MOO'.
|
|
53919
53989
|
ENDCASE.`,
|
|
53920
53990
|
};
|
|
53921
53991
|
}
|
|
@@ -54052,8 +54122,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54052
54122
|
return {
|
|
54053
54123
|
key: "check_abstract",
|
|
54054
54124
|
title: "Check abstract methods and classes",
|
|
54055
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54056
|
-
- class defined as abstract and final,
|
|
54125
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54126
|
+
- class defined as abstract and final,
|
|
54057
54127
|
- non-abstract class contains abstract methods`,
|
|
54058
54128
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54059
54129
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54134,11 +54204,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54134
54204
|
return {
|
|
54135
54205
|
key: "check_comments",
|
|
54136
54206
|
title: "Check Comments",
|
|
54137
|
-
shortDescription: `
|
|
54207
|
+
shortDescription: `
|
|
54138
54208
|
Various checks for comment usage.`,
|
|
54139
|
-
extendedInformation: `
|
|
54140
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54141
|
-
|
|
54209
|
+
extendedInformation: `
|
|
54210
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54211
|
+
|
|
54142
54212
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54143
54213
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54144
54214
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54300,9 +54370,9 @@ class CheckInclude {
|
|
|
54300
54370
|
key: "check_include",
|
|
54301
54371
|
title: "Check INCLUDEs",
|
|
54302
54372
|
shortDescription: `Checks INCLUDE statements`,
|
|
54303
|
-
extendedInformation: `
|
|
54304
|
-
* Reports unused includes
|
|
54305
|
-
* Errors if the includes are not found
|
|
54373
|
+
extendedInformation: `
|
|
54374
|
+
* Reports unused includes
|
|
54375
|
+
* Errors if the includes are not found
|
|
54306
54376
|
* Error if including a main program`,
|
|
54307
54377
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54308
54378
|
};
|
|
@@ -54378,14 +54448,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54378
54448
|
key: "check_subrc",
|
|
54379
54449
|
title: "Check sy-subrc",
|
|
54380
54450
|
shortDescription: `Check sy-subrc`,
|
|
54381
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54382
|
-
|
|
54383
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54384
|
-
|
|
54385
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54386
|
-
|
|
54387
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54388
|
-
|
|
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
|
+
|
|
54389
54459
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54390
54460
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54391
54461
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -54954,17 +55024,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
54954
55024
|
shortDescription: `Find overlapping classic exceptions`,
|
|
54955
55025
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
54956
55026
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54957
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54958
|
-
EXCEPTIONS
|
|
54959
|
-
system_failure = 1 MESSAGE lv_message
|
|
54960
|
-
communication_failure = 1 MESSAGE lv_message
|
|
54961
|
-
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
|
|
54962
55032
|
OTHERS = 1.`,
|
|
54963
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54964
|
-
EXCEPTIONS
|
|
54965
|
-
system_failure = 1 MESSAGE lv_message
|
|
54966
|
-
communication_failure = 2 MESSAGE lv_message
|
|
54967
|
-
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
|
|
54968
55038
|
OTHERS = 4.`,
|
|
54969
55039
|
};
|
|
54970
55040
|
}
|
|
@@ -55210,7 +55280,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55210
55280
|
key: "commented_code",
|
|
55211
55281
|
title: "Find commented code",
|
|
55212
55282
|
shortDescription: `Detects usage of commented out code.`,
|
|
55213
|
-
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
|
|
55214
55284
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55215
55285
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55216
55286
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55443,10 +55513,10 @@ class ConstructorVisibilityPublic {
|
|
|
55443
55513
|
key: "constructor_visibility_public",
|
|
55444
55514
|
title: "Check constructor visibility is public",
|
|
55445
55515
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55446
|
-
extendedInformation: `
|
|
55447
|
-
This only applies to global classes.
|
|
55448
|
-
|
|
55449
|
-
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
|
|
55450
55520
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55451
55521
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55452
55522
|
};
|
|
@@ -55521,8 +55591,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55521
55591
|
key: "contains_tab",
|
|
55522
55592
|
title: "Code contains tab",
|
|
55523
55593
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55524
|
-
extendedInformation: `
|
|
55525
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55594
|
+
extendedInformation: `
|
|
55595
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55526
55596
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55527
55597
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55528
55598
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55609,10 +55679,10 @@ class CyclicOO {
|
|
|
55609
55679
|
key: "cyclic_oo",
|
|
55610
55680
|
title: "Cyclic OO",
|
|
55611
55681
|
shortDescription: `Finds cyclic OO references`,
|
|
55612
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55613
|
-
|
|
55614
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55615
|
-
|
|
55682
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55683
|
+
|
|
55684
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55685
|
+
|
|
55616
55686
|
References in testclass includes are ignored`,
|
|
55617
55687
|
};
|
|
55618
55688
|
}
|
|
@@ -55854,7 +55924,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55854
55924
|
key: "dangerous_statement",
|
|
55855
55925
|
title: "Dangerous statement",
|
|
55856
55926
|
shortDescription: `Detects potentially dangerous statements`,
|
|
55857
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55927
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55858
55928
|
dynamic SQL can potentially create SQL injection problems`,
|
|
55859
55929
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55860
55930
|
};
|
|
@@ -56058,13 +56128,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56058
56128
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56059
56129
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56060
56130
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56061
|
-
badExample: `FROM foo.
|
|
56062
|
-
WRITE 'hello'.
|
|
56063
|
-
DATA int TYPE i.
|
|
56131
|
+
badExample: `FROM foo.
|
|
56132
|
+
WRITE 'hello'.
|
|
56133
|
+
DATA int TYPE i.
|
|
56064
56134
|
ENDFORM.`,
|
|
56065
|
-
goodExample: `FROM foo.
|
|
56066
|
-
DATA int TYPE i.
|
|
56067
|
-
WRITE 'hello'.
|
|
56135
|
+
goodExample: `FROM foo.
|
|
56136
|
+
DATA int TYPE i.
|
|
56137
|
+
WRITE 'hello'.
|
|
56068
56138
|
ENDFORM.`,
|
|
56069
56139
|
};
|
|
56070
56140
|
}
|
|
@@ -56600,39 +56670,39 @@ class Downport {
|
|
|
56600
56670
|
key: "downport",
|
|
56601
56671
|
title: "Downport statement",
|
|
56602
56672
|
shortDescription: `Downport functionality`,
|
|
56603
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56604
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56605
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56606
|
-
|
|
56607
|
-
Current rules:
|
|
56608
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56609
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56610
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56611
|
-
* CONV is outlined
|
|
56612
|
-
* COND is outlined
|
|
56613
|
-
* REDUCE is outlined
|
|
56614
|
-
* SWITCH is outlined
|
|
56615
|
-
* FILTER is outlined
|
|
56616
|
-
* APPEND expression is outlined
|
|
56617
|
-
* INSERT expression is outlined
|
|
56618
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56619
|
-
* CAST changed to ?=
|
|
56620
|
-
* LOOP AT method_call( ) is outlined
|
|
56621
|
-
* VALUE # with structure fields
|
|
56622
|
-
* VALUE # with internal table lines
|
|
56623
|
-
* Table Expressions are outlined
|
|
56624
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56625
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56626
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56627
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56628
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56629
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56630
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56631
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56632
|
-
* MESSAGE with non simple source
|
|
56633
|
-
|
|
56634
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56635
|
-
|
|
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
|
+
|
|
56636
56706
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56637
56707
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56638
56708
|
};
|
|
@@ -57210,10 +57280,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57210
57280
|
const fieldName = f.concatTokens();
|
|
57211
57281
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57212
57282
|
}
|
|
57213
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57283
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57214
57284
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57215
57285
|
}
|
|
57216
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57286
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57217
57287
|
${indentation}`);
|
|
57218
57288
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57219
57289
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57257,12 +57327,12 @@ ${indentation}`);
|
|
|
57257
57327
|
}
|
|
57258
57328
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57259
57329
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
57260
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57261
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57262
|
-
${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.
|
|
57263
57333
|
${indentation}`);
|
|
57264
57334
|
if (fieldDefinitions === "") {
|
|
57265
|
-
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.
|
|
57266
57336
|
${indentation}`);
|
|
57267
57337
|
}
|
|
57268
57338
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57330,7 +57400,7 @@ ${indentation}`);
|
|
|
57330
57400
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57331
57401
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57332
57402
|
const firstToken = high.getFirstToken();
|
|
57333
|
-
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()}.
|
|
57334
57404
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57335
57405
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57336
57406
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57384,7 +57454,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57384
57454
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57385
57455
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57386
57456
|
const firstToken = high.getFirstToken();
|
|
57387
|
-
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()}.
|
|
57388
57458
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57389
57459
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57390
57460
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57426,14 +57496,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57426
57496
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57427
57497
|
const firstToken = high.getFirstToken();
|
|
57428
57498
|
// note that the tabix restore should be done before throwing the exception
|
|
57429
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57430
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57431
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57432
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57433
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57434
|
-
${indentation}IF sy-subrc <> 0.
|
|
57435
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57436
|
-
${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.
|
|
57437
57507
|
${indentation}`);
|
|
57438
57508
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57439
57509
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57490,7 +57560,7 @@ ${indentation}`);
|
|
|
57490
57560
|
const className = classNames[0].concatTokens();
|
|
57491
57561
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57492
57562
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57493
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57563
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57494
57564
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57495
57565
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57496
57566
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57652,16 +57722,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57652
57722
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57653
57723
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57654
57724
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57655
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57656
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57725
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57726
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57657
57727
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57658
57728
|
if (withs.length > 0) {
|
|
57659
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57660
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57661
|
-
${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'.
|
|
57662
57732
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57663
57733
|
}
|
|
57664
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57734
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57665
57735
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57666
57736
|
if (withs.length > 0) {
|
|
57667
57737
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -57773,10 +57843,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
57773
57843
|
let code = "";
|
|
57774
57844
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
57775
57845
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57776
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57777
|
-
IF sy-subrc <> 0.
|
|
57778
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57779
|
-
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.
|
|
57780
57850
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
57781
57851
|
}
|
|
57782
57852
|
else {
|
|
@@ -57865,20 +57935,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
57865
57935
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57866
57936
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57867
57937
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57868
|
-
code += ` items LIKE ${loopSourceName},
|
|
57869
|
-
END OF ${groupTargetName}type.
|
|
57870
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57871
|
-
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.
|
|
57872
57942
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
57873
57943
|
if (groupIndexName !== undefined) {
|
|
57874
57944
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
57875
57945
|
}
|
|
57876
|
-
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}.
|
|
57877
57947
|
IF sy-subrc = 0.\n`;
|
|
57878
57948
|
if (groupCountName !== undefined) {
|
|
57879
57949
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
57880
57950
|
}
|
|
57881
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57951
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57882
57952
|
ELSE.\n`;
|
|
57883
57953
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
57884
57954
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -57899,8 +57969,8 @@ ELSE.\n`;
|
|
|
57899
57969
|
}
|
|
57900
57970
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
57901
57971
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
57902
|
-
code += `ENDIF.
|
|
57903
|
-
ENDLOOP.
|
|
57972
|
+
code += `ENDIF.
|
|
57973
|
+
ENDLOOP.
|
|
57904
57974
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
57905
57975
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
57906
57976
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58072,7 +58142,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58072
58142
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58073
58143
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58074
58144
|
// all ENUMS are char like?
|
|
58075
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58145
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58076
58146
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58077
58147
|
let count = 1;
|
|
58078
58148
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58116,14 +58186,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58116
58186
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58117
58187
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58118
58188
|
// restore tabix before exeption
|
|
58119
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58120
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58121
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58122
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58123
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58124
|
-
${indentation}IF sy-subrc <> 0.
|
|
58125
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58126
|
-
${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.
|
|
58127
58197
|
${indentation}${uniqueName}`;
|
|
58128
58198
|
const start = target.getFirstToken().getStart();
|
|
58129
58199
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58207,11 +58277,11 @@ ${indentation}${uniqueName}`;
|
|
|
58207
58277
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58208
58278
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58209
58279
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58210
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58211
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58212
|
-
${indentation} EXPORTING
|
|
58213
|
-
${indentation} input = ${source}
|
|
58214
|
-
${indentation} IMPORTING
|
|
58280
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58281
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58282
|
+
${indentation} EXPORTING
|
|
58283
|
+
${indentation} input = ${source}
|
|
58284
|
+
${indentation} IMPORTING
|
|
58215
58285
|
${indentation} output = ${uniqueName}.\n`;
|
|
58216
58286
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58217
58287
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59523,12 +59593,12 @@ class EasyToFindMessages {
|
|
|
59523
59593
|
key: "easy_to_find_messages",
|
|
59524
59594
|
title: "Easy to find messages",
|
|
59525
59595
|
shortDescription: `Make messages easy to find`,
|
|
59526
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59527
|
-
|
|
59528
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59529
|
-
|
|
59530
|
-
Also see rule "message_exists"
|
|
59531
|
-
|
|
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
|
+
|
|
59532
59602
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59533
59603
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59534
59604
|
};
|
|
@@ -59613,8 +59683,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59613
59683
|
key: "empty_line_in_statement",
|
|
59614
59684
|
title: "Find empty lines in statements",
|
|
59615
59685
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59616
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59617
|
-
|
|
59686
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59687
|
+
|
|
59618
59688
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59619
59689
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59620
59690
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -59790,13 +59860,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
59790
59860
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
59791
59861
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
59792
59862
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
59793
|
-
badExample: `IF foo = bar.
|
|
59794
|
-
ENDIF.
|
|
59795
|
-
|
|
59796
|
-
DO 2 TIMES.
|
|
59863
|
+
badExample: `IF foo = bar.
|
|
59864
|
+
ENDIF.
|
|
59865
|
+
|
|
59866
|
+
DO 2 TIMES.
|
|
59797
59867
|
ENDDO.`,
|
|
59798
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
59799
|
-
ENDLOOP.
|
|
59868
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
59869
|
+
ENDLOOP.
|
|
59800
59870
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
59801
59871
|
};
|
|
59802
59872
|
}
|
|
@@ -59938,10 +60008,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
59938
60008
|
return {
|
|
59939
60009
|
key: "exit_or_check",
|
|
59940
60010
|
title: "Find EXIT or CHECK outside loops",
|
|
59941
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
60011
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59942
60012
|
Use RETURN to leave procesing blocks instead.`,
|
|
59943
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59944
|
-
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
|
|
59945
60015
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
59946
60016
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59947
60017
|
};
|
|
@@ -60024,12 +60094,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
60024
60094
|
key: "expand_macros",
|
|
60025
60095
|
title: "Expand Macros",
|
|
60026
60096
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
60027
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60028
|
-
|
|
60097
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60098
|
+
|
|
60029
60099
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
60030
|
-
badExample: `DEFINE _hello.
|
|
60031
|
-
WRITE 'hello'.
|
|
60032
|
-
END-OF-DEFINITION.
|
|
60100
|
+
badExample: `DEFINE _hello.
|
|
60101
|
+
WRITE 'hello'.
|
|
60102
|
+
END-OF-DEFINITION.
|
|
60033
60103
|
_hello.`,
|
|
60034
60104
|
goodExample: `WRITE 'hello'.`,
|
|
60035
60105
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60116,7 +60186,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60116
60186
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60117
60187
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60118
60188
|
goodExample: `call_method( foo = bar ).`,
|
|
60119
|
-
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
|
|
60120
60190
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60121
60191
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60122
60192
|
};
|
|
@@ -60214,7 +60284,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60214
60284
|
key: "forbidden_identifier",
|
|
60215
60285
|
title: "Forbidden Identifier",
|
|
60216
60286
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60217
|
-
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,
|
|
60218
60288
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60219
60289
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60220
60290
|
};
|
|
@@ -60456,8 +60526,8 @@ class ForbiddenVoidType {
|
|
|
60456
60526
|
key: "forbidden_void_type",
|
|
60457
60527
|
title: "Forbidden Void Types",
|
|
60458
60528
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60459
|
-
extendedInformation: `Inspiration:
|
|
60460
|
-
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,
|
|
60461
60531
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60462
60532
|
};
|
|
60463
60533
|
}
|
|
@@ -60700,7 +60770,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60700
60770
|
key: "fully_type_itabs",
|
|
60701
60771
|
title: "Fully type internal tables",
|
|
60702
60772
|
shortDescription: `No implict table types or table keys`,
|
|
60703
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60773
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60704
60774
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60705
60775
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60706
60776
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -60885,26 +60955,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
60885
60955
|
key: "functional_writing",
|
|
60886
60956
|
title: "Use functional writing",
|
|
60887
60957
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
60888
|
-
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
|
|
60889
60959
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
60890
60960
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60891
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60892
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60893
|
-
EXPORTING
|
|
60894
|
-
p_name = 'NAME'
|
|
60895
|
-
RECEIVING
|
|
60896
|
-
p_descr_ref = lr_typedescr
|
|
60897
|
-
EXCEPTIONS
|
|
60898
|
-
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
|
|
60899
60969
|
OTHERS = 2.`,
|
|
60900
|
-
goodExample: `zcl_class=>method( ).
|
|
60901
|
-
cl_abap_typedescr=>describe_by_name(
|
|
60902
|
-
EXPORTING
|
|
60903
|
-
p_name = 'NAME'
|
|
60904
|
-
RECEIVING
|
|
60905
|
-
p_descr_ref = lr_typedescr
|
|
60906
|
-
EXCEPTIONS
|
|
60907
|
-
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
|
|
60908
60978
|
OTHERS = 2 ).`,
|
|
60909
60979
|
};
|
|
60910
60980
|
}
|
|
@@ -61015,14 +61085,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
61015
61085
|
key: "global_class",
|
|
61016
61086
|
title: "Global class checks",
|
|
61017
61087
|
shortDescription: `Checks related to global classes`,
|
|
61018
|
-
extendedInformation: `* global classes must be in own files
|
|
61019
|
-
|
|
61020
|
-
* file names must match class name
|
|
61021
|
-
|
|
61022
|
-
* file names must match interface name
|
|
61023
|
-
|
|
61024
|
-
* global classes must be global definitions
|
|
61025
|
-
|
|
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
|
+
|
|
61026
61096
|
* global interfaces must be global definitions`,
|
|
61027
61097
|
tags: [_irule_1.RuleTag.Syntax],
|
|
61028
61098
|
};
|
|
@@ -61121,21 +61191,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61121
61191
|
return {
|
|
61122
61192
|
key: "identical_conditions",
|
|
61123
61193
|
title: "Identical conditions",
|
|
61124
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61125
|
-
|
|
61194
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61195
|
+
|
|
61126
61196
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61127
61197
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61128
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61129
|
-
ENDIF.
|
|
61130
|
-
CASE bar.
|
|
61131
|
-
WHEN '1'.
|
|
61132
|
-
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'.
|
|
61133
61203
|
ENDCASE.`,
|
|
61134
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61135
|
-
ENDIF.
|
|
61136
|
-
CASE bar.
|
|
61137
|
-
WHEN '1'.
|
|
61138
|
-
WHEN 'A'.
|
|
61204
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61205
|
+
ENDIF.
|
|
61206
|
+
CASE bar.
|
|
61207
|
+
WHEN '1'.
|
|
61208
|
+
WHEN 'A'.
|
|
61139
61209
|
ENDCASE.`,
|
|
61140
61210
|
};
|
|
61141
61211
|
}
|
|
@@ -61269,23 +61339,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61269
61339
|
key: "identical_contents",
|
|
61270
61340
|
title: "Identical contents",
|
|
61271
61341
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61272
|
-
extendedInformation: `
|
|
61273
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61274
|
-
|
|
61342
|
+
extendedInformation: `
|
|
61343
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61344
|
+
|
|
61275
61345
|
Chained statments are ignored`,
|
|
61276
61346
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61277
|
-
badExample: `IF foo = bar.
|
|
61278
|
-
WRITE 'bar'.
|
|
61279
|
-
WRITE 'world'.
|
|
61280
|
-
ELSE.
|
|
61281
|
-
WRITE 'foo'.
|
|
61282
|
-
WRITE 'world'.
|
|
61347
|
+
badExample: `IF foo = bar.
|
|
61348
|
+
WRITE 'bar'.
|
|
61349
|
+
WRITE 'world'.
|
|
61350
|
+
ELSE.
|
|
61351
|
+
WRITE 'foo'.
|
|
61352
|
+
WRITE 'world'.
|
|
61283
61353
|
ENDIF.`,
|
|
61284
|
-
goodExample: `IF foo = bar.
|
|
61285
|
-
WRITE 'bar'.
|
|
61286
|
-
ELSE.
|
|
61287
|
-
WRITE 'foo'.
|
|
61288
|
-
ENDIF.
|
|
61354
|
+
goodExample: `IF foo = bar.
|
|
61355
|
+
WRITE 'bar'.
|
|
61356
|
+
ELSE.
|
|
61357
|
+
WRITE 'foo'.
|
|
61358
|
+
ENDIF.
|
|
61289
61359
|
WRITE 'world'.`,
|
|
61290
61360
|
};
|
|
61291
61361
|
}
|
|
@@ -61393,12 +61463,12 @@ class IdenticalDescriptions {
|
|
|
61393
61463
|
key: "identical_descriptions",
|
|
61394
61464
|
title: "Identical descriptions",
|
|
61395
61465
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61396
|
-
extendedInformation: `Case insensitive
|
|
61397
|
-
|
|
61398
|
-
Only checks the master language descriptions
|
|
61399
|
-
|
|
61400
|
-
Dependencies are skipped
|
|
61401
|
-
|
|
61466
|
+
extendedInformation: `Case insensitive
|
|
61467
|
+
|
|
61468
|
+
Only checks the master language descriptions
|
|
61469
|
+
|
|
61470
|
+
Dependencies are skipped
|
|
61471
|
+
|
|
61402
61472
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61403
61473
|
tags: [],
|
|
61404
61474
|
};
|
|
@@ -61572,43 +61642,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61572
61642
|
key: "if_in_if",
|
|
61573
61643
|
title: "IF in IF",
|
|
61574
61644
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61575
|
-
extendedInformation: `
|
|
61576
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61577
|
-
|
|
61578
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61579
|
-
|
|
61580
|
-
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/
|
|
61581
61651
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61582
|
-
badExample: `IF condition1.
|
|
61583
|
-
IF condition2.
|
|
61584
|
-
...
|
|
61585
|
-
ENDIF.
|
|
61586
|
-
ENDIF.
|
|
61587
|
-
|
|
61588
|
-
IF condition1.
|
|
61589
|
-
...
|
|
61590
|
-
ELSE.
|
|
61591
|
-
IF condition2.
|
|
61592
|
-
...
|
|
61593
|
-
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.
|
|
61594
61664
|
ENDIF.`,
|
|
61595
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61596
|
-
...
|
|
61597
|
-
ENDIF.
|
|
61598
|
-
|
|
61599
|
-
IF condition1.
|
|
61600
|
-
...
|
|
61601
|
-
ELSEIF condition2.
|
|
61602
|
-
...
|
|
61603
|
-
ENDIF.
|
|
61604
|
-
|
|
61605
|
-
CASE variable.
|
|
61606
|
-
WHEN value1.
|
|
61607
|
-
...
|
|
61608
|
-
WHEN value2.
|
|
61609
|
-
IF condition2.
|
|
61610
|
-
...
|
|
61611
|
-
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.
|
|
61612
61682
|
ENDCASE.`,
|
|
61613
61683
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61614
61684
|
};
|
|
@@ -61793,9 +61863,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
61793
61863
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
61794
61864
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
61795
61865
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
61796
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61797
|
-
METHOD ${methodName.toLowerCase()}.
|
|
61798
|
-
RETURN. " todo, implement method
|
|
61866
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61867
|
+
METHOD ${methodName.toLowerCase()}.
|
|
61868
|
+
RETURN. " todo, implement method
|
|
61799
61869
|
ENDMETHOD.`);
|
|
61800
61870
|
}
|
|
61801
61871
|
}
|
|
@@ -61983,19 +62053,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
61983
62053
|
key: "in_statement_indentation",
|
|
61984
62054
|
title: "In-statement indentation",
|
|
61985
62055
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
61986
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61987
|
-
|
|
61988
|
-
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)
|
|
61989
62059
|
to distinguish them better from code within the block.`,
|
|
61990
|
-
badExample: `IF 1 = 1
|
|
61991
|
-
AND 2 = 2.
|
|
61992
|
-
WRITE 'hello' &&
|
|
61993
|
-
'world'.
|
|
62060
|
+
badExample: `IF 1 = 1
|
|
62061
|
+
AND 2 = 2.
|
|
62062
|
+
WRITE 'hello' &&
|
|
62063
|
+
'world'.
|
|
61994
62064
|
ENDIF.`,
|
|
61995
|
-
goodExample: `IF 1 = 1
|
|
61996
|
-
AND 2 = 2.
|
|
61997
|
-
WRITE 'hello' &&
|
|
61998
|
-
'world'.
|
|
62065
|
+
goodExample: `IF 1 = 1
|
|
62066
|
+
AND 2 = 2.
|
|
62067
|
+
WRITE 'hello' &&
|
|
62068
|
+
'world'.
|
|
61999
62069
|
ENDIF.`,
|
|
62000
62070
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62001
62071
|
};
|
|
@@ -62118,23 +62188,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62118
62188
|
title: "Indentation",
|
|
62119
62189
|
shortDescription: `Checks indentation`,
|
|
62120
62190
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62121
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62122
|
-
PRIVATE SECTION.
|
|
62123
|
-
METHODS constructor.
|
|
62124
|
-
ENDCLASS.
|
|
62125
|
-
|
|
62126
|
-
CLASS lcl IMPLEMENTATION.
|
|
62127
|
-
METHOD constructor.
|
|
62128
|
-
ENDMETHOD.
|
|
62191
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62192
|
+
PRIVATE SECTION.
|
|
62193
|
+
METHODS constructor.
|
|
62194
|
+
ENDCLASS.
|
|
62195
|
+
|
|
62196
|
+
CLASS lcl IMPLEMENTATION.
|
|
62197
|
+
METHOD constructor.
|
|
62198
|
+
ENDMETHOD.
|
|
62129
62199
|
ENDCLASS.`,
|
|
62130
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62131
|
-
PRIVATE SECTION.
|
|
62132
|
-
METHODS constructor.
|
|
62133
|
-
ENDCLASS.
|
|
62134
|
-
|
|
62135
|
-
CLASS lcl IMPLEMENTATION.
|
|
62136
|
-
METHOD constructor.
|
|
62137
|
-
ENDMETHOD.
|
|
62200
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62201
|
+
PRIVATE SECTION.
|
|
62202
|
+
METHODS constructor.
|
|
62203
|
+
ENDCLASS.
|
|
62204
|
+
|
|
62205
|
+
CLASS lcl IMPLEMENTATION.
|
|
62206
|
+
METHOD constructor.
|
|
62207
|
+
ENDMETHOD.
|
|
62138
62208
|
ENDCLASS.`,
|
|
62139
62209
|
};
|
|
62140
62210
|
}
|
|
@@ -62521,9 +62591,9 @@ class IntfReferencingClas {
|
|
|
62521
62591
|
key: "intf_referencing_clas",
|
|
62522
62592
|
title: "INTF referencing CLAS",
|
|
62523
62593
|
shortDescription: `Interface contains references to class`,
|
|
62524
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62525
|
-
Only first level references are checked.
|
|
62526
|
-
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.
|
|
62527
62597
|
Void references are ignored.`,
|
|
62528
62598
|
};
|
|
62529
62599
|
}
|
|
@@ -62608,9 +62678,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
62608
62678
|
title: "Invalid Table Index",
|
|
62609
62679
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
62610
62680
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62611
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
62681
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
62612
62682
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
62613
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
62683
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
62614
62684
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62615
62685
|
};
|
|
62616
62686
|
}
|
|
@@ -63211,8 +63281,8 @@ class LineBreakStyle {
|
|
|
63211
63281
|
return {
|
|
63212
63282
|
key: "line_break_style",
|
|
63213
63283
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63214
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63215
|
-
|
|
63284
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63285
|
+
|
|
63216
63286
|
abapGit does not work with CRLF`,
|
|
63217
63287
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63218
63288
|
};
|
|
@@ -63281,7 +63351,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63281
63351
|
key: "line_length",
|
|
63282
63352
|
title: "Line length",
|
|
63283
63353
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63284
|
-
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
|
|
63285
63355
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63286
63356
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63287
63357
|
};
|
|
@@ -63352,7 +63422,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63352
63422
|
key: "line_only_punc",
|
|
63353
63423
|
title: "Line containing only punctuation",
|
|
63354
63424
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63355
|
-
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
|
|
63356
63426
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63357
63427
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63358
63428
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -63612,15 +63682,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63612
63682
|
return {
|
|
63613
63683
|
key: "local_variable_names",
|
|
63614
63684
|
title: "Local variable naming conventions",
|
|
63615
|
-
shortDescription: `
|
|
63616
|
-
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.
|
|
63617
63687
|
Regexes are case-insensitive.`,
|
|
63618
63688
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
63619
|
-
badExample: `FORM bar.
|
|
63620
|
-
DATA foo.
|
|
63689
|
+
badExample: `FORM bar.
|
|
63690
|
+
DATA foo.
|
|
63621
63691
|
ENDFORM.`,
|
|
63622
|
-
goodExample: `FORM bar.
|
|
63623
|
-
DATA lv_foo.
|
|
63692
|
+
goodExample: `FORM bar.
|
|
63693
|
+
DATA lv_foo.
|
|
63624
63694
|
ENDFORM.`,
|
|
63625
63695
|
};
|
|
63626
63696
|
}
|
|
@@ -63766,10 +63836,10 @@ class MainFileContents {
|
|
|
63766
63836
|
key: "main_file_contents",
|
|
63767
63837
|
title: "Main file contents",
|
|
63768
63838
|
shortDescription: `Checks related to report declarations.`,
|
|
63769
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
63770
|
-
|
|
63771
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63772
|
-
* 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>."
|
|
63773
63843
|
`,
|
|
63774
63844
|
};
|
|
63775
63845
|
}
|
|
@@ -63885,17 +63955,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
63885
63955
|
title: "Too many parentheses",
|
|
63886
63956
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
63887
63957
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63888
|
-
badExample: `
|
|
63889
|
-
IF ( destination IS INITIAL ).
|
|
63890
|
-
ENDIF.
|
|
63891
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63892
|
-
ENDIF.
|
|
63958
|
+
badExample: `
|
|
63959
|
+
IF ( destination IS INITIAL ).
|
|
63960
|
+
ENDIF.
|
|
63961
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63962
|
+
ENDIF.
|
|
63893
63963
|
`,
|
|
63894
|
-
goodExample: `
|
|
63895
|
-
IF destination IS INITIAL.
|
|
63896
|
-
ENDIF.
|
|
63897
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
63898
|
-
ENDIF.
|
|
63964
|
+
goodExample: `
|
|
63965
|
+
IF destination IS INITIAL.
|
|
63966
|
+
ENDIF.
|
|
63967
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
63968
|
+
ENDIF.
|
|
63899
63969
|
`,
|
|
63900
63970
|
};
|
|
63901
63971
|
}
|
|
@@ -64069,14 +64139,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64069
64139
|
title: "Max one method parameter definition per line",
|
|
64070
64140
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64071
64141
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64072
|
-
badExample: `
|
|
64073
|
-
METHODS apps_scope_token
|
|
64074
|
-
IMPORTING
|
|
64142
|
+
badExample: `
|
|
64143
|
+
METHODS apps_scope_token
|
|
64144
|
+
IMPORTING
|
|
64075
64145
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64076
|
-
goodExample: `
|
|
64077
|
-
METHODS apps_scope_token
|
|
64078
|
-
IMPORTING
|
|
64079
|
-
body TYPE bodyapps_scope_token
|
|
64146
|
+
goodExample: `
|
|
64147
|
+
METHODS apps_scope_token
|
|
64148
|
+
IMPORTING
|
|
64149
|
+
body TYPE bodyapps_scope_token
|
|
64080
64150
|
client_id TYPE str.`,
|
|
64081
64151
|
};
|
|
64082
64152
|
}
|
|
@@ -64141,11 +64211,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64141
64211
|
key: "max_one_statement",
|
|
64142
64212
|
title: "Max one statement per line",
|
|
64143
64213
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64144
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64145
|
-
|
|
64146
|
-
Does not report anything for chained statements.
|
|
64147
|
-
|
|
64148
|
-
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
|
|
64149
64219
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64150
64220
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64151
64221
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -64483,8 +64553,8 @@ class MethodLength {
|
|
|
64483
64553
|
key: "method_length",
|
|
64484
64554
|
title: "Method/Form Length",
|
|
64485
64555
|
shortDescription: `Checks relating to method/form length.`,
|
|
64486
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64487
|
-
|
|
64556
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64557
|
+
|
|
64488
64558
|
Abstract methods without statements are considered okay.`,
|
|
64489
64559
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64490
64560
|
};
|
|
@@ -64589,20 +64659,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
64589
64659
|
key: "method_overwrites_builtin",
|
|
64590
64660
|
title: "Method name overwrites builtin function",
|
|
64591
64661
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
64592
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64593
|
-
|
|
64594
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64595
|
-
|
|
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
|
+
|
|
64596
64666
|
Interface method names are ignored`,
|
|
64597
64667
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64598
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64599
|
-
PUBLIC SECTION.
|
|
64600
|
-
METHODS matches.
|
|
64601
|
-
ENDCLASS.
|
|
64602
|
-
|
|
64603
|
-
CLASS lcl IMPLEMENTATION.
|
|
64604
|
-
METHOD matches.
|
|
64605
|
-
ENDMETHOD.
|
|
64668
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64669
|
+
PUBLIC SECTION.
|
|
64670
|
+
METHODS matches.
|
|
64671
|
+
ENDCLASS.
|
|
64672
|
+
|
|
64673
|
+
CLASS lcl IMPLEMENTATION.
|
|
64674
|
+
METHOD matches.
|
|
64675
|
+
ENDMETHOD.
|
|
64606
64676
|
ENDCLASS.`,
|
|
64607
64677
|
};
|
|
64608
64678
|
}
|
|
@@ -64793,12 +64863,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
64793
64863
|
// eslint-disable-next-line max-len
|
|
64794
64864
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
64795
64865
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64796
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64797
|
-
PUBLIC SECTION.
|
|
64798
|
-
METHODS
|
|
64799
|
-
foobar
|
|
64800
|
-
EXPORTING foo TYPE i
|
|
64801
|
-
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.
|
|
64802
64872
|
ENDCLASS.`,
|
|
64803
64873
|
};
|
|
64804
64874
|
}
|
|
@@ -65178,7 +65248,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65178
65248
|
key: "nesting",
|
|
65179
65249
|
title: "Check nesting depth",
|
|
65180
65250
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65181
|
-
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
|
|
65182
65252
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65183
65253
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65184
65254
|
};
|
|
@@ -65421,7 +65491,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65421
65491
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65422
65492
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65423
65493
|
badExample: `var1 = var2 = var3.`,
|
|
65424
|
-
goodExample: `var2 = var3.
|
|
65494
|
+
goodExample: `var2 = var3.
|
|
65425
65495
|
var1 = var2.`,
|
|
65426
65496
|
};
|
|
65427
65497
|
}
|
|
@@ -65480,8 +65550,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
65480
65550
|
key: "no_external_form_calls",
|
|
65481
65551
|
title: "No external FORM calls",
|
|
65482
65552
|
shortDescription: `Detect external form calls`,
|
|
65483
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65484
|
-
|
|
65553
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65554
|
+
|
|
65485
65555
|
PERFORM foo(bar).`,
|
|
65486
65556
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65487
65557
|
};
|
|
@@ -65542,17 +65612,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
65542
65612
|
key: "no_inline_in_optional_branches",
|
|
65543
65613
|
title: "Don't declare inline in optional branches",
|
|
65544
65614
|
shortDescription: `Don't declare inline in optional branches`,
|
|
65545
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65546
|
-
|
|
65547
|
-
Considered optional branches:
|
|
65548
|
-
* inside IF/ELSEIF/ELSE
|
|
65549
|
-
* inside LOOP
|
|
65550
|
-
* inside WHILE
|
|
65551
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
65552
|
-
* inside DO
|
|
65553
|
-
* inside SELECT loops
|
|
65554
|
-
|
|
65555
|
-
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:
|
|
65556
65626
|
* TRY/CATCH/CLEANUP`,
|
|
65557
65627
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65558
65628
|
};
|
|
@@ -65652,12 +65722,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
65652
65722
|
key: "no_prefixes",
|
|
65653
65723
|
title: "No Prefixes",
|
|
65654
65724
|
shortDescription: `Dont use hungarian notation`,
|
|
65655
|
-
extendedInformation: `
|
|
65656
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65657
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65658
|
-
|
|
65659
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65660
|
-
|
|
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
|
+
|
|
65661
65731
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
65662
65732
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65663
65733
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -65836,7 +65906,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
65836
65906
|
return {
|
|
65837
65907
|
key: "no_public_attributes",
|
|
65838
65908
|
title: "No public attributes",
|
|
65839
|
-
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.
|
|
65840
65910
|
Exceptions are excluded from this rule.`,
|
|
65841
65911
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
65842
65912
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -65937,13 +66007,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
65937
66007
|
key: "no_yoda_conditions",
|
|
65938
66008
|
title: "No Yoda conditions",
|
|
65939
66009
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
65940
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65941
|
-
|
|
66010
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
66011
|
+
|
|
65942
66012
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
65943
66013
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65944
|
-
badExample: `IF 0 <> sy-subrc.
|
|
66014
|
+
badExample: `IF 0 <> sy-subrc.
|
|
65945
66015
|
ENDIF.`,
|
|
65946
|
-
goodExample: `IF sy-subrc <> 0.
|
|
66016
|
+
goodExample: `IF sy-subrc <> 0.
|
|
65947
66017
|
ENDIF.`,
|
|
65948
66018
|
};
|
|
65949
66019
|
}
|
|
@@ -66044,8 +66114,8 @@ class NROBConsistency {
|
|
|
66044
66114
|
key: "nrob_consistency",
|
|
66045
66115
|
title: "Number range consistency",
|
|
66046
66116
|
shortDescription: `Consistency checks for number ranges`,
|
|
66047
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66048
|
-
|
|
66117
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66118
|
+
|
|
66049
66119
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
66050
66120
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66051
66121
|
};
|
|
@@ -66322,58 +66392,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66322
66392
|
title: "Obsolete statements",
|
|
66323
66393
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66324
66394
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66325
|
-
extendedInformation: `
|
|
66326
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66327
|
-
|
|
66328
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66329
|
-
|
|
66330
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66331
|
-
|
|
66332
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66333
|
-
|
|
66334
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66335
|
-
|
|
66336
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66337
|
-
|
|
66338
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66339
|
-
|
|
66340
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66341
|
-
|
|
66342
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66343
|
-
|
|
66344
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66345
|
-
|
|
66346
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66347
|
-
|
|
66348
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66349
|
-
|
|
66350
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66351
|
-
|
|
66352
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66353
|
-
|
|
66354
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66355
|
-
SELECT COUNT(*) is considered okay
|
|
66356
|
-
|
|
66357
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66358
|
-
|
|
66359
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66360
|
-
|
|
66361
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66362
|
-
|
|
66363
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66364
|
-
|
|
66365
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66366
|
-
|
|
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
|
+
|
|
66367
66437
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66368
|
-
badExample: `REFRESH itab.
|
|
66369
|
-
|
|
66370
|
-
COMPUTE foo = 2 + 2.
|
|
66371
|
-
|
|
66372
|
-
MULTIPLY lv_foo BY 2.
|
|
66373
|
-
|
|
66374
|
-
INTERFACE intf LOAD.
|
|
66375
|
-
|
|
66376
|
-
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.
|
|
66377
66447
|
ENDIF.`,
|
|
66378
66448
|
};
|
|
66379
66449
|
}
|
|
@@ -66713,9 +66783,9 @@ class OmitParameterName {
|
|
|
66713
66783
|
key: "omit_parameter_name",
|
|
66714
66784
|
title: "Omit parameter name",
|
|
66715
66785
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
66716
|
-
extendedInformation: `
|
|
66717
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
66718
|
-
|
|
66786
|
+
extendedInformation: `
|
|
66787
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
66788
|
+
|
|
66719
66789
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
66720
66790
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66721
66791
|
badExample: `method( param = 2 ).`,
|
|
@@ -66921,20 +66991,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
66921
66991
|
shortDescription: `Omit RECEIVING`,
|
|
66922
66992
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
66923
66993
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66924
|
-
badExample: `
|
|
66925
|
-
upload_pack(
|
|
66926
|
-
EXPORTING
|
|
66927
|
-
io_client = lo_client
|
|
66928
|
-
iv_url = iv_url
|
|
66929
|
-
iv_deepen_level = iv_deepen_level
|
|
66930
|
-
it_hashes = lt_hashes
|
|
66931
|
-
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
|
|
66932
67002
|
rt_objects = et_objects ).`,
|
|
66933
|
-
goodExample: `
|
|
66934
|
-
et_objects = upload_pack(
|
|
66935
|
-
io_client = lo_client
|
|
66936
|
-
iv_url = iv_url
|
|
66937
|
-
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
|
|
66938
67008
|
it_hashes = lt_hashes ).`,
|
|
66939
67009
|
};
|
|
66940
67010
|
}
|
|
@@ -66998,8 +67068,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
66998
67068
|
return {
|
|
66999
67069
|
key: "parser_702_chaining",
|
|
67000
67070
|
title: "Parser Error, bad chanining on 702",
|
|
67001
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67002
|
-
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.
|
|
67003
67073
|
Only active on target version 702 and below.`,
|
|
67004
67074
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67005
67075
|
};
|
|
@@ -67079,8 +67149,8 @@ class ParserError {
|
|
|
67079
67149
|
return {
|
|
67080
67150
|
key: "parser_error",
|
|
67081
67151
|
title: "Parser error",
|
|
67082
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67083
|
-
|
|
67152
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67153
|
+
|
|
67084
67154
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67085
67155
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67086
67156
|
};
|
|
@@ -67165,7 +67235,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67165
67235
|
return {
|
|
67166
67236
|
key: "parser_missing_space",
|
|
67167
67237
|
title: "Parser Error, missing space",
|
|
67168
|
-
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.
|
|
67169
67239
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67170
67240
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67171
67241
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -67577,25 +67647,25 @@ class PreferInline {
|
|
|
67577
67647
|
key: "prefer_inline",
|
|
67578
67648
|
title: "Prefer Inline Declarations",
|
|
67579
67649
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
67580
|
-
extendedInformation: `EXPERIMENTAL
|
|
67581
|
-
|
|
67582
|
-
Activates if language version is v740sp02 or above.
|
|
67583
|
-
|
|
67584
|
-
Variables must be local(METHOD or FORM).
|
|
67585
|
-
|
|
67586
|
-
No generic or void typed variables. No syntax errors.
|
|
67587
|
-
|
|
67588
|
-
First position used must be a full/pure write.
|
|
67589
|
-
|
|
67590
|
-
Move statment is not a cast(?=)
|
|
67591
|
-
|
|
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
|
+
|
|
67592
67662
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
67593
67663
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
67594
|
-
badExample: `DATA foo TYPE i.
|
|
67595
|
-
foo = 2.
|
|
67596
|
-
DATA percentage TYPE decfloat34.
|
|
67664
|
+
badExample: `DATA foo TYPE i.
|
|
67665
|
+
foo = 2.
|
|
67666
|
+
DATA percentage TYPE decfloat34.
|
|
67597
67667
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
67598
|
-
goodExample: `DATA(foo) = 2.
|
|
67668
|
+
goodExample: `DATA(foo) = 2.
|
|
67599
67669
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
67600
67670
|
};
|
|
67601
67671
|
}
|
|
@@ -67809,18 +67879,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
67809
67879
|
key: "prefer_is_not",
|
|
67810
67880
|
title: "Prefer IS NOT to NOT IS",
|
|
67811
67881
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
67812
|
-
extendedInformation: `
|
|
67813
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67814
|
-
|
|
67882
|
+
extendedInformation: `
|
|
67883
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67884
|
+
|
|
67815
67885
|
"if not is_valid( )." examples are skipped`,
|
|
67816
67886
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
67817
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
67818
|
-
IF variable NP 'TODO*'.
|
|
67819
|
-
IF variable <> 42.
|
|
67887
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
67888
|
+
IF variable NP 'TODO*'.
|
|
67889
|
+
IF variable <> 42.
|
|
67820
67890
|
IF variable CO 'hello'.`,
|
|
67821
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
67822
|
-
IF NOT variable CP 'TODO*'.
|
|
67823
|
-
IF NOT variable = 42.
|
|
67891
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
67892
|
+
IF NOT variable CP 'TODO*'.
|
|
67893
|
+
IF NOT variable = 42.
|
|
67824
67894
|
IF NOT variable CA 'hello'.`,
|
|
67825
67895
|
};
|
|
67826
67896
|
}
|
|
@@ -68008,14 +68078,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
68008
68078
|
key: "prefer_raise_exception_new",
|
|
68009
68079
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
68010
68080
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
68011
|
-
extendedInformation: `
|
|
68012
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68013
|
-
|
|
68081
|
+
extendedInformation: `
|
|
68082
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68083
|
+
|
|
68014
68084
|
From 752 and up`,
|
|
68015
68085
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
68016
68086
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
68017
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68018
|
-
EXPORTING
|
|
68087
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68088
|
+
EXPORTING
|
|
68019
68089
|
previous = exception.`,
|
|
68020
68090
|
};
|
|
68021
68091
|
}
|
|
@@ -68093,12 +68163,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68093
68163
|
key: "prefer_returning_to_exporting",
|
|
68094
68164
|
title: "Prefer RETURNING to EXPORTING",
|
|
68095
68165
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68096
|
-
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
|
|
68097
68167
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68098
68168
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68099
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68100
|
-
PUBLIC SECTION.
|
|
68101
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68169
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68170
|
+
PUBLIC SECTION.
|
|
68171
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68102
68172
|
ENDCLASS.`,
|
|
68103
68173
|
};
|
|
68104
68174
|
}
|
|
@@ -68194,8 +68264,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68194
68264
|
key: "prefer_xsdbool",
|
|
68195
68265
|
title: "Prefer xsdbool over boolc",
|
|
68196
68266
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68197
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68198
|
-
|
|
68267
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68268
|
+
|
|
68199
68269
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68200
68270
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68201
68271
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68267,9 +68337,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68267
68337
|
title: "Preferred compare operator",
|
|
68268
68338
|
shortDescription: `Configure undesired operator variants`,
|
|
68269
68339
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68270
|
-
badExample: `IF foo EQ bar.
|
|
68340
|
+
badExample: `IF foo EQ bar.
|
|
68271
68341
|
ENDIF.`,
|
|
68272
|
-
goodExample: `IF foo = bar.
|
|
68342
|
+
goodExample: `IF foo = bar.
|
|
68273
68343
|
ENDIF.`,
|
|
68274
68344
|
};
|
|
68275
68345
|
}
|
|
@@ -68493,26 +68563,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
68493
68563
|
key: "reduce_procedural_code",
|
|
68494
68564
|
title: "Reduce procedural code",
|
|
68495
68565
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
68496
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68497
|
-
|
|
68498
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68499
|
-
|
|
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
|
+
|
|
68500
68570
|
Comments are not counted as statements.`,
|
|
68501
68571
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68502
|
-
badExample: `FORM foo.
|
|
68503
|
-
DATA lv_bar TYPE i.
|
|
68504
|
-
lv_bar = 2 + 2.
|
|
68505
|
-
IF lv_bar = 4.
|
|
68506
|
-
WRITE 'hello world'.
|
|
68507
|
-
ENDIF.
|
|
68508
|
-
DATA lv_bar TYPE i.
|
|
68509
|
-
lv_bar = 2 + 2.
|
|
68510
|
-
IF lv_bar = 4.
|
|
68511
|
-
WRITE 'hello world'.
|
|
68512
|
-
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.
|
|
68513
68583
|
ENDFORM.`,
|
|
68514
|
-
goodExample: `FORM foo.
|
|
68515
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
68584
|
+
goodExample: `FORM foo.
|
|
68585
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
68516
68586
|
ENDFORM.`,
|
|
68517
68587
|
};
|
|
68518
68588
|
}
|
|
@@ -68756,10 +68826,10 @@ class RemoveDescriptions {
|
|
|
68756
68826
|
return {
|
|
68757
68827
|
key: "remove_descriptions",
|
|
68758
68828
|
title: "Remove descriptions",
|
|
68759
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
68760
|
-
|
|
68761
|
-
Class descriptions are required, see rule description_empty.
|
|
68762
|
-
|
|
68829
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
68830
|
+
|
|
68831
|
+
Class descriptions are required, see rule description_empty.
|
|
68832
|
+
|
|
68763
68833
|
Consider using ABAP Doc for documentation.`,
|
|
68764
68834
|
tags: [],
|
|
68765
68835
|
};
|
|
@@ -68884,16 +68954,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
68884
68954
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68885
68955
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
68886
68956
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
68887
|
-
badExample: `
|
|
68888
|
-
CALL FUNCTION 'ZRFC'
|
|
68957
|
+
badExample: `
|
|
68958
|
+
CALL FUNCTION 'ZRFC'
|
|
68889
68959
|
DESTINATION lv_rfc.`,
|
|
68890
|
-
goodExample: `
|
|
68891
|
-
CALL FUNCTION 'ZRFC'
|
|
68892
|
-
DESTINATION lv_rfc
|
|
68893
|
-
EXCEPTIONS
|
|
68894
|
-
system_failure = 1 MESSAGE msg
|
|
68895
|
-
communication_failure = 2 MESSAGE msg
|
|
68896
|
-
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
|
|
68897
68967
|
OTHERS = 4.`,
|
|
68898
68968
|
};
|
|
68899
68969
|
}
|
|
@@ -68977,11 +69047,11 @@ class SelectAddOrderBy {
|
|
|
68977
69047
|
key: "select_add_order_by",
|
|
68978
69048
|
title: "SELECT add ORDER BY",
|
|
68979
69049
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
68980
|
-
extendedInformation: `
|
|
68981
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68982
|
-
|
|
68983
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
68984
|
-
|
|
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
|
+
|
|
68985
69055
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
68986
69056
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68987
69057
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69112,14 +69182,14 @@ class SelectPerformance {
|
|
|
69112
69182
|
key: "select_performance",
|
|
69113
69183
|
title: "SELECT performance",
|
|
69114
69184
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69115
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69116
|
-
|
|
69185
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69186
|
+
|
|
69117
69187
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69118
69188
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69119
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69120
|
-
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.
|
|
69121
69191
|
ENDSELECT.`,
|
|
69122
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69192
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69123
69193
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69124
69194
|
};
|
|
69125
69195
|
}
|
|
@@ -69231,8 +69301,8 @@ class SelectSingleFullKey {
|
|
|
69231
69301
|
key: "select_single_full_key",
|
|
69232
69302
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69233
69303
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69234
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69235
|
-
|
|
69304
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69305
|
+
|
|
69236
69306
|
If the statement contains a JOIN it is not checked`,
|
|
69237
69307
|
pseudoComment: "EC CI_NOORDER",
|
|
69238
69308
|
tags: [],
|
|
@@ -69649,8 +69719,8 @@ class SICFConsistency {
|
|
|
69649
69719
|
key: "sicf_consistency",
|
|
69650
69720
|
title: "SICF consistency",
|
|
69651
69721
|
shortDescription: `Checks the validity of ICF services`,
|
|
69652
|
-
extendedInformation: `* Class defined in handler must exist
|
|
69653
|
-
* Class must not have any syntax errors
|
|
69722
|
+
extendedInformation: `* Class defined in handler must exist
|
|
69723
|
+
* Class must not have any syntax errors
|
|
69654
69724
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
69655
69725
|
};
|
|
69656
69726
|
}
|
|
@@ -69762,23 +69832,23 @@ class SlowParameterPassing {
|
|
|
69762
69832
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
69763
69833
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
69764
69834
|
tags: [_irule_1.RuleTag.Performance],
|
|
69765
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69766
|
-
PUBLIC SECTION.
|
|
69767
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
69768
|
-
ENDCLASS.
|
|
69769
|
-
CLASS lcl IMPLEMENTATION.
|
|
69770
|
-
METHOD bar.
|
|
69771
|
-
WRITE sdf.
|
|
69772
|
-
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.
|
|
69773
69843
|
ENDCLASS.`,
|
|
69774
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
69775
|
-
PUBLIC SECTION.
|
|
69776
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
69777
|
-
ENDCLASS.
|
|
69778
|
-
CLASS lcl IMPLEMENTATION.
|
|
69779
|
-
METHOD bar.
|
|
69780
|
-
WRITE sdf.
|
|
69781
|
-
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.
|
|
69782
69852
|
ENDCLASS.`,
|
|
69783
69853
|
};
|
|
69784
69854
|
}
|
|
@@ -70035,8 +70105,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
70035
70105
|
key: "space_before_dot",
|
|
70036
70106
|
title: "Space before dot",
|
|
70037
70107
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
70038
|
-
extendedInformation: `
|
|
70039
|
-
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
|
|
70040
70110
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
70041
70111
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70042
70112
|
badExample: `WRITE bar .`,
|
|
@@ -70222,12 +70292,12 @@ class SQLValueConversion {
|
|
|
70222
70292
|
key: "sql_value_conversion",
|
|
70223
70293
|
title: "Implicit SQL Value Conversion",
|
|
70224
70294
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70225
|
-
extendedInformation: `
|
|
70226
|
-
* Integer to CHAR conversion
|
|
70227
|
-
* Integer to NUMC conversion
|
|
70228
|
-
* NUMC to Integer conversion
|
|
70229
|
-
* CHAR to Integer conversion
|
|
70230
|
-
* 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
|
|
70231
70301
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70232
70302
|
tags: [],
|
|
70233
70303
|
};
|
|
@@ -70299,7 +70369,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70299
70369
|
key: "start_at_tab",
|
|
70300
70370
|
title: "Start at tab",
|
|
70301
70371
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70302
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70372
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70303
70373
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70304
70374
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70305
70375
|
badExample: ` WRITE a.`,
|
|
@@ -70476,12 +70546,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
70476
70546
|
key: "strict_sql",
|
|
70477
70547
|
title: "Strict SQL",
|
|
70478
70548
|
shortDescription: `Strict SQL`,
|
|
70479
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70480
|
-
|
|
70481
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70482
|
-
|
|
70483
|
-
Also see separate rule sql_escape_host_variables
|
|
70484
|
-
|
|
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
|
+
|
|
70485
70555
|
Activates from v750 and up`,
|
|
70486
70556
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
70487
70557
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -70735,11 +70805,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
70735
70805
|
key: "sy_modification",
|
|
70736
70806
|
title: "Modification of SY fields",
|
|
70737
70807
|
shortDescription: `Finds modification of sy fields`,
|
|
70738
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
70739
|
-
|
|
70808
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
70809
|
+
|
|
70740
70810
|
Changes to SY-TVAR* fields are not reported`,
|
|
70741
70811
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70742
|
-
badExample: `sy-uname = 2.
|
|
70812
|
+
badExample: `sy-uname = 2.
|
|
70743
70813
|
sy = sy.`,
|
|
70744
70814
|
};
|
|
70745
70815
|
}
|
|
@@ -70801,8 +70871,8 @@ class TABLEnhancementCategory {
|
|
|
70801
70871
|
key: "tabl_enhancement_category",
|
|
70802
70872
|
title: "TABL enhancement category must be set",
|
|
70803
70873
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
70804
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
70805
|
-
|
|
70874
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
70875
|
+
|
|
70806
70876
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
70807
70877
|
tags: [],
|
|
70808
70878
|
};
|
|
@@ -70930,9 +71000,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
70930
71000
|
title: "Type FORM parameters",
|
|
70931
71001
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
70932
71002
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70933
|
-
badExample: `FORM foo USING bar.
|
|
71003
|
+
badExample: `FORM foo USING bar.
|
|
70934
71004
|
ENDFORM.`,
|
|
70935
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
71005
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
70936
71006
|
ENDFORM.`,
|
|
70937
71007
|
};
|
|
70938
71008
|
}
|
|
@@ -71605,38 +71675,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
71605
71675
|
key: "unnecessary_pragma",
|
|
71606
71676
|
title: "Unnecessary Pragma",
|
|
71607
71677
|
shortDescription: `Finds pragmas which can be removed`,
|
|
71608
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
71609
|
-
|
|
71610
|
-
* NEEDED without definition
|
|
71611
|
-
|
|
71612
|
-
* NO_TEXT without texts
|
|
71613
|
-
|
|
71614
|
-
* SUBRC_OK where sy-subrc is checked
|
|
71615
|
-
|
|
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
|
+
|
|
71616
71686
|
NO_HANDLER inside macros are not checked`,
|
|
71617
71687
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71618
|
-
badExample: `TRY.
|
|
71619
|
-
...
|
|
71620
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71621
|
-
RETURN. " it has a handler
|
|
71622
|
-
ENDTRY.
|
|
71623
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71624
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71625
|
-
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.
|
|
71626
71696
|
ENDIF.`,
|
|
71627
|
-
goodExample: `TRY.
|
|
71628
|
-
...
|
|
71629
|
-
CATCH zcx_abapgit_exception.
|
|
71630
|
-
RETURN.
|
|
71631
|
-
ENDTRY.
|
|
71632
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71633
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71634
|
-
IF sy-subrc <> 0.
|
|
71635
|
-
ENDIF.
|
|
71636
|
-
|
|
71637
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
71638
|
-
test1 TYPE string,
|
|
71639
|
-
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,
|
|
71640
71710
|
END OF blah.`,
|
|
71641
71711
|
};
|
|
71642
71712
|
}
|
|
@@ -71797,18 +71867,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
71797
71867
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
71798
71868
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
71799
71869
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
71800
|
-
badExample: `FORM hello1.
|
|
71801
|
-
WRITE 'world'.
|
|
71802
|
-
RETURN.
|
|
71803
|
-
ENDFORM.
|
|
71804
|
-
|
|
71805
|
-
FORM foo.
|
|
71806
|
-
IF 1 = 2.
|
|
71807
|
-
RETURN.
|
|
71808
|
-
ENDIF.
|
|
71870
|
+
badExample: `FORM hello1.
|
|
71871
|
+
WRITE 'world'.
|
|
71872
|
+
RETURN.
|
|
71873
|
+
ENDFORM.
|
|
71874
|
+
|
|
71875
|
+
FORM foo.
|
|
71876
|
+
IF 1 = 2.
|
|
71877
|
+
RETURN.
|
|
71878
|
+
ENDIF.
|
|
71809
71879
|
ENDFORM.`,
|
|
71810
|
-
goodExample: `FORM hello2.
|
|
71811
|
-
WRITE 'world'.
|
|
71880
|
+
goodExample: `FORM hello2.
|
|
71881
|
+
WRITE 'world'.
|
|
71812
71882
|
ENDFORM.`,
|
|
71813
71883
|
};
|
|
71814
71884
|
}
|
|
@@ -72175,17 +72245,17 @@ class UnusedMethods {
|
|
|
72175
72245
|
key: "unused_methods",
|
|
72176
72246
|
title: "Unused methods",
|
|
72177
72247
|
shortDescription: `Checks for unused methods`,
|
|
72178
|
-
extendedInformation: `Checks private and protected methods.
|
|
72179
|
-
|
|
72180
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72181
|
-
|
|
72182
|
-
Skips:
|
|
72183
|
-
* methods FOR TESTING
|
|
72184
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72185
|
-
* class_constructor + constructor methods
|
|
72186
|
-
* event handlers
|
|
72187
|
-
* methods that are redefined
|
|
72188
|
-
* 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
|
|
72189
72259
|
`,
|
|
72190
72260
|
tags: [],
|
|
72191
72261
|
pragma: "##CALLED",
|
|
@@ -72619,23 +72689,23 @@ class UnusedVariables {
|
|
|
72619
72689
|
key: "unused_variables",
|
|
72620
72690
|
title: "Unused variables",
|
|
72621
72691
|
shortDescription: `Checks for unused variables and constants`,
|
|
72622
|
-
extendedInformation: `Skips event parameters.
|
|
72623
|
-
|
|
72624
|
-
Note that this currently does not work if the source code uses macros.
|
|
72625
|
-
|
|
72626
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
72627
|
-
|
|
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
|
+
|
|
72628
72698
|
Errors found in INCLUDES are reported for the main program.`,
|
|
72629
72699
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72630
72700
|
pragma: "##NEEDED",
|
|
72631
72701
|
pseudoComment: "EC NEEDED",
|
|
72632
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
72633
|
-
test TYPE string,
|
|
72634
|
-
test2 TYPE string,
|
|
72702
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
72703
|
+
test TYPE string,
|
|
72704
|
+
test2 TYPE string,
|
|
72635
72705
|
END OF blah1.`,
|
|
72636
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
72637
|
-
test TYPE string,
|
|
72638
|
-
test2 TYPE string,
|
|
72706
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
72707
|
+
test TYPE string,
|
|
72708
|
+
test2 TYPE string,
|
|
72639
72709
|
END OF blah2.`,
|
|
72640
72710
|
};
|
|
72641
72711
|
}
|
|
@@ -72854,15 +72924,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
72854
72924
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
72855
72925
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
72856
72926
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
72857
|
-
badExample: `IF line IS INITIAL.
|
|
72858
|
-
has_entries = abap_false.
|
|
72859
|
-
ELSE.
|
|
72860
|
-
has_entries = abap_true.
|
|
72861
|
-
ENDIF.
|
|
72862
|
-
|
|
72927
|
+
badExample: `IF line IS INITIAL.
|
|
72928
|
+
has_entries = abap_false.
|
|
72929
|
+
ELSE.
|
|
72930
|
+
has_entries = abap_true.
|
|
72931
|
+
ENDIF.
|
|
72932
|
+
|
|
72863
72933
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
72864
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
72865
|
-
|
|
72934
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
72935
|
+
|
|
72866
72936
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
72867
72937
|
};
|
|
72868
72938
|
}
|
|
@@ -72980,15 +73050,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
72980
73050
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
72981
73051
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
72982
73052
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72983
|
-
badExample: `INTERFACE lif.
|
|
72984
|
-
METHODS load_data
|
|
72985
|
-
EXCEPTIONS
|
|
72986
|
-
invalid_parameter.
|
|
73053
|
+
badExample: `INTERFACE lif.
|
|
73054
|
+
METHODS load_data
|
|
73055
|
+
EXCEPTIONS
|
|
73056
|
+
invalid_parameter.
|
|
72987
73057
|
ENDINTERFACE.`,
|
|
72988
|
-
goodExample: `INTERFACE lif.
|
|
72989
|
-
METHODS load_data
|
|
72990
|
-
RAISING
|
|
72991
|
-
cx_something.
|
|
73058
|
+
goodExample: `INTERFACE lif.
|
|
73059
|
+
METHODS load_data
|
|
73060
|
+
RAISING
|
|
73061
|
+
cx_something.
|
|
72992
73062
|
ENDINTERFACE.`,
|
|
72993
73063
|
};
|
|
72994
73064
|
}
|
|
@@ -73048,15 +73118,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
73048
73118
|
key: "use_line_exists",
|
|
73049
73119
|
title: "Use line_exists",
|
|
73050
73120
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73051
|
-
extendedInformation: `
|
|
73052
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73053
|
-
|
|
73121
|
+
extendedInformation: `
|
|
73122
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73123
|
+
|
|
73054
73124
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73055
73125
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73056
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73057
|
-
IF sy-subrc = 0.
|
|
73126
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73127
|
+
IF sy-subrc = 0.
|
|
73058
73128
|
ENDIF.`,
|
|
73059
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73129
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73060
73130
|
ENDIF.`,
|
|
73061
73131
|
};
|
|
73062
73132
|
}
|
|
@@ -73166,10 +73236,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73166
73236
|
key: "use_new",
|
|
73167
73237
|
title: "Use NEW",
|
|
73168
73238
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73169
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73170
|
-
|
|
73171
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73172
|
-
|
|
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
|
+
|
|
73173
73243
|
Applicable from v740sp02 and up`,
|
|
73174
73244
|
badExample: `CREATE OBJECT ref.`,
|
|
73175
73245
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73267,13 +73337,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73267
73337
|
title: "WHEN OTHERS last",
|
|
73268
73338
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73269
73339
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73270
|
-
badExample: `CASE bar.
|
|
73271
|
-
WHEN OTHERS.
|
|
73272
|
-
WHEN 2.
|
|
73340
|
+
badExample: `CASE bar.
|
|
73341
|
+
WHEN OTHERS.
|
|
73342
|
+
WHEN 2.
|
|
73273
73343
|
ENDCASE.`,
|
|
73274
|
-
goodExample: `CASE bar.
|
|
73275
|
-
WHEN 2.
|
|
73276
|
-
WHEN OTHERS.
|
|
73344
|
+
goodExample: `CASE bar.
|
|
73345
|
+
WHEN 2.
|
|
73346
|
+
WHEN OTHERS.
|
|
73277
73347
|
ENDCASE.`,
|
|
73278
73348
|
};
|
|
73279
73349
|
}
|