@abaplint/cli 2.120.30 → 2.120.32
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/build/cli.js +368 -9
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -27700,7 +27700,10 @@ class TypeUtils {
|
|
|
27700
27700
|
|| source instanceof basic_1.DataType
|
|
27701
27701
|
|| source instanceof basic_1.UnknownType;
|
|
27702
27702
|
}
|
|
27703
|
-
if (source instanceof basic_1.
|
|
27703
|
+
if (source instanceof cgeneric_type_1.CGenericType && target instanceof basic_1.StringType) {
|
|
27704
|
+
return false;
|
|
27705
|
+
}
|
|
27706
|
+
else if (source instanceof basic_1.CharacterType) {
|
|
27704
27707
|
if (target instanceof basic_1.CharacterType) {
|
|
27705
27708
|
if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {
|
|
27706
27709
|
return source.getLength() <= target.getLength();
|
|
@@ -31478,11 +31481,20 @@ class FormParam {
|
|
|
31478
31481
|
return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, basic_1.AnyType.get(), ["form_parameter" /* IdentifierMeta.FormParameter */]);
|
|
31479
31482
|
}
|
|
31480
31483
|
let bfound = new basic_types_1.BasicTypes(input).parseType(node);
|
|
31481
|
-
const
|
|
31484
|
+
const typeName = (_c = node.findFirstExpression(expressions_1.TypeName)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
|
|
31482
31485
|
const hasExplicitLength = node.findFirstExpression(expressions_1.Length) !== undefined
|
|
31483
31486
|
|| node.findFirstExpression(expressions_1.ConstantFieldLength) !== undefined;
|
|
31484
|
-
|
|
31485
|
-
|
|
31487
|
+
// the length cannot be specified for FORM parameters, so these types are generic
|
|
31488
|
+
if (hasExplicitLength === false) {
|
|
31489
|
+
if (typeName === "C" && bfound instanceof basic_1.CharacterType) {
|
|
31490
|
+
bfound = basic_1.CGenericType.get();
|
|
31491
|
+
}
|
|
31492
|
+
else if (typeName === "X" && bfound instanceof basic_1.HexType) {
|
|
31493
|
+
bfound = basic_1.XGenericType.get();
|
|
31494
|
+
}
|
|
31495
|
+
else if (typeName === "P" && bfound instanceof basic_1.PackedType) {
|
|
31496
|
+
bfound = basic_1.PGenericType.get();
|
|
31497
|
+
}
|
|
31486
31498
|
}
|
|
31487
31499
|
if (nameToken && bfound) {
|
|
31488
31500
|
return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound, ["form_parameter" /* IdentifierMeta.FormParameter */]);
|
|
@@ -43509,6 +43521,11 @@ class Parameter {
|
|
|
43509
43521
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
43510
43522
|
return;
|
|
43511
43523
|
}
|
|
43524
|
+
const radioGroup = node.findFirstExpression(Expressions.RadioGroupName);
|
|
43525
|
+
if (radioGroup && radioGroup.concatTokens().length > 4) {
|
|
43526
|
+
const message = "Radio button group name too long, " + radioGroup.concatTokens();
|
|
43527
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, radioGroup.getFirstToken(), message));
|
|
43528
|
+
}
|
|
43512
43529
|
if (this.hasUserCommand(node) && this.hasLength(node)) {
|
|
43513
43530
|
const message = "USER-COMMAND and LENGTH not possible together";
|
|
43514
43531
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
@@ -43606,6 +43623,7 @@ const target_1 = __webpack_require__(/*! ../expressions/target */ "../core/build
|
|
|
43606
43623
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
43607
43624
|
const assert_error_1 = __webpack_require__(/*! ../assert_error */ "../core/build/src/abap/5_syntax/assert_error.js");
|
|
43608
43625
|
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "../core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
43626
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "../core/build/src/abap/5_syntax/_type_utils.js");
|
|
43609
43627
|
class Perform {
|
|
43610
43628
|
runSyntax(node, input) {
|
|
43611
43629
|
if (!(node.get() instanceof Statements.Perform)) {
|
|
@@ -43613,19 +43631,22 @@ class Perform {
|
|
|
43613
43631
|
}
|
|
43614
43632
|
////////////////////////////
|
|
43615
43633
|
// check parameters are defined
|
|
43634
|
+
const changing = [];
|
|
43616
43635
|
for (const c of node.findDirectExpressions(Expressions.PerformChanging)) {
|
|
43617
43636
|
for (const s of c.findDirectExpressions(Expressions.Target)) {
|
|
43618
|
-
target_1.Target.runSyntax(s, input);
|
|
43637
|
+
changing.push({ node: s, type: target_1.Target.runSyntax(s, input) });
|
|
43619
43638
|
}
|
|
43620
43639
|
}
|
|
43640
|
+
const tables = [];
|
|
43621
43641
|
for (const t of node.findDirectExpressions(Expressions.PerformTables)) {
|
|
43622
43642
|
for (const s of t.findDirectExpressions(Expressions.Source)) {
|
|
43623
|
-
source_1.Source.runSyntax(s, input);
|
|
43643
|
+
tables.push({ node: s, type: source_1.Source.runSyntax(s, input) });
|
|
43624
43644
|
}
|
|
43625
43645
|
}
|
|
43646
|
+
const using = [];
|
|
43626
43647
|
for (const u of node.findDirectExpressions(Expressions.PerformUsing)) {
|
|
43627
43648
|
for (const s of u.findDirectExpressions(Expressions.SimpleSource3)) {
|
|
43628
|
-
source_1.Source.runSyntax(s, input);
|
|
43649
|
+
using.push({ node: s, type: source_1.Source.runSyntax(s, input) });
|
|
43629
43650
|
}
|
|
43630
43651
|
}
|
|
43631
43652
|
////////////////////////////
|
|
@@ -43650,7 +43671,36 @@ class Perform {
|
|
|
43650
43671
|
return;
|
|
43651
43672
|
}
|
|
43652
43673
|
input.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.FormReference, input.filename);
|
|
43653
|
-
|
|
43674
|
+
////////////////////////////
|
|
43675
|
+
// check parameters match
|
|
43676
|
+
// USING and CHANGING are interchangeable, the actual parameters form a single positional list
|
|
43677
|
+
if (this.checkParameters(node, tables, found.getTablesParameters(), "TABLES", input) === false) {
|
|
43678
|
+
return;
|
|
43679
|
+
}
|
|
43680
|
+
const formal = found.getUsingParameters().concat(found.getChangingParameters());
|
|
43681
|
+
this.checkParameters(node, using.concat(changing), formal, "USING/CHANGING", input);
|
|
43682
|
+
}
|
|
43683
|
+
// returns false if an issue was reported
|
|
43684
|
+
checkParameters(node, actual, formal, kind, input) {
|
|
43685
|
+
if (actual.length !== formal.length) {
|
|
43686
|
+
const message = `PERFORM, expected ${formal.length} ${kind} parameters, found ${actual.length}`;
|
|
43687
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
43688
|
+
return false;
|
|
43689
|
+
}
|
|
43690
|
+
const typeUtils = new _type_utils_1.TypeUtils(input.scope);
|
|
43691
|
+
for (let i = 0; i < actual.length; i++) {
|
|
43692
|
+
const { node: source, type } = actual[i];
|
|
43693
|
+
if (type === undefined) {
|
|
43694
|
+
continue;
|
|
43695
|
+
}
|
|
43696
|
+
const parameter = formal[i];
|
|
43697
|
+
if (typeUtils.isAssignableStrict(type, parameter.getType(), source) === false) {
|
|
43698
|
+
const message = `PERFORM parameter type not compatible, ${parameter.getName()}`;
|
|
43699
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, source.getFirstToken(), message));
|
|
43700
|
+
return false;
|
|
43701
|
+
}
|
|
43702
|
+
}
|
|
43703
|
+
return true;
|
|
43654
43704
|
}
|
|
43655
43705
|
}
|
|
43656
43706
|
exports.Perform = Perform;
|
|
@@ -70003,7 +70053,7 @@ class Registry {
|
|
|
70003
70053
|
}
|
|
70004
70054
|
static abaplintVersion() {
|
|
70005
70055
|
// magic, see build script "version.js"
|
|
70006
|
-
return "2.120.
|
|
70056
|
+
return "2.120.32";
|
|
70007
70057
|
}
|
|
70008
70058
|
getDDICReferences() {
|
|
70009
70059
|
return this.ddicReferences;
|
|
@@ -84231,6 +84281,7 @@ __exportStar(__webpack_require__(/*! ./newline_between_methods */ "../core/build
|
|
|
84231
84281
|
__exportStar(__webpack_require__(/*! ./no_aliases */ "../core/build/src/rules/no_aliases.js"), exports);
|
|
84232
84282
|
__exportStar(__webpack_require__(/*! ./no_chained_assignment */ "../core/build/src/rules/no_chained_assignment.js"), exports);
|
|
84233
84283
|
__exportStar(__webpack_require__(/*! ./no_comments_between_methods */ "../core/build/src/rules/no_comments_between_methods.js"), exports);
|
|
84284
|
+
__exportStar(__webpack_require__(/*! ./no_dynamic_stuff */ "../core/build/src/rules/no_dynamic_stuff.js"), exports);
|
|
84234
84285
|
__exportStar(__webpack_require__(/*! ./no_external_form_calls */ "../core/build/src/rules/no_external_form_calls.js"), exports);
|
|
84235
84286
|
__exportStar(__webpack_require__(/*! ./no_inline_in_optional_branches */ "../core/build/src/rules/no_inline_in_optional_branches.js"), exports);
|
|
84236
84287
|
__exportStar(__webpack_require__(/*! ./no_macros */ "../core/build/src/rules/no_macros.js"), exports);
|
|
@@ -84310,6 +84361,7 @@ __exportStar(__webpack_require__(/*! ./when_others_last */ "../core/build/src/ru
|
|
|
84310
84361
|
__exportStar(__webpack_require__(/*! ./whitespace_end */ "../core/build/src/rules/whitespace_end.js"), exports);
|
|
84311
84362
|
__exportStar(__webpack_require__(/*! ./xml_consistency */ "../core/build/src/rules/xml_consistency.js"), exports);
|
|
84312
84363
|
__exportStar(__webpack_require__(/*! ./no_exclamation_escape */ "../core/build/src/rules/no_exclamation_escape.js"), exports);
|
|
84364
|
+
__exportStar(__webpack_require__(/*! ./xml_bom */ "../core/build/src/rules/xml_bom.js"), exports);
|
|
84313
84365
|
__exportStar(__webpack_require__(/*! ./no_exclamation_escape */ "../core/build/src/rules/no_exclamation_escape.js"), exports);
|
|
84314
84366
|
//# sourceMappingURL=index.js.map
|
|
84315
84367
|
|
|
@@ -88343,6 +88395,255 @@ exports.NoCommentsBetweenMethods = NoCommentsBetweenMethods;
|
|
|
88343
88395
|
|
|
88344
88396
|
/***/ },
|
|
88345
88397
|
|
|
88398
|
+
/***/ "../core/build/src/rules/no_dynamic_stuff.js"
|
|
88399
|
+
/*!***************************************************!*\
|
|
88400
|
+
!*** ../core/build/src/rules/no_dynamic_stuff.js ***!
|
|
88401
|
+
\***************************************************/
|
|
88402
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
88403
|
+
|
|
88404
|
+
"use strict";
|
|
88405
|
+
|
|
88406
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
88407
|
+
if (k2 === undefined) k2 = k;
|
|
88408
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
88409
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
88410
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
88411
|
+
}
|
|
88412
|
+
Object.defineProperty(o, k2, desc);
|
|
88413
|
+
}) : (function(o, m, k, k2) {
|
|
88414
|
+
if (k2 === undefined) k2 = k;
|
|
88415
|
+
o[k2] = m[k];
|
|
88416
|
+
}));
|
|
88417
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
88418
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
88419
|
+
}) : function(o, v) {
|
|
88420
|
+
o["default"] = v;
|
|
88421
|
+
});
|
|
88422
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
88423
|
+
var ownKeys = function(o) {
|
|
88424
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
88425
|
+
var ar = [];
|
|
88426
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
88427
|
+
return ar;
|
|
88428
|
+
};
|
|
88429
|
+
return ownKeys(o);
|
|
88430
|
+
};
|
|
88431
|
+
return function (mod) {
|
|
88432
|
+
if (mod && mod.__esModule) return mod;
|
|
88433
|
+
var result = {};
|
|
88434
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
88435
|
+
__setModuleDefault(result, mod);
|
|
88436
|
+
return result;
|
|
88437
|
+
};
|
|
88438
|
+
})();
|
|
88439
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
88440
|
+
exports.NoDynamicStuff = exports.NoDynamicStuffConf = void 0;
|
|
88441
|
+
const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
88442
|
+
const Expressions = __importStar(__webpack_require__(/*! ../abap/2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
88443
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
|
|
88444
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
88445
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
88446
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
88447
|
+
class NoDynamicStuffConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
88448
|
+
constructor() {
|
|
88449
|
+
super(...arguments);
|
|
88450
|
+
/** Detects dynamic method calls, ie. CALL METHOD (name), SET HANDLER and CALL BADI */
|
|
88451
|
+
this.callMethod = true;
|
|
88452
|
+
/** Detects dynamic CALL FUNCTION, ie. the function module name is not a literal */
|
|
88453
|
+
this.callFunction = true;
|
|
88454
|
+
/** Detects CALL DATABASE PROCEDURE, the procedure name is always dynamic */
|
|
88455
|
+
this.callDatabaseProcedure = true;
|
|
88456
|
+
/** Detects dynamic CALL TRANSFORMATION */
|
|
88457
|
+
this.callTransformation = true;
|
|
88458
|
+
/** Detects dynamic CALL TRANSACTION, ie. the transaction code is not a literal */
|
|
88459
|
+
this.callTransaction = true;
|
|
88460
|
+
/** Detects dynamic PERFORM */
|
|
88461
|
+
this.perform = true;
|
|
88462
|
+
/** Detects dynamic SUBMIT */
|
|
88463
|
+
this.submit = true;
|
|
88464
|
+
/** Detects dynamic CREATE OBJECT */
|
|
88465
|
+
this.createObject = true;
|
|
88466
|
+
/** Detects dynamic CREATE DATA */
|
|
88467
|
+
this.createData = true;
|
|
88468
|
+
/** Detects dynamic GET BADI */
|
|
88469
|
+
this.getBadi = true;
|
|
88470
|
+
/** Detects dynamic ASSIGN, including ASSIGN COMPONENT */
|
|
88471
|
+
this.assign = true;
|
|
88472
|
+
/** Detects dynamic internal table access, ie. dynamic WHERE, keys, SORT BY and TRANSPORTING */
|
|
88473
|
+
this.internalTable = true;
|
|
88474
|
+
/** Detects dynamic EXPORT and IMPORT */
|
|
88475
|
+
this.exportImport = true;
|
|
88476
|
+
}
|
|
88477
|
+
}
|
|
88478
|
+
exports.NoDynamicStuffConf = NoDynamicStuffConf;
|
|
88479
|
+
class NoDynamicStuff extends _abap_rule_1.ABAPRule {
|
|
88480
|
+
constructor() {
|
|
88481
|
+
super(...arguments);
|
|
88482
|
+
this.conf = new NoDynamicStuffConf();
|
|
88483
|
+
}
|
|
88484
|
+
getMetadata() {
|
|
88485
|
+
return {
|
|
88486
|
+
key: "no_dynamic_stuff",
|
|
88487
|
+
title: "No dynamic stuff",
|
|
88488
|
+
shortDescription: `Detects dynamic calls and other dynamic language constructs`,
|
|
88489
|
+
extendedInformation: `Dynamic constructs cannot be checked statically, they are not found by
|
|
88490
|
+
where-used lists and refactorings, and they can introduce injection vulnerabilities.
|
|
88491
|
+
|
|
88492
|
+
Dynamic tokens containing a literal, eg. CALL METHOD ('CL_FOO')=>('BAR'), are not reported,
|
|
88493
|
+
as these are equivalent to the static variant.
|
|
88494
|
+
|
|
88495
|
+
Dynamic SQL is reported by rule dangerous_statement.`,
|
|
88496
|
+
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
88497
|
+
badExample: `CALL METHOD (lv_class)=>(lv_method).
|
|
88498
|
+
CALL FUNCTION lv_function_module.
|
|
88499
|
+
CREATE OBJECT ref TYPE (lv_class).
|
|
88500
|
+
ASSIGN (lv_name) TO <fs>.
|
|
88501
|
+
SORT tab BY (lv_field).`,
|
|
88502
|
+
goodExample: `cl_class=>method( ).
|
|
88503
|
+
CALL FUNCTION 'ZFOO'.
|
|
88504
|
+
CREATE OBJECT ref TYPE cl_class.
|
|
88505
|
+
ASSIGN foo TO <fs>.
|
|
88506
|
+
SORT tab BY field.`,
|
|
88507
|
+
};
|
|
88508
|
+
}
|
|
88509
|
+
getConfig() {
|
|
88510
|
+
return this.conf;
|
|
88511
|
+
}
|
|
88512
|
+
setConfig(conf) {
|
|
88513
|
+
this.conf = conf;
|
|
88514
|
+
}
|
|
88515
|
+
runParsed(file) {
|
|
88516
|
+
const issues = [];
|
|
88517
|
+
for (const statementNode of file.getStatements()) {
|
|
88518
|
+
const found = this.check(statementNode);
|
|
88519
|
+
if (found !== undefined) {
|
|
88520
|
+
issues.push(issue_1.Issue.atStatement(file, statementNode, "Dynamic " + found, this.getMetadata().key, this.conf.severity));
|
|
88521
|
+
}
|
|
88522
|
+
}
|
|
88523
|
+
return issues;
|
|
88524
|
+
}
|
|
88525
|
+
check(node) {
|
|
88526
|
+
const statement = node.get();
|
|
88527
|
+
// note that MethodSource is also used by SET HANDLER and CALL BADI
|
|
88528
|
+
if (this.conf.callMethod === true && this.dynamicMethodSource(node) === true) {
|
|
88529
|
+
return "method call";
|
|
88530
|
+
}
|
|
88531
|
+
if (statement instanceof Statements.CallFunction) {
|
|
88532
|
+
if (this.conf.callFunction === true
|
|
88533
|
+
&& this.notLiteral(node.findDirectExpression(Expressions.FunctionName))) {
|
|
88534
|
+
return "CALL FUNCTION";
|
|
88535
|
+
}
|
|
88536
|
+
}
|
|
88537
|
+
else if (statement instanceof Statements.CallDatabase) {
|
|
88538
|
+
if (this.conf.callDatabaseProcedure === true) {
|
|
88539
|
+
return "CALL DATABASE PROCEDURE";
|
|
88540
|
+
}
|
|
88541
|
+
}
|
|
88542
|
+
else if (statement instanceof Statements.CallTransformation) {
|
|
88543
|
+
if (this.conf.callTransformation === true && this.hasDynamic(node)) {
|
|
88544
|
+
return "CALL TRANSFORMATION";
|
|
88545
|
+
}
|
|
88546
|
+
}
|
|
88547
|
+
else if (statement instanceof Statements.CallTransaction) {
|
|
88548
|
+
// the transaction code is a Source, ie. there is no parenthesized dynamic variant
|
|
88549
|
+
if (this.conf.callTransaction === true
|
|
88550
|
+
&& this.notLiteral(node.findDirectExpression(Expressions.Source))) {
|
|
88551
|
+
return "CALL TRANSACTION";
|
|
88552
|
+
}
|
|
88553
|
+
}
|
|
88554
|
+
else if (statement instanceof Statements.Perform) {
|
|
88555
|
+
if (this.conf.perform === true && this.hasDynamic(node)) {
|
|
88556
|
+
return "PERFORM";
|
|
88557
|
+
}
|
|
88558
|
+
}
|
|
88559
|
+
else if (statement instanceof Statements.Submit) {
|
|
88560
|
+
if (this.conf.submit === true && this.hasDynamic(node)) {
|
|
88561
|
+
return "SUBMIT";
|
|
88562
|
+
}
|
|
88563
|
+
}
|
|
88564
|
+
else if (statement instanceof Statements.CreateObject) {
|
|
88565
|
+
if (this.conf.createObject === true && this.hasDynamic(node)) {
|
|
88566
|
+
return "CREATE OBJECT";
|
|
88567
|
+
}
|
|
88568
|
+
}
|
|
88569
|
+
else if (statement instanceof Statements.CreateData) {
|
|
88570
|
+
if (this.conf.createData === true && this.hasDynamic(node)) {
|
|
88571
|
+
return "CREATE DATA";
|
|
88572
|
+
}
|
|
88573
|
+
}
|
|
88574
|
+
else if (statement instanceof Statements.GetBadi) {
|
|
88575
|
+
if (this.conf.getBadi === true && this.hasDynamic(node)) {
|
|
88576
|
+
return "GET BADI";
|
|
88577
|
+
}
|
|
88578
|
+
}
|
|
88579
|
+
else if (statement instanceof Statements.Assign
|
|
88580
|
+
|| statement instanceof Statements.AssignLocalCopy) {
|
|
88581
|
+
if (this.conf.assign === true
|
|
88582
|
+
&& (this.hasDynamic(node) || this.dynamicAssignComponent(node))) {
|
|
88583
|
+
return "ASSIGN";
|
|
88584
|
+
}
|
|
88585
|
+
}
|
|
88586
|
+
else if (statement instanceof Statements.Export) {
|
|
88587
|
+
if (this.conf.exportImport === true && this.hasDynamic(node)) {
|
|
88588
|
+
return "EXPORT";
|
|
88589
|
+
}
|
|
88590
|
+
}
|
|
88591
|
+
else if (statement instanceof Statements.Import) {
|
|
88592
|
+
if (this.conf.exportImport === true && this.hasDynamic(node)) {
|
|
88593
|
+
return "IMPORT";
|
|
88594
|
+
}
|
|
88595
|
+
}
|
|
88596
|
+
else if (statement instanceof Statements.At
|
|
88597
|
+
|| statement instanceof Statements.DeleteInternal
|
|
88598
|
+
|| statement instanceof Statements.InsertInternal
|
|
88599
|
+
|| statement instanceof Statements.Loop
|
|
88600
|
+
|| statement instanceof Statements.ModifyInternal
|
|
88601
|
+
|| statement instanceof Statements.ReadTable
|
|
88602
|
+
|| statement instanceof Statements.Sort
|
|
88603
|
+
|| statement instanceof Statements.SortDataset) {
|
|
88604
|
+
if (this.conf.internalTable === true && this.hasDynamic(node)) {
|
|
88605
|
+
return "internal table access";
|
|
88606
|
+
}
|
|
88607
|
+
}
|
|
88608
|
+
return undefined;
|
|
88609
|
+
}
|
|
88610
|
+
dynamicMethodSource(node) {
|
|
88611
|
+
for (const source of node.findAllExpressions(Expressions.MethodSource)) {
|
|
88612
|
+
// Dynamic is always a direct child of MethodSource, dynamics further down
|
|
88613
|
+
// are parameters of the method call and not part of the method name
|
|
88614
|
+
for (const dynamic of source.findDirectExpressions(Expressions.Dynamic)) {
|
|
88615
|
+
if (this.isLiteral(dynamic) === false) {
|
|
88616
|
+
return true;
|
|
88617
|
+
}
|
|
88618
|
+
}
|
|
88619
|
+
}
|
|
88620
|
+
return false;
|
|
88621
|
+
}
|
|
88622
|
+
dynamicAssignComponent(node) {
|
|
88623
|
+
var _a;
|
|
88624
|
+
const component = (_a = node.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findExpressionAfterToken("COMPONENT");
|
|
88625
|
+
return component !== undefined && this.isLiteral(component) === false;
|
|
88626
|
+
}
|
|
88627
|
+
hasDynamic(node) {
|
|
88628
|
+
for (const dynamic of node.findAllExpressions(Expressions.Dynamic)) {
|
|
88629
|
+
if (this.isLiteral(dynamic) === false) {
|
|
88630
|
+
return true;
|
|
88631
|
+
}
|
|
88632
|
+
}
|
|
88633
|
+
return false;
|
|
88634
|
+
}
|
|
88635
|
+
notLiteral(node) {
|
|
88636
|
+
return node !== undefined && this.isLiteral(node) === false;
|
|
88637
|
+
}
|
|
88638
|
+
isLiteral(node) {
|
|
88639
|
+
return node.findDirectExpression(Expressions.Constant) !== undefined;
|
|
88640
|
+
}
|
|
88641
|
+
}
|
|
88642
|
+
exports.NoDynamicStuff = NoDynamicStuff;
|
|
88643
|
+
//# sourceMappingURL=no_dynamic_stuff.js.map
|
|
88644
|
+
|
|
88645
|
+
/***/ },
|
|
88646
|
+
|
|
88346
88647
|
/***/ "../core/build/src/rules/no_exclamation_escape.js"
|
|
88347
88648
|
/*!********************************************************!*\
|
|
88348
88649
|
!*** ../core/build/src/rules/no_exclamation_escape.js ***!
|
|
@@ -99536,6 +99837,64 @@ exports.WhitespaceEnd = WhitespaceEnd;
|
|
|
99536
99837
|
|
|
99537
99838
|
/***/ },
|
|
99538
99839
|
|
|
99840
|
+
/***/ "../core/build/src/rules/xml_bom.js"
|
|
99841
|
+
/*!******************************************!*\
|
|
99842
|
+
!*** ../core/build/src/rules/xml_bom.js ***!
|
|
99843
|
+
\******************************************/
|
|
99844
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
99845
|
+
|
|
99846
|
+
"use strict";
|
|
99847
|
+
|
|
99848
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
99849
|
+
exports.XMLBOM = exports.XMLBOMConf = void 0;
|
|
99850
|
+
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "../core/build/src/edit_helper.js");
|
|
99851
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
99852
|
+
const position_1 = __webpack_require__(/*! ../position */ "../core/build/src/position.js");
|
|
99853
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
99854
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
99855
|
+
class XMLBOMConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
99856
|
+
}
|
|
99857
|
+
exports.XMLBOMConf = XMLBOMConf;
|
|
99858
|
+
class XMLBOM {
|
|
99859
|
+
constructor() {
|
|
99860
|
+
this.conf = new XMLBOMConf();
|
|
99861
|
+
}
|
|
99862
|
+
getMetadata() {
|
|
99863
|
+
return {
|
|
99864
|
+
key: "xml_bom",
|
|
99865
|
+
title: "XML UTF-8 byte order mark",
|
|
99866
|
+
shortDescription: "Checks that XML files start with a UTF-8 byte order mark",
|
|
99867
|
+
extendedInformation: "Checks that each XML file has a UTF-8 byte order mark (BOM) at its beginning.",
|
|
99868
|
+
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix],
|
|
99869
|
+
};
|
|
99870
|
+
}
|
|
99871
|
+
getConfig() {
|
|
99872
|
+
return this.conf;
|
|
99873
|
+
}
|
|
99874
|
+
setConfig(conf) {
|
|
99875
|
+
this.conf = conf;
|
|
99876
|
+
}
|
|
99877
|
+
initialize(_reg) {
|
|
99878
|
+
return this;
|
|
99879
|
+
}
|
|
99880
|
+
run(obj) {
|
|
99881
|
+
const file = obj.getXMLFile();
|
|
99882
|
+
if (file === undefined || file.getRaw().startsWith("\uFEFF")) {
|
|
99883
|
+
return [];
|
|
99884
|
+
}
|
|
99885
|
+
return [this.createIssue(file)];
|
|
99886
|
+
}
|
|
99887
|
+
createIssue(file) {
|
|
99888
|
+
const start = new position_1.Position(1, 1);
|
|
99889
|
+
const fix = edit_helper_1.EditHelper.insertAt(file, start, "\uFEFF");
|
|
99890
|
+
return issue_1.Issue.atRange(file, start, start, "XML file must start with a UTF-8 byte order mark", this.getMetadata().key, this.conf.severity, fix);
|
|
99891
|
+
}
|
|
99892
|
+
}
|
|
99893
|
+
exports.XMLBOM = XMLBOM;
|
|
99894
|
+
//# sourceMappingURL=xml_bom.js.map
|
|
99895
|
+
|
|
99896
|
+
/***/ },
|
|
99897
|
+
|
|
99539
99898
|
/***/ "../core/build/src/rules/xml_consistency.js"
|
|
99540
99899
|
/*!**************************************************!*\
|
|
99541
99900
|
!*** ../core/build/src/rules/xml_consistency.js ***!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.32",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.120.
|
|
42
|
+
"@abaplint/core": "^2.120.32",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|