Skip to content

Commit

Permalink
Merge pull request #2 from boyter/master
Browse files Browse the repository at this point in the history
update code
  • Loading branch information
foxdd committed Jul 17, 2021
2 parents a9f1b58 + 6130432 commit e752e09
Show file tree
Hide file tree
Showing 20 changed files with 176 additions and 91 deletions.
2 changes: 1 addition & 1 deletion LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Verilog (vg,vh,v)
Verilog Args File (irunargs,xrunargs)
Vertex Shader File (vsh)
VHDL (vhd,vhdl)
Vim Script (vim)
Vim Script (vim,vimrc,gvimrc,_vimrc,.vimrc,_gvimrc,.gvimrc,vimrc,gvimrc)
Visual Basic (vb)
Visual Basic for Applications (cls)
Vue (vue)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ import (
"fmt"
"io/ioutil"
"github.com/boyter/scc/processor"
"github.com/boyter/scc/v3/processor"
)
type statsProcessor struct{}
Expand Down
147 changes: 87 additions & 60 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
</tr></thead>
<tbody><tr>
<th>Go</th>
<th>34</th>
<th>8548</th>
<th>1396</th>
<th>398</th>
<th>6754</th>
<th>1392</th>
<th>335679</th>
<th>43</th>
<th>8670</th>
<th>1437</th>
<th>404</th>
<th>6829</th>
<th>1377</th>
<th>337105</th>
</tr><tr>
<th>Java</th>
<th>24</th>
Expand All @@ -39,21 +39,21 @@
</tr><tr>
<th>Markdown</th>
<th>11</th>
<th>1275</th>
<th>309</th>
<th>1282</th>
<th>312</th>
<th>0</th>
<th>966</th>
<th>970</th>
<th>0</th>
<th>52209</th>
<th>52379</th>
</tr><tr>
<th>Python</th>
<th>9</th>
<th>350</th>
<th>20</th>
<th>20</th>
<th>310</th>
<th>32</th>
<th>10072</th>
<th>10</th>
<th>368</th>
<th>31</th>
<th>198</th>
<th>139</th>
<th>53</th>
<th>10706</th>
</tr><tr>
<th>CSS</th>
<th>5</th>
Expand All @@ -74,13 +74,13 @@
<th>3425</th>
</tr><tr>
<th>YAML</th>
<th>4</th>
<th>78</th>
<th>5</th>
<th>482</th>
<th>13</th>
<th>20</th>
<th>45</th>
<th>21</th>
<th>448</th>
<th>0</th>
<th>2153</th>
<th>7372</th>
</tr><tr>
<th>gitignore</th>
<th>4</th>
Expand All @@ -93,21 +93,39 @@
</tr><tr>
<th>Shell</th>
<th>3</th>
<th>1073</th>
<th>142</th>
<th>84</th>
<th>847</th>
<th>1084</th>
<th>144</th>
<th>86</th>
<th>854</th>
<th>94</th>
<th>38597</th>
<th>39018</th>
</tr><tr>
<th>C#</th>
<th>2</th>
<th>623</th>
<th>58</th>
<th>73</th>
<th>492</th>
<th>26</th>
<th>83</th>
<th>130</th>
<th>410</th>
<th>45</th>
<th>19739</th>
</tr><tr>
<th>HTML</th>
<th>2</th>
<th>1216</th>
<th>0</th>
<th>0</th>
<th>1216</th>
<th>0</th>
<th>17758</th>
</tr><tr>
<th>JSON</th>
<th>2</th>
<th>7230</th>
<th>0</th>
<th>0</th>
<th>7230</th>
<th>0</th>
<th>110403</th>
</tr><tr>
<th>JavaServer Pages</th>
<th>2</th>
Expand Down Expand Up @@ -207,6 +225,15 @@
<th>139</th>
<th>1</th>
<th>6900</th>
</tr><tr>
<th>C</th>
<th>1</th>
<th>0</th>
<th>0</th>
<th>0</th>
<th>0</th>
<th>0</th>
<th>0</th>
</tr><tr>
<th>C Header</th>
<th>1</th>
Expand All @@ -225,6 +252,15 @@
<th>1</th>
<th>0</th>
<th>6</th>
</tr><tr>
<th>CSV</th>
<th>1</th>
<th>66</th>
<th>0</th>
<th>0</th>
<th>66</th>
<th>0</th>
<th>1754</th>
</tr><tr>
<th>Clojure</th>
<th>1</th>
Expand Down Expand Up @@ -360,24 +396,6 @@
<th>10</th>
<th>0</th>
<th>245</th>
</tr><tr>
<th>HTML</th>
<th>1</th>
<th>581</th>
<th>0</th>
<th>0</th>
<th>581</th>
<th>0</th>
<th>8510</th>
</tr><tr>
<th>JSON</th>
<th>1</th>
<th>7206</th>
<th>0</th>
<th>0</th>
<th>7206</th>
<th>0</th>
<th>100328</th>
</tr><tr>
<th>Korn Shell</th>
<th>1</th>
Expand Down Expand Up @@ -459,6 +477,15 @@
<th>0</th>
<th>0</th>
<th>0</th>
</tr><tr>
<th>SQL</th>
<th>1</th>
<th>204</th>
<th>0</th>
<th>0</th>
<th>204</th>
<th>0</th>
<th>23687</th>
</tr><tr>
<th>Sieve</th>
<th>1</th>
Expand Down Expand Up @@ -526,9 +553,9 @@
<th>Wren</th>
<th>1</th>
<th>188</th>
<th>22</th>
<th>35</th>
<th>131</th>
<th>26</th>
<th>37</th>
<th>125</th>
<th>8</th>
<th>3544</th>
</tr><tr>
Expand Down Expand Up @@ -570,12 +597,12 @@
</tr></tbody>
<tfoot><tr>
<th>Total</th>
<th>168</th>
<th>25795</th>
<th>2957</th>
<th>1718</th>
<th>21120</th>
<th>2343</th>
<th>1779796</th>
<th>184</th>
<th>27286</th>
<th>3043</th>
<th>1964</th>
<th>22279</th>
<th>2368</th>
<th>1832430</th>
</tr></tfoot>
</table></body></html>
Empty file added examples/ignore/ignorefile.txt
Empty file.
Empty file added examples/issue260/test.c
Empty file.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/boyter/scc
module github.com/boyter/scc/v3

