Skip to content

Commit

Permalink
slight fix for #311
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jan 4, 2022
1 parent 058e7e8 commit bc065ad
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
22 changes: 11 additions & 11 deletions SCC-OUTPUT-REPORT.html
Expand Up @@ -12,12 +12,12 @@
<tbody><tr>
<th>Go</th>
<th>36</th>
<th>9090</th>
<th>1443</th>
<th>9094</th>
<th>1445</th>
<th>429</th>
<th>7218</th>
<th>7220</th>
<th>1481</th>
<th>357991</th>
<th>358069</th>
</tr><tr>
<th>Java</th>
<th>24</th>
Expand All @@ -39,12 +39,12 @@
</tr><tr>
<th>Markdown</th>
<th>11</th>
<th>1347</th>
<th>1348</th>
<th>319</th>
<th>0</th>
<th>1028</th>
<th>1029</th>
<th>0</th>
<th>54838</th>
<th>54998</th>
</tr><tr>
<th>Python</th>
<th>10</th>
Expand Down Expand Up @@ -607,11 +607,11 @@
<tfoot><tr>
<th>Total</th>
<th>176</th>
<th>26940</th>
<th>3041</th>
<th>26945</th>
<th>3043</th>
<th>1765</th>
<th>22134</th>
<th>22137</th>
<th>2467</th>
<th>1815589</th>
<th>1815827</th>
</tr></tfoot>
</table></body></html>
28 changes: 16 additions & 12 deletions processor/formatters.go
Expand Up @@ -333,17 +333,7 @@ func toCSVSummary(input chan *FileJob) string {
}

func toCSVFiles(input chan *FileJob) string {
records := [][]string{{
"Language",
"Location",
"Filename",
"Lines",
"Code",
"Comments",
"Blanks",
"Complexity",
"Bytes"},
}
records := [][]string{}

for result := range input {
records = append(records, []string{
Expand Down Expand Up @@ -411,9 +401,23 @@ func toCSVFiles(input chan *FileJob) string {
})
}

recordsEnd := [][]string{{
"Language",
"Location",
"Filename",
"Lines",
"Code",
"Comments",
"Blanks",
"Complexity",
"Bytes"},
}

recordsEnd = append(recordsEnd, records...)

b := &bytes.Buffer{}
w := csv.NewWriter(b)
_ = w.WriteAll(records)
_ = w.WriteAll(recordsEnd)
w.Flush()

return b.String()
Expand Down

0 comments on commit bc065ad

Please sign in to comment.