@abaplint/core
Version:
abaplint - Core API
55 lines • 1.76 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnusedDDIC = exports.UnusedDDICConf = void 0;
const issue_1 = require("../issue");
const Objects = require("../objects");
const _basic_rule_config_1 = require("./_basic_rule_config");
class UnusedDDICConf extends _basic_rule_config_1.BasicRuleConfig {
}
exports.UnusedDDICConf = UnusedDDICConf;
class UnusedDDIC {
constructor() {
this.conf = new UnusedDDICConf();
}
getMetadata() {
return {
key: "unused_ddic",
title: "Unused DDIC",
shortDescription: `Checks the usage of DDIC objects`,
extendedInformation: `Objects checked: DOMA + DTEL + TABL + TTYP + VIEW`,
tags: [],
};
}
initialize(reg) {
this.reg = reg;
return this;
}
getConfig() {
return this.conf;
}
setConfig(conf) {
this.conf = conf;
}
run(obj) {
if (obj instanceof Objects.Domain
|| obj instanceof Objects.TableType
|| obj instanceof Objects.View
|| obj instanceof Objects.Table
|| obj instanceof Objects.DataElement) {
return this.check(obj);
}
return [];
}
check(obj) {
const id = obj.getIdentifier();
const refs = this.reg.getDDICReferences();
const list = refs.listWhereUsed(obj);
if (id && list.length === 0) {
const message = obj.getType() + " " + obj.getName() + " not statically referenced";
return [issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.conf.severity)];
}
return [];
}
}
exports.UnusedDDIC = UnusedDDIC;
//# sourceMappingURL=unused_ddic.js.map