use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class CodenarcParserTest method testParseFullBuildModelFromFile.
@Test
public void testParseFullBuildModelFromFile() throws Exception {
FullBuildModel model = getFullBuildModel("CodeNarcXmlReport.xml");
FullFileModel fileModel = model.getFileModel("grails-app/controllers/LoginController.groovy");
assertEquals("Number of violations is incorrect", 10, model.getCountNumber("codenarc"));
assertEquals("Number of files is incorrect", 7, model.getFileModelMap().size());
assertNotNull("LoginController model is null", fileModel.getSourceFile());
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class PerlCriticParser method getFileModel.
private FullFileModel getFileModel(FullBuildModel model, String name) {
File sourceFile = this.absoluteFileFinder.getFileForName(name);
FullFileModel fileModel = model.getFileModel(name);
File other = fileModel.getSourceFile();
if (sourceFile == null || ((other != null) && (other.equals(sourceFile) || other.exists()))) {
return fileModel;
}
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
return fileModel;
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class PMDParser method parseFileElement.
private void parseFileElement() throws IOException, XmlPullParserException {
String absoluteFileName = fixAbsolutePath(checkNotBlank("name"));
// consume "file" tag
getParser().next();
FullFileModel fileModel = getFileModel(absoluteFileName);
// Loop tru the child elements, getting the "error" ones
while (skipToTag("violation")) {
fileModel.addViolation(parseViolationElement());
}
endElement();
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class PyLintParser method getFileModel.
private FullFileModel getFileModel(FullBuildModel model, String name, File sourceFile) {
FullFileModel fileModel = model.getFileModel(name);
File other = fileModel.getSourceFile();
if (sourceFile == null || ((other != null) && (other.equals(sourceFile) || other.exists()))) {
return fileModel;
}
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
return fileModel;
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class ReSharperParser method getFileModel.
private FullFileModel getFileModel(final FullBuildModel model, final String name, final File sourceFile) {
final FullFileModel fileModel = model.getFileModel(name);
final File other = fileModel.getSourceFile();
if (sourceFile == null || ((other != null) && (other.equals(sourceFile) || other.exists()))) {
return fileModel;
}
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
return fileModel;
}
Aggregations