Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ruleset.getAllRules().forEach( rule => {
// Severity is always high.
newProfile.severities[rule.code] = ValidationProblemSeverity.high;
});
} else {
public iconFor(problem: ValidationProblem): string {
switch (problem.severity) {
case ValidationProblemSeverity.low:
return "pficon-info";
case ValidationProblemSeverity.medium:
return "pficon-warning-triangle-o";
case ValidationProblemSeverity.high:
return "pficon-error-circle-o";
default:
return "";
}
}
public iconFor(problem: ValidationProblem): string {
switch (problem.severity) {
case ValidationProblemSeverity.low:
return "pficon-info";
case ValidationProblemSeverity.medium:
return "pficon-warning-triangle-o";
case ValidationProblemSeverity.high:
return "pficon-error-circle-o";
default:
return "pficon-info";
}
}
public icon(): string {
let problems: ValidationProblem[] = this.validationProblems();
let maxSeverity: ValidationProblemSeverity = null;
problems.forEach( problem => {
if (maxSeverity === null || problem.severity > maxSeverity) {
maxSeverity = problem.severity;
}
});
switch (maxSeverity) {
case ValidationProblemSeverity.low:
return "pficon-info";
case ValidationProblemSeverity.medium:
return "pficon-warning-triangle-o";
case ValidationProblemSeverity.high:
return "pficon-error-circle-o";
default:
return "";
}
}
public lookupSeverity(): ValidationProblemSeverity {
return ValidationProblemSeverity.high;
}
Object.getOwnPropertyNames(severities).forEach( key => {
let value: string = severities[key];
let severity: ValidationProblemSeverity = ValidationProblemSeverity.low;
switch (value) {
case "ignore": severity = ValidationProblemSeverity.ignore; break;
case "low": severity = ValidationProblemSeverity.low; break;
case "medium": severity = ValidationProblemSeverity.medium; break;
case "high": severity = ValidationProblemSeverity.high; break;
}
rval[key] = severity;
});
return rval;
high(): ValidationProblemSeverity { return ValidationProblemSeverity.high; }
medium(): ValidationProblemSeverity { return ValidationProblemSeverity.medium; }
public lookupSeverity(): ValidationProblemSeverity {
return ValidationProblemSeverity.high;
}