use of hudson.plugins.violations.model.Violation in project violations-plugin by jenkinsci.
the class CppLintParser method parseLine.
/**
* Parses a CppLint line and adding a violation if regex
* @param model build model to add violations to
* @param line the line in the file.
* @param projectPath the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
CppLintViolation cppLintViolation = getCppLintViolation(line);
if (cppLintViolation != null) {
Violation violation = new Violation();
violation.setType("cpplint");
violation.setLine(cppLintViolation.getLineStr());
violation.setMessage(cppLintViolation.getMessage());
violation.setSource(cppLintViolation.getViolationId());
setServerityLevel(violation, cppLintViolation.getConfidence());
FullFileModel fileModel = getFileModel(model, cppLintViolation.getFileName(), absoluteFileFinder.getFileForName(cppLintViolation.getFileName()));
fileModel.addViolation(violation);
}
}
use of hudson.plugins.violations.model.Violation in project violations-plugin by jenkinsci.
the class PyflakesParser method parseLine.
/**
* Parses a Pyflakes line and adding a violation if regex
*
* @param model
* build model to add violations to
* @param line
* the line in the file.
* @param projectPath
* the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
PyflakesViolation pyFlakesViolation = getPyflakesViolation(line);
if (pyFlakesViolation != null) {
Violation violation = new Violation();
violation.setType("pyflakes");
violation.setLine(pyFlakesViolation.getLineStr());
violation.setMessage(pyFlakesViolation.getMessage());
violation.setSource(pyFlakesViolation.getViolationId());
setServerityLevel(violation, pyFlakesViolation.getViolationId());
FullFileModel fileModel = getFileModel(model, pyFlakesViolation.getFileName(), absoluteFileFinder.getFileForName(pyFlakesViolation.getFileName()));
fileModel.addViolation(violation);
}
}
use of hudson.plugins.violations.model.Violation in project violations-plugin by jenkinsci.
the class PyLintParser method parseLine.
/**
* Parses a PyLint line and adding a violation if regex
*
* @param model
* build model to add violations to
* @param line
* the line in the file.
* @param projectPath
* the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
PyLintViolation pyLintViolation = getPyLintViolation(line);
if (pyLintViolation != null) {
Violation violation = new Violation();
violation.setType("pylint");
violation.setLine(pyLintViolation.getLineStr());
violation.setMessage(pyLintViolation.getMessage());
violation.setSource(pyLintViolation.getViolationId());
setServerityLevel(violation, pyLintViolation.getViolationId());
FullFileModel fileModel = getFileModel(model, pyLintViolation.getFileName(), absoluteFileFinder.getFileForName(pyLintViolation.getFileName()));
fileModel.addViolation(violation);
}
}
use of hudson.plugins.violations.model.Violation in project violations-plugin by jenkinsci.
the class SimianParser method createViolation.
/**
* Create a violation from the duplication block
* @param block the block to create a violation from
* @return a violation
*/
private Violation createViolation(DuplicationBlock block) {
Violation violation = new Violation();
violation.setType(TYPE_NAME);
violation.setSource("duplication");
int startLineNumber = block.startLineNumber;
int endLineNumber = block.endLineNumber;
int lineCount = endLineNumber - startLineNumber + 1;
violation.setLine(startLineNumber);
setViolationSeverity(violation, (lineCount < LOW_LIMIT) ? Severity.LOW : (lineCount < MEDIUM_LIMIT) ? Severity.MEDIUM : Severity.HIGH);
return violation;
}
use of hudson.plugins.violations.model.Violation in project violations-plugin by jenkinsci.
the class ZptlintParser method parseLine.
/**
* Parses a Zptlint line and adding a violation if regex
*
* @param model
* build model to add violations to
* @param line
* the line in the file.
* @param projectPath
* the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
ZptlintViolation zptlintViolation = getZptlintViolation(line);
if (zptlintViolation != null) {
Violation violation = new Violation();
violation.setType("zptlint");
violation.setLine(zptlintViolation.getLineStr());
violation.setMessage(zptlintViolation.getMessage());
violation.setSource(zptlintViolation.getViolationId());
setServerityLevel(violation, zptlintViolation.getViolationId());
FullFileModel fileModel = getFileModel(model, zptlintViolation.getFileName(), absoluteFileFinder.getFileForName(zptlintViolation.getFileName()));
fileModel.addViolation(violation);
}
}
Aggregations