Preparing report...

Report for github.com/ethersphere/bee

(v1.8.2)

A+    Excellent!    Found 80 issues across 619 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo87%

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.

    • pkg/localstore/mode_put.go
    • Line 67: warning: cyclomatic complexity 37 of function (*DB).put() is high (> 15) (gocyclo)
    • Line 270: warning: cyclomatic complexity 19 of function (*DB).putRequest() is high (> 15) (gocyclo)
    • Line 436: warning: cyclomatic complexity 18 of function (*DB).putSync() is high (> 15) (gocyclo)
    • cmd/bee/cmd/start.go
    • Line 50: warning: cyclomatic complexity 34 of function (*command).initStartCmd() is high (> 15) (gocyclo)
    • Line 330: warning: cyclomatic complexity 23 of function (*command).configureSigner() is high (> 15) (gocyclo)
    • pkg/pushsync/pushsync.go
    • Line 142: warning: cyclomatic complexity 31 of function (*PushSync).handler() is high (> 15) (gocyclo)
    • Line 337: warning: cyclomatic complexity 23 of function (*PushSync).pushToClosest() is high (> 15) (gocyclo)
    • pkg/pullsync/pullsync.go
    • Line 134: warning: cyclomatic complexity 26 of function (*Syncer).SyncInterval() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 19 of function (*Syncer).handler() is high (> 15) (gocyclo)
    • pkg/shed/vector_uint64_test.go
    • Line 27: warning: cyclomatic complexity 18 of function TestUint64Vector() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 16 of function TestUint64Vector_DecInBatch() is high (> 15) (gocyclo)
    • pkg/localstore/mode_set.go
    • Line 50: warning: cyclomatic complexity 22 of function (*DB).set() is high (> 15) (gocyclo)
    • Line 232: warning: cyclomatic complexity 16 of function (*DB).setRemove() is high (> 15) (gocyclo)
    • pkg/shed/index.go
    • Line 334: warning: cyclomatic complexity 21 of function (Index).Iterate() is high (> 15) (gocyclo)
    • Line 62: warning: cyclomatic complexity 17 of function (Item).Merge() is high (> 15) (gocyclo)
    • pkg/log/logger_test.go
    • Line 335: warning: cyclomatic complexity 29 of function TestLoggerWithCaller() is high (> 15) (gocyclo)
    • Line 843: warning: cyclomatic complexity 21 of function TestLoggerVerbosity() is high (> 15) (gocyclo)
    • pkg/file/buffer_test.go
    • Line 120: warning: cyclomatic complexity 16 of function TestCopyBuffer() is high (> 15) (gocyclo)
    • Line 44: warning: cyclomatic complexity 16 of function testChunkPipe() is high (> 15) (gocyclo)
    • pkg/topology/kademlia/kademlia.go
    • Line 466: warning: cyclomatic complexity 25 of function (*Kad).manage() is high (> 15) (gocyclo)
    • Line 921: warning: cyclomatic complexity 17 of function (*Kad).connect() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 16 of function (*Kad).connectionAttemptsHandler() is high (> 15) (gocyclo)
    • pkg/accounting/accounting_test.go
    • Line 1389: warning: cyclomatic complexity 27 of function TestAccountingCallPaymentErrorRetries() is high (> 15) (gocyclo)
    • Line 1042: warning: cyclomatic complexity 27 of function TestAccountingSurplusBalance() is high (> 15) (gocyclo)
    • Line 712: warning: cyclomatic complexity 27 of function TestAccountingCallSettlementMonetary() is high (> 15) (gocyclo)
    • Line 847: warning: cyclomatic complexity 25 of function TestAccountingCallSettlementTooSoon() is high (> 15) (gocyclo)
    • Line 594: warning: cyclomatic complexity 21 of function TestAccountingCallSettlement() is high (> 15) (gocyclo)
    • Line 401: warning: cyclomatic complexity 21 of function TestAccountingReserveAheadOfTime() is high (> 15) (gocyclo)
    • Line 173: warning: cyclomatic complexity 18 of function TestAccountingAddOriginatedBalance() is high (> 15) (gocyclo)
    • pkg/api/bzz.go
    • Line 262: warning: cyclomatic complexity 22 of function (*Service).serveReference() is high (> 15) (gocyclo)
    • Line 80: warning: cyclomatic complexity 21 of function (*Service).fileUploadHandler() is high (> 15) (gocyclo)
    • pkg/retrieval/retrieval_test.go
    • Line 261: warning: cyclomatic complexity 24 of function TestRetrievePreemptiveRetry() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 17 of function TestDelivery() is high (> 15) (gocyclo)
    • pkg/api/soc.go
    • Line 27: warning: cyclomatic complexity 24 of function (*Service).socUploadHandler() is high (> 15) (gocyclo)
    • pkg/api/chunk.go
    • Line 65: warning: cyclomatic complexity 20 of function (*Service).chunkUploadHandler() is high (> 15) (gocyclo)
    • pkg/topology/kademlia/kademlia_test.go
    • Line 205: warning: cyclomatic complexity 17 of function TestNeighborhoodDepthWithReachability() is high (> 15) (gocyclo)
    • Line 50: warning: cyclomatic complexity 17 of function TestNeighborhoodDepth() is high (> 15) (gocyclo)
    • pkg/pushsync/pushsync_test.go
    • Line 428: warning: cyclomatic complexity 17 of function TestPushChunkToClosestErrorAttemptRetry() is high (> 15) (gocyclo)
    • Line 301: warning: cyclomatic complexity 17 of function TestPushChunkToNextClosest() is high (> 15) (gocyclo)
    • pkg/localstore/gc_test.go
    • Line 981: warning: cyclomatic complexity 38 of function TestReserveEvictionWorker() is high (> 15) (gocyclo)
    • Line 809: warning: cyclomatic complexity 21 of function TestGC_NoEvictDirty() is high (> 15) (gocyclo)
    • Line 157: warning: cyclomatic complexity 20 of function TestPinGC() is high (> 15) (gocyclo)
    • Line 330: warning: cyclomatic complexity 19 of function TestDB_collectGarbageWorker_withRequests() is high (> 15) (gocyclo)
    • Line 56: warning: cyclomatic complexity 16 of function testDBCollectGarbageWorker() is high (> 15) (gocyclo)
    • Line 698: warning: cyclomatic complexity 16 of function TestPinSyncAndAccessPutSetChunkMultipleTimes() is high (> 15) (gocyclo)
    • pkg/p2p/libp2p/libp2p.go
    • Line 128: warning: cyclomatic complexity 25 of function New() is high (> 15) (gocyclo)
    • Line 340: warning: cyclomatic complexity 24 of function (*Service).handleIncoming() is high (> 15) (gocyclo)
    • Line 644: warning: cyclomatic complexity 21 of function (*Service).Connect() is high (> 15) (gocyclo)
    • pkg/shed/index_test.go
    • Line 54: warning: cyclomatic complexity 37 of function TestIndex() is high (> 15) (gocyclo)
    • Line 549: warning: cyclomatic complexity 27 of function TestIndex_IterateReverse() is high (> 15) (gocyclo)
    • Line 957: warning: cyclomatic complexity 25 of function TestIndex_IterateReverse_withPrefix() is high (> 15) (gocyclo)
    • Line 771: warning: cyclomatic complexity 25 of function TestIndex_Iterate_withPrefix() is high (> 15) (gocyclo)
    • Line 367: warning: cyclomatic complexity 22 of function TestIndex_Iterate() is high (> 15) (gocyclo)
    • Line 1153: warning: cyclomatic complexity 20 of function TestIndex_count() is high (> 15) (gocyclo)
    • pkg/localstore/reserve_test.go
    • Line 400: warning: cyclomatic complexity 37 of function TestDB_ReserveGC_EvictMaxPO() is high (> 15) (gocyclo)
    • Line 216: warning: cyclomatic complexity 35 of function TestDB_ReserveGC_Unreserve() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!