@abaplint/cli 2.113.43 → 2.113.45
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 +879 -850
- package/package.json +63 -63
package/build/cli.js
CHANGED
|
@@ -5942,12 +5942,13 @@ __exportStar(__webpack_require__(/*! ./sql_field_list_loop */ "./node_modules/@a
|
|
|
5942
5942
|
__exportStar(__webpack_require__(/*! ./sql_field_list */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_list.js"), exports);
|
|
5943
5943
|
__exportStar(__webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js"), exports);
|
|
5944
5944
|
__exportStar(__webpack_require__(/*! ./sql_field */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field.js"), exports);
|
|
5945
|
+
__exportStar(__webpack_require__(/*! ./sql_fields_loop */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields_loop.js"), exports);
|
|
5945
5946
|
__exportStar(__webpack_require__(/*! ./sql_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields.js"), exports);
|
|
5946
5947
|
__exportStar(__webpack_require__(/*! ./sql_for_all_entries */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_for_all_entries.js"), exports);
|
|
5947
5948
|
__exportStar(__webpack_require__(/*! ./sql_from_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_from_source.js"), exports);
|
|
5948
5949
|
__exportStar(__webpack_require__(/*! ./sql_from */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_from.js"), exports);
|
|
5949
|
-
__exportStar(__webpack_require__(/*! ./sql_function */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function.js"), exports);
|
|
5950
5950
|
__exportStar(__webpack_require__(/*! ./sql_function_input */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function_input.js"), exports);
|
|
5951
|
+
__exportStar(__webpack_require__(/*! ./sql_function */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function.js"), exports);
|
|
5951
5952
|
__exportStar(__webpack_require__(/*! ./sql_group_by */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_group_by.js"), exports);
|
|
5952
5953
|
__exportStar(__webpack_require__(/*! ./sql_having */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_having.js"), exports);
|
|
5953
5954
|
__exportStar(__webpack_require__(/*! ./sql_hints */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_hints.js"), exports);
|
|
@@ -7502,6 +7503,7 @@ const sql_hints_1 = __webpack_require__(/*! ./sql_hints */ "./node_modules/@abap
|
|
|
7502
7503
|
const sql_field_list_loop_1 = __webpack_require__(/*! ./sql_field_list_loop */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_list_loop.js");
|
|
7503
7504
|
const sql_up_to_1 = __webpack_require__(/*! ./sql_up_to */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_up_to.js");
|
|
7504
7505
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
7506
|
+
const sql_fields_loop_1 = __webpack_require__(/*! ./sql_fields_loop */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields_loop.js");
|
|
7505
7507
|
// note: SELECT loops are matched before single statement SELECTs
|
|
7506
7508
|
class SelectLoop extends combi_1.Expression {
|
|
7507
7509
|
getRunnable() {
|
|
@@ -7512,7 +7514,7 @@ class SelectLoop extends combi_1.Expression {
|
|
|
7512
7514
|
const packTab = (0, combi_1.seq)(pack, _1.SQLIntoTable);
|
|
7513
7515
|
const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
|
|
7514
7516
|
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab, into, packTab));
|
|
7515
|
-
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, _1.
|
|
7517
|
+
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)(_1.SQLForAllEntries), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
|
|
7516
7518
|
const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
|
|
7517
7519
|
return ret;
|
|
7518
7520
|
}
|
|
@@ -8298,6 +8300,28 @@ exports.SQLFields = SQLFields;
|
|
|
8298
8300
|
|
|
8299
8301
|
/***/ }),
|
|
8300
8302
|
|
|
8303
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields_loop.js":
|
|
8304
|
+
/*!************************************************************************************************!*\
|
|
8305
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_fields_loop.js ***!
|
|
8306
|
+
\************************************************************************************************/
|
|
8307
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8308
|
+
|
|
8309
|
+
"use strict";
|
|
8310
|
+
|
|
8311
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8312
|
+
exports.SQLFieldsLoop = void 0;
|
|
8313
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8314
|
+
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
8315
|
+
class SQLFieldsLoop extends combi_1.Expression {
|
|
8316
|
+
getRunnable() {
|
|
8317
|
+
return (0, combi_1.seq)("FIELDS", (0, combi_1.opt)("DISTINCT"), _1.SQLFieldListLoop);
|
|
8318
|
+
}
|
|
8319
|
+
}
|
|
8320
|
+
exports.SQLFieldsLoop = SQLFieldsLoop;
|
|
8321
|
+
//# sourceMappingURL=sql_fields_loop.js.map
|
|
8322
|
+
|
|
8323
|
+
/***/ }),
|
|
8324
|
+
|
|
8301
8325
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_for_all_entries.js":
|
|
8302
8326
|
/*!****************************************************************************************************!*\
|
|
8303
8327
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_for_all_entries.js ***!
|
|
@@ -9354,8 +9378,11 @@ class TypeStructure extends combi_1.Expression {
|
|
|
9354
9378
|
getRunnable() {
|
|
9355
9379
|
// todo, add version,
|
|
9356
9380
|
const hier = (0, combi_1.seq)("HIERARCHY", _1.NamespaceSimpleName);
|
|
9381
|
+
const create = (0, combi_1.seq)("CREATE", _1.NamespaceSimpleName);
|
|
9382
|
+
const update = (0, combi_1.seq)("UPDATE", _1.NamespaceSimpleName);
|
|
9383
|
+
const action = (0, combi_1.seq)("ACTION IMPORT", _1.SourceField);
|
|
9357
9384
|
const evt = (0, combi_1.seq)("EVENT", _1.EventName);
|
|
9358
|
-
return (0, combi_1.seq)("TYPE STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt));
|
|
9385
|
+
return (0, combi_1.seq)("TYPE STRUCTURE FOR", (0, combi_1.altPrio)(hier, evt, create, update, action));
|
|
9359
9386
|
}
|
|
9360
9387
|
}
|
|
9361
9388
|
exports.TypeStructure = TypeStructure;
|
|
@@ -14662,7 +14689,9 @@ class MethodDef {
|
|
|
14662
14689
|
const link = (0, combi_1.seq)("LINK", expressions_1.MethodParamName);
|
|
14663
14690
|
const full = (0, combi_1.seq)("FULL", expressions_1.MethodParamName);
|
|
14664
14691
|
const modify = (0, combi_1.alt)((0, combi_1.seq)("FOR ACTION", expressions_1.TypeName, (0, combi_1.optPrio)(result)), (0, combi_1.seq)("FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("FOR UPDATE", expressions_1.TypeName));
|
|
14665
|
-
const
|
|
14692
|
+
const forRead = (0, combi_1.seq)("FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link));
|
|
14693
|
+
const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
|
|
14694
|
+
const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE AUTHORIZATION IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
14666
14695
|
// todo, this is only from version something
|
|
14667
14696
|
const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
14668
14697
|
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
@@ -14742,7 +14771,7 @@ class ModifyEntities {
|
|
|
14742
14771
|
getMatcher() {
|
|
14743
14772
|
const fieldsWith = (0, combi_1.seq)("FIELDS (", (0, combi_1.plus)(expressions_1.SimpleName), ") WITH", expressions_1.Source);
|
|
14744
14773
|
const operation = (0, combi_1.alt)((0, combi_1.seq)("UPDATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("CREATE SET FIELDS WITH", expressions_1.Source), (0, combi_1.seq)("UPDATE", fieldsWith), (0, combi_1.seq)("DELETE FROM", expressions_1.Source), (0, combi_1.seq)("EXECUTE", expressions_1.SimpleName, "FROM", expressions_1.Source), (0, combi_1.seq)("CREATE", (0, combi_1.optPrio)("AUTO FILL CID"), fieldsWith));
|
|
14745
|
-
const s = (0, combi_1.seq)("MODIFY ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, operation, (0, combi_1.per)((0, combi_1.seq)("FAILED", expressions_1.Target), (0, combi_1.seq)("RESULT", expressions_1.Target), (0, combi_1.seq)("MAPPED", expressions_1.Target), (0, combi_1.seq)("REPORTED", expressions_1.Target)));
|
|
14774
|
+
const s = (0, combi_1.seq)("MODIFY ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), "ENTITY", expressions_1.SimpleName, operation, (0, combi_1.optPrio)((0, combi_1.per)((0, combi_1.seq)("FAILED", expressions_1.Target), (0, combi_1.seq)("RESULT", expressions_1.Target), (0, combi_1.seq)("MAPPED", expressions_1.Target), (0, combi_1.seq)("REPORTED", expressions_1.Target))));
|
|
14746
14775
|
return (0, combi_1.ver)(version_1.Version.v754, s);
|
|
14747
14776
|
}
|
|
14748
14777
|
}
|
|
@@ -16173,7 +16202,7 @@ class SelectionScreen {
|
|
|
16173
16202
|
const endLine = (0, combi_1.str)("END OF LINE");
|
|
16174
16203
|
const modif = (0, combi_1.seq)("MODIF ID", expressions_1.Modif);
|
|
16175
16204
|
const visible = (0, combi_1.seq)("VISIBLE LENGTH", (0, combi_1.regex)(/^\d+$/));
|
|
16176
|
-
const commentOpt = (0, combi_1.per)((0, combi_1.seq)("FOR FIELD", expressions_1.
|
|
16205
|
+
const commentOpt = (0, combi_1.per)((0, combi_1.seq)("FOR FIELD", expressions_1.FieldSub), modif, visible);
|
|
16177
16206
|
const position = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.regex)(/^\/?[\d\w]+$/)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.WParenLeft)), expressions_1.Integer, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
|
|
16178
16207
|
const comment = (0, combi_1.seq)("COMMENT", position, (0, combi_1.opt)((0, combi_1.alt)(expressions_1.InlineField, expressions_1.TextElement)), (0, combi_1.opt)(commentOpt));
|
|
16179
16208
|
const command = (0, combi_1.seq)("USER-COMMAND", (0, combi_1.alt)(expressions_1.Field, expressions_1.Constant));
|
|
@@ -35239,13 +35268,13 @@ class FlowGraph {
|
|
|
35239
35268
|
this.label = label;
|
|
35240
35269
|
}
|
|
35241
35270
|
toDigraph() {
|
|
35242
|
-
return `digraph G {
|
|
35243
|
-
labelloc="t";
|
|
35244
|
-
label="${this.label}";
|
|
35245
|
-
graph [fontname = "helvetica"];
|
|
35246
|
-
node [fontname = "helvetica", shape="box"];
|
|
35247
|
-
edge [fontname = "helvetica"];
|
|
35248
|
-
${this.toTextEdges()}
|
|
35271
|
+
return `digraph G {
|
|
35272
|
+
labelloc="t";
|
|
35273
|
+
label="${this.label}";
|
|
35274
|
+
graph [fontname = "helvetica"];
|
|
35275
|
+
node [fontname = "helvetica", shape="box"];
|
|
35276
|
+
edge [fontname = "helvetica"];
|
|
35277
|
+
${this.toTextEdges()}
|
|
35249
35278
|
}`;
|
|
35250
35279
|
}
|
|
35251
35280
|
listSources(node) {
|
|
@@ -43632,13 +43661,13 @@ class Help {
|
|
|
43632
43661
|
/////////////////////////////////////////////////
|
|
43633
43662
|
static dumpABAP(file, reg, textDocument, position) {
|
|
43634
43663
|
let content = "";
|
|
43635
|
-
content = `
|
|
43636
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43637
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43638
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43639
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43640
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43641
|
-
<hr>
|
|
43664
|
+
content = `
|
|
43665
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
43666
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
43667
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
43668
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
43669
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
43670
|
+
<hr>
|
|
43642
43671
|
` +
|
|
43643
43672
|
"<tt>" + textDocument.uri + " (" +
|
|
43644
43673
|
(position.line + 1) + ", " +
|
|
@@ -43793,9 +43822,9 @@ class Help {
|
|
|
43793
43822
|
return ret + "</ul>";
|
|
43794
43823
|
}
|
|
43795
43824
|
static tokens(file) {
|
|
43796
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
43797
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
43798
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
43825
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
43826
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
43827
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
43799
43828
|
</tr>`;
|
|
43800
43829
|
for (const token of file.getTokens()) {
|
|
43801
43830
|
const tStart = token.getStart();
|
|
@@ -53035,7 +53064,7 @@ class Registry {
|
|
|
53035
53064
|
}
|
|
53036
53065
|
static abaplintVersion() {
|
|
53037
53066
|
// magic, see build script "version.sh"
|
|
53038
|
-
return "2.113.
|
|
53067
|
+
return "2.113.45";
|
|
53039
53068
|
}
|
|
53040
53069
|
getDDICReferences() {
|
|
53041
53070
|
return this.ddicReferences;
|
|
@@ -53354,10 +53383,10 @@ class SevenBitAscii {
|
|
|
53354
53383
|
key: "7bit_ascii",
|
|
53355
53384
|
title: "Check for 7bit ascii",
|
|
53356
53385
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
53357
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53358
|
-
|
|
53359
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53360
|
-
|
|
53386
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
53387
|
+
|
|
53388
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
53389
|
+
|
|
53361
53390
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
53362
53391
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53363
53392
|
badExample: `WRITE '뽑'.`,
|
|
@@ -53563,10 +53592,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
53563
53592
|
key: "abapdoc",
|
|
53564
53593
|
title: "Check abapdoc",
|
|
53565
53594
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
53566
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53567
|
-
|
|
53568
|
-
Plus class and interface definitions.
|
|
53569
|
-
|
|
53595
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
53596
|
+
|
|
53597
|
+
Plus class and interface definitions.
|
|
53598
|
+
|
|
53570
53599
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
53571
53600
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
53572
53601
|
};
|
|
@@ -53703,27 +53732,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
53703
53732
|
title: "Add test attributes for tests classes with test methods",
|
|
53704
53733
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
53705
53734
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
53706
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53707
|
-
PUBLIC SECTION.
|
|
53708
|
-
PROTECTED SECTION.
|
|
53709
|
-
PRIVATE SECTION.
|
|
53710
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53711
|
-
ENDCLASS.
|
|
53712
|
-
|
|
53713
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53714
|
-
METHOD test.
|
|
53715
|
-
ENDMETHOD.
|
|
53735
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
53736
|
+
PUBLIC SECTION.
|
|
53737
|
+
PROTECTED SECTION.
|
|
53738
|
+
PRIVATE SECTION.
|
|
53739
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53740
|
+
ENDCLASS.
|
|
53741
|
+
|
|
53742
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
53743
|
+
METHOD test.
|
|
53744
|
+
ENDMETHOD.
|
|
53716
53745
|
ENDCLASS.`,
|
|
53717
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53718
|
-
PUBLIC SECTION.
|
|
53719
|
-
PROTECTED SECTION.
|
|
53720
|
-
PRIVATE SECTION.
|
|
53721
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53722
|
-
ENDCLASS.
|
|
53723
|
-
|
|
53724
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53725
|
-
METHOD test.
|
|
53726
|
-
ENDMETHOD.
|
|
53746
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
53747
|
+
PUBLIC SECTION.
|
|
53748
|
+
PROTECTED SECTION.
|
|
53749
|
+
PRIVATE SECTION.
|
|
53750
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
53751
|
+
ENDCLASS.
|
|
53752
|
+
|
|
53753
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
53754
|
+
METHOD test.
|
|
53755
|
+
ENDMETHOD.
|
|
53727
53756
|
ENDCLASS.`,
|
|
53728
53757
|
};
|
|
53729
53758
|
}
|
|
@@ -53809,49 +53838,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
53809
53838
|
key: "align_parameters",
|
|
53810
53839
|
title: "Align Parameters",
|
|
53811
53840
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
53812
|
-
extendedInformation: `Checks:
|
|
53813
|
-
* function module calls
|
|
53814
|
-
* method calls
|
|
53815
|
-
* VALUE constructors
|
|
53816
|
-
* NEW constructors
|
|
53817
|
-
* RAISE EXCEPTION statements
|
|
53818
|
-
* CREATE OBJECT statements
|
|
53819
|
-
* RAISE EVENT statements
|
|
53820
|
-
|
|
53821
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53822
|
-
|
|
53823
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53824
|
-
|
|
53825
|
-
If parameters are on the same row, no issues are reported, see
|
|
53841
|
+
extendedInformation: `Checks:
|
|
53842
|
+
* function module calls
|
|
53843
|
+
* method calls
|
|
53844
|
+
* VALUE constructors
|
|
53845
|
+
* NEW constructors
|
|
53846
|
+
* RAISE EXCEPTION statements
|
|
53847
|
+
* CREATE OBJECT statements
|
|
53848
|
+
* RAISE EVENT statements
|
|
53849
|
+
|
|
53850
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
53851
|
+
|
|
53852
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
53853
|
+
|
|
53854
|
+
If parameters are on the same row, no issues are reported, see
|
|
53826
53855
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
53827
53856
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
53828
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53829
|
-
EXPORTING
|
|
53830
|
-
foo = 2
|
|
53831
|
-
parameter = 3.
|
|
53832
|
-
|
|
53833
|
-
foobar( moo = 1
|
|
53834
|
-
param = 1 ).
|
|
53835
|
-
|
|
53836
|
-
foo = VALUE #(
|
|
53837
|
-
foo = bar
|
|
53857
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
53858
|
+
EXPORTING
|
|
53859
|
+
foo = 2
|
|
53860
|
+
parameter = 3.
|
|
53861
|
+
|
|
53862
|
+
foobar( moo = 1
|
|
53863
|
+
param = 1 ).
|
|
53864
|
+
|
|
53865
|
+
foo = VALUE #(
|
|
53866
|
+
foo = bar
|
|
53838
53867
|
moo = 2 ).`,
|
|
53839
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53840
|
-
EXPORTING
|
|
53841
|
-
foo = 2
|
|
53842
|
-
parameter = 3.
|
|
53843
|
-
|
|
53844
|
-
foobar( moo = 1
|
|
53845
|
-
param = 1 ).
|
|
53846
|
-
|
|
53847
|
-
foo = VALUE #(
|
|
53848
|
-
foo = bar
|
|
53849
|
-
moo = 2 ).
|
|
53850
|
-
|
|
53851
|
-
DATA(sdf) = VALUE type(
|
|
53852
|
-
common_val = 2
|
|
53853
|
-
another_common = 5
|
|
53854
|
-
( row_value = 4
|
|
53868
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
53869
|
+
EXPORTING
|
|
53870
|
+
foo = 2
|
|
53871
|
+
parameter = 3.
|
|
53872
|
+
|
|
53873
|
+
foobar( moo = 1
|
|
53874
|
+
param = 1 ).
|
|
53875
|
+
|
|
53876
|
+
foo = VALUE #(
|
|
53877
|
+
foo = bar
|
|
53878
|
+
moo = 2 ).
|
|
53879
|
+
|
|
53880
|
+
DATA(sdf) = VALUE type(
|
|
53881
|
+
common_val = 2
|
|
53882
|
+
another_common = 5
|
|
53883
|
+
( row_value = 4
|
|
53855
53884
|
value_foo = 5 ) ).`,
|
|
53856
53885
|
};
|
|
53857
53886
|
}
|
|
@@ -54285,37 +54314,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
54285
54314
|
key: "align_type_expressions",
|
|
54286
54315
|
title: "Align TYPE expressions",
|
|
54287
54316
|
shortDescription: `Align TYPE expressions in statements`,
|
|
54288
|
-
extendedInformation: `
|
|
54289
|
-
Currently works for METHODS + BEGIN OF
|
|
54290
|
-
|
|
54291
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54292
|
-
|
|
54293
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54317
|
+
extendedInformation: `
|
|
54318
|
+
Currently works for METHODS + BEGIN OF
|
|
54319
|
+
|
|
54320
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
54321
|
+
|
|
54322
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
54294
54323
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
54295
54324
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
54296
|
-
badExample: `
|
|
54297
|
-
TYPES: BEGIN OF foo,
|
|
54298
|
-
bar TYPE i,
|
|
54299
|
-
foobar TYPE i,
|
|
54300
|
-
END OF foo.
|
|
54301
|
-
|
|
54302
|
-
INTERFACE lif.
|
|
54303
|
-
METHODS bar
|
|
54304
|
-
IMPORTING
|
|
54305
|
-
foo TYPE i
|
|
54306
|
-
foobar TYPE i.
|
|
54325
|
+
badExample: `
|
|
54326
|
+
TYPES: BEGIN OF foo,
|
|
54327
|
+
bar TYPE i,
|
|
54328
|
+
foobar TYPE i,
|
|
54329
|
+
END OF foo.
|
|
54330
|
+
|
|
54331
|
+
INTERFACE lif.
|
|
54332
|
+
METHODS bar
|
|
54333
|
+
IMPORTING
|
|
54334
|
+
foo TYPE i
|
|
54335
|
+
foobar TYPE i.
|
|
54307
54336
|
ENDINTERFACE.`,
|
|
54308
|
-
goodExample: `
|
|
54309
|
-
TYPES: BEGIN OF foo,
|
|
54310
|
-
bar TYPE i,
|
|
54311
|
-
foobar TYPE i,
|
|
54312
|
-
END OF foo.
|
|
54313
|
-
|
|
54314
|
-
INTERFACE lif.
|
|
54315
|
-
METHODS bar
|
|
54316
|
-
IMPORTING
|
|
54317
|
-
foo TYPE i
|
|
54318
|
-
foobar TYPE i.
|
|
54337
|
+
goodExample: `
|
|
54338
|
+
TYPES: BEGIN OF foo,
|
|
54339
|
+
bar TYPE i,
|
|
54340
|
+
foobar TYPE i,
|
|
54341
|
+
END OF foo.
|
|
54342
|
+
|
|
54343
|
+
INTERFACE lif.
|
|
54344
|
+
METHODS bar
|
|
54345
|
+
IMPORTING
|
|
54346
|
+
foo TYPE i
|
|
54347
|
+
foobar TYPE i.
|
|
54319
54348
|
ENDINTERFACE.`,
|
|
54320
54349
|
};
|
|
54321
54350
|
}
|
|
@@ -54594,16 +54623,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
54594
54623
|
return {
|
|
54595
54624
|
key: "ambiguous_statement",
|
|
54596
54625
|
title: "Check for ambigious statements",
|
|
54597
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54598
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54599
|
-
|
|
54626
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
54627
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
54628
|
+
|
|
54600
54629
|
Only works if the target version is 740sp05 or above`,
|
|
54601
54630
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54602
|
-
badExample: `DELETE foo FROM bar.
|
|
54631
|
+
badExample: `DELETE foo FROM bar.
|
|
54603
54632
|
MODIFY foo FROM bar.`,
|
|
54604
|
-
goodExample: `DELETE foo FROM @bar.
|
|
54605
|
-
DELETE TABLE itab FROM 2.
|
|
54606
|
-
MODIFY zfoo FROM @wa.
|
|
54633
|
+
goodExample: `DELETE foo FROM @bar.
|
|
54634
|
+
DELETE TABLE itab FROM 2.
|
|
54635
|
+
MODIFY zfoo FROM @wa.
|
|
54607
54636
|
MODIFY TABLE foo FROM bar.`,
|
|
54608
54637
|
};
|
|
54609
54638
|
}
|
|
@@ -54708,16 +54737,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
54708
54737
|
key: "avoid_use",
|
|
54709
54738
|
title: "Avoid use of certain statements",
|
|
54710
54739
|
shortDescription: `Detects usage of certain statements.`,
|
|
54711
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54712
|
-
|
|
54713
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54714
|
-
|
|
54715
|
-
STATICS: use CLASS-DATA instead
|
|
54716
|
-
|
|
54717
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54718
|
-
|
|
54719
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54720
|
-
|
|
54740
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
54741
|
+
|
|
54742
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
54743
|
+
|
|
54744
|
+
STATICS: use CLASS-DATA instead
|
|
54745
|
+
|
|
54746
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
54747
|
+
|
|
54748
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
54749
|
+
|
|
54721
54750
|
BREAK points`,
|
|
54722
54751
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
54723
54752
|
};
|
|
@@ -54849,11 +54878,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
54849
54878
|
title: "Check BEGIN END names",
|
|
54850
54879
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
54851
54880
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
54852
|
-
badExample: `DATA: BEGIN OF stru,
|
|
54853
|
-
field TYPE i,
|
|
54881
|
+
badExample: `DATA: BEGIN OF stru,
|
|
54882
|
+
field TYPE i,
|
|
54854
54883
|
END OF structure_not_the_same.`,
|
|
54855
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
54856
|
-
field TYPE i,
|
|
54884
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
54885
|
+
field TYPE i,
|
|
54857
54886
|
END OF stru.`,
|
|
54858
54887
|
};
|
|
54859
54888
|
}
|
|
@@ -54950,20 +54979,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
54950
54979
|
title: "BEGIN contains single INCLUDE",
|
|
54951
54980
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
54952
54981
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
54953
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
54954
|
-
INCLUDE TYPE dselc.
|
|
54955
|
-
TYPES: END OF dummy1.
|
|
54956
|
-
|
|
54957
|
-
DATA BEGIN OF foo.
|
|
54958
|
-
INCLUDE STRUCTURE syst.
|
|
54959
|
-
DATA END OF foo.
|
|
54960
|
-
|
|
54961
|
-
STATICS BEGIN OF bar.
|
|
54962
|
-
INCLUDE STRUCTURE syst.
|
|
54982
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
54983
|
+
INCLUDE TYPE dselc.
|
|
54984
|
+
TYPES: END OF dummy1.
|
|
54985
|
+
|
|
54986
|
+
DATA BEGIN OF foo.
|
|
54987
|
+
INCLUDE STRUCTURE syst.
|
|
54988
|
+
DATA END OF foo.
|
|
54989
|
+
|
|
54990
|
+
STATICS BEGIN OF bar.
|
|
54991
|
+
INCLUDE STRUCTURE syst.
|
|
54963
54992
|
STATICS END OF bar.`,
|
|
54964
|
-
goodExample: `DATA BEGIN OF foo.
|
|
54965
|
-
DATA field TYPE i.
|
|
54966
|
-
INCLUDE STRUCTURE dselc.
|
|
54993
|
+
goodExample: `DATA BEGIN OF foo.
|
|
54994
|
+
DATA field TYPE i.
|
|
54995
|
+
INCLUDE STRUCTURE dselc.
|
|
54967
54996
|
DATA END OF foo.`,
|
|
54968
54997
|
};
|
|
54969
54998
|
}
|
|
@@ -55053,9 +55082,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
55053
55082
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
55054
55083
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
55055
55084
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
55056
|
-
goodExample: `TRY.
|
|
55057
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55058
|
-
CATCH cx_sy_authorization_error.
|
|
55085
|
+
goodExample: `TRY.
|
|
55086
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
55087
|
+
CATCH cx_sy_authorization_error.
|
|
55059
55088
|
ENDTRY.`,
|
|
55060
55089
|
};
|
|
55061
55090
|
}
|
|
@@ -55120,10 +55149,10 @@ class CDSCommentStyle {
|
|
|
55120
55149
|
key: "cds_comment_style",
|
|
55121
55150
|
title: "CDS Comment Style",
|
|
55122
55151
|
shortDescription: `Check for obsolete comment style`,
|
|
55123
|
-
extendedInformation: `Check for obsolete comment style
|
|
55124
|
-
|
|
55125
|
-
Comments starting with "--" are considered obsolete
|
|
55126
|
-
|
|
55152
|
+
extendedInformation: `Check for obsolete comment style
|
|
55153
|
+
|
|
55154
|
+
Comments starting with "--" are considered obsolete
|
|
55155
|
+
|
|
55127
55156
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
55128
55157
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
55129
55158
|
badExample: "-- this is a comment",
|
|
@@ -55189,10 +55218,10 @@ class CDSLegacyView {
|
|
|
55189
55218
|
key: "cds_legacy_view",
|
|
55190
55219
|
title: "CDS Legacy View",
|
|
55191
55220
|
shortDescription: `Identify CDS Legacy Views`,
|
|
55192
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55193
|
-
|
|
55194
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55195
|
-
|
|
55221
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
55222
|
+
|
|
55223
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
55224
|
+
|
|
55196
55225
|
v755 and up`,
|
|
55197
55226
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
55198
55227
|
};
|
|
@@ -55347,10 +55376,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
55347
55376
|
key: "chain_mainly_declarations",
|
|
55348
55377
|
title: "Chain mainly declarations",
|
|
55349
55378
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
55350
|
-
extendedInformation: `
|
|
55351
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
55352
|
-
|
|
55353
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55379
|
+
extendedInformation: `
|
|
55380
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
55381
|
+
|
|
55382
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
55354
55383
|
`,
|
|
55355
55384
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
55356
55385
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -55526,17 +55555,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
55526
55555
|
title: "Change IF to CASE",
|
|
55527
55556
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
55528
55557
|
// eslint-disable-next-line max-len
|
|
55529
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55530
|
-
|
|
55558
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
55559
|
+
|
|
55531
55560
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
55532
55561
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
55533
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55534
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55535
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
55562
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
55563
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
55564
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
55536
55565
|
ENDIF.`,
|
|
55537
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
55538
|
-
WHEN 'FOO'.
|
|
55539
|
-
WHEN 'BAR' OR 'MOO'.
|
|
55566
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
55567
|
+
WHEN 'FOO'.
|
|
55568
|
+
WHEN 'BAR' OR 'MOO'.
|
|
55540
55569
|
ENDCASE.`,
|
|
55541
55570
|
};
|
|
55542
55571
|
}
|
|
@@ -55673,8 +55702,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
55673
55702
|
return {
|
|
55674
55703
|
key: "check_abstract",
|
|
55675
55704
|
title: "Check abstract methods and classes",
|
|
55676
|
-
shortDescription: `Checks abstract methods and classes:
|
|
55677
|
-
- class defined as abstract and final,
|
|
55705
|
+
shortDescription: `Checks abstract methods and classes:
|
|
55706
|
+
- class defined as abstract and final,
|
|
55678
55707
|
- non-abstract class contains abstract methods`,
|
|
55679
55708
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
55680
55709
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -55755,11 +55784,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
55755
55784
|
return {
|
|
55756
55785
|
key: "check_comments",
|
|
55757
55786
|
title: "Check Comments",
|
|
55758
|
-
shortDescription: `
|
|
55787
|
+
shortDescription: `
|
|
55759
55788
|
Various checks for comment usage.`,
|
|
55760
|
-
extendedInformation: `
|
|
55761
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55762
|
-
|
|
55789
|
+
extendedInformation: `
|
|
55790
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
55791
|
+
|
|
55763
55792
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
55764
55793
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
55765
55794
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -55921,9 +55950,9 @@ class CheckInclude {
|
|
|
55921
55950
|
key: "check_include",
|
|
55922
55951
|
title: "Check INCLUDEs",
|
|
55923
55952
|
shortDescription: `Checks INCLUDE statements`,
|
|
55924
|
-
extendedInformation: `
|
|
55925
|
-
* Reports unused includes
|
|
55926
|
-
* Errors if the includes are not found
|
|
55953
|
+
extendedInformation: `
|
|
55954
|
+
* Reports unused includes
|
|
55955
|
+
* Errors if the includes are not found
|
|
55927
55956
|
* Error if including a main program`,
|
|
55928
55957
|
tags: [_irule_1.RuleTag.Syntax],
|
|
55929
55958
|
};
|
|
@@ -55999,14 +56028,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
55999
56028
|
key: "check_subrc",
|
|
56000
56029
|
title: "Check sy-subrc",
|
|
56001
56030
|
shortDescription: `Check sy-subrc`,
|
|
56002
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56003
|
-
|
|
56004
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56005
|
-
|
|
56006
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56007
|
-
|
|
56008
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56009
|
-
|
|
56031
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
56032
|
+
|
|
56033
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
56034
|
+
|
|
56035
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
56036
|
+
|
|
56037
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
56038
|
+
|
|
56010
56039
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
56011
56040
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
56012
56041
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -56576,17 +56605,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
56576
56605
|
shortDescription: `Find overlapping classic exceptions`,
|
|
56577
56606
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
56578
56607
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56579
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56580
|
-
EXCEPTIONS
|
|
56581
|
-
system_failure = 1 MESSAGE lv_message
|
|
56582
|
-
communication_failure = 1 MESSAGE lv_message
|
|
56583
|
-
resource_failure = 1
|
|
56608
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
56609
|
+
EXCEPTIONS
|
|
56610
|
+
system_failure = 1 MESSAGE lv_message
|
|
56611
|
+
communication_failure = 1 MESSAGE lv_message
|
|
56612
|
+
resource_failure = 1
|
|
56584
56613
|
OTHERS = 1.`,
|
|
56585
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56586
|
-
EXCEPTIONS
|
|
56587
|
-
system_failure = 1 MESSAGE lv_message
|
|
56588
|
-
communication_failure = 2 MESSAGE lv_message
|
|
56589
|
-
resource_failure = 3
|
|
56614
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
56615
|
+
EXCEPTIONS
|
|
56616
|
+
system_failure = 1 MESSAGE lv_message
|
|
56617
|
+
communication_failure = 2 MESSAGE lv_message
|
|
56618
|
+
resource_failure = 3
|
|
56590
56619
|
OTHERS = 4.`,
|
|
56591
56620
|
};
|
|
56592
56621
|
}
|
|
@@ -56832,7 +56861,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
56832
56861
|
key: "commented_code",
|
|
56833
56862
|
title: "Find commented code",
|
|
56834
56863
|
shortDescription: `Detects usage of commented out code.`,
|
|
56835
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56864
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
56836
56865
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
56837
56866
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
56838
56867
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -57065,10 +57094,10 @@ class ConstructorVisibilityPublic {
|
|
|
57065
57094
|
key: "constructor_visibility_public",
|
|
57066
57095
|
title: "Check constructor visibility is public",
|
|
57067
57096
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
57068
|
-
extendedInformation: `
|
|
57069
|
-
This only applies to global classes.
|
|
57070
|
-
|
|
57071
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57097
|
+
extendedInformation: `
|
|
57098
|
+
This only applies to global classes.
|
|
57099
|
+
|
|
57100
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
57072
57101
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
57073
57102
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57074
57103
|
};
|
|
@@ -57143,8 +57172,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
57143
57172
|
key: "contains_tab",
|
|
57144
57173
|
title: "Code contains tab",
|
|
57145
57174
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
57146
|
-
extendedInformation: `
|
|
57147
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
57175
|
+
extendedInformation: `
|
|
57176
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
57148
57177
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
57149
57178
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
57150
57179
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -57231,10 +57260,10 @@ class CyclicOO {
|
|
|
57231
57260
|
key: "cyclic_oo",
|
|
57232
57261
|
title: "Cyclic OO",
|
|
57233
57262
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
57234
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57235
|
-
|
|
57236
|
-
Objects must be without syntax errors for this rule to take effect
|
|
57237
|
-
|
|
57263
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
57264
|
+
|
|
57265
|
+
Objects must be without syntax errors for this rule to take effect
|
|
57266
|
+
|
|
57238
57267
|
References in testclass includes are ignored`,
|
|
57239
57268
|
};
|
|
57240
57269
|
}
|
|
@@ -57477,7 +57506,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
57477
57506
|
key: "dangerous_statement",
|
|
57478
57507
|
title: "Dangerous statement",
|
|
57479
57508
|
shortDescription: `Detects potentially dangerous statements`,
|
|
57480
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57509
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
57481
57510
|
dynamic SQL can potentially create SQL injection problems`,
|
|
57482
57511
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
57483
57512
|
};
|
|
@@ -57684,13 +57713,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
57684
57713
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
57685
57714
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
57686
57715
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
57687
|
-
badExample: `FROM foo.
|
|
57688
|
-
WRITE 'hello'.
|
|
57689
|
-
DATA int TYPE i.
|
|
57716
|
+
badExample: `FROM foo.
|
|
57717
|
+
WRITE 'hello'.
|
|
57718
|
+
DATA int TYPE i.
|
|
57690
57719
|
ENDFORM.`,
|
|
57691
|
-
goodExample: `FROM foo.
|
|
57692
|
-
DATA int TYPE i.
|
|
57693
|
-
WRITE 'hello'.
|
|
57720
|
+
goodExample: `FROM foo.
|
|
57721
|
+
DATA int TYPE i.
|
|
57722
|
+
WRITE 'hello'.
|
|
57694
57723
|
ENDFORM.`,
|
|
57695
57724
|
};
|
|
57696
57725
|
}
|
|
@@ -58229,39 +58258,39 @@ class Downport {
|
|
|
58229
58258
|
key: "downport",
|
|
58230
58259
|
title: "Downport statement",
|
|
58231
58260
|
shortDescription: `Downport functionality`,
|
|
58232
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58233
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58234
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58235
|
-
|
|
58236
|
-
Current rules:
|
|
58237
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58238
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58239
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
58240
|
-
* CONV is outlined
|
|
58241
|
-
* COND is outlined
|
|
58242
|
-
* REDUCE is outlined
|
|
58243
|
-
* SWITCH is outlined
|
|
58244
|
-
* FILTER is outlined
|
|
58245
|
-
* APPEND expression is outlined
|
|
58246
|
-
* INSERT expression is outlined
|
|
58247
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58248
|
-
* CAST changed to ?=
|
|
58249
|
-
* LOOP AT method_call( ) is outlined
|
|
58250
|
-
* VALUE # with structure fields
|
|
58251
|
-
* VALUE # with internal table lines
|
|
58252
|
-
* Table Expressions are outlined
|
|
58253
|
-
* SELECT INTO @DATA definitions are outlined
|
|
58254
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58255
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58256
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58257
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
58258
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58259
|
-
* line_exists and line_index is downported to READ TABLE
|
|
58260
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
58261
|
-
* MESSAGE with non simple source
|
|
58262
|
-
|
|
58263
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58264
|
-
|
|
58261
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
58262
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
58263
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
58264
|
+
|
|
58265
|
+
Current rules:
|
|
58266
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
58267
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
58268
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
58269
|
+
* CONV is outlined
|
|
58270
|
+
* COND is outlined
|
|
58271
|
+
* REDUCE is outlined
|
|
58272
|
+
* SWITCH is outlined
|
|
58273
|
+
* FILTER is outlined
|
|
58274
|
+
* APPEND expression is outlined
|
|
58275
|
+
* INSERT expression is outlined
|
|
58276
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
58277
|
+
* CAST changed to ?=
|
|
58278
|
+
* LOOP AT method_call( ) is outlined
|
|
58279
|
+
* VALUE # with structure fields
|
|
58280
|
+
* VALUE # with internal table lines
|
|
58281
|
+
* Table Expressions are outlined
|
|
58282
|
+
* SELECT INTO @DATA definitions are outlined
|
|
58283
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
58284
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
58285
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
58286
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
58287
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
58288
|
+
* line_exists and line_index is downported to READ TABLE
|
|
58289
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
58290
|
+
* MESSAGE with non simple source
|
|
58291
|
+
|
|
58292
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
58293
|
+
|
|
58265
58294
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
58266
58295
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
58267
58296
|
};
|
|
@@ -58839,10 +58868,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
58839
58868
|
const fieldName = f.concatTokens();
|
|
58840
58869
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
58841
58870
|
}
|
|
58842
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58871
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
58843
58872
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
58844
58873
|
}
|
|
58845
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58874
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
58846
58875
|
${indentation}`);
|
|
58847
58876
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
58848
58877
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -58901,12 +58930,12 @@ ${indentation}`);
|
|
|
58901
58930
|
}
|
|
58902
58931
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58903
58932
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
58904
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58905
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58906
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58933
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
58934
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
58935
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
58907
58936
|
${indentation}`);
|
|
58908
58937
|
if (fieldDefinitions === "") {
|
|
58909
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58938
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
58910
58939
|
${indentation}`);
|
|
58911
58940
|
}
|
|
58912
58941
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -58974,7 +59003,7 @@ ${indentation}`);
|
|
|
58974
59003
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
58975
59004
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
58976
59005
|
const firstToken = high.getFirstToken();
|
|
58977
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59006
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
58978
59007
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
58979
59008
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
58980
59009
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59028,7 +59057,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59028
59057
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59029
59058
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59030
59059
|
const firstToken = high.getFirstToken();
|
|
59031
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59060
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
59032
59061
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
59033
59062
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
59034
59063
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59070,14 +59099,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
59070
59099
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59071
59100
|
const firstToken = high.getFirstToken();
|
|
59072
59101
|
// note that the tabix restore should be done before throwing the exception
|
|
59073
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59074
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59075
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59076
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59077
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59078
|
-
${indentation}IF sy-subrc <> 0.
|
|
59079
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59080
|
-
${indentation}ENDIF.
|
|
59102
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
59103
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59104
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59105
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
59106
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59107
|
+
${indentation}IF sy-subrc <> 0.
|
|
59108
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59109
|
+
${indentation}ENDIF.
|
|
59081
59110
|
${indentation}`);
|
|
59082
59111
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
59083
59112
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -59134,7 +59163,7 @@ ${indentation}`);
|
|
|
59134
59163
|
const className = classNames[0].concatTokens();
|
|
59135
59164
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59136
59165
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59137
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59166
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
59138
59167
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
59139
59168
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
59140
59169
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -59296,16 +59325,16 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
59296
59325
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59297
59326
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59298
59327
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
59299
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59300
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59328
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
59329
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
59301
59330
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
59302
59331
|
if (withs.length > 0) {
|
|
59303
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59304
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59305
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59332
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
59333
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
59334
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
59306
59335
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
59307
59336
|
}
|
|
59308
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59337
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
59309
59338
|
${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`;
|
|
59310
59339
|
if (withs.length > 0) {
|
|
59311
59340
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -59417,10 +59446,10 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
|
|
|
59417
59446
|
let code = "";
|
|
59418
59447
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
59419
59448
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59420
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59421
|
-
IF sy-subrc <> 0.
|
|
59422
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59423
|
-
ENDIF.
|
|
59449
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
59450
|
+
IF sy-subrc <> 0.
|
|
59451
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59452
|
+
ENDIF.
|
|
59424
59453
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
59425
59454
|
}
|
|
59426
59455
|
else {
|
|
@@ -59509,20 +59538,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
59509
59538
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59510
59539
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59511
59540
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59512
|
-
code += ` items LIKE ${loopSourceName},
|
|
59513
|
-
END OF ${groupTargetName}type.
|
|
59514
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59515
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59541
|
+
code += ` items LIKE ${loopSourceName},
|
|
59542
|
+
END OF ${groupTargetName}type.
|
|
59543
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
59544
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
59516
59545
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
59517
59546
|
if (groupIndexName !== undefined) {
|
|
59518
59547
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
59519
59548
|
}
|
|
59520
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59549
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
59521
59550
|
IF sy-subrc = 0.\n`;
|
|
59522
59551
|
if (groupCountName !== undefined) {
|
|
59523
59552
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
59524
59553
|
}
|
|
59525
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59554
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
59526
59555
|
ELSE.\n`;
|
|
59527
59556
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
59528
59557
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -59543,8 +59572,8 @@ ELSE.\n`;
|
|
|
59543
59572
|
}
|
|
59544
59573
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
59545
59574
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
59546
|
-
code += `ENDIF.
|
|
59547
|
-
ENDLOOP.
|
|
59575
|
+
code += `ENDIF.
|
|
59576
|
+
ENDLOOP.
|
|
59548
59577
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
59549
59578
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
59550
59579
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -59716,7 +59745,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
59716
59745
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59717
59746
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
59718
59747
|
// all ENUMS are char like?
|
|
59719
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
59748
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
59720
59749
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
59721
59750
|
let count = 1;
|
|
59722
59751
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -59760,14 +59789,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
59760
59789
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59761
59790
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59762
59791
|
// restore tabix before exeption
|
|
59763
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59764
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59765
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
59766
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59767
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
59768
|
-
${indentation}IF sy-subrc <> 0.
|
|
59769
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59770
|
-
${indentation}ENDIF.
|
|
59792
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
59793
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
59794
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
59795
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
59796
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
59797
|
+
${indentation}IF sy-subrc <> 0.
|
|
59798
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
59799
|
+
${indentation}ENDIF.
|
|
59771
59800
|
${indentation}${uniqueName}`;
|
|
59772
59801
|
const start = target.getFirstToken().getStart();
|
|
59773
59802
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -59847,11 +59876,11 @@ ${indentation}${uniqueName}`;
|
|
|
59847
59876
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
59848
59877
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
59849
59878
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
59850
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
59851
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
59852
|
-
${indentation} EXPORTING
|
|
59853
|
-
${indentation} input = ${source}
|
|
59854
|
-
${indentation} IMPORTING
|
|
59879
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
59880
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
59881
|
+
${indentation} EXPORTING
|
|
59882
|
+
${indentation} input = ${source}
|
|
59883
|
+
${indentation} IMPORTING
|
|
59855
59884
|
${indentation} output = ${uniqueName}.\n`;
|
|
59856
59885
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
59857
59886
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -61163,12 +61192,12 @@ class EasyToFindMessages {
|
|
|
61163
61192
|
key: "easy_to_find_messages",
|
|
61164
61193
|
title: "Easy to find messages",
|
|
61165
61194
|
shortDescription: `Make messages easy to find`,
|
|
61166
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
61167
|
-
|
|
61168
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
61169
|
-
|
|
61170
|
-
Also see rule "message_exists"
|
|
61171
|
-
|
|
61195
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
61196
|
+
|
|
61197
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
61198
|
+
|
|
61199
|
+
Also see rule "message_exists"
|
|
61200
|
+
|
|
61172
61201
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
61173
61202
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
61174
61203
|
};
|
|
@@ -61249,13 +61278,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
61249
61278
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
61250
61279
|
extendedInformation: ``,
|
|
61251
61280
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61252
|
-
badExample: `
|
|
61253
|
-
INITIALIZATION.
|
|
61254
|
-
WRITE 'hello'.
|
|
61281
|
+
badExample: `
|
|
61282
|
+
INITIALIZATION.
|
|
61283
|
+
WRITE 'hello'.
|
|
61255
61284
|
END-OF-SELECTION.`,
|
|
61256
|
-
goodExample: `
|
|
61257
|
-
START-OF-SELECTION.
|
|
61258
|
-
PERFORM sdf.
|
|
61285
|
+
goodExample: `
|
|
61286
|
+
START-OF-SELECTION.
|
|
61287
|
+
PERFORM sdf.
|
|
61259
61288
|
COMMIT WORK.`,
|
|
61260
61289
|
};
|
|
61261
61290
|
}
|
|
@@ -61347,8 +61376,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
61347
61376
|
key: "empty_line_in_statement",
|
|
61348
61377
|
title: "Find empty lines in statements",
|
|
61349
61378
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
61350
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61351
|
-
|
|
61379
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
61380
|
+
|
|
61352
61381
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
61353
61382
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
61354
61383
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -61524,13 +61553,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
61524
61553
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
61525
61554
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
61526
61555
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61527
|
-
badExample: `IF foo = bar.
|
|
61528
|
-
ENDIF.
|
|
61529
|
-
|
|
61530
|
-
DO 2 TIMES.
|
|
61556
|
+
badExample: `IF foo = bar.
|
|
61557
|
+
ENDIF.
|
|
61558
|
+
|
|
61559
|
+
DO 2 TIMES.
|
|
61531
61560
|
ENDDO.`,
|
|
61532
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61533
|
-
ENDLOOP.
|
|
61561
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
61562
|
+
ENDLOOP.
|
|
61534
61563
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
61535
61564
|
};
|
|
61536
61565
|
}
|
|
@@ -61672,10 +61701,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
61672
61701
|
return {
|
|
61673
61702
|
key: "exit_or_check",
|
|
61674
61703
|
title: "Find EXIT or CHECK outside loops",
|
|
61675
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61704
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
61676
61705
|
Use RETURN to leave procesing blocks instead.`,
|
|
61677
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61678
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61706
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
61707
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
61679
61708
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
61680
61709
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61681
61710
|
};
|
|
@@ -61758,12 +61787,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
61758
61787
|
key: "expand_macros",
|
|
61759
61788
|
title: "Expand Macros",
|
|
61760
61789
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
61761
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61762
|
-
|
|
61790
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
61791
|
+
|
|
61763
61792
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
61764
|
-
badExample: `DEFINE _hello.
|
|
61765
|
-
WRITE 'hello'.
|
|
61766
|
-
END-OF-DEFINITION.
|
|
61793
|
+
badExample: `DEFINE _hello.
|
|
61794
|
+
WRITE 'hello'.
|
|
61795
|
+
END-OF-DEFINITION.
|
|
61767
61796
|
_hello.`,
|
|
61768
61797
|
goodExample: `WRITE 'hello'.`,
|
|
61769
61798
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -61850,7 +61879,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
61850
61879
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
61851
61880
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
61852
61881
|
goodExample: `call_method( foo = bar ).`,
|
|
61853
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61882
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
61854
61883
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
61855
61884
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
61856
61885
|
};
|
|
@@ -61948,7 +61977,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
61948
61977
|
key: "forbidden_identifier",
|
|
61949
61978
|
title: "Forbidden Identifier",
|
|
61950
61979
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
61951
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61980
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
61952
61981
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
61953
61982
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
61954
61983
|
};
|
|
@@ -62190,8 +62219,8 @@ class ForbiddenVoidType {
|
|
|
62190
62219
|
key: "forbidden_void_type",
|
|
62191
62220
|
title: "Forbidden Void Types",
|
|
62192
62221
|
shortDescription: `Avoid usage of specified void types.`,
|
|
62193
|
-
extendedInformation: `Inspiration:
|
|
62194
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62222
|
+
extendedInformation: `Inspiration:
|
|
62223
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
62195
62224
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
62196
62225
|
};
|
|
62197
62226
|
}
|
|
@@ -62434,9 +62463,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
62434
62463
|
key: "fully_type_itabs",
|
|
62435
62464
|
title: "Fully type internal tables",
|
|
62436
62465
|
shortDescription: `No implict table types or table keys`,
|
|
62437
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62466
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
62438
62467
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
62439
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62468
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
62440
62469
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
62441
62470
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
62442
62471
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -62621,26 +62650,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
62621
62650
|
key: "functional_writing",
|
|
62622
62651
|
title: "Use functional writing",
|
|
62623
62652
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
62624
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62653
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
62625
62654
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
62626
62655
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
62627
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62628
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62629
|
-
EXPORTING
|
|
62630
|
-
p_name = 'NAME'
|
|
62631
|
-
RECEIVING
|
|
62632
|
-
p_descr_ref = lr_typedescr
|
|
62633
|
-
EXCEPTIONS
|
|
62634
|
-
type_not_found = 1
|
|
62656
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
62657
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
62658
|
+
EXPORTING
|
|
62659
|
+
p_name = 'NAME'
|
|
62660
|
+
RECEIVING
|
|
62661
|
+
p_descr_ref = lr_typedescr
|
|
62662
|
+
EXCEPTIONS
|
|
62663
|
+
type_not_found = 1
|
|
62635
62664
|
OTHERS = 2.`,
|
|
62636
|
-
goodExample: `zcl_class=>method( ).
|
|
62637
|
-
cl_abap_typedescr=>describe_by_name(
|
|
62638
|
-
EXPORTING
|
|
62639
|
-
p_name = 'NAME'
|
|
62640
|
-
RECEIVING
|
|
62641
|
-
p_descr_ref = lr_typedescr
|
|
62642
|
-
EXCEPTIONS
|
|
62643
|
-
type_not_found = 1
|
|
62665
|
+
goodExample: `zcl_class=>method( ).
|
|
62666
|
+
cl_abap_typedescr=>describe_by_name(
|
|
62667
|
+
EXPORTING
|
|
62668
|
+
p_name = 'NAME'
|
|
62669
|
+
RECEIVING
|
|
62670
|
+
p_descr_ref = lr_typedescr
|
|
62671
|
+
EXCEPTIONS
|
|
62672
|
+
type_not_found = 1
|
|
62644
62673
|
OTHERS = 2 ).`,
|
|
62645
62674
|
};
|
|
62646
62675
|
}
|
|
@@ -62751,14 +62780,14 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
62751
62780
|
key: "global_class",
|
|
62752
62781
|
title: "Global class checks",
|
|
62753
62782
|
shortDescription: `Checks related to global classes`,
|
|
62754
|
-
extendedInformation: `* global classes must be in own files
|
|
62755
|
-
|
|
62756
|
-
* file names must match class name
|
|
62757
|
-
|
|
62758
|
-
* file names must match interface name
|
|
62759
|
-
|
|
62760
|
-
* global classes must be global definitions
|
|
62761
|
-
|
|
62783
|
+
extendedInformation: `* global classes must be in own files
|
|
62784
|
+
|
|
62785
|
+
* file names must match class name
|
|
62786
|
+
|
|
62787
|
+
* file names must match interface name
|
|
62788
|
+
|
|
62789
|
+
* global classes must be global definitions
|
|
62790
|
+
|
|
62762
62791
|
* global interfaces must be global definitions`,
|
|
62763
62792
|
tags: [_irule_1.RuleTag.Syntax],
|
|
62764
62793
|
};
|
|
@@ -62857,21 +62886,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
62857
62886
|
return {
|
|
62858
62887
|
key: "identical_conditions",
|
|
62859
62888
|
title: "Identical conditions",
|
|
62860
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62861
|
-
|
|
62889
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
62890
|
+
|
|
62862
62891
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
62863
62892
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
62864
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62865
|
-
ENDIF.
|
|
62866
|
-
CASE bar.
|
|
62867
|
-
WHEN '1'.
|
|
62868
|
-
WHEN 'A' OR '1'.
|
|
62893
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
62894
|
+
ENDIF.
|
|
62895
|
+
CASE bar.
|
|
62896
|
+
WHEN '1'.
|
|
62897
|
+
WHEN 'A' OR '1'.
|
|
62869
62898
|
ENDCASE.`,
|
|
62870
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
62871
|
-
ENDIF.
|
|
62872
|
-
CASE bar.
|
|
62873
|
-
WHEN '1'.
|
|
62874
|
-
WHEN 'A'.
|
|
62899
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
62900
|
+
ENDIF.
|
|
62901
|
+
CASE bar.
|
|
62902
|
+
WHEN '1'.
|
|
62903
|
+
WHEN 'A'.
|
|
62875
62904
|
ENDCASE.`,
|
|
62876
62905
|
};
|
|
62877
62906
|
}
|
|
@@ -63005,23 +63034,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
63005
63034
|
key: "identical_contents",
|
|
63006
63035
|
title: "Identical contents",
|
|
63007
63036
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
63008
|
-
extendedInformation: `
|
|
63009
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
63010
|
-
|
|
63037
|
+
extendedInformation: `
|
|
63038
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
63039
|
+
|
|
63011
63040
|
Chained statments are ignored`,
|
|
63012
63041
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63013
|
-
badExample: `IF foo = bar.
|
|
63014
|
-
WRITE 'bar'.
|
|
63015
|
-
WRITE 'world'.
|
|
63016
|
-
ELSE.
|
|
63017
|
-
WRITE 'foo'.
|
|
63018
|
-
WRITE 'world'.
|
|
63042
|
+
badExample: `IF foo = bar.
|
|
63043
|
+
WRITE 'bar'.
|
|
63044
|
+
WRITE 'world'.
|
|
63045
|
+
ELSE.
|
|
63046
|
+
WRITE 'foo'.
|
|
63047
|
+
WRITE 'world'.
|
|
63019
63048
|
ENDIF.`,
|
|
63020
|
-
goodExample: `IF foo = bar.
|
|
63021
|
-
WRITE 'bar'.
|
|
63022
|
-
ELSE.
|
|
63023
|
-
WRITE 'foo'.
|
|
63024
|
-
ENDIF.
|
|
63049
|
+
goodExample: `IF foo = bar.
|
|
63050
|
+
WRITE 'bar'.
|
|
63051
|
+
ELSE.
|
|
63052
|
+
WRITE 'foo'.
|
|
63053
|
+
ENDIF.
|
|
63025
63054
|
WRITE 'world'.`,
|
|
63026
63055
|
};
|
|
63027
63056
|
}
|
|
@@ -63129,12 +63158,12 @@ class IdenticalDescriptions {
|
|
|
63129
63158
|
key: "identical_descriptions",
|
|
63130
63159
|
title: "Identical descriptions",
|
|
63131
63160
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
63132
|
-
extendedInformation: `Case insensitive
|
|
63133
|
-
|
|
63134
|
-
Only checks the master language descriptions
|
|
63135
|
-
|
|
63136
|
-
Dependencies are skipped
|
|
63137
|
-
|
|
63161
|
+
extendedInformation: `Case insensitive
|
|
63162
|
+
|
|
63163
|
+
Only checks the master language descriptions
|
|
63164
|
+
|
|
63165
|
+
Dependencies are skipped
|
|
63166
|
+
|
|
63138
63167
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
63139
63168
|
tags: [],
|
|
63140
63169
|
};
|
|
@@ -63308,43 +63337,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
63308
63337
|
key: "if_in_if",
|
|
63309
63338
|
title: "IF in IF",
|
|
63310
63339
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
63311
|
-
extendedInformation: `
|
|
63312
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63313
|
-
|
|
63314
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63315
|
-
|
|
63316
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
63340
|
+
extendedInformation: `
|
|
63341
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
63342
|
+
|
|
63343
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
63344
|
+
|
|
63345
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
63317
63346
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
63318
|
-
badExample: `IF condition1.
|
|
63319
|
-
IF condition2.
|
|
63320
|
-
...
|
|
63321
|
-
ENDIF.
|
|
63322
|
-
ENDIF.
|
|
63323
|
-
|
|
63324
|
-
IF condition1.
|
|
63325
|
-
...
|
|
63326
|
-
ELSE.
|
|
63327
|
-
IF condition2.
|
|
63328
|
-
...
|
|
63329
|
-
ENDIF.
|
|
63347
|
+
badExample: `IF condition1.
|
|
63348
|
+
IF condition2.
|
|
63349
|
+
...
|
|
63350
|
+
ENDIF.
|
|
63351
|
+
ENDIF.
|
|
63352
|
+
|
|
63353
|
+
IF condition1.
|
|
63354
|
+
...
|
|
63355
|
+
ELSE.
|
|
63356
|
+
IF condition2.
|
|
63357
|
+
...
|
|
63358
|
+
ENDIF.
|
|
63330
63359
|
ENDIF.`,
|
|
63331
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63332
|
-
...
|
|
63333
|
-
ENDIF.
|
|
63334
|
-
|
|
63335
|
-
IF condition1.
|
|
63336
|
-
...
|
|
63337
|
-
ELSEIF condition2.
|
|
63338
|
-
...
|
|
63339
|
-
ENDIF.
|
|
63340
|
-
|
|
63341
|
-
CASE variable.
|
|
63342
|
-
WHEN value1.
|
|
63343
|
-
...
|
|
63344
|
-
WHEN value2.
|
|
63345
|
-
IF condition2.
|
|
63346
|
-
...
|
|
63347
|
-
ENDIF.
|
|
63360
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
63361
|
+
...
|
|
63362
|
+
ENDIF.
|
|
63363
|
+
|
|
63364
|
+
IF condition1.
|
|
63365
|
+
...
|
|
63366
|
+
ELSEIF condition2.
|
|
63367
|
+
...
|
|
63368
|
+
ENDIF.
|
|
63369
|
+
|
|
63370
|
+
CASE variable.
|
|
63371
|
+
WHEN value1.
|
|
63372
|
+
...
|
|
63373
|
+
WHEN value2.
|
|
63374
|
+
IF condition2.
|
|
63375
|
+
...
|
|
63376
|
+
ENDIF.
|
|
63348
63377
|
ENDCASE.`,
|
|
63349
63378
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
63350
63379
|
};
|
|
@@ -63529,9 +63558,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
63529
63558
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
63530
63559
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
63531
63560
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
63532
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63533
|
-
METHOD ${methodName.toLowerCase()}.
|
|
63534
|
-
RETURN. " todo, implement method
|
|
63561
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
63562
|
+
METHOD ${methodName.toLowerCase()}.
|
|
63563
|
+
RETURN. " todo, implement method
|
|
63535
63564
|
ENDMETHOD.`);
|
|
63536
63565
|
}
|
|
63537
63566
|
}
|
|
@@ -63710,14 +63739,14 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
63710
63739
|
key: "implicit_start_of_selection",
|
|
63711
63740
|
title: "Implicit START-OF-SELECTION",
|
|
63712
63741
|
shortDescription: `Add explicit selection screen event handling`,
|
|
63713
|
-
extendedInformation: `Only runs for executable programs
|
|
63714
|
-
|
|
63742
|
+
extendedInformation: `Only runs for executable programs
|
|
63743
|
+
|
|
63715
63744
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
63716
63745
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
63717
|
-
badExample: `REPORT zfoo.
|
|
63746
|
+
badExample: `REPORT zfoo.
|
|
63718
63747
|
WRITE 'hello'.`,
|
|
63719
|
-
goodExample: `
|
|
63720
|
-
START-OF-SELECTION.
|
|
63748
|
+
goodExample: `
|
|
63749
|
+
START-OF-SELECTION.
|
|
63721
63750
|
WRITE 'hello'.`,
|
|
63722
63751
|
};
|
|
63723
63752
|
}
|
|
@@ -63822,19 +63851,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
63822
63851
|
key: "in_statement_indentation",
|
|
63823
63852
|
title: "In-statement indentation",
|
|
63824
63853
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
63825
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63826
|
-
|
|
63827
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63854
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
63855
|
+
|
|
63856
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
63828
63857
|
to distinguish them better from code within the block.`,
|
|
63829
|
-
badExample: `IF 1 = 1
|
|
63830
|
-
AND 2 = 2.
|
|
63831
|
-
WRITE 'hello' &&
|
|
63832
|
-
'world'.
|
|
63858
|
+
badExample: `IF 1 = 1
|
|
63859
|
+
AND 2 = 2.
|
|
63860
|
+
WRITE 'hello' &&
|
|
63861
|
+
'world'.
|
|
63833
63862
|
ENDIF.`,
|
|
63834
|
-
goodExample: `IF 1 = 1
|
|
63835
|
-
AND 2 = 2.
|
|
63836
|
-
WRITE 'hello' &&
|
|
63837
|
-
'world'.
|
|
63863
|
+
goodExample: `IF 1 = 1
|
|
63864
|
+
AND 2 = 2.
|
|
63865
|
+
WRITE 'hello' &&
|
|
63866
|
+
'world'.
|
|
63838
63867
|
ENDIF.`,
|
|
63839
63868
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63840
63869
|
};
|
|
@@ -63957,23 +63986,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
63957
63986
|
title: "Indentation",
|
|
63958
63987
|
shortDescription: `Checks indentation`,
|
|
63959
63988
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
63960
|
-
badExample: `CLASS lcl DEFINITION.
|
|
63961
|
-
PRIVATE SECTION.
|
|
63962
|
-
METHODS constructor.
|
|
63963
|
-
ENDCLASS.
|
|
63964
|
-
|
|
63965
|
-
CLASS lcl IMPLEMENTATION.
|
|
63966
|
-
METHOD constructor.
|
|
63967
|
-
ENDMETHOD.
|
|
63989
|
+
badExample: `CLASS lcl DEFINITION.
|
|
63990
|
+
PRIVATE SECTION.
|
|
63991
|
+
METHODS constructor.
|
|
63992
|
+
ENDCLASS.
|
|
63993
|
+
|
|
63994
|
+
CLASS lcl IMPLEMENTATION.
|
|
63995
|
+
METHOD constructor.
|
|
63996
|
+
ENDMETHOD.
|
|
63968
63997
|
ENDCLASS.`,
|
|
63969
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
63970
|
-
PRIVATE SECTION.
|
|
63971
|
-
METHODS constructor.
|
|
63972
|
-
ENDCLASS.
|
|
63973
|
-
|
|
63974
|
-
CLASS lcl IMPLEMENTATION.
|
|
63975
|
-
METHOD constructor.
|
|
63976
|
-
ENDMETHOD.
|
|
63998
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
63999
|
+
PRIVATE SECTION.
|
|
64000
|
+
METHODS constructor.
|
|
64001
|
+
ENDCLASS.
|
|
64002
|
+
|
|
64003
|
+
CLASS lcl IMPLEMENTATION.
|
|
64004
|
+
METHOD constructor.
|
|
64005
|
+
ENDMETHOD.
|
|
63977
64006
|
ENDCLASS.`,
|
|
63978
64007
|
};
|
|
63979
64008
|
}
|
|
@@ -64374,9 +64403,9 @@ class IntfReferencingClas {
|
|
|
64374
64403
|
key: "intf_referencing_clas",
|
|
64375
64404
|
title: "INTF referencing CLAS",
|
|
64376
64405
|
shortDescription: `Interface contains references to class`,
|
|
64377
|
-
extendedInformation: `Only global interfaces are checked.
|
|
64378
|
-
Only first level references are checked.
|
|
64379
|
-
Exception class references are ignored.
|
|
64406
|
+
extendedInformation: `Only global interfaces are checked.
|
|
64407
|
+
Only first level references are checked.
|
|
64408
|
+
Exception class references are ignored.
|
|
64380
64409
|
Void references are ignored.`,
|
|
64381
64410
|
};
|
|
64382
64411
|
}
|
|
@@ -64461,9 +64490,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
64461
64490
|
title: "Invalid Table Index",
|
|
64462
64491
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
64463
64492
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
64464
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
64493
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
64465
64494
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
64466
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
64495
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
64467
64496
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
64468
64497
|
};
|
|
64469
64498
|
}
|
|
@@ -65064,8 +65093,8 @@ class LineBreakStyle {
|
|
|
65064
65093
|
return {
|
|
65065
65094
|
key: "line_break_style",
|
|
65066
65095
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
65067
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65068
|
-
|
|
65096
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
65097
|
+
|
|
65069
65098
|
abapGit does not work with CRLF`,
|
|
65070
65099
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
65071
65100
|
};
|
|
@@ -65134,7 +65163,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
65134
65163
|
key: "line_length",
|
|
65135
65164
|
title: "Line length",
|
|
65136
65165
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
65137
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65166
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
65138
65167
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
65139
65168
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65140
65169
|
};
|
|
@@ -65205,7 +65234,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
65205
65234
|
key: "line_only_punc",
|
|
65206
65235
|
title: "Line containing only punctuation",
|
|
65207
65236
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
65208
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65237
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
65209
65238
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
65210
65239
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
65211
65240
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -65468,15 +65497,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
65468
65497
|
return {
|
|
65469
65498
|
key: "local_variable_names",
|
|
65470
65499
|
title: "Local variable naming conventions",
|
|
65471
|
-
shortDescription: `
|
|
65472
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65500
|
+
shortDescription: `
|
|
65501
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
65473
65502
|
Regexes are case-insensitive.`,
|
|
65474
65503
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65475
|
-
badExample: `FORM bar.
|
|
65476
|
-
DATA foo.
|
|
65504
|
+
badExample: `FORM bar.
|
|
65505
|
+
DATA foo.
|
|
65477
65506
|
ENDFORM.`,
|
|
65478
|
-
goodExample: `FORM bar.
|
|
65479
|
-
DATA lv_foo.
|
|
65507
|
+
goodExample: `FORM bar.
|
|
65508
|
+
DATA lv_foo.
|
|
65480
65509
|
ENDFORM.`,
|
|
65481
65510
|
};
|
|
65482
65511
|
}
|
|
@@ -65628,9 +65657,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
65628
65657
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
65629
65658
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
65630
65659
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
65631
|
-
badExample: `DEFINE something.
|
|
65660
|
+
badExample: `DEFINE something.
|
|
65632
65661
|
END-OF-DEFINITION.`,
|
|
65633
|
-
goodExample: `DEFINE _something.
|
|
65662
|
+
goodExample: `DEFINE _something.
|
|
65634
65663
|
END-OF-DEFINITION.`,
|
|
65635
65664
|
};
|
|
65636
65665
|
}
|
|
@@ -65703,10 +65732,10 @@ class MainFileContents {
|
|
|
65703
65732
|
key: "main_file_contents",
|
|
65704
65733
|
title: "Main file contents",
|
|
65705
65734
|
shortDescription: `Checks related to report declarations.`,
|
|
65706
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
65707
|
-
|
|
65708
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65709
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65735
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
65736
|
+
|
|
65737
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
65738
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
65710
65739
|
`,
|
|
65711
65740
|
};
|
|
65712
65741
|
}
|
|
@@ -65822,17 +65851,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
65822
65851
|
title: "Too many parentheses",
|
|
65823
65852
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
65824
65853
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65825
|
-
badExample: `
|
|
65826
|
-
IF ( destination IS INITIAL ).
|
|
65827
|
-
ENDIF.
|
|
65828
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65829
|
-
ENDIF.
|
|
65854
|
+
badExample: `
|
|
65855
|
+
IF ( destination IS INITIAL ).
|
|
65856
|
+
ENDIF.
|
|
65857
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
65858
|
+
ENDIF.
|
|
65830
65859
|
`,
|
|
65831
|
-
goodExample: `
|
|
65832
|
-
IF destination IS INITIAL.
|
|
65833
|
-
ENDIF.
|
|
65834
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
65835
|
-
ENDIF.
|
|
65860
|
+
goodExample: `
|
|
65861
|
+
IF destination IS INITIAL.
|
|
65862
|
+
ENDIF.
|
|
65863
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
65864
|
+
ENDIF.
|
|
65836
65865
|
`,
|
|
65837
65866
|
};
|
|
65838
65867
|
}
|
|
@@ -66006,14 +66035,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
66006
66035
|
title: "Max one method parameter definition per line",
|
|
66007
66036
|
shortDescription: `Keep max one method parameter description per line`,
|
|
66008
66037
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
66009
|
-
badExample: `
|
|
66010
|
-
METHODS apps_scope_token
|
|
66011
|
-
IMPORTING
|
|
66038
|
+
badExample: `
|
|
66039
|
+
METHODS apps_scope_token
|
|
66040
|
+
IMPORTING
|
|
66012
66041
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
66013
|
-
goodExample: `
|
|
66014
|
-
METHODS apps_scope_token
|
|
66015
|
-
IMPORTING
|
|
66016
|
-
body TYPE bodyapps_scope_token
|
|
66042
|
+
goodExample: `
|
|
66043
|
+
METHODS apps_scope_token
|
|
66044
|
+
IMPORTING
|
|
66045
|
+
body TYPE bodyapps_scope_token
|
|
66017
66046
|
client_id TYPE str.`,
|
|
66018
66047
|
};
|
|
66019
66048
|
}
|
|
@@ -66078,11 +66107,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
66078
66107
|
key: "max_one_statement",
|
|
66079
66108
|
title: "Max one statement per line",
|
|
66080
66109
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
66081
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66082
|
-
|
|
66083
|
-
Does not report anything for chained statements.
|
|
66084
|
-
|
|
66085
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66110
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
66111
|
+
|
|
66112
|
+
Does not report anything for chained statements.
|
|
66113
|
+
|
|
66114
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
66086
66115
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
66087
66116
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66088
66117
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -66420,8 +66449,8 @@ class MethodLength {
|
|
|
66420
66449
|
key: "method_length",
|
|
66421
66450
|
title: "Method/Form Length",
|
|
66422
66451
|
shortDescription: `Checks relating to method/form length.`,
|
|
66423
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66424
|
-
|
|
66452
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
66453
|
+
|
|
66425
66454
|
Abstract methods without statements are considered okay.`,
|
|
66426
66455
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66427
66456
|
};
|
|
@@ -66526,20 +66555,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
66526
66555
|
key: "method_overwrites_builtin",
|
|
66527
66556
|
title: "Method name overwrites builtin function",
|
|
66528
66557
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
66529
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66530
|
-
|
|
66531
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66532
|
-
|
|
66558
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
66559
|
+
|
|
66560
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
66561
|
+
|
|
66533
66562
|
Interface method names are ignored`,
|
|
66534
66563
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
66535
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66536
|
-
PUBLIC SECTION.
|
|
66537
|
-
METHODS matches.
|
|
66538
|
-
ENDCLASS.
|
|
66539
|
-
|
|
66540
|
-
CLASS lcl IMPLEMENTATION.
|
|
66541
|
-
METHOD matches.
|
|
66542
|
-
ENDMETHOD.
|
|
66564
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66565
|
+
PUBLIC SECTION.
|
|
66566
|
+
METHODS matches.
|
|
66567
|
+
ENDCLASS.
|
|
66568
|
+
|
|
66569
|
+
CLASS lcl IMPLEMENTATION.
|
|
66570
|
+
METHOD matches.
|
|
66571
|
+
ENDMETHOD.
|
|
66543
66572
|
ENDCLASS.`,
|
|
66544
66573
|
};
|
|
66545
66574
|
}
|
|
@@ -66730,12 +66759,12 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
66730
66759
|
// eslint-disable-next-line max-len
|
|
66731
66760
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination`,
|
|
66732
66761
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
66733
|
-
badExample: `CLASS lcl DEFINITION.
|
|
66734
|
-
PUBLIC SECTION.
|
|
66735
|
-
METHODS
|
|
66736
|
-
foobar
|
|
66737
|
-
EXPORTING foo TYPE i
|
|
66738
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
66762
|
+
badExample: `CLASS lcl DEFINITION.
|
|
66763
|
+
PUBLIC SECTION.
|
|
66764
|
+
METHODS
|
|
66765
|
+
foobar
|
|
66766
|
+
EXPORTING foo TYPE i
|
|
66767
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
66739
66768
|
ENDCLASS.`,
|
|
66740
66769
|
};
|
|
66741
66770
|
}
|
|
@@ -67115,7 +67144,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
67115
67144
|
key: "nesting",
|
|
67116
67145
|
title: "Check nesting depth",
|
|
67117
67146
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
67118
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67147
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
67119
67148
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
67120
67149
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67121
67150
|
};
|
|
@@ -67358,7 +67387,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
67358
67387
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
67359
67388
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67360
67389
|
badExample: `var1 = var2 = var3.`,
|
|
67361
|
-
goodExample: `var2 = var3.
|
|
67390
|
+
goodExample: `var2 = var3.
|
|
67362
67391
|
var1 = var2.`,
|
|
67363
67392
|
};
|
|
67364
67393
|
}
|
|
@@ -67417,8 +67446,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
67417
67446
|
key: "no_external_form_calls",
|
|
67418
67447
|
title: "No external FORM calls",
|
|
67419
67448
|
shortDescription: `Detect external form calls`,
|
|
67420
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67421
|
-
|
|
67449
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
67450
|
+
|
|
67422
67451
|
PERFORM foo(bar).`,
|
|
67423
67452
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67424
67453
|
};
|
|
@@ -67479,17 +67508,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
67479
67508
|
key: "no_inline_in_optional_branches",
|
|
67480
67509
|
title: "Don't declare inline in optional branches",
|
|
67481
67510
|
shortDescription: `Don't declare inline in optional branches`,
|
|
67482
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67483
|
-
|
|
67484
|
-
Considered optional branches:
|
|
67485
|
-
* inside IF/ELSEIF/ELSE
|
|
67486
|
-
* inside LOOP
|
|
67487
|
-
* inside WHILE
|
|
67488
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
67489
|
-
* inside DO
|
|
67490
|
-
* inside SELECT loops
|
|
67491
|
-
|
|
67492
|
-
Not considered optional branches:
|
|
67511
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
67512
|
+
|
|
67513
|
+
Considered optional branches:
|
|
67514
|
+
* inside IF/ELSEIF/ELSE
|
|
67515
|
+
* inside LOOP
|
|
67516
|
+
* inside WHILE
|
|
67517
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
67518
|
+
* inside DO
|
|
67519
|
+
* inside SELECT loops
|
|
67520
|
+
|
|
67521
|
+
Not considered optional branches:
|
|
67493
67522
|
* TRY/CATCH/CLEANUP`,
|
|
67494
67523
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
67495
67524
|
};
|
|
@@ -67589,12 +67618,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
67589
67618
|
key: "no_prefixes",
|
|
67590
67619
|
title: "No Prefixes",
|
|
67591
67620
|
shortDescription: `Dont use hungarian notation`,
|
|
67592
|
-
extendedInformation: `
|
|
67593
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67594
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67595
|
-
|
|
67596
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67597
|
-
|
|
67621
|
+
extendedInformation: `
|
|
67622
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
67623
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
67624
|
+
|
|
67625
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
67626
|
+
|
|
67598
67627
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
67599
67628
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
67600
67629
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -67773,7 +67802,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
67773
67802
|
return {
|
|
67774
67803
|
key: "no_public_attributes",
|
|
67775
67804
|
title: "No public attributes",
|
|
67776
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67805
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
67777
67806
|
Exceptions are excluded from this rule.`,
|
|
67778
67807
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
67779
67808
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -67874,13 +67903,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
67874
67903
|
key: "no_yoda_conditions",
|
|
67875
67904
|
title: "No Yoda conditions",
|
|
67876
67905
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
67877
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67878
|
-
|
|
67906
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
67907
|
+
|
|
67879
67908
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
67880
67909
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67881
|
-
badExample: `IF 0 <> sy-subrc.
|
|
67910
|
+
badExample: `IF 0 <> sy-subrc.
|
|
67882
67911
|
ENDIF.`,
|
|
67883
|
-
goodExample: `IF sy-subrc <> 0.
|
|
67912
|
+
goodExample: `IF sy-subrc <> 0.
|
|
67884
67913
|
ENDIF.`,
|
|
67885
67914
|
};
|
|
67886
67915
|
}
|
|
@@ -67981,8 +68010,8 @@ class NROBConsistency {
|
|
|
67981
68010
|
key: "nrob_consistency",
|
|
67982
68011
|
title: "Number range consistency",
|
|
67983
68012
|
shortDescription: `Consistency checks for number ranges`,
|
|
67984
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
67985
|
-
|
|
68013
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
68014
|
+
|
|
67986
68015
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
67987
68016
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67988
68017
|
};
|
|
@@ -68259,58 +68288,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
68259
68288
|
title: "Obsolete statements",
|
|
68260
68289
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
68261
68290
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68262
|
-
extendedInformation: `
|
|
68263
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68264
|
-
|
|
68265
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68266
|
-
|
|
68267
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68268
|
-
|
|
68269
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68270
|
-
|
|
68271
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68272
|
-
|
|
68273
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68274
|
-
|
|
68275
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68276
|
-
|
|
68277
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68278
|
-
|
|
68279
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68280
|
-
|
|
68281
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68282
|
-
|
|
68283
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68284
|
-
|
|
68285
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68286
|
-
|
|
68287
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68288
|
-
|
|
68289
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68290
|
-
|
|
68291
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68292
|
-
SELECT COUNT(*) is considered okay
|
|
68293
|
-
|
|
68294
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68295
|
-
|
|
68296
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68297
|
-
|
|
68298
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68299
|
-
|
|
68300
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68301
|
-
|
|
68302
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68303
|
-
|
|
68291
|
+
extendedInformation: `
|
|
68292
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
68293
|
+
|
|
68294
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
68295
|
+
|
|
68296
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
68297
|
+
|
|
68298
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
68299
|
+
|
|
68300
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
68301
|
+
|
|
68302
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
68303
|
+
|
|
68304
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68305
|
+
|
|
68306
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
68307
|
+
|
|
68308
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
68309
|
+
|
|
68310
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
68311
|
+
|
|
68312
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
68313
|
+
|
|
68314
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
68315
|
+
|
|
68316
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
68317
|
+
|
|
68318
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
68319
|
+
|
|
68320
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
68321
|
+
SELECT COUNT(*) is considered okay
|
|
68322
|
+
|
|
68323
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
68324
|
+
|
|
68325
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
68326
|
+
|
|
68327
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
68328
|
+
|
|
68329
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
68330
|
+
|
|
68331
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
68332
|
+
|
|
68304
68333
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
68305
|
-
badExample: `REFRESH itab.
|
|
68306
|
-
|
|
68307
|
-
COMPUTE foo = 2 + 2.
|
|
68308
|
-
|
|
68309
|
-
MULTIPLY lv_foo BY 2.
|
|
68310
|
-
|
|
68311
|
-
INTERFACE intf LOAD.
|
|
68312
|
-
|
|
68313
|
-
IF foo IS SUPPLIED.
|
|
68334
|
+
badExample: `REFRESH itab.
|
|
68335
|
+
|
|
68336
|
+
COMPUTE foo = 2 + 2.
|
|
68337
|
+
|
|
68338
|
+
MULTIPLY lv_foo BY 2.
|
|
68339
|
+
|
|
68340
|
+
INTERFACE intf LOAD.
|
|
68341
|
+
|
|
68342
|
+
IF foo IS SUPPLIED.
|
|
68314
68343
|
ENDIF.`,
|
|
68315
68344
|
};
|
|
68316
68345
|
}
|
|
@@ -68650,9 +68679,9 @@ class OmitParameterName {
|
|
|
68650
68679
|
key: "omit_parameter_name",
|
|
68651
68680
|
title: "Omit parameter name",
|
|
68652
68681
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
68653
|
-
extendedInformation: `
|
|
68654
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68655
|
-
|
|
68682
|
+
extendedInformation: `
|
|
68683
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
68684
|
+
|
|
68656
68685
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
68657
68686
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
68658
68687
|
badExample: `method( param = 2 ).`,
|
|
@@ -68858,20 +68887,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
68858
68887
|
shortDescription: `Omit RECEIVING`,
|
|
68859
68888
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
68860
68889
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
68861
|
-
badExample: `
|
|
68862
|
-
upload_pack(
|
|
68863
|
-
EXPORTING
|
|
68864
|
-
io_client = lo_client
|
|
68865
|
-
iv_url = iv_url
|
|
68866
|
-
iv_deepen_level = iv_deepen_level
|
|
68867
|
-
it_hashes = lt_hashes
|
|
68868
|
-
RECEIVING
|
|
68890
|
+
badExample: `
|
|
68891
|
+
upload_pack(
|
|
68892
|
+
EXPORTING
|
|
68893
|
+
io_client = lo_client
|
|
68894
|
+
iv_url = iv_url
|
|
68895
|
+
iv_deepen_level = iv_deepen_level
|
|
68896
|
+
it_hashes = lt_hashes
|
|
68897
|
+
RECEIVING
|
|
68869
68898
|
rt_objects = et_objects ).`,
|
|
68870
|
-
goodExample: `
|
|
68871
|
-
et_objects = upload_pack(
|
|
68872
|
-
io_client = lo_client
|
|
68873
|
-
iv_url = iv_url
|
|
68874
|
-
iv_deepen_level = iv_deepen_level
|
|
68899
|
+
goodExample: `
|
|
68900
|
+
et_objects = upload_pack(
|
|
68901
|
+
io_client = lo_client
|
|
68902
|
+
iv_url = iv_url
|
|
68903
|
+
iv_deepen_level = iv_deepen_level
|
|
68875
68904
|
it_hashes = lt_hashes ).`,
|
|
68876
68905
|
};
|
|
68877
68906
|
}
|
|
@@ -68935,8 +68964,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
68935
68964
|
return {
|
|
68936
68965
|
key: "parser_702_chaining",
|
|
68937
68966
|
title: "Parser Error, bad chanining on 702",
|
|
68938
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68939
|
-
this rule finds these and reports errors.
|
|
68967
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
68968
|
+
this rule finds these and reports errors.
|
|
68940
68969
|
Only active on target version 702 and below.`,
|
|
68941
68970
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
68942
68971
|
};
|
|
@@ -69016,8 +69045,8 @@ class ParserError {
|
|
|
69016
69045
|
return {
|
|
69017
69046
|
key: "parser_error",
|
|
69018
69047
|
title: "Parser error",
|
|
69019
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69020
|
-
|
|
69048
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
69049
|
+
|
|
69021
69050
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
69022
69051
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
69023
69052
|
};
|
|
@@ -69102,7 +69131,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
69102
69131
|
return {
|
|
69103
69132
|
key: "parser_missing_space",
|
|
69104
69133
|
title: "Parser Error, missing space",
|
|
69105
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69134
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
69106
69135
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
69107
69136
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69108
69137
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -69525,25 +69554,25 @@ class PreferInline {
|
|
|
69525
69554
|
key: "prefer_inline",
|
|
69526
69555
|
title: "Prefer Inline Declarations",
|
|
69527
69556
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
69528
|
-
extendedInformation: `EXPERIMENTAL
|
|
69529
|
-
|
|
69530
|
-
Activates if language version is v740sp02 or above.
|
|
69531
|
-
|
|
69532
|
-
Variables must be local(METHOD or FORM).
|
|
69533
|
-
|
|
69534
|
-
No generic or void typed variables. No syntax errors.
|
|
69535
|
-
|
|
69536
|
-
First position used must be a full/pure write.
|
|
69537
|
-
|
|
69538
|
-
Move statment is not a cast(?=)
|
|
69539
|
-
|
|
69557
|
+
extendedInformation: `EXPERIMENTAL
|
|
69558
|
+
|
|
69559
|
+
Activates if language version is v740sp02 or above.
|
|
69560
|
+
|
|
69561
|
+
Variables must be local(METHOD or FORM).
|
|
69562
|
+
|
|
69563
|
+
No generic or void typed variables. No syntax errors.
|
|
69564
|
+
|
|
69565
|
+
First position used must be a full/pure write.
|
|
69566
|
+
|
|
69567
|
+
Move statment is not a cast(?=)
|
|
69568
|
+
|
|
69540
69569
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
69541
69570
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
69542
|
-
badExample: `DATA foo TYPE i.
|
|
69543
|
-
foo = 2.
|
|
69544
|
-
DATA percentage TYPE decfloat34.
|
|
69571
|
+
badExample: `DATA foo TYPE i.
|
|
69572
|
+
foo = 2.
|
|
69573
|
+
DATA percentage TYPE decfloat34.
|
|
69545
69574
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
69546
|
-
goodExample: `DATA(foo) = 2.
|
|
69575
|
+
goodExample: `DATA(foo) = 2.
|
|
69547
69576
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
69548
69577
|
};
|
|
69549
69578
|
}
|
|
@@ -69757,18 +69786,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
69757
69786
|
key: "prefer_is_not",
|
|
69758
69787
|
title: "Prefer IS NOT to NOT IS",
|
|
69759
69788
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
69760
|
-
extendedInformation: `
|
|
69761
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69762
|
-
|
|
69789
|
+
extendedInformation: `
|
|
69790
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
69791
|
+
|
|
69763
69792
|
"if not is_valid( )." examples are skipped`,
|
|
69764
69793
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69765
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
69766
|
-
IF variable NP 'TODO*'.
|
|
69767
|
-
IF variable <> 42.
|
|
69794
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
69795
|
+
IF variable NP 'TODO*'.
|
|
69796
|
+
IF variable <> 42.
|
|
69768
69797
|
IF variable CO 'hello'.`,
|
|
69769
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
69770
|
-
IF NOT variable CP 'TODO*'.
|
|
69771
|
-
IF NOT variable = 42.
|
|
69798
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
69799
|
+
IF NOT variable CP 'TODO*'.
|
|
69800
|
+
IF NOT variable = 42.
|
|
69772
69801
|
IF NOT variable CA 'hello'.`,
|
|
69773
69802
|
};
|
|
69774
69803
|
}
|
|
@@ -69956,14 +69985,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
69956
69985
|
key: "prefer_raise_exception_new",
|
|
69957
69986
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
69958
69987
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
69959
|
-
extendedInformation: `
|
|
69960
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69961
|
-
|
|
69988
|
+
extendedInformation: `
|
|
69989
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
69990
|
+
|
|
69962
69991
|
From 752 and up`,
|
|
69963
69992
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
69964
69993
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
69965
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69966
|
-
EXPORTING
|
|
69994
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
69995
|
+
EXPORTING
|
|
69967
69996
|
previous = exception.`,
|
|
69968
69997
|
};
|
|
69969
69998
|
}
|
|
@@ -70041,12 +70070,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
70041
70070
|
key: "prefer_returning_to_exporting",
|
|
70042
70071
|
title: "Prefer RETURNING to EXPORTING",
|
|
70043
70072
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
70044
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70073
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
70045
70074
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
70046
70075
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70047
|
-
badExample: `CLASS lcl DEFINITION.
|
|
70048
|
-
PUBLIC SECTION.
|
|
70049
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
70076
|
+
badExample: `CLASS lcl DEFINITION.
|
|
70077
|
+
PUBLIC SECTION.
|
|
70078
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
70050
70079
|
ENDCLASS.`,
|
|
70051
70080
|
};
|
|
70052
70081
|
}
|
|
@@ -70142,8 +70171,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
70142
70171
|
key: "prefer_xsdbool",
|
|
70143
70172
|
title: "Prefer xsdbool over boolc",
|
|
70144
70173
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
70145
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70146
|
-
|
|
70174
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
70175
|
+
|
|
70147
70176
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
70148
70177
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70149
70178
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -70215,9 +70244,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
70215
70244
|
title: "Preferred compare operator",
|
|
70216
70245
|
shortDescription: `Configure undesired operator variants`,
|
|
70217
70246
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70218
|
-
badExample: `IF foo EQ bar.
|
|
70247
|
+
badExample: `IF foo EQ bar.
|
|
70219
70248
|
ENDIF.`,
|
|
70220
|
-
goodExample: `IF foo = bar.
|
|
70249
|
+
goodExample: `IF foo = bar.
|
|
70221
70250
|
ENDIF.`,
|
|
70222
70251
|
};
|
|
70223
70252
|
}
|
|
@@ -70441,26 +70470,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
70441
70470
|
key: "reduce_procedural_code",
|
|
70442
70471
|
title: "Reduce procedural code",
|
|
70443
70472
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
70444
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70445
|
-
|
|
70446
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70447
|
-
|
|
70473
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
70474
|
+
|
|
70475
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
70476
|
+
|
|
70448
70477
|
Comments are not counted as statements.`,
|
|
70449
70478
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
70450
|
-
badExample: `FORM foo.
|
|
70451
|
-
DATA lv_bar TYPE i.
|
|
70452
|
-
lv_bar = 2 + 2.
|
|
70453
|
-
IF lv_bar = 4.
|
|
70454
|
-
WRITE 'hello world'.
|
|
70455
|
-
ENDIF.
|
|
70456
|
-
DATA lv_bar TYPE i.
|
|
70457
|
-
lv_bar = 2 + 2.
|
|
70458
|
-
IF lv_bar = 4.
|
|
70459
|
-
WRITE 'hello world'.
|
|
70460
|
-
ENDIF.
|
|
70479
|
+
badExample: `FORM foo.
|
|
70480
|
+
DATA lv_bar TYPE i.
|
|
70481
|
+
lv_bar = 2 + 2.
|
|
70482
|
+
IF lv_bar = 4.
|
|
70483
|
+
WRITE 'hello world'.
|
|
70484
|
+
ENDIF.
|
|
70485
|
+
DATA lv_bar TYPE i.
|
|
70486
|
+
lv_bar = 2 + 2.
|
|
70487
|
+
IF lv_bar = 4.
|
|
70488
|
+
WRITE 'hello world'.
|
|
70489
|
+
ENDIF.
|
|
70461
70490
|
ENDFORM.`,
|
|
70462
|
-
goodExample: `FORM foo.
|
|
70463
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
70491
|
+
goodExample: `FORM foo.
|
|
70492
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
70464
70493
|
ENDFORM.`,
|
|
70465
70494
|
};
|
|
70466
70495
|
}
|
|
@@ -70704,10 +70733,10 @@ class RemoveDescriptions {
|
|
|
70704
70733
|
return {
|
|
70705
70734
|
key: "remove_descriptions",
|
|
70706
70735
|
title: "Remove descriptions",
|
|
70707
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70708
|
-
|
|
70709
|
-
Class descriptions are required, see rule description_empty.
|
|
70710
|
-
|
|
70736
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
70737
|
+
|
|
70738
|
+
Class descriptions are required, see rule description_empty.
|
|
70739
|
+
|
|
70711
70740
|
Consider using ABAP Doc for documentation.`,
|
|
70712
70741
|
tags: [],
|
|
70713
70742
|
};
|
|
@@ -70832,14 +70861,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
70832
70861
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70833
70862
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
70834
70863
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
70835
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
70864
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
70836
70865
|
DESTINATION lv_rfc.`,
|
|
70837
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70838
|
-
DESTINATION lv_rfc
|
|
70839
|
-
EXCEPTIONS
|
|
70840
|
-
system_failure = 1 MESSAGE msg
|
|
70841
|
-
communication_failure = 2 MESSAGE msg
|
|
70842
|
-
resource_failure = 3
|
|
70866
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
70867
|
+
DESTINATION lv_rfc
|
|
70868
|
+
EXCEPTIONS
|
|
70869
|
+
system_failure = 1 MESSAGE msg
|
|
70870
|
+
communication_failure = 2 MESSAGE msg
|
|
70871
|
+
resource_failure = 3
|
|
70843
70872
|
OTHERS = 4.`,
|
|
70844
70873
|
};
|
|
70845
70874
|
}
|
|
@@ -70923,11 +70952,11 @@ class SelectAddOrderBy {
|
|
|
70923
70952
|
key: "select_add_order_by",
|
|
70924
70953
|
title: "SELECT add ORDER BY",
|
|
70925
70954
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
70926
|
-
extendedInformation: `
|
|
70927
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70928
|
-
|
|
70929
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
70930
|
-
|
|
70955
|
+
extendedInformation: `
|
|
70956
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
70957
|
+
|
|
70958
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
70959
|
+
|
|
70931
70960
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
70932
70961
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
70933
70962
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -71058,14 +71087,14 @@ class SelectPerformance {
|
|
|
71058
71087
|
key: "select_performance",
|
|
71059
71088
|
title: "SELECT performance",
|
|
71060
71089
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
71061
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71062
|
-
|
|
71090
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
71091
|
+
|
|
71063
71092
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
71064
71093
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
71065
|
-
badExample: `SELECT field1, field2 FROM table
|
|
71066
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71094
|
+
badExample: `SELECT field1, field2 FROM table
|
|
71095
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
71067
71096
|
ENDSELECT.`,
|
|
71068
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71097
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
71069
71098
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
71070
71099
|
};
|
|
71071
71100
|
}
|
|
@@ -71179,8 +71208,8 @@ class SelectSingleFullKey {
|
|
|
71179
71208
|
key: "select_single_full_key",
|
|
71180
71209
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
71181
71210
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
71182
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71183
|
-
|
|
71211
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
71212
|
+
|
|
71184
71213
|
If the statement contains a JOIN it is not checked`,
|
|
71185
71214
|
pseudoComment: "EC CI_NOORDER",
|
|
71186
71215
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -71604,8 +71633,8 @@ class SICFConsistency {
|
|
|
71604
71633
|
key: "sicf_consistency",
|
|
71605
71634
|
title: "SICF consistency",
|
|
71606
71635
|
shortDescription: `Checks the validity of ICF services`,
|
|
71607
|
-
extendedInformation: `* Class defined in handler must exist
|
|
71608
|
-
* Class must not have any syntax errors
|
|
71636
|
+
extendedInformation: `* Class defined in handler must exist
|
|
71637
|
+
* Class must not have any syntax errors
|
|
71609
71638
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
71610
71639
|
};
|
|
71611
71640
|
}
|
|
@@ -71717,23 +71746,23 @@ class SlowParameterPassing {
|
|
|
71717
71746
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
71718
71747
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
71719
71748
|
tags: [_irule_1.RuleTag.Performance],
|
|
71720
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71721
|
-
PUBLIC SECTION.
|
|
71722
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71723
|
-
ENDCLASS.
|
|
71724
|
-
CLASS lcl IMPLEMENTATION.
|
|
71725
|
-
METHOD bar.
|
|
71726
|
-
WRITE sdf.
|
|
71727
|
-
ENDMETHOD.
|
|
71749
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71750
|
+
PUBLIC SECTION.
|
|
71751
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
71752
|
+
ENDCLASS.
|
|
71753
|
+
CLASS lcl IMPLEMENTATION.
|
|
71754
|
+
METHOD bar.
|
|
71755
|
+
WRITE sdf.
|
|
71756
|
+
ENDMETHOD.
|
|
71728
71757
|
ENDCLASS.`,
|
|
71729
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
71730
|
-
PUBLIC SECTION.
|
|
71731
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
71732
|
-
ENDCLASS.
|
|
71733
|
-
CLASS lcl IMPLEMENTATION.
|
|
71734
|
-
METHOD bar.
|
|
71735
|
-
WRITE sdf.
|
|
71736
|
-
ENDMETHOD.
|
|
71758
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
71759
|
+
PUBLIC SECTION.
|
|
71760
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
71761
|
+
ENDCLASS.
|
|
71762
|
+
CLASS lcl IMPLEMENTATION.
|
|
71763
|
+
METHOD bar.
|
|
71764
|
+
WRITE sdf.
|
|
71765
|
+
ENDMETHOD.
|
|
71737
71766
|
ENDCLASS.`,
|
|
71738
71767
|
};
|
|
71739
71768
|
}
|
|
@@ -71990,8 +72019,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
71990
72019
|
key: "space_before_dot",
|
|
71991
72020
|
title: "Space before dot",
|
|
71992
72021
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
71993
|
-
extendedInformation: `
|
|
71994
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
72022
|
+
extendedInformation: `
|
|
72023
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
71995
72024
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
71996
72025
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71997
72026
|
badExample: `WRITE bar .`,
|
|
@@ -72177,12 +72206,12 @@ class SQLValueConversion {
|
|
|
72177
72206
|
key: "sql_value_conversion",
|
|
72178
72207
|
title: "Implicit SQL Value Conversion",
|
|
72179
72208
|
shortDescription: `Ensure types match when selecting from database`,
|
|
72180
|
-
extendedInformation: `
|
|
72181
|
-
* Integer to CHAR conversion
|
|
72182
|
-
* Integer to NUMC conversion
|
|
72183
|
-
* NUMC to Integer conversion
|
|
72184
|
-
* CHAR to Integer conversion
|
|
72185
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
72209
|
+
extendedInformation: `
|
|
72210
|
+
* Integer to CHAR conversion
|
|
72211
|
+
* Integer to NUMC conversion
|
|
72212
|
+
* NUMC to Integer conversion
|
|
72213
|
+
* CHAR to Integer conversion
|
|
72214
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
72186
72215
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
72187
72216
|
tags: [],
|
|
72188
72217
|
};
|
|
@@ -72254,7 +72283,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
72254
72283
|
key: "start_at_tab",
|
|
72255
72284
|
title: "Start at tab",
|
|
72256
72285
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
72257
|
-
extendedInformation: `Reports max 100 issues per file
|
|
72286
|
+
extendedInformation: `Reports max 100 issues per file
|
|
72258
72287
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
72259
72288
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72260
72289
|
badExample: ` WRITE a.`,
|
|
@@ -72431,12 +72460,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
72431
72460
|
key: "strict_sql",
|
|
72432
72461
|
title: "Strict SQL",
|
|
72433
72462
|
shortDescription: `Strict SQL`,
|
|
72434
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72435
|
-
|
|
72436
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72437
|
-
|
|
72438
|
-
Also see separate rule sql_escape_host_variables
|
|
72439
|
-
|
|
72463
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
72464
|
+
|
|
72465
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
72466
|
+
|
|
72467
|
+
Also see separate rule sql_escape_host_variables
|
|
72468
|
+
|
|
72440
72469
|
Activates from v750 and up`,
|
|
72441
72470
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
72442
72471
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -72690,11 +72719,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
72690
72719
|
key: "sy_modification",
|
|
72691
72720
|
title: "Modification of SY fields",
|
|
72692
72721
|
shortDescription: `Finds modification of sy fields`,
|
|
72693
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72694
|
-
|
|
72722
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
72723
|
+
|
|
72695
72724
|
Changes to SY-TVAR* fields are not reported`,
|
|
72696
72725
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72697
|
-
badExample: `sy-uname = 2.
|
|
72726
|
+
badExample: `sy-uname = 2.
|
|
72698
72727
|
sy = sy.`,
|
|
72699
72728
|
};
|
|
72700
72729
|
}
|
|
@@ -72756,8 +72785,8 @@ class TABLEnhancementCategory {
|
|
|
72756
72785
|
key: "tabl_enhancement_category",
|
|
72757
72786
|
title: "TABL enhancement category must be set",
|
|
72758
72787
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
72759
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72760
|
-
|
|
72788
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
72789
|
+
|
|
72761
72790
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
72762
72791
|
tags: [],
|
|
72763
72792
|
};
|
|
@@ -72822,8 +72851,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
72822
72851
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
72823
72852
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
72824
72853
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72825
|
-
badExample: `FORM foo.
|
|
72826
|
-
TABLES t100.
|
|
72854
|
+
badExample: `FORM foo.
|
|
72855
|
+
TABLES t100.
|
|
72827
72856
|
ENDFORM.`,
|
|
72828
72857
|
goodExample: `TABLES t000.`,
|
|
72829
72858
|
};
|
|
@@ -72951,9 +72980,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
72951
72980
|
title: "Type FORM parameters",
|
|
72952
72981
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
72953
72982
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72954
|
-
badExample: `FORM foo USING bar.
|
|
72983
|
+
badExample: `FORM foo USING bar.
|
|
72955
72984
|
ENDFORM.`,
|
|
72956
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
72985
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
72957
72986
|
ENDFORM.`,
|
|
72958
72987
|
};
|
|
72959
72988
|
}
|
|
@@ -73626,38 +73655,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
73626
73655
|
key: "unnecessary_pragma",
|
|
73627
73656
|
title: "Unnecessary Pragma",
|
|
73628
73657
|
shortDescription: `Finds pragmas which can be removed`,
|
|
73629
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
73630
|
-
|
|
73631
|
-
* NEEDED without definition
|
|
73632
|
-
|
|
73633
|
-
* NO_TEXT without texts
|
|
73634
|
-
|
|
73635
|
-
* SUBRC_OK where sy-subrc is checked
|
|
73636
|
-
|
|
73658
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
73659
|
+
|
|
73660
|
+
* NEEDED without definition
|
|
73661
|
+
|
|
73662
|
+
* NO_TEXT without texts
|
|
73663
|
+
|
|
73664
|
+
* SUBRC_OK where sy-subrc is checked
|
|
73665
|
+
|
|
73637
73666
|
NO_HANDLER inside macros are not checked`,
|
|
73638
73667
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
73639
|
-
badExample: `TRY.
|
|
73640
|
-
...
|
|
73641
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73642
|
-
RETURN. " it has a handler
|
|
73643
|
-
ENDTRY.
|
|
73644
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73645
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73646
|
-
IF sy-subrc <> 0.
|
|
73668
|
+
badExample: `TRY.
|
|
73669
|
+
...
|
|
73670
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
73671
|
+
RETURN. " it has a handler
|
|
73672
|
+
ENDTRY.
|
|
73673
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
73674
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
73675
|
+
IF sy-subrc <> 0.
|
|
73647
73676
|
ENDIF.`,
|
|
73648
|
-
goodExample: `TRY.
|
|
73649
|
-
...
|
|
73650
|
-
CATCH zcx_abapgit_exception.
|
|
73651
|
-
RETURN.
|
|
73652
|
-
ENDTRY.
|
|
73653
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73654
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73655
|
-
IF sy-subrc <> 0.
|
|
73656
|
-
ENDIF.
|
|
73657
|
-
|
|
73658
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
73659
|
-
test1 TYPE string,
|
|
73660
|
-
test2 TYPE string,
|
|
73677
|
+
goodExample: `TRY.
|
|
73678
|
+
...
|
|
73679
|
+
CATCH zcx_abapgit_exception.
|
|
73680
|
+
RETURN.
|
|
73681
|
+
ENDTRY.
|
|
73682
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
73683
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
73684
|
+
IF sy-subrc <> 0.
|
|
73685
|
+
ENDIF.
|
|
73686
|
+
|
|
73687
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
73688
|
+
test1 TYPE string,
|
|
73689
|
+
test2 TYPE string,
|
|
73661
73690
|
END OF blah.`,
|
|
73662
73691
|
};
|
|
73663
73692
|
}
|
|
@@ -73824,18 +73853,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
73824
73853
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
73825
73854
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
73826
73855
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
73827
|
-
badExample: `FORM hello1.
|
|
73828
|
-
WRITE 'world'.
|
|
73829
|
-
RETURN.
|
|
73830
|
-
ENDFORM.
|
|
73831
|
-
|
|
73832
|
-
FORM foo.
|
|
73833
|
-
IF 1 = 2.
|
|
73834
|
-
RETURN.
|
|
73835
|
-
ENDIF.
|
|
73856
|
+
badExample: `FORM hello1.
|
|
73857
|
+
WRITE 'world'.
|
|
73858
|
+
RETURN.
|
|
73859
|
+
ENDFORM.
|
|
73860
|
+
|
|
73861
|
+
FORM foo.
|
|
73862
|
+
IF 1 = 2.
|
|
73863
|
+
RETURN.
|
|
73864
|
+
ENDIF.
|
|
73836
73865
|
ENDFORM.`,
|
|
73837
|
-
goodExample: `FORM hello2.
|
|
73838
|
-
WRITE 'world'.
|
|
73866
|
+
goodExample: `FORM hello2.
|
|
73867
|
+
WRITE 'world'.
|
|
73839
73868
|
ENDFORM.`,
|
|
73840
73869
|
};
|
|
73841
73870
|
}
|
|
@@ -74186,13 +74215,13 @@ class UnusedMacros {
|
|
|
74186
74215
|
title: "Unused macros",
|
|
74187
74216
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
74188
74217
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74189
|
-
badExample: `DEFINE foobar1.
|
|
74190
|
-
WRITE 'hello'.
|
|
74218
|
+
badExample: `DEFINE foobar1.
|
|
74219
|
+
WRITE 'hello'.
|
|
74191
74220
|
END-OF-DEFINITION.`,
|
|
74192
|
-
goodExample: `DEFINE foobar2.
|
|
74193
|
-
WRITE 'hello'.
|
|
74194
|
-
END-OF-DEFINITION.
|
|
74195
|
-
|
|
74221
|
+
goodExample: `DEFINE foobar2.
|
|
74222
|
+
WRITE 'hello'.
|
|
74223
|
+
END-OF-DEFINITION.
|
|
74224
|
+
|
|
74196
74225
|
foobar2.`,
|
|
74197
74226
|
};
|
|
74198
74227
|
}
|
|
@@ -74304,18 +74333,18 @@ class UnusedMethods {
|
|
|
74304
74333
|
key: "unused_methods",
|
|
74305
74334
|
title: "Unused methods",
|
|
74306
74335
|
shortDescription: `Checks for unused methods`,
|
|
74307
|
-
extendedInformation: `Checks private and protected methods.
|
|
74308
|
-
|
|
74309
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74310
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74311
|
-
|
|
74312
|
-
Skips:
|
|
74313
|
-
* methods FOR TESTING
|
|
74314
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74315
|
-
* class_constructor + constructor methods
|
|
74316
|
-
* event handlers
|
|
74317
|
-
* methods that are redefined
|
|
74318
|
-
* INCLUDEs
|
|
74336
|
+
extendedInformation: `Checks private and protected methods.
|
|
74337
|
+
|
|
74338
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
74339
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
74340
|
+
|
|
74341
|
+
Skips:
|
|
74342
|
+
* methods FOR TESTING
|
|
74343
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
74344
|
+
* class_constructor + constructor methods
|
|
74345
|
+
* event handlers
|
|
74346
|
+
* methods that are redefined
|
|
74347
|
+
* INCLUDEs
|
|
74319
74348
|
`,
|
|
74320
74349
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74321
74350
|
pragma: "##CALLED",
|
|
@@ -74791,23 +74820,23 @@ class UnusedVariables {
|
|
|
74791
74820
|
key: "unused_variables",
|
|
74792
74821
|
title: "Unused variables",
|
|
74793
74822
|
shortDescription: `Checks for unused variables and constants`,
|
|
74794
|
-
extendedInformation: `Skips event parameters.
|
|
74795
|
-
|
|
74796
|
-
Note that this currently does not work if the source code uses macros.
|
|
74797
|
-
|
|
74798
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74799
|
-
|
|
74823
|
+
extendedInformation: `Skips event parameters.
|
|
74824
|
+
|
|
74825
|
+
Note that this currently does not work if the source code uses macros.
|
|
74826
|
+
|
|
74827
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
74828
|
+
|
|
74800
74829
|
Errors found in INCLUDES are reported for the main program.`,
|
|
74801
74830
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
74802
74831
|
pragma: "##NEEDED",
|
|
74803
74832
|
pseudoComment: "EC NEEDED",
|
|
74804
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
74805
|
-
test TYPE string,
|
|
74806
|
-
test2 TYPE string,
|
|
74833
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
74834
|
+
test TYPE string,
|
|
74835
|
+
test2 TYPE string,
|
|
74807
74836
|
END OF blah1.`,
|
|
74808
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74809
|
-
test TYPE string,
|
|
74810
|
-
test2 TYPE string,
|
|
74837
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
74838
|
+
test TYPE string,
|
|
74839
|
+
test2 TYPE string,
|
|
74811
74840
|
END OF blah2.`,
|
|
74812
74841
|
};
|
|
74813
74842
|
}
|
|
@@ -75026,15 +75055,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
75026
75055
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
75027
75056
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75028
75057
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75029
|
-
badExample: `IF line IS INITIAL.
|
|
75030
|
-
has_entries = abap_false.
|
|
75031
|
-
ELSE.
|
|
75032
|
-
has_entries = abap_true.
|
|
75033
|
-
ENDIF.
|
|
75034
|
-
|
|
75058
|
+
badExample: `IF line IS INITIAL.
|
|
75059
|
+
has_entries = abap_false.
|
|
75060
|
+
ELSE.
|
|
75061
|
+
has_entries = abap_true.
|
|
75062
|
+
ENDIF.
|
|
75063
|
+
|
|
75035
75064
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
75036
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75037
|
-
|
|
75065
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
75066
|
+
|
|
75038
75067
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
75039
75068
|
};
|
|
75040
75069
|
}
|
|
@@ -75152,15 +75181,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
75152
75181
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
75153
75182
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
75154
75183
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75155
|
-
badExample: `INTERFACE lif.
|
|
75156
|
-
METHODS load_data
|
|
75157
|
-
EXCEPTIONS
|
|
75158
|
-
invalid_parameter.
|
|
75184
|
+
badExample: `INTERFACE lif.
|
|
75185
|
+
METHODS load_data
|
|
75186
|
+
EXCEPTIONS
|
|
75187
|
+
invalid_parameter.
|
|
75159
75188
|
ENDINTERFACE.`,
|
|
75160
|
-
goodExample: `INTERFACE lif.
|
|
75161
|
-
METHODS load_data
|
|
75162
|
-
RAISING
|
|
75163
|
-
cx_something.
|
|
75189
|
+
goodExample: `INTERFACE lif.
|
|
75190
|
+
METHODS load_data
|
|
75191
|
+
RAISING
|
|
75192
|
+
cx_something.
|
|
75164
75193
|
ENDINTERFACE.`,
|
|
75165
75194
|
};
|
|
75166
75195
|
}
|
|
@@ -75220,15 +75249,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
75220
75249
|
key: "use_line_exists",
|
|
75221
75250
|
title: "Use line_exists",
|
|
75222
75251
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
75223
|
-
extendedInformation: `
|
|
75224
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75225
|
-
|
|
75252
|
+
extendedInformation: `
|
|
75253
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
75254
|
+
|
|
75226
75255
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
75227
75256
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
75228
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75229
|
-
IF sy-subrc = 0.
|
|
75257
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
75258
|
+
IF sy-subrc = 0.
|
|
75230
75259
|
ENDIF.`,
|
|
75231
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75260
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
75232
75261
|
ENDIF.`,
|
|
75233
75262
|
};
|
|
75234
75263
|
}
|
|
@@ -75338,10 +75367,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
75338
75367
|
key: "use_new",
|
|
75339
75368
|
title: "Use NEW",
|
|
75340
75369
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
75341
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75342
|
-
|
|
75343
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75344
|
-
|
|
75370
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
75371
|
+
|
|
75372
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
75373
|
+
|
|
75345
75374
|
Applicable from v740sp02 and up`,
|
|
75346
75375
|
badExample: `CREATE OBJECT ref.`,
|
|
75347
75376
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -75439,13 +75468,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
75439
75468
|
title: "WHEN OTHERS last",
|
|
75440
75469
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
75441
75470
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75442
|
-
badExample: `CASE bar.
|
|
75443
|
-
WHEN OTHERS.
|
|
75444
|
-
WHEN 2.
|
|
75471
|
+
badExample: `CASE bar.
|
|
75472
|
+
WHEN OTHERS.
|
|
75473
|
+
WHEN 2.
|
|
75445
75474
|
ENDCASE.`,
|
|
75446
|
-
goodExample: `CASE bar.
|
|
75447
|
-
WHEN 2.
|
|
75448
|
-
WHEN OTHERS.
|
|
75475
|
+
goodExample: `CASE bar.
|
|
75476
|
+
WHEN 2.
|
|
75477
|
+
WHEN OTHERS.
|
|
75449
75478
|
ENDCASE.`,
|
|
75450
75479
|
};
|
|
75451
75480
|
}
|