Skip to content

Commit

Permalink
Fix [JENKINS-11065]
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Dec 31, 2011
1 parent 3e5d26d commit 4fcb94a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
Expand Up @@ -83,6 +83,7 @@ private static void mergeReport(CppcheckReport cppcheckReportResult, CppcheckRep
cppcheckReportResult.getInformationSeverityList().addAll(cppcheckReport.getInformationSeverityList());
cppcheckReportResult.getNoCategorySeverityList().addAll(cppcheckReport.getNoCategorySeverityList());
cppcheckReportResult.getAllErrors().addAll(cppcheckReport.getAllErrors());
cppcheckReportResult.getVersions().add(cppcheckReport.getVersion());
}

/**
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/jenkinsci/plugins/cppcheck/CppcheckReport.java
Expand Up @@ -6,22 +6,40 @@

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
* @author Gregory Boissinot
*/
@ExportedBean
public class CppcheckReport implements Serializable {

private String version;

private transient List<CppcheckFile> allErrors = new ArrayList<CppcheckFile>();
private transient Set<String> versions = new HashSet<String>();

private List<CppcheckFile> errorSeverityList = new ArrayList<CppcheckFile>();
private List<CppcheckFile> warningSeverityList = new ArrayList<CppcheckFile>();
private List<CppcheckFile> styleSeverityList = new ArrayList<CppcheckFile>();
private List<CppcheckFile> performanceSeverityList = new ArrayList<CppcheckFile>();
private List<CppcheckFile> informationSeverityList = new ArrayList<CppcheckFile>();
private List<CppcheckFile> noCategorySeverityList = new ArrayList<CppcheckFile>();

public String getVersion() {
return version;
}

public Set<String> getVersions() {
return versions;
}

public void setVersion(String version) {
this.version = version;
}

public List<CppcheckFile> getAllErrors() {
return allErrors;
}
Expand Down
Expand Up @@ -173,6 +173,10 @@ private CppcheckReport getReportVersion2(Results results) {
cppCheckReport.setStyleSeverityList(styleSeverityList);
cppCheckReport.setWarningSeverityList(warningSeverityList);

if (results.getCppcheck() != null) {
cppCheckReport.setVersion(results.getCppcheck().getVersion());
}

return cppCheckReport;
}

Expand Down
Expand Up @@ -20,8 +20,7 @@
</tr>
</tbody>
</table>



<h2>Summary</h2>
<table class="pane sortable">
<tr>
Expand All @@ -44,7 +43,21 @@
<td class="pane">${it.report.numberNoCategorySeverity}</td>
</tr>
</tbody>
</table>
</table>

<j:if test="${it.report.versions != null}">
<h2>Cppcheck Information</h2>
<table class="pane sortable">
<tr>
<td class="pane-header">Cppcheck Engine versions</td>
</tr>
<tbody>
<tr>
<td class="pane">${it.report.versions}</td>
</tr>
</tbody>
</table>
</j:if>

<st:include page="/tabview/main.jelly" />
</l:main-panel>
Expand Down

0 comments on commit 4fcb94a

Please sign in to comment.