Skip to content

Commit

Permalink
Fix for issue 552
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Oct 29, 2024
1 parent b2631d8 commit 10b0f6d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
38 changes: 19 additions & 19 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<tbody><tr>
<th>Go</th>
<th>27</th>
<th>9577</th>
<th>1461</th>
<th>9578</th>
<th>1462</th>
<th>447</th>
<th>7669</th>
<th>1413</th>
<th>254907</th>
<th>254983</th>
<th>4126</th>
</tr><tr>
<td>processor/workers_test.go</td>
Expand Down Expand Up @@ -53,12 +53,12 @@
</tr><tr>
<td>processor/workers.go</td>
<td></td>
<td>870</td>
<td>128</td>
<td>871</td>
<td>129</td>
<td>91</td>
<td>651</td>
<td>225</td>
<td>25495</td>
<td>25571</td>
<td>494</td>
</tr><tr>
<td>processor/processor.go</td>
Expand Down Expand Up @@ -240,16 +240,6 @@
<td>0</td>
<td>2209</td>
<td>35</td>
</tr><tr>
<td>processor/cocomo_test.go</td>
<td></td>
<td>37</td>
<td>8</td>
<td>4</td>
<td>25</td>
<td>6</td>
<td>686</td>
<td>23</td>
</tr><tr>
<td>processor/bloom.go</td>
<td></td>
Expand All @@ -260,6 +250,16 @@
<td>2</td>
<td>1062</td>
<td>29</td>
</tr><tr>
<td>processor/cocomo_test.go</td>
<td></td>
<td>37</td>
<td>8</td>
<td>4</td>
<td>25</td>
<td>6</td>
<td>686</td>
<td>23</td>
</tr><tr>
<td>processor/helpers_test.go</td>
<td></td>
Expand Down Expand Up @@ -294,12 +294,12 @@
<tfoot><tr>
<th>Total</th>
<th>27</th>
<th>9577</th>
<th>1461</th>
<th>9578</th>
<th>1462</th>
<th>447</th>
<th>7669</th>
<th>1413</th>
<th>254907</th>
<th>254983</th>
<th>4126</th>
</tr>
<tr>
Expand Down
2 changes: 2 additions & 0 deletions examples/issue552/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- line 1
- line 2
7 changes: 4 additions & 3 deletions processor/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,14 @@ func CountStats(fileJob *FileJob) {

if UlocMode && Files {
uloc := map[string]struct{}{}
for _, l := range strings.Split(string(fileJob.Content), "\n") {
for _, l := range strings.Split(strings.TrimRight(string(fileJob.Content), "\n"), "\n") {
uloc[l] = struct{}{}
}
fileJob.Uloc = len(uloc)
}

if MaxMean {
for _, l := range strings.Split(string(fileJob.Content), "\n") {
for _, l := range strings.Split(strings.TrimRight(string(fileJob.Content), "\n"), "\n") {
fileJob.LineLength = append(fileJob.LineLength, len(l))
}
}
Expand Down Expand Up @@ -802,7 +802,8 @@ func processFile(job *FileJob) bool {
// avoiding inflating the counts
if UlocMode {
ulocMutex.Lock()
for _, l := range strings.Split(string(job.Content), "\n") {

for _, l := range strings.Split(strings.TrimRight(string(job.Content), "\n"), "\n") {
ulocGlobalCount[l] = struct{}{}

_, ok := ulocLanguageCount[job.Language]
Expand Down

0 comments on commit 10b0f6d

Please sign in to comment.