@abaplint/cli 2.113.81 → 2.113.82
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 +885 -870
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -35673,13 +35673,13 @@ class FlowGraph {
|
|
|
35673
35673
|
this.label = label;
|
|
35674
35674
|
}
|
|
35675
35675
|
toDigraph() {
|
|
35676
|
-
return `digraph G {
|
|
35677
|
-
labelloc="t";
|
|
35678
|
-
label="${this.label}";
|
|
35679
|
-
graph [fontname = "helvetica"];
|
|
35680
|
-
node [fontname = "helvetica", shape="box"];
|
|
35681
|
-
edge [fontname = "helvetica"];
|
|
35682
|
-
${this.toTextEdges()}
|
|
35676
|
+
return `digraph G {
|
|
35677
|
+
labelloc="t";
|
|
35678
|
+
label="${this.label}";
|
|
35679
|
+
graph [fontname = "helvetica"];
|
|
35680
|
+
node [fontname = "helvetica", shape="box"];
|
|
35681
|
+
edge [fontname = "helvetica"];
|
|
35682
|
+
${this.toTextEdges()}
|
|
35683
35683
|
}`;
|
|
35684
35684
|
}
|
|
35685
35685
|
listSources(node) {
|
|
@@ -44102,13 +44102,13 @@ class Help {
|
|
|
44102
44102
|
/////////////////////////////////////////////////
|
|
44103
44103
|
static dumpABAP(file, reg, textDocument, position) {
|
|
44104
44104
|
let content = "";
|
|
44105
|
-
content = `
|
|
44106
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
44107
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
44108
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
44109
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
44110
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
44111
|
-
<hr>
|
|
44105
|
+
content = `
|
|
44106
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
44107
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
44108
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
44109
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
44110
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
44111
|
+
<hr>
|
|
44112
44112
|
` +
|
|
44113
44113
|
"<tt>" + textDocument.uri + " (" +
|
|
44114
44114
|
(position.line + 1) + ", " +
|
|
@@ -44263,9 +44263,9 @@ class Help {
|
|
|
44263
44263
|
return ret + "</ul>";
|
|
44264
44264
|
}
|
|
44265
44265
|
static tokens(file) {
|
|
44266
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
44267
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
44268
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
44266
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
44267
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
44268
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
44269
44269
|
</tr>`;
|
|
44270
44270
|
for (const token of file.getTokens()) {
|
|
44271
44271
|
const tStart = token.getStart();
|
|
@@ -53581,7 +53581,7 @@ class Registry {
|
|
|
53581
53581
|
}
|
|
53582
53582
|
static abaplintVersion() {
|
|
53583
53583
|
// magic, see build script "version.sh"
|
|
53584
|
-
return "2.113.
|
|
53584
|
+
return "2.113.82";
|
|
53585
53585
|
}
|
|
53586
53586
|
getDDICReferences() {
|
|
53587
53587
|
return this.ddicReferences;
|
|
@@ -53900,10 +53900,10 @@ class SevenBitAscii {
|
|
|
53900
53900
|
key: "7bit_ascii",
|
|
53901
53901
|
title: "Check for 7bit ascii",
|
|
53902
53902
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53903
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53904
|
-
|
|
53905
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53906
|
-
|
|
53903
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53904
|
+
|
|
53905
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53906
|
+
|
|
53907
53907
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53908
53908
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53909
53909
|
badExample: `WRITE '뽑'.`,
|
|
@@ -54109,10 +54109,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
54109
54109
|
key: "abapdoc",
|
|
54110
54110
|
title: "Check abapdoc",
|
|
54111
54111
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
54112
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
54113
|
-
|
|
54114
|
-
Plus class and interface definitions.
|
|
54115
|
-
|
|
54112
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
54113
|
+
|
|
54114
|
+
Plus class and interface definitions.
|
|
54115
|
+
|
|
54116
54116
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
54117
54117
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
54118
54118
|
};
|
|
@@ -54249,27 +54249,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
54249
54249
|
title: "Add test attributes for tests classes with test methods",
|
|
54250
54250
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
54251
54251
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54252
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
54253
|
-
PUBLIC SECTION.
|
|
54254
|
-
PROTECTED SECTION.
|
|
54255
|
-
PRIVATE SECTION.
|
|
54256
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54257
|
-
ENDCLASS.
|
|
54258
|
-
|
|
54259
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
54260
|
-
METHOD test.
|
|
54261
|
-
ENDMETHOD.
|
|
54252
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
54253
|
+
PUBLIC SECTION.
|
|
54254
|
+
PROTECTED SECTION.
|
|
54255
|
+
PRIVATE SECTION.
|
|
54256
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54257
|
+
ENDCLASS.
|
|
54258
|
+
|
|
54259
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
54260
|
+
METHOD test.
|
|
54261
|
+
ENDMETHOD.
|
|
54262
54262
|
ENDCLASS.`,
|
|
54263
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
54264
|
-
PUBLIC SECTION.
|
|
54265
|
-
PROTECTED SECTION.
|
|
54266
|
-
PRIVATE SECTION.
|
|
54267
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54268
|
-
ENDCLASS.
|
|
54269
|
-
|
|
54270
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
54271
|
-
METHOD test.
|
|
54272
|
-
ENDMETHOD.
|
|
54263
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
54264
|
+
PUBLIC SECTION.
|
|
54265
|
+
PROTECTED SECTION.
|
|
54266
|
+
PRIVATE SECTION.
|
|
54267
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
54268
|
+
ENDCLASS.
|
|
54269
|
+
|
|
54270
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
54271
|
+
METHOD test.
|
|
54272
|
+
ENDMETHOD.
|
|
54273
54273
|
ENDCLASS.`,
|
|
54274
54274
|
};
|
|
54275
54275
|
}
|
|
@@ -54355,49 +54355,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
54355
54355
|
key: "align_parameters",
|
|
54356
54356
|
title: "Align Parameters",
|
|
54357
54357
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
54358
|
-
extendedInformation: `Checks:
|
|
54359
|
-
* function module calls
|
|
54360
|
-
* method calls
|
|
54361
|
-
* VALUE constructors
|
|
54362
|
-
* NEW constructors
|
|
54363
|
-
* RAISE EXCEPTION statements
|
|
54364
|
-
* CREATE OBJECT statements
|
|
54365
|
-
* RAISE EVENT statements
|
|
54366
|
-
|
|
54367
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54368
|
-
|
|
54369
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54370
|
-
|
|
54371
|
-
If parameters are on the same row, no issues are reported, see
|
|
54358
|
+
extendedInformation: `Checks:
|
|
54359
|
+
* function module calls
|
|
54360
|
+
* method calls
|
|
54361
|
+
* VALUE constructors
|
|
54362
|
+
* NEW constructors
|
|
54363
|
+
* RAISE EXCEPTION statements
|
|
54364
|
+
* CREATE OBJECT statements
|
|
54365
|
+
* RAISE EVENT statements
|
|
54366
|
+
|
|
54367
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
54368
|
+
|
|
54369
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
54370
|
+
|
|
54371
|
+
If parameters are on the same row, no issues are reported, see
|
|
54372
54372
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
54373
54373
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
54374
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54375
|
-
EXPORTING
|
|
54376
|
-
foo = 2
|
|
54377
|
-
parameter = 3.
|
|
54378
|
-
|
|
54379
|
-
foobar( moo = 1
|
|
54380
|
-
param = 1 ).
|
|
54381
|
-
|
|
54382
|
-
foo = VALUE #(
|
|
54383
|
-
foo = bar
|
|
54374
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
54375
|
+
EXPORTING
|
|
54376
|
+
foo = 2
|
|
54377
|
+
parameter = 3.
|
|
54378
|
+
|
|
54379
|
+
foobar( moo = 1
|
|
54380
|
+
param = 1 ).
|
|
54381
|
+
|
|
54382
|
+
foo = VALUE #(
|
|
54383
|
+
foo = bar
|
|
54384
54384
|
moo = 2 ).`,
|
|
54385
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54386
|
-
EXPORTING
|
|
54387
|
-
foo = 2
|
|
54388
|
-
parameter = 3.
|
|
54389
|
-
|
|
54390
|
-
foobar( moo = 1
|
|
54391
|
-
param = 1 ).
|
|
54392
|
-
|
|
54393
|
-
foo = VALUE #(
|
|
54394
|
-
foo = bar
|
|
54395
|
-
moo = 2 ).
|
|
54396
|
-
|
|
54397
|
-
DATA(sdf) = VALUE type(
|
|
54398
|
-
common_val = 2
|
|
54399
|
-
another_common = 5
|
|
54400
|
-
( row_value = 4
|
|
54385
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
54386
|
+
EXPORTING
|
|
54387
|
+
foo = 2
|
|
54388
|
+
parameter = 3.
|
|
54389
|
+
|
|
54390
|
+
foobar( moo = 1
|
|
54391
|
+
param = 1 ).
|
|
54392
|
+
|
|
54393
|
+
foo = VALUE #(
|
|
54394
|
+
foo = bar
|
|
54395
|
+
moo = 2 ).
|
|
54396
|
+
|
|
54397
|
+
DATA(sdf) = VALUE type(
|
|
54398
|
+
common_val = 2
|
|
54399
|
+
another_common = 5
|
|
54400
|
+
( row_value = 4
|
|
54401
54401
|
value_foo = 5 ) ).`,
|
|
54402
54402
|
};
|
|
54403
54403
|
}
|
|
@@ -54831,37 +54831,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54831
54831
|
key: "align_type_expressions",
|
|
54832
54832
|
title: "Align TYPE expressions",
|
|
54833
54833
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54834
|
-
extendedInformation: `
|
|
54835
|
-
Currently works for METHODS + BEGIN OF
|
|
54836
|
-
|
|
54837
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54838
|
-
|
|
54839
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54834
|
+
extendedInformation: `
|
|
54835
|
+
Currently works for METHODS + BEGIN OF
|
|
54836
|
+
|
|
54837
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54838
|
+
|
|
54839
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54840
54840
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54841
54841
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54842
|
-
badExample: `
|
|
54843
|
-
TYPES: BEGIN OF foo,
|
|
54844
|
-
bar TYPE i,
|
|
54845
|
-
foobar TYPE i,
|
|
54846
|
-
END OF foo.
|
|
54847
|
-
|
|
54848
|
-
INTERFACE lif.
|
|
54849
|
-
METHODS bar
|
|
54850
|
-
IMPORTING
|
|
54851
|
-
foo TYPE i
|
|
54852
|
-
foobar TYPE i.
|
|
54842
|
+
badExample: `
|
|
54843
|
+
TYPES: BEGIN OF foo,
|
|
54844
|
+
bar TYPE i,
|
|
54845
|
+
foobar TYPE i,
|
|
54846
|
+
END OF foo.
|
|
54847
|
+
|
|
54848
|
+
INTERFACE lif.
|
|
54849
|
+
METHODS bar
|
|
54850
|
+
IMPORTING
|
|
54851
|
+
foo TYPE i
|
|
54852
|
+
foobar TYPE i.
|
|
54853
54853
|
ENDINTERFACE.`,
|
|
54854
|
-
goodExample: `
|
|
54855
|
-
TYPES: BEGIN OF foo,
|
|
54856
|
-
bar TYPE i,
|
|
54857
|
-
foobar TYPE i,
|
|
54858
|
-
END OF foo.
|
|
54859
|
-
|
|
54860
|
-
INTERFACE lif.
|
|
54861
|
-
METHODS bar
|
|
54862
|
-
IMPORTING
|
|
54863
|
-
foo TYPE i
|
|
54864
|
-
foobar TYPE i.
|
|
54854
|
+
goodExample: `
|
|
54855
|
+
TYPES: BEGIN OF foo,
|
|
54856
|
+
bar TYPE i,
|
|
54857
|
+
foobar TYPE i,
|
|
54858
|
+
END OF foo.
|
|
54859
|
+
|
|
54860
|
+
INTERFACE lif.
|
|
54861
|
+
METHODS bar
|
|
54862
|
+
IMPORTING
|
|
54863
|
+
foo TYPE i
|
|
54864
|
+
foobar TYPE i.
|
|
54865
54865
|
ENDINTERFACE.`,
|
|
54866
54866
|
};
|
|
54867
54867
|
}
|
|
@@ -55140,16 +55140,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
55140
55140
|
return {
|
|
55141
55141
|
key: "ambiguous_statement",
|
|
55142
55142
|
title: "Check for ambigious statements",
|
|
55143
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
55144
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
55145
|
-
|
|
55143
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
55144
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
55145
|
+
|
|
55146
55146
|
Only works if the target version is 740sp05 or above`,
|
|
55147
55147
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55148
|
-
badExample: `DELETE foo FROM bar.
|
|
55148
|
+
badExample: `DELETE foo FROM bar.
|
|
55149
55149
|
MODIFY foo FROM bar.`,
|
|
55150
|
-
goodExample: `DELETE foo FROM @bar.
|
|
55151
|
-
DELETE TABLE itab FROM 2.
|
|
55152
|
-
MODIFY zfoo FROM @wa.
|
|
55150
|
+
goodExample: `DELETE foo FROM @bar.
|
|
55151
|
+
DELETE TABLE itab FROM 2.
|
|
55152
|
+
MODIFY zfoo FROM @wa.
|
|
55153
55153
|
MODIFY TABLE foo FROM bar.`,
|
|
55154
55154
|
};
|
|
55155
55155
|
}
|
|
@@ -55254,16 +55254,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
55254
55254
|
key: "avoid_use",
|
|
55255
55255
|
title: "Avoid use of certain statements",
|
|
55256
55256
|
shortDescription: `Detects usage of certain statements.`,
|
|
55257
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
55258
|
-
|
|
55259
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
55260
|
-
|
|
55261
|
-
STATICS: use CLASS-DATA instead
|
|
55262
|
-
|
|
55263
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
55264
|
-
|
|
55265
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
55266
|
-
|
|
55257
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
55258
|
+
|
|
55259
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
55260
|
+
|
|
55261
|
+
STATICS: use CLASS-DATA instead
|
|
55262
|
+
|
|
55263
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
55264
|
+
|
|
55265
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
55266
|
+
|
|
55267
55267
|
BREAK points`,
|
|
55268
55268
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55269
55269
|
};
|
|
@@ -55395,11 +55395,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
55395
55395
|
title: "Check BEGIN END names",
|
|
55396
55396
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
55397
55397
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
55398
|
-
badExample: `DATA: BEGIN OF stru,
|
|
55399
|
-
field TYPE i,
|
|
55398
|
+
badExample: `DATA: BEGIN OF stru,
|
|
55399
|
+
field TYPE i,
|
|
55400
55400
|
END OF structure_not_the_same.`,
|
|
55401
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
55402
|
-
field TYPE i,
|
|
55401
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
55402
|
+
field TYPE i,
|
|
55403
55403
|
END OF stru.`,
|
|
55404
55404
|
};
|
|
55405
55405
|
}
|
|
@@ -55496,20 +55496,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
55496
55496
|
title: "BEGIN contains single INCLUDE",
|
|
55497
55497
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
55498
55498
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55499
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
55500
|
-
INCLUDE TYPE dselc.
|
|
55501
|
-
TYPES: END OF dummy1.
|
|
55502
|
-
|
|
55503
|
-
DATA BEGIN OF foo.
|
|
55504
|
-
INCLUDE STRUCTURE syst.
|
|
55505
|
-
DATA END OF foo.
|
|
55506
|
-
|
|
55507
|
-
STATICS BEGIN OF bar.
|
|
55508
|
-
INCLUDE STRUCTURE syst.
|
|
55499
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
55500
|
+
INCLUDE TYPE dselc.
|
|
55501
|
+
TYPES: END OF dummy1.
|
|
55502
|
+
|
|
55503
|
+
DATA BEGIN OF foo.
|
|
55504
|
+
INCLUDE STRUCTURE syst.
|
|
55505
|
+
DATA END OF foo.
|
|
55506
|
+
|
|
55507
|
+
STATICS BEGIN OF bar.
|
|
55508
|
+
INCLUDE STRUCTURE syst.
|
|
55509
55509
|
STATICS END OF bar.`,
|
|
55510
|
-
goodExample: `DATA BEGIN OF foo.
|
|
55511
|
-
DATA field TYPE i.
|
|
55512
|
-
INCLUDE STRUCTURE dselc.
|
|
55510
|
+
goodExample: `DATA BEGIN OF foo.
|
|
55511
|
+
DATA field TYPE i.
|
|
55512
|
+
INCLUDE STRUCTURE dselc.
|
|
55513
55513
|
DATA END OF foo.`,
|
|
55514
55514
|
};
|
|
55515
55515
|
}
|
|
@@ -55599,9 +55599,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
55599
55599
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
55600
55600
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55601
55601
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
55602
|
-
goodExample: `TRY.
|
|
55603
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55604
|
-
CATCH cx_sy_authorization_error.
|
|
55602
|
+
goodExample: `TRY.
|
|
55603
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55604
|
+
CATCH cx_sy_authorization_error.
|
|
55605
55605
|
ENDTRY.`,
|
|
55606
55606
|
};
|
|
55607
55607
|
}
|
|
@@ -55666,10 +55666,10 @@ class CDSCommentStyle {
|
|
|
55666
55666
|
key: "cds_comment_style",
|
|
55667
55667
|
title: "CDS Comment Style",
|
|
55668
55668
|
shortDescription: `Check for obsolete comment style`,
|
|
55669
|
-
extendedInformation: `Check for obsolete comment style
|
|
55670
|
-
|
|
55671
|
-
Comments starting with "--" are considered obsolete
|
|
55672
|
-
|
|
55669
|
+
extendedInformation: `Check for obsolete comment style
|
|
55670
|
+
|
|
55671
|
+
Comments starting with "--" are considered obsolete
|
|
55672
|
+
|
|
55673
55673
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
55674
55674
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55675
55675
|
badExample: "-- this is a comment",
|
|
@@ -55735,10 +55735,10 @@ class CDSLegacyView {
|
|
|
55735
55735
|
key: "cds_legacy_view",
|
|
55736
55736
|
title: "CDS Legacy View",
|
|
55737
55737
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55738
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55739
|
-
|
|
55740
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55741
|
-
|
|
55738
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55739
|
+
|
|
55740
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55741
|
+
|
|
55742
55742
|
v755 and up`,
|
|
55743
55743
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55744
55744
|
};
|
|
@@ -55893,10 +55893,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55893
55893
|
key: "chain_mainly_declarations",
|
|
55894
55894
|
title: "Chain mainly declarations",
|
|
55895
55895
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55896
|
-
extendedInformation: `
|
|
55897
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55898
|
-
|
|
55899
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55896
|
+
extendedInformation: `
|
|
55897
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55898
|
+
|
|
55899
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55900
55900
|
`,
|
|
55901
55901
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55902
55902
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -56072,17 +56072,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
56072
56072
|
title: "Change IF to CASE",
|
|
56073
56073
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
56074
56074
|
// eslint-disable-next-line max-len
|
|
56075
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
56076
|
-
|
|
56075
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
56076
|
+
|
|
56077
56077
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
56078
56078
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
56079
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
56080
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
56081
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
56079
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
56080
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
56081
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
56082
56082
|
ENDIF.`,
|
|
56083
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
56084
|
-
WHEN 'FOO'.
|
|
56085
|
-
WHEN 'BAR' OR 'MOO'.
|
|
56083
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
56084
|
+
WHEN 'FOO'.
|
|
56085
|
+
WHEN 'BAR' OR 'MOO'.
|
|
56086
56086
|
ENDCASE.`,
|
|
56087
56087
|
};
|
|
56088
56088
|
}
|
|
@@ -56219,8 +56219,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
56219
56219
|
return {
|
|
56220
56220
|
key: "check_abstract",
|
|
56221
56221
|
title: "Check abstract methods and classes",
|
|
56222
|
-
shortDescription: `Checks abstract methods and classes:
|
|
56223
|
-
- class defined as abstract and final,
|
|
56222
|
+
shortDescription: `Checks abstract methods and classes:
|
|
56223
|
+
- class defined as abstract and final,
|
|
56224
56224
|
- non-abstract class contains abstract methods`,
|
|
56225
56225
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
56226
56226
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -56301,11 +56301,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
56301
56301
|
return {
|
|
56302
56302
|
key: "check_comments",
|
|
56303
56303
|
title: "Check Comments",
|
|
56304
|
-
shortDescription: `
|
|
56304
|
+
shortDescription: `
|
|
56305
56305
|
Various checks for comment usage.`,
|
|
56306
|
-
extendedInformation: `
|
|
56307
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
56308
|
-
|
|
56306
|
+
extendedInformation: `
|
|
56307
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
56308
|
+
|
|
56309
56309
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
56310
56310
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
56311
56311
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -56467,9 +56467,9 @@ class CheckInclude {
|
|
|
56467
56467
|
key: "check_include",
|
|
56468
56468
|
title: "Check INCLUDEs",
|
|
56469
56469
|
shortDescription: `Checks INCLUDE statements`,
|
|
56470
|
-
extendedInformation: `
|
|
56471
|
-
* Reports unused includes
|
|
56472
|
-
* Errors if the includes are not found
|
|
56470
|
+
extendedInformation: `
|
|
56471
|
+
* Reports unused includes
|
|
56472
|
+
* Errors if the includes are not found
|
|
56473
56473
|
* Error if including a main program`,
|
|
56474
56474
|
tags: [_irule_1.RuleTag.Syntax],
|
|
56475
56475
|
};
|
|
@@ -56545,14 +56545,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
56545
56545
|
key: "check_subrc",
|
|
56546
56546
|
title: "Check sy-subrc",
|
|
56547
56547
|
shortDescription: `Check sy-subrc`,
|
|
56548
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56549
|
-
|
|
56550
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56551
|
-
|
|
56552
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56553
|
-
|
|
56554
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56555
|
-
|
|
56548
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56549
|
+
|
|
56550
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56551
|
+
|
|
56552
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56553
|
+
|
|
56554
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56555
|
+
|
|
56556
56556
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
56557
56557
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56558
56558
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -57122,17 +57122,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
57122
57122
|
shortDescription: `Find overlapping classic exceptions`,
|
|
57123
57123
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
57124
57124
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
57125
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
57126
|
-
EXCEPTIONS
|
|
57127
|
-
system_failure = 1 MESSAGE lv_message
|
|
57128
|
-
communication_failure = 1 MESSAGE lv_message
|
|
57129
|
-
resource_failure = 1
|
|
57125
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
57126
|
+
EXCEPTIONS
|
|
57127
|
+
system_failure = 1 MESSAGE lv_message
|
|
57128
|
+
communication_failure = 1 MESSAGE lv_message
|
|
57129
|
+
resource_failure = 1
|
|
57130
57130
|
OTHERS = 1.`,
|
|
57131
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
57132
|
-
EXCEPTIONS
|
|
57133
|
-
system_failure = 1 MESSAGE lv_message
|
|
57134
|
-
communication_failure = 2 MESSAGE lv_message
|
|
57135
|
-
resource_failure = 3
|
|
57131
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
57132
|
+
EXCEPTIONS
|
|
57133
|
+
system_failure = 1 MESSAGE lv_message
|
|
57134
|
+
communication_failure = 2 MESSAGE lv_message
|
|
57135
|
+
resource_failure = 3
|
|
57136
57136
|
OTHERS = 4.`,
|
|
57137
57137
|
};
|
|
57138
57138
|
}
|
|
@@ -57390,7 +57390,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
57390
57390
|
key: "commented_code",
|
|
57391
57391
|
title: "Find commented code",
|
|
57392
57392
|
shortDescription: `Detects usage of commented out code.`,
|
|
57393
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57393
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
57394
57394
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
57395
57395
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
57396
57396
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -57623,10 +57623,10 @@ class ConstructorVisibilityPublic {
|
|
|
57623
57623
|
key: "constructor_visibility_public",
|
|
57624
57624
|
title: "Check constructor visibility is public",
|
|
57625
57625
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
57626
|
-
extendedInformation: `
|
|
57627
|
-
This only applies to global classes.
|
|
57628
|
-
|
|
57629
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57626
|
+
extendedInformation: `
|
|
57627
|
+
This only applies to global classes.
|
|
57628
|
+
|
|
57629
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57630
57630
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
57631
57631
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57632
57632
|
};
|
|
@@ -57701,8 +57701,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
57701
57701
|
key: "contains_tab",
|
|
57702
57702
|
title: "Code contains tab",
|
|
57703
57703
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
57704
|
-
extendedInformation: `
|
|
57705
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57704
|
+
extendedInformation: `
|
|
57705
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
57706
57706
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
57707
57707
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57708
57708
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57789,10 +57789,10 @@ class CyclicOO {
|
|
|
57789
57789
|
key: "cyclic_oo",
|
|
57790
57790
|
title: "Cyclic OO",
|
|
57791
57791
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57792
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57793
|
-
|
|
57794
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57795
|
-
|
|
57792
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57793
|
+
|
|
57794
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57795
|
+
|
|
57796
57796
|
References in testclass includes are ignored`,
|
|
57797
57797
|
};
|
|
57798
57798
|
}
|
|
@@ -58035,7 +58035,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
58035
58035
|
key: "dangerous_statement",
|
|
58036
58036
|
title: "Dangerous statement",
|
|
58037
58037
|
shortDescription: `Detects potentially dangerous statements`,
|
|
58038
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
58038
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
58039
58039
|
dynamic SQL can potentially create SQL injection problems`,
|
|
58040
58040
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
58041
58041
|
};
|
|
@@ -58242,13 +58242,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
58242
58242
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
58243
58243
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
58244
58244
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
58245
|
-
badExample: `FROM foo.
|
|
58246
|
-
WRITE 'hello'.
|
|
58247
|
-
DATA int TYPE i.
|
|
58245
|
+
badExample: `FROM foo.
|
|
58246
|
+
WRITE 'hello'.
|
|
58247
|
+
DATA int TYPE i.
|
|
58248
58248
|
ENDFORM.`,
|
|
58249
|
-
goodExample: `FROM foo.
|
|
58250
|
-
DATA int TYPE i.
|
|
58251
|
-
WRITE 'hello'.
|
|
58249
|
+
goodExample: `FROM foo.
|
|
58250
|
+
DATA int TYPE i.
|
|
58251
|
+
WRITE 'hello'.
|
|
58252
58252
|
ENDFORM.`,
|
|
58253
58253
|
};
|
|
58254
58254
|
}
|
|
@@ -58667,32 +58667,32 @@ exports.DoubleSpace = DoubleSpace;
|
|
|
58667
58667
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
58668
58668
|
exports.Downport = exports.DownportConf = void 0;
|
|
58669
58669
|
/* eslint-disable max-len */
|
|
58670
|
-
const
|
|
58670
|
+
const crypto = __webpack_require__(/*! crypto */ "crypto");
|
|
58671
|
+
const tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
58671
58672
|
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
58672
|
-
const
|
|
58673
|
-
const
|
|
58674
|
-
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
58675
|
-
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
58673
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
58674
|
+
const statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
58676
58675
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
58677
|
-
const
|
|
58678
|
-
const
|
|
58679
|
-
const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
|
|
58680
|
-
const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
|
|
58681
|
-
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
58682
|
-
const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
58683
|
-
const registry_1 = __webpack_require__(/*! ../registry */ "./node_modules/@abaplint/core/build/src/registry.js");
|
|
58684
|
-
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
|
|
58676
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
58677
|
+
const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
|
|
58685
58678
|
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
58679
|
+
const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
|
|
58680
|
+
const syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js");
|
|
58681
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
58686
58682
|
const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
|
|
58687
58683
|
const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
58688
58684
|
const config_1 = __webpack_require__(/*! ../config */ "./node_modules/@abaplint/core/build/src/config.js");
|
|
58689
|
-
const
|
|
58690
|
-
const
|
|
58685
|
+
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
58686
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
58691
58687
|
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
58692
|
-
const
|
|
58693
|
-
const
|
|
58694
|
-
const
|
|
58695
|
-
const
|
|
58688
|
+
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
58689
|
+
const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
|
|
58690
|
+
const registry_1 = __webpack_require__(/*! ../registry */ "./node_modules/@abaplint/core/build/src/registry.js");
|
|
58691
|
+
const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
|
|
58692
|
+
const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
58693
|
+
const virtual_position_1 = __webpack_require__(/*! ../virtual_position */ "./node_modules/@abaplint/core/build/src/virtual_position.js");
|
|
58694
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
58695
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
58696
58696
|
// todo: refactor each sub-rule to new classes?
|
|
58697
58697
|
// todo: add configuration
|
|
58698
58698
|
class DownportConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
@@ -58790,39 +58790,39 @@ class Downport {
|
|
|
58790
58790
|
key: "downport",
|
|
58791
58791
|
title: "Downport statement",
|
|
58792
58792
|
shortDescription: `Downport functionality`,
|
|
58793
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58794
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58795
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58796
|
-
|
|
58797
|
-
Current rules:
|
|
58798
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58799
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58800
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58801
|
-
* CONV is outlined
|
|
58802
|
-
* COND is outlined
|
|
58803
|
-
* REDUCE is outlined
|
|
58804
|
-
* SWITCH is outlined
|
|
58805
|
-
* FILTER is outlined
|
|
58806
|
-
* APPEND expression is outlined
|
|
58807
|
-
* INSERT expression is outlined
|
|
58808
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58809
|
-
* CAST changed to ?=
|
|
58810
|
-
* LOOP AT method_call( ) is outlined
|
|
58811
|
-
* VALUE # with structure fields
|
|
58812
|
-
* VALUE # with internal table lines
|
|
58813
|
-
* Table Expressions are outlined
|
|
58814
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58815
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58816
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58817
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58818
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58819
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58820
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58821
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58822
|
-
* MESSAGE with non simple source
|
|
58823
|
-
|
|
58824
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58825
|
-
|
|
58793
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58794
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58795
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58796
|
+
|
|
58797
|
+
Current rules:
|
|
58798
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58799
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58800
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58801
|
+
* CONV is outlined
|
|
58802
|
+
* COND is outlined
|
|
58803
|
+
* REDUCE is outlined
|
|
58804
|
+
* SWITCH is outlined
|
|
58805
|
+
* FILTER is outlined
|
|
58806
|
+
* APPEND expression is outlined
|
|
58807
|
+
* INSERT expression is outlined
|
|
58808
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58809
|
+
* CAST changed to ?=
|
|
58810
|
+
* LOOP AT method_call( ) is outlined
|
|
58811
|
+
* VALUE # with structure fields
|
|
58812
|
+
* VALUE # with internal table lines
|
|
58813
|
+
* Table Expressions are outlined
|
|
58814
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58815
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58816
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58817
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58818
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58819
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58820
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58821
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58822
|
+
* MESSAGE with non simple source
|
|
58823
|
+
|
|
58824
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58825
|
+
|
|
58826
58826
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58827
58827
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58828
58828
|
};
|
|
@@ -59400,10 +59400,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
59400
59400
|
const fieldName = f.concatTokens();
|
|
59401
59401
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
59402
59402
|
}
|
|
59403
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59403
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
59404
59404
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
59405
59405
|
}
|
|
59406
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59406
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
59407
59407
|
${indentation}`);
|
|
59408
59408
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
59409
59409
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59462,12 +59462,12 @@ ${indentation}`);
|
|
|
59462
59462
|
}
|
|
59463
59463
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59464
59464
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
59465
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59466
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59467
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59465
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
59466
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
59467
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
59468
59468
|
${indentation}`);
|
|
59469
59469
|
if (fieldDefinitions === "") {
|
|
59470
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59470
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
59471
59471
|
${indentation}`);
|
|
59472
59472
|
}
|
|
59473
59473
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -59535,7 +59535,7 @@ ${indentation}`);
|
|
|
59535
59535
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59536
59536
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59537
59537
|
const firstToken = high.getFirstToken();
|
|
59538
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59538
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59539
59539
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59540
59540
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59541
59541
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59589,7 +59589,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59589
59589
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59590
59590
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59591
59591
|
const firstToken = high.getFirstToken();
|
|
59592
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59592
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59593
59593
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59594
59594
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59595
59595
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59631,14 +59631,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59631
59631
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59632
59632
|
const firstToken = high.getFirstToken();
|
|
59633
59633
|
// note that the tabix restore should be done before throwing the exception
|
|
59634
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59635
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59636
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59637
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59638
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59639
|
-
${indentation}IF sy-subrc <> 0.
|
|
59640
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59641
|
-
${indentation}ENDIF.
|
|
59634
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59635
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59636
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59637
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59638
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59639
|
+
${indentation}IF sy-subrc <> 0.
|
|
59640
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59641
|
+
${indentation}ENDIF.
|
|
59642
59642
|
${indentation}`);
|
|
59643
59643
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
59644
59644
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59695,7 +59695,7 @@ ${indentation}`);
|
|
|
59695
59695
|
const className = classNames[0].concatTokens();
|
|
59696
59696
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59697
59697
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59698
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59698
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59699
59699
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
59700
59700
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
59701
59701
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59857,16 +59857,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59857
59857
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59858
59858
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59859
59859
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59860
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59861
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59860
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59861
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59862
59862
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59863
59863
|
if (withs.length > 0) {
|
|
59864
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59865
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59866
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59864
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59865
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59866
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59867
59867
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59868
59868
|
}
|
|
59869
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59869
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59870
59870
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59871
59871
|
if (withs.length > 0) {
|
|
59872
59872
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59978,10 +59978,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59978
59978
|
let code = "";
|
|
59979
59979
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59980
59980
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59981
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59982
|
-
IF sy-subrc <> 0.
|
|
59983
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59984
|
-
ENDIF.
|
|
59981
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59982
|
+
IF sy-subrc <> 0.
|
|
59983
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59984
|
+
ENDIF.
|
|
59985
59985
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59986
59986
|
}
|
|
59987
59987
|
else {
|
|
@@ -60070,20 +60070,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
60070
60070
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60071
60071
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60072
60072
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60073
|
-
code += ` items LIKE ${loopSourceName},
|
|
60074
|
-
END OF ${groupTargetName}type.
|
|
60075
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
60076
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
60073
|
+
code += ` items LIKE ${loopSourceName},
|
|
60074
|
+
END OF ${groupTargetName}type.
|
|
60075
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
60076
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
60077
60077
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
60078
60078
|
if (groupIndexName !== undefined) {
|
|
60079
60079
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
60080
60080
|
}
|
|
60081
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
60081
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
60082
60082
|
IF sy-subrc = 0.\n`;
|
|
60083
60083
|
if (groupCountName !== undefined) {
|
|
60084
60084
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
60085
60085
|
}
|
|
60086
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
60086
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
60087
60087
|
ELSE.\n`;
|
|
60088
60088
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
60089
60089
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -60104,8 +60104,8 @@ ELSE.\n`;
|
|
|
60104
60104
|
}
|
|
60105
60105
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
60106
60106
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
60107
|
-
code += `ENDIF.
|
|
60108
|
-
ENDLOOP.
|
|
60107
|
+
code += `ENDIF.
|
|
60108
|
+
ENDLOOP.
|
|
60109
60109
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
60110
60110
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
60111
60111
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -60277,7 +60277,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
60277
60277
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60278
60278
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
60279
60279
|
// all ENUMS are char like?
|
|
60280
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
60280
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
60281
60281
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
60282
60282
|
let count = 1;
|
|
60283
60283
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -60321,14 +60321,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
60321
60321
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60322
60322
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60323
60323
|
// restore tabix before exeption
|
|
60324
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
60325
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
60326
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
60327
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
60328
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
60329
|
-
${indentation}IF sy-subrc <> 0.
|
|
60330
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60331
|
-
${indentation}ENDIF.
|
|
60324
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
60325
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
60326
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
60327
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
60328
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
60329
|
+
${indentation}IF sy-subrc <> 0.
|
|
60330
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
60331
|
+
${indentation}ENDIF.
|
|
60332
60332
|
${indentation}${uniqueName}`;
|
|
60333
60333
|
const start = target.getFirstToken().getStart();
|
|
60334
60334
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -60408,11 +60408,11 @@ ${indentation}${uniqueName}`;
|
|
|
60408
60408
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
60409
60409
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
60410
60410
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
60411
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
60412
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
60413
|
-
${indentation} EXPORTING
|
|
60414
|
-
${indentation} input = ${source}
|
|
60415
|
-
${indentation} IMPORTING
|
|
60411
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
60412
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
60413
|
+
${indentation} EXPORTING
|
|
60414
|
+
${indentation} input = ${source}
|
|
60415
|
+
${indentation} IMPORTING
|
|
60416
60416
|
${indentation} output = ${uniqueName}.\n`;
|
|
60417
60417
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
60418
60418
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -60445,24 +60445,33 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
60445
60445
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Outline LOOP input", this.getMetadata().key, this.conf.severity, fix);
|
|
60446
60446
|
}
|
|
60447
60447
|
outlineLoopTarget(node, lowFile, highSyntax) {
|
|
60448
|
-
var _a, _b, _c, _d, _e, _f
|
|
60448
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60449
60449
|
// also allows outlining of voided types
|
|
60450
60450
|
if (!(node.get() instanceof Statements.Loop)) {
|
|
60451
60451
|
return undefined;
|
|
60452
60452
|
}
|
|
60453
|
-
const
|
|
60453
|
+
const source = node.findDirectExpression(Expressions.SimpleSource2);
|
|
60454
|
+
if (source === undefined) {
|
|
60455
|
+
return undefined;
|
|
60456
|
+
}
|
|
60457
|
+
const sourceName = source === null || source === void 0 ? void 0 : source.concatTokens();
|
|
60454
60458
|
if (sourceName === undefined) {
|
|
60455
60459
|
return undefined;
|
|
60456
60460
|
}
|
|
60461
|
+
let foundType = undefined;
|
|
60462
|
+
const spag = highSyntax.spaghetti.lookupPosition(source.getFirstToken().getStart(), lowFile.getFilename());
|
|
60463
|
+
if (spag) {
|
|
60464
|
+
foundType = spag.findVariable(source.concatTokens());
|
|
60465
|
+
}
|
|
60457
60466
|
const concat = node.concatTokens().toUpperCase();
|
|
60458
60467
|
if (concat.includes(" GROUP BY ") || concat.startsWith("LOOP AT GROUP ")) {
|
|
60459
60468
|
return undefined;
|
|
60460
60469
|
}
|
|
60461
60470
|
const isReference = concat.includes(" REFERENCE INTO ");
|
|
60462
60471
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
60463
|
-
const dataTarget = (
|
|
60472
|
+
const dataTarget = (_b = (_a = node.findDirectExpression(Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);
|
|
60464
60473
|
if (dataTarget) {
|
|
60465
|
-
const targetName = ((
|
|
60474
|
+
const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "DOWNPORT_ERROR";
|
|
60466
60475
|
let code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\n${indentation}`;
|
|
60467
60476
|
if (isReference) {
|
|
60468
60477
|
const likeName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
@@ -60473,10 +60482,15 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
60473
60482
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
60474
60483
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline LOOP data target", this.getMetadata().key, this.conf.severity, fix);
|
|
60475
60484
|
}
|
|
60476
|
-
const fsTarget = (
|
|
60485
|
+
const fsTarget = (_e = (_d = node.findDirectExpression(Expressions.LoopTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.FSTarget)) === null || _e === void 0 ? void 0 : _e.findDirectExpression(Expressions.InlineFS);
|
|
60477
60486
|
if (fsTarget) {
|
|
60478
|
-
const targetName = ((
|
|
60479
|
-
|
|
60487
|
+
const targetName = ((_f = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens()) || "DOWNPORT_ERROR";
|
|
60488
|
+
let type = `LIKE LINE OF ${sourceName}`;
|
|
60489
|
+
const f = foundType === null || foundType === void 0 ? void 0 : foundType.getType();
|
|
60490
|
+
if (f instanceof basic_1.TableType && f.getRowType() instanceof basic_1.AnyType) {
|
|
60491
|
+
type = "TYPE ANY";
|
|
60492
|
+
}
|
|
60493
|
+
const code = `FIELD-SYMBOLS ${targetName} ${type}.\n${indentation}`;
|
|
60480
60494
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);
|
|
60481
60495
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);
|
|
60482
60496
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -61724,12 +61738,12 @@ class EasyToFindMessages {
|
|
|
61724
61738
|
key: "easy_to_find_messages",
|
|
61725
61739
|
title: "Easy to find messages",
|
|
61726
61740
|
shortDescription: `Make messages easy to find`,
|
|
61727
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
61728
|
-
|
|
61729
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
61730
|
-
|
|
61731
|
-
Also see rule "message_exists"
|
|
61732
|
-
|
|
61741
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61742
|
+
|
|
61743
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61744
|
+
|
|
61745
|
+
Also see rule "message_exists"
|
|
61746
|
+
|
|
61733
61747
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61734
61748
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61735
61749
|
};
|
|
@@ -61810,13 +61824,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61810
61824
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61811
61825
|
extendedInformation: ``,
|
|
61812
61826
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61813
|
-
badExample: `
|
|
61814
|
-
INITIALIZATION.
|
|
61815
|
-
WRITE 'hello'.
|
|
61827
|
+
badExample: `
|
|
61828
|
+
INITIALIZATION.
|
|
61829
|
+
WRITE 'hello'.
|
|
61816
61830
|
END-OF-SELECTION.`,
|
|
61817
|
-
goodExample: `
|
|
61818
|
-
START-OF-SELECTION.
|
|
61819
|
-
PERFORM sdf.
|
|
61831
|
+
goodExample: `
|
|
61832
|
+
START-OF-SELECTION.
|
|
61833
|
+
PERFORM sdf.
|
|
61820
61834
|
COMMIT WORK.`,
|
|
61821
61835
|
};
|
|
61822
61836
|
}
|
|
@@ -61908,8 +61922,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61908
61922
|
key: "empty_line_in_statement",
|
|
61909
61923
|
title: "Find empty lines in statements",
|
|
61910
61924
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61911
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61912
|
-
|
|
61925
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61926
|
+
|
|
61913
61927
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61914
61928
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61915
61929
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -62085,13 +62099,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
62085
62099
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
62086
62100
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
62087
62101
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
62088
|
-
badExample: `IF foo = bar.
|
|
62089
|
-
ENDIF.
|
|
62090
|
-
|
|
62091
|
-
DO 2 TIMES.
|
|
62102
|
+
badExample: `IF foo = bar.
|
|
62103
|
+
ENDIF.
|
|
62104
|
+
|
|
62105
|
+
DO 2 TIMES.
|
|
62092
62106
|
ENDDO.`,
|
|
62093
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
62094
|
-
ENDLOOP.
|
|
62107
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
62108
|
+
ENDLOOP.
|
|
62095
62109
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
62096
62110
|
};
|
|
62097
62111
|
}
|
|
@@ -62233,10 +62247,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
62233
62247
|
return {
|
|
62234
62248
|
key: "exit_or_check",
|
|
62235
62249
|
title: "Find EXIT or CHECK outside loops",
|
|
62236
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
62250
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
62237
62251
|
Use RETURN to leave procesing blocks instead.`,
|
|
62238
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
62239
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
62252
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
62253
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
62240
62254
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
62241
62255
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
62242
62256
|
};
|
|
@@ -62319,12 +62333,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
62319
62333
|
key: "expand_macros",
|
|
62320
62334
|
title: "Expand Macros",
|
|
62321
62335
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
62322
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
62323
|
-
|
|
62336
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
62337
|
+
|
|
62324
62338
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
62325
|
-
badExample: `DEFINE _hello.
|
|
62326
|
-
WRITE 'hello'.
|
|
62327
|
-
END-OF-DEFINITION.
|
|
62339
|
+
badExample: `DEFINE _hello.
|
|
62340
|
+
WRITE 'hello'.
|
|
62341
|
+
END-OF-DEFINITION.
|
|
62328
62342
|
_hello.`,
|
|
62329
62343
|
goodExample: `WRITE 'hello'.`,
|
|
62330
62344
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -62411,7 +62425,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
62411
62425
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
62412
62426
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
62413
62427
|
goodExample: `call_method( foo = bar ).`,
|
|
62414
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62428
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
62415
62429
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
62416
62430
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62417
62431
|
};
|
|
@@ -62509,7 +62523,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
62509
62523
|
key: "forbidden_identifier",
|
|
62510
62524
|
title: "Forbidden Identifier",
|
|
62511
62525
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
62512
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62526
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
62513
62527
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
62514
62528
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62515
62529
|
};
|
|
@@ -62751,8 +62765,8 @@ class ForbiddenVoidType {
|
|
|
62751
62765
|
key: "forbidden_void_type",
|
|
62752
62766
|
title: "Forbidden Void Types",
|
|
62753
62767
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62754
|
-
extendedInformation: `Inspiration:
|
|
62755
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62768
|
+
extendedInformation: `Inspiration:
|
|
62769
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62756
62770
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62757
62771
|
};
|
|
62758
62772
|
}
|
|
@@ -62995,9 +63009,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62995
63009
|
key: "fully_type_itabs",
|
|
62996
63010
|
title: "Fully type internal tables",
|
|
62997
63011
|
shortDescription: `No implict table types or table keys`,
|
|
62998
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
63012
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62999
63013
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
63000
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
63014
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
63001
63015
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
63002
63016
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
63003
63017
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -63182,26 +63196,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
63182
63196
|
key: "functional_writing",
|
|
63183
63197
|
title: "Use functional writing",
|
|
63184
63198
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
63185
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
63199
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
63186
63200
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
63187
63201
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63188
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
63189
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
63190
|
-
EXPORTING
|
|
63191
|
-
p_name = 'NAME'
|
|
63192
|
-
RECEIVING
|
|
63193
|
-
p_descr_ref = lr_typedescr
|
|
63194
|
-
EXCEPTIONS
|
|
63195
|
-
type_not_found = 1
|
|
63202
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
63203
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
63204
|
+
EXPORTING
|
|
63205
|
+
p_name = 'NAME'
|
|
63206
|
+
RECEIVING
|
|
63207
|
+
p_descr_ref = lr_typedescr
|
|
63208
|
+
EXCEPTIONS
|
|
63209
|
+
type_not_found = 1
|
|
63196
63210
|
OTHERS = 2.`,
|
|
63197
|
-
goodExample: `zcl_class=>method( ).
|
|
63198
|
-
cl_abap_typedescr=>describe_by_name(
|
|
63199
|
-
EXPORTING
|
|
63200
|
-
p_name = 'NAME'
|
|
63201
|
-
RECEIVING
|
|
63202
|
-
p_descr_ref = lr_typedescr
|
|
63203
|
-
EXCEPTIONS
|
|
63204
|
-
type_not_found = 1
|
|
63211
|
+
goodExample: `zcl_class=>method( ).
|
|
63212
|
+
cl_abap_typedescr=>describe_by_name(
|
|
63213
|
+
EXPORTING
|
|
63214
|
+
p_name = 'NAME'
|
|
63215
|
+
RECEIVING
|
|
63216
|
+
p_descr_ref = lr_typedescr
|
|
63217
|
+
EXCEPTIONS
|
|
63218
|
+
type_not_found = 1
|
|
63205
63219
|
OTHERS = 2 ).`,
|
|
63206
63220
|
};
|
|
63207
63221
|
}
|
|
@@ -63312,14 +63326,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
63312
63326
|
key: "global_class",
|
|
63313
63327
|
title: "Global class checks",
|
|
63314
63328
|
shortDescription: `Checks related to global classes`,
|
|
63315
|
-
extendedInformation: `* global classes must be in own files
|
|
63316
|
-
|
|
63317
|
-
* file names must match class name
|
|
63318
|
-
|
|
63319
|
-
* file names must match interface name
|
|
63320
|
-
|
|
63321
|
-
* global classes must be global definitions
|
|
63322
|
-
|
|
63329
|
+
extendedInformation: `* global classes must be in own files
|
|
63330
|
+
|
|
63331
|
+
* file names must match class name
|
|
63332
|
+
|
|
63333
|
+
* file names must match interface name
|
|
63334
|
+
|
|
63335
|
+
* global classes must be global definitions
|
|
63336
|
+
|
|
63323
63337
|
* global interfaces must be global definitions`,
|
|
63324
63338
|
tags: [_irule_1.RuleTag.Syntax],
|
|
63325
63339
|
};
|
|
@@ -63418,21 +63432,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
63418
63432
|
return {
|
|
63419
63433
|
key: "identical_conditions",
|
|
63420
63434
|
title: "Identical conditions",
|
|
63421
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63422
|
-
|
|
63435
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
63436
|
+
|
|
63423
63437
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
63424
63438
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63425
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63426
|
-
ENDIF.
|
|
63427
|
-
CASE bar.
|
|
63428
|
-
WHEN '1'.
|
|
63429
|
-
WHEN 'A' OR '1'.
|
|
63439
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
63440
|
+
ENDIF.
|
|
63441
|
+
CASE bar.
|
|
63442
|
+
WHEN '1'.
|
|
63443
|
+
WHEN 'A' OR '1'.
|
|
63430
63444
|
ENDCASE.`,
|
|
63431
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
63432
|
-
ENDIF.
|
|
63433
|
-
CASE bar.
|
|
63434
|
-
WHEN '1'.
|
|
63435
|
-
WHEN 'A'.
|
|
63445
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
63446
|
+
ENDIF.
|
|
63447
|
+
CASE bar.
|
|
63448
|
+
WHEN '1'.
|
|
63449
|
+
WHEN 'A'.
|
|
63436
63450
|
ENDCASE.`,
|
|
63437
63451
|
};
|
|
63438
63452
|
}
|
|
@@ -63566,23 +63580,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
63566
63580
|
key: "identical_contents",
|
|
63567
63581
|
title: "Identical contents",
|
|
63568
63582
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
63569
|
-
extendedInformation: `
|
|
63570
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
63571
|
-
|
|
63583
|
+
extendedInformation: `
|
|
63584
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
63585
|
+
|
|
63572
63586
|
Chained statments are ignored`,
|
|
63573
63587
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63574
|
-
badExample: `IF foo = bar.
|
|
63575
|
-
WRITE 'bar'.
|
|
63576
|
-
WRITE 'world'.
|
|
63577
|
-
ELSE.
|
|
63578
|
-
WRITE 'foo'.
|
|
63579
|
-
WRITE 'world'.
|
|
63588
|
+
badExample: `IF foo = bar.
|
|
63589
|
+
WRITE 'bar'.
|
|
63590
|
+
WRITE 'world'.
|
|
63591
|
+
ELSE.
|
|
63592
|
+
WRITE 'foo'.
|
|
63593
|
+
WRITE 'world'.
|
|
63580
63594
|
ENDIF.`,
|
|
63581
|
-
goodExample: `IF foo = bar.
|
|
63582
|
-
WRITE 'bar'.
|
|
63583
|
-
ELSE.
|
|
63584
|
-
WRITE 'foo'.
|
|
63585
|
-
ENDIF.
|
|
63595
|
+
goodExample: `IF foo = bar.
|
|
63596
|
+
WRITE 'bar'.
|
|
63597
|
+
ELSE.
|
|
63598
|
+
WRITE 'foo'.
|
|
63599
|
+
ENDIF.
|
|
63586
63600
|
WRITE 'world'.`,
|
|
63587
63601
|
};
|
|
63588
63602
|
}
|
|
@@ -63690,12 +63704,12 @@ class IdenticalDescriptions {
|
|
|
63690
63704
|
key: "identical_descriptions",
|
|
63691
63705
|
title: "Identical descriptions",
|
|
63692
63706
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
63693
|
-
extendedInformation: `Case insensitive
|
|
63694
|
-
|
|
63695
|
-
Only checks the master language descriptions
|
|
63696
|
-
|
|
63697
|
-
Dependencies are skipped
|
|
63698
|
-
|
|
63707
|
+
extendedInformation: `Case insensitive
|
|
63708
|
+
|
|
63709
|
+
Only checks the master language descriptions
|
|
63710
|
+
|
|
63711
|
+
Dependencies are skipped
|
|
63712
|
+
|
|
63699
63713
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
63700
63714
|
tags: [],
|
|
63701
63715
|
};
|
|
@@ -63869,43 +63883,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63869
63883
|
key: "if_in_if",
|
|
63870
63884
|
title: "IF in IF",
|
|
63871
63885
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63872
|
-
extendedInformation: `
|
|
63873
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63874
|
-
|
|
63875
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63876
|
-
|
|
63877
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63886
|
+
extendedInformation: `
|
|
63887
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63888
|
+
|
|
63889
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63890
|
+
|
|
63891
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63878
63892
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63879
|
-
badExample: `IF condition1.
|
|
63880
|
-
IF condition2.
|
|
63881
|
-
...
|
|
63882
|
-
ENDIF.
|
|
63883
|
-
ENDIF.
|
|
63884
|
-
|
|
63885
|
-
IF condition1.
|
|
63886
|
-
...
|
|
63887
|
-
ELSE.
|
|
63888
|
-
IF condition2.
|
|
63889
|
-
...
|
|
63890
|
-
ENDIF.
|
|
63893
|
+
badExample: `IF condition1.
|
|
63894
|
+
IF condition2.
|
|
63895
|
+
...
|
|
63896
|
+
ENDIF.
|
|
63897
|
+
ENDIF.
|
|
63898
|
+
|
|
63899
|
+
IF condition1.
|
|
63900
|
+
...
|
|
63901
|
+
ELSE.
|
|
63902
|
+
IF condition2.
|
|
63903
|
+
...
|
|
63904
|
+
ENDIF.
|
|
63891
63905
|
ENDIF.`,
|
|
63892
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63893
|
-
...
|
|
63894
|
-
ENDIF.
|
|
63895
|
-
|
|
63896
|
-
IF condition1.
|
|
63897
|
-
...
|
|
63898
|
-
ELSEIF condition2.
|
|
63899
|
-
...
|
|
63900
|
-
ENDIF.
|
|
63901
|
-
|
|
63902
|
-
CASE variable.
|
|
63903
|
-
WHEN value1.
|
|
63904
|
-
...
|
|
63905
|
-
WHEN value2.
|
|
63906
|
-
IF condition2.
|
|
63907
|
-
...
|
|
63908
|
-
ENDIF.
|
|
63906
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63907
|
+
...
|
|
63908
|
+
ENDIF.
|
|
63909
|
+
|
|
63910
|
+
IF condition1.
|
|
63911
|
+
...
|
|
63912
|
+
ELSEIF condition2.
|
|
63913
|
+
...
|
|
63914
|
+
ENDIF.
|
|
63915
|
+
|
|
63916
|
+
CASE variable.
|
|
63917
|
+
WHEN value1.
|
|
63918
|
+
...
|
|
63919
|
+
WHEN value2.
|
|
63920
|
+
IF condition2.
|
|
63921
|
+
...
|
|
63922
|
+
ENDIF.
|
|
63909
63923
|
ENDCASE.`,
|
|
63910
63924
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63911
63925
|
};
|
|
@@ -64090,9 +64104,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
64090
64104
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
64091
64105
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
64092
64106
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
64093
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
64094
|
-
METHOD ${methodName.toLowerCase()}.
|
|
64095
|
-
RETURN. " todo, implement method
|
|
64107
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
64108
|
+
METHOD ${methodName.toLowerCase()}.
|
|
64109
|
+
RETURN. " todo, implement method
|
|
64096
64110
|
ENDMETHOD.`);
|
|
64097
64111
|
}
|
|
64098
64112
|
}
|
|
@@ -64271,14 +64285,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
64271
64285
|
key: "implicit_start_of_selection",
|
|
64272
64286
|
title: "Implicit START-OF-SELECTION",
|
|
64273
64287
|
shortDescription: `Add explicit selection screen event handling`,
|
|
64274
|
-
extendedInformation: `Only runs for executable programs
|
|
64275
|
-
|
|
64288
|
+
extendedInformation: `Only runs for executable programs
|
|
64289
|
+
|
|
64276
64290
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
64277
64291
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
64278
|
-
badExample: `REPORT zfoo.
|
|
64292
|
+
badExample: `REPORT zfoo.
|
|
64279
64293
|
WRITE 'hello'.`,
|
|
64280
|
-
goodExample: `
|
|
64281
|
-
START-OF-SELECTION.
|
|
64294
|
+
goodExample: `
|
|
64295
|
+
START-OF-SELECTION.
|
|
64282
64296
|
WRITE 'hello'.`,
|
|
64283
64297
|
};
|
|
64284
64298
|
}
|
|
@@ -64383,19 +64397,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
64383
64397
|
key: "in_statement_indentation",
|
|
64384
64398
|
title: "In-statement indentation",
|
|
64385
64399
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
64386
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64387
|
-
|
|
64388
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64400
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
64401
|
+
|
|
64402
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
64389
64403
|
to distinguish them better from code within the block.`,
|
|
64390
|
-
badExample: `IF 1 = 1
|
|
64391
|
-
AND 2 = 2.
|
|
64392
|
-
WRITE 'hello' &&
|
|
64393
|
-
'world'.
|
|
64404
|
+
badExample: `IF 1 = 1
|
|
64405
|
+
AND 2 = 2.
|
|
64406
|
+
WRITE 'hello' &&
|
|
64407
|
+
'world'.
|
|
64394
64408
|
ENDIF.`,
|
|
64395
|
-
goodExample: `IF 1 = 1
|
|
64396
|
-
AND 2 = 2.
|
|
64397
|
-
WRITE 'hello' &&
|
|
64398
|
-
'world'.
|
|
64409
|
+
goodExample: `IF 1 = 1
|
|
64410
|
+
AND 2 = 2.
|
|
64411
|
+
WRITE 'hello' &&
|
|
64412
|
+
'world'.
|
|
64399
64413
|
ENDIF.`,
|
|
64400
64414
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64401
64415
|
};
|
|
@@ -64521,23 +64535,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
64521
64535
|
title: "Indentation",
|
|
64522
64536
|
shortDescription: `Checks indentation`,
|
|
64523
64537
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
64524
|
-
badExample: `CLASS lcl DEFINITION.
|
|
64525
|
-
PRIVATE SECTION.
|
|
64526
|
-
METHODS constructor.
|
|
64527
|
-
ENDCLASS.
|
|
64528
|
-
|
|
64529
|
-
CLASS lcl IMPLEMENTATION.
|
|
64530
|
-
METHOD constructor.
|
|
64531
|
-
ENDMETHOD.
|
|
64538
|
+
badExample: `CLASS lcl DEFINITION.
|
|
64539
|
+
PRIVATE SECTION.
|
|
64540
|
+
METHODS constructor.
|
|
64541
|
+
ENDCLASS.
|
|
64542
|
+
|
|
64543
|
+
CLASS lcl IMPLEMENTATION.
|
|
64544
|
+
METHOD constructor.
|
|
64545
|
+
ENDMETHOD.
|
|
64532
64546
|
ENDCLASS.`,
|
|
64533
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
64534
|
-
PRIVATE SECTION.
|
|
64535
|
-
METHODS constructor.
|
|
64536
|
-
ENDCLASS.
|
|
64537
|
-
|
|
64538
|
-
CLASS lcl IMPLEMENTATION.
|
|
64539
|
-
METHOD constructor.
|
|
64540
|
-
ENDMETHOD.
|
|
64547
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
64548
|
+
PRIVATE SECTION.
|
|
64549
|
+
METHODS constructor.
|
|
64550
|
+
ENDCLASS.
|
|
64551
|
+
|
|
64552
|
+
CLASS lcl IMPLEMENTATION.
|
|
64553
|
+
METHOD constructor.
|
|
64554
|
+
ENDMETHOD.
|
|
64541
64555
|
ENDCLASS.`,
|
|
64542
64556
|
};
|
|
64543
64557
|
}
|
|
@@ -64941,9 +64955,9 @@ class IntfReferencingClas {
|
|
|
64941
64955
|
key: "intf_referencing_clas",
|
|
64942
64956
|
title: "INTF referencing CLAS",
|
|
64943
64957
|
shortDescription: `Interface contains references to class`,
|
|
64944
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64945
|
-
Only first level references are checked.
|
|
64946
|
-
Exception class references are ignored.
|
|
64958
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64959
|
+
Only first level references are checked.
|
|
64960
|
+
Exception class references are ignored.
|
|
64947
64961
|
Void references are ignored.`,
|
|
64948
64962
|
};
|
|
64949
64963
|
}
|
|
@@ -65028,9 +65042,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
65028
65042
|
title: "Invalid Table Index",
|
|
65029
65043
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
65030
65044
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65031
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
65045
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
65032
65046
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
65033
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
65047
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
65034
65048
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
65035
65049
|
};
|
|
65036
65050
|
}
|
|
@@ -65632,8 +65646,8 @@ class LineBreakStyle {
|
|
|
65632
65646
|
return {
|
|
65633
65647
|
key: "line_break_style",
|
|
65634
65648
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65635
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65636
|
-
|
|
65649
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65650
|
+
|
|
65637
65651
|
abapGit does not work with CRLF`,
|
|
65638
65652
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65639
65653
|
};
|
|
@@ -65702,7 +65716,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65702
65716
|
key: "line_length",
|
|
65703
65717
|
title: "Line length",
|
|
65704
65718
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65705
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65719
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65706
65720
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65707
65721
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65708
65722
|
};
|
|
@@ -65773,7 +65787,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65773
65787
|
key: "line_only_punc",
|
|
65774
65788
|
title: "Line containing only punctuation",
|
|
65775
65789
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65776
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65790
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65777
65791
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65778
65792
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65779
65793
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -66036,15 +66050,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
66036
66050
|
return {
|
|
66037
66051
|
key: "local_variable_names",
|
|
66038
66052
|
title: "Local variable naming conventions",
|
|
66039
|
-
shortDescription: `
|
|
66040
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66053
|
+
shortDescription: `
|
|
66054
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
66041
66055
|
Regexes are case-insensitive.`,
|
|
66042
66056
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
66043
|
-
badExample: `FORM bar.
|
|
66044
|
-
DATA foo.
|
|
66057
|
+
badExample: `FORM bar.
|
|
66058
|
+
DATA foo.
|
|
66045
66059
|
ENDFORM.`,
|
|
66046
|
-
goodExample: `FORM bar.
|
|
66047
|
-
DATA lv_foo.
|
|
66060
|
+
goodExample: `FORM bar.
|
|
66061
|
+
DATA lv_foo.
|
|
66048
66062
|
ENDFORM.`,
|
|
66049
66063
|
};
|
|
66050
66064
|
}
|
|
@@ -66196,9 +66210,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
66196
66210
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
66197
66211
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
66198
66212
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
66199
|
-
badExample: `DEFINE something.
|
|
66213
|
+
badExample: `DEFINE something.
|
|
66200
66214
|
END-OF-DEFINITION.`,
|
|
66201
|
-
goodExample: `DEFINE _something.
|
|
66215
|
+
goodExample: `DEFINE _something.
|
|
66202
66216
|
END-OF-DEFINITION.`,
|
|
66203
66217
|
};
|
|
66204
66218
|
}
|
|
@@ -66271,10 +66285,10 @@ class MainFileContents {
|
|
|
66271
66285
|
key: "main_file_contents",
|
|
66272
66286
|
title: "Main file contents",
|
|
66273
66287
|
shortDescription: `Checks related to report declarations.`,
|
|
66274
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
66275
|
-
|
|
66276
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
66277
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
66288
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
66289
|
+
|
|
66290
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
66291
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
66278
66292
|
`,
|
|
66279
66293
|
};
|
|
66280
66294
|
}
|
|
@@ -66390,17 +66404,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
66390
66404
|
title: "Too many parentheses",
|
|
66391
66405
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
66392
66406
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
66393
|
-
badExample: `
|
|
66394
|
-
IF ( destination IS INITIAL ).
|
|
66395
|
-
ENDIF.
|
|
66396
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66397
|
-
ENDIF.
|
|
66407
|
+
badExample: `
|
|
66408
|
+
IF ( destination IS INITIAL ).
|
|
66409
|
+
ENDIF.
|
|
66410
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
66411
|
+
ENDIF.
|
|
66398
66412
|
`,
|
|
66399
|
-
goodExample: `
|
|
66400
|
-
IF destination IS INITIAL.
|
|
66401
|
-
ENDIF.
|
|
66402
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
66403
|
-
ENDIF.
|
|
66413
|
+
goodExample: `
|
|
66414
|
+
IF destination IS INITIAL.
|
|
66415
|
+
ENDIF.
|
|
66416
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
66417
|
+
ENDIF.
|
|
66404
66418
|
`,
|
|
66405
66419
|
};
|
|
66406
66420
|
}
|
|
@@ -66574,14 +66588,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66574
66588
|
title: "Max one method parameter definition per line",
|
|
66575
66589
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66576
66590
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66577
|
-
badExample: `
|
|
66578
|
-
METHODS apps_scope_token
|
|
66579
|
-
IMPORTING
|
|
66591
|
+
badExample: `
|
|
66592
|
+
METHODS apps_scope_token
|
|
66593
|
+
IMPORTING
|
|
66580
66594
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66581
|
-
goodExample: `
|
|
66582
|
-
METHODS apps_scope_token
|
|
66583
|
-
IMPORTING
|
|
66584
|
-
body TYPE bodyapps_scope_token
|
|
66595
|
+
goodExample: `
|
|
66596
|
+
METHODS apps_scope_token
|
|
66597
|
+
IMPORTING
|
|
66598
|
+
body TYPE bodyapps_scope_token
|
|
66585
66599
|
client_id TYPE str.`,
|
|
66586
66600
|
};
|
|
66587
66601
|
}
|
|
@@ -66646,11 +66660,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66646
66660
|
key: "max_one_statement",
|
|
66647
66661
|
title: "Max one statement per line",
|
|
66648
66662
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66649
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66650
|
-
|
|
66651
|
-
Does not report anything for chained statements.
|
|
66652
|
-
|
|
66653
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66663
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66664
|
+
|
|
66665
|
+
Does not report anything for chained statements.
|
|
66666
|
+
|
|
66667
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66654
66668
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66655
66669
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66656
66670
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66988,8 +67002,8 @@ class MethodLength {
|
|
|
66988
67002
|
key: "method_length",
|
|
66989
67003
|
title: "Method/Form Length",
|
|
66990
67004
|
shortDescription: `Checks relating to method/form length.`,
|
|
66991
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66992
|
-
|
|
67005
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
67006
|
+
|
|
66993
67007
|
Abstract methods without statements are considered okay.`,
|
|
66994
67008
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66995
67009
|
};
|
|
@@ -67094,20 +67108,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
67094
67108
|
key: "method_overwrites_builtin",
|
|
67095
67109
|
title: "Method name overwrites builtin function",
|
|
67096
67110
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
67097
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
67098
|
-
|
|
67099
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
67100
|
-
|
|
67111
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
67112
|
+
|
|
67113
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
67114
|
+
|
|
67101
67115
|
Interface method names are ignored`,
|
|
67102
67116
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67103
|
-
badExample: `CLASS lcl DEFINITION.
|
|
67104
|
-
PUBLIC SECTION.
|
|
67105
|
-
METHODS matches.
|
|
67106
|
-
ENDCLASS.
|
|
67107
|
-
|
|
67108
|
-
CLASS lcl IMPLEMENTATION.
|
|
67109
|
-
METHOD matches.
|
|
67110
|
-
ENDMETHOD.
|
|
67117
|
+
badExample: `CLASS lcl DEFINITION.
|
|
67118
|
+
PUBLIC SECTION.
|
|
67119
|
+
METHODS matches.
|
|
67120
|
+
ENDCLASS.
|
|
67121
|
+
|
|
67122
|
+
CLASS lcl IMPLEMENTATION.
|
|
67123
|
+
METHOD matches.
|
|
67124
|
+
ENDMETHOD.
|
|
67111
67125
|
ENDCLASS.`,
|
|
67112
67126
|
};
|
|
67113
67127
|
}
|
|
@@ -67298,12 +67312,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
67298
67312
|
// eslint-disable-next-line max-len
|
|
67299
67313
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
67300
67314
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67301
|
-
badExample: `CLASS lcl DEFINITION.
|
|
67302
|
-
PUBLIC SECTION.
|
|
67303
|
-
METHODS
|
|
67304
|
-
foobar
|
|
67305
|
-
EXPORTING foo TYPE i
|
|
67306
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
67315
|
+
badExample: `CLASS lcl DEFINITION.
|
|
67316
|
+
PUBLIC SECTION.
|
|
67317
|
+
METHODS
|
|
67318
|
+
foobar
|
|
67319
|
+
EXPORTING foo TYPE i
|
|
67320
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
67307
67321
|
ENDCLASS.`,
|
|
67308
67322
|
};
|
|
67309
67323
|
}
|
|
@@ -67683,7 +67697,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67683
67697
|
key: "nesting",
|
|
67684
67698
|
title: "Check nesting depth",
|
|
67685
67699
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67686
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67700
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67687
67701
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67688
67702
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67689
67703
|
};
|
|
@@ -67926,7 +67940,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67926
67940
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67927
67941
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67928
67942
|
badExample: `var1 = var2 = var3.`,
|
|
67929
|
-
goodExample: `var2 = var3.
|
|
67943
|
+
goodExample: `var2 = var3.
|
|
67930
67944
|
var1 = var2.`,
|
|
67931
67945
|
};
|
|
67932
67946
|
}
|
|
@@ -67985,8 +67999,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67985
67999
|
key: "no_external_form_calls",
|
|
67986
68000
|
title: "No external FORM calls",
|
|
67987
68001
|
shortDescription: `Detect external form calls`,
|
|
67988
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67989
|
-
|
|
68002
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
68003
|
+
|
|
67990
68004
|
PERFORM foo(bar).`,
|
|
67991
68005
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67992
68006
|
};
|
|
@@ -68047,17 +68061,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
68047
68061
|
key: "no_inline_in_optional_branches",
|
|
68048
68062
|
title: "Don't declare inline in optional branches",
|
|
68049
68063
|
shortDescription: `Don't declare inline in optional branches`,
|
|
68050
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
68051
|
-
|
|
68052
|
-
Considered optional branches:
|
|
68053
|
-
* inside IF/ELSEIF/ELSE
|
|
68054
|
-
* inside LOOP
|
|
68055
|
-
* inside WHILE
|
|
68056
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
68057
|
-
* inside DO
|
|
68058
|
-
* inside SELECT loops
|
|
68059
|
-
|
|
68060
|
-
Not considered optional branches:
|
|
68064
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
68065
|
+
|
|
68066
|
+
Considered optional branches:
|
|
68067
|
+
* inside IF/ELSEIF/ELSE
|
|
68068
|
+
* inside LOOP
|
|
68069
|
+
* inside WHILE
|
|
68070
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
68071
|
+
* inside DO
|
|
68072
|
+
* inside SELECT loops
|
|
68073
|
+
|
|
68074
|
+
Not considered optional branches:
|
|
68061
68075
|
* TRY/CATCH/CLEANUP`,
|
|
68062
68076
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68063
68077
|
};
|
|
@@ -68157,12 +68171,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
68157
68171
|
key: "no_prefixes",
|
|
68158
68172
|
title: "No Prefixes",
|
|
68159
68173
|
shortDescription: `Dont use hungarian notation`,
|
|
68160
|
-
extendedInformation: `
|
|
68161
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
68162
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
68163
|
-
|
|
68164
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
68165
|
-
|
|
68174
|
+
extendedInformation: `
|
|
68175
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
68176
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
68177
|
+
|
|
68178
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
68179
|
+
|
|
68166
68180
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
68167
68181
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
68168
68182
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -68341,7 +68355,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
68341
68355
|
return {
|
|
68342
68356
|
key: "no_public_attributes",
|
|
68343
68357
|
title: "No public attributes",
|
|
68344
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
68358
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
68345
68359
|
Exceptions are excluded from this rule.`,
|
|
68346
68360
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
68347
68361
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -68442,13 +68456,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
68442
68456
|
key: "no_yoda_conditions",
|
|
68443
68457
|
title: "No Yoda conditions",
|
|
68444
68458
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
68445
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68446
|
-
|
|
68459
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
68460
|
+
|
|
68447
68461
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
68448
68462
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68449
|
-
badExample: `IF 0 <> sy-subrc.
|
|
68463
|
+
badExample: `IF 0 <> sy-subrc.
|
|
68450
68464
|
ENDIF.`,
|
|
68451
|
-
goodExample: `IF sy-subrc <> 0.
|
|
68465
|
+
goodExample: `IF sy-subrc <> 0.
|
|
68452
68466
|
ENDIF.`,
|
|
68453
68467
|
};
|
|
68454
68468
|
}
|
|
@@ -68549,8 +68563,8 @@ class NROBConsistency {
|
|
|
68549
68563
|
key: "nrob_consistency",
|
|
68550
68564
|
title: "Number range consistency",
|
|
68551
68565
|
shortDescription: `Consistency checks for number ranges`,
|
|
68552
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68553
|
-
|
|
68566
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68567
|
+
|
|
68554
68568
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
68555
68569
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68556
68570
|
};
|
|
@@ -68827,58 +68841,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68827
68841
|
title: "Obsolete statements",
|
|
68828
68842
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68829
68843
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68830
|
-
extendedInformation: `
|
|
68831
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68832
|
-
|
|
68833
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68834
|
-
|
|
68835
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68836
|
-
|
|
68837
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68838
|
-
|
|
68839
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68840
|
-
|
|
68841
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68842
|
-
|
|
68843
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68844
|
-
|
|
68845
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68846
|
-
|
|
68847
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68848
|
-
|
|
68849
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68850
|
-
|
|
68851
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68852
|
-
|
|
68853
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68854
|
-
|
|
68855
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68856
|
-
|
|
68857
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68858
|
-
|
|
68859
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68860
|
-
SELECT COUNT(*) is considered okay
|
|
68861
|
-
|
|
68862
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68863
|
-
|
|
68864
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68865
|
-
|
|
68866
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68867
|
-
|
|
68868
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68869
|
-
|
|
68870
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68871
|
-
|
|
68844
|
+
extendedInformation: `
|
|
68845
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68846
|
+
|
|
68847
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68848
|
+
|
|
68849
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68850
|
+
|
|
68851
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68852
|
+
|
|
68853
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68854
|
+
|
|
68855
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68856
|
+
|
|
68857
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68858
|
+
|
|
68859
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68860
|
+
|
|
68861
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68862
|
+
|
|
68863
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68864
|
+
|
|
68865
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68866
|
+
|
|
68867
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68868
|
+
|
|
68869
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68870
|
+
|
|
68871
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68872
|
+
|
|
68873
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68874
|
+
SELECT COUNT(*) is considered okay
|
|
68875
|
+
|
|
68876
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68877
|
+
|
|
68878
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68879
|
+
|
|
68880
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68881
|
+
|
|
68882
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68883
|
+
|
|
68884
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68885
|
+
|
|
68872
68886
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68873
|
-
badExample: `REFRESH itab.
|
|
68874
|
-
|
|
68875
|
-
COMPUTE foo = 2 + 2.
|
|
68876
|
-
|
|
68877
|
-
MULTIPLY lv_foo BY 2.
|
|
68878
|
-
|
|
68879
|
-
INTERFACE intf LOAD.
|
|
68880
|
-
|
|
68881
|
-
IF foo IS SUPPLIED.
|
|
68887
|
+
badExample: `REFRESH itab.
|
|
68888
|
+
|
|
68889
|
+
COMPUTE foo = 2 + 2.
|
|
68890
|
+
|
|
68891
|
+
MULTIPLY lv_foo BY 2.
|
|
68892
|
+
|
|
68893
|
+
INTERFACE intf LOAD.
|
|
68894
|
+
|
|
68895
|
+
IF foo IS SUPPLIED.
|
|
68882
68896
|
ENDIF.`,
|
|
68883
68897
|
};
|
|
68884
68898
|
}
|
|
@@ -69218,9 +69232,9 @@ class OmitParameterName {
|
|
|
69218
69232
|
key: "omit_parameter_name",
|
|
69219
69233
|
title: "Omit parameter name",
|
|
69220
69234
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
69221
|
-
extendedInformation: `
|
|
69222
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
69223
|
-
|
|
69235
|
+
extendedInformation: `
|
|
69236
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
69237
|
+
|
|
69224
69238
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
69225
69239
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
69226
69240
|
badExample: `method( param = 2 ).`,
|
|
@@ -69426,20 +69440,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
69426
69440
|
shortDescription: `Omit RECEIVING`,
|
|
69427
69441
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
69428
69442
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69429
|
-
badExample: `
|
|
69430
|
-
upload_pack(
|
|
69431
|
-
EXPORTING
|
|
69432
|
-
io_client = lo_client
|
|
69433
|
-
iv_url = iv_url
|
|
69434
|
-
iv_deepen_level = iv_deepen_level
|
|
69435
|
-
it_hashes = lt_hashes
|
|
69436
|
-
RECEIVING
|
|
69443
|
+
badExample: `
|
|
69444
|
+
upload_pack(
|
|
69445
|
+
EXPORTING
|
|
69446
|
+
io_client = lo_client
|
|
69447
|
+
iv_url = iv_url
|
|
69448
|
+
iv_deepen_level = iv_deepen_level
|
|
69449
|
+
it_hashes = lt_hashes
|
|
69450
|
+
RECEIVING
|
|
69437
69451
|
rt_objects = et_objects ).`,
|
|
69438
|
-
goodExample: `
|
|
69439
|
-
et_objects = upload_pack(
|
|
69440
|
-
io_client = lo_client
|
|
69441
|
-
iv_url = iv_url
|
|
69442
|
-
iv_deepen_level = iv_deepen_level
|
|
69452
|
+
goodExample: `
|
|
69453
|
+
et_objects = upload_pack(
|
|
69454
|
+
io_client = lo_client
|
|
69455
|
+
iv_url = iv_url
|
|
69456
|
+
iv_deepen_level = iv_deepen_level
|
|
69443
69457
|
it_hashes = lt_hashes ).`,
|
|
69444
69458
|
};
|
|
69445
69459
|
}
|
|
@@ -69503,8 +69517,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
69503
69517
|
return {
|
|
69504
69518
|
key: "parser_702_chaining",
|
|
69505
69519
|
title: "Parser Error, bad chanining on 702",
|
|
69506
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69507
|
-
this rule finds these and reports errors.
|
|
69520
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
69521
|
+
this rule finds these and reports errors.
|
|
69508
69522
|
Only active on target version 702 and below.`,
|
|
69509
69523
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69510
69524
|
};
|
|
@@ -69584,8 +69598,8 @@ class ParserError {
|
|
|
69584
69598
|
return {
|
|
69585
69599
|
key: "parser_error",
|
|
69586
69600
|
title: "Parser error",
|
|
69587
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69588
|
-
|
|
69601
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69602
|
+
|
|
69589
69603
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69590
69604
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69591
69605
|
};
|
|
@@ -69670,7 +69684,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69670
69684
|
return {
|
|
69671
69685
|
key: "parser_missing_space",
|
|
69672
69686
|
title: "Parser Error, missing space",
|
|
69673
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69687
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69674
69688
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69675
69689
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69676
69690
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -70093,25 +70107,25 @@ class PreferInline {
|
|
|
70093
70107
|
key: "prefer_inline",
|
|
70094
70108
|
title: "Prefer Inline Declarations",
|
|
70095
70109
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
70096
|
-
extendedInformation: `EXPERIMENTAL
|
|
70097
|
-
|
|
70098
|
-
Activates if language version is v740sp02 or above.
|
|
70099
|
-
|
|
70100
|
-
Variables must be local(METHOD or FORM).
|
|
70101
|
-
|
|
70102
|
-
No generic or void typed variables. No syntax errors.
|
|
70103
|
-
|
|
70104
|
-
First position used must be a full/pure write.
|
|
70105
|
-
|
|
70106
|
-
Move statment is not a cast(?=)
|
|
70107
|
-
|
|
70110
|
+
extendedInformation: `EXPERIMENTAL
|
|
70111
|
+
|
|
70112
|
+
Activates if language version is v740sp02 or above.
|
|
70113
|
+
|
|
70114
|
+
Variables must be local(METHOD or FORM).
|
|
70115
|
+
|
|
70116
|
+
No generic or void typed variables. No syntax errors.
|
|
70117
|
+
|
|
70118
|
+
First position used must be a full/pure write.
|
|
70119
|
+
|
|
70120
|
+
Move statment is not a cast(?=)
|
|
70121
|
+
|
|
70108
70122
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
70109
70123
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
70110
|
-
badExample: `DATA foo TYPE i.
|
|
70111
|
-
foo = 2.
|
|
70112
|
-
DATA percentage TYPE decfloat34.
|
|
70124
|
+
badExample: `DATA foo TYPE i.
|
|
70125
|
+
foo = 2.
|
|
70126
|
+
DATA percentage TYPE decfloat34.
|
|
70113
70127
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
70114
|
-
goodExample: `DATA(foo) = 2.
|
|
70128
|
+
goodExample: `DATA(foo) = 2.
|
|
70115
70129
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
70116
70130
|
};
|
|
70117
70131
|
}
|
|
@@ -70325,18 +70339,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
70325
70339
|
key: "prefer_is_not",
|
|
70326
70340
|
title: "Prefer IS NOT to NOT IS",
|
|
70327
70341
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
70328
|
-
extendedInformation: `
|
|
70329
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
70330
|
-
|
|
70342
|
+
extendedInformation: `
|
|
70343
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
70344
|
+
|
|
70331
70345
|
"if not is_valid( )." examples are skipped`,
|
|
70332
70346
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70333
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
70334
|
-
IF variable NP 'TODO*'.
|
|
70335
|
-
IF variable <> 42.
|
|
70347
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
70348
|
+
IF variable NP 'TODO*'.
|
|
70349
|
+
IF variable <> 42.
|
|
70336
70350
|
IF variable CO 'hello'.`,
|
|
70337
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
70338
|
-
IF NOT variable CP 'TODO*'.
|
|
70339
|
-
IF NOT variable = 42.
|
|
70351
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
70352
|
+
IF NOT variable CP 'TODO*'.
|
|
70353
|
+
IF NOT variable = 42.
|
|
70340
70354
|
IF NOT variable CA 'hello'.`,
|
|
70341
70355
|
};
|
|
70342
70356
|
}
|
|
@@ -70524,14 +70538,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
70524
70538
|
key: "prefer_raise_exception_new",
|
|
70525
70539
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
70526
70540
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
70527
|
-
extendedInformation: `
|
|
70528
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70529
|
-
|
|
70541
|
+
extendedInformation: `
|
|
70542
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
70543
|
+
|
|
70530
70544
|
From 752 and up`,
|
|
70531
70545
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
70532
70546
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
70533
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70534
|
-
EXPORTING
|
|
70547
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
70548
|
+
EXPORTING
|
|
70535
70549
|
previous = exception.`,
|
|
70536
70550
|
};
|
|
70537
70551
|
}
|
|
@@ -70609,12 +70623,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70609
70623
|
key: "prefer_returning_to_exporting",
|
|
70610
70624
|
title: "Prefer RETURNING to EXPORTING",
|
|
70611
70625
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70612
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70626
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70613
70627
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70614
70628
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70615
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70616
|
-
PUBLIC SECTION.
|
|
70617
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70629
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70630
|
+
PUBLIC SECTION.
|
|
70631
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70618
70632
|
ENDCLASS.`,
|
|
70619
70633
|
};
|
|
70620
70634
|
}
|
|
@@ -70710,8 +70724,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70710
70724
|
key: "prefer_xsdbool",
|
|
70711
70725
|
title: "Prefer xsdbool over boolc",
|
|
70712
70726
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70713
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70714
|
-
|
|
70727
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70728
|
+
|
|
70715
70729
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70716
70730
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70717
70731
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70783,9 +70797,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70783
70797
|
title: "Preferred compare operator",
|
|
70784
70798
|
shortDescription: `Configure undesired operator variants`,
|
|
70785
70799
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70786
|
-
badExample: `IF foo EQ bar.
|
|
70800
|
+
badExample: `IF foo EQ bar.
|
|
70787
70801
|
ENDIF.`,
|
|
70788
|
-
goodExample: `IF foo = bar.
|
|
70802
|
+
goodExample: `IF foo = bar.
|
|
70789
70803
|
ENDIF.`,
|
|
70790
70804
|
};
|
|
70791
70805
|
}
|
|
@@ -71009,26 +71023,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
71009
71023
|
key: "reduce_procedural_code",
|
|
71010
71024
|
title: "Reduce procedural code",
|
|
71011
71025
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
71012
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
71013
|
-
|
|
71014
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
71015
|
-
|
|
71026
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
71027
|
+
|
|
71028
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
71029
|
+
|
|
71016
71030
|
Comments are not counted as statements.`,
|
|
71017
71031
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
71018
|
-
badExample: `FORM foo.
|
|
71019
|
-
DATA lv_bar TYPE i.
|
|
71020
|
-
lv_bar = 2 + 2.
|
|
71021
|
-
IF lv_bar = 4.
|
|
71022
|
-
WRITE 'hello world'.
|
|
71023
|
-
ENDIF.
|
|
71024
|
-
DATA lv_bar TYPE i.
|
|
71025
|
-
lv_bar = 2 + 2.
|
|
71026
|
-
IF lv_bar = 4.
|
|
71027
|
-
WRITE 'hello world'.
|
|
71028
|
-
ENDIF.
|
|
71032
|
+
badExample: `FORM foo.
|
|
71033
|
+
DATA lv_bar TYPE i.
|
|
71034
|
+
lv_bar = 2 + 2.
|
|
71035
|
+
IF lv_bar = 4.
|
|
71036
|
+
WRITE 'hello world'.
|
|
71037
|
+
ENDIF.
|
|
71038
|
+
DATA lv_bar TYPE i.
|
|
71039
|
+
lv_bar = 2 + 2.
|
|
71040
|
+
IF lv_bar = 4.
|
|
71041
|
+
WRITE 'hello world'.
|
|
71042
|
+
ENDIF.
|
|
71029
71043
|
ENDFORM.`,
|
|
71030
|
-
goodExample: `FORM foo.
|
|
71031
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
71044
|
+
goodExample: `FORM foo.
|
|
71045
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
71032
71046
|
ENDFORM.`,
|
|
71033
71047
|
};
|
|
71034
71048
|
}
|
|
@@ -71272,10 +71286,10 @@ class RemoveDescriptions {
|
|
|
71272
71286
|
return {
|
|
71273
71287
|
key: "remove_descriptions",
|
|
71274
71288
|
title: "Remove descriptions",
|
|
71275
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
71276
|
-
|
|
71277
|
-
Class descriptions are required, see rule description_empty.
|
|
71278
|
-
|
|
71289
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
71290
|
+
|
|
71291
|
+
Class descriptions are required, see rule description_empty.
|
|
71292
|
+
|
|
71279
71293
|
Consider using ABAP Doc for documentation.`,
|
|
71280
71294
|
tags: [],
|
|
71281
71295
|
};
|
|
@@ -71400,14 +71414,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
71400
71414
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71401
71415
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
71402
71416
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
71403
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
71417
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
71404
71418
|
DESTINATION lv_rfc.`,
|
|
71405
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71406
|
-
DESTINATION lv_rfc
|
|
71407
|
-
EXCEPTIONS
|
|
71408
|
-
system_failure = 1 MESSAGE msg
|
|
71409
|
-
communication_failure = 2 MESSAGE msg
|
|
71410
|
-
resource_failure = 3
|
|
71419
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
71420
|
+
DESTINATION lv_rfc
|
|
71421
|
+
EXCEPTIONS
|
|
71422
|
+
system_failure = 1 MESSAGE msg
|
|
71423
|
+
communication_failure = 2 MESSAGE msg
|
|
71424
|
+
resource_failure = 3
|
|
71411
71425
|
OTHERS = 4.`,
|
|
71412
71426
|
};
|
|
71413
71427
|
}
|
|
@@ -71491,11 +71505,11 @@ class SelectAddOrderBy {
|
|
|
71491
71505
|
key: "select_add_order_by",
|
|
71492
71506
|
title: "SELECT add ORDER BY",
|
|
71493
71507
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
71494
|
-
extendedInformation: `
|
|
71495
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71496
|
-
|
|
71497
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
71498
|
-
|
|
71508
|
+
extendedInformation: `
|
|
71509
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
71510
|
+
|
|
71511
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
71512
|
+
|
|
71499
71513
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
71500
71514
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
71501
71515
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71626,14 +71640,14 @@ class SelectPerformance {
|
|
|
71626
71640
|
key: "select_performance",
|
|
71627
71641
|
title: "SELECT performance",
|
|
71628
71642
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71629
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71630
|
-
|
|
71643
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71644
|
+
|
|
71631
71645
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71632
71646
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71633
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71634
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71647
|
+
badExample: `SELECT field1, field2 FROM table
|
|
71648
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71635
71649
|
ENDSELECT.`,
|
|
71636
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71650
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71637
71651
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71638
71652
|
};
|
|
71639
71653
|
}
|
|
@@ -71747,8 +71761,8 @@ class SelectSingleFullKey {
|
|
|
71747
71761
|
key: "select_single_full_key",
|
|
71748
71762
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71749
71763
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71750
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71751
|
-
|
|
71764
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71765
|
+
|
|
71752
71766
|
If the statement contains a JOIN it is not checked`,
|
|
71753
71767
|
pseudoComment: "EC CI_NOORDER",
|
|
71754
71768
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -72176,8 +72190,8 @@ class SICFConsistency {
|
|
|
72176
72190
|
key: "sicf_consistency",
|
|
72177
72191
|
title: "SICF consistency",
|
|
72178
72192
|
shortDescription: `Checks the validity of ICF services`,
|
|
72179
|
-
extendedInformation: `* Class defined in handler must exist
|
|
72180
|
-
* Class must not have any syntax errors
|
|
72193
|
+
extendedInformation: `* Class defined in handler must exist
|
|
72194
|
+
* Class must not have any syntax errors
|
|
72181
72195
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
72182
72196
|
};
|
|
72183
72197
|
}
|
|
@@ -72289,23 +72303,23 @@ class SlowParameterPassing {
|
|
|
72289
72303
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
72290
72304
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
72291
72305
|
tags: [_irule_1.RuleTag.Performance],
|
|
72292
|
-
badExample: `CLASS lcl DEFINITION.
|
|
72293
|
-
PUBLIC SECTION.
|
|
72294
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
72295
|
-
ENDCLASS.
|
|
72296
|
-
CLASS lcl IMPLEMENTATION.
|
|
72297
|
-
METHOD bar.
|
|
72298
|
-
WRITE sdf.
|
|
72299
|
-
ENDMETHOD.
|
|
72306
|
+
badExample: `CLASS lcl DEFINITION.
|
|
72307
|
+
PUBLIC SECTION.
|
|
72308
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
72309
|
+
ENDCLASS.
|
|
72310
|
+
CLASS lcl IMPLEMENTATION.
|
|
72311
|
+
METHOD bar.
|
|
72312
|
+
WRITE sdf.
|
|
72313
|
+
ENDMETHOD.
|
|
72300
72314
|
ENDCLASS.`,
|
|
72301
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
72302
|
-
PUBLIC SECTION.
|
|
72303
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
72304
|
-
ENDCLASS.
|
|
72305
|
-
CLASS lcl IMPLEMENTATION.
|
|
72306
|
-
METHOD bar.
|
|
72307
|
-
WRITE sdf.
|
|
72308
|
-
ENDMETHOD.
|
|
72315
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
72316
|
+
PUBLIC SECTION.
|
|
72317
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
72318
|
+
ENDCLASS.
|
|
72319
|
+
CLASS lcl IMPLEMENTATION.
|
|
72320
|
+
METHOD bar.
|
|
72321
|
+
WRITE sdf.
|
|
72322
|
+
ENDMETHOD.
|
|
72309
72323
|
ENDCLASS.`,
|
|
72310
72324
|
};
|
|
72311
72325
|
}
|
|
@@ -72576,8 +72590,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
72576
72590
|
key: "space_before_dot",
|
|
72577
72591
|
title: "Space before dot",
|
|
72578
72592
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
72579
|
-
extendedInformation: `
|
|
72580
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72593
|
+
extendedInformation: `
|
|
72594
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72581
72595
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
72582
72596
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72583
72597
|
badExample: `WRITE bar .`,
|
|
@@ -72763,12 +72777,12 @@ class SQLValueConversion {
|
|
|
72763
72777
|
key: "sql_value_conversion",
|
|
72764
72778
|
title: "Implicit SQL Value Conversion",
|
|
72765
72779
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72766
|
-
extendedInformation: `
|
|
72767
|
-
* Integer to CHAR conversion
|
|
72768
|
-
* Integer to NUMC conversion
|
|
72769
|
-
* NUMC to Integer conversion
|
|
72770
|
-
* CHAR to Integer conversion
|
|
72771
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72780
|
+
extendedInformation: `
|
|
72781
|
+
* Integer to CHAR conversion
|
|
72782
|
+
* Integer to NUMC conversion
|
|
72783
|
+
* NUMC to Integer conversion
|
|
72784
|
+
* CHAR to Integer conversion
|
|
72785
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72772
72786
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72773
72787
|
tags: [],
|
|
72774
72788
|
};
|
|
@@ -72840,7 +72854,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72840
72854
|
key: "start_at_tab",
|
|
72841
72855
|
title: "Start at tab",
|
|
72842
72856
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72843
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72857
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72844
72858
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72845
72859
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72846
72860
|
badExample: ` WRITE a.`,
|
|
@@ -73017,12 +73031,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
73017
73031
|
key: "strict_sql",
|
|
73018
73032
|
title: "Strict SQL",
|
|
73019
73033
|
shortDescription: `Strict SQL`,
|
|
73020
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
73021
|
-
|
|
73022
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
73023
|
-
|
|
73024
|
-
Also see separate rule sql_escape_host_variables
|
|
73025
|
-
|
|
73034
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
73035
|
+
|
|
73036
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
73037
|
+
|
|
73038
|
+
Also see separate rule sql_escape_host_variables
|
|
73039
|
+
|
|
73026
73040
|
Activates from v750 and up`,
|
|
73027
73041
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
73028
73042
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -73276,11 +73290,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
73276
73290
|
key: "sy_modification",
|
|
73277
73291
|
title: "Modification of SY fields",
|
|
73278
73292
|
shortDescription: `Finds modification of sy fields`,
|
|
73279
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
73280
|
-
|
|
73293
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
73294
|
+
|
|
73281
73295
|
Changes to SY-TVAR* fields are not reported`,
|
|
73282
73296
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73283
|
-
badExample: `sy-uname = 2.
|
|
73297
|
+
badExample: `sy-uname = 2.
|
|
73284
73298
|
sy = sy.`,
|
|
73285
73299
|
};
|
|
73286
73300
|
}
|
|
@@ -73342,8 +73356,8 @@ class TABLEnhancementCategory {
|
|
|
73342
73356
|
key: "tabl_enhancement_category",
|
|
73343
73357
|
title: "TABL enhancement category must be set",
|
|
73344
73358
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
73345
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73346
|
-
|
|
73359
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
73360
|
+
|
|
73347
73361
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
73348
73362
|
tags: [],
|
|
73349
73363
|
};
|
|
@@ -73408,8 +73422,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
73408
73422
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
73409
73423
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
73410
73424
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73411
|
-
badExample: `FORM foo.
|
|
73412
|
-
TABLES t100.
|
|
73425
|
+
badExample: `FORM foo.
|
|
73426
|
+
TABLES t100.
|
|
73413
73427
|
ENDFORM.`,
|
|
73414
73428
|
goodExample: `TABLES t000.`,
|
|
73415
73429
|
};
|
|
@@ -73537,9 +73551,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
73537
73551
|
title: "Type FORM parameters",
|
|
73538
73552
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
73539
73553
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73540
|
-
badExample: `FORM foo USING bar.
|
|
73554
|
+
badExample: `FORM foo USING bar.
|
|
73541
73555
|
ENDFORM.`,
|
|
73542
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
73556
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
73543
73557
|
ENDFORM.`,
|
|
73544
73558
|
};
|
|
73545
73559
|
}
|
|
@@ -74212,38 +74226,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
74212
74226
|
key: "unnecessary_pragma",
|
|
74213
74227
|
title: "Unnecessary Pragma",
|
|
74214
74228
|
shortDescription: `Finds pragmas which can be removed`,
|
|
74215
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
74216
|
-
|
|
74217
|
-
* NEEDED without definition
|
|
74218
|
-
|
|
74219
|
-
* NO_TEXT without texts
|
|
74220
|
-
|
|
74221
|
-
* SUBRC_OK where sy-subrc is checked
|
|
74222
|
-
|
|
74229
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
74230
|
+
|
|
74231
|
+
* NEEDED without definition
|
|
74232
|
+
|
|
74233
|
+
* NO_TEXT without texts
|
|
74234
|
+
|
|
74235
|
+
* SUBRC_OK where sy-subrc is checked
|
|
74236
|
+
|
|
74223
74237
|
NO_HANDLER inside macros are not checked`,
|
|
74224
74238
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
74225
|
-
badExample: `TRY.
|
|
74226
|
-
...
|
|
74227
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
74228
|
-
RETURN. " it has a handler
|
|
74229
|
-
ENDTRY.
|
|
74230
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
74231
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
74232
|
-
IF sy-subrc <> 0.
|
|
74239
|
+
badExample: `TRY.
|
|
74240
|
+
...
|
|
74241
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
74242
|
+
RETURN. " it has a handler
|
|
74243
|
+
ENDTRY.
|
|
74244
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
74245
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
74246
|
+
IF sy-subrc <> 0.
|
|
74233
74247
|
ENDIF.`,
|
|
74234
|
-
goodExample: `TRY.
|
|
74235
|
-
...
|
|
74236
|
-
CATCH zcx_abapgit_exception.
|
|
74237
|
-
RETURN.
|
|
74238
|
-
ENDTRY.
|
|
74239
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
74240
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
74241
|
-
IF sy-subrc <> 0.
|
|
74242
|
-
ENDIF.
|
|
74243
|
-
|
|
74244
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
74245
|
-
test1 TYPE string,
|
|
74246
|
-
test2 TYPE string,
|
|
74248
|
+
goodExample: `TRY.
|
|
74249
|
+
...
|
|
74250
|
+
CATCH zcx_abapgit_exception.
|
|
74251
|
+
RETURN.
|
|
74252
|
+
ENDTRY.
|
|
74253
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
74254
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
74255
|
+
IF sy-subrc <> 0.
|
|
74256
|
+
ENDIF.
|
|
74257
|
+
|
|
74258
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
74259
|
+
test1 TYPE string,
|
|
74260
|
+
test2 TYPE string,
|
|
74247
74261
|
END OF blah.`,
|
|
74248
74262
|
};
|
|
74249
74263
|
}
|
|
@@ -74410,18 +74424,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
74410
74424
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
74411
74425
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
74412
74426
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
74413
|
-
badExample: `FORM hello1.
|
|
74414
|
-
WRITE 'world'.
|
|
74415
|
-
RETURN.
|
|
74416
|
-
ENDFORM.
|
|
74417
|
-
|
|
74418
|
-
FORM foo.
|
|
74419
|
-
IF 1 = 2.
|
|
74420
|
-
RETURN.
|
|
74421
|
-
ENDIF.
|
|
74427
|
+
badExample: `FORM hello1.
|
|
74428
|
+
WRITE 'world'.
|
|
74429
|
+
RETURN.
|
|
74430
|
+
ENDFORM.
|
|
74431
|
+
|
|
74432
|
+
FORM foo.
|
|
74433
|
+
IF 1 = 2.
|
|
74434
|
+
RETURN.
|
|
74435
|
+
ENDIF.
|
|
74422
74436
|
ENDFORM.`,
|
|
74423
|
-
goodExample: `FORM hello2.
|
|
74424
|
-
WRITE 'world'.
|
|
74437
|
+
goodExample: `FORM hello2.
|
|
74438
|
+
WRITE 'world'.
|
|
74425
74439
|
ENDFORM.`,
|
|
74426
74440
|
};
|
|
74427
74441
|
}
|
|
@@ -74772,13 +74786,13 @@ class UnusedMacros {
|
|
|
74772
74786
|
title: "Unused macros",
|
|
74773
74787
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74774
74788
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74775
|
-
badExample: `DEFINE foobar1.
|
|
74776
|
-
WRITE 'hello'.
|
|
74789
|
+
badExample: `DEFINE foobar1.
|
|
74790
|
+
WRITE 'hello'.
|
|
74777
74791
|
END-OF-DEFINITION.`,
|
|
74778
|
-
goodExample: `DEFINE foobar2.
|
|
74779
|
-
WRITE 'hello'.
|
|
74780
|
-
END-OF-DEFINITION.
|
|
74781
|
-
|
|
74792
|
+
goodExample: `DEFINE foobar2.
|
|
74793
|
+
WRITE 'hello'.
|
|
74794
|
+
END-OF-DEFINITION.
|
|
74795
|
+
|
|
74782
74796
|
foobar2.`,
|
|
74783
74797
|
};
|
|
74784
74798
|
}
|
|
@@ -74890,18 +74904,18 @@ class UnusedMethods {
|
|
|
74890
74904
|
key: "unused_methods",
|
|
74891
74905
|
title: "Unused methods",
|
|
74892
74906
|
shortDescription: `Checks for unused methods`,
|
|
74893
|
-
extendedInformation: `Checks private and protected methods.
|
|
74894
|
-
|
|
74895
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74896
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74897
|
-
|
|
74898
|
-
Skips:
|
|
74899
|
-
* methods FOR TESTING
|
|
74900
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74901
|
-
* class_constructor + constructor methods
|
|
74902
|
-
* event handlers
|
|
74903
|
-
* methods that are redefined
|
|
74904
|
-
* INCLUDEs
|
|
74907
|
+
extendedInformation: `Checks private and protected methods.
|
|
74908
|
+
|
|
74909
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74910
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74911
|
+
|
|
74912
|
+
Skips:
|
|
74913
|
+
* methods FOR TESTING
|
|
74914
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74915
|
+
* class_constructor + constructor methods
|
|
74916
|
+
* event handlers
|
|
74917
|
+
* methods that are redefined
|
|
74918
|
+
* INCLUDEs
|
|
74905
74919
|
`,
|
|
74906
74920
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74907
74921
|
pragma: "##CALLED",
|
|
@@ -75377,23 +75391,23 @@ class UnusedVariables {
|
|
|
75377
75391
|
key: "unused_variables",
|
|
75378
75392
|
title: "Unused variables",
|
|
75379
75393
|
shortDescription: `Checks for unused variables and constants`,
|
|
75380
|
-
extendedInformation: `Skips event parameters.
|
|
75381
|
-
|
|
75382
|
-
Note that this currently does not work if the source code uses macros.
|
|
75383
|
-
|
|
75384
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75385
|
-
|
|
75394
|
+
extendedInformation: `Skips event parameters.
|
|
75395
|
+
|
|
75396
|
+
Note that this currently does not work if the source code uses macros.
|
|
75397
|
+
|
|
75398
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
75399
|
+
|
|
75386
75400
|
Errors found in INCLUDES are reported for the main program.`,
|
|
75387
75401
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
75388
75402
|
pragma: "##NEEDED",
|
|
75389
75403
|
pseudoComment: "EC NEEDED",
|
|
75390
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
75391
|
-
test TYPE string,
|
|
75392
|
-
test2 TYPE string,
|
|
75404
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
75405
|
+
test TYPE string,
|
|
75406
|
+
test2 TYPE string,
|
|
75393
75407
|
END OF blah1.`,
|
|
75394
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75395
|
-
test TYPE string,
|
|
75396
|
-
test2 TYPE string,
|
|
75408
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
75409
|
+
test TYPE string,
|
|
75410
|
+
test2 TYPE string,
|
|
75397
75411
|
END OF blah2.`,
|
|
75398
75412
|
};
|
|
75399
75413
|
}
|
|
@@ -75612,15 +75626,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75612
75626
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75613
75627
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75614
75628
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75615
|
-
badExample: `IF line IS INITIAL.
|
|
75616
|
-
has_entries = abap_false.
|
|
75617
|
-
ELSE.
|
|
75618
|
-
has_entries = abap_true.
|
|
75619
|
-
ENDIF.
|
|
75620
|
-
|
|
75629
|
+
badExample: `IF line IS INITIAL.
|
|
75630
|
+
has_entries = abap_false.
|
|
75631
|
+
ELSE.
|
|
75632
|
+
has_entries = abap_true.
|
|
75633
|
+
ENDIF.
|
|
75634
|
+
|
|
75621
75635
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75622
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75623
|
-
|
|
75636
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75637
|
+
|
|
75624
75638
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75625
75639
|
};
|
|
75626
75640
|
}
|
|
@@ -75738,15 +75752,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75738
75752
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75739
75753
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75740
75754
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75741
|
-
badExample: `INTERFACE lif.
|
|
75742
|
-
METHODS load_data
|
|
75743
|
-
EXCEPTIONS
|
|
75744
|
-
invalid_parameter.
|
|
75755
|
+
badExample: `INTERFACE lif.
|
|
75756
|
+
METHODS load_data
|
|
75757
|
+
EXCEPTIONS
|
|
75758
|
+
invalid_parameter.
|
|
75745
75759
|
ENDINTERFACE.`,
|
|
75746
|
-
goodExample: `INTERFACE lif.
|
|
75747
|
-
METHODS load_data
|
|
75748
|
-
RAISING
|
|
75749
|
-
cx_something.
|
|
75760
|
+
goodExample: `INTERFACE lif.
|
|
75761
|
+
METHODS load_data
|
|
75762
|
+
RAISING
|
|
75763
|
+
cx_something.
|
|
75750
75764
|
ENDINTERFACE.`,
|
|
75751
75765
|
};
|
|
75752
75766
|
}
|
|
@@ -75806,15 +75820,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75806
75820
|
key: "use_line_exists",
|
|
75807
75821
|
title: "Use line_exists",
|
|
75808
75822
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75809
|
-
extendedInformation: `
|
|
75810
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75811
|
-
|
|
75823
|
+
extendedInformation: `
|
|
75824
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75825
|
+
|
|
75812
75826
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75813
75827
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75814
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75815
|
-
IF sy-subrc = 0.
|
|
75828
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75829
|
+
IF sy-subrc = 0.
|
|
75816
75830
|
ENDIF.`,
|
|
75817
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75831
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75818
75832
|
ENDIF.`,
|
|
75819
75833
|
};
|
|
75820
75834
|
}
|
|
@@ -75924,10 +75938,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75924
75938
|
key: "use_new",
|
|
75925
75939
|
title: "Use NEW",
|
|
75926
75940
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75927
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75928
|
-
|
|
75929
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75930
|
-
|
|
75941
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75942
|
+
|
|
75943
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75944
|
+
|
|
75931
75945
|
Applicable from v740sp02 and up`,
|
|
75932
75946
|
badExample: `CREATE OBJECT ref.`,
|
|
75933
75947
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -76025,13 +76039,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
76025
76039
|
title: "WHEN OTHERS last",
|
|
76026
76040
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
76027
76041
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
76028
|
-
badExample: `CASE bar.
|
|
76029
|
-
WHEN OTHERS.
|
|
76030
|
-
WHEN 2.
|
|
76042
|
+
badExample: `CASE bar.
|
|
76043
|
+
WHEN OTHERS.
|
|
76044
|
+
WHEN 2.
|
|
76031
76045
|
ENDCASE.`,
|
|
76032
|
-
goodExample: `CASE bar.
|
|
76033
|
-
WHEN 2.
|
|
76034
|
-
WHEN OTHERS.
|
|
76046
|
+
goodExample: `CASE bar.
|
|
76047
|
+
WHEN 2.
|
|
76048
|
+
WHEN OTHERS.
|
|
76035
76049
|
ENDCASE.`,
|
|
76036
76050
|
};
|
|
76037
76051
|
}
|
|
@@ -78453,6 +78467,7 @@ function readDocType(xmlData, i){
|
|
|
78453
78467
|
if (xmlData[i] === '<' && !comment) { //Determine the tag type
|
|
78454
78468
|
if( hasBody && isEntity(xmlData, i)){
|
|
78455
78469
|
i += 7;
|
|
78470
|
+
let entityName, val;
|
|
78456
78471
|
[entityName, val,i] = readEntityExp(xmlData,i+1);
|
|
78457
78472
|
if(val.indexOf("&") === -1) //Parameter entities are not supported
|
|
78458
78473
|
entities[ validateEntityName(entityName) ] = {
|