Preparing report...

Report for github.com/esrrhs/go-cpuminer

A    Great!    Found 13 issues across 14 files

Tweet

gofmt85%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo92%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • go-cpuminer/algo.go
    • Line 137: warning: cyclomatic complexity 31 of function (*Algorithm).family() is high (> 15) (gocyclo)
    • Line 209: warning: cyclomatic complexity 20 of function (*Algorithm).supportAlgoName() is high (> 15) (gocyclo)

golint7%

Golint is a linter for Go source code.

    • go-cpuminer/proto.go
    • Line 5: warning: exported type JSONRpcReq should have comment or be unexported (golint)
    • Line 12: warning: exported type LoginParam should have comment or be unexported (golint)
    • Line 19: warning: exported type SubmitParam should have comment or be unexported (golint)
    • Line 27: warning: exported type HBParam should have comment or be unexported (golint)
    • Line 33: warning: exported type JSONRpcRsp should have comment or be unexported (golint)
    • Line 42: warning: exported type ErrorReply should have comment or be unexported (golint)
    • Line 47: warning: exported type JobReply should have comment or be unexported (golint)
    • Line 54: warning: exported type JobReplyData should have comment or be unexported (golint)
    • go-cpuminer/stratum.go
    • Line 16: warning: exported type Stratum should have comment or be unexported (golint)
    • Line 26: warning: don't use underscores in Go names; struct field ext_algo should be extAlgo (golint)
    • Line 27: warning: don't use underscores in Go names; struct field ext_nicehash should be extNicehash (golint)
    • Line 28: warning: don't use underscores in Go names; struct field ext_connect should be extConnect (golint)
    • Line 29: warning: don't use underscores in Go names; struct field ext_keepalive should be extKeepalive (golint)
    • Line 40: warning: exported function NewStratum should have comment or be unexported (golint)
    • Line 63: warning: exported method Stratum.Reconnect should have comment or be unexported (golint)
    • Line 356: warning: don't use underscores in Go names; var nonce_bytes should be nonceBytes (golint)
    • Line 358: warning: don't use underscores in Go names; var nonce_str should be nonceStr (golint)
    • Line 365: warning: don't use underscores in Go names; var hash_str should be hashStr (golint)
    • go-cpuminer/worker.go
    • Line 16: warning: exported type Worker should have comment or be unexported (golint)
    • Line 23: warning: exported function NewWorker should have comment or be unexported (golint)
    • go-cpuminer/algo.go
    • Line 6: warning: exported const INVALID should have comment (or a comment on this block) or be unexported (golint)
    • Line 7: warning: don't use underscores in Go names; const CN_0 should be CN0 (golint)
    • Line 8: warning: don't use underscores in Go names; const CN_1 should be CN1 (golint)
    • Line 9: warning: don't use underscores in Go names; const CN_2 should be CN2 (golint)
    • Line 10: warning: don't use underscores in Go names; const CN_R should be CNR (golint)
    • Line 26: warning: don't use underscores in Go names; const RX_0 should be RX0 (golint)
    • Line 40: warning: exported const UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: exported type AlgoName should have comment or be unexported (golint)
    • Line 57: warning: don't use underscores in Go names; var algorithm_names should be algorithmNames (golint)
    • Line 124: warning: exported type Algorithm should have comment or be unexported (golint)
    • Line 128: warning: exported function NewAlgorithm should have comment or be unexported (golint)
    • go-cpuminer/nonce.go
    • Line 5: warning: exported type Nonce should have comment or be unexported (golint)
    • Line 33: warning: don't use underscores in Go names; var ret_nonce0 should be retNonce0 (golint)
    • Line 34: warning: don't use underscores in Go names; var ret_nonce1 should be retNonce1 (golint)
    • go-cpuminer/tester.go
    • Line 14: warning: exported const TEST_BLOB should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type Tester should have comment or be unexported (golint)
    • Line 24: warning: exported function NewTester should have comment or be unexported (golint)
    • Line 43: warning: exported method Tester.Stop should have comment or be unexported (golint)
    • Line 47: warning: exported method Tester.Run should have comment or be unexported (golint)
    • go-cpuminer/workerjob.go
    • Line 5: warning: exported type WorkerJob should have comment or be unexported (golint)
    • Line 8: warning: don't use underscores in Go names; struct field nonce_mask should be nonceMask (golint)
    • go-cpuminer/benchmark.go
    • Line 10: warning: exported type Benchmark should have comment or be unexported (golint)
    • Line 15: warning: exported function NewBenchmark should have comment or be unexported (golint)
    • Line 42: warning: exported method Benchmark.Stop should have comment or be unexported (golint)
    • Line 46: warning: exported method Benchmark.Run should have comment or be unexported (golint)
    • Line 48: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • go-cpuminer/miner.go
    • Line 11: warning: exported type Miner should have comment or be unexported (golint)
    • Line 26: warning: exported function NewMiner should have comment or be unexported (golint)
    • Line 57: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 79: warning: exported method Miner.Stop should have comment or be unexported (golint)
    • Line 83: warning: exported method Miner.Run should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!