ch.acanda.maven.coan.pmd.PmdIssue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of code-analysis-maven-plugin Show documentation
Show all versions of code-analysis-maven-plugin Show documentation
The Code Analysis Maven Plugin runs several static analysis tools to check
your code for bugs, design and formatting problems.
package ch.acanda.maven.coan.pmd;
import ch.acanda.maven.coan.Issue;
import net.sourceforge.pmd.reporting.RuleViolation;
import java.nio.file.Path;
import java.nio.file.Paths;
public record PmdIssue(RuleViolation violation) implements Issue {
@Override
public Path file() {
return Paths.get(violation.getFileId().getAbsolutePath());
}
@Override
public int line() {
return violation.getBeginLine();
}
@Override
public int column() {
return violation.getBeginColumn();
}
@Override
public String name() {
return violation.getRule().getName();
}
@Override
public String description() {
return violation.getDescription();
}
@Override
public Severity severity() {
return switch (violation.getRule().getPriority()) {
case HIGH -> Severity.HIGHEST;
case MEDIUM_HIGH -> Severity.HIGH;
case MEDIUM -> Severity.MEDIUM;
case MEDIUM_LOW -> Severity.LOW;
case LOW -> Severity.LOWEST;
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy