Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 11333x 11333x 11333x 11333x 33842x 33842x 33842x 33842x 33842x 33842x 33842x 33842x 11333x 11333x 234x 234x 11333x 11333x 10837x 10837x 11333x 11333x 233x 233x 11333x 11333x 303x 303x 303x 139x 139x 164x 164x 303x 162x 162x 2x 303x 1x 2x 1x 1x 1x 2x 1x 2x 2x 2x 11333x 11333x | import {Issue} from "../issue";
import {IObject} from "../objects/_iobject";
import {IRule, IRuleMetadata, RuleTag} from "./_irule";
import {BasicRuleConfig} from "./_basic_rule_config";
import {IRegistry} from "../_iregistry";
import {Program} from "../objects";
import {Position} from "../position";
export class DynproChecksConf extends BasicRuleConfig {
}
export class DynproChecks implements IRule {
private conf = new DynproChecksConf();
public getMetadata(): IRuleMetadata {
return {
key: "dynpro_checks",
title: "Dynpro Checks",
shortDescription: `Various Dynpro checks`,
extendedInformation: `* Check length of PUSH elements less than 132`,
tags: [RuleTag.Syntax],
};
}
public initialize(_reg: IRegistry) {
return this;
}
public getConfig(): DynproChecksConf {
return this.conf;
}
public setConfig(conf: DynproChecksConf) {
this.conf = conf;
}
public run(obj: IObject): Issue[] {
const ret: Issue[] = [];
if (!(obj instanceof 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.atPosition(file, new Position(1, 1), message, this.getMetadata().key, this.getConfig().severity));
}
}
}
return ret;
}
}
|