Skip to content

Commit

Permalink
cflint#330 - Added files counts and timestamp to DefaultCFLintResultM…
Browse files Browse the repository at this point in the history
…arshaller to make it functionally equivalent with XMLOutput
  • Loading branch information
TheRealAgentK committed Jul 2, 2017
1 parent d2d2488 commit 6250929
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ public void output(BugList bugList, Writer writer, CFLintStats stats) throws Mar
private void writeIssues(BugList bugList, XMLStreamWriter xtw, CFLintStats stats) throws XMLStreamException {
xtw.writeStartElement("issues");
xtw.writeAttribute("version", Version.getVersion());
xtw.writeAttribute("timestamp", Long.toString(stats.getTimestamp()));

BugCounts counts = stats.getCounts();

for (BugInfo bug : bugList) {
writeIssue(xtw, bug);
}

writeCounts(xtw, counts);
writeCounts(xtw, counts, stats);

xtw.writeEndElement();
}

private void writeCounts(XMLStreamWriter xtw, BugCounts counts) throws XMLStreamException {
private void writeCounts(XMLStreamWriter xtw, BugCounts counts, CFLintStats stats) throws XMLStreamException {
xtw.writeStartElement("counts");
xtw.writeAttribute("totalfiles", Long.toString(stats.getFileCount()));
xtw.writeAttribute("totalsize", stats.getTotalSize().toString());

for (String code : counts.bugTypes()) {
xtw.writeStartElement("count");
Expand Down

0 comments on commit 6250929

Please sign in to comment.