@abaplint/cli 2.108.4 → 2.108.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/abaplint +2 -2
- package/build/cli.js +853 -803
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -34406,13 +34406,13 @@ class FlowGraph {
|
|
|
34406
34406
|
this.label = label;
|
|
34407
34407
|
}
|
|
34408
34408
|
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()}
|
|
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()}
|
|
34416
34416
|
}`;
|
|
34417
34417
|
}
|
|
34418
34418
|
listSources(node) {
|
|
@@ -42489,13 +42489,13 @@ class Help {
|
|
|
42489
42489
|
/////////////////////////////////////////////////
|
|
42490
42490
|
static dumpABAP(file, reg, textDocument, position) {
|
|
42491
42491
|
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>
|
|
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>
|
|
42499
42499
|
` +
|
|
42500
42500
|
"<tt>" + textDocument.uri + " (" +
|
|
42501
42501
|
(position.line + 1) + ", " +
|
|
@@ -50538,15 +50538,42 @@ class Transaction extends _abstract_object_1.AbstractObject {
|
|
|
50538
50538
|
getType() {
|
|
50539
50539
|
return "TRAN";
|
|
50540
50540
|
}
|
|
50541
|
+
setDirty() {
|
|
50542
|
+
this.parsedXML = undefined;
|
|
50543
|
+
super.setDirty();
|
|
50544
|
+
}
|
|
50541
50545
|
getAllowedNaming() {
|
|
50542
50546
|
return {
|
|
50543
50547
|
maxLength: 20,
|
|
50544
50548
|
allowNamespace: true,
|
|
50545
50549
|
};
|
|
50546
50550
|
}
|
|
50551
|
+
getProgramName() {
|
|
50552
|
+
var _a;
|
|
50553
|
+
this.parse();
|
|
50554
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.programName;
|
|
50555
|
+
}
|
|
50547
50556
|
getDescription() {
|
|
50548
|
-
|
|
50549
|
-
|
|
50557
|
+
var _a;
|
|
50558
|
+
this.parse();
|
|
50559
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
|
|
50560
|
+
}
|
|
50561
|
+
parse() {
|
|
50562
|
+
if (this.parsedXML) {
|
|
50563
|
+
return { updated: false, runtime: 0 };
|
|
50564
|
+
}
|
|
50565
|
+
const start = Date.now();
|
|
50566
|
+
this.parsedXML = {};
|
|
50567
|
+
const parsed = super.parseRaw2();
|
|
50568
|
+
if (parsed === undefined
|
|
50569
|
+
|| parsed.abapGit === undefined
|
|
50570
|
+
|| parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
|
|
50571
|
+
return { updated: false, runtime: 0 };
|
|
50572
|
+
}
|
|
50573
|
+
this.parsedXML.description = parsed.abapGit["asx:abap"]["asx:values"].TSTCT.TTEXT;
|
|
50574
|
+
this.parsedXML.programName = parsed.abapGit["asx:abap"]["asx:values"].TSTC.PGMNA;
|
|
50575
|
+
const end = Date.now();
|
|
50576
|
+
return { updated: true, runtime: end - start };
|
|
50550
50577
|
}
|
|
50551
50578
|
}
|
|
50552
50579
|
exports.Transaction = Transaction;
|
|
@@ -51494,7 +51521,7 @@ class Registry {
|
|
|
51494
51521
|
}
|
|
51495
51522
|
static abaplintVersion() {
|
|
51496
51523
|
// magic, see build script "version.sh"
|
|
51497
|
-
return "2.108.
|
|
51524
|
+
return "2.108.5";
|
|
51498
51525
|
}
|
|
51499
51526
|
getDDICReferences() {
|
|
51500
51527
|
return this.ddicReferences;
|
|
@@ -51810,10 +51837,10 @@ class SevenBitAscii {
|
|
|
51810
51837
|
key: "7bit_ascii",
|
|
51811
51838
|
title: "Check for 7bit ascii",
|
|
51812
51839
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
51813
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51814
|
-
|
|
51815
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51816
|
-
|
|
51840
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
51841
|
+
|
|
51842
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
51843
|
+
|
|
51817
51844
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
51818
51845
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
51819
51846
|
badExample: `WRITE '뽑'.`,
|
|
@@ -52019,10 +52046,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
52019
52046
|
key: "abapdoc",
|
|
52020
52047
|
title: "Check abapdoc",
|
|
52021
52048
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
52022
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52023
|
-
|
|
52024
|
-
Plus class and interface definitions.
|
|
52025
|
-
|
|
52049
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
52050
|
+
|
|
52051
|
+
Plus class and interface definitions.
|
|
52052
|
+
|
|
52026
52053
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
52027
52054
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
52028
52055
|
};
|
|
@@ -52160,49 +52187,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
52160
52187
|
key: "align_parameters",
|
|
52161
52188
|
title: "Align Parameters",
|
|
52162
52189
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
52163
|
-
extendedInformation: `Checks:
|
|
52164
|
-
* function module calls
|
|
52165
|
-
* method calls
|
|
52166
|
-
* VALUE constructors
|
|
52167
|
-
* NEW constructors
|
|
52168
|
-
* RAISE EXCEPTION statements
|
|
52169
|
-
* CREATE OBJECT statements
|
|
52170
|
-
* RAISE EVENT statements
|
|
52171
|
-
|
|
52172
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52173
|
-
|
|
52174
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52175
|
-
|
|
52176
|
-
If parameters are on the same row, no issues are reported, see
|
|
52190
|
+
extendedInformation: `Checks:
|
|
52191
|
+
* function module calls
|
|
52192
|
+
* method calls
|
|
52193
|
+
* VALUE constructors
|
|
52194
|
+
* NEW constructors
|
|
52195
|
+
* RAISE EXCEPTION statements
|
|
52196
|
+
* CREATE OBJECT statements
|
|
52197
|
+
* RAISE EVENT statements
|
|
52198
|
+
|
|
52199
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
52200
|
+
|
|
52201
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
52202
|
+
|
|
52203
|
+
If parameters are on the same row, no issues are reported, see
|
|
52177
52204
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
52178
52205
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
52179
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52180
|
-
EXPORTING
|
|
52181
|
-
foo = 2
|
|
52182
|
-
parameter = 3.
|
|
52183
|
-
|
|
52184
|
-
foobar( moo = 1
|
|
52185
|
-
param = 1 ).
|
|
52186
|
-
|
|
52187
|
-
foo = VALUE #(
|
|
52188
|
-
foo = bar
|
|
52206
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
52207
|
+
EXPORTING
|
|
52208
|
+
foo = 2
|
|
52209
|
+
parameter = 3.
|
|
52210
|
+
|
|
52211
|
+
foobar( moo = 1
|
|
52212
|
+
param = 1 ).
|
|
52213
|
+
|
|
52214
|
+
foo = VALUE #(
|
|
52215
|
+
foo = bar
|
|
52189
52216
|
moo = 2 ).`,
|
|
52190
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52191
|
-
EXPORTING
|
|
52192
|
-
foo = 2
|
|
52193
|
-
parameter = 3.
|
|
52194
|
-
|
|
52195
|
-
foobar( moo = 1
|
|
52196
|
-
param = 1 ).
|
|
52197
|
-
|
|
52198
|
-
foo = VALUE #(
|
|
52199
|
-
foo = bar
|
|
52200
|
-
moo = 2 ).
|
|
52201
|
-
|
|
52202
|
-
DATA(sdf) = VALUE type(
|
|
52203
|
-
common_val = 2
|
|
52204
|
-
another_common = 5
|
|
52205
|
-
( row_value = 4
|
|
52217
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
52218
|
+
EXPORTING
|
|
52219
|
+
foo = 2
|
|
52220
|
+
parameter = 3.
|
|
52221
|
+
|
|
52222
|
+
foobar( moo = 1
|
|
52223
|
+
param = 1 ).
|
|
52224
|
+
|
|
52225
|
+
foo = VALUE #(
|
|
52226
|
+
foo = bar
|
|
52227
|
+
moo = 2 ).
|
|
52228
|
+
|
|
52229
|
+
DATA(sdf) = VALUE type(
|
|
52230
|
+
common_val = 2
|
|
52231
|
+
another_common = 5
|
|
52232
|
+
( row_value = 4
|
|
52206
52233
|
value_foo = 5 ) ).`,
|
|
52207
52234
|
};
|
|
52208
52235
|
}
|
|
@@ -52636,37 +52663,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
52636
52663
|
key: "align_type_expressions",
|
|
52637
52664
|
title: "Align TYPE expressions",
|
|
52638
52665
|
shortDescription: `Align TYPE expressions in statements`,
|
|
52639
|
-
extendedInformation: `
|
|
52640
|
-
Currently works for METHODS + BEGIN OF
|
|
52641
|
-
|
|
52642
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52643
|
-
|
|
52644
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52666
|
+
extendedInformation: `
|
|
52667
|
+
Currently works for METHODS + BEGIN OF
|
|
52668
|
+
|
|
52669
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
52670
|
+
|
|
52671
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
52645
52672
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
52646
52673
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
52647
|
-
badExample: `
|
|
52648
|
-
TYPES: BEGIN OF foo,
|
|
52649
|
-
bar TYPE i,
|
|
52650
|
-
foobar TYPE i,
|
|
52651
|
-
END OF foo.
|
|
52652
|
-
|
|
52653
|
-
INTERFACE lif.
|
|
52654
|
-
METHODS bar
|
|
52655
|
-
IMPORTING
|
|
52656
|
-
foo TYPE i
|
|
52657
|
-
foobar TYPE i.
|
|
52674
|
+
badExample: `
|
|
52675
|
+
TYPES: BEGIN OF foo,
|
|
52676
|
+
bar TYPE i,
|
|
52677
|
+
foobar TYPE i,
|
|
52678
|
+
END OF foo.
|
|
52679
|
+
|
|
52680
|
+
INTERFACE lif.
|
|
52681
|
+
METHODS bar
|
|
52682
|
+
IMPORTING
|
|
52683
|
+
foo TYPE i
|
|
52684
|
+
foobar TYPE i.
|
|
52658
52685
|
ENDINTERFACE.`,
|
|
52659
|
-
goodExample: `
|
|
52660
|
-
TYPES: BEGIN OF foo,
|
|
52661
|
-
bar TYPE i,
|
|
52662
|
-
foobar TYPE i,
|
|
52663
|
-
END OF foo.
|
|
52664
|
-
|
|
52665
|
-
INTERFACE lif.
|
|
52666
|
-
METHODS bar
|
|
52667
|
-
IMPORTING
|
|
52668
|
-
foo TYPE i
|
|
52669
|
-
foobar TYPE i.
|
|
52686
|
+
goodExample: `
|
|
52687
|
+
TYPES: BEGIN OF foo,
|
|
52688
|
+
bar TYPE i,
|
|
52689
|
+
foobar TYPE i,
|
|
52690
|
+
END OF foo.
|
|
52691
|
+
|
|
52692
|
+
INTERFACE lif.
|
|
52693
|
+
METHODS bar
|
|
52694
|
+
IMPORTING
|
|
52695
|
+
foo TYPE i
|
|
52696
|
+
foobar TYPE i.
|
|
52670
52697
|
ENDINTERFACE.`,
|
|
52671
52698
|
};
|
|
52672
52699
|
}
|
|
@@ -52945,15 +52972,15 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
52945
52972
|
return {
|
|
52946
52973
|
key: "ambiguous_statement",
|
|
52947
52974
|
title: "Check for ambigious statements",
|
|
52948
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52949
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52950
|
-
|
|
52975
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
52976
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
52977
|
+
|
|
52951
52978
|
Only works if the target version is 740sp05 or above`,
|
|
52952
52979
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
52953
|
-
badExample: `DELETE foo FROM bar.
|
|
52980
|
+
badExample: `DELETE foo FROM bar.
|
|
52954
52981
|
MODIFY foo FROM bar.`,
|
|
52955
|
-
goodExample: `DELETE foo FROM @bar.
|
|
52956
|
-
MODIFY TABLE foo FROM bar.
|
|
52982
|
+
goodExample: `DELETE foo FROM @bar.
|
|
52983
|
+
MODIFY TABLE foo FROM bar.
|
|
52957
52984
|
MODIFY zfoo FROM @wa.`,
|
|
52958
52985
|
};
|
|
52959
52986
|
}
|
|
@@ -53058,16 +53085,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
53058
53085
|
key: "avoid_use",
|
|
53059
53086
|
title: "Avoid use of certain statements",
|
|
53060
53087
|
shortDescription: `Detects usage of certain statements.`,
|
|
53061
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53062
|
-
|
|
53063
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53064
|
-
|
|
53065
|
-
STATICS: use CLASS-DATA instead
|
|
53066
|
-
|
|
53067
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53068
|
-
|
|
53069
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53070
|
-
|
|
53088
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
53089
|
+
|
|
53090
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
53091
|
+
|
|
53092
|
+
STATICS: use CLASS-DATA instead
|
|
53093
|
+
|
|
53094
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
53095
|
+
|
|
53096
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
53097
|
+
|
|
53071
53098
|
BREAK points`,
|
|
53072
53099
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
53073
53100
|
};
|
|
@@ -53199,11 +53226,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
53199
53226
|
title: "Check BEGIN END names",
|
|
53200
53227
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
53201
53228
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
53202
|
-
badExample: `DATA: BEGIN OF stru,
|
|
53203
|
-
field TYPE i,
|
|
53229
|
+
badExample: `DATA: BEGIN OF stru,
|
|
53230
|
+
field TYPE i,
|
|
53204
53231
|
END OF structure_not_the_same.`,
|
|
53205
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
53206
|
-
field TYPE i,
|
|
53232
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
53233
|
+
field TYPE i,
|
|
53207
53234
|
END OF stru.`,
|
|
53208
53235
|
};
|
|
53209
53236
|
}
|
|
@@ -53300,20 +53327,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
53300
53327
|
title: "BEGIN contains single INCLUDE",
|
|
53301
53328
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
53302
53329
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53303
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
53304
|
-
INCLUDE TYPE dselc.
|
|
53305
|
-
TYPES: END OF dummy1.
|
|
53306
|
-
|
|
53307
|
-
DATA BEGIN OF foo.
|
|
53308
|
-
INCLUDE STRUCTURE syst.
|
|
53309
|
-
DATA END OF foo.
|
|
53310
|
-
|
|
53311
|
-
STATICS BEGIN OF bar.
|
|
53312
|
-
INCLUDE STRUCTURE syst.
|
|
53330
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
53331
|
+
INCLUDE TYPE dselc.
|
|
53332
|
+
TYPES: END OF dummy1.
|
|
53333
|
+
|
|
53334
|
+
DATA BEGIN OF foo.
|
|
53335
|
+
INCLUDE STRUCTURE syst.
|
|
53336
|
+
DATA END OF foo.
|
|
53337
|
+
|
|
53338
|
+
STATICS BEGIN OF bar.
|
|
53339
|
+
INCLUDE STRUCTURE syst.
|
|
53313
53340
|
STATICS END OF bar.`,
|
|
53314
|
-
goodExample: `DATA BEGIN OF foo.
|
|
53315
|
-
DATA field TYPE i.
|
|
53316
|
-
INCLUDE STRUCTURE dselc.
|
|
53341
|
+
goodExample: `DATA BEGIN OF foo.
|
|
53342
|
+
DATA field TYPE i.
|
|
53343
|
+
INCLUDE STRUCTURE dselc.
|
|
53317
53344
|
DATA END OF foo.`,
|
|
53318
53345
|
};
|
|
53319
53346
|
}
|
|
@@ -53403,9 +53430,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
53403
53430
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
53404
53431
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
53405
53432
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
53406
|
-
goodExample: `TRY.
|
|
53407
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53408
|
-
CATCH cx_sy_authorization_error.
|
|
53433
|
+
goodExample: `TRY.
|
|
53434
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
53435
|
+
CATCH cx_sy_authorization_error.
|
|
53409
53436
|
ENDTRY.`,
|
|
53410
53437
|
};
|
|
53411
53438
|
}
|
|
@@ -53470,10 +53497,10 @@ class CDSCommentStyle {
|
|
|
53470
53497
|
key: "cds_comment_style",
|
|
53471
53498
|
title: "CDS Comment Style",
|
|
53472
53499
|
shortDescription: `Check for obsolete comment style`,
|
|
53473
|
-
extendedInformation: `Check for obsolete comment style
|
|
53474
|
-
|
|
53475
|
-
Comments starting with "--" are considered obsolete
|
|
53476
|
-
|
|
53500
|
+
extendedInformation: `Check for obsolete comment style
|
|
53501
|
+
|
|
53502
|
+
Comments starting with "--" are considered obsolete
|
|
53503
|
+
|
|
53477
53504
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
53478
53505
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53479
53506
|
badExample: "-- this is a comment",
|
|
@@ -53540,10 +53567,10 @@ class CDSLegacyView {
|
|
|
53540
53567
|
title: "CDS Legacy View",
|
|
53541
53568
|
shortDescription: `Identify CDS Legacy Views`,
|
|
53542
53569
|
// eslint-disable-next-line max-len
|
|
53543
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53544
|
-
|
|
53545
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53546
|
-
|
|
53570
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
53571
|
+
|
|
53572
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
53573
|
+
|
|
53547
53574
|
v755 and up`,
|
|
53548
53575
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
53549
53576
|
};
|
|
@@ -53698,10 +53725,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
53698
53725
|
key: "chain_mainly_declarations",
|
|
53699
53726
|
title: "Chain mainly declarations",
|
|
53700
53727
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
53701
|
-
extendedInformation: `
|
|
53702
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
53703
|
-
|
|
53704
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53728
|
+
extendedInformation: `
|
|
53729
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
53730
|
+
|
|
53731
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
53705
53732
|
`,
|
|
53706
53733
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
53707
53734
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -53877,17 +53904,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
53877
53904
|
title: "Change IF to CASE",
|
|
53878
53905
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
53879
53906
|
// eslint-disable-next-line max-len
|
|
53880
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53881
|
-
|
|
53907
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
53908
|
+
|
|
53882
53909
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
53883
53910
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53884
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53885
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53886
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
53911
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
53912
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
53913
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
53887
53914
|
ENDIF.`,
|
|
53888
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
53889
|
-
WHEN 'FOO'.
|
|
53890
|
-
WHEN 'BAR' OR 'MOO'.
|
|
53915
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
53916
|
+
WHEN 'FOO'.
|
|
53917
|
+
WHEN 'BAR' OR 'MOO'.
|
|
53891
53918
|
ENDCASE.`,
|
|
53892
53919
|
};
|
|
53893
53920
|
}
|
|
@@ -54024,8 +54051,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
54024
54051
|
return {
|
|
54025
54052
|
key: "check_abstract",
|
|
54026
54053
|
title: "Check abstract methods and classes",
|
|
54027
|
-
shortDescription: `Checks abstract methods and classes:
|
|
54028
|
-
- class defined as abstract and final,
|
|
54054
|
+
shortDescription: `Checks abstract methods and classes:
|
|
54055
|
+
- class defined as abstract and final,
|
|
54029
54056
|
- non-abstract class contains abstract methods`,
|
|
54030
54057
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
54031
54058
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -54106,11 +54133,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
54106
54133
|
return {
|
|
54107
54134
|
key: "check_comments",
|
|
54108
54135
|
title: "Check Comments",
|
|
54109
|
-
shortDescription: `
|
|
54136
|
+
shortDescription: `
|
|
54110
54137
|
Various checks for comment usage.`,
|
|
54111
|
-
extendedInformation: `
|
|
54112
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54113
|
-
|
|
54138
|
+
extendedInformation: `
|
|
54139
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
54140
|
+
|
|
54114
54141
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
54115
54142
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54116
54143
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -54272,9 +54299,9 @@ class CheckInclude {
|
|
|
54272
54299
|
key: "check_include",
|
|
54273
54300
|
title: "Check INCLUDEs",
|
|
54274
54301
|
shortDescription: `Checks INCLUDE statements`,
|
|
54275
|
-
extendedInformation: `
|
|
54276
|
-
* Reports unused includes
|
|
54277
|
-
* Errors if the includes are not found
|
|
54302
|
+
extendedInformation: `
|
|
54303
|
+
* Reports unused includes
|
|
54304
|
+
* Errors if the includes are not found
|
|
54278
54305
|
* Error if including a main program`,
|
|
54279
54306
|
tags: [_irule_1.RuleTag.Syntax],
|
|
54280
54307
|
};
|
|
@@ -54350,14 +54377,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
54350
54377
|
key: "check_subrc",
|
|
54351
54378
|
title: "Check sy-subrc",
|
|
54352
54379
|
shortDescription: `Check sy-subrc`,
|
|
54353
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54354
|
-
|
|
54355
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54356
|
-
|
|
54357
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54358
|
-
|
|
54359
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54360
|
-
|
|
54380
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
54381
|
+
|
|
54382
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
54383
|
+
|
|
54384
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
54385
|
+
|
|
54386
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
54387
|
+
|
|
54361
54388
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
54362
54389
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54363
54390
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -54926,17 +54953,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
54926
54953
|
shortDescription: `Find overlapping classic exceptions`,
|
|
54927
54954
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
54928
54955
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54929
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54930
|
-
EXCEPTIONS
|
|
54931
|
-
system_failure = 1 MESSAGE lv_message
|
|
54932
|
-
communication_failure = 1 MESSAGE lv_message
|
|
54933
|
-
resource_failure = 1
|
|
54956
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
54957
|
+
EXCEPTIONS
|
|
54958
|
+
system_failure = 1 MESSAGE lv_message
|
|
54959
|
+
communication_failure = 1 MESSAGE lv_message
|
|
54960
|
+
resource_failure = 1
|
|
54934
54961
|
OTHERS = 1.`,
|
|
54935
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54936
|
-
EXCEPTIONS
|
|
54937
|
-
system_failure = 1 MESSAGE lv_message
|
|
54938
|
-
communication_failure = 2 MESSAGE lv_message
|
|
54939
|
-
resource_failure = 3
|
|
54962
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
54963
|
+
EXCEPTIONS
|
|
54964
|
+
system_failure = 1 MESSAGE lv_message
|
|
54965
|
+
communication_failure = 2 MESSAGE lv_message
|
|
54966
|
+
resource_failure = 3
|
|
54940
54967
|
OTHERS = 4.`,
|
|
54941
54968
|
};
|
|
54942
54969
|
}
|
|
@@ -55182,7 +55209,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
55182
55209
|
key: "commented_code",
|
|
55183
55210
|
title: "Find commented code",
|
|
55184
55211
|
shortDescription: `Detects usage of commented out code.`,
|
|
55185
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55212
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
55186
55213
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
55187
55214
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55188
55215
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -55415,10 +55442,10 @@ class ConstructorVisibilityPublic {
|
|
|
55415
55442
|
key: "constructor_visibility_public",
|
|
55416
55443
|
title: "Check constructor visibility is public",
|
|
55417
55444
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
55418
|
-
extendedInformation: `
|
|
55419
|
-
This only applies to global classes.
|
|
55420
|
-
|
|
55421
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55445
|
+
extendedInformation: `
|
|
55446
|
+
This only applies to global classes.
|
|
55447
|
+
|
|
55448
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
55422
55449
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
55423
55450
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55424
55451
|
};
|
|
@@ -55493,8 +55520,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
55493
55520
|
key: "contains_tab",
|
|
55494
55521
|
title: "Code contains tab",
|
|
55495
55522
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
55496
|
-
extendedInformation: `
|
|
55497
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
55523
|
+
extendedInformation: `
|
|
55524
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
55498
55525
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
55499
55526
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55500
55527
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -55581,10 +55608,10 @@ class CyclicOO {
|
|
|
55581
55608
|
key: "cyclic_oo",
|
|
55582
55609
|
title: "Cyclic OO",
|
|
55583
55610
|
shortDescription: `Finds cyclic OO references`,
|
|
55584
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55585
|
-
|
|
55586
|
-
Objects must be without syntax errors for this rule to take effect
|
|
55587
|
-
|
|
55611
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
55612
|
+
|
|
55613
|
+
Objects must be without syntax errors for this rule to take effect
|
|
55614
|
+
|
|
55588
55615
|
References in testclass includes are ignored`,
|
|
55589
55616
|
};
|
|
55590
55617
|
}
|
|
@@ -55826,7 +55853,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55826
55853
|
key: "dangerous_statement",
|
|
55827
55854
|
title: "Dangerous statement",
|
|
55828
55855
|
shortDescription: `Detects potentially dangerous statements`,
|
|
55829
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55856
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
55830
55857
|
dynamic SQL can potentially create SQL injection problems`,
|
|
55831
55858
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55832
55859
|
};
|
|
@@ -56030,13 +56057,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
56030
56057
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
56031
56058
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
56032
56059
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56033
|
-
badExample: `FROM foo.
|
|
56034
|
-
WRITE 'hello'.
|
|
56035
|
-
DATA int TYPE i.
|
|
56060
|
+
badExample: `FROM foo.
|
|
56061
|
+
WRITE 'hello'.
|
|
56062
|
+
DATA int TYPE i.
|
|
56036
56063
|
ENDFORM.`,
|
|
56037
|
-
goodExample: `FROM foo.
|
|
56038
|
-
DATA int TYPE i.
|
|
56039
|
-
WRITE 'hello'.
|
|
56064
|
+
goodExample: `FROM foo.
|
|
56065
|
+
DATA int TYPE i.
|
|
56066
|
+
WRITE 'hello'.
|
|
56040
56067
|
ENDFORM.`,
|
|
56041
56068
|
};
|
|
56042
56069
|
}
|
|
@@ -56572,39 +56599,39 @@ class Downport {
|
|
|
56572
56599
|
key: "downport",
|
|
56573
56600
|
title: "Downport statement",
|
|
56574
56601
|
shortDescription: `Downport functionality`,
|
|
56575
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56576
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56577
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56578
|
-
|
|
56579
|
-
Current rules:
|
|
56580
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56581
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56582
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
56583
|
-
* CONV is outlined
|
|
56584
|
-
* COND is outlined
|
|
56585
|
-
* REDUCE is outlined
|
|
56586
|
-
* SWITCH is outlined
|
|
56587
|
-
* FILTER is outlined
|
|
56588
|
-
* APPEND expression is outlined
|
|
56589
|
-
* INSERT expression is outlined
|
|
56590
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56591
|
-
* CAST changed to ?=
|
|
56592
|
-
* LOOP AT method_call( ) is outlined
|
|
56593
|
-
* VALUE # with structure fields
|
|
56594
|
-
* VALUE # with internal table lines
|
|
56595
|
-
* Table Expressions are outlined
|
|
56596
|
-
* SELECT INTO @DATA definitions are outlined
|
|
56597
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56598
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56599
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56600
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
56601
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56602
|
-
* line_exists and line_index is downported to READ TABLE
|
|
56603
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
56604
|
-
* MESSAGE with non simple source
|
|
56605
|
-
|
|
56606
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56607
|
-
|
|
56602
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
56603
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
56604
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
56605
|
+
|
|
56606
|
+
Current rules:
|
|
56607
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
56608
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
56609
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
56610
|
+
* CONV is outlined
|
|
56611
|
+
* COND is outlined
|
|
56612
|
+
* REDUCE is outlined
|
|
56613
|
+
* SWITCH is outlined
|
|
56614
|
+
* FILTER is outlined
|
|
56615
|
+
* APPEND expression is outlined
|
|
56616
|
+
* INSERT expression is outlined
|
|
56617
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
56618
|
+
* CAST changed to ?=
|
|
56619
|
+
* LOOP AT method_call( ) is outlined
|
|
56620
|
+
* VALUE # with structure fields
|
|
56621
|
+
* VALUE # with internal table lines
|
|
56622
|
+
* Table Expressions are outlined
|
|
56623
|
+
* SELECT INTO @DATA definitions are outlined
|
|
56624
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
56625
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
56626
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
56627
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
56628
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
56629
|
+
* line_exists and line_index is downported to READ TABLE
|
|
56630
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
56631
|
+
* MESSAGE with non simple source
|
|
56632
|
+
|
|
56633
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
56634
|
+
|
|
56608
56635
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
56609
56636
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
56610
56637
|
};
|
|
@@ -56968,6 +56995,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
56968
56995
|
if (found) {
|
|
56969
56996
|
return found;
|
|
56970
56997
|
}
|
|
56998
|
+
found = this.downportMessageSource(high, lowFile, highSyntax);
|
|
56999
|
+
if (found) {
|
|
57000
|
+
return found;
|
|
57001
|
+
}
|
|
56971
57002
|
found = this.downportMessage(high, lowFile, highSyntax);
|
|
56972
57003
|
if (found) {
|
|
56973
57004
|
return found;
|
|
@@ -57178,10 +57209,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
57178
57209
|
const fieldName = f.concatTokens();
|
|
57179
57210
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
57180
57211
|
}
|
|
57181
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57212
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
57182
57213
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
57183
57214
|
}
|
|
57184
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57215
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
57185
57216
|
${indentation}`);
|
|
57186
57217
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
57187
57218
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57225,12 +57256,12 @@ ${indentation}`);
|
|
|
57225
57256
|
}
|
|
57226
57257
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57227
57258
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
57228
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57229
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57230
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57259
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
57260
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
57261
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
57231
57262
|
${indentation}`);
|
|
57232
57263
|
if (fieldDefinitions === "") {
|
|
57233
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57264
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
57234
57265
|
${indentation}`);
|
|
57235
57266
|
}
|
|
57236
57267
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -57298,7 +57329,7 @@ ${indentation}`);
|
|
|
57298
57329
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57299
57330
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57300
57331
|
const firstToken = high.getFirstToken();
|
|
57301
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57332
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57302
57333
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57303
57334
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57304
57335
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57322,6 +57353,22 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57322
57353
|
}
|
|
57323
57354
|
return undefined;
|
|
57324
57355
|
}
|
|
57356
|
+
downportMessageSource(high, lowFile, highSyntax) {
|
|
57357
|
+
if (!(high.get() instanceof Statements.Message)) {
|
|
57358
|
+
return undefined;
|
|
57359
|
+
}
|
|
57360
|
+
const source = high.findExpressionAfterToken("MESSAGE");
|
|
57361
|
+
if ((source === null || source === void 0 ? void 0 : source.get()) instanceof Expressions.Source) {
|
|
57362
|
+
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57363
|
+
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57364
|
+
const firstToken = high.getFirstToken();
|
|
57365
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA(${uniqueName}) = ${source.concatTokens()}.\n` + indentation);
|
|
57366
|
+
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57367
|
+
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
57368
|
+
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline message source", this.getMetadata().key, this.conf.severity, fix);
|
|
57369
|
+
}
|
|
57370
|
+
return undefined;
|
|
57371
|
+
}
|
|
57325
57372
|
replaceInsertExpression(high, lowFile, highSyntax) {
|
|
57326
57373
|
if (!(high.get() instanceof Statements.InsertInternal)) {
|
|
57327
57374
|
return undefined;
|
|
@@ -57336,7 +57383,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57336
57383
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57337
57384
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57338
57385
|
const firstToken = high.getFirstToken();
|
|
57339
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57386
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
57340
57387
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
57341
57388
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
57342
57389
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57378,14 +57425,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
57378
57425
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
57379
57426
|
const firstToken = high.getFirstToken();
|
|
57380
57427
|
// note that the tabix restore should be done before throwing the exception
|
|
57381
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57382
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57383
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
57384
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57385
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
57386
|
-
${indentation}IF sy-subrc <> 0.
|
|
57387
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57388
|
-
${indentation}ENDIF.
|
|
57428
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
57429
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
57430
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
57431
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
57432
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
57433
|
+
${indentation}IF sy-subrc <> 0.
|
|
57434
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57435
|
+
${indentation}ENDIF.
|
|
57389
57436
|
${indentation}`);
|
|
57390
57437
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
57391
57438
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -57442,7 +57489,7 @@ ${indentation}`);
|
|
|
57442
57489
|
const className = classNames[0].concatTokens();
|
|
57443
57490
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
57444
57491
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57445
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57492
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
57446
57493
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
57447
57494
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
57448
57495
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -57604,16 +57651,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
57604
57651
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57605
57652
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57606
57653
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
57607
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57608
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57654
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
57655
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
57609
57656
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
57610
57657
|
if (withs.length > 0) {
|
|
57611
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57612
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57613
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57658
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
57659
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
57660
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
57614
57661
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
57615
57662
|
}
|
|
57616
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57663
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
57617
57664
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
57618
57665
|
if (withs.length > 0) {
|
|
57619
57666
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -57725,10 +57772,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
57725
57772
|
let code = "";
|
|
57726
57773
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
57727
57774
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57728
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57729
|
-
IF sy-subrc <> 0.
|
|
57730
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57731
|
-
ENDIF.
|
|
57775
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
57776
|
+
IF sy-subrc <> 0.
|
|
57777
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
57778
|
+
ENDIF.
|
|
57732
57779
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
57733
57780
|
}
|
|
57734
57781
|
else {
|
|
@@ -57817,20 +57864,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
57817
57864
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57818
57865
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57819
57866
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
57820
|
-
code += ` items LIKE ${loopSourceName},
|
|
57821
|
-
END OF ${groupTargetName}type.
|
|
57822
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57823
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57867
|
+
code += ` items LIKE ${loopSourceName},
|
|
57868
|
+
END OF ${groupTargetName}type.
|
|
57869
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
57870
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
57824
57871
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
57825
57872
|
if (groupIndexName !== undefined) {
|
|
57826
57873
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
57827
57874
|
}
|
|
57828
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57875
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
57829
57876
|
IF sy-subrc = 0.\n`;
|
|
57830
57877
|
if (groupCountName !== undefined) {
|
|
57831
57878
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
57832
57879
|
}
|
|
57833
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57880
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
57834
57881
|
ELSE.\n`;
|
|
57835
57882
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
57836
57883
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -57851,8 +57898,8 @@ ELSE.\n`;
|
|
|
57851
57898
|
}
|
|
57852
57899
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
57853
57900
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
57854
|
-
code += `ENDIF.
|
|
57855
|
-
ENDLOOP.
|
|
57901
|
+
code += `ENDIF.
|
|
57902
|
+
ENDLOOP.
|
|
57856
57903
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
57857
57904
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
57858
57905
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -58024,7 +58071,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
58024
58071
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58025
58072
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
58026
58073
|
// all ENUMS are char like?
|
|
58027
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
58074
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
58028
58075
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
58029
58076
|
let count = 1;
|
|
58030
58077
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -58068,14 +58115,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
58068
58115
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58069
58116
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58070
58117
|
// restore tabix before exeption
|
|
58071
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58072
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58073
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
58074
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58075
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
58076
|
-
${indentation}IF sy-subrc <> 0.
|
|
58077
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58078
|
-
${indentation}ENDIF.
|
|
58118
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
58119
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
58120
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
58121
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
58122
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
58123
|
+
${indentation}IF sy-subrc <> 0.
|
|
58124
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
58125
|
+
${indentation}ENDIF.
|
|
58079
58126
|
${indentation}${uniqueName}`;
|
|
58080
58127
|
const start = target.getFirstToken().getStart();
|
|
58081
58128
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -58159,11 +58206,11 @@ ${indentation}${uniqueName}`;
|
|
|
58159
58206
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58160
58207
|
const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
58161
58208
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58162
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
58163
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
58164
|
-
${indentation} EXPORTING
|
|
58165
|
-
${indentation} input = ${source}
|
|
58166
|
-
${indentation} IMPORTING
|
|
58209
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
58210
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
58211
|
+
${indentation} EXPORTING
|
|
58212
|
+
${indentation} input = ${source}
|
|
58213
|
+
${indentation} IMPORTING
|
|
58167
58214
|
${indentation} output = ${uniqueName}.\n`;
|
|
58168
58215
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
58169
58216
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -59475,12 +59522,12 @@ class EasyToFindMessages {
|
|
|
59475
59522
|
key: "easy_to_find_messages",
|
|
59476
59523
|
title: "Easy to find messages",
|
|
59477
59524
|
shortDescription: `Make messages easy to find`,
|
|
59478
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
59479
|
-
|
|
59480
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
59481
|
-
|
|
59482
|
-
Also see rule "message_exists"
|
|
59483
|
-
|
|
59525
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
59526
|
+
|
|
59527
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
59528
|
+
|
|
59529
|
+
Also see rule "message_exists"
|
|
59530
|
+
|
|
59484
59531
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
59485
59532
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
59486
59533
|
};
|
|
@@ -59565,8 +59612,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
59565
59612
|
key: "empty_line_in_statement",
|
|
59566
59613
|
title: "Find empty lines in statements",
|
|
59567
59614
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
59568
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59569
|
-
|
|
59615
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
59616
|
+
|
|
59570
59617
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
59571
59618
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59572
59619
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -59742,13 +59789,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
59742
59789
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
59743
59790
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
59744
59791
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
59745
|
-
badExample: `IF foo = bar.
|
|
59746
|
-
ENDIF.
|
|
59747
|
-
|
|
59748
|
-
DO 2 TIMES.
|
|
59792
|
+
badExample: `IF foo = bar.
|
|
59793
|
+
ENDIF.
|
|
59794
|
+
|
|
59795
|
+
DO 2 TIMES.
|
|
59749
59796
|
ENDDO.`,
|
|
59750
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
59751
|
-
ENDLOOP.
|
|
59797
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
59798
|
+
ENDLOOP.
|
|
59752
59799
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
59753
59800
|
};
|
|
59754
59801
|
}
|
|
@@ -59890,10 +59937,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
59890
59937
|
return {
|
|
59891
59938
|
key: "exit_or_check",
|
|
59892
59939
|
title: "Find EXIT or CHECK outside loops",
|
|
59893
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59940
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
59894
59941
|
Use RETURN to leave procesing blocks instead.`,
|
|
59895
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59896
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59942
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
59943
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
59897
59944
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
59898
59945
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59899
59946
|
};
|
|
@@ -59976,12 +60023,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
59976
60023
|
key: "expand_macros",
|
|
59977
60024
|
title: "Expand Macros",
|
|
59978
60025
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
59979
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
59980
|
-
|
|
60026
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
60027
|
+
|
|
59981
60028
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
59982
|
-
badExample: `DEFINE _hello.
|
|
59983
|
-
WRITE 'hello'.
|
|
59984
|
-
END-OF-DEFINITION.
|
|
60029
|
+
badExample: `DEFINE _hello.
|
|
60030
|
+
WRITE 'hello'.
|
|
60031
|
+
END-OF-DEFINITION.
|
|
59985
60032
|
_hello.`,
|
|
59986
60033
|
goodExample: `WRITE 'hello'.`,
|
|
59987
60034
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -60068,7 +60115,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
60068
60115
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
60069
60116
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
60070
60117
|
goodExample: `call_method( foo = bar ).`,
|
|
60071
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60118
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
60072
60119
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
60073
60120
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60074
60121
|
};
|
|
@@ -60166,7 +60213,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
60166
60213
|
key: "forbidden_identifier",
|
|
60167
60214
|
title: "Forbidden Identifier",
|
|
60168
60215
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
60169
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60216
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
60170
60217
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
60171
60218
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60172
60219
|
};
|
|
@@ -60408,8 +60455,8 @@ class ForbiddenVoidType {
|
|
|
60408
60455
|
key: "forbidden_void_type",
|
|
60409
60456
|
title: "Forbidden Void Types",
|
|
60410
60457
|
shortDescription: `Avoid usage of specified void types.`,
|
|
60411
|
-
extendedInformation: `Inspiration:
|
|
60412
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60458
|
+
extendedInformation: `Inspiration:
|
|
60459
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
60413
60460
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
60414
60461
|
};
|
|
60415
60462
|
}
|
|
@@ -60652,7 +60699,7 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
60652
60699
|
key: "fully_type_itabs",
|
|
60653
60700
|
title: "Fully type internal tables",
|
|
60654
60701
|
shortDescription: `No implict table types or table keys`,
|
|
60655
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60702
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
60656
60703
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
60657
60704
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
60658
60705
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -60837,26 +60884,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
60837
60884
|
key: "functional_writing",
|
|
60838
60885
|
title: "Use functional writing",
|
|
60839
60886
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
60840
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60887
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
60841
60888
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
60842
60889
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60843
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60844
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60845
|
-
EXPORTING
|
|
60846
|
-
p_name = 'NAME'
|
|
60847
|
-
RECEIVING
|
|
60848
|
-
p_descr_ref = lr_typedescr
|
|
60849
|
-
EXCEPTIONS
|
|
60850
|
-
type_not_found = 1
|
|
60890
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
60891
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
60892
|
+
EXPORTING
|
|
60893
|
+
p_name = 'NAME'
|
|
60894
|
+
RECEIVING
|
|
60895
|
+
p_descr_ref = lr_typedescr
|
|
60896
|
+
EXCEPTIONS
|
|
60897
|
+
type_not_found = 1
|
|
60851
60898
|
OTHERS = 2.`,
|
|
60852
|
-
goodExample: `zcl_class=>method( ).
|
|
60853
|
-
cl_abap_typedescr=>describe_by_name(
|
|
60854
|
-
EXPORTING
|
|
60855
|
-
p_name = 'NAME'
|
|
60856
|
-
RECEIVING
|
|
60857
|
-
p_descr_ref = lr_typedescr
|
|
60858
|
-
EXCEPTIONS
|
|
60859
|
-
type_not_found = 1
|
|
60899
|
+
goodExample: `zcl_class=>method( ).
|
|
60900
|
+
cl_abap_typedescr=>describe_by_name(
|
|
60901
|
+
EXPORTING
|
|
60902
|
+
p_name = 'NAME'
|
|
60903
|
+
RECEIVING
|
|
60904
|
+
p_descr_ref = lr_typedescr
|
|
60905
|
+
EXCEPTIONS
|
|
60906
|
+
type_not_found = 1
|
|
60860
60907
|
OTHERS = 2 ).`,
|
|
60861
60908
|
};
|
|
60862
60909
|
}
|
|
@@ -60967,14 +61014,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
60967
61014
|
key: "global_class",
|
|
60968
61015
|
title: "Global class checks",
|
|
60969
61016
|
shortDescription: `Checks related to global classes`,
|
|
60970
|
-
extendedInformation: `* global classes must be in own files
|
|
60971
|
-
|
|
60972
|
-
* file names must match class name
|
|
60973
|
-
|
|
60974
|
-
* file names must match interface name
|
|
60975
|
-
|
|
60976
|
-
* global classes must be global definitions
|
|
60977
|
-
|
|
61017
|
+
extendedInformation: `* global classes must be in own files
|
|
61018
|
+
|
|
61019
|
+
* file names must match class name
|
|
61020
|
+
|
|
61021
|
+
* file names must match interface name
|
|
61022
|
+
|
|
61023
|
+
* global classes must be global definitions
|
|
61024
|
+
|
|
60978
61025
|
* global interfaces must be global definitions`,
|
|
60979
61026
|
tags: [_irule_1.RuleTag.Syntax],
|
|
60980
61027
|
};
|
|
@@ -61073,21 +61120,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
61073
61120
|
return {
|
|
61074
61121
|
key: "identical_conditions",
|
|
61075
61122
|
title: "Identical conditions",
|
|
61076
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61077
|
-
|
|
61123
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
61124
|
+
|
|
61078
61125
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
61079
61126
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61080
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61081
|
-
ENDIF.
|
|
61082
|
-
CASE bar.
|
|
61083
|
-
WHEN '1'.
|
|
61084
|
-
WHEN 'A' OR '1'.
|
|
61127
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
61128
|
+
ENDIF.
|
|
61129
|
+
CASE bar.
|
|
61130
|
+
WHEN '1'.
|
|
61131
|
+
WHEN 'A' OR '1'.
|
|
61085
61132
|
ENDCASE.`,
|
|
61086
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
61087
|
-
ENDIF.
|
|
61088
|
-
CASE bar.
|
|
61089
|
-
WHEN '1'.
|
|
61090
|
-
WHEN 'A'.
|
|
61133
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
61134
|
+
ENDIF.
|
|
61135
|
+
CASE bar.
|
|
61136
|
+
WHEN '1'.
|
|
61137
|
+
WHEN 'A'.
|
|
61091
61138
|
ENDCASE.`,
|
|
61092
61139
|
};
|
|
61093
61140
|
}
|
|
@@ -61221,23 +61268,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
61221
61268
|
key: "identical_contents",
|
|
61222
61269
|
title: "Identical contents",
|
|
61223
61270
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
61224
|
-
extendedInformation: `
|
|
61225
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
61226
|
-
|
|
61271
|
+
extendedInformation: `
|
|
61272
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
61273
|
+
|
|
61227
61274
|
Chained statments are ignored`,
|
|
61228
61275
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61229
|
-
badExample: `IF foo = bar.
|
|
61230
|
-
WRITE 'bar'.
|
|
61231
|
-
WRITE 'world'.
|
|
61232
|
-
ELSE.
|
|
61233
|
-
WRITE 'foo'.
|
|
61234
|
-
WRITE 'world'.
|
|
61276
|
+
badExample: `IF foo = bar.
|
|
61277
|
+
WRITE 'bar'.
|
|
61278
|
+
WRITE 'world'.
|
|
61279
|
+
ELSE.
|
|
61280
|
+
WRITE 'foo'.
|
|
61281
|
+
WRITE 'world'.
|
|
61235
61282
|
ENDIF.`,
|
|
61236
|
-
goodExample: `IF foo = bar.
|
|
61237
|
-
WRITE 'bar'.
|
|
61238
|
-
ELSE.
|
|
61239
|
-
WRITE 'foo'.
|
|
61240
|
-
ENDIF.
|
|
61283
|
+
goodExample: `IF foo = bar.
|
|
61284
|
+
WRITE 'bar'.
|
|
61285
|
+
ELSE.
|
|
61286
|
+
WRITE 'foo'.
|
|
61287
|
+
ENDIF.
|
|
61241
61288
|
WRITE 'world'.`,
|
|
61242
61289
|
};
|
|
61243
61290
|
}
|
|
@@ -61345,12 +61392,12 @@ class IdenticalDescriptions {
|
|
|
61345
61392
|
key: "identical_descriptions",
|
|
61346
61393
|
title: "Identical descriptions",
|
|
61347
61394
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
61348
|
-
extendedInformation: `Case insensitive
|
|
61349
|
-
|
|
61350
|
-
Only checks the master language descriptions
|
|
61351
|
-
|
|
61352
|
-
Dependencies are skipped
|
|
61353
|
-
|
|
61395
|
+
extendedInformation: `Case insensitive
|
|
61396
|
+
|
|
61397
|
+
Only checks the master language descriptions
|
|
61398
|
+
|
|
61399
|
+
Dependencies are skipped
|
|
61400
|
+
|
|
61354
61401
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
61355
61402
|
tags: [],
|
|
61356
61403
|
};
|
|
@@ -61524,43 +61571,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
61524
61571
|
key: "if_in_if",
|
|
61525
61572
|
title: "IF in IF",
|
|
61526
61573
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
61527
|
-
extendedInformation: `
|
|
61528
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61529
|
-
|
|
61530
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61531
|
-
|
|
61532
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
61574
|
+
extendedInformation: `
|
|
61575
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
61576
|
+
|
|
61577
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
61578
|
+
|
|
61579
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
61533
61580
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
61534
|
-
badExample: `IF condition1.
|
|
61535
|
-
IF condition2.
|
|
61536
|
-
...
|
|
61537
|
-
ENDIF.
|
|
61538
|
-
ENDIF.
|
|
61539
|
-
|
|
61540
|
-
IF condition1.
|
|
61541
|
-
...
|
|
61542
|
-
ELSE.
|
|
61543
|
-
IF condition2.
|
|
61544
|
-
...
|
|
61545
|
-
ENDIF.
|
|
61581
|
+
badExample: `IF condition1.
|
|
61582
|
+
IF condition2.
|
|
61583
|
+
...
|
|
61584
|
+
ENDIF.
|
|
61585
|
+
ENDIF.
|
|
61586
|
+
|
|
61587
|
+
IF condition1.
|
|
61588
|
+
...
|
|
61589
|
+
ELSE.
|
|
61590
|
+
IF condition2.
|
|
61591
|
+
...
|
|
61592
|
+
ENDIF.
|
|
61546
61593
|
ENDIF.`,
|
|
61547
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61548
|
-
...
|
|
61549
|
-
ENDIF.
|
|
61550
|
-
|
|
61551
|
-
IF condition1.
|
|
61552
|
-
...
|
|
61553
|
-
ELSEIF condition2.
|
|
61554
|
-
...
|
|
61555
|
-
ENDIF.
|
|
61556
|
-
|
|
61557
|
-
CASE variable.
|
|
61558
|
-
WHEN value1.
|
|
61559
|
-
...
|
|
61560
|
-
WHEN value2.
|
|
61561
|
-
IF condition2.
|
|
61562
|
-
...
|
|
61563
|
-
ENDIF.
|
|
61594
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
61595
|
+
...
|
|
61596
|
+
ENDIF.
|
|
61597
|
+
|
|
61598
|
+
IF condition1.
|
|
61599
|
+
...
|
|
61600
|
+
ELSEIF condition2.
|
|
61601
|
+
...
|
|
61602
|
+
ENDIF.
|
|
61603
|
+
|
|
61604
|
+
CASE variable.
|
|
61605
|
+
WHEN value1.
|
|
61606
|
+
...
|
|
61607
|
+
WHEN value2.
|
|
61608
|
+
IF condition2.
|
|
61609
|
+
...
|
|
61610
|
+
ENDIF.
|
|
61564
61611
|
ENDCASE.`,
|
|
61565
61612
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61566
61613
|
};
|
|
@@ -61745,9 +61792,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
61745
61792
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
61746
61793
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
61747
61794
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
61748
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61749
|
-
METHOD ${methodName.toLowerCase()}.
|
|
61750
|
-
RETURN. " todo, implement method
|
|
61795
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
61796
|
+
METHOD ${methodName.toLowerCase()}.
|
|
61797
|
+
RETURN. " todo, implement method
|
|
61751
61798
|
ENDMETHOD.`);
|
|
61752
61799
|
}
|
|
61753
61800
|
}
|
|
@@ -61935,19 +61982,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
61935
61982
|
key: "in_statement_indentation",
|
|
61936
61983
|
title: "In-statement indentation",
|
|
61937
61984
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
61938
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61939
|
-
|
|
61940
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
61985
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
61986
|
+
|
|
61987
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
61941
61988
|
to distinguish them better from code within the block.`,
|
|
61942
|
-
badExample: `IF 1 = 1
|
|
61943
|
-
AND 2 = 2.
|
|
61944
|
-
WRITE 'hello' &&
|
|
61945
|
-
'world'.
|
|
61989
|
+
badExample: `IF 1 = 1
|
|
61990
|
+
AND 2 = 2.
|
|
61991
|
+
WRITE 'hello' &&
|
|
61992
|
+
'world'.
|
|
61946
61993
|
ENDIF.`,
|
|
61947
|
-
goodExample: `IF 1 = 1
|
|
61948
|
-
AND 2 = 2.
|
|
61949
|
-
WRITE 'hello' &&
|
|
61950
|
-
'world'.
|
|
61994
|
+
goodExample: `IF 1 = 1
|
|
61995
|
+
AND 2 = 2.
|
|
61996
|
+
WRITE 'hello' &&
|
|
61997
|
+
'world'.
|
|
61951
61998
|
ENDIF.`,
|
|
61952
61999
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61953
62000
|
};
|
|
@@ -62070,23 +62117,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
62070
62117
|
title: "Indentation",
|
|
62071
62118
|
shortDescription: `Checks indentation`,
|
|
62072
62119
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62073
|
-
badExample: `CLASS lcl DEFINITION.
|
|
62074
|
-
PRIVATE SECTION.
|
|
62075
|
-
METHODS constructor.
|
|
62076
|
-
ENDCLASS.
|
|
62077
|
-
|
|
62078
|
-
CLASS lcl IMPLEMENTATION.
|
|
62079
|
-
METHOD constructor.
|
|
62080
|
-
ENDMETHOD.
|
|
62120
|
+
badExample: `CLASS lcl DEFINITION.
|
|
62121
|
+
PRIVATE SECTION.
|
|
62122
|
+
METHODS constructor.
|
|
62123
|
+
ENDCLASS.
|
|
62124
|
+
|
|
62125
|
+
CLASS lcl IMPLEMENTATION.
|
|
62126
|
+
METHOD constructor.
|
|
62127
|
+
ENDMETHOD.
|
|
62081
62128
|
ENDCLASS.`,
|
|
62082
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
62083
|
-
PRIVATE SECTION.
|
|
62084
|
-
METHODS constructor.
|
|
62085
|
-
ENDCLASS.
|
|
62086
|
-
|
|
62087
|
-
CLASS lcl IMPLEMENTATION.
|
|
62088
|
-
METHOD constructor.
|
|
62089
|
-
ENDMETHOD.
|
|
62129
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
62130
|
+
PRIVATE SECTION.
|
|
62131
|
+
METHODS constructor.
|
|
62132
|
+
ENDCLASS.
|
|
62133
|
+
|
|
62134
|
+
CLASS lcl IMPLEMENTATION.
|
|
62135
|
+
METHOD constructor.
|
|
62136
|
+
ENDMETHOD.
|
|
62090
62137
|
ENDCLASS.`,
|
|
62091
62138
|
};
|
|
62092
62139
|
}
|
|
@@ -62473,9 +62520,9 @@ class IntfReferencingClas {
|
|
|
62473
62520
|
key: "intf_referencing_clas",
|
|
62474
62521
|
title: "INTF referencing CLAS",
|
|
62475
62522
|
shortDescription: `Interface contains references to class`,
|
|
62476
|
-
extendedInformation: `Only global interfaces are checked.
|
|
62477
|
-
Only first level references are checked.
|
|
62478
|
-
Exception class references are ignored.
|
|
62523
|
+
extendedInformation: `Only global interfaces are checked.
|
|
62524
|
+
Only first level references are checked.
|
|
62525
|
+
Exception class references are ignored.
|
|
62479
62526
|
Void references are ignored.`,
|
|
62480
62527
|
};
|
|
62481
62528
|
}
|
|
@@ -62560,9 +62607,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
62560
62607
|
title: "Invalid Table Index",
|
|
62561
62608
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
62562
62609
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62563
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
62610
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
62564
62611
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
62565
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
62612
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
62566
62613
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
62567
62614
|
};
|
|
62568
62615
|
}
|
|
@@ -62991,8 +63038,11 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
62991
63038
|
/** returns a list of tokens which violates the keyword_case rule */
|
|
62992
63039
|
traverse(s, parent) {
|
|
62993
63040
|
let ret = [];
|
|
62994
|
-
|
|
63041
|
+
const children = s.getChildren();
|
|
63042
|
+
for (let i = 0; i < children.length; i++) {
|
|
63043
|
+
const child = children[i];
|
|
62995
63044
|
if (child instanceof nodes_1.TokenNodeRegex) {
|
|
63045
|
+
const next = children[i + 1];
|
|
62996
63046
|
if (this.conf.ignoreLowerClassImplmentationStatement
|
|
62997
63047
|
&& parent instanceof Statements.ClassImplementation) {
|
|
62998
63048
|
continue;
|
|
@@ -63000,7 +63050,7 @@ class KeywordCase extends _abap_rule_1.ABAPRule {
|
|
|
63000
63050
|
const str = child.get().getStr();
|
|
63001
63051
|
const upper = str.toUpperCase();
|
|
63002
63052
|
// todo, this is a hack, the parser should recongize OTHERS/TEXT as a keyword
|
|
63003
|
-
if (upper === "OTHERS" || upper === "TEXT") {
|
|
63053
|
+
if (upper === "OTHERS" || (upper === "TEXT" && (next === null || next === void 0 ? void 0 : next.concatTokens()) === "-")) {
|
|
63004
63054
|
continue;
|
|
63005
63055
|
}
|
|
63006
63056
|
if (this.conf.ignoreFunctionModuleName === true
|
|
@@ -63160,8 +63210,8 @@ class LineBreakStyle {
|
|
|
63160
63210
|
return {
|
|
63161
63211
|
key: "line_break_style",
|
|
63162
63212
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
63163
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63164
|
-
|
|
63213
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
63214
|
+
|
|
63165
63215
|
abapGit does not work with CRLF`,
|
|
63166
63216
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
63167
63217
|
};
|
|
@@ -63230,7 +63280,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
63230
63280
|
key: "line_length",
|
|
63231
63281
|
title: "Line length",
|
|
63232
63282
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
63233
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63283
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
63234
63284
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
63235
63285
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
63236
63286
|
};
|
|
@@ -63301,7 +63351,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
63301
63351
|
key: "line_only_punc",
|
|
63302
63352
|
title: "Line containing only punctuation",
|
|
63303
63353
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
63304
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63354
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
63305
63355
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
63306
63356
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63307
63357
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -63561,15 +63611,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
63561
63611
|
return {
|
|
63562
63612
|
key: "local_variable_names",
|
|
63563
63613
|
title: "Local variable naming conventions",
|
|
63564
|
-
shortDescription: `
|
|
63565
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63614
|
+
shortDescription: `
|
|
63615
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
63566
63616
|
Regexes are case-insensitive.`,
|
|
63567
63617
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
63568
|
-
badExample: `FORM bar.
|
|
63569
|
-
DATA foo.
|
|
63618
|
+
badExample: `FORM bar.
|
|
63619
|
+
DATA foo.
|
|
63570
63620
|
ENDFORM.`,
|
|
63571
|
-
goodExample: `FORM bar.
|
|
63572
|
-
DATA lv_foo.
|
|
63621
|
+
goodExample: `FORM bar.
|
|
63622
|
+
DATA lv_foo.
|
|
63573
63623
|
ENDFORM.`,
|
|
63574
63624
|
};
|
|
63575
63625
|
}
|
|
@@ -63715,10 +63765,10 @@ class MainFileContents {
|
|
|
63715
63765
|
key: "main_file_contents",
|
|
63716
63766
|
title: "Main file contents",
|
|
63717
63767
|
shortDescription: `Checks related to report declarations.`,
|
|
63718
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
63719
|
-
|
|
63720
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63721
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
63768
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
63769
|
+
|
|
63770
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
63771
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
63722
63772
|
`,
|
|
63723
63773
|
};
|
|
63724
63774
|
}
|
|
@@ -63834,17 +63884,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
63834
63884
|
title: "Too many parentheses",
|
|
63835
63885
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
63836
63886
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63837
|
-
badExample: `
|
|
63838
|
-
IF ( destination IS INITIAL ).
|
|
63839
|
-
ENDIF.
|
|
63840
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63841
|
-
ENDIF.
|
|
63887
|
+
badExample: `
|
|
63888
|
+
IF ( destination IS INITIAL ).
|
|
63889
|
+
ENDIF.
|
|
63890
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
63891
|
+
ENDIF.
|
|
63842
63892
|
`,
|
|
63843
|
-
goodExample: `
|
|
63844
|
-
IF destination IS INITIAL.
|
|
63845
|
-
ENDIF.
|
|
63846
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
63847
|
-
ENDIF.
|
|
63893
|
+
goodExample: `
|
|
63894
|
+
IF destination IS INITIAL.
|
|
63895
|
+
ENDIF.
|
|
63896
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
63897
|
+
ENDIF.
|
|
63848
63898
|
`,
|
|
63849
63899
|
};
|
|
63850
63900
|
}
|
|
@@ -64018,14 +64068,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
64018
64068
|
title: "Max one method parameter definition per line",
|
|
64019
64069
|
shortDescription: `Keep max one method parameter description per line`,
|
|
64020
64070
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
64021
|
-
badExample: `
|
|
64022
|
-
METHODS apps_scope_token
|
|
64023
|
-
IMPORTING
|
|
64071
|
+
badExample: `
|
|
64072
|
+
METHODS apps_scope_token
|
|
64073
|
+
IMPORTING
|
|
64024
64074
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
64025
|
-
goodExample: `
|
|
64026
|
-
METHODS apps_scope_token
|
|
64027
|
-
IMPORTING
|
|
64028
|
-
body TYPE bodyapps_scope_token
|
|
64075
|
+
goodExample: `
|
|
64076
|
+
METHODS apps_scope_token
|
|
64077
|
+
IMPORTING
|
|
64078
|
+
body TYPE bodyapps_scope_token
|
|
64029
64079
|
client_id TYPE str.`,
|
|
64030
64080
|
};
|
|
64031
64081
|
}
|
|
@@ -64090,11 +64140,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
64090
64140
|
key: "max_one_statement",
|
|
64091
64141
|
title: "Max one statement per line",
|
|
64092
64142
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
64093
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64094
|
-
|
|
64095
|
-
Does not report anything for chained statements.
|
|
64096
|
-
|
|
64097
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64143
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
64144
|
+
|
|
64145
|
+
Does not report anything for chained statements.
|
|
64146
|
+
|
|
64147
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
64098
64148
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
64099
64149
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64100
64150
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -64432,8 +64482,8 @@ class MethodLength {
|
|
|
64432
64482
|
key: "method_length",
|
|
64433
64483
|
title: "Method/Form Length",
|
|
64434
64484
|
shortDescription: `Checks relating to method/form length.`,
|
|
64435
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64436
|
-
|
|
64485
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
64486
|
+
|
|
64437
64487
|
Abstract methods without statements are considered okay.`,
|
|
64438
64488
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64439
64489
|
};
|
|
@@ -64538,20 +64588,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
64538
64588
|
key: "method_overwrites_builtin",
|
|
64539
64589
|
title: "Method name overwrites builtin function",
|
|
64540
64590
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
64541
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64542
|
-
|
|
64543
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64544
|
-
|
|
64591
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
64592
|
+
|
|
64593
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
64594
|
+
|
|
64545
64595
|
Interface method names are ignored`,
|
|
64546
64596
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
64547
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64548
|
-
PUBLIC SECTION.
|
|
64549
|
-
METHODS matches.
|
|
64550
|
-
ENDCLASS.
|
|
64551
|
-
|
|
64552
|
-
CLASS lcl IMPLEMENTATION.
|
|
64553
|
-
METHOD matches.
|
|
64554
|
-
ENDMETHOD.
|
|
64597
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64598
|
+
PUBLIC SECTION.
|
|
64599
|
+
METHODS matches.
|
|
64600
|
+
ENDCLASS.
|
|
64601
|
+
|
|
64602
|
+
CLASS lcl IMPLEMENTATION.
|
|
64603
|
+
METHOD matches.
|
|
64604
|
+
ENDMETHOD.
|
|
64555
64605
|
ENDCLASS.`,
|
|
64556
64606
|
};
|
|
64557
64607
|
}
|
|
@@ -64742,12 +64792,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
64742
64792
|
// eslint-disable-next-line max-len
|
|
64743
64793
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
64744
64794
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
64745
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64746
|
-
PUBLIC SECTION.
|
|
64747
|
-
METHODS
|
|
64748
|
-
foobar
|
|
64749
|
-
EXPORTING foo TYPE i
|
|
64750
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
64795
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64796
|
+
PUBLIC SECTION.
|
|
64797
|
+
METHODS
|
|
64798
|
+
foobar
|
|
64799
|
+
EXPORTING foo TYPE i
|
|
64800
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
64751
64801
|
ENDCLASS.`,
|
|
64752
64802
|
};
|
|
64753
64803
|
}
|
|
@@ -65127,7 +65177,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
65127
65177
|
key: "nesting",
|
|
65128
65178
|
title: "Check nesting depth",
|
|
65129
65179
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
65130
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65180
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
65131
65181
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
65132
65182
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65133
65183
|
};
|
|
@@ -65370,7 +65420,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
65370
65420
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
65371
65421
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65372
65422
|
badExample: `var1 = var2 = var3.`,
|
|
65373
|
-
goodExample: `var2 = var3.
|
|
65423
|
+
goodExample: `var2 = var3.
|
|
65374
65424
|
var1 = var2.`,
|
|
65375
65425
|
};
|
|
65376
65426
|
}
|
|
@@ -65429,8 +65479,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
65429
65479
|
key: "no_external_form_calls",
|
|
65430
65480
|
title: "No external FORM calls",
|
|
65431
65481
|
shortDescription: `Detect external form calls`,
|
|
65432
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65433
|
-
|
|
65482
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
65483
|
+
|
|
65434
65484
|
PERFORM foo(bar).`,
|
|
65435
65485
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65436
65486
|
};
|
|
@@ -65491,17 +65541,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
65491
65541
|
key: "no_inline_in_optional_branches",
|
|
65492
65542
|
title: "Don't declare inline in optional branches",
|
|
65493
65543
|
shortDescription: `Don't declare inline in optional branches`,
|
|
65494
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65495
|
-
|
|
65496
|
-
Considered optional branches:
|
|
65497
|
-
* inside IF/ELSEIF/ELSE
|
|
65498
|
-
* inside LOOP
|
|
65499
|
-
* inside WHILE
|
|
65500
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
65501
|
-
* inside DO
|
|
65502
|
-
* inside SELECT loops
|
|
65503
|
-
|
|
65504
|
-
Not considered optional branches:
|
|
65544
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
65545
|
+
|
|
65546
|
+
Considered optional branches:
|
|
65547
|
+
* inside IF/ELSEIF/ELSE
|
|
65548
|
+
* inside LOOP
|
|
65549
|
+
* inside WHILE
|
|
65550
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
65551
|
+
* inside DO
|
|
65552
|
+
* inside SELECT loops
|
|
65553
|
+
|
|
65554
|
+
Not considered optional branches:
|
|
65505
65555
|
* TRY/CATCH/CLEANUP`,
|
|
65506
65556
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65507
65557
|
};
|
|
@@ -65601,12 +65651,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
65601
65651
|
key: "no_prefixes",
|
|
65602
65652
|
title: "No Prefixes",
|
|
65603
65653
|
shortDescription: `Dont use hungarian notation`,
|
|
65604
|
-
extendedInformation: `
|
|
65605
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65606
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65607
|
-
|
|
65608
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65609
|
-
|
|
65654
|
+
extendedInformation: `
|
|
65655
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
65656
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
65657
|
+
|
|
65658
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
65659
|
+
|
|
65610
65660
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
65611
65661
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65612
65662
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -65785,7 +65835,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
65785
65835
|
return {
|
|
65786
65836
|
key: "no_public_attributes",
|
|
65787
65837
|
title: "No public attributes",
|
|
65788
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65838
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
65789
65839
|
Exceptions are excluded from this rule.`,
|
|
65790
65840
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
65791
65841
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -65886,13 +65936,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
65886
65936
|
key: "no_yoda_conditions",
|
|
65887
65937
|
title: "No Yoda conditions",
|
|
65888
65938
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
65889
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65890
|
-
|
|
65939
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
65940
|
+
|
|
65891
65941
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
65892
65942
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65893
|
-
badExample: `IF 0 <> sy-subrc.
|
|
65943
|
+
badExample: `IF 0 <> sy-subrc.
|
|
65894
65944
|
ENDIF.`,
|
|
65895
|
-
goodExample: `IF sy-subrc <> 0.
|
|
65945
|
+
goodExample: `IF sy-subrc <> 0.
|
|
65896
65946
|
ENDIF.`,
|
|
65897
65947
|
};
|
|
65898
65948
|
}
|
|
@@ -65993,8 +66043,8 @@ class NROBConsistency {
|
|
|
65993
66043
|
key: "nrob_consistency",
|
|
65994
66044
|
title: "Number range consistency",
|
|
65995
66045
|
shortDescription: `Consistency checks for number ranges`,
|
|
65996
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
65997
|
-
|
|
66046
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
66047
|
+
|
|
65998
66048
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
65999
66049
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66000
66050
|
};
|
|
@@ -66271,58 +66321,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
66271
66321
|
title: "Obsolete statements",
|
|
66272
66322
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
66273
66323
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66274
|
-
extendedInformation: `
|
|
66275
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66276
|
-
|
|
66277
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66278
|
-
|
|
66279
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66280
|
-
|
|
66281
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66282
|
-
|
|
66283
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66284
|
-
|
|
66285
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66286
|
-
|
|
66287
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66288
|
-
|
|
66289
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66290
|
-
|
|
66291
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66292
|
-
|
|
66293
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66294
|
-
|
|
66295
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66296
|
-
|
|
66297
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66298
|
-
|
|
66299
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66300
|
-
|
|
66301
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66302
|
-
|
|
66303
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66304
|
-
SELECT COUNT(*) is considered okay
|
|
66305
|
-
|
|
66306
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66307
|
-
|
|
66308
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66309
|
-
|
|
66310
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66311
|
-
|
|
66312
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66313
|
-
|
|
66314
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66315
|
-
|
|
66324
|
+
extendedInformation: `
|
|
66325
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
66326
|
+
|
|
66327
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
66328
|
+
|
|
66329
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
66330
|
+
|
|
66331
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
66332
|
+
|
|
66333
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
66334
|
+
|
|
66335
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
66336
|
+
|
|
66337
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66338
|
+
|
|
66339
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
66340
|
+
|
|
66341
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
66342
|
+
|
|
66343
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
66344
|
+
|
|
66345
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
66346
|
+
|
|
66347
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
66348
|
+
|
|
66349
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
66350
|
+
|
|
66351
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
66352
|
+
|
|
66353
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
66354
|
+
SELECT COUNT(*) is considered okay
|
|
66355
|
+
|
|
66356
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
66357
|
+
|
|
66358
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
66359
|
+
|
|
66360
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
66361
|
+
|
|
66362
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
66363
|
+
|
|
66364
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
66365
|
+
|
|
66316
66366
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
66317
|
-
badExample: `REFRESH itab.
|
|
66318
|
-
|
|
66319
|
-
COMPUTE foo = 2 + 2.
|
|
66320
|
-
|
|
66321
|
-
MULTIPLY lv_foo BY 2.
|
|
66322
|
-
|
|
66323
|
-
INTERFACE intf LOAD.
|
|
66324
|
-
|
|
66325
|
-
IF foo IS SUPPLIED.
|
|
66367
|
+
badExample: `REFRESH itab.
|
|
66368
|
+
|
|
66369
|
+
COMPUTE foo = 2 + 2.
|
|
66370
|
+
|
|
66371
|
+
MULTIPLY lv_foo BY 2.
|
|
66372
|
+
|
|
66373
|
+
INTERFACE intf LOAD.
|
|
66374
|
+
|
|
66375
|
+
IF foo IS SUPPLIED.
|
|
66326
66376
|
ENDIF.`,
|
|
66327
66377
|
};
|
|
66328
66378
|
}
|
|
@@ -66662,9 +66712,9 @@ class OmitParameterName {
|
|
|
66662
66712
|
key: "omit_parameter_name",
|
|
66663
66713
|
title: "Omit parameter name",
|
|
66664
66714
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
66665
|
-
extendedInformation: `
|
|
66666
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
66667
|
-
|
|
66715
|
+
extendedInformation: `
|
|
66716
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
66717
|
+
|
|
66668
66718
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
66669
66719
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
66670
66720
|
badExample: `method( param = 2 ).`,
|
|
@@ -66870,20 +66920,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
66870
66920
|
shortDescription: `Omit RECEIVING`,
|
|
66871
66921
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
66872
66922
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66873
|
-
badExample: `
|
|
66874
|
-
upload_pack(
|
|
66875
|
-
EXPORTING
|
|
66876
|
-
io_client = lo_client
|
|
66877
|
-
iv_url = iv_url
|
|
66878
|
-
iv_deepen_level = iv_deepen_level
|
|
66879
|
-
it_hashes = lt_hashes
|
|
66880
|
-
RECEIVING
|
|
66923
|
+
badExample: `
|
|
66924
|
+
upload_pack(
|
|
66925
|
+
EXPORTING
|
|
66926
|
+
io_client = lo_client
|
|
66927
|
+
iv_url = iv_url
|
|
66928
|
+
iv_deepen_level = iv_deepen_level
|
|
66929
|
+
it_hashes = lt_hashes
|
|
66930
|
+
RECEIVING
|
|
66881
66931
|
rt_objects = et_objects ).`,
|
|
66882
|
-
goodExample: `
|
|
66883
|
-
et_objects = upload_pack(
|
|
66884
|
-
io_client = lo_client
|
|
66885
|
-
iv_url = iv_url
|
|
66886
|
-
iv_deepen_level = iv_deepen_level
|
|
66932
|
+
goodExample: `
|
|
66933
|
+
et_objects = upload_pack(
|
|
66934
|
+
io_client = lo_client
|
|
66935
|
+
iv_url = iv_url
|
|
66936
|
+
iv_deepen_level = iv_deepen_level
|
|
66887
66937
|
it_hashes = lt_hashes ).`,
|
|
66888
66938
|
};
|
|
66889
66939
|
}
|
|
@@ -66947,8 +66997,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
66947
66997
|
return {
|
|
66948
66998
|
key: "parser_702_chaining",
|
|
66949
66999
|
title: "Parser Error, bad chanining on 702",
|
|
66950
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
66951
|
-
this rule finds these and reports errors.
|
|
67000
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
67001
|
+
this rule finds these and reports errors.
|
|
66952
67002
|
Only active on target version 702 and below.`,
|
|
66953
67003
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
66954
67004
|
};
|
|
@@ -67028,8 +67078,8 @@ class ParserError {
|
|
|
67028
67078
|
return {
|
|
67029
67079
|
key: "parser_error",
|
|
67030
67080
|
title: "Parser error",
|
|
67031
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67032
|
-
|
|
67081
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
67082
|
+
|
|
67033
67083
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
67034
67084
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
67035
67085
|
};
|
|
@@ -67114,7 +67164,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
67114
67164
|
return {
|
|
67115
67165
|
key: "parser_missing_space",
|
|
67116
67166
|
title: "Parser Error, missing space",
|
|
67117
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67167
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
67118
67168
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
67119
67169
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
67120
67170
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -67526,25 +67576,25 @@ class PreferInline {
|
|
|
67526
67576
|
key: "prefer_inline",
|
|
67527
67577
|
title: "Prefer Inline Declarations",
|
|
67528
67578
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
67529
|
-
extendedInformation: `EXPERIMENTAL
|
|
67530
|
-
|
|
67531
|
-
Activates if language version is v740sp02 or above.
|
|
67532
|
-
|
|
67533
|
-
Variables must be local(METHOD or FORM).
|
|
67534
|
-
|
|
67535
|
-
No generic or void typed variables. No syntax errors.
|
|
67536
|
-
|
|
67537
|
-
First position used must be a full/pure write.
|
|
67538
|
-
|
|
67539
|
-
Move statment is not a cast(?=)
|
|
67540
|
-
|
|
67579
|
+
extendedInformation: `EXPERIMENTAL
|
|
67580
|
+
|
|
67581
|
+
Activates if language version is v740sp02 or above.
|
|
67582
|
+
|
|
67583
|
+
Variables must be local(METHOD or FORM).
|
|
67584
|
+
|
|
67585
|
+
No generic or void typed variables. No syntax errors.
|
|
67586
|
+
|
|
67587
|
+
First position used must be a full/pure write.
|
|
67588
|
+
|
|
67589
|
+
Move statment is not a cast(?=)
|
|
67590
|
+
|
|
67541
67591
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
67542
67592
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
67543
|
-
badExample: `DATA foo TYPE i.
|
|
67544
|
-
foo = 2.
|
|
67545
|
-
DATA percentage TYPE decfloat34.
|
|
67593
|
+
badExample: `DATA foo TYPE i.
|
|
67594
|
+
foo = 2.
|
|
67595
|
+
DATA percentage TYPE decfloat34.
|
|
67546
67596
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
67547
|
-
goodExample: `DATA(foo) = 2.
|
|
67597
|
+
goodExample: `DATA(foo) = 2.
|
|
67548
67598
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
67549
67599
|
};
|
|
67550
67600
|
}
|
|
@@ -67758,18 +67808,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
67758
67808
|
key: "prefer_is_not",
|
|
67759
67809
|
title: "Prefer IS NOT to NOT IS",
|
|
67760
67810
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
67761
|
-
extendedInformation: `
|
|
67762
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67763
|
-
|
|
67811
|
+
extendedInformation: `
|
|
67812
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
67813
|
+
|
|
67764
67814
|
"if not is_valid( )." examples are skipped`,
|
|
67765
67815
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
67766
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
67767
|
-
IF variable NP 'TODO*'.
|
|
67768
|
-
IF variable <> 42.
|
|
67816
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
67817
|
+
IF variable NP 'TODO*'.
|
|
67818
|
+
IF variable <> 42.
|
|
67769
67819
|
IF variable CO 'hello'.`,
|
|
67770
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
67771
|
-
IF NOT variable CP 'TODO*'.
|
|
67772
|
-
IF NOT variable = 42.
|
|
67820
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
67821
|
+
IF NOT variable CP 'TODO*'.
|
|
67822
|
+
IF NOT variable = 42.
|
|
67773
67823
|
IF NOT variable CA 'hello'.`,
|
|
67774
67824
|
};
|
|
67775
67825
|
}
|
|
@@ -67957,14 +68007,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
67957
68007
|
key: "prefer_raise_exception_new",
|
|
67958
68008
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
67959
68009
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
67960
|
-
extendedInformation: `
|
|
67961
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
67962
|
-
|
|
68010
|
+
extendedInformation: `
|
|
68011
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
68012
|
+
|
|
67963
68013
|
From 752 and up`,
|
|
67964
68014
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
67965
68015
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
67966
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
67967
|
-
EXPORTING
|
|
68016
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
68017
|
+
EXPORTING
|
|
67968
68018
|
previous = exception.`,
|
|
67969
68019
|
};
|
|
67970
68020
|
}
|
|
@@ -68042,12 +68092,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
68042
68092
|
key: "prefer_returning_to_exporting",
|
|
68043
68093
|
title: "Prefer RETURNING to EXPORTING",
|
|
68044
68094
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
68045
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68095
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
68046
68096
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
68047
68097
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68048
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68049
|
-
PUBLIC SECTION.
|
|
68050
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
68098
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68099
|
+
PUBLIC SECTION.
|
|
68100
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
68051
68101
|
ENDCLASS.`,
|
|
68052
68102
|
};
|
|
68053
68103
|
}
|
|
@@ -68143,8 +68193,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
68143
68193
|
key: "prefer_xsdbool",
|
|
68144
68194
|
title: "Prefer xsdbool over boolc",
|
|
68145
68195
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
68146
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68147
|
-
|
|
68196
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
68197
|
+
|
|
68148
68198
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
68149
68199
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68150
68200
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -68216,9 +68266,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
68216
68266
|
title: "Preferred compare operator",
|
|
68217
68267
|
shortDescription: `Configure undesired operator variants`,
|
|
68218
68268
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68219
|
-
badExample: `IF foo EQ bar.
|
|
68269
|
+
badExample: `IF foo EQ bar.
|
|
68220
68270
|
ENDIF.`,
|
|
68221
|
-
goodExample: `IF foo = bar.
|
|
68271
|
+
goodExample: `IF foo = bar.
|
|
68222
68272
|
ENDIF.`,
|
|
68223
68273
|
};
|
|
68224
68274
|
}
|
|
@@ -68442,26 +68492,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
68442
68492
|
key: "reduce_procedural_code",
|
|
68443
68493
|
title: "Reduce procedural code",
|
|
68444
68494
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
68445
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68446
|
-
|
|
68447
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68448
|
-
|
|
68495
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
68496
|
+
|
|
68497
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
68498
|
+
|
|
68449
68499
|
Comments are not counted as statements.`,
|
|
68450
68500
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68451
|
-
badExample: `FORM foo.
|
|
68452
|
-
DATA lv_bar TYPE i.
|
|
68453
|
-
lv_bar = 2 + 2.
|
|
68454
|
-
IF lv_bar = 4.
|
|
68455
|
-
WRITE 'hello world'.
|
|
68456
|
-
ENDIF.
|
|
68457
|
-
DATA lv_bar TYPE i.
|
|
68458
|
-
lv_bar = 2 + 2.
|
|
68459
|
-
IF lv_bar = 4.
|
|
68460
|
-
WRITE 'hello world'.
|
|
68461
|
-
ENDIF.
|
|
68501
|
+
badExample: `FORM foo.
|
|
68502
|
+
DATA lv_bar TYPE i.
|
|
68503
|
+
lv_bar = 2 + 2.
|
|
68504
|
+
IF lv_bar = 4.
|
|
68505
|
+
WRITE 'hello world'.
|
|
68506
|
+
ENDIF.
|
|
68507
|
+
DATA lv_bar TYPE i.
|
|
68508
|
+
lv_bar = 2 + 2.
|
|
68509
|
+
IF lv_bar = 4.
|
|
68510
|
+
WRITE 'hello world'.
|
|
68511
|
+
ENDIF.
|
|
68462
68512
|
ENDFORM.`,
|
|
68463
|
-
goodExample: `FORM foo.
|
|
68464
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
68513
|
+
goodExample: `FORM foo.
|
|
68514
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
68465
68515
|
ENDFORM.`,
|
|
68466
68516
|
};
|
|
68467
68517
|
}
|
|
@@ -68705,10 +68755,10 @@ class RemoveDescriptions {
|
|
|
68705
68755
|
return {
|
|
68706
68756
|
key: "remove_descriptions",
|
|
68707
68757
|
title: "Remove descriptions",
|
|
68708
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
68709
|
-
|
|
68710
|
-
Class descriptions are required, see rule description_empty.
|
|
68711
|
-
|
|
68758
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
68759
|
+
|
|
68760
|
+
Class descriptions are required, see rule description_empty.
|
|
68761
|
+
|
|
68712
68762
|
Consider using ABAP Doc for documentation.`,
|
|
68713
68763
|
tags: [],
|
|
68714
68764
|
};
|
|
@@ -68833,16 +68883,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
68833
68883
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68834
68884
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
68835
68885
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
68836
|
-
badExample: `
|
|
68837
|
-
CALL FUNCTION 'ZRFC'
|
|
68886
|
+
badExample: `
|
|
68887
|
+
CALL FUNCTION 'ZRFC'
|
|
68838
68888
|
DESTINATION lv_rfc.`,
|
|
68839
|
-
goodExample: `
|
|
68840
|
-
CALL FUNCTION 'ZRFC'
|
|
68841
|
-
DESTINATION lv_rfc
|
|
68842
|
-
EXCEPTIONS
|
|
68843
|
-
system_failure = 1 MESSAGE msg
|
|
68844
|
-
communication_failure = 2 MESSAGE msg
|
|
68845
|
-
resource_failure = 3
|
|
68889
|
+
goodExample: `
|
|
68890
|
+
CALL FUNCTION 'ZRFC'
|
|
68891
|
+
DESTINATION lv_rfc
|
|
68892
|
+
EXCEPTIONS
|
|
68893
|
+
system_failure = 1 MESSAGE msg
|
|
68894
|
+
communication_failure = 2 MESSAGE msg
|
|
68895
|
+
resource_failure = 3
|
|
68846
68896
|
OTHERS = 4.`,
|
|
68847
68897
|
};
|
|
68848
68898
|
}
|
|
@@ -68926,11 +68976,11 @@ class SelectAddOrderBy {
|
|
|
68926
68976
|
key: "select_add_order_by",
|
|
68927
68977
|
title: "SELECT add ORDER BY",
|
|
68928
68978
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
68929
|
-
extendedInformation: `
|
|
68930
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68931
|
-
|
|
68932
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
68933
|
-
|
|
68979
|
+
extendedInformation: `
|
|
68980
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
68981
|
+
|
|
68982
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
68983
|
+
|
|
68934
68984
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
68935
68985
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68936
68986
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -69061,14 +69111,14 @@ class SelectPerformance {
|
|
|
69061
69111
|
key: "select_performance",
|
|
69062
69112
|
title: "SELECT performance",
|
|
69063
69113
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
69064
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69065
|
-
|
|
69114
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
69115
|
+
|
|
69066
69116
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
69067
69117
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
69068
|
-
badExample: `SELECT field1, field2 FROM table
|
|
69069
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69118
|
+
badExample: `SELECT field1, field2 FROM table
|
|
69119
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
69070
69120
|
ENDSELECT.`,
|
|
69071
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69121
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
69072
69122
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
69073
69123
|
};
|
|
69074
69124
|
}
|
|
@@ -69180,8 +69230,8 @@ class SelectSingleFullKey {
|
|
|
69180
69230
|
key: "select_single_full_key",
|
|
69181
69231
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
69182
69232
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
69183
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69184
|
-
|
|
69233
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
69234
|
+
|
|
69185
69235
|
If the statement contains a JOIN it is not checked`,
|
|
69186
69236
|
pseudoComment: "EC CI_NOORDER",
|
|
69187
69237
|
tags: [],
|
|
@@ -69598,8 +69648,8 @@ class SICFConsistency {
|
|
|
69598
69648
|
key: "sicf_consistency",
|
|
69599
69649
|
title: "SICF consistency",
|
|
69600
69650
|
shortDescription: `Checks the validity of ICF services`,
|
|
69601
|
-
extendedInformation: `* Class defined in handler must exist
|
|
69602
|
-
* Class must not have any syntax errors
|
|
69651
|
+
extendedInformation: `* Class defined in handler must exist
|
|
69652
|
+
* Class must not have any syntax errors
|
|
69603
69653
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
69604
69654
|
};
|
|
69605
69655
|
}
|
|
@@ -69711,23 +69761,23 @@ class SlowParameterPassing {
|
|
|
69711
69761
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
69712
69762
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
69713
69763
|
tags: [_irule_1.RuleTag.Performance],
|
|
69714
|
-
badExample: `CLASS lcl DEFINITION.
|
|
69715
|
-
PUBLIC SECTION.
|
|
69716
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
69717
|
-
ENDCLASS.
|
|
69718
|
-
CLASS lcl IMPLEMENTATION.
|
|
69719
|
-
METHOD bar.
|
|
69720
|
-
WRITE sdf.
|
|
69721
|
-
ENDMETHOD.
|
|
69764
|
+
badExample: `CLASS lcl DEFINITION.
|
|
69765
|
+
PUBLIC SECTION.
|
|
69766
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
69767
|
+
ENDCLASS.
|
|
69768
|
+
CLASS lcl IMPLEMENTATION.
|
|
69769
|
+
METHOD bar.
|
|
69770
|
+
WRITE sdf.
|
|
69771
|
+
ENDMETHOD.
|
|
69722
69772
|
ENDCLASS.`,
|
|
69723
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
69724
|
-
PUBLIC SECTION.
|
|
69725
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
69726
|
-
ENDCLASS.
|
|
69727
|
-
CLASS lcl IMPLEMENTATION.
|
|
69728
|
-
METHOD bar.
|
|
69729
|
-
WRITE sdf.
|
|
69730
|
-
ENDMETHOD.
|
|
69773
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
69774
|
+
PUBLIC SECTION.
|
|
69775
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
69776
|
+
ENDCLASS.
|
|
69777
|
+
CLASS lcl IMPLEMENTATION.
|
|
69778
|
+
METHOD bar.
|
|
69779
|
+
WRITE sdf.
|
|
69780
|
+
ENDMETHOD.
|
|
69731
69781
|
ENDCLASS.`,
|
|
69732
69782
|
};
|
|
69733
69783
|
}
|
|
@@ -69984,8 +70034,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
69984
70034
|
key: "space_before_dot",
|
|
69985
70035
|
title: "Space before dot",
|
|
69986
70036
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
69987
|
-
extendedInformation: `
|
|
69988
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
70037
|
+
extendedInformation: `
|
|
70038
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
69989
70039
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
69990
70040
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69991
70041
|
badExample: `WRITE bar .`,
|
|
@@ -70171,12 +70221,12 @@ class SQLValueConversion {
|
|
|
70171
70221
|
key: "sql_value_conversion",
|
|
70172
70222
|
title: "Implicit SQL Value Conversion",
|
|
70173
70223
|
shortDescription: `Ensure types match when selecting from database`,
|
|
70174
|
-
extendedInformation: `
|
|
70175
|
-
* Integer to CHAR conversion
|
|
70176
|
-
* Integer to NUMC conversion
|
|
70177
|
-
* NUMC to Integer conversion
|
|
70178
|
-
* CHAR to Integer conversion
|
|
70179
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
70224
|
+
extendedInformation: `
|
|
70225
|
+
* Integer to CHAR conversion
|
|
70226
|
+
* Integer to NUMC conversion
|
|
70227
|
+
* NUMC to Integer conversion
|
|
70228
|
+
* CHAR to Integer conversion
|
|
70229
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
70180
70230
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
70181
70231
|
tags: [],
|
|
70182
70232
|
};
|
|
@@ -70248,7 +70298,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
70248
70298
|
key: "start_at_tab",
|
|
70249
70299
|
title: "Start at tab",
|
|
70250
70300
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
70251
|
-
extendedInformation: `Reports max 100 issues per file
|
|
70301
|
+
extendedInformation: `Reports max 100 issues per file
|
|
70252
70302
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
70253
70303
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70254
70304
|
badExample: ` WRITE a.`,
|
|
@@ -70425,12 +70475,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
70425
70475
|
key: "strict_sql",
|
|
70426
70476
|
title: "Strict SQL",
|
|
70427
70477
|
shortDescription: `Strict SQL`,
|
|
70428
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70429
|
-
|
|
70430
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70431
|
-
|
|
70432
|
-
Also see separate rule sql_escape_host_variables
|
|
70433
|
-
|
|
70478
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
70479
|
+
|
|
70480
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
70481
|
+
|
|
70482
|
+
Also see separate rule sql_escape_host_variables
|
|
70483
|
+
|
|
70434
70484
|
Activates from v750 and up`,
|
|
70435
70485
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
70436
70486
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -70684,11 +70734,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
70684
70734
|
key: "sy_modification",
|
|
70685
70735
|
title: "Modification of SY fields",
|
|
70686
70736
|
shortDescription: `Finds modification of sy fields`,
|
|
70687
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
70688
|
-
|
|
70737
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
70738
|
+
|
|
70689
70739
|
Changes to SY-TVAR* fields are not reported`,
|
|
70690
70740
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70691
|
-
badExample: `sy-uname = 2.
|
|
70741
|
+
badExample: `sy-uname = 2.
|
|
70692
70742
|
sy = sy.`,
|
|
70693
70743
|
};
|
|
70694
70744
|
}
|
|
@@ -70750,8 +70800,8 @@ class TABLEnhancementCategory {
|
|
|
70750
70800
|
key: "tabl_enhancement_category",
|
|
70751
70801
|
title: "TABL enhancement category must be set",
|
|
70752
70802
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
70753
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
70754
|
-
|
|
70803
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
70804
|
+
|
|
70755
70805
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
70756
70806
|
tags: [],
|
|
70757
70807
|
};
|
|
@@ -70879,9 +70929,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
70879
70929
|
title: "Type FORM parameters",
|
|
70880
70930
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
70881
70931
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70882
|
-
badExample: `FORM foo USING bar.
|
|
70932
|
+
badExample: `FORM foo USING bar.
|
|
70883
70933
|
ENDFORM.`,
|
|
70884
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
70934
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
70885
70935
|
ENDFORM.`,
|
|
70886
70936
|
};
|
|
70887
70937
|
}
|
|
@@ -71554,38 +71604,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
71554
71604
|
key: "unnecessary_pragma",
|
|
71555
71605
|
title: "Unnecessary Pragma",
|
|
71556
71606
|
shortDescription: `Finds pragmas which can be removed`,
|
|
71557
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
71558
|
-
|
|
71559
|
-
* NEEDED without definition
|
|
71560
|
-
|
|
71561
|
-
* NO_TEXT without texts
|
|
71562
|
-
|
|
71563
|
-
* SUBRC_OK where sy-subrc is checked
|
|
71564
|
-
|
|
71607
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
71608
|
+
|
|
71609
|
+
* NEEDED without definition
|
|
71610
|
+
|
|
71611
|
+
* NO_TEXT without texts
|
|
71612
|
+
|
|
71613
|
+
* SUBRC_OK where sy-subrc is checked
|
|
71614
|
+
|
|
71565
71615
|
NO_HANDLER inside macros are not checked`,
|
|
71566
71616
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71567
|
-
badExample: `TRY.
|
|
71568
|
-
...
|
|
71569
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71570
|
-
RETURN. " it has a handler
|
|
71571
|
-
ENDTRY.
|
|
71572
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71573
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71574
|
-
IF sy-subrc <> 0.
|
|
71617
|
+
badExample: `TRY.
|
|
71618
|
+
...
|
|
71619
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
71620
|
+
RETURN. " it has a handler
|
|
71621
|
+
ENDTRY.
|
|
71622
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
71623
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
71624
|
+
IF sy-subrc <> 0.
|
|
71575
71625
|
ENDIF.`,
|
|
71576
|
-
goodExample: `TRY.
|
|
71577
|
-
...
|
|
71578
|
-
CATCH zcx_abapgit_exception.
|
|
71579
|
-
RETURN.
|
|
71580
|
-
ENDTRY.
|
|
71581
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71582
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71583
|
-
IF sy-subrc <> 0.
|
|
71584
|
-
ENDIF.
|
|
71585
|
-
|
|
71586
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
71587
|
-
test1 TYPE string,
|
|
71588
|
-
test2 TYPE string,
|
|
71626
|
+
goodExample: `TRY.
|
|
71627
|
+
...
|
|
71628
|
+
CATCH zcx_abapgit_exception.
|
|
71629
|
+
RETURN.
|
|
71630
|
+
ENDTRY.
|
|
71631
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
71632
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
71633
|
+
IF sy-subrc <> 0.
|
|
71634
|
+
ENDIF.
|
|
71635
|
+
|
|
71636
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
71637
|
+
test1 TYPE string,
|
|
71638
|
+
test2 TYPE string,
|
|
71589
71639
|
END OF blah.`,
|
|
71590
71640
|
};
|
|
71591
71641
|
}
|
|
@@ -71746,18 +71796,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
71746
71796
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
71747
71797
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
71748
71798
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
71749
|
-
badExample: `FORM hello1.
|
|
71750
|
-
WRITE 'world'.
|
|
71751
|
-
RETURN.
|
|
71752
|
-
ENDFORM.
|
|
71753
|
-
|
|
71754
|
-
FORM foo.
|
|
71755
|
-
IF 1 = 2.
|
|
71756
|
-
RETURN.
|
|
71757
|
-
ENDIF.
|
|
71799
|
+
badExample: `FORM hello1.
|
|
71800
|
+
WRITE 'world'.
|
|
71801
|
+
RETURN.
|
|
71802
|
+
ENDFORM.
|
|
71803
|
+
|
|
71804
|
+
FORM foo.
|
|
71805
|
+
IF 1 = 2.
|
|
71806
|
+
RETURN.
|
|
71807
|
+
ENDIF.
|
|
71758
71808
|
ENDFORM.`,
|
|
71759
|
-
goodExample: `FORM hello2.
|
|
71760
|
-
WRITE 'world'.
|
|
71809
|
+
goodExample: `FORM hello2.
|
|
71810
|
+
WRITE 'world'.
|
|
71761
71811
|
ENDFORM.`,
|
|
71762
71812
|
};
|
|
71763
71813
|
}
|
|
@@ -72124,17 +72174,17 @@ class UnusedMethods {
|
|
|
72124
72174
|
key: "unused_methods",
|
|
72125
72175
|
title: "Unused methods",
|
|
72126
72176
|
shortDescription: `Checks for unused methods`,
|
|
72127
|
-
extendedInformation: `Checks private and protected methods.
|
|
72128
|
-
|
|
72129
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72130
|
-
|
|
72131
|
-
Skips:
|
|
72132
|
-
* methods FOR TESTING
|
|
72133
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72134
|
-
* class_constructor + constructor methods
|
|
72135
|
-
* event handlers
|
|
72136
|
-
* methods that are redefined
|
|
72137
|
-
* INCLUDEs
|
|
72177
|
+
extendedInformation: `Checks private and protected methods.
|
|
72178
|
+
|
|
72179
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
72180
|
+
|
|
72181
|
+
Skips:
|
|
72182
|
+
* methods FOR TESTING
|
|
72183
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
72184
|
+
* class_constructor + constructor methods
|
|
72185
|
+
* event handlers
|
|
72186
|
+
* methods that are redefined
|
|
72187
|
+
* INCLUDEs
|
|
72138
72188
|
`,
|
|
72139
72189
|
tags: [],
|
|
72140
72190
|
pragma: "##CALLED",
|
|
@@ -72568,23 +72618,23 @@ class UnusedVariables {
|
|
|
72568
72618
|
key: "unused_variables",
|
|
72569
72619
|
title: "Unused variables",
|
|
72570
72620
|
shortDescription: `Checks for unused variables and constants`,
|
|
72571
|
-
extendedInformation: `Skips event parameters.
|
|
72572
|
-
|
|
72573
|
-
Note that this currently does not work if the source code uses macros.
|
|
72574
|
-
|
|
72575
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
72576
|
-
|
|
72621
|
+
extendedInformation: `Skips event parameters.
|
|
72622
|
+
|
|
72623
|
+
Note that this currently does not work if the source code uses macros.
|
|
72624
|
+
|
|
72625
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
72626
|
+
|
|
72577
72627
|
Errors found in INCLUDES are reported for the main program.`,
|
|
72578
72628
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
72579
72629
|
pragma: "##NEEDED",
|
|
72580
72630
|
pseudoComment: "EC NEEDED",
|
|
72581
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
72582
|
-
test TYPE string,
|
|
72583
|
-
test2 TYPE string,
|
|
72631
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
72632
|
+
test TYPE string,
|
|
72633
|
+
test2 TYPE string,
|
|
72584
72634
|
END OF blah1.`,
|
|
72585
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
72586
|
-
test TYPE string,
|
|
72587
|
-
test2 TYPE string,
|
|
72635
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
72636
|
+
test TYPE string,
|
|
72637
|
+
test2 TYPE string,
|
|
72588
72638
|
END OF blah2.`,
|
|
72589
72639
|
};
|
|
72590
72640
|
}
|
|
@@ -72803,15 +72853,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
72803
72853
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
72804
72854
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
72805
72855
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
72806
|
-
badExample: `IF line IS INITIAL.
|
|
72807
|
-
has_entries = abap_false.
|
|
72808
|
-
ELSE.
|
|
72809
|
-
has_entries = abap_true.
|
|
72810
|
-
ENDIF.
|
|
72811
|
-
|
|
72856
|
+
badExample: `IF line IS INITIAL.
|
|
72857
|
+
has_entries = abap_false.
|
|
72858
|
+
ELSE.
|
|
72859
|
+
has_entries = abap_true.
|
|
72860
|
+
ENDIF.
|
|
72861
|
+
|
|
72812
72862
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
72813
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
72814
|
-
|
|
72863
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
72864
|
+
|
|
72815
72865
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
72816
72866
|
};
|
|
72817
72867
|
}
|
|
@@ -72929,15 +72979,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
72929
72979
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
72930
72980
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
72931
72981
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72932
|
-
badExample: `INTERFACE lif.
|
|
72933
|
-
METHODS load_data
|
|
72934
|
-
EXCEPTIONS
|
|
72935
|
-
invalid_parameter.
|
|
72982
|
+
badExample: `INTERFACE lif.
|
|
72983
|
+
METHODS load_data
|
|
72984
|
+
EXCEPTIONS
|
|
72985
|
+
invalid_parameter.
|
|
72936
72986
|
ENDINTERFACE.`,
|
|
72937
|
-
goodExample: `INTERFACE lif.
|
|
72938
|
-
METHODS load_data
|
|
72939
|
-
RAISING
|
|
72940
|
-
cx_something.
|
|
72987
|
+
goodExample: `INTERFACE lif.
|
|
72988
|
+
METHODS load_data
|
|
72989
|
+
RAISING
|
|
72990
|
+
cx_something.
|
|
72941
72991
|
ENDINTERFACE.`,
|
|
72942
72992
|
};
|
|
72943
72993
|
}
|
|
@@ -72997,15 +73047,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
72997
73047
|
key: "use_line_exists",
|
|
72998
73048
|
title: "Use line_exists",
|
|
72999
73049
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
73000
|
-
extendedInformation: `
|
|
73001
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73002
|
-
|
|
73050
|
+
extendedInformation: `
|
|
73051
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
73052
|
+
|
|
73003
73053
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
73004
73054
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73005
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73006
|
-
IF sy-subrc = 0.
|
|
73055
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
73056
|
+
IF sy-subrc = 0.
|
|
73007
73057
|
ENDIF.`,
|
|
73008
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73058
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
73009
73059
|
ENDIF.`,
|
|
73010
73060
|
};
|
|
73011
73061
|
}
|
|
@@ -73115,10 +73165,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
73115
73165
|
key: "use_new",
|
|
73116
73166
|
title: "Use NEW",
|
|
73117
73167
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
73118
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73119
|
-
|
|
73120
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73121
|
-
|
|
73168
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
73169
|
+
|
|
73170
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
73171
|
+
|
|
73122
73172
|
Applicable from v740sp02 and up`,
|
|
73123
73173
|
badExample: `CREATE OBJECT ref.`,
|
|
73124
73174
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -73216,13 +73266,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
73216
73266
|
title: "WHEN OTHERS last",
|
|
73217
73267
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
73218
73268
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73219
|
-
badExample: `CASE bar.
|
|
73220
|
-
WHEN OTHERS.
|
|
73221
|
-
WHEN 2.
|
|
73269
|
+
badExample: `CASE bar.
|
|
73270
|
+
WHEN OTHERS.
|
|
73271
|
+
WHEN 2.
|
|
73222
73272
|
ENDCASE.`,
|
|
73223
|
-
goodExample: `CASE bar.
|
|
73224
|
-
WHEN 2.
|
|
73225
|
-
WHEN OTHERS.
|
|
73273
|
+
goodExample: `CASE bar.
|
|
73274
|
+
WHEN 2.
|
|
73275
|
+
WHEN OTHERS.
|
|
73226
73276
|
ENDCASE.`,
|
|
73227
73277
|
};
|
|
73228
73278
|
}
|