@abaplint/cli 2.119.23 → 2.119.26
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 +1008 -901
- package/package.json +62 -62
package/build/cli.js
CHANGED
|
@@ -6064,6 +6064,8 @@ __exportStar(__webpack_require__(/*! ./sql_into_structure */ "./node_modules/@ab
|
|
|
6064
6064
|
__exportStar(__webpack_require__(/*! ./sql_into_table */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_into_table.js"), exports);
|
|
6065
6065
|
__exportStar(__webpack_require__(/*! ./sql_join */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_join.js"), exports);
|
|
6066
6066
|
__exportStar(__webpack_require__(/*! ./sql_order_by */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_order_by.js"), exports);
|
|
6067
|
+
__exportStar(__webpack_require__(/*! ./sql_over */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_over.js"), exports);
|
|
6068
|
+
__exportStar(__webpack_require__(/*! ./sql_over */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_over.js"), exports);
|
|
6067
6069
|
__exportStar(__webpack_require__(/*! ./sql_path */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_path.js"), exports);
|
|
6068
6070
|
__exportStar(__webpack_require__(/*! ./sql_source_no_space */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source_no_space.js"), exports);
|
|
6069
6071
|
__exportStar(__webpack_require__(/*! ./sql_source_simple */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source_simple.js"), exports);
|
|
@@ -8042,19 +8044,31 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8042
8044
|
exports.SQLAggregation = void 0;
|
|
8043
8045
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8044
8046
|
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
8045
|
-
const
|
|
8046
|
-
const
|
|
8047
|
-
const
|
|
8047
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
8048
|
+
const sql_function_input_1 = __webpack_require__(/*! ./sql_function_input */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function_input.js");
|
|
8049
|
+
const sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js");
|
|
8050
|
+
const sql_over_1 = __webpack_require__(/*! ./sql_over */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_over.js");
|
|
8051
|
+
const lparen = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW));
|
|
8052
|
+
const rparen = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight), (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
8048
8053
|
class SQLAggregation extends combi_1.Expression {
|
|
8049
8054
|
getRunnable() {
|
|
8050
|
-
const
|
|
8051
|
-
const
|
|
8052
|
-
const
|
|
8053
|
-
const
|
|
8054
|
-
const
|
|
8055
|
-
const
|
|
8056
|
-
const
|
|
8057
|
-
|
|
8055
|
+
const arg = (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v740sp08, sql_function_input_1.SQLFunctionInput), sql_field_name_1.SQLFieldName);
|
|
8056
|
+
const avgRparen = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight), (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
8057
|
+
const lenDecimals = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, ",", sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8058
|
+
const avgCastType = (0, combi_1.altPrio)((0, combi_1.seq)("DEC", lenDecimals), (0, combi_1.seq)("CURR", lenDecimals), (0, combi_1.seq)("QUAN", lenDecimals), "D16N", "D34N", "FLTP");
|
|
8059
|
+
const count = (0, combi_1.seq)("COUNT", lparen, (0, combi_1.optPrio)("DISTINCT"), (0, combi_1.altPrio)("*", arg), rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver));
|
|
8060
|
+
const max = (0, combi_1.seq)("MAX", lparen, (0, combi_1.optPrio)("DISTINCT"), arg, rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver));
|
|
8061
|
+
const min = (0, combi_1.seq)("MIN", lparen, (0, combi_1.optPrio)("DISTINCT"), arg, rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver));
|
|
8062
|
+
const sum = (0, combi_1.seq)("SUM", lparen, (0, combi_1.optPrio)("DISTINCT"), arg, rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver));
|
|
8063
|
+
const avg = (0, combi_1.seq)("AVG", (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.optPrio)("DISTINCT"), arg, (0, combi_1.optPrio)((0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("AS", avgCastType))), avgRparen, (0, combi_1.optPrio)(sql_over_1.SQLOver));
|
|
8064
|
+
const rank = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.altPrio)("ROW_NUMBER", "RANK", "DENSE_RANK"), lparen, rparen, sql_over_1.SQLOver));
|
|
8065
|
+
const leadLag = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.altPrio)("LEAD", "LAG"), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.optPrio)((0, combi_1.seq)(",", sql_function_input_1.SQLFunctionInput, (0, combi_1.optPrio)((0, combi_1.seq)(",", sql_function_input_1.SQLFunctionInput)))), rparen, sql_over_1.SQLOver));
|
|
8066
|
+
const firstLastValue = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.altPrio)("FIRST_VALUE", "LAST_VALUE"), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, rparen, sql_over_1.SQLOver));
|
|
8067
|
+
const stringAgg = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)("STRING_AGG", (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.optPrio)((0, combi_1.seq)(",", sql_function_input_1.SQLFunctionInput)), rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver)));
|
|
8068
|
+
const ntile = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)("NTILE", (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, rparen, sql_over_1.SQLOver));
|
|
8069
|
+
const corr = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.altPrio)("CORR_SPEARMAN", "CORR"), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, ",", sql_function_input_1.SQLFunctionInput, rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver)));
|
|
8070
|
+
const stat = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)((0, combi_1.altPrio)("PRODUCT", "MEDIAN", "VAR", "STDDEV"), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, rparen, (0, combi_1.optPrio)(sql_over_1.SQLOver)));
|
|
8071
|
+
return (0, combi_1.altPrio)(rank, leadLag, firstLastValue, stringAgg, ntile, corr, stat, count, max, min, sum, avg);
|
|
8058
8072
|
}
|
|
8059
8073
|
}
|
|
8060
8074
|
exports.SQLAggregation = SQLAggregation;
|
|
@@ -8265,7 +8279,7 @@ class SQLCompare extends combi_1.Expression {
|
|
|
8265
8279
|
const arith = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/"), _1.SQLFieldName)), version_1.Version.OpenABAP);
|
|
8266
8280
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8267
8281
|
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(_1.SimpleSource3, paren)), version_1.Version.OpenABAP);
|
|
8268
|
-
const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, _1.ConstantString, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
|
|
8282
|
+
const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLFunction, _1.ConstantString, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
|
|
8269
8283
|
const exists = (0, combi_1.seq)("EXISTS", subSelect);
|
|
8270
8284
|
return (0, combi_1.altPrio)(exists, _1.Dynamic, rett);
|
|
8271
8285
|
}
|
|
@@ -8346,10 +8360,17 @@ class SQLField extends combi_1.Expression {
|
|
|
8346
8360
|
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(_1.SimpleFieldChain2, atParen)), version_1.Version.OpenABAP);
|
|
8347
8361
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
8348
8362
|
const parenFieldName = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)));
|
|
8349
|
-
const
|
|
8363
|
+
const fieldNoAgg = (0, combi_1.altPrio)(_1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant, parenFieldName);
|
|
8364
|
+
const field = (0, combi_1.altPrio)(_1.SQLAggregation, fieldNoAgg);
|
|
8350
8365
|
const parenField = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), field, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8351
|
-
const
|
|
8352
|
-
|
|
8366
|
+
const parenFieldNoAgg = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), fieldNoAgg, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8367
|
+
// arithmetic without aggregates as operands: from v740sp05
|
|
8368
|
+
const subNoAgg = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenFieldNoAgg, fieldNoAgg)));
|
|
8369
|
+
const arithNoAgg = (0, combi_1.ver)(version_1.Version.v740sp05, subNoAgg);
|
|
8370
|
+
// arithmetic with aggregates as operands: from v754
|
|
8371
|
+
const subWithAgg = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenField, field)));
|
|
8372
|
+
const arithWithAgg = (0, combi_1.ver)(version_1.Version.v754, subWithAgg);
|
|
8373
|
+
const arith = (0, combi_1.altPrio)(arithWithAgg, arithNoAgg);
|
|
8353
8374
|
const arithSequence = (0, combi_1.seq)(field, (0, combi_1.optPrio)(arith));
|
|
8354
8375
|
const parenArithSequence = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), arithSequence, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8355
8376
|
return (0, combi_1.seq)((0, combi_1.altPrio)(parenArithSequence, arithSequence), (0, combi_1.optPrio)(as));
|
|
@@ -8648,7 +8669,8 @@ class SQLFunction extends combi_1.Expression {
|
|
|
8648
8669
|
const rtrim = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^rtrim$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8649
8670
|
const right = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^right$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8650
8671
|
const left = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^left$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8651
|
-
|
|
8672
|
+
const division = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)((0, combi_1.regex)(/^division$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
8673
|
+
return (0, combi_1.altPrio)(uuid, abs, ceil, floor, cast, div, mod, coalesce, concat, replace, length, lower, upper, round, concat_with_space, ltrim, rtrim, right, left, substring, dats_is_valid, dats_days_between, dats_add_days, dats_add_months, division);
|
|
8652
8674
|
}
|
|
8653
8675
|
}
|
|
8654
8676
|
exports.SQLFunction = SQLFunction;
|
|
@@ -8676,11 +8698,13 @@ const simple_source3_1 = __webpack_require__(/*! ./simple_source3 */ "./node_mod
|
|
|
8676
8698
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/source.js");
|
|
8677
8699
|
const sql_aggregation_1 = __webpack_require__(/*! ./sql_aggregation */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js");
|
|
8678
8700
|
const sql_function_1 = __webpack_require__(/*! ./sql_function */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function.js");
|
|
8701
|
+
const sql_case_1 = __webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js");
|
|
8679
8702
|
class SQLFunctionInput extends combi_1.Expression {
|
|
8680
8703
|
getRunnable() {
|
|
8681
|
-
const
|
|
8682
|
-
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3,
|
|
8683
|
-
const
|
|
8704
|
+
const hostParen = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
8705
|
+
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(simple_source3_1.SimpleSource3, hostParen)));
|
|
8706
|
+
const parenInput = (0, combi_1.seq)("(", SQLFunctionInput, ")");
|
|
8707
|
+
const param = (0, combi_1.altPrio)(parenInput, sql_case_1.SQLCase, sql_function_1.SQLFunction, sql_aggregation_1.SQLAggregation, sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, constant_1.Constant, at);
|
|
8684
8708
|
const operator = (0, combi_1.altPrio)("+", "-", "*", "/", "&&");
|
|
8685
8709
|
return (0, combi_1.seq)(param, (0, combi_1.starPrio)((0, combi_1.seq)(operator, param)));
|
|
8686
8710
|
}
|
|
@@ -8921,6 +8945,41 @@ exports.SQLOrderBy = SQLOrderBy;
|
|
|
8921
8945
|
|
|
8922
8946
|
/***/ },
|
|
8923
8947
|
|
|
8948
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_over.js"
|
|
8949
|
+
/*!*****************************************************************************************!*\
|
|
8950
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_over.js ***!
|
|
8951
|
+
\*****************************************************************************************/
|
|
8952
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
8953
|
+
|
|
8954
|
+
"use strict";
|
|
8955
|
+
|
|
8956
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8957
|
+
exports.SQLOver = void 0;
|
|
8958
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
8959
|
+
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
8960
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8961
|
+
const sql_function_input_1 = __webpack_require__(/*! ./sql_function_input */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function_input.js");
|
|
8962
|
+
const sql_source_1 = __webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source.js");
|
|
8963
|
+
const sql_order_by_1 = __webpack_require__(/*! ./sql_order_by */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_order_by.js");
|
|
8964
|
+
const lparen = (0, combi_1.tok)(tokens_1.ParenLeftW);
|
|
8965
|
+
const rparen = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight));
|
|
8966
|
+
class SQLOver extends combi_1.Expression {
|
|
8967
|
+
getRunnable() {
|
|
8968
|
+
const partitionBy = (0, combi_1.seq)("PARTITION", "BY", (0, combi_1.plus)((0, combi_1.seq)(sql_function_input_1.SQLFunctionInput, (0, combi_1.opt)(","))));
|
|
8969
|
+
const unboundedPreceding = (0, combi_1.seq)("UNBOUNDED", "PRECEDING");
|
|
8970
|
+
const unboundedFollowing = (0, combi_1.seq)("UNBOUNDED", "FOLLOWING");
|
|
8971
|
+
const currentRow = (0, combi_1.seq)("CURRENT", "ROW");
|
|
8972
|
+
const numBound = (0, combi_1.seq)(sql_source_1.SQLSource, (0, combi_1.altPrio)("PRECEDING", "FOLLOWING"));
|
|
8973
|
+
const bound = (0, combi_1.altPrio)(unboundedPreceding, unboundedFollowing, currentRow, numBound);
|
|
8974
|
+
const windowFrameSpec = (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)("ROWS", "BETWEEN", bound, "AND", bound));
|
|
8975
|
+
return (0, combi_1.ver)(version_1.Version.v757, (0, combi_1.seq)("OVER", lparen, (0, combi_1.optPrio)(partitionBy), (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), (0, combi_1.optPrio)(windowFrameSpec), rparen));
|
|
8976
|
+
}
|
|
8977
|
+
}
|
|
8978
|
+
exports.SQLOver = SQLOver;
|
|
8979
|
+
//# sourceMappingURL=sql_over.js.map
|
|
8980
|
+
|
|
8981
|
+
/***/ },
|
|
8982
|
+
|
|
8924
8983
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_path.js"
|
|
8925
8984
|
/*!*****************************************************************************************!*\
|
|
8926
8985
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_path.js ***!
|
|
@@ -27325,6 +27384,7 @@ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules
|
|
|
27325
27384
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
27326
27385
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
27327
27386
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
27387
|
+
const constant_1 = __webpack_require__(/*! ./constant */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/constant.js");
|
|
27328
27388
|
class MethodCallParam {
|
|
27329
27389
|
static runSyntax(node, input, method) {
|
|
27330
27390
|
if (!(node.get() instanceof Expressions.MethodCallParam)) {
|
|
@@ -27382,10 +27442,13 @@ class MethodCallParam {
|
|
|
27382
27442
|
else {
|
|
27383
27443
|
targetType = method;
|
|
27384
27444
|
}
|
|
27385
|
-
let sourceType =
|
|
27445
|
+
let sourceType = undefined;
|
|
27386
27446
|
if (child.get() instanceof Expressions.Source) {
|
|
27387
27447
|
sourceType = source_1.Source.runSyntax(child, input, targetType);
|
|
27388
27448
|
}
|
|
27449
|
+
else if (child.get() instanceof Expressions.ConstantString) {
|
|
27450
|
+
sourceType = constant_1.Constant.runSyntax(child);
|
|
27451
|
+
}
|
|
27389
27452
|
if (sourceType === undefined) {
|
|
27390
27453
|
const message = "No source type determined, method source";
|
|
27391
27454
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
@@ -28998,7 +29061,7 @@ class Source {
|
|
|
28998
29061
|
if (context instanceof basic_1.FloatType && found instanceof basic_1.IntegerType) {
|
|
28999
29062
|
return context;
|
|
29000
29063
|
}
|
|
29001
|
-
else if (context instanceof basic_1.IntegerType && (found === null || found === void 0 ? void 0 : found.isGeneric())) {
|
|
29064
|
+
else if ((context instanceof basic_1.IntegerType || context instanceof basic_1.FloatType) && (found === null || found === void 0 ? void 0 : found.isGeneric())) {
|
|
29002
29065
|
return context;
|
|
29003
29066
|
}
|
|
29004
29067
|
else {
|
|
@@ -32011,7 +32074,7 @@ class Data {
|
|
|
32011
32074
|
const dd = node.findFirstExpression(Expressions.DataDefinition);
|
|
32012
32075
|
if (dd) {
|
|
32013
32076
|
const id = data_definition_1.DataDefinition.runSyntax(dd, input);
|
|
32014
|
-
if (id && this.isOnlyDigits(id.getName())) {
|
|
32077
|
+
if (id && this.isOnlyDigits(id.getName()) && this.allowOnlyDigitsName(node, input) === false) {
|
|
32015
32078
|
const message = "not possible to have a name with only digits";
|
|
32016
32079
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, id.getToken(), message));
|
|
32017
32080
|
return new _typed_identifier_1.TypedIdentifier(id.getToken(), input.filename, basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey));
|
|
@@ -32025,7 +32088,7 @@ class Data {
|
|
|
32025
32088
|
return id;
|
|
32026
32089
|
}
|
|
32027
32090
|
if (name) {
|
|
32028
|
-
if (this.isOnlyDigits(name.concatTokens())) {
|
|
32091
|
+
if (this.isOnlyDigits(name.concatTokens()) && this.allowOnlyDigitsName(node, input) === false) {
|
|
32029
32092
|
const message = "not possible to have a name with only digits";
|
|
32030
32093
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, name.getFirstToken(), message));
|
|
32031
32094
|
}
|
|
@@ -32036,6 +32099,9 @@ class Data {
|
|
|
32036
32099
|
isOnlyDigits(name) {
|
|
32037
32100
|
return /^[0-9]+$/.test(name);
|
|
32038
32101
|
}
|
|
32102
|
+
allowOnlyDigitsName(node, input) {
|
|
32103
|
+
return input.scope.isAnyOO() === false && node.getColon() !== undefined;
|
|
32104
|
+
}
|
|
32039
32105
|
}
|
|
32040
32106
|
exports.Data = Data;
|
|
32041
32107
|
//# sourceMappingURL=data.js.map
|
|
@@ -45985,13 +46051,13 @@ class Help {
|
|
|
45985
46051
|
}
|
|
45986
46052
|
static dumpABAP(file, reg, textDocument, position) {
|
|
45987
46053
|
let content = "";
|
|
45988
|
-
content = `
|
|
45989
|
-
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
45990
|
-
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
45991
|
-
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
45992
|
-
<a href="#_files" rel="no-refresh">Files</a> |
|
|
45993
|
-
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
45994
|
-
<hr>
|
|
46054
|
+
content = `
|
|
46055
|
+
<a href="#_tokens" rel="no-refresh">Tokens</a> |
|
|
46056
|
+
<a href="#_statements" rel="no-refresh">Statements</a> |
|
|
46057
|
+
<a href="#_structure" rel="no-refresh">Structure</a> |
|
|
46058
|
+
<a href="#_files" rel="no-refresh">Files</a> |
|
|
46059
|
+
<a href="#_info" rel="no-refresh">Info Dump</a>
|
|
46060
|
+
<hr>
|
|
45995
46061
|
` +
|
|
45996
46062
|
"<tt>" + textDocument.uri + " (" +
|
|
45997
46063
|
(position.line + 1) + ", " +
|
|
@@ -46146,9 +46212,9 @@ class Help {
|
|
|
46146
46212
|
return ret + "</ul>";
|
|
46147
46213
|
}
|
|
46148
46214
|
static tokens(file) {
|
|
46149
|
-
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
46150
|
-
<td><b>Row</b></td><td><b>Column</b></td>
|
|
46151
|
-
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
46215
|
+
let inner = `<table><tr><td><b>String</b></td><td><b>Type</b></td>
|
|
46216
|
+
<td><b>Row</b></td><td><b>Column</b></td>
|
|
46217
|
+
<td><b>vRow</b></td><td><b>vColumn</b></td>
|
|
46152
46218
|
</tr>`;
|
|
46153
46219
|
for (const token of file.getTokens()) {
|
|
46154
46220
|
const tStart = token.getStart();
|
|
@@ -47422,9 +47488,11 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
|
|
|
47422
47488
|
}
|
|
47423
47489
|
for (const t of (0, xml_utils_1.xmlToArray)(parsed.abapGit["asx:abap"]["asx:values"].TPOOL.item)) {
|
|
47424
47490
|
const id = (_e = t.ID) === null || _e === void 0 ? void 0 : _e.toUpperCase();
|
|
47425
|
-
if (id === undefined
|
|
47426
|
-
|
|
47427
|
-
|
|
47491
|
+
if (id === undefined) {
|
|
47492
|
+
continue;
|
|
47493
|
+
}
|
|
47494
|
+
if (id !== "R" && t.KEY === undefined) {
|
|
47495
|
+
continue;
|
|
47428
47496
|
}
|
|
47429
47497
|
const key = (_g = ((_f = t.KEY) !== null && _f !== void 0 ? _f : t.ID)) === null || _g === void 0 ? void 0 : _g.toUpperCase();
|
|
47430
47498
|
if (key === undefined) {
|
|
@@ -56456,7 +56524,7 @@ class Registry {
|
|
|
56456
56524
|
}
|
|
56457
56525
|
static abaplintVersion() {
|
|
56458
56526
|
// magic, see build script "version.sh"
|
|
56459
|
-
return "2.119.
|
|
56527
|
+
return "2.119.26";
|
|
56460
56528
|
}
|
|
56461
56529
|
getDDICReferences() {
|
|
56462
56530
|
return this.ddicReferences;
|
|
@@ -56796,10 +56864,10 @@ class SevenBitAscii {
|
|
|
56796
56864
|
key: "7bit_ascii",
|
|
56797
56865
|
title: "Check for 7bit ascii",
|
|
56798
56866
|
shortDescription: `Only allow characters from the 7bit ASCII set.`,
|
|
56799
|
-
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
56800
|
-
|
|
56801
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
56802
|
-
|
|
56867
|
+
extendedInformation: `https://docs.abapopenchecks.org/checks/05/
|
|
56868
|
+
|
|
56869
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
|
|
56870
|
+
|
|
56803
56871
|
Checkes files with extensions ".abap" and ".asddls"`,
|
|
56804
56872
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
56805
56873
|
badExample: `WRITE '뽑'.`,
|
|
@@ -57005,10 +57073,10 @@ class Abapdoc extends _abap_rule_1.ABAPRule {
|
|
|
57005
57073
|
key: "abapdoc",
|
|
57006
57074
|
title: "Check abapdoc",
|
|
57007
57075
|
shortDescription: `Various checks regarding abapdoc.`,
|
|
57008
|
-
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
57009
|
-
|
|
57010
|
-
Plus class and interface definitions.
|
|
57011
|
-
|
|
57076
|
+
extendedInformation: `Base rule checks for existence of abapdoc for public class methods and all interface methods.
|
|
57077
|
+
|
|
57078
|
+
Plus class and interface definitions.
|
|
57079
|
+
|
|
57012
57080
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-only-for-public-apis`,
|
|
57013
57081
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
57014
57082
|
};
|
|
@@ -57145,27 +57213,27 @@ class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
|
57145
57213
|
title: "Add test attributes for tests classes with test methods",
|
|
57146
57214
|
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
57147
57215
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
57148
|
-
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
57149
|
-
PUBLIC SECTION.
|
|
57150
|
-
PROTECTED SECTION.
|
|
57151
|
-
PRIVATE SECTION.
|
|
57152
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
57153
|
-
ENDCLASS.
|
|
57154
|
-
|
|
57155
|
-
CLASS ltcl_test1 IMPLEMENTATION.
|
|
57156
|
-
METHOD test.
|
|
57157
|
-
ENDMETHOD.
|
|
57216
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
57217
|
+
PUBLIC SECTION.
|
|
57218
|
+
PROTECTED SECTION.
|
|
57219
|
+
PRIVATE SECTION.
|
|
57220
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
57221
|
+
ENDCLASS.
|
|
57222
|
+
|
|
57223
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
57224
|
+
METHOD test.
|
|
57225
|
+
ENDMETHOD.
|
|
57158
57226
|
ENDCLASS.`,
|
|
57159
|
-
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
57160
|
-
PUBLIC SECTION.
|
|
57161
|
-
PROTECTED SECTION.
|
|
57162
|
-
PRIVATE SECTION.
|
|
57163
|
-
METHODS test FOR TESTING RAISING cx_static_check.
|
|
57164
|
-
ENDCLASS.
|
|
57165
|
-
|
|
57166
|
-
CLASS ltcl_test2 IMPLEMENTATION.
|
|
57167
|
-
METHOD test.
|
|
57168
|
-
ENDMETHOD.
|
|
57227
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
57228
|
+
PUBLIC SECTION.
|
|
57229
|
+
PROTECTED SECTION.
|
|
57230
|
+
PRIVATE SECTION.
|
|
57231
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
57232
|
+
ENDCLASS.
|
|
57233
|
+
|
|
57234
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
57235
|
+
METHOD test.
|
|
57236
|
+
ENDMETHOD.
|
|
57169
57237
|
ENDCLASS.`,
|
|
57170
57238
|
};
|
|
57171
57239
|
}
|
|
@@ -57318,49 +57386,49 @@ class AlignParameters extends _abap_rule_1.ABAPRule {
|
|
|
57318
57386
|
key: "align_parameters",
|
|
57319
57387
|
title: "Align Parameters",
|
|
57320
57388
|
shortDescription: `Checks for vertially aligned parameters`,
|
|
57321
|
-
extendedInformation: `Checks:
|
|
57322
|
-
* function module calls
|
|
57323
|
-
* method calls
|
|
57324
|
-
* VALUE constructors
|
|
57325
|
-
* NEW constructors
|
|
57326
|
-
* RAISE EXCEPTION statements
|
|
57327
|
-
* CREATE OBJECT statements
|
|
57328
|
-
* RAISE EVENT statements
|
|
57329
|
-
|
|
57330
|
-
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
57331
|
-
|
|
57332
|
-
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
57333
|
-
|
|
57334
|
-
If parameters are on the same row, no issues are reported, see
|
|
57389
|
+
extendedInformation: `Checks:
|
|
57390
|
+
* function module calls
|
|
57391
|
+
* method calls
|
|
57392
|
+
* VALUE constructors
|
|
57393
|
+
* NEW constructors
|
|
57394
|
+
* RAISE EXCEPTION statements
|
|
57395
|
+
* CREATE OBJECT statements
|
|
57396
|
+
* RAISE EVENT statements
|
|
57397
|
+
|
|
57398
|
+
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters
|
|
57399
|
+
|
|
57400
|
+
Does not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/
|
|
57401
|
+
|
|
57402
|
+
If parameters are on the same row, no issues are reported, see
|
|
57335
57403
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
57336
57404
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
57337
|
-
badExample: `CALL FUNCTION 'FOOBAR'
|
|
57338
|
-
EXPORTING
|
|
57339
|
-
foo = 2
|
|
57340
|
-
parameter = 3.
|
|
57341
|
-
|
|
57342
|
-
foobar( moo = 1
|
|
57343
|
-
param = 1 ).
|
|
57344
|
-
|
|
57345
|
-
foo = VALUE #(
|
|
57346
|
-
foo = bar
|
|
57405
|
+
badExample: `CALL FUNCTION 'FOOBAR'
|
|
57406
|
+
EXPORTING
|
|
57407
|
+
foo = 2
|
|
57408
|
+
parameter = 3.
|
|
57409
|
+
|
|
57410
|
+
foobar( moo = 1
|
|
57411
|
+
param = 1 ).
|
|
57412
|
+
|
|
57413
|
+
foo = VALUE #(
|
|
57414
|
+
foo = bar
|
|
57347
57415
|
moo = 2 ).`,
|
|
57348
|
-
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
57349
|
-
EXPORTING
|
|
57350
|
-
foo = 2
|
|
57351
|
-
parameter = 3.
|
|
57352
|
-
|
|
57353
|
-
foobar( moo = 1
|
|
57354
|
-
param = 1 ).
|
|
57355
|
-
|
|
57356
|
-
foo = VALUE #(
|
|
57357
|
-
foo = bar
|
|
57358
|
-
moo = 2 ).
|
|
57359
|
-
|
|
57360
|
-
DATA(sdf) = VALUE type(
|
|
57361
|
-
common_val = 2
|
|
57362
|
-
another_common = 5
|
|
57363
|
-
( row_value = 4
|
|
57416
|
+
goodExample: `CALL FUNCTION 'FOOBAR'
|
|
57417
|
+
EXPORTING
|
|
57418
|
+
foo = 2
|
|
57419
|
+
parameter = 3.
|
|
57420
|
+
|
|
57421
|
+
foobar( moo = 1
|
|
57422
|
+
param = 1 ).
|
|
57423
|
+
|
|
57424
|
+
foo = VALUE #(
|
|
57425
|
+
foo = bar
|
|
57426
|
+
moo = 2 ).
|
|
57427
|
+
|
|
57428
|
+
DATA(sdf) = VALUE type(
|
|
57429
|
+
common_val = 2
|
|
57430
|
+
another_common = 5
|
|
57431
|
+
( row_value = 4
|
|
57364
57432
|
value_foo = 5 ) ).`,
|
|
57365
57433
|
};
|
|
57366
57434
|
}
|
|
@@ -57794,37 +57862,37 @@ class AlignTypeExpressions extends _abap_rule_1.ABAPRule {
|
|
|
57794
57862
|
key: "align_type_expressions",
|
|
57795
57863
|
title: "Align TYPE expressions",
|
|
57796
57864
|
shortDescription: `Align TYPE expressions in statements`,
|
|
57797
|
-
extendedInformation: `
|
|
57798
|
-
Currently works for METHODS + BEGIN OF
|
|
57799
|
-
|
|
57800
|
-
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
57801
|
-
|
|
57802
|
-
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
57865
|
+
extendedInformation: `
|
|
57866
|
+
Currently works for METHODS + BEGIN OF
|
|
57867
|
+
|
|
57868
|
+
If BEGIN OF has an INCLUDE TYPE its ignored
|
|
57869
|
+
|
|
57870
|
+
Also note that clean ABAP does not recommend aligning TYPE clauses:
|
|
57803
57871
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-align-type-clauses`,
|
|
57804
57872
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix],
|
|
57805
|
-
badExample: `
|
|
57806
|
-
TYPES: BEGIN OF foo,
|
|
57807
|
-
bar TYPE i,
|
|
57808
|
-
foobar TYPE i,
|
|
57809
|
-
END OF foo.
|
|
57810
|
-
|
|
57811
|
-
INTERFACE lif.
|
|
57812
|
-
METHODS bar
|
|
57813
|
-
IMPORTING
|
|
57814
|
-
foo TYPE i
|
|
57815
|
-
foobar TYPE i.
|
|
57873
|
+
badExample: `
|
|
57874
|
+
TYPES: BEGIN OF foo,
|
|
57875
|
+
bar TYPE i,
|
|
57876
|
+
foobar TYPE i,
|
|
57877
|
+
END OF foo.
|
|
57878
|
+
|
|
57879
|
+
INTERFACE lif.
|
|
57880
|
+
METHODS bar
|
|
57881
|
+
IMPORTING
|
|
57882
|
+
foo TYPE i
|
|
57883
|
+
foobar TYPE i.
|
|
57816
57884
|
ENDINTERFACE.`,
|
|
57817
|
-
goodExample: `
|
|
57818
|
-
TYPES: BEGIN OF foo,
|
|
57819
|
-
bar TYPE i,
|
|
57820
|
-
foobar TYPE i,
|
|
57821
|
-
END OF foo.
|
|
57822
|
-
|
|
57823
|
-
INTERFACE lif.
|
|
57824
|
-
METHODS bar
|
|
57825
|
-
IMPORTING
|
|
57826
|
-
foo TYPE i
|
|
57827
|
-
foobar TYPE i.
|
|
57885
|
+
goodExample: `
|
|
57886
|
+
TYPES: BEGIN OF foo,
|
|
57887
|
+
bar TYPE i,
|
|
57888
|
+
foobar TYPE i,
|
|
57889
|
+
END OF foo.
|
|
57890
|
+
|
|
57891
|
+
INTERFACE lif.
|
|
57892
|
+
METHODS bar
|
|
57893
|
+
IMPORTING
|
|
57894
|
+
foo TYPE i
|
|
57895
|
+
foobar TYPE i.
|
|
57828
57896
|
ENDINTERFACE.`,
|
|
57829
57897
|
};
|
|
57830
57898
|
}
|
|
@@ -58124,16 +58192,16 @@ class AmbiguousStatement extends _abap_rule_1.ABAPRule {
|
|
|
58124
58192
|
return {
|
|
58125
58193
|
key: "ambiguous_statement",
|
|
58126
58194
|
title: "Check for ambigious statements",
|
|
58127
|
-
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
58128
|
-
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
58129
|
-
|
|
58195
|
+
shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table
|
|
58196
|
+
Add "TABLE" keyword or "@" for escaping SQL variables
|
|
58197
|
+
|
|
58130
58198
|
Only works if the target version is 740sp05 or above`,
|
|
58131
58199
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
58132
|
-
badExample: `DELETE foo FROM bar.
|
|
58200
|
+
badExample: `DELETE foo FROM bar.
|
|
58133
58201
|
MODIFY foo FROM bar.`,
|
|
58134
|
-
goodExample: `DELETE foo FROM @bar.
|
|
58135
|
-
DELETE TABLE itab FROM 2.
|
|
58136
|
-
MODIFY zfoo FROM @wa.
|
|
58202
|
+
goodExample: `DELETE foo FROM @bar.
|
|
58203
|
+
DELETE TABLE itab FROM 2.
|
|
58204
|
+
MODIFY zfoo FROM @wa.
|
|
58137
58205
|
MODIFY TABLE foo FROM bar.`,
|
|
58138
58206
|
};
|
|
58139
58207
|
}
|
|
@@ -58249,16 +58317,16 @@ class AvoidUse extends _abap_rule_1.ABAPRule {
|
|
|
58249
58317
|
key: "avoid_use",
|
|
58250
58318
|
title: "Avoid use of certain statements",
|
|
58251
58319
|
shortDescription: `Detects usage of certain statements.`,
|
|
58252
|
-
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
58253
|
-
|
|
58254
|
-
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
58255
|
-
|
|
58256
|
-
STATICS: use CLASS-DATA instead
|
|
58257
|
-
|
|
58258
|
-
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
58259
|
-
|
|
58260
|
-
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
58261
|
-
|
|
58320
|
+
extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key
|
|
58321
|
+
|
|
58322
|
+
Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
58323
|
+
|
|
58324
|
+
STATICS: use CLASS-DATA instead
|
|
58325
|
+
|
|
58326
|
+
DESCRIBE TABLE LINES: use lines() instead (quickfix exists)
|
|
58327
|
+
|
|
58328
|
+
TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround
|
|
58329
|
+
|
|
58262
58330
|
BREAK points`,
|
|
58263
58331
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
58264
58332
|
};
|
|
@@ -58390,11 +58458,11 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
|
|
|
58390
58458
|
title: "Check BEGIN END names",
|
|
58391
58459
|
shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,
|
|
58392
58460
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
58393
|
-
badExample: `DATA: BEGIN OF stru,
|
|
58394
|
-
field TYPE i,
|
|
58461
|
+
badExample: `DATA: BEGIN OF stru,
|
|
58462
|
+
field TYPE i,
|
|
58395
58463
|
END OF structure_not_the_same.`,
|
|
58396
|
-
goodExample: `DATA: BEGIN OF stru,
|
|
58397
|
-
field TYPE i,
|
|
58464
|
+
goodExample: `DATA: BEGIN OF stru,
|
|
58465
|
+
field TYPE i,
|
|
58398
58466
|
END OF stru.`,
|
|
58399
58467
|
};
|
|
58400
58468
|
}
|
|
@@ -58491,20 +58559,20 @@ class BeginSingleInclude extends _abap_rule_1.ABAPRule {
|
|
|
58491
58559
|
title: "BEGIN contains single INCLUDE",
|
|
58492
58560
|
shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,
|
|
58493
58561
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
58494
|
-
badExample: `TYPES: BEGIN OF dummy1.
|
|
58495
|
-
INCLUDE TYPE dselc.
|
|
58496
|
-
TYPES: END OF dummy1.
|
|
58497
|
-
|
|
58498
|
-
DATA BEGIN OF foo.
|
|
58499
|
-
INCLUDE STRUCTURE syst.
|
|
58500
|
-
DATA END OF foo.
|
|
58501
|
-
|
|
58502
|
-
STATICS BEGIN OF bar.
|
|
58503
|
-
INCLUDE STRUCTURE syst.
|
|
58562
|
+
badExample: `TYPES: BEGIN OF dummy1.
|
|
58563
|
+
INCLUDE TYPE dselc.
|
|
58564
|
+
TYPES: END OF dummy1.
|
|
58565
|
+
|
|
58566
|
+
DATA BEGIN OF foo.
|
|
58567
|
+
INCLUDE STRUCTURE syst.
|
|
58568
|
+
DATA END OF foo.
|
|
58569
|
+
|
|
58570
|
+
STATICS BEGIN OF bar.
|
|
58571
|
+
INCLUDE STRUCTURE syst.
|
|
58504
58572
|
STATICS END OF bar.`,
|
|
58505
|
-
goodExample: `DATA BEGIN OF foo.
|
|
58506
|
-
DATA field TYPE i.
|
|
58507
|
-
INCLUDE STRUCTURE dselc.
|
|
58573
|
+
goodExample: `DATA BEGIN OF foo.
|
|
58574
|
+
DATA field TYPE i.
|
|
58575
|
+
INCLUDE STRUCTURE dselc.
|
|
58508
58576
|
DATA END OF foo.`,
|
|
58509
58577
|
};
|
|
58510
58578
|
}
|
|
@@ -58598,9 +58666,9 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
58598
58666
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
58599
58667
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
58600
58668
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
58601
|
-
goodExample: `TRY.
|
|
58602
|
-
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
58603
|
-
CATCH cx_sy_authorization_error.
|
|
58669
|
+
goodExample: `TRY.
|
|
58670
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
58671
|
+
CATCH cx_sy_authorization_error.
|
|
58604
58672
|
ENDTRY.`,
|
|
58605
58673
|
};
|
|
58606
58674
|
}
|
|
@@ -58756,15 +58824,15 @@ class CDSAssociationName {
|
|
|
58756
58824
|
key: "cds_association_name",
|
|
58757
58825
|
title: "CDS Association Name",
|
|
58758
58826
|
shortDescription: `CDS association names should start with an underscore`,
|
|
58759
|
-
extendedInformation: `By convention, CDS association names must start with an underscore character.
|
|
58760
|
-
|
|
58827
|
+
extendedInformation: `By convention, CDS association names must start with an underscore character.
|
|
58828
|
+
|
|
58761
58829
|
https://help.sap.com/docs/abap-cloud/abap-data-models/cds-associations`,
|
|
58762
58830
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Naming],
|
|
58763
|
-
badExample: `define view entity test as select from source
|
|
58764
|
-
association [1..1] to target as Assoc on Assoc.id = source.id
|
|
58831
|
+
badExample: `define view entity test as select from source
|
|
58832
|
+
association [1..1] to target as Assoc on Assoc.id = source.id
|
|
58765
58833
|
{ key id }`,
|
|
58766
|
-
goodExample: `define view entity test as select from source
|
|
58767
|
-
association [1..1] to target as _Assoc on _Assoc.id = source.id
|
|
58834
|
+
goodExample: `define view entity test as select from source
|
|
58835
|
+
association [1..1] to target as _Assoc on _Assoc.id = source.id
|
|
58768
58836
|
{ key id }`,
|
|
58769
58837
|
};
|
|
58770
58838
|
}
|
|
@@ -58842,10 +58910,10 @@ class CDSCommentStyle {
|
|
|
58842
58910
|
key: "cds_comment_style",
|
|
58843
58911
|
title: "CDS Comment Style",
|
|
58844
58912
|
shortDescription: `Check for obsolete comment style`,
|
|
58845
|
-
extendedInformation: `Check for obsolete comment style
|
|
58846
|
-
|
|
58847
|
-
Comments starting with "--" are considered obsolete
|
|
58848
|
-
|
|
58913
|
+
extendedInformation: `Check for obsolete comment style
|
|
58914
|
+
|
|
58915
|
+
Comments starting with "--" are considered obsolete
|
|
58916
|
+
|
|
58849
58917
|
https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abencds_general_syntax_rules.htm`,
|
|
58850
58918
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
58851
58919
|
badExample: "-- this is a comment",
|
|
@@ -58912,19 +58980,19 @@ class CDSFieldOrder {
|
|
|
58912
58980
|
title: "CDS Field Order",
|
|
58913
58981
|
shortDescription: `Checks that CDS key fields are listed first and associations last in the field list`,
|
|
58914
58982
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
58915
|
-
badExample: `define view entity test as select from source
|
|
58916
|
-
association [1..1] to target as _Assoc on _Assoc.id = source.id
|
|
58917
|
-
{
|
|
58918
|
-
field1,
|
|
58919
|
-
key id,
|
|
58920
|
-
_Assoc
|
|
58983
|
+
badExample: `define view entity test as select from source
|
|
58984
|
+
association [1..1] to target as _Assoc on _Assoc.id = source.id
|
|
58985
|
+
{
|
|
58986
|
+
field1,
|
|
58987
|
+
key id,
|
|
58988
|
+
_Assoc
|
|
58921
58989
|
}`,
|
|
58922
|
-
goodExample: `define view entity test as select from source
|
|
58923
|
-
association [1..1] to target as _Assoc on _Assoc.id = source.id
|
|
58924
|
-
{
|
|
58925
|
-
key id,
|
|
58926
|
-
field1,
|
|
58927
|
-
_Assoc
|
|
58990
|
+
goodExample: `define view entity test as select from source
|
|
58991
|
+
association [1..1] to target as _Assoc on _Assoc.id = source.id
|
|
58992
|
+
{
|
|
58993
|
+
key id,
|
|
58994
|
+
field1,
|
|
58995
|
+
_Assoc
|
|
58928
58996
|
}`,
|
|
58929
58997
|
};
|
|
58930
58998
|
}
|
|
@@ -59039,10 +59107,10 @@ class CDSLegacyView {
|
|
|
59039
59107
|
key: "cds_legacy_view",
|
|
59040
59108
|
title: "CDS Legacy View",
|
|
59041
59109
|
shortDescription: `Identify CDS Legacy Views`,
|
|
59042
|
-
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
59043
|
-
|
|
59044
|
-
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
59045
|
-
|
|
59110
|
+
extendedInformation: `Use DEFINE VIEW ENTITY instead of DEFINE VIEW
|
|
59111
|
+
|
|
59112
|
+
https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/
|
|
59113
|
+
|
|
59046
59114
|
v755 and up`,
|
|
59047
59115
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Upport],
|
|
59048
59116
|
};
|
|
@@ -59137,13 +59205,13 @@ class CDSNaming {
|
|
|
59137
59205
|
key: "cds_naming",
|
|
59138
59206
|
title: "CDS Naming",
|
|
59139
59207
|
shortDescription: `Checks CDS naming conventions based on the VDM prefix rules`,
|
|
59140
|
-
extendedInformation: `Validates that CDS entity names follow the expected prefix conventions:
|
|
59141
|
-
I_ for interface views, C_ for consumption views, R_ for restricted reuse views,
|
|
59142
|
-
P_ for private views, A_ for remote API views, X_ for view extends,
|
|
59143
|
-
E_ for extension include views, F_ for derivation functions, D_ for abstract entities.
|
|
59144
|
-
|
|
59145
|
-
Names must also start with Z after the prefix (custom namespace).
|
|
59146
|
-
|
|
59208
|
+
extendedInformation: `Validates that CDS entity names follow the expected prefix conventions:
|
|
59209
|
+
I_ for interface views, C_ for consumption views, R_ for restricted reuse views,
|
|
59210
|
+
P_ for private views, A_ for remote API views, X_ for view extends,
|
|
59211
|
+
E_ for extension include views, F_ for derivation functions, D_ for abstract entities.
|
|
59212
|
+
|
|
59213
|
+
Names must also start with Z after the prefix (custom namespace).
|
|
59214
|
+
|
|
59147
59215
|
https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/ee6ff9b281d8448f96b4fe6c89f2bdc8/8a8cee943ef944fe8936f4cc60ba9bc1.html`,
|
|
59148
59216
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Naming],
|
|
59149
59217
|
badExample: `define view entity ZMY_VIEW as select from source { key id }`,
|
|
@@ -59339,10 +59407,10 @@ class ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {
|
|
|
59339
59407
|
key: "chain_mainly_declarations",
|
|
59340
59408
|
title: "Chain mainly declarations",
|
|
59341
59409
|
shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,
|
|
59342
|
-
extendedInformation: `
|
|
59343
|
-
https://docs.abapopenchecks.org/checks/23/
|
|
59344
|
-
|
|
59345
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
59410
|
+
extendedInformation: `
|
|
59411
|
+
https://docs.abapopenchecks.org/checks/23/
|
|
59412
|
+
|
|
59413
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm
|
|
59346
59414
|
`,
|
|
59347
59415
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
59348
59416
|
badExample: `CALL METHOD: bar.`,
|
|
@@ -59518,17 +59586,17 @@ class ChangeIfToCase extends _abap_rule_1.ABAPRule {
|
|
|
59518
59586
|
title: "Change IF to CASE",
|
|
59519
59587
|
shortDescription: `Finds IF constructs that can be changed to CASE`,
|
|
59520
59588
|
// eslint-disable-next-line max-len
|
|
59521
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
59522
|
-
|
|
59589
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-case-to-else-if-for-multiple-alternative-conditions
|
|
59590
|
+
|
|
59523
59591
|
If the first comparison is a boolean compare, no issue is reported.`,
|
|
59524
59592
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
59525
|
-
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
59526
|
-
ELSEIF l_fcat-fieldname = 'BAR'
|
|
59527
|
-
OR l_fcat-fieldname = 'MOO'.
|
|
59593
|
+
badExample: `IF l_fcat-fieldname EQ 'FOO'.
|
|
59594
|
+
ELSEIF l_fcat-fieldname = 'BAR'
|
|
59595
|
+
OR l_fcat-fieldname = 'MOO'.
|
|
59528
59596
|
ENDIF.`,
|
|
59529
|
-
goodExample: `CASE l_fcat-fieldname.
|
|
59530
|
-
WHEN 'FOO'.
|
|
59531
|
-
WHEN 'BAR' OR 'MOO'.
|
|
59597
|
+
goodExample: `CASE l_fcat-fieldname.
|
|
59598
|
+
WHEN 'FOO'.
|
|
59599
|
+
WHEN 'BAR' OR 'MOO'.
|
|
59532
59600
|
ENDCASE.`,
|
|
59533
59601
|
};
|
|
59534
59602
|
}
|
|
@@ -59665,8 +59733,8 @@ class CheckAbstract extends _abap_rule_1.ABAPRule {
|
|
|
59665
59733
|
return {
|
|
59666
59734
|
key: "check_abstract",
|
|
59667
59735
|
title: "Check abstract methods and classes",
|
|
59668
|
-
shortDescription: `Checks abstract methods and classes:
|
|
59669
|
-
- class defined as abstract and final,
|
|
59736
|
+
shortDescription: `Checks abstract methods and classes:
|
|
59737
|
+
- class defined as abstract and final,
|
|
59670
59738
|
- non-abstract class contains abstract methods`,
|
|
59671
59739
|
extendedInformation: `If a class defines only constants, use an interface instead`,
|
|
59672
59740
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -59748,11 +59816,11 @@ class CheckComments extends _abap_rule_1.ABAPRule {
|
|
|
59748
59816
|
return {
|
|
59749
59817
|
key: "check_comments",
|
|
59750
59818
|
title: "Check Comments",
|
|
59751
|
-
shortDescription: `
|
|
59819
|
+
shortDescription: `
|
|
59752
59820
|
Various checks for comment usage.`,
|
|
59753
|
-
extendedInformation: `
|
|
59754
|
-
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
59755
|
-
|
|
59821
|
+
extendedInformation: `
|
|
59822
|
+
Detects end of line comments. Comments starting with "#EC" or "##" are ignored
|
|
59823
|
+
|
|
59756
59824
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,
|
|
59757
59825
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
59758
59826
|
badExample: `WRITE 2. " descriptive comment`,
|
|
@@ -59927,10 +59995,10 @@ class CheckInclude {
|
|
|
59927
59995
|
key: "check_include",
|
|
59928
59996
|
title: "Check INCLUDEs",
|
|
59929
59997
|
shortDescription: `Checks INCLUDE statements`,
|
|
59930
|
-
extendedInformation: `
|
|
59931
|
-
* Reports unused includes
|
|
59932
|
-
* Errors if the includes are not found
|
|
59933
|
-
* Error if including a main program
|
|
59998
|
+
extendedInformation: `
|
|
59999
|
+
* Reports unused includes
|
|
60000
|
+
* Errors if the includes are not found
|
|
60001
|
+
* Error if including a main program
|
|
59934
60002
|
* Skips ZX* includes`,
|
|
59935
60003
|
tags: [_irule_1.RuleTag.Syntax],
|
|
59936
60004
|
};
|
|
@@ -60010,14 +60078,14 @@ class CheckSubrc extends _abap_rule_1.ABAPRule {
|
|
|
60010
60078
|
key: "check_subrc",
|
|
60011
60079
|
title: "Check sy-subrc",
|
|
60012
60080
|
shortDescription: `Check sy-subrc`,
|
|
60013
|
-
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
60014
|
-
|
|
60015
|
-
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
60016
|
-
|
|
60017
|
-
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
60018
|
-
|
|
60019
|
-
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
60020
|
-
|
|
60081
|
+
extendedInformation: `Pseudo comment "#EC CI_SUBRC can be added to suppress findings
|
|
60082
|
+
|
|
60083
|
+
If sy-dbcnt is checked after database statements, it is considered okay.
|
|
60084
|
+
|
|
60085
|
+
"SELECT SINGLE @abap_true FROM " is considered as an existence check, also "SELECT COUNT( * )" is considered okay
|
|
60086
|
+
|
|
60087
|
+
If IS ASSIGNED is checked after assigning, it is considered okay.
|
|
60088
|
+
|
|
60021
60089
|
FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
60022
60090
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
60023
60091
|
pseudoComment: "EC CI_SUBRC",
|
|
@@ -60596,17 +60664,17 @@ class ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {
|
|
|
60596
60664
|
shortDescription: `Find overlapping classic exceptions`,
|
|
60597
60665
|
extendedInformation: `When debugging its typically good to know exactly which exception is caught`,
|
|
60598
60666
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
60599
|
-
badExample: `CALL FUNCTION 'SOMETHING'
|
|
60600
|
-
EXCEPTIONS
|
|
60601
|
-
system_failure = 1 MESSAGE lv_message
|
|
60602
|
-
communication_failure = 1 MESSAGE lv_message
|
|
60603
|
-
resource_failure = 1
|
|
60667
|
+
badExample: `CALL FUNCTION 'SOMETHING'
|
|
60668
|
+
EXCEPTIONS
|
|
60669
|
+
system_failure = 1 MESSAGE lv_message
|
|
60670
|
+
communication_failure = 1 MESSAGE lv_message
|
|
60671
|
+
resource_failure = 1
|
|
60604
60672
|
OTHERS = 1.`,
|
|
60605
|
-
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
60606
|
-
EXCEPTIONS
|
|
60607
|
-
system_failure = 1 MESSAGE lv_message
|
|
60608
|
-
communication_failure = 2 MESSAGE lv_message
|
|
60609
|
-
resource_failure = 3
|
|
60673
|
+
goodExample: `CALL FUNCTION 'SOMETHING'
|
|
60674
|
+
EXCEPTIONS
|
|
60675
|
+
system_failure = 1 MESSAGE lv_message
|
|
60676
|
+
communication_failure = 2 MESSAGE lv_message
|
|
60677
|
+
resource_failure = 3
|
|
60610
60678
|
OTHERS = 4.`,
|
|
60611
60679
|
};
|
|
60612
60680
|
}
|
|
@@ -60871,7 +60939,7 @@ class CommentedCode extends _abap_rule_1.ABAPRule {
|
|
|
60871
60939
|
key: "commented_code",
|
|
60872
60940
|
title: "Find commented code",
|
|
60873
60941
|
shortDescription: `Detects usage of commented out code.`,
|
|
60874
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
60942
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it
|
|
60875
60943
|
https://docs.abapopenchecks.org/checks/14/`,
|
|
60876
60944
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
60877
60945
|
badExample: `* WRITE 'hello world'.`,
|
|
@@ -61105,10 +61173,10 @@ class ConstructorVisibilityPublic {
|
|
|
61105
61173
|
key: "constructor_visibility_public",
|
|
61106
61174
|
title: "Check constructor visibility is public",
|
|
61107
61175
|
shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,
|
|
61108
|
-
extendedInformation: `
|
|
61109
|
-
This only applies to global classes.
|
|
61110
|
-
|
|
61111
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
61176
|
+
extendedInformation: `
|
|
61177
|
+
This only applies to global classes.
|
|
61178
|
+
|
|
61179
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public
|
|
61112
61180
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,
|
|
61113
61181
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61114
61182
|
};
|
|
@@ -61183,8 +61251,8 @@ class ContainsTab extends _abap_rule_1.ABAPRule {
|
|
|
61183
61251
|
key: "contains_tab",
|
|
61184
61252
|
title: "Code contains tab",
|
|
61185
61253
|
shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,
|
|
61186
|
-
extendedInformation: `
|
|
61187
|
-
https://docs.abapopenchecks.org/checks/09/
|
|
61254
|
+
extendedInformation: `
|
|
61255
|
+
https://docs.abapopenchecks.org/checks/09/
|
|
61188
61256
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
61189
61257
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
61190
61258
|
badExample: `\tWRITE 'hello world'.`,
|
|
@@ -61271,10 +61339,10 @@ class CyclicOO {
|
|
|
61271
61339
|
key: "cyclic_oo",
|
|
61272
61340
|
title: "Cyclic OO",
|
|
61273
61341
|
shortDescription: `Finds cyclic/circular OO references`,
|
|
61274
|
-
extendedInformation: `Runs for global INTF + CLAS objects
|
|
61275
|
-
|
|
61276
|
-
Objects must be without syntax errors for this rule to take effect
|
|
61277
|
-
|
|
61342
|
+
extendedInformation: `Runs for global INTF + CLAS objects
|
|
61343
|
+
|
|
61344
|
+
Objects must be without syntax errors for this rule to take effect
|
|
61345
|
+
|
|
61278
61346
|
References in testclass includes are ignored`,
|
|
61279
61347
|
};
|
|
61280
61348
|
}
|
|
@@ -61517,7 +61585,7 @@ class DangerousStatement extends _abap_rule_1.ABAPRule {
|
|
|
61517
61585
|
key: "dangerous_statement",
|
|
61518
61586
|
title: "Dangerous statement",
|
|
61519
61587
|
shortDescription: `Detects potentially dangerous statements`,
|
|
61520
|
-
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
61588
|
+
extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,
|
|
61521
61589
|
dynamic SQL can potentially create SQL injection problems`,
|
|
61522
61590
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
61523
61591
|
};
|
|
@@ -61724,13 +61792,13 @@ class DefinitionsTop extends _abap_rule_1.ABAPRule {
|
|
|
61724
61792
|
shortDescription: `Checks that definitions are placed at the beginning of METHODs, FORMs and FUNCTIONs.`,
|
|
61725
61793
|
extendedInformation: `https://docs.abapopenchecks.org/checks/17/`,
|
|
61726
61794
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
61727
|
-
badExample: `FORM foo.
|
|
61728
|
-
WRITE 'hello'.
|
|
61729
|
-
DATA int TYPE i.
|
|
61795
|
+
badExample: `FORM foo.
|
|
61796
|
+
WRITE 'hello'.
|
|
61797
|
+
DATA int TYPE i.
|
|
61730
61798
|
ENDFORM.`,
|
|
61731
|
-
goodExample: `FORM foo.
|
|
61732
|
-
DATA int TYPE i.
|
|
61733
|
-
WRITE 'hello'.
|
|
61799
|
+
goodExample: `FORM foo.
|
|
61800
|
+
DATA int TYPE i.
|
|
61801
|
+
WRITE 'hello'.
|
|
61734
61802
|
ENDFORM.`,
|
|
61735
61803
|
};
|
|
61736
61804
|
}
|
|
@@ -62279,39 +62347,39 @@ class Downport {
|
|
|
62279
62347
|
key: "downport",
|
|
62280
62348
|
title: "Downport statement",
|
|
62281
62349
|
shortDescription: `Downport functionality`,
|
|
62282
|
-
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
62283
|
-
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
62284
|
-
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
62285
|
-
|
|
62286
|
-
Current rules:
|
|
62287
|
-
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
62288
|
-
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
62289
|
-
* FIELD-SYMBOL() definitions are outlined
|
|
62290
|
-
* CONV is outlined
|
|
62291
|
-
* COND is outlined
|
|
62292
|
-
* REDUCE is outlined
|
|
62293
|
-
* SWITCH is outlined
|
|
62294
|
-
* FILTER is outlined
|
|
62295
|
-
* APPEND expression is outlined
|
|
62296
|
-
* INSERT expression is outlined
|
|
62297
|
-
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
62298
|
-
* CAST changed to ?=
|
|
62299
|
-
* LOOP AT method_call( ) is outlined
|
|
62300
|
-
* VALUE # with structure fields
|
|
62301
|
-
* VALUE # with internal table lines
|
|
62302
|
-
* Table Expressions are outlined
|
|
62303
|
-
* SELECT INTO @DATA definitions are outlined
|
|
62304
|
-
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
62305
|
-
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
62306
|
-
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
62307
|
-
* RAISE EXCEPTION ... MESSAGE
|
|
62308
|
-
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
62309
|
-
* line_exists and line_index is downported to READ TABLE
|
|
62310
|
-
* ENUMs, but does not nessesarily give the correct type and value
|
|
62311
|
-
* MESSAGE with non simple source
|
|
62312
|
-
|
|
62313
|
-
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
62314
|
-
|
|
62350
|
+
extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
|
|
62351
|
+
a higher level language version. If successful, various rules are applied to downport the statement.
|
|
62352
|
+
Target downport version is always v702, thus rule is only enabled if target version is v702.
|
|
62353
|
+
|
|
62354
|
+
Current rules:
|
|
62355
|
+
* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/
|
|
62356
|
+
* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/
|
|
62357
|
+
* FIELD-SYMBOL() definitions are outlined
|
|
62358
|
+
* CONV is outlined
|
|
62359
|
+
* COND is outlined
|
|
62360
|
+
* REDUCE is outlined
|
|
62361
|
+
* SWITCH is outlined
|
|
62362
|
+
* FILTER is outlined
|
|
62363
|
+
* APPEND expression is outlined
|
|
62364
|
+
* INSERT expression is outlined
|
|
62365
|
+
* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/
|
|
62366
|
+
* CAST changed to ?=
|
|
62367
|
+
* LOOP AT method_call( ) is outlined
|
|
62368
|
+
* VALUE # with structure fields
|
|
62369
|
+
* VALUE # with internal table lines
|
|
62370
|
+
* Table Expressions are outlined
|
|
62371
|
+
* SELECT INTO @DATA definitions are outlined
|
|
62372
|
+
* Some occurrences of string template formatting option ALPHA changed to function module call
|
|
62373
|
+
* SELECT/INSERT/MODIFY/DELETE/UPDATE "," in field list removed, "@" in source/targets removed
|
|
62374
|
+
* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods
|
|
62375
|
+
* RAISE EXCEPTION ... MESSAGE
|
|
62376
|
+
* Moving with +=, -=, /=, *=, &&= is expanded
|
|
62377
|
+
* line_exists and line_index is downported to READ TABLE
|
|
62378
|
+
* ENUMs, but does not nessesarily give the correct type and value
|
|
62379
|
+
* MESSAGE with non simple source
|
|
62380
|
+
|
|
62381
|
+
Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.
|
|
62382
|
+
|
|
62315
62383
|
Make sure to test the downported code, it might not always be completely correct.`,
|
|
62316
62384
|
tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
|
|
62317
62385
|
};
|
|
@@ -62926,10 +62994,10 @@ Make sure to test the downported code, it might not always be completely correct
|
|
|
62926
62994
|
const fieldName = f.concatTokens();
|
|
62927
62995
|
fieldDefinition += indentation + " " + fieldName + " TYPE " + tableName + "-" + fieldName + ",\n";
|
|
62928
62996
|
}
|
|
62929
|
-
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
62997
|
+
fieldDefinition = `DATA: BEGIN OF ${name},
|
|
62930
62998
|
${fieldDefinition}${indentation} END OF ${name}.`;
|
|
62931
62999
|
}
|
|
62932
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
63000
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}
|
|
62933
63001
|
${indentation}`);
|
|
62934
63002
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
62935
63003
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -62988,12 +63056,12 @@ ${indentation}`);
|
|
|
62988
63056
|
}
|
|
62989
63057
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
62990
63058
|
const name = ((_g = inlineData.findFirstExpression(Expressions.TargetField)) === null || _g === void 0 ? void 0 : _g.concatTokens()) || "error";
|
|
62991
|
-
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
62992
|
-
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
62993
|
-
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
63059
|
+
let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},
|
|
63060
|
+
${fieldDefinitions}${indentation} END OF ${uniqueName}.
|
|
63061
|
+
${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.
|
|
62994
63062
|
${indentation}`);
|
|
62995
63063
|
if (fieldDefinitions === "") {
|
|
62996
|
-
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
63064
|
+
fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.
|
|
62997
63065
|
${indentation}`);
|
|
62998
63066
|
}
|
|
62999
63067
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);
|
|
@@ -63061,7 +63129,7 @@ ${indentation}`);
|
|
|
63061
63129
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63062
63130
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
63063
63131
|
const firstToken = high.getFirstToken();
|
|
63064
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
63132
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
63065
63133
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
63066
63134
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
63067
63135
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -63117,7 +63185,7 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
63117
63185
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63118
63186
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
63119
63187
|
const firstToken = high.getFirstToken();
|
|
63120
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
63188
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.
|
|
63121
63189
|
${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
63122
63190
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);
|
|
63123
63191
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -63159,14 +63227,14 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
63159
63227
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
63160
63228
|
const firstToken = high.getFirstToken();
|
|
63161
63229
|
// note that the tabix restore should be done before throwing the exception
|
|
63162
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
63163
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
63164
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
63165
|
-
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
63166
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
63167
|
-
${indentation}IF sy-subrc <> 0.
|
|
63168
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
63169
|
-
${indentation}ENDIF.
|
|
63230
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.
|
|
63231
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
63232
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
63233
|
+
${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.
|
|
63234
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
63235
|
+
${indentation}IF sy-subrc <> 0.
|
|
63236
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
63237
|
+
${indentation}ENDIF.
|
|
63170
63238
|
${indentation}`);
|
|
63171
63239
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);
|
|
63172
63240
|
const fix = edit_helper_1.EditHelper.merge(fix2, fix1);
|
|
@@ -63226,7 +63294,7 @@ ${indentation}`);
|
|
|
63226
63294
|
const className = classNames[0].concatTokens();
|
|
63227
63295
|
const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
63228
63296
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
63229
|
-
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
63297
|
+
const code = ` DATA ${targetName} TYPE REF TO ${className}.
|
|
63230
63298
|
${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
63231
63299
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);
|
|
63232
63300
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
@@ -63394,17 +63462,17 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
63394
63462
|
const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63395
63463
|
const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63396
63464
|
const indentation = " ".repeat(node.getFirstToken().getStart().getCol() - 1);
|
|
63397
|
-
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
63398
|
-
${indentation}${uniqueName1}-msgid = ${id}.
|
|
63465
|
+
let abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.
|
|
63466
|
+
${indentation}${uniqueName1}-msgid = ${id}.
|
|
63399
63467
|
${indentation}${uniqueName1}-msgno = ${number}.\n`;
|
|
63400
63468
|
if (withs.length > 0) {
|
|
63401
|
-
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
63402
|
-
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
63403
|
-
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
63469
|
+
abap += `${indentation}${uniqueName1}-attr1 = 'IF_T100_DYN_MSG~MSGV1'.
|
|
63470
|
+
${indentation}${uniqueName1}-attr2 = 'IF_T100_DYN_MSG~MSGV2'.
|
|
63471
|
+
${indentation}${uniqueName1}-attr3 = 'IF_T100_DYN_MSG~MSGV3'.
|
|
63404
63472
|
${indentation}${uniqueName1}-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\n`;
|
|
63405
63473
|
}
|
|
63406
|
-
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
63407
|
-
${indentation}CREATE OBJECT ${uniqueName2}.
|
|
63474
|
+
abap += `${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.
|
|
63475
|
+
${indentation}CREATE OBJECT ${uniqueName2}.
|
|
63408
63476
|
${indentation}${uniqueName2}->if_t100_message~t100key = ${uniqueName1}.\n`;
|
|
63409
63477
|
if (withs.length > 0) {
|
|
63410
63478
|
abap += `${indentation}${uniqueName2}->if_t100_dyn_msg~msgty = 'E'.\n`;
|
|
@@ -63517,10 +63585,10 @@ ${indentation}${uniqueName2}->if_t100_message~t100key = ${uniqueName1}.\n`;
|
|
|
63517
63585
|
let code = "";
|
|
63518
63586
|
if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
|
|
63519
63587
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63520
|
-
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
63521
|
-
IF sy-subrc <> 0.
|
|
63522
|
-
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
63523
|
-
ENDIF.
|
|
63588
|
+
code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
|
|
63589
|
+
IF sy-subrc <> 0.
|
|
63590
|
+
RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
63591
|
+
ENDIF.
|
|
63524
63592
|
GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
63525
63593
|
}
|
|
63526
63594
|
else {
|
|
@@ -63609,20 +63677,20 @@ GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
|
|
|
63609
63677
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63610
63678
|
const uniqueFS = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63611
63679
|
const uniqueNameIndex = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63612
|
-
code += ` items LIKE ${loopSourceName},
|
|
63613
|
-
END OF ${groupTargetName}type.
|
|
63614
|
-
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
63615
|
-
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
63680
|
+
code += ` items LIKE ${loopSourceName},
|
|
63681
|
+
END OF ${groupTargetName}type.
|
|
63682
|
+
DATA ${groupTargetName}tab TYPE STANDARD TABLE OF ${groupTargetName}type WITH DEFAULT KEY.
|
|
63683
|
+
DATA ${uniqueName} LIKE LINE OF ${groupTargetName}tab.
|
|
63616
63684
|
LOOP AT ${loopSourceName} ${(_l = high.findFirstExpression(Expressions.LoopTarget)) === null || _l === void 0 ? void 0 : _l.concatTokens()}.\n`;
|
|
63617
63685
|
if (groupIndexName !== undefined) {
|
|
63618
63686
|
code += `DATA(${uniqueNameIndex}) = sy-tabix.\n`;
|
|
63619
63687
|
}
|
|
63620
|
-
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
63688
|
+
code += `READ TABLE ${groupTargetName}tab ASSIGNING FIELD-SYMBOL(<${uniqueFS}>) WITH KEY ${condition}.
|
|
63621
63689
|
IF sy-subrc = 0.\n`;
|
|
63622
63690
|
if (groupCountName !== undefined) {
|
|
63623
63691
|
code += ` <${uniqueFS}>-${groupCountName} = <${uniqueFS}>-${groupCountName} + 1.\n`;
|
|
63624
63692
|
}
|
|
63625
|
-
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
63693
|
+
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE <${uniqueFS}>-items.
|
|
63626
63694
|
ELSE.\n`;
|
|
63627
63695
|
code += ` CLEAR ${uniqueName}.\n`;
|
|
63628
63696
|
for (const c of group.findAllExpressions(Expressions.LoopGroupByComponent)) {
|
|
@@ -63643,8 +63711,8 @@ ELSE.\n`;
|
|
|
63643
63711
|
}
|
|
63644
63712
|
code += ` INSERT ${loopTargetName}${isReference ? "->*" : ""} INTO TABLE ${uniqueName}-items.\n`;
|
|
63645
63713
|
code += ` INSERT ${uniqueName} INTO TABLE ${groupTargetName}tab.\n`;
|
|
63646
|
-
code += `ENDIF.
|
|
63647
|
-
ENDLOOP.
|
|
63714
|
+
code += `ENDIF.
|
|
63715
|
+
ENDLOOP.
|
|
63648
63716
|
LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
63649
63717
|
let fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
63650
63718
|
for (const l of ((_m = highFile.getStructure()) === null || _m === void 0 ? void 0 : _m.findAllStructures(Structures.Loop)) || []) {
|
|
@@ -63816,7 +63884,7 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
63816
63884
|
const enumName = (_b = high.findExpressionAfterToken("ENUM")) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
63817
63885
|
const structureName = (_c = high.findExpressionAfterToken("STRUCTURE")) === null || _c === void 0 ? void 0 : _c.concatTokens();
|
|
63818
63886
|
// all ENUMS are char like?
|
|
63819
|
-
let code = `TYPES ${enumName} TYPE string.
|
|
63887
|
+
let code = `TYPES ${enumName} TYPE string.
|
|
63820
63888
|
CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
63821
63889
|
let count = 1;
|
|
63822
63890
|
for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {
|
|
@@ -63860,14 +63928,14 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
63860
63928
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63861
63929
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
63862
63930
|
// restore tabix before exeption
|
|
63863
|
-
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
63864
|
-
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
63865
|
-
${indentation}${tabixBackup} = sy-tabix.
|
|
63866
|
-
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
63867
|
-
${indentation}sy-tabix = ${tabixBackup}.
|
|
63868
|
-
${indentation}IF sy-subrc <> 0.
|
|
63869
|
-
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
63870
|
-
${indentation}ENDIF.
|
|
63931
|
+
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
|
63932
|
+
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
63933
|
+
${indentation}${tabixBackup} = sy-tabix.
|
|
63934
|
+
${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.
|
|
63935
|
+
${indentation}sy-tabix = ${tabixBackup}.
|
|
63936
|
+
${indentation}IF sy-subrc <> 0.
|
|
63937
|
+
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
63938
|
+
${indentation}ENDIF.
|
|
63871
63939
|
${indentation}${uniqueName}`;
|
|
63872
63940
|
const start = target.getFirstToken().getStart();
|
|
63873
63941
|
const end = (_a = tableExpression.findDirectTokenByText("]")) === null || _a === void 0 ? void 0 : _a.getEnd();
|
|
@@ -63947,11 +64015,11 @@ ${indentation}${uniqueName}`;
|
|
|
63947
64015
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
63948
64016
|
const source = (_b = child.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
63949
64017
|
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
63950
|
-
const code = `DATA ${uniqueName} TYPE string.
|
|
63951
|
-
${indentation}CALL FUNCTION '${functionName}'
|
|
63952
|
-
${indentation} EXPORTING
|
|
63953
|
-
${indentation} input = ${source}
|
|
63954
|
-
${indentation} IMPORTING
|
|
64018
|
+
const code = `DATA ${uniqueName} TYPE string.
|
|
64019
|
+
${indentation}CALL FUNCTION '${functionName}'
|
|
64020
|
+
${indentation} EXPORTING
|
|
64021
|
+
${indentation} input = ${source}
|
|
64022
|
+
${indentation} IMPORTING
|
|
63955
64023
|
${indentation} output = ${uniqueName}.\n`;
|
|
63956
64024
|
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getFirstToken().getStart(), code);
|
|
63957
64025
|
const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, child.getFirstToken().getStart(), child.getLastToken().getEnd(), uniqueName);
|
|
@@ -65338,12 +65406,12 @@ class EasyToFindMessages {
|
|
|
65338
65406
|
key: "easy_to_find_messages",
|
|
65339
65407
|
title: "Easy to find messages",
|
|
65340
65408
|
shortDescription: `Make messages easy to find`,
|
|
65341
|
-
extendedInformation: `All messages must be statically referenced exactly once
|
|
65342
|
-
|
|
65343
|
-
Only MESSAGE and RAISE statments are counted as static references
|
|
65344
|
-
|
|
65345
|
-
Also see rule "message_exists"
|
|
65346
|
-
|
|
65409
|
+
extendedInformation: `All messages must be statically referenced exactly once
|
|
65410
|
+
|
|
65411
|
+
Only MESSAGE and RAISE statments are counted as static references
|
|
65412
|
+
|
|
65413
|
+
Also see rule "message_exists"
|
|
65414
|
+
|
|
65347
65415
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#make-messages-easy-to-find`,
|
|
65348
65416
|
tags: [_irule_1.RuleTag.Styleguide],
|
|
65349
65417
|
};
|
|
@@ -65424,13 +65492,13 @@ class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
|
65424
65492
|
shortDescription: `Empty selection screen or list processing event block`,
|
|
65425
65493
|
extendedInformation: ``,
|
|
65426
65494
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
65427
|
-
badExample: `
|
|
65428
|
-
INITIALIZATION.
|
|
65429
|
-
WRITE 'hello'.
|
|
65495
|
+
badExample: `
|
|
65496
|
+
INITIALIZATION.
|
|
65497
|
+
WRITE 'hello'.
|
|
65430
65498
|
END-OF-SELECTION.`,
|
|
65431
|
-
goodExample: `
|
|
65432
|
-
START-OF-SELECTION.
|
|
65433
|
-
PERFORM sdf.
|
|
65499
|
+
goodExample: `
|
|
65500
|
+
START-OF-SELECTION.
|
|
65501
|
+
PERFORM sdf.
|
|
65434
65502
|
COMMIT WORK.`,
|
|
65435
65503
|
};
|
|
65436
65504
|
}
|
|
@@ -65522,8 +65590,8 @@ class EmptyLineinStatement extends _abap_rule_1.ABAPRule {
|
|
|
65522
65590
|
key: "empty_line_in_statement",
|
|
65523
65591
|
title: "Find empty lines in statements",
|
|
65524
65592
|
shortDescription: `Checks that statements do not contain empty lines.`,
|
|
65525
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
65526
|
-
|
|
65593
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-obsess-with-separating-blank-lines
|
|
65594
|
+
|
|
65527
65595
|
https://docs.abapopenchecks.org/checks/41/`,
|
|
65528
65596
|
tags: [_irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
65529
65597
|
badExample: `WRITE\n\nhello.`,
|
|
@@ -65699,13 +65767,13 @@ class EmptyStructure extends _abap_rule_1.ABAPRule {
|
|
|
65699
65767
|
shortDescription: `Checks that the code does not contain empty blocks.`,
|
|
65700
65768
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-empty-if-branches`,
|
|
65701
65769
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
65702
|
-
badExample: `IF foo = bar.
|
|
65703
|
-
ENDIF.
|
|
65704
|
-
|
|
65705
|
-
DO 2 TIMES.
|
|
65770
|
+
badExample: `IF foo = bar.
|
|
65771
|
+
ENDIF.
|
|
65772
|
+
|
|
65773
|
+
DO 2 TIMES.
|
|
65706
65774
|
ENDDO.`,
|
|
65707
|
-
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
65708
|
-
ENDLOOP.
|
|
65775
|
+
goodExample: `LOOP AT itab WHERE qty = 0 OR date > sy-datum.
|
|
65776
|
+
ENDLOOP.
|
|
65709
65777
|
result = xsdbool( sy-subrc = 0 ).`,
|
|
65710
65778
|
};
|
|
65711
65779
|
}
|
|
@@ -65847,10 +65915,10 @@ class ExitOrCheck extends _abap_rule_1.ABAPRule {
|
|
|
65847
65915
|
return {
|
|
65848
65916
|
key: "exit_or_check",
|
|
65849
65917
|
title: "Find EXIT or CHECK outside loops",
|
|
65850
|
-
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
65918
|
+
shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.
|
|
65851
65919
|
Use RETURN to leave procesing blocks instead.`,
|
|
65852
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
65853
|
-
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
65920
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm
|
|
65921
|
+
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm
|
|
65854
65922
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,
|
|
65855
65923
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
65856
65924
|
};
|
|
@@ -65934,12 +66002,12 @@ class ExpandMacros extends _abap_rule_1.ABAPRule {
|
|
|
65934
66002
|
key: "expand_macros",
|
|
65935
66003
|
title: "Expand Macros",
|
|
65936
66004
|
shortDescription: `Allows expanding macro calls with quick fixes`,
|
|
65937
|
-
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
65938
|
-
|
|
66005
|
+
extendedInformation: `Macros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm
|
|
66006
|
+
|
|
65939
66007
|
Note that macros/DEFINE cannot be used in the ABAP Cloud programming model`,
|
|
65940
|
-
badExample: `DEFINE _hello.
|
|
65941
|
-
WRITE 'hello'.
|
|
65942
|
-
END-OF-DEFINITION.
|
|
66008
|
+
badExample: `DEFINE _hello.
|
|
66009
|
+
WRITE 'hello'.
|
|
66010
|
+
END-OF-DEFINITION.
|
|
65943
66011
|
_hello.`,
|
|
65944
66012
|
goodExample: `WRITE 'hello'.`,
|
|
65945
66013
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
@@ -66026,7 +66094,7 @@ class Exporting extends _abap_rule_1.ABAPRule {
|
|
|
66026
66094
|
shortDescription: `Detects EXPORTING statements which can be omitted.`,
|
|
66027
66095
|
badExample: `call_method( EXPORTING foo = bar ).`,
|
|
66028
66096
|
goodExample: `call_method( foo = bar ).`,
|
|
66029
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
66097
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting
|
|
66030
66098
|
https://docs.abapopenchecks.org/checks/30/`,
|
|
66031
66099
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66032
66100
|
};
|
|
@@ -66186,7 +66254,7 @@ class ForbiddenIdentifier extends _abap_rule_1.ABAPRule {
|
|
|
66186
66254
|
key: "forbidden_identifier",
|
|
66187
66255
|
title: "Forbidden Identifier",
|
|
66188
66256
|
shortDescription: `Forbid use of specified identifiers, list of regex.`,
|
|
66189
|
-
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
66257
|
+
extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,
|
|
66190
66258
|
https://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,
|
|
66191
66259
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
66192
66260
|
};
|
|
@@ -66428,8 +66496,8 @@ class ForbiddenVoidType {
|
|
|
66428
66496
|
key: "forbidden_void_type",
|
|
66429
66497
|
title: "Forbidden Void Types",
|
|
66430
66498
|
shortDescription: `Avoid usage of specified void types.`,
|
|
66431
|
-
extendedInformation: `Inspiration:
|
|
66432
|
-
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
66499
|
+
extendedInformation: `Inspiration:
|
|
66500
|
+
BOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,
|
|
66433
66501
|
DATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,
|
|
66434
66502
|
};
|
|
66435
66503
|
}
|
|
@@ -66672,9 +66740,9 @@ class FullyTypeITabs extends _abap_rule_1.ABAPRule {
|
|
|
66672
66740
|
key: "fully_type_itabs",
|
|
66673
66741
|
title: "Fully type internal tables",
|
|
66674
66742
|
shortDescription: `No implict table types or table keys`,
|
|
66675
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
66743
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-the-right-table-type
|
|
66676
66744
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key`,
|
|
66677
|
-
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
66745
|
+
badExample: `DATA lt_foo TYPE TABLE OF ty.
|
|
66678
66746
|
DATA lt_bar TYPE STANDARD TABLE OF ty.`,
|
|
66679
66747
|
goodExample: `DATA lt_foo TYPE STANDARD TABLE OF ty WITH EMPTY KEY.`,
|
|
66680
66748
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
@@ -66740,25 +66808,54 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
|
|
|
66740
66808
|
* @uniqueItems true
|
|
66741
66809
|
*/
|
|
66742
66810
|
this.recommendations = [
|
|
66811
|
+
{ name: "CALCULATE_HASH_FOR_CHAR", replace: "use CL_ABAP_MESSAGE_DIGEST" },
|
|
66743
66812
|
{ name: "CALCULATE_HASH_FOR_RAW", replace: "use CL_ABAP_HMAC or CL_ABAP_MESSAGE_DIGEST" },
|
|
66744
66813
|
{ name: "CCU_TIMESTAMP_DIFFERENCE", replace: "use CL_ABAP_TSTMP" },
|
|
66814
|
+
{ name: "CLPB_EXPORT", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66815
|
+
{ name: "CLPB_IMPORT", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66745
66816
|
{ name: "CONVERT_DATE_TO_EXTERNAL", replace: "use CL_ABAP_DATFM" },
|
|
66746
66817
|
{ name: "CONVERT_TIME_INPUT", replace: "use CL_ABAP_TIMEFM" },
|
|
66818
|
+
{ name: "DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66747
66819
|
{ name: "ECATT_CONV_XSTRING_TO_STRING", replace: "use CL_BINARY_CONVERT" },
|
|
66748
66820
|
{ name: "F4_FILENAME", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66749
66821
|
{ name: "FUNCTION_EXISTS", replace: "surround with try-catch CX_SY_DYN_CALL_ILLEGAL_METHOD instead" },
|
|
66822
|
+
{ name: "GUI_CREATE_DIRECTORY", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66823
|
+
{ name: "GUI_DELETE_FILE", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66750
66824
|
{ name: "GUI_DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66825
|
+
{ name: "GUI_EXEC", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66826
|
+
{ name: "GUI_FB_USAGE", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66827
|
+
{ name: "GUI_FILE_LOAD_DIALOG", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66828
|
+
{ name: "GUI_FILE_SAVE_DIALOG", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66829
|
+
{ name: "GUI_GET_DESKTOP_INFO", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66830
|
+
{ name: "GUI_GET_FILE_INFO", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66831
|
+
{ name: "GUI_GET_REGVALUE", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66832
|
+
{ name: "GUI_MULTIPLE_FILE_LOAD_DIALOG", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66833
|
+
{ name: "GUI_REMOVE_DIRECTORY", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66834
|
+
{ name: "GUI_RUN", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66835
|
+
{ name: "GUI_SET_REGVALUE", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66751
66836
|
{ name: "GUI_UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66837
|
+
{ name: "GUI_VSS_DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66838
|
+
{ name: "GUI_VSS_UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66752
66839
|
{ name: "GUID_CREATE", replace: "use CL_SYSTEM_UUID" },
|
|
66753
66840
|
{ name: "IGN_TIMESTAMP_DIFFERENCE", replace: "use CL_ABAP_TSTMP" },
|
|
66754
66841
|
{ name: "IGN_TIMESTAMP_PLUSMINUS", replace: "use CL_ABAP_TSTMP" },
|
|
66755
66842
|
{ name: "ISM_SD_GET_PRICING_CONDITIONS", replace: "use CL_PRC_RESULT_FACTORY as per note 2220005" },
|
|
66756
66843
|
{ name: "JOB_CREATE", replace: "use CL_BP_ABAP_JOB" },
|
|
66757
66844
|
{ name: "JOB_SUBMIT", replace: "use CL_BP_ABAP_JOB" },
|
|
66845
|
+
{ name: "MD5_CALCULATE_HASH_FOR_CHAR", replace: "use CL_ABAP_MESSAGE_DIGEST" },
|
|
66846
|
+
{ name: "MD5_CALCULATE_HASH_FOR_RAW", replace: "use CL_ABAP_MESSAGE_DIGEST" },
|
|
66847
|
+
{ name: "POPUP_TO_CONFIRM_LOSS_OF_DATA", replace: "use POPUP_TO_CONFIRM" },
|
|
66758
66848
|
{ name: "POPUP_TO_CONFIRM_STEP", replace: "use POPUP_TO_CONFIRM" },
|
|
66849
|
+
{ name: "POPUP_TO_CONFIRM_WITH_MESSAGE", replace: "use POPUP_TO_CONFIRM" },
|
|
66850
|
+
{ name: "POPUP_TO_CONFIRM_WITH_VALUE", replace: "use POPUP_TO_CONFIRM" },
|
|
66851
|
+
{ name: "POPUP_TO_CONFIRM_WITH_VALUE_2", replace: "use POPUP_TO_CONFIRM" },
|
|
66759
66852
|
{ name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
|
|
66853
|
+
{ name: "POPUP_TO_DECIDE_INFO", replace: "use POPUP_TO_CONFIRM" },
|
|
66854
|
+
{ name: "POPUP_TO_DECIDE_WITH_MESSAGE", replace: "use POPUP_TO_CONFIRM" },
|
|
66760
66855
|
{ name: "POPUP_TO_GET_VALUE", replace: "use POPUP_GET_VALUES" },
|
|
66761
66856
|
{ name: "QF05_RANDOM_INTEGER", replace: "use CL_ABAP_RANDOM_INT" },
|
|
66857
|
+
{ name: "REGISTRY_GET", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66858
|
+
{ name: "REGISTRY_SET", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66762
66859
|
{ name: "REUSE_ALV_GRID_DISPLAY", replace: "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID" },
|
|
66763
66860
|
{ name: "ROUND", replace: "use built in function: round()" },
|
|
66764
66861
|
{ name: "SAPGUI_PROGRESS_INDICATOR", replace: "use CL_PROGRESS_INDICATOR" },
|
|
@@ -66768,7 +66865,17 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
|
|
|
66768
66865
|
{ name: "SSFC_BASE64_DECODE", replace: "use class CL_HTTP_UTILITY methods" },
|
|
66769
66866
|
{ name: "SSFC_BASE64_ENCODE", replace: "use class CL_HTTP_UTILITY methods" },
|
|
66770
66867
|
{ name: "SUBST_GET_FILE_LIST", replace: "see note 1686357" },
|
|
66868
|
+
{ name: "SYSTEM_GET_UNIQUE_ID", replace: "use CL_SYSTEM_UUID" },
|
|
66869
|
+
{ name: "SYSTEM_UUID_C_CREATE", replace: "use CL_SYSTEM_UUID" },
|
|
66870
|
+
{ name: "UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66871
|
+
{ name: "WS_DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66872
|
+
{ name: "WS_EXECUTE", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66771
66873
|
{ name: "WS_FILENAME_GET", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66874
|
+
{ name: "WS_FILE_ATTRIB", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66875
|
+
{ name: "WS_FILE_COPY", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66876
|
+
{ name: "WS_FILE_DELETE", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66877
|
+
{ name: "WS_QUERY", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66878
|
+
{ name: "WS_UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
|
|
66772
66879
|
];
|
|
66773
66880
|
}
|
|
66774
66881
|
}
|
|
@@ -66862,26 +66969,26 @@ class FunctionalWriting extends _abap_rule_1.ABAPRule {
|
|
|
66862
66969
|
key: "functional_writing",
|
|
66863
66970
|
title: "Use functional writing",
|
|
66864
66971
|
shortDescription: `Detects usage of call method when functional style calls can be used.`,
|
|
66865
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
66972
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls
|
|
66866
66973
|
https://docs.abapopenchecks.org/checks/07/`,
|
|
66867
66974
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
66868
|
-
badExample: `CALL METHOD zcl_class=>method( ).
|
|
66869
|
-
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
66870
|
-
EXPORTING
|
|
66871
|
-
p_name = 'NAME'
|
|
66872
|
-
RECEIVING
|
|
66873
|
-
p_descr_ref = lr_typedescr
|
|
66874
|
-
EXCEPTIONS
|
|
66875
|
-
type_not_found = 1
|
|
66975
|
+
badExample: `CALL METHOD zcl_class=>method( ).
|
|
66976
|
+
CALL METHOD cl_abap_typedescr=>describe_by_name
|
|
66977
|
+
EXPORTING
|
|
66978
|
+
p_name = 'NAME'
|
|
66979
|
+
RECEIVING
|
|
66980
|
+
p_descr_ref = lr_typedescr
|
|
66981
|
+
EXCEPTIONS
|
|
66982
|
+
type_not_found = 1
|
|
66876
66983
|
OTHERS = 2.`,
|
|
66877
|
-
goodExample: `zcl_class=>method( ).
|
|
66878
|
-
cl_abap_typedescr=>describe_by_name(
|
|
66879
|
-
EXPORTING
|
|
66880
|
-
p_name = 'NAME'
|
|
66881
|
-
RECEIVING
|
|
66882
|
-
p_descr_ref = lr_typedescr
|
|
66883
|
-
EXCEPTIONS
|
|
66884
|
-
type_not_found = 1
|
|
66984
|
+
goodExample: `zcl_class=>method( ).
|
|
66985
|
+
cl_abap_typedescr=>describe_by_name(
|
|
66986
|
+
EXPORTING
|
|
66987
|
+
p_name = 'NAME'
|
|
66988
|
+
RECEIVING
|
|
66989
|
+
p_descr_ref = lr_typedescr
|
|
66990
|
+
EXCEPTIONS
|
|
66991
|
+
type_not_found = 1
|
|
66885
66992
|
OTHERS = 2 ).`,
|
|
66886
66993
|
};
|
|
66887
66994
|
}
|
|
@@ -66993,16 +67100,16 @@ class GlobalClass extends _abap_rule_1.ABAPRule {
|
|
|
66993
67100
|
key: "global_class",
|
|
66994
67101
|
title: "Global class checks",
|
|
66995
67102
|
shortDescription: `Checks related to global classes`,
|
|
66996
|
-
extendedInformation: `* global classes must be in own files
|
|
66997
|
-
|
|
66998
|
-
* file names must match class name
|
|
66999
|
-
|
|
67000
|
-
* file names must match interface name
|
|
67001
|
-
|
|
67002
|
-
* global classes must be global definitions
|
|
67003
|
-
|
|
67004
|
-
* global interfaces must be global definitions
|
|
67005
|
-
|
|
67103
|
+
extendedInformation: `* global classes must be in own files
|
|
67104
|
+
|
|
67105
|
+
* file names must match class name
|
|
67106
|
+
|
|
67107
|
+
* file names must match interface name
|
|
67108
|
+
|
|
67109
|
+
* global classes must be global definitions
|
|
67110
|
+
|
|
67111
|
+
* global interfaces must be global definitions
|
|
67112
|
+
|
|
67006
67113
|
* global FOR TESTING, must have CATEGORY = 05 in the XML`,
|
|
67007
67114
|
tags: [_irule_1.RuleTag.Syntax],
|
|
67008
67115
|
};
|
|
@@ -67113,21 +67220,21 @@ class IdenticalConditions extends _abap_rule_1.ABAPRule {
|
|
|
67113
67220
|
return {
|
|
67114
67221
|
key: "identical_conditions",
|
|
67115
67222
|
title: "Identical conditions",
|
|
67116
|
-
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
67117
|
-
|
|
67223
|
+
shortDescription: `Find identical conditions in IF + CASE + WHILE etc
|
|
67224
|
+
|
|
67118
67225
|
Prerequsites: code is pretty printed with identical cAsE`,
|
|
67119
67226
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67120
|
-
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
67121
|
-
ENDIF.
|
|
67122
|
-
CASE bar.
|
|
67123
|
-
WHEN '1'.
|
|
67124
|
-
WHEN 'A' OR '1'.
|
|
67227
|
+
badExample: `IF foo = bar OR 1 = a OR foo = bar.
|
|
67228
|
+
ENDIF.
|
|
67229
|
+
CASE bar.
|
|
67230
|
+
WHEN '1'.
|
|
67231
|
+
WHEN 'A' OR '1'.
|
|
67125
67232
|
ENDCASE.`,
|
|
67126
|
-
goodExample: `IF foo = bar OR 1 = a.
|
|
67127
|
-
ENDIF.
|
|
67128
|
-
CASE bar.
|
|
67129
|
-
WHEN '1'.
|
|
67130
|
-
WHEN 'A'.
|
|
67233
|
+
goodExample: `IF foo = bar OR 1 = a.
|
|
67234
|
+
ENDIF.
|
|
67235
|
+
CASE bar.
|
|
67236
|
+
WHEN '1'.
|
|
67237
|
+
WHEN 'A'.
|
|
67131
67238
|
ENDCASE.`,
|
|
67132
67239
|
};
|
|
67133
67240
|
}
|
|
@@ -67261,23 +67368,23 @@ class IdenticalContents extends _abap_rule_1.ABAPRule {
|
|
|
67261
67368
|
key: "identical_contents",
|
|
67262
67369
|
title: "Identical contents",
|
|
67263
67370
|
shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,
|
|
67264
|
-
extendedInformation: `
|
|
67265
|
-
Prerequsites: code is pretty printed with identical cAsE
|
|
67266
|
-
|
|
67371
|
+
extendedInformation: `
|
|
67372
|
+
Prerequsites: code is pretty printed with identical cAsE
|
|
67373
|
+
|
|
67267
67374
|
Chained statments are ignored`,
|
|
67268
67375
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67269
|
-
badExample: `IF foo = bar.
|
|
67270
|
-
WRITE 'bar'.
|
|
67271
|
-
WRITE 'world'.
|
|
67272
|
-
ELSE.
|
|
67273
|
-
WRITE 'foo'.
|
|
67274
|
-
WRITE 'world'.
|
|
67376
|
+
badExample: `IF foo = bar.
|
|
67377
|
+
WRITE 'bar'.
|
|
67378
|
+
WRITE 'world'.
|
|
67379
|
+
ELSE.
|
|
67380
|
+
WRITE 'foo'.
|
|
67381
|
+
WRITE 'world'.
|
|
67275
67382
|
ENDIF.`,
|
|
67276
|
-
goodExample: `IF foo = bar.
|
|
67277
|
-
WRITE 'bar'.
|
|
67278
|
-
ELSE.
|
|
67279
|
-
WRITE 'foo'.
|
|
67280
|
-
ENDIF.
|
|
67383
|
+
goodExample: `IF foo = bar.
|
|
67384
|
+
WRITE 'bar'.
|
|
67385
|
+
ELSE.
|
|
67386
|
+
WRITE 'foo'.
|
|
67387
|
+
ENDIF.
|
|
67281
67388
|
WRITE 'world'.`,
|
|
67282
67389
|
};
|
|
67283
67390
|
}
|
|
@@ -67414,12 +67521,12 @@ class IdenticalDescriptions {
|
|
|
67414
67521
|
key: "identical_descriptions",
|
|
67415
67522
|
title: "Identical descriptions",
|
|
67416
67523
|
shortDescription: `Searches for objects with the same type and same description`,
|
|
67417
|
-
extendedInformation: `Case insensitive
|
|
67418
|
-
|
|
67419
|
-
Only checks the master language descriptions
|
|
67420
|
-
|
|
67421
|
-
Dependencies are skipped
|
|
67422
|
-
|
|
67524
|
+
extendedInformation: `Case insensitive
|
|
67525
|
+
|
|
67526
|
+
Only checks the master language descriptions
|
|
67527
|
+
|
|
67528
|
+
Dependencies are skipped
|
|
67529
|
+
|
|
67423
67530
|
Works for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,
|
|
67424
67531
|
tags: [],
|
|
67425
67532
|
};
|
|
@@ -67593,9 +67700,9 @@ class IdenticalMove extends _abap_rule_1.ABAPRule {
|
|
|
67593
67700
|
title: "Identical move",
|
|
67594
67701
|
shortDescription: `Moving the same value from left to right or right to left is redundant.`,
|
|
67595
67702
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
67596
|
-
badExample: `DATA lv_value TYPE i.
|
|
67703
|
+
badExample: `DATA lv_value TYPE i.
|
|
67597
67704
|
lv_value = lv_value.`,
|
|
67598
|
-
goodExample: `DATA lv_value TYPE i.
|
|
67705
|
+
goodExample: `DATA lv_value TYPE i.
|
|
67599
67706
|
lv_value = 5.`,
|
|
67600
67707
|
};
|
|
67601
67708
|
}
|
|
@@ -67657,43 +67764,43 @@ class IfInIf extends _abap_rule_1.ABAPRule {
|
|
|
67657
67764
|
key: "if_in_if",
|
|
67658
67765
|
title: "IF in IF",
|
|
67659
67766
|
shortDescription: `Detects nested ifs which can be refactored.`,
|
|
67660
|
-
extendedInformation: `
|
|
67661
|
-
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
67662
|
-
|
|
67663
|
-
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
67664
|
-
|
|
67665
|
-
https://docs.abapopenchecks.org/checks/01/
|
|
67767
|
+
extendedInformation: `
|
|
67768
|
+
Directly nested IFs without ELSE can be refactored to a single condition using AND.
|
|
67769
|
+
|
|
67770
|
+
ELSE condtions with directly nested IF refactored to ELSEIF, quickfixes are suggested for this case.
|
|
67771
|
+
|
|
67772
|
+
https://docs.abapopenchecks.org/checks/01/
|
|
67666
67773
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,
|
|
67667
|
-
badExample: `IF condition1.
|
|
67668
|
-
IF condition2.
|
|
67669
|
-
...
|
|
67670
|
-
ENDIF.
|
|
67671
|
-
ENDIF.
|
|
67672
|
-
|
|
67673
|
-
IF condition1.
|
|
67674
|
-
...
|
|
67675
|
-
ELSE.
|
|
67676
|
-
IF condition2.
|
|
67677
|
-
...
|
|
67678
|
-
ENDIF.
|
|
67774
|
+
badExample: `IF condition1.
|
|
67775
|
+
IF condition2.
|
|
67776
|
+
...
|
|
67777
|
+
ENDIF.
|
|
67778
|
+
ENDIF.
|
|
67779
|
+
|
|
67780
|
+
IF condition1.
|
|
67781
|
+
...
|
|
67782
|
+
ELSE.
|
|
67783
|
+
IF condition2.
|
|
67784
|
+
...
|
|
67785
|
+
ENDIF.
|
|
67679
67786
|
ENDIF.`,
|
|
67680
|
-
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
67681
|
-
...
|
|
67682
|
-
ENDIF.
|
|
67683
|
-
|
|
67684
|
-
IF condition1.
|
|
67685
|
-
...
|
|
67686
|
-
ELSEIF condition2.
|
|
67687
|
-
...
|
|
67688
|
-
ENDIF.
|
|
67689
|
-
|
|
67690
|
-
CASE variable.
|
|
67691
|
-
WHEN value1.
|
|
67692
|
-
...
|
|
67693
|
-
WHEN value2.
|
|
67694
|
-
IF condition2.
|
|
67695
|
-
...
|
|
67696
|
-
ENDIF.
|
|
67787
|
+
goodExample: `IF ( condition1 ) AND ( condition2 ).
|
|
67788
|
+
...
|
|
67789
|
+
ENDIF.
|
|
67790
|
+
|
|
67791
|
+
IF condition1.
|
|
67792
|
+
...
|
|
67793
|
+
ELSEIF condition2.
|
|
67794
|
+
...
|
|
67795
|
+
ENDIF.
|
|
67796
|
+
|
|
67797
|
+
CASE variable.
|
|
67798
|
+
WHEN value1.
|
|
67799
|
+
...
|
|
67800
|
+
WHEN value2.
|
|
67801
|
+
IF condition2.
|
|
67802
|
+
...
|
|
67803
|
+
ENDIF.
|
|
67697
67804
|
ENDCASE.`,
|
|
67698
67805
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
67699
67806
|
};
|
|
@@ -67886,9 +67993,9 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
|
|
|
67886
67993
|
for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {
|
|
67887
67994
|
const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();
|
|
67888
67995
|
if (name === impl.identifier.getName().toUpperCase()) {
|
|
67889
|
-
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
67890
|
-
METHOD ${methodName.toLowerCase()}.
|
|
67891
|
-
RETURN. " todo, implement method
|
|
67996
|
+
return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `
|
|
67997
|
+
METHOD ${methodName.toLowerCase()}.
|
|
67998
|
+
RETURN. " todo, implement method
|
|
67892
67999
|
ENDMETHOD.`);
|
|
67893
68000
|
}
|
|
67894
68001
|
}
|
|
@@ -68095,13 +68202,13 @@ class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
|
68095
68202
|
key: "implicit_start_of_selection",
|
|
68096
68203
|
title: "Implicit START-OF-SELECTION",
|
|
68097
68204
|
shortDescription: `Add explicit selection screen event handling`,
|
|
68098
|
-
extendedInformation: `Only runs for executable programs
|
|
68099
|
-
|
|
68205
|
+
extendedInformation: `Only runs for executable programs
|
|
68206
|
+
|
|
68100
68207
|
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
68101
68208
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
68102
|
-
badExample: `REPORT zfoo.
|
|
68209
|
+
badExample: `REPORT zfoo.
|
|
68103
68210
|
WRITE 'hello'.`,
|
|
68104
|
-
goodExample: `START-OF-SELECTION.
|
|
68211
|
+
goodExample: `START-OF-SELECTION.
|
|
68105
68212
|
WRITE 'hello'.`,
|
|
68106
68213
|
};
|
|
68107
68214
|
}
|
|
@@ -68206,19 +68313,19 @@ class InStatementIndentation extends _abap_rule_1.ABAPRule {
|
|
|
68206
68313
|
key: "in_statement_indentation",
|
|
68207
68314
|
title: "In-statement indentation",
|
|
68208
68315
|
shortDescription: "Checks alignment within statements which span multiple lines.",
|
|
68209
|
-
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
68210
|
-
|
|
68211
|
-
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
68316
|
+
extendedInformation: `Lines following the first line should be indented once (2 spaces).
|
|
68317
|
+
|
|
68318
|
+
For block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)
|
|
68212
68319
|
to distinguish them better from code within the block.`,
|
|
68213
|
-
badExample: `IF 1 = 1
|
|
68214
|
-
AND 2 = 2.
|
|
68215
|
-
WRITE 'hello' &&
|
|
68216
|
-
'world'.
|
|
68320
|
+
badExample: `IF 1 = 1
|
|
68321
|
+
AND 2 = 2.
|
|
68322
|
+
WRITE 'hello' &&
|
|
68323
|
+
'world'.
|
|
68217
68324
|
ENDIF.`,
|
|
68218
|
-
goodExample: `IF 1 = 1
|
|
68219
|
-
AND 2 = 2.
|
|
68220
|
-
WRITE 'hello' &&
|
|
68221
|
-
'world'.
|
|
68325
|
+
goodExample: `IF 1 = 1
|
|
68326
|
+
AND 2 = 2.
|
|
68327
|
+
WRITE 'hello' &&
|
|
68328
|
+
'world'.
|
|
68222
68329
|
ENDIF.`,
|
|
68223
68330
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68224
68331
|
};
|
|
@@ -68345,23 +68452,23 @@ class Indentation extends _abap_rule_1.ABAPRule {
|
|
|
68345
68452
|
title: "Indentation",
|
|
68346
68453
|
shortDescription: `Checks indentation`,
|
|
68347
68454
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
68348
|
-
badExample: `CLASS lcl DEFINITION.
|
|
68349
|
-
PRIVATE SECTION.
|
|
68350
|
-
METHODS constructor.
|
|
68351
|
-
ENDCLASS.
|
|
68352
|
-
|
|
68353
|
-
CLASS lcl IMPLEMENTATION.
|
|
68354
|
-
METHOD constructor.
|
|
68355
|
-
ENDMETHOD.
|
|
68455
|
+
badExample: `CLASS lcl DEFINITION.
|
|
68456
|
+
PRIVATE SECTION.
|
|
68457
|
+
METHODS constructor.
|
|
68458
|
+
ENDCLASS.
|
|
68459
|
+
|
|
68460
|
+
CLASS lcl IMPLEMENTATION.
|
|
68461
|
+
METHOD constructor.
|
|
68462
|
+
ENDMETHOD.
|
|
68356
68463
|
ENDCLASS.`,
|
|
68357
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
68358
|
-
PRIVATE SECTION.
|
|
68359
|
-
METHODS constructor.
|
|
68360
|
-
ENDCLASS.
|
|
68361
|
-
|
|
68362
|
-
CLASS lcl IMPLEMENTATION.
|
|
68363
|
-
METHOD constructor.
|
|
68364
|
-
ENDMETHOD.
|
|
68464
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
68465
|
+
PRIVATE SECTION.
|
|
68466
|
+
METHODS constructor.
|
|
68467
|
+
ENDCLASS.
|
|
68468
|
+
|
|
68469
|
+
CLASS lcl IMPLEMENTATION.
|
|
68470
|
+
METHOD constructor.
|
|
68471
|
+
ENDMETHOD.
|
|
68365
68472
|
ENDCLASS.`,
|
|
68366
68473
|
};
|
|
68367
68474
|
}
|
|
@@ -68859,9 +68966,9 @@ class IntfReferencingClas {
|
|
|
68859
68966
|
key: "intf_referencing_clas",
|
|
68860
68967
|
title: "INTF referencing CLAS",
|
|
68861
68968
|
shortDescription: `Interface contains references to class`,
|
|
68862
|
-
extendedInformation: `Only global interfaces are checked.
|
|
68863
|
-
Only first level references are checked.
|
|
68864
|
-
Exception class references are ignored.
|
|
68969
|
+
extendedInformation: `Only global interfaces are checked.
|
|
68970
|
+
Only first level references are checked.
|
|
68971
|
+
Exception class references are ignored.
|
|
68865
68972
|
Void references are ignored.`,
|
|
68866
68973
|
};
|
|
68867
68974
|
}
|
|
@@ -68946,9 +69053,9 @@ class InvalidTableIndex extends _abap_rule_1.ABAPRule {
|
|
|
68946
69053
|
title: "Invalid Table Index",
|
|
68947
69054
|
shortDescription: `Issues error for constant table index zero, as ABAP starts from 1`,
|
|
68948
69055
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
68949
|
-
badExample: `DATA(first) = table[ 0 ].
|
|
69056
|
+
badExample: `DATA(first) = table[ 0 ].
|
|
68950
69057
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 0.`,
|
|
68951
|
-
goodExample: `DATA(first) = table[ 1 ].
|
|
69058
|
+
goodExample: `DATA(first) = table[ 1 ].
|
|
68952
69059
|
READ TABLE gt_stack ASSIGNING <ls_stack> INDEX 1.`,
|
|
68953
69060
|
};
|
|
68954
69061
|
}
|
|
@@ -69560,8 +69667,8 @@ class LineBreakStyle {
|
|
|
69560
69667
|
return {
|
|
69561
69668
|
key: "line_break_style",
|
|
69562
69669
|
title: "Makes sure line breaks are consistent in the ABAP code",
|
|
69563
|
-
shortDescription: `Enforces LF as newlines in ABAP files
|
|
69564
|
-
|
|
69670
|
+
shortDescription: `Enforces LF as newlines in ABAP files
|
|
69671
|
+
|
|
69565
69672
|
abapGit does not work with CRLF`,
|
|
69566
69673
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
69567
69674
|
};
|
|
@@ -69631,7 +69738,7 @@ class LineLength extends _abap_rule_1.ABAPRule {
|
|
|
69631
69738
|
key: "line_length",
|
|
69632
69739
|
title: "Line length",
|
|
69633
69740
|
shortDescription: `Detects lines exceeding the provided maximum length.`,
|
|
69634
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
69741
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length
|
|
69635
69742
|
https://docs.abapopenchecks.org/checks/04/`,
|
|
69636
69743
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
69637
69744
|
};
|
|
@@ -69709,7 +69816,7 @@ class LineOnlyPunc extends _abap_rule_1.ABAPRule {
|
|
|
69709
69816
|
key: "line_only_punc",
|
|
69710
69817
|
title: "Line containing only punctuation",
|
|
69711
69818
|
shortDescription: `Detects lines containing only punctuation.`,
|
|
69712
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
69819
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end
|
|
69713
69820
|
https://docs.abapopenchecks.org/checks/16/`,
|
|
69714
69821
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
69715
69822
|
badExample: "zcl_class=>method(\n).",
|
|
@@ -69983,15 +70090,15 @@ class LocalVariableNames extends _abap_rule_1.ABAPRule {
|
|
|
69983
70090
|
return {
|
|
69984
70091
|
key: "local_variable_names",
|
|
69985
70092
|
title: "Local variable naming conventions",
|
|
69986
|
-
shortDescription: `
|
|
69987
|
-
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
70093
|
+
shortDescription: `
|
|
70094
|
+
Allows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.
|
|
69988
70095
|
Regexes are case-insensitive.`,
|
|
69989
70096
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
69990
|
-
badExample: `FORM bar.
|
|
69991
|
-
DATA foo.
|
|
70097
|
+
badExample: `FORM bar.
|
|
70098
|
+
DATA foo.
|
|
69992
70099
|
ENDFORM.`,
|
|
69993
|
-
goodExample: `FORM bar.
|
|
69994
|
-
DATA lv_foo.
|
|
70100
|
+
goodExample: `FORM bar.
|
|
70101
|
+
DATA lv_foo.
|
|
69995
70102
|
ENDFORM.`,
|
|
69996
70103
|
};
|
|
69997
70104
|
}
|
|
@@ -70143,9 +70250,9 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
70143
70250
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
70144
70251
|
extendedInformation: `Use rule "avoid_use" to avoid macros altogether.`,
|
|
70145
70252
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
70146
|
-
badExample: `DEFINE something.
|
|
70253
|
+
badExample: `DEFINE something.
|
|
70147
70254
|
END-OF-DEFINITION.`,
|
|
70148
|
-
goodExample: `DEFINE _something.
|
|
70255
|
+
goodExample: `DEFINE _something.
|
|
70149
70256
|
END-OF-DEFINITION.`,
|
|
70150
70257
|
};
|
|
70151
70258
|
}
|
|
@@ -70220,10 +70327,10 @@ class MainFileContents {
|
|
|
70220
70327
|
title: "Main file contents",
|
|
70221
70328
|
shortDescription: `Checks related to report declarations.`,
|
|
70222
70329
|
tags: [_irule_1.RuleTag.Syntax],
|
|
70223
|
-
extendedInformation: `Does not run if the target version is Cloud
|
|
70224
|
-
|
|
70225
|
-
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
70226
|
-
* TYPEs must begin with "TYPE-POOL <name>."
|
|
70330
|
+
extendedInformation: `Does not run if the target version is Cloud
|
|
70331
|
+
|
|
70332
|
+
* PROGs must begin with "REPORT <name>." or "PROGRAM <name>.
|
|
70333
|
+
* TYPEs must begin with "TYPE-POOL <name>."
|
|
70227
70334
|
`,
|
|
70228
70335
|
};
|
|
70229
70336
|
}
|
|
@@ -70339,17 +70446,17 @@ class ManyParentheses extends _abap_rule_1.ABAPRule {
|
|
|
70339
70446
|
title: "Too many parentheses",
|
|
70340
70447
|
shortDescription: `Searches for expressions where extra parentheses can safely be removed`,
|
|
70341
70448
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
70342
|
-
badExample: `
|
|
70343
|
-
IF ( destination IS INITIAL ).
|
|
70344
|
-
ENDIF.
|
|
70345
|
-
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
70346
|
-
ENDIF.
|
|
70449
|
+
badExample: `
|
|
70450
|
+
IF ( destination IS INITIAL ).
|
|
70451
|
+
ENDIF.
|
|
70452
|
+
IF foo = boo AND ( bar = lar AND moo = loo ).
|
|
70453
|
+
ENDIF.
|
|
70347
70454
|
`,
|
|
70348
|
-
goodExample: `
|
|
70349
|
-
IF destination IS INITIAL.
|
|
70350
|
-
ENDIF.
|
|
70351
|
-
IF foo = boo AND bar = lar AND moo = loo.
|
|
70352
|
-
ENDIF.
|
|
70455
|
+
goodExample: `
|
|
70456
|
+
IF destination IS INITIAL.
|
|
70457
|
+
ENDIF.
|
|
70458
|
+
IF foo = boo AND bar = lar AND moo = loo.
|
|
70459
|
+
ENDIF.
|
|
70353
70460
|
`,
|
|
70354
70461
|
};
|
|
70355
70462
|
}
|
|
@@ -70537,14 +70644,14 @@ class MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {
|
|
|
70537
70644
|
title: "Max one method parameter definition per line",
|
|
70538
70645
|
shortDescription: `Keep max one method parameter description per line`,
|
|
70539
70646
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
|
|
70540
|
-
badExample: `
|
|
70541
|
-
METHODS apps_scope_token
|
|
70542
|
-
IMPORTING
|
|
70647
|
+
badExample: `
|
|
70648
|
+
METHODS apps_scope_token
|
|
70649
|
+
IMPORTING
|
|
70543
70650
|
body TYPE bodyapps_scope_token client_id TYPE str.`,
|
|
70544
|
-
goodExample: `
|
|
70545
|
-
METHODS apps_scope_token
|
|
70546
|
-
IMPORTING
|
|
70547
|
-
body TYPE bodyapps_scope_token
|
|
70651
|
+
goodExample: `
|
|
70652
|
+
METHODS apps_scope_token
|
|
70653
|
+
IMPORTING
|
|
70654
|
+
body TYPE bodyapps_scope_token
|
|
70548
70655
|
client_id TYPE str.`,
|
|
70549
70656
|
};
|
|
70550
70657
|
}
|
|
@@ -70609,11 +70716,11 @@ class MaxOneStatement extends _abap_rule_1.ABAPRule {
|
|
|
70609
70716
|
key: "max_one_statement",
|
|
70610
70717
|
title: "Max one statement per line",
|
|
70611
70718
|
shortDescription: `Checks that each line contains only a single statement.`,
|
|
70612
|
-
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
70613
|
-
|
|
70614
|
-
Does not report anything for chained statements.
|
|
70615
|
-
|
|
70616
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
70719
|
+
extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.
|
|
70720
|
+
|
|
70721
|
+
Does not report anything for chained statements.
|
|
70722
|
+
|
|
70723
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line
|
|
70617
70724
|
https://docs.abapopenchecks.org/checks/11/`,
|
|
70618
70725
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
70619
70726
|
badExample: `WRITE foo. WRITE bar.`,
|
|
@@ -70951,8 +71058,8 @@ class MethodLength {
|
|
|
70951
71058
|
key: "method_length",
|
|
70952
71059
|
title: "Method/Form Length",
|
|
70953
71060
|
shortDescription: `Checks relating to method/form length.`,
|
|
70954
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
70955
|
-
|
|
71061
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
71062
|
+
|
|
70956
71063
|
Abstract methods without statements are considered okay.`,
|
|
70957
71064
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
70958
71065
|
};
|
|
@@ -71057,20 +71164,20 @@ class MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {
|
|
|
71057
71164
|
key: "method_overwrites_builtin",
|
|
71058
71165
|
title: "Method name overwrites builtin function",
|
|
71059
71166
|
shortDescription: `Checks Method names that overwrite builtin SAP functions`,
|
|
71060
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
71061
|
-
|
|
71062
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
71063
|
-
|
|
71167
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm
|
|
71168
|
+
|
|
71169
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions
|
|
71170
|
+
|
|
71064
71171
|
Interface method names are ignored`,
|
|
71065
71172
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
71066
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71067
|
-
PUBLIC SECTION.
|
|
71068
|
-
METHODS matches.
|
|
71069
|
-
ENDCLASS.
|
|
71070
|
-
|
|
71071
|
-
CLASS lcl IMPLEMENTATION.
|
|
71072
|
-
METHOD matches.
|
|
71073
|
-
ENDMETHOD.
|
|
71173
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71174
|
+
PUBLIC SECTION.
|
|
71175
|
+
METHODS matches.
|
|
71176
|
+
ENDCLASS.
|
|
71177
|
+
|
|
71178
|
+
CLASS lcl IMPLEMENTATION.
|
|
71179
|
+
METHOD matches.
|
|
71180
|
+
ENDMETHOD.
|
|
71074
71181
|
ENDCLASS.`,
|
|
71075
71182
|
};
|
|
71076
71183
|
}
|
|
@@ -71258,16 +71365,16 @@ class MixReturning extends _abap_rule_1.ABAPRule {
|
|
|
71258
71365
|
key: "mix_returning",
|
|
71259
71366
|
title: "Mix of returning and exporting",
|
|
71260
71367
|
shortDescription: `Checks that methods don't have a mixture of returning and exporting/changing parameters`,
|
|
71261
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination
|
|
71262
|
-
|
|
71368
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-either-returning-or-exporting-or-changing-but-not-a-combination
|
|
71369
|
+
|
|
71263
71370
|
This syntax is not allowed on versions earlier than 740sp02, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abennews-740-abap_objects.htm#!ABAP_MODIFICATION_1@1@`,
|
|
71264
71371
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Syntax],
|
|
71265
|
-
badExample: `CLASS lcl DEFINITION.
|
|
71266
|
-
PUBLIC SECTION.
|
|
71267
|
-
METHODS
|
|
71268
|
-
foobar
|
|
71269
|
-
EXPORTING foo TYPE i
|
|
71270
|
-
RETURNING VALUE(rv_string) TYPE string.
|
|
71372
|
+
badExample: `CLASS lcl DEFINITION.
|
|
71373
|
+
PUBLIC SECTION.
|
|
71374
|
+
METHODS
|
|
71375
|
+
foobar
|
|
71376
|
+
EXPORTING foo TYPE i
|
|
71377
|
+
RETURNING VALUE(rv_string) TYPE string.
|
|
71271
71378
|
ENDCLASS.`,
|
|
71272
71379
|
};
|
|
71273
71380
|
}
|
|
@@ -71669,7 +71776,7 @@ class Nesting extends _abap_rule_1.ABAPRule {
|
|
|
71669
71776
|
key: "nesting",
|
|
71670
71777
|
title: "Check nesting depth",
|
|
71671
71778
|
shortDescription: `Checks for methods exceeding a maximum nesting depth`,
|
|
71672
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
71779
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low
|
|
71673
71780
|
https://docs.abapopenchecks.org/checks/74/`,
|
|
71674
71781
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
71675
71782
|
};
|
|
@@ -71923,7 +72030,7 @@ class NoChainedAssignment extends _abap_rule_1.ABAPRule {
|
|
|
71923
72030
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,
|
|
71924
72031
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
71925
72032
|
badExample: `var1 = var2 = var3.`,
|
|
71926
|
-
goodExample: `var2 = var3.
|
|
72033
|
+
goodExample: `var2 = var3.
|
|
71927
72034
|
var1 = var2.`,
|
|
71928
72035
|
};
|
|
71929
72036
|
}
|
|
@@ -72130,8 +72237,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
|
|
|
72130
72237
|
key: "no_external_form_calls",
|
|
72131
72238
|
title: "No external FORM calls",
|
|
72132
72239
|
shortDescription: `Detect external form calls`,
|
|
72133
|
-
badExample: `PERFORM foo IN PROGRAM bar.
|
|
72134
|
-
|
|
72240
|
+
badExample: `PERFORM foo IN PROGRAM bar.
|
|
72241
|
+
|
|
72135
72242
|
PERFORM foo(bar).`,
|
|
72136
72243
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72137
72244
|
};
|
|
@@ -72192,17 +72299,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
|
|
|
72192
72299
|
key: "no_inline_in_optional_branches",
|
|
72193
72300
|
title: "Don't declare inline in optional branches",
|
|
72194
72301
|
shortDescription: `Don't declare inline in optional branches`,
|
|
72195
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
72196
|
-
|
|
72197
|
-
Considered optional branches:
|
|
72198
|
-
* inside IF/ELSEIF/ELSE
|
|
72199
|
-
* inside LOOP
|
|
72200
|
-
* inside WHILE
|
|
72201
|
-
* inside CASE/WHEN, CASE TYPE OF
|
|
72202
|
-
* inside DO
|
|
72203
|
-
* inside SELECT loops
|
|
72204
|
-
|
|
72205
|
-
Not considered optional branches:
|
|
72302
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
|
|
72303
|
+
|
|
72304
|
+
Considered optional branches:
|
|
72305
|
+
* inside IF/ELSEIF/ELSE
|
|
72306
|
+
* inside LOOP
|
|
72307
|
+
* inside WHILE
|
|
72308
|
+
* inside CASE/WHEN, CASE TYPE OF
|
|
72309
|
+
* inside DO
|
|
72310
|
+
* inside SELECT loops
|
|
72311
|
+
|
|
72312
|
+
Not considered optional branches:
|
|
72206
72313
|
* TRY/CATCH/CLEANUP`,
|
|
72207
72314
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
72208
72315
|
};
|
|
@@ -72303,12 +72410,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
|
|
|
72303
72410
|
key: "no_prefixes",
|
|
72304
72411
|
title: "No Prefixes",
|
|
72305
72412
|
shortDescription: `Dont use hungarian notation`,
|
|
72306
|
-
extendedInformation: `
|
|
72307
|
-
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
72308
|
-
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
72309
|
-
|
|
72310
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
72311
|
-
|
|
72413
|
+
extendedInformation: `
|
|
72414
|
+
Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
|
|
72415
|
+
allowing all types to become voided, abaplint will then provide less precise syntax errors.
|
|
72416
|
+
|
|
72417
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
|
|
72418
|
+
|
|
72312
72419
|
https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
|
|
72313
72420
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
72314
72421
|
badExample: `DATA lv_foo TYPE i.`,
|
|
@@ -72506,7 +72613,7 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
|
|
|
72506
72613
|
return {
|
|
72507
72614
|
key: "no_public_attributes",
|
|
72508
72615
|
title: "No public attributes",
|
|
72509
|
-
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
72616
|
+
shortDescription: `Checks that classes and interfaces don't contain any public attributes.
|
|
72510
72617
|
Exceptions are excluded from this rule.`,
|
|
72511
72618
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
|
|
72512
72619
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
@@ -72607,13 +72714,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
|
|
|
72607
72714
|
key: "no_yoda_conditions",
|
|
72608
72715
|
title: "No Yoda conditions",
|
|
72609
72716
|
shortDescription: `Finds Yoda conditions and reports issues`,
|
|
72610
|
-
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
72611
|
-
|
|
72717
|
+
extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
|
|
72718
|
+
|
|
72612
72719
|
Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
|
|
72613
72720
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72614
|
-
badExample: `IF 0 <> sy-subrc.
|
|
72721
|
+
badExample: `IF 0 <> sy-subrc.
|
|
72615
72722
|
ENDIF.`,
|
|
72616
|
-
goodExample: `IF sy-subrc <> 0.
|
|
72723
|
+
goodExample: `IF sy-subrc <> 0.
|
|
72617
72724
|
ENDIF.`,
|
|
72618
72725
|
};
|
|
72619
72726
|
}
|
|
@@ -72714,8 +72821,8 @@ class NROBConsistency {
|
|
|
72714
72821
|
key: "nrob_consistency",
|
|
72715
72822
|
title: "Number range consistency",
|
|
72716
72823
|
shortDescription: `Consistency checks for number ranges`,
|
|
72717
|
-
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
72718
|
-
|
|
72824
|
+
extendedInformation: `Issue reported if percentage warning is over 50%
|
|
72825
|
+
|
|
72719
72826
|
Issue reported if the referenced domain is not found(taking error namespace into account)`,
|
|
72720
72827
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
72721
72828
|
};
|
|
@@ -73000,58 +73107,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
|
|
|
73000
73107
|
title: "Obsolete statements",
|
|
73001
73108
|
shortDescription: `Checks for usages of certain obsolete statements`,
|
|
73002
73109
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
73003
|
-
extendedInformation: `
|
|
73004
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
73005
|
-
|
|
73006
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
73007
|
-
|
|
73008
|
-
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
73009
|
-
|
|
73010
|
-
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
73011
|
-
|
|
73012
|
-
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
73013
|
-
|
|
73014
|
-
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
73015
|
-
|
|
73016
|
-
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
73017
|
-
|
|
73018
|
-
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
73019
|
-
|
|
73020
|
-
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
73021
|
-
|
|
73022
|
-
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
73023
|
-
|
|
73024
|
-
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
73025
|
-
|
|
73026
|
-
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
73027
|
-
|
|
73028
|
-
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
73029
|
-
|
|
73030
|
-
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
73031
|
-
|
|
73032
|
-
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
73033
|
-
SELECT COUNT(*) is considered okay
|
|
73034
|
-
|
|
73035
|
-
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
73036
|
-
|
|
73037
|
-
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
73038
|
-
|
|
73039
|
-
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
73040
|
-
|
|
73041
|
-
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
73042
|
-
|
|
73043
|
-
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
73044
|
-
|
|
73110
|
+
extendedInformation: `
|
|
73111
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
|
|
73112
|
+
|
|
73113
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
|
|
73114
|
+
|
|
73115
|
+
SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
|
|
73116
|
+
|
|
73117
|
+
IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
|
|
73118
|
+
|
|
73119
|
+
WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
|
|
73120
|
+
|
|
73121
|
+
FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
|
|
73122
|
+
|
|
73123
|
+
TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
73124
|
+
|
|
73125
|
+
LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
|
|
73126
|
+
|
|
73127
|
+
COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
|
|
73128
|
+
|
|
73129
|
+
OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
|
|
73130
|
+
|
|
73131
|
+
PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
|
|
73132
|
+
|
|
73133
|
+
RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
|
|
73134
|
+
|
|
73135
|
+
PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
|
|
73136
|
+
|
|
73137
|
+
MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
|
|
73138
|
+
|
|
73139
|
+
SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
|
|
73140
|
+
SELECT COUNT(*) is considered okay
|
|
73141
|
+
|
|
73142
|
+
FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
|
|
73143
|
+
|
|
73144
|
+
SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
|
|
73145
|
+
|
|
73146
|
+
CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
|
|
73147
|
+
|
|
73148
|
+
POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
|
|
73149
|
+
|
|
73150
|
+
OCCURENCES: check for OCCURENCES vs OCCURRENCES
|
|
73151
|
+
|
|
73045
73152
|
CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
|
|
73046
|
-
badExample: `REFRESH itab.
|
|
73047
|
-
|
|
73048
|
-
COMPUTE foo = 2 + 2.
|
|
73049
|
-
|
|
73050
|
-
MULTIPLY lv_foo BY 2.
|
|
73051
|
-
|
|
73052
|
-
INTERFACE intf LOAD.
|
|
73053
|
-
|
|
73054
|
-
IF foo IS SUPPLIED.
|
|
73153
|
+
badExample: `REFRESH itab.
|
|
73154
|
+
|
|
73155
|
+
COMPUTE foo = 2 + 2.
|
|
73156
|
+
|
|
73157
|
+
MULTIPLY lv_foo BY 2.
|
|
73158
|
+
|
|
73159
|
+
INTERFACE intf LOAD.
|
|
73160
|
+
|
|
73161
|
+
IF foo IS SUPPLIED.
|
|
73055
73162
|
ENDIF.`,
|
|
73056
73163
|
};
|
|
73057
73164
|
}
|
|
@@ -73411,9 +73518,9 @@ class OmitParameterName {
|
|
|
73411
73518
|
key: "omit_parameter_name",
|
|
73412
73519
|
title: "Omit parameter name",
|
|
73413
73520
|
shortDescription: `Omit the parameter name in single parameter calls`,
|
|
73414
|
-
extendedInformation: `
|
|
73415
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
73416
|
-
|
|
73521
|
+
extendedInformation: `
|
|
73522
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
|
|
73523
|
+
|
|
73417
73524
|
EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
|
|
73418
73525
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
73419
73526
|
badExample: `method( param = 2 ).`,
|
|
@@ -73619,20 +73726,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
|
|
|
73619
73726
|
shortDescription: `Omit RECEIVING`,
|
|
73620
73727
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
|
|
73621
73728
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
73622
|
-
badExample: `
|
|
73623
|
-
upload_pack(
|
|
73624
|
-
EXPORTING
|
|
73625
|
-
io_client = lo_client
|
|
73626
|
-
iv_url = iv_url
|
|
73627
|
-
iv_deepen_level = iv_deepen_level
|
|
73628
|
-
it_hashes = lt_hashes
|
|
73629
|
-
RECEIVING
|
|
73729
|
+
badExample: `
|
|
73730
|
+
upload_pack(
|
|
73731
|
+
EXPORTING
|
|
73732
|
+
io_client = lo_client
|
|
73733
|
+
iv_url = iv_url
|
|
73734
|
+
iv_deepen_level = iv_deepen_level
|
|
73735
|
+
it_hashes = lt_hashes
|
|
73736
|
+
RECEIVING
|
|
73630
73737
|
rt_objects = et_objects ).`,
|
|
73631
|
-
goodExample: `
|
|
73632
|
-
et_objects = upload_pack(
|
|
73633
|
-
io_client = lo_client
|
|
73634
|
-
iv_url = iv_url
|
|
73635
|
-
iv_deepen_level = iv_deepen_level
|
|
73738
|
+
goodExample: `
|
|
73739
|
+
et_objects = upload_pack(
|
|
73740
|
+
io_client = lo_client
|
|
73741
|
+
iv_url = iv_url
|
|
73742
|
+
iv_deepen_level = iv_deepen_level
|
|
73636
73743
|
it_hashes = lt_hashes ).`,
|
|
73637
73744
|
};
|
|
73638
73745
|
}
|
|
@@ -73697,8 +73804,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
|
|
|
73697
73804
|
return {
|
|
73698
73805
|
key: "parser_702_chaining",
|
|
73699
73806
|
title: "Parser Error, bad chaining on 702",
|
|
73700
|
-
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
73701
|
-
this rule finds these and reports errors.
|
|
73807
|
+
shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
|
|
73808
|
+
this rule finds these and reports errors.
|
|
73702
73809
|
Only active on target version 702 and below.`,
|
|
73703
73810
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
73704
73811
|
};
|
|
@@ -73893,8 +74000,8 @@ class ParserError {
|
|
|
73893
74000
|
return {
|
|
73894
74001
|
key: "parser_error",
|
|
73895
74002
|
title: "Parser error",
|
|
73896
|
-
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
73897
|
-
|
|
74003
|
+
shortDescription: `Checks for syntax not recognized by abaplint.
|
|
74004
|
+
|
|
73898
74005
|
See recognized syntax at https://syntax.abaplint.org`,
|
|
73899
74006
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
73900
74007
|
};
|
|
@@ -73979,7 +74086,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
|
|
|
73979
74086
|
return {
|
|
73980
74087
|
key: "parser_missing_space",
|
|
73981
74088
|
title: "Parser Error, missing space",
|
|
73982
|
-
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
74089
|
+
shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
|
|
73983
74090
|
This rule makes sure the spaces are consistently required across the language.`,
|
|
73984
74091
|
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
|
|
73985
74092
|
badExample: `IF ( foo = 'bar').`,
|
|
@@ -74433,25 +74540,25 @@ class PreferInline {
|
|
|
74433
74540
|
key: "prefer_inline",
|
|
74434
74541
|
title: "Prefer Inline Declarations",
|
|
74435
74542
|
shortDescription: `Prefer inline to up-front declarations.`,
|
|
74436
|
-
extendedInformation: `EXPERIMENTAL
|
|
74437
|
-
|
|
74438
|
-
Activates if language version is v740sp02 or above.
|
|
74439
|
-
|
|
74440
|
-
Variables must be local(METHOD or FORM).
|
|
74441
|
-
|
|
74442
|
-
No generic or void typed variables. No syntax errors.
|
|
74443
|
-
|
|
74444
|
-
First position used must be a full/pure write.
|
|
74445
|
-
|
|
74446
|
-
Move statment is not a cast(?=)
|
|
74447
|
-
|
|
74543
|
+
extendedInformation: `EXPERIMENTAL
|
|
74544
|
+
|
|
74545
|
+
Activates if language version is v740sp02 or above.
|
|
74546
|
+
|
|
74547
|
+
Variables must be local(METHOD or FORM).
|
|
74548
|
+
|
|
74549
|
+
No generic or void typed variables. No syntax errors.
|
|
74550
|
+
|
|
74551
|
+
First position used must be a full/pure write.
|
|
74552
|
+
|
|
74553
|
+
Move statment is not a cast(?=)
|
|
74554
|
+
|
|
74448
74555
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
|
|
74449
74556
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
|
|
74450
|
-
badExample: `DATA foo TYPE i.
|
|
74451
|
-
foo = 2.
|
|
74452
|
-
DATA percentage TYPE decfloat34.
|
|
74557
|
+
badExample: `DATA foo TYPE i.
|
|
74558
|
+
foo = 2.
|
|
74559
|
+
DATA percentage TYPE decfloat34.
|
|
74453
74560
|
percentage = ( comment_number / abs_statement_number ) * 100.`,
|
|
74454
|
-
goodExample: `DATA(foo) = 2.
|
|
74561
|
+
goodExample: `DATA(foo) = 2.
|
|
74455
74562
|
DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
|
|
74456
74563
|
};
|
|
74457
74564
|
}
|
|
@@ -74665,18 +74772,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
|
|
|
74665
74772
|
key: "prefer_is_not",
|
|
74666
74773
|
title: "Prefer IS NOT to NOT IS",
|
|
74667
74774
|
shortDescription: `Prefer IS NOT to NOT IS`,
|
|
74668
|
-
extendedInformation: `
|
|
74669
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
74670
|
-
|
|
74775
|
+
extendedInformation: `
|
|
74776
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
|
|
74777
|
+
|
|
74671
74778
|
"if not is_valid( )." examples are skipped`,
|
|
74672
74779
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
74673
|
-
goodExample: `IF variable IS NOT INITIAL.
|
|
74674
|
-
IF variable NP 'TODO*'.
|
|
74675
|
-
IF variable <> 42.
|
|
74780
|
+
goodExample: `IF variable IS NOT INITIAL.
|
|
74781
|
+
IF variable NP 'TODO*'.
|
|
74782
|
+
IF variable <> 42.
|
|
74676
74783
|
IF variable CO 'hello'.`,
|
|
74677
|
-
badExample: `IF NOT variable IS INITIAL.
|
|
74678
|
-
IF NOT variable CP 'TODO*'.
|
|
74679
|
-
IF NOT variable = 42.
|
|
74784
|
+
badExample: `IF NOT variable IS INITIAL.
|
|
74785
|
+
IF NOT variable CP 'TODO*'.
|
|
74786
|
+
IF NOT variable = 42.
|
|
74680
74787
|
IF NOT variable CA 'hello'.`,
|
|
74681
74788
|
};
|
|
74682
74789
|
}
|
|
@@ -74865,14 +74972,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
|
|
|
74865
74972
|
key: "prefer_raise_exception_new",
|
|
74866
74973
|
title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
|
|
74867
74974
|
shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
|
|
74868
|
-
extendedInformation: `
|
|
74869
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
74870
|
-
|
|
74975
|
+
extendedInformation: `
|
|
74976
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
|
|
74977
|
+
|
|
74871
74978
|
From 752 and up`,
|
|
74872
74979
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
|
|
74873
74980
|
goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
|
|
74874
|
-
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
74875
|
-
EXPORTING
|
|
74981
|
+
badExample: `RAISE EXCEPTION TYPE cx_generation_error
|
|
74982
|
+
EXPORTING
|
|
74876
74983
|
previous = exception.`,
|
|
74877
74984
|
};
|
|
74878
74985
|
}
|
|
@@ -74950,12 +75057,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
|
|
|
74950
75057
|
key: "prefer_returning_to_exporting",
|
|
74951
75058
|
title: "Prefer RETURNING to EXPORTING",
|
|
74952
75059
|
shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
|
|
74953
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
75060
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
|
|
74954
75061
|
https://docs.abapopenchecks.org/checks/44/`,
|
|
74955
75062
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
74956
|
-
badExample: `CLASS lcl DEFINITION.
|
|
74957
|
-
PUBLIC SECTION.
|
|
74958
|
-
METHODS test EXPORTING ev_foo TYPE i.
|
|
75063
|
+
badExample: `CLASS lcl DEFINITION.
|
|
75064
|
+
PUBLIC SECTION.
|
|
75065
|
+
METHODS test EXPORTING ev_foo TYPE i.
|
|
74959
75066
|
ENDCLASS.`,
|
|
74960
75067
|
};
|
|
74961
75068
|
}
|
|
@@ -75051,8 +75158,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
|
|
|
75051
75158
|
key: "prefer_xsdbool",
|
|
75052
75159
|
title: "Prefer xsdbool over boolc",
|
|
75053
75160
|
shortDescription: `Prefer xsdbool over boolc`,
|
|
75054
|
-
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
75055
|
-
|
|
75161
|
+
extendedInformation: `Activates if language version is v740sp08 or above.
|
|
75162
|
+
|
|
75056
75163
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
75057
75164
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
75058
75165
|
badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
|
|
@@ -75124,9 +75231,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
|
|
|
75124
75231
|
title: "Preferred compare operator",
|
|
75125
75232
|
shortDescription: `Configure undesired operator variants`,
|
|
75126
75233
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
75127
|
-
badExample: `IF foo EQ bar.
|
|
75234
|
+
badExample: `IF foo EQ bar.
|
|
75128
75235
|
ENDIF.`,
|
|
75129
|
-
goodExample: `IF foo = bar.
|
|
75236
|
+
goodExample: `IF foo = bar.
|
|
75130
75237
|
ENDIF.`,
|
|
75131
75238
|
};
|
|
75132
75239
|
}
|
|
@@ -75350,26 +75457,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
|
|
|
75350
75457
|
key: "reduce_procedural_code",
|
|
75351
75458
|
title: "Reduce procedural code",
|
|
75352
75459
|
shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
|
|
75353
|
-
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
75354
|
-
|
|
75355
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
75356
|
-
|
|
75460
|
+
extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
|
|
75461
|
+
|
|
75462
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
|
|
75463
|
+
|
|
75357
75464
|
Comments are not counted as statements.`,
|
|
75358
75465
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
75359
|
-
badExample: `FORM foo.
|
|
75360
|
-
DATA lv_bar TYPE i.
|
|
75361
|
-
lv_bar = 2 + 2.
|
|
75362
|
-
IF lv_bar = 4.
|
|
75363
|
-
WRITE 'hello world'.
|
|
75364
|
-
ENDIF.
|
|
75365
|
-
DATA lv_bar TYPE i.
|
|
75366
|
-
lv_bar = 2 + 2.
|
|
75367
|
-
IF lv_bar = 4.
|
|
75368
|
-
WRITE 'hello world'.
|
|
75369
|
-
ENDIF.
|
|
75466
|
+
badExample: `FORM foo.
|
|
75467
|
+
DATA lv_bar TYPE i.
|
|
75468
|
+
lv_bar = 2 + 2.
|
|
75469
|
+
IF lv_bar = 4.
|
|
75470
|
+
WRITE 'hello world'.
|
|
75471
|
+
ENDIF.
|
|
75472
|
+
DATA lv_bar TYPE i.
|
|
75473
|
+
lv_bar = 2 + 2.
|
|
75474
|
+
IF lv_bar = 4.
|
|
75475
|
+
WRITE 'hello world'.
|
|
75476
|
+
ENDIF.
|
|
75370
75477
|
ENDFORM.`,
|
|
75371
|
-
goodExample: `FORM foo.
|
|
75372
|
-
NEW zcl_global_class( )->run_logic( ).
|
|
75478
|
+
goodExample: `FORM foo.
|
|
75479
|
+
NEW zcl_global_class( )->run_logic( ).
|
|
75373
75480
|
ENDFORM.`,
|
|
75374
75481
|
};
|
|
75375
75482
|
}
|
|
@@ -75613,10 +75720,10 @@ class RemoveDescriptions {
|
|
|
75613
75720
|
return {
|
|
75614
75721
|
key: "remove_descriptions",
|
|
75615
75722
|
title: "Remove descriptions",
|
|
75616
|
-
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
75617
|
-
|
|
75618
|
-
Class descriptions are required, see rule description_empty.
|
|
75619
|
-
|
|
75723
|
+
shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
|
|
75724
|
+
|
|
75725
|
+
Class descriptions are required, see rule description_empty.
|
|
75726
|
+
|
|
75620
75727
|
Consider using ABAP Doc for documentation.`,
|
|
75621
75728
|
tags: [],
|
|
75622
75729
|
};
|
|
@@ -75741,14 +75848,14 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
|
|
|
75741
75848
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75742
75849
|
shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
|
|
75743
75850
|
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
|
|
75744
|
-
badExample: `CALL FUNCTION 'ZRFC'
|
|
75851
|
+
badExample: `CALL FUNCTION 'ZRFC'
|
|
75745
75852
|
DESTINATION lv_rfc.`,
|
|
75746
|
-
goodExample: `CALL FUNCTION 'ZRFC'
|
|
75747
|
-
DESTINATION lv_rfc
|
|
75748
|
-
EXCEPTIONS
|
|
75749
|
-
system_failure = 1 MESSAGE msg
|
|
75750
|
-
communication_failure = 2 MESSAGE msg
|
|
75751
|
-
resource_failure = 3
|
|
75853
|
+
goodExample: `CALL FUNCTION 'ZRFC'
|
|
75854
|
+
DESTINATION lv_rfc
|
|
75855
|
+
EXCEPTIONS
|
|
75856
|
+
system_failure = 1 MESSAGE msg
|
|
75857
|
+
communication_failure = 2 MESSAGE msg
|
|
75858
|
+
resource_failure = 3
|
|
75752
75859
|
OTHERS = 4.`,
|
|
75753
75860
|
};
|
|
75754
75861
|
}
|
|
@@ -75832,11 +75939,11 @@ class SelectAddOrderBy {
|
|
|
75832
75939
|
key: "select_add_order_by",
|
|
75833
75940
|
title: "SELECT add ORDER BY",
|
|
75834
75941
|
shortDescription: `SELECTs add ORDER BY clause`,
|
|
75835
|
-
extendedInformation: `
|
|
75836
|
-
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
75837
|
-
|
|
75838
|
-
add ORDER BY PRIMARY KEY if in doubt
|
|
75839
|
-
|
|
75942
|
+
extendedInformation: `
|
|
75943
|
+
This will make sure that the SELECT statement returns results in the same sequence on different databases
|
|
75944
|
+
|
|
75945
|
+
add ORDER BY PRIMARY KEY if in doubt
|
|
75946
|
+
|
|
75840
75947
|
If the target is a sorted/hashed table, no issue is reported`,
|
|
75841
75948
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
75842
75949
|
badExample: `SELECT * FROM db INTO TABLE @DATA(tab).`,
|
|
@@ -75967,14 +76074,14 @@ class SelectPerformance {
|
|
|
75967
76074
|
key: "select_performance",
|
|
75968
76075
|
title: "SELECT performance",
|
|
75969
76076
|
shortDescription: `Various checks regarding SELECT performance.`,
|
|
75970
|
-
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
75971
|
-
|
|
76077
|
+
extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
|
|
76078
|
+
|
|
75972
76079
|
SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
|
|
75973
76080
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
|
|
75974
|
-
badExample: `SELECT field1, field2 FROM table
|
|
75975
|
-
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
76081
|
+
badExample: `SELECT field1, field2 FROM table
|
|
76082
|
+
INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
|
|
75976
76083
|
ENDSELECT.`,
|
|
75977
|
-
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
76084
|
+
goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
|
|
75978
76085
|
INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
|
|
75979
76086
|
};
|
|
75980
76087
|
}
|
|
@@ -76092,8 +76199,8 @@ class SelectSingleFullKey {
|
|
|
76092
76199
|
key: "select_single_full_key",
|
|
76093
76200
|
title: "Detect SELECT SINGLE which are possibily not unique",
|
|
76094
76201
|
shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
|
|
76095
|
-
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
76096
|
-
|
|
76202
|
+
extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
|
|
76203
|
+
|
|
76097
76204
|
If the statement contains a JOIN it is not checked`,
|
|
76098
76205
|
pseudoComment: "EC CI_NOORDER",
|
|
76099
76206
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
@@ -76610,8 +76717,8 @@ class SICFConsistency {
|
|
|
76610
76717
|
key: "sicf_consistency",
|
|
76611
76718
|
title: "SICF consistency",
|
|
76612
76719
|
shortDescription: `Checks the validity of ICF services`,
|
|
76613
|
-
extendedInformation: `* Class defined in handler must exist
|
|
76614
|
-
* Class must not have any syntax errors
|
|
76720
|
+
extendedInformation: `* Class defined in handler must exist
|
|
76721
|
+
* Class must not have any syntax errors
|
|
76615
76722
|
* Class must implement interface IF_HTTP_EXTENSION`,
|
|
76616
76723
|
};
|
|
76617
76724
|
}
|
|
@@ -76724,23 +76831,23 @@ class SlowParameterPassing {
|
|
|
76724
76831
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
76725
76832
|
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
76726
76833
|
tags: [_irule_1.RuleTag.Performance, _irule_1.RuleTag.Quickfix],
|
|
76727
|
-
badExample: `CLASS lcl DEFINITION.
|
|
76728
|
-
PUBLIC SECTION.
|
|
76729
|
-
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
76730
|
-
ENDCLASS.
|
|
76731
|
-
CLASS lcl IMPLEMENTATION.
|
|
76732
|
-
METHOD bar.
|
|
76733
|
-
WRITE sdf.
|
|
76734
|
-
ENDMETHOD.
|
|
76834
|
+
badExample: `CLASS lcl DEFINITION.
|
|
76835
|
+
PUBLIC SECTION.
|
|
76836
|
+
METHODS bar IMPORTING VALUE(sdf) TYPE string.
|
|
76837
|
+
ENDCLASS.
|
|
76838
|
+
CLASS lcl IMPLEMENTATION.
|
|
76839
|
+
METHOD bar.
|
|
76840
|
+
WRITE sdf.
|
|
76841
|
+
ENDMETHOD.
|
|
76735
76842
|
ENDCLASS.`,
|
|
76736
|
-
goodExample: `CLASS lcl DEFINITION.
|
|
76737
|
-
PUBLIC SECTION.
|
|
76738
|
-
METHODS bar IMPORTING sdf TYPE string.
|
|
76739
|
-
ENDCLASS.
|
|
76740
|
-
CLASS lcl IMPLEMENTATION.
|
|
76741
|
-
METHOD bar.
|
|
76742
|
-
WRITE sdf.
|
|
76743
|
-
ENDMETHOD.
|
|
76843
|
+
goodExample: `CLASS lcl DEFINITION.
|
|
76844
|
+
PUBLIC SECTION.
|
|
76845
|
+
METHODS bar IMPORTING sdf TYPE string.
|
|
76846
|
+
ENDCLASS.
|
|
76847
|
+
CLASS lcl IMPLEMENTATION.
|
|
76848
|
+
METHOD bar.
|
|
76849
|
+
WRITE sdf.
|
|
76850
|
+
ENDMETHOD.
|
|
76744
76851
|
ENDCLASS.`,
|
|
76745
76852
|
};
|
|
76746
76853
|
}
|
|
@@ -77029,8 +77136,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
|
|
|
77029
77136
|
key: "space_before_dot",
|
|
77030
77137
|
title: "Space before dot",
|
|
77031
77138
|
shortDescription: `Checks for extra spaces before dots at the ends of statements`,
|
|
77032
|
-
extendedInformation: `
|
|
77033
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
77139
|
+
extendedInformation: `
|
|
77140
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
|
|
77034
77141
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
|
|
77035
77142
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
77036
77143
|
badExample: `WRITE bar .`,
|
|
@@ -77223,12 +77330,12 @@ class SQLValueConversion {
|
|
|
77223
77330
|
key: "sql_value_conversion",
|
|
77224
77331
|
title: "Implicit SQL Value Conversion",
|
|
77225
77332
|
shortDescription: `Ensure types match when selecting from database`,
|
|
77226
|
-
extendedInformation: `
|
|
77227
|
-
* Integer to CHAR conversion
|
|
77228
|
-
* Integer to NUMC conversion
|
|
77229
|
-
* NUMC to Integer conversion
|
|
77230
|
-
* CHAR to Integer conversion
|
|
77231
|
-
* Source field longer than database field, CHAR -> CHAR
|
|
77333
|
+
extendedInformation: `
|
|
77334
|
+
* Integer to CHAR conversion
|
|
77335
|
+
* Integer to NUMC conversion
|
|
77336
|
+
* NUMC to Integer conversion
|
|
77337
|
+
* CHAR to Integer conversion
|
|
77338
|
+
* Source field longer than database field, CHAR -> CHAR
|
|
77232
77339
|
* Source field longer than database field, NUMC -> NUMC`,
|
|
77233
77340
|
tags: [],
|
|
77234
77341
|
};
|
|
@@ -77300,7 +77407,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
|
|
|
77300
77407
|
key: "start_at_tab",
|
|
77301
77408
|
title: "Start at tab",
|
|
77302
77409
|
shortDescription: `Checks that statements start at tabstops.`,
|
|
77303
|
-
extendedInformation: `Reports max 100 issues per file
|
|
77410
|
+
extendedInformation: `Reports max 100 issues per file
|
|
77304
77411
|
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
|
|
77305
77412
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
77306
77413
|
badExample: ` WRITE a.`,
|
|
@@ -77477,12 +77584,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
|
|
|
77477
77584
|
key: "strict_sql",
|
|
77478
77585
|
title: "Strict SQL",
|
|
77479
77586
|
shortDescription: `Strict SQL`,
|
|
77480
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
77481
|
-
|
|
77482
|
-
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
77483
|
-
|
|
77484
|
-
Also see separate rule sql_escape_host_variables
|
|
77485
|
-
|
|
77587
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
|
|
77588
|
+
|
|
77589
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
|
|
77590
|
+
|
|
77591
|
+
Also see separate rule sql_escape_host_variables
|
|
77592
|
+
|
|
77486
77593
|
Activates from v750 and up`,
|
|
77487
77594
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
|
|
77488
77595
|
badExample: `SELECT * FROM ztabl INTO TABLE @rt_content WHERE type = @iv_type ORDER BY PRIMARY KEY.`,
|
|
@@ -77768,14 +77875,14 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
77768
77875
|
key: "sy_modification",
|
|
77769
77876
|
title: "Modification of SY fields",
|
|
77770
77877
|
shortDescription: `Finds modification of sy fields`,
|
|
77771
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
77772
|
-
|
|
77773
|
-
Changes to SY-TVAR* fields are not reported
|
|
77774
|
-
|
|
77775
|
-
Modification of SY fields is not allwed in ABAP Cloud language version,
|
|
77878
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
77879
|
+
|
|
77880
|
+
Changes to SY-TVAR* fields are not reported
|
|
77881
|
+
|
|
77882
|
+
Modification of SY fields is not allwed in ABAP Cloud language version,
|
|
77776
77883
|
https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/ABENSYSTEM_FIELDS.html`,
|
|
77777
77884
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
77778
|
-
badExample: `sy-uname = 2.
|
|
77885
|
+
badExample: `sy-uname = 2.
|
|
77779
77886
|
sy = sy.`,
|
|
77780
77887
|
};
|
|
77781
77888
|
}
|
|
@@ -77837,8 +77944,8 @@ class TABLEnhancementCategory {
|
|
|
77837
77944
|
key: "tabl_enhancement_category",
|
|
77838
77945
|
title: "TABL enhancement category must be set",
|
|
77839
77946
|
shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
|
|
77840
|
-
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
77841
|
-
|
|
77947
|
+
extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
|
|
77948
|
+
|
|
77842
77949
|
You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
|
|
77843
77950
|
tags: [],
|
|
77844
77951
|
};
|
|
@@ -77903,8 +78010,8 @@ class TablesDeclaredLocally extends _abap_rule_1.ABAPRule {
|
|
|
77903
78010
|
shortDescription: `TABLES are always global, so declare them globally`,
|
|
77904
78011
|
extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abaptables.htm`,
|
|
77905
78012
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
77906
|
-
badExample: `FORM foo.
|
|
77907
|
-
TABLES t100.
|
|
78013
|
+
badExample: `FORM foo.
|
|
78014
|
+
TABLES t100.
|
|
77908
78015
|
ENDFORM.`,
|
|
77909
78016
|
goodExample: `TABLES t000.`,
|
|
77910
78017
|
};
|
|
@@ -78032,9 +78139,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
|
|
|
78032
78139
|
title: "Type FORM parameters",
|
|
78033
78140
|
shortDescription: `Checks for untyped FORM parameters`,
|
|
78034
78141
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
78035
|
-
badExample: `FORM foo USING bar.
|
|
78142
|
+
badExample: `FORM foo USING bar.
|
|
78036
78143
|
ENDFORM.`,
|
|
78037
|
-
goodExample: `FORM foo USING bar TYPE string.
|
|
78144
|
+
goodExample: `FORM foo USING bar TYPE string.
|
|
78038
78145
|
ENDFORM.`,
|
|
78039
78146
|
};
|
|
78040
78147
|
}
|
|
@@ -78752,38 +78859,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
|
78752
78859
|
key: "unnecessary_pragma",
|
|
78753
78860
|
title: "Unnecessary Pragma",
|
|
78754
78861
|
shortDescription: `Finds pragmas which can be removed`,
|
|
78755
|
-
extendedInformation: `* NO_HANDLER with handler
|
|
78756
|
-
|
|
78757
|
-
* NEEDED without definition
|
|
78758
|
-
|
|
78759
|
-
* NO_TEXT without texts
|
|
78760
|
-
|
|
78761
|
-
* SUBRC_OK where sy-subrc is checked
|
|
78762
|
-
|
|
78862
|
+
extendedInformation: `* NO_HANDLER with handler
|
|
78863
|
+
|
|
78864
|
+
* NEEDED without definition
|
|
78865
|
+
|
|
78866
|
+
* NO_TEXT without texts
|
|
78867
|
+
|
|
78868
|
+
* SUBRC_OK where sy-subrc is checked
|
|
78869
|
+
|
|
78763
78870
|
NO_HANDLER inside macros are not checked`,
|
|
78764
78871
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
78765
|
-
badExample: `TRY.
|
|
78766
|
-
...
|
|
78767
|
-
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
78768
|
-
RETURN. " it has a handler
|
|
78769
|
-
ENDTRY.
|
|
78770
|
-
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
78771
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
78772
|
-
IF sy-subrc <> 0.
|
|
78872
|
+
badExample: `TRY.
|
|
78873
|
+
...
|
|
78874
|
+
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
78875
|
+
RETURN. " it has a handler
|
|
78876
|
+
ENDTRY.
|
|
78877
|
+
MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
|
|
78878
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
|
|
78879
|
+
IF sy-subrc <> 0.
|
|
78773
78880
|
ENDIF.`,
|
|
78774
|
-
goodExample: `TRY.
|
|
78775
|
-
...
|
|
78776
|
-
CATCH zcx_abapgit_exception.
|
|
78777
|
-
RETURN.
|
|
78778
|
-
ENDTRY.
|
|
78779
|
-
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
78780
|
-
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
78781
|
-
IF sy-subrc <> 0.
|
|
78782
|
-
ENDIF.
|
|
78783
|
-
|
|
78784
|
-
DATA: BEGIN OF blah ##NEEDED,
|
|
78785
|
-
test1 TYPE string,
|
|
78786
|
-
test2 TYPE string,
|
|
78881
|
+
goodExample: `TRY.
|
|
78882
|
+
...
|
|
78883
|
+
CATCH zcx_abapgit_exception.
|
|
78884
|
+
RETURN.
|
|
78885
|
+
ENDTRY.
|
|
78886
|
+
MESSAGE w125(zbar) WITH c_foo INTO message.
|
|
78887
|
+
SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
|
|
78888
|
+
IF sy-subrc <> 0.
|
|
78889
|
+
ENDIF.
|
|
78890
|
+
|
|
78891
|
+
DATA: BEGIN OF blah ##NEEDED,
|
|
78892
|
+
test1 TYPE string,
|
|
78893
|
+
test2 TYPE string,
|
|
78787
78894
|
END OF blah.`,
|
|
78788
78895
|
};
|
|
78789
78896
|
}
|
|
@@ -78950,18 +79057,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
|
|
|
78950
79057
|
shortDescription: `Finds unnecessary RETURN statements`,
|
|
78951
79058
|
extendedInformation: `Finds unnecessary RETURN statements`,
|
|
78952
79059
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
|
|
78953
|
-
badExample: `FORM hello1.
|
|
78954
|
-
WRITE 'world'.
|
|
78955
|
-
RETURN.
|
|
78956
|
-
ENDFORM.
|
|
78957
|
-
|
|
78958
|
-
FORM foo.
|
|
78959
|
-
IF 1 = 2.
|
|
78960
|
-
RETURN.
|
|
78961
|
-
ENDIF.
|
|
79060
|
+
badExample: `FORM hello1.
|
|
79061
|
+
WRITE 'world'.
|
|
79062
|
+
RETURN.
|
|
79063
|
+
ENDFORM.
|
|
79064
|
+
|
|
79065
|
+
FORM foo.
|
|
79066
|
+
IF 1 = 2.
|
|
79067
|
+
RETURN.
|
|
79068
|
+
ENDIF.
|
|
78962
79069
|
ENDFORM.`,
|
|
78963
|
-
goodExample: `FORM hello2.
|
|
78964
|
-
WRITE 'world'.
|
|
79070
|
+
goodExample: `FORM hello2.
|
|
79071
|
+
WRITE 'world'.
|
|
78965
79072
|
ENDFORM.`,
|
|
78966
79073
|
};
|
|
78967
79074
|
}
|
|
@@ -79316,13 +79423,13 @@ class UnusedMacros {
|
|
|
79316
79423
|
title: "Unused macros",
|
|
79317
79424
|
shortDescription: `Checks for unused macro definitions definitions`,
|
|
79318
79425
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
79319
|
-
badExample: `DEFINE foobar1.
|
|
79320
|
-
WRITE 'hello'.
|
|
79426
|
+
badExample: `DEFINE foobar1.
|
|
79427
|
+
WRITE 'hello'.
|
|
79321
79428
|
END-OF-DEFINITION.`,
|
|
79322
|
-
goodExample: `DEFINE foobar2.
|
|
79323
|
-
WRITE 'hello'.
|
|
79324
|
-
END-OF-DEFINITION.
|
|
79325
|
-
|
|
79429
|
+
goodExample: `DEFINE foobar2.
|
|
79430
|
+
WRITE 'hello'.
|
|
79431
|
+
END-OF-DEFINITION.
|
|
79432
|
+
|
|
79326
79433
|
foobar2.`,
|
|
79327
79434
|
};
|
|
79328
79435
|
}
|
|
@@ -79434,18 +79541,18 @@ class UnusedMethods {
|
|
|
79434
79541
|
key: "unused_methods",
|
|
79435
79542
|
title: "Unused methods",
|
|
79436
79543
|
shortDescription: `Checks for unused methods`,
|
|
79437
|
-
extendedInformation: `Checks private and protected methods.
|
|
79438
|
-
|
|
79439
|
-
Unused methods are not reported if the object contains parser or syntax errors.
|
|
79440
|
-
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
79441
|
-
|
|
79442
|
-
Skips:
|
|
79443
|
-
* methods FOR TESTING
|
|
79444
|
-
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
79445
|
-
* class_constructor + constructor methods
|
|
79446
|
-
* event handlers
|
|
79447
|
-
* methods that are redefined
|
|
79448
|
-
* INCLUDEs
|
|
79544
|
+
extendedInformation: `Checks private and protected methods.
|
|
79545
|
+
|
|
79546
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
79547
|
+
Quick fixes only appears for private methods or projected methods where the class doesnt have any subclasses.
|
|
79548
|
+
|
|
79549
|
+
Skips:
|
|
79550
|
+
* methods FOR TESTING
|
|
79551
|
+
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
79552
|
+
* class_constructor + constructor methods
|
|
79553
|
+
* event handlers
|
|
79554
|
+
* methods that are redefined
|
|
79555
|
+
* INCLUDEs
|
|
79449
79556
|
`,
|
|
79450
79557
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
79451
79558
|
pragma: "##CALLED",
|
|
@@ -79921,23 +80028,23 @@ class UnusedVariables {
|
|
|
79921
80028
|
key: "unused_variables",
|
|
79922
80029
|
title: "Unused variables",
|
|
79923
80030
|
shortDescription: `Checks for unused variables and constants`,
|
|
79924
|
-
extendedInformation: `Skips event parameters.
|
|
79925
|
-
|
|
79926
|
-
Note that this currently does not work if the source code uses macros.
|
|
79927
|
-
|
|
79928
|
-
Unused variables are not reported if the object contains parser or syntax errors.
|
|
79929
|
-
|
|
80031
|
+
extendedInformation: `Skips event parameters.
|
|
80032
|
+
|
|
80033
|
+
Note that this currently does not work if the source code uses macros.
|
|
80034
|
+
|
|
80035
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
80036
|
+
|
|
79930
80037
|
Errors found in INCLUDES are reported for the main program.`,
|
|
79931
80038
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
79932
80039
|
pragma: "##NEEDED",
|
|
79933
80040
|
pseudoComment: "EC NEEDED",
|
|
79934
|
-
badExample: `DATA: BEGIN OF blah1,
|
|
79935
|
-
test TYPE string,
|
|
79936
|
-
test2 TYPE string,
|
|
80041
|
+
badExample: `DATA: BEGIN OF blah1,
|
|
80042
|
+
test TYPE string,
|
|
80043
|
+
test2 TYPE string,
|
|
79937
80044
|
END OF blah1.`,
|
|
79938
|
-
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
79939
|
-
test TYPE string,
|
|
79940
|
-
test2 TYPE string,
|
|
80045
|
+
goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
|
|
80046
|
+
test TYPE string,
|
|
80047
|
+
test2 TYPE string,
|
|
79941
80048
|
END OF blah2.`,
|
|
79942
80049
|
};
|
|
79943
80050
|
}
|
|
@@ -80156,15 +80263,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
|
|
|
80156
80263
|
shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
|
|
80157
80264
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
|
|
80158
80265
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
80159
|
-
badExample: `IF line IS INITIAL.
|
|
80160
|
-
has_entries = abap_false.
|
|
80161
|
-
ELSE.
|
|
80162
|
-
has_entries = abap_true.
|
|
80163
|
-
ENDIF.
|
|
80164
|
-
|
|
80266
|
+
badExample: `IF line IS INITIAL.
|
|
80267
|
+
has_entries = abap_false.
|
|
80268
|
+
ELSE.
|
|
80269
|
+
has_entries = abap_true.
|
|
80270
|
+
ENDIF.
|
|
80271
|
+
|
|
80165
80272
|
DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
|
|
80166
|
-
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
80167
|
-
|
|
80273
|
+
goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
|
|
80274
|
+
|
|
80168
80275
|
DATA(fsdf) = xsdbool( foo <> bar ).`,
|
|
80169
80276
|
};
|
|
80170
80277
|
}
|
|
@@ -80282,15 +80389,15 @@ class UseClassBasedExceptions extends _abap_rule_1.ABAPRule {
|
|
|
80282
80389
|
shortDescription: `Use class based exceptions, checks interface and class definitions`,
|
|
80283
80390
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-class-based-exceptions`,
|
|
80284
80391
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
80285
|
-
badExample: `INTERFACE lif.
|
|
80286
|
-
METHODS load_data
|
|
80287
|
-
EXCEPTIONS
|
|
80288
|
-
invalid_parameter.
|
|
80392
|
+
badExample: `INTERFACE lif.
|
|
80393
|
+
METHODS load_data
|
|
80394
|
+
EXCEPTIONS
|
|
80395
|
+
invalid_parameter.
|
|
80289
80396
|
ENDINTERFACE.`,
|
|
80290
|
-
goodExample: `INTERFACE lif.
|
|
80291
|
-
METHODS load_data
|
|
80292
|
-
RAISING
|
|
80293
|
-
cx_something.
|
|
80397
|
+
goodExample: `INTERFACE lif.
|
|
80398
|
+
METHODS load_data
|
|
80399
|
+
RAISING
|
|
80400
|
+
cx_something.
|
|
80294
80401
|
ENDINTERFACE.`,
|
|
80295
80402
|
};
|
|
80296
80403
|
}
|
|
@@ -80351,15 +80458,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
|
|
|
80351
80458
|
key: "use_line_exists",
|
|
80352
80459
|
title: "Use line_exists",
|
|
80353
80460
|
shortDescription: `Use line_exists, from 740sp02 and up`,
|
|
80354
|
-
extendedInformation: `
|
|
80355
|
-
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
80356
|
-
|
|
80461
|
+
extendedInformation: `
|
|
80462
|
+
https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
|
|
80463
|
+
|
|
80357
80464
|
Not reported if the READ TABLE statement contains BINARY SEARCH.`,
|
|
80358
80465
|
tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
80359
|
-
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
80360
|
-
IF sy-subrc = 0.
|
|
80466
|
+
badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
|
|
80467
|
+
IF sy-subrc = 0.
|
|
80361
80468
|
ENDIF.`,
|
|
80362
|
-
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
80469
|
+
goodExample: `IF line_exists( my_table[ key = 'A' ] ).
|
|
80363
80470
|
ENDIF.`,
|
|
80364
80471
|
};
|
|
80365
80472
|
}
|
|
@@ -80469,10 +80576,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
|
|
|
80469
80576
|
key: "use_new",
|
|
80470
80577
|
title: "Use NEW",
|
|
80471
80578
|
shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
|
|
80472
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
80473
|
-
|
|
80474
|
-
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
80475
|
-
|
|
80579
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
|
|
80580
|
+
|
|
80581
|
+
If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
|
|
80582
|
+
|
|
80476
80583
|
Applicable from v740sp02 and up`,
|
|
80477
80584
|
badExample: `CREATE OBJECT ref.`,
|
|
80478
80585
|
goodExample: `ref = NEW #( ).`,
|
|
@@ -80570,13 +80677,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
|
|
|
80570
80677
|
title: "WHEN OTHERS last",
|
|
80571
80678
|
shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
|
|
80572
80679
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
80573
|
-
badExample: `CASE bar.
|
|
80574
|
-
WHEN OTHERS.
|
|
80575
|
-
WHEN 2.
|
|
80680
|
+
badExample: `CASE bar.
|
|
80681
|
+
WHEN OTHERS.
|
|
80682
|
+
WHEN 2.
|
|
80576
80683
|
ENDCASE.`,
|
|
80577
|
-
goodExample: `CASE bar.
|
|
80578
|
-
WHEN 2.
|
|
80579
|
-
WHEN OTHERS.
|
|
80684
|
+
goodExample: `CASE bar.
|
|
80685
|
+
WHEN 2.
|
|
80686
|
+
WHEN OTHERS.
|
|
80580
80687
|
ENDCASE.`,
|
|
80581
80688
|
};
|
|
80582
80689
|
}
|
|
@@ -80723,9 +80830,9 @@ class XMLConsistency {
|
|
|
80723
80830
|
key: "xml_consistency",
|
|
80724
80831
|
title: "XML consistency",
|
|
80725
80832
|
shortDescription: `Checks the consistency of main XML files`,
|
|
80726
|
-
extendedInformation: `Checks:
|
|
80727
|
-
* XML is well-formed and parseable
|
|
80728
|
-
* Naming for CLAS and INTF objects
|
|
80833
|
+
extendedInformation: `Checks:
|
|
80834
|
+
* XML is well-formed and parseable
|
|
80835
|
+
* Naming for CLAS and INTF objects
|
|
80729
80836
|
* Texts and translations do not exceed maximum allowed length.`,
|
|
80730
80837
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.Syntax],
|
|
80731
80838
|
};
|