@abaplint/core
Version:
abaplint - Core API
55 lines • 1.83 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DynproChecks = exports.DynproChecksConf = void 0;
const issue_1 = require("../issue");
const _irule_1 = require("./_irule");
const _basic_rule_config_1 = require("./_basic_rule_config");
const objects_1 = require("../objects");
const position_1 = require("../position");
class DynproChecksConf extends _basic_rule_config_1.BasicRuleConfig {
}
exports.DynproChecksConf = DynproChecksConf;
class DynproChecks {
constructor() {
this.conf = new DynproChecksConf();
}
getMetadata() {
return {
key: "dynpro_checks",
title: "Dynpro Checks",
shortDescription: `Various Dynpro checks`,
extendedInformation: `* Check length of PUSH elements less than 132`,
tags: [_irule_1.RuleTag.Syntax],
};
}
initialize(_reg) {
return this;
}
getConfig() {
return this.conf;
}
setConfig(conf) {
this.conf = conf;
}
run(obj) {
const ret = [];
if (!(obj instanceof objects_1.Program)) {
return [];
}
const file = obj.getXMLFile();
if (file === undefined) {
return [];
}
for (const dynpro of obj.getDynpros()) {
for (const field of dynpro.fields) {
if (field.type === "PUSH" && field.length > 132) {
const message = `Screen ${dynpro.number}, field ${field.name} LENGTH longer than 132`;
ret.push(issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.getConfig().severity));
}
}
}
return ret;
}
}
exports.DynproChecks = DynproChecks;
//# sourceMappingURL=dynpro_checks.js.map