go 1.14

Expand Down
56 changes: 52 additions & 4 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,39 @@
],
"multi_line": [],
"quotes": []
},
"APL": {
"complexitychecks": [
":For ",
":If ",
":Case ",
":CaseList ",
":While ",
":Repeat ",
":Else ",
"",
"",
"",
"~",
"¨",
"="
],
"extensions": [
"apl",
"aplf",
"apln",
"aplc"
],
"line_comment": [
""
],
"multi_line": [],
"quotes": [
{
"end": "'",
"start": "'"
}
]
},
"ASP": {
"complexitychecks": [
Expand Down Expand Up @@ -2440,6 +2473,8 @@
},
"Go": {
"complexitychecks": [
"go ",
"defer ",
"for ",
"for(",
"if ",
Expand Down Expand Up @@ -4838,15 +4873,28 @@
"complexitychecks": [
"for ",
"for(",
"while ",
"while(",
"if ",
"if(",
"switch ",
"while ",
"elif ",
"elif(",
"else ",
"else:",
"match ",
"match(",
"try ",
"try:",
"except ",
"except(",
"finally ",
"finally:",
"with ",
"with (",
"and ",
"and(",
"or ",
"not ",
"in "
"or("
],
"extensions": [
"py"
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main

import (
"fmt"
"github.com/boyter/scc/processor"
"github.com/boyter/scc/v3/processor"
"github.com/spf13/cobra"
"os"
)
Expand Down
2 changes: 1 addition & 1 deletion processor/bloom.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func BloomHash(b byte) uint64 {
// filter.
var hash uint64
for i := uint64(0); i < 3; i++ {
n := k >> (i*8) & mask64
n := k >> (i * 8) & mask64
hash |= 1 << n
}

Expand Down
2 changes: 1 addition & 1 deletion processor/constants.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion processor/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"sync"

"github.com/boyter/scc/processor/gitignore"
"github.com/boyter/scc/v3/processor/gitignore"
"github.com/dbaggerman/cuba"
)

Expand Down
2 changes: 1 addition & 1 deletion processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ func Process() {
if FileOutput == "" {
fmt.Println(result)
} else {
_ = ioutil.WriteFile(FileOutput, []byte(result), 0600)
_ = ioutil.WriteFile(FileOutput, []byte(result), 0644)
fmt.Println("results written to " + FileOutput)
}
}
2 changes: 1 addition & 1 deletion processor/state_blank.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package processor

type StateBlank struct {}
type StateBlank struct{}

func (state *StateBlank) String() string {
return "blank"
Expand Down
2 changes: 1 addition & 1 deletion processor/state_code.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package processor

type StateCode struct {}
type StateCode struct{}

func (state *StateCode) String() string {
return "code"
Expand Down
2 changes: 1 addition & 1 deletion processor/state_comment_multi.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package processor

type StateCommentMulti struct {
Stack [][]byte
Stack [][]byte
}

func (state *StateCommentMulti) String() string {
Expand Down
Loading

0 comments on commit e752e09

Please sign in to comment.