Preparing report...

Report for github.com/hello2mao/go-common

A+    Excellent!    Found 37 issues across 116 files

Tweet

gofmt87%

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!


gocyclo96%

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-common/incubator/clock/clock_test.go
    • Line 134: warning: cyclomatic complexity 37 of function TestFakeTimer() is high (> 15) (gocyclo)
    • Line 236: warning: cyclomatic complexity 23 of function TestFakeTick() is high (> 15) (gocyclo)
    • Line 76: warning: cyclomatic complexity 19 of function TestFakeAfter() is high (> 15) (gocyclo)

golint81%

Golint is a linter for Go source code.

    • go-common/stable/csp/sw/new.go
    • Line 25: warning: comment on exported function NewDefaultSecurityLevelWithKeystore should be of the form "NewDefaultSecurityLevelWithKeystore ..." (golint)
    • go-common/incubator/event/example/scope/scope.go
    • Line 30: warning: comment on exported type App should be of the form "App ..." (with optional leading article) (golint)
    • Line 38: warning: exported method App.Calc should have comment or be unexported (golint)
    • Line 49: warning: comment on exported method App.SubscribeResults should be of the form "SubscribeResults ..." (golint)
    • go-common/stable/wait/wait.go
    • Line 15: warning: comment on exported var ForeverTestTimeout should be of the form "ForeverTestTimeout ..." (golint)
    • Line 32: warning: exported method Group.Wait should have comment or be unexported (golint)
    • go-common/stable/csp/mocks/mocks.go
    • Line 13: warning: exported type MockCSP should have comment or be unexported (golint)
    • Line 36: warning: exported method MockCSP.KeyGen should have comment or be unexported (golint)
    • Line 40: warning: exported method MockCSP.KeyDeriv should have comment or be unexported (golint)
    • Line 44: warning: exported method MockCSP.KeyImport should have comment or be unexported (golint)
    • Line 48: warning: exported method MockCSP.GetKey should have comment or be unexported (golint)
    • Line 52: warning: exported method MockCSP.Hash should have comment or be unexported (golint)
    • Line 56: warning: exported method MockCSP.GetHash should have comment or be unexported (golint)
    • Line 60: warning: exported method MockCSP.Sign should have comment or be unexported (golint)
    • Line 60: warning: receiver name b should be consistent with previous receiver name m for MockCSP (golint)
    • Line 74: warning: exported method MockCSP.Verify should have comment or be unexported (golint)
    • Line 74: warning: receiver name b should be consistent with previous receiver name m for MockCSP (golint)
    • Line 89: warning: exported method MockCSP.Encrypt should have comment or be unexported (golint)
    • Line 92: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 97: warning: exported method MockCSP.Decrypt should have comment or be unexported (golint)
    • Line 100: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 105: warning: exported type MockKey should have comment or be unexported (golint)
    • Line 114: warning: exported method MockKey.Bytes should have comment or be unexported (golint)
    • Line 118: warning: exported method MockKey.SKI should have comment or be unexported (golint)
    • Line 122: warning: exported method MockKey.Symmetric should have comment or be unexported (golint)
    • Line 126: warning: exported method MockKey.Private should have comment or be unexported (golint)
    • Line 130: warning: exported method MockKey.PublicKey should have comment or be unexported (golint)
    • Line 134: warning: exported type SignerOpts should have comment or be unexported (golint)
    • Line 138: warning: exported method SignerOpts.HashFunc should have comment or be unexported (golint)
    • Line 142: warning: exported type KeyGenOpts should have comment or be unexported (golint)
    • Line 146: warning: exported method KeyGenOpts.Algorithm should have comment or be unexported (golint)
    • Line 150: warning: exported method KeyGenOpts.Ephemeral should have comment or be unexported (golint)
    • Line 154: warning: exported type KeyStore should have comment or be unexported (golint)
    • Line 160: warning: exported method KeyStore.ReadOnly should have comment or be unexported (golint)
    • Line 164: warning: exported method KeyStore.GetKey should have comment or be unexported (golint)
    • Line 168: warning: exported method KeyStore.StoreKey should have comment or be unexported (golint)
    • Line 172: warning: exported type KeyImportOpts should have comment or be unexported (golint)
    • Line 174: warning: exported method KeyImportOpts.Algorithm should have comment or be unexported (golint)
    • Line 178: warning: exported method KeyImportOpts.Ephemeral should have comment or be unexported (golint)
    • Line 182: warning: exported type EncrypterOpts should have comment or be unexported (golint)
    • Line 183: warning: exported type DecrypterOpts should have comment or be unexported (golint)
    • Line 185: warning: exported type HashOpts should have comment or be unexported (golint)
    • Line 187: warning: exported method HashOpts.Algorithm should have comment or be unexported (golint)
    • Line 191: warning: exported type KeyDerivOpts should have comment or be unexported (golint)
    • Line 195: warning: exported method KeyDerivOpts.Algorithm should have comment or be unexported (golint)
    • Line 199: warning: exported method KeyDerivOpts.Ephemeral should have comment or be unexported (golint)
    • go-common/stable/singleton/singleton.go
    • Line 8: warning: exported type SingletonInitFunc should have comment or be unexported (golint)
    • Line 10: warning: comment on exported type Singleton should be of the form "Singleton ..." (with optional leading article) (golint)
    • Line 26: warning: comment on exported function NewSingleton should be of the form "NewSingleton ..." (golint)
    • go-common/stable/csp/utils/ecdsa.go
    • Line 12: warning: exported type ECDSASignature should have comment or be unexported (golint)
    • Line 29: warning: exported function GetCurveHalfOrdersAt should have comment or be unexported (golint)
    • Line 33: warning: exported function MarshalECDSASignature should have comment or be unexported (golint)
    • Line 37: warning: exported function UnmarshalECDSASignature should have comment or be unexported (golint)
    • Line 63: warning: exported function SignatureToLowS should have comment or be unexported (golint)
    • Line 81: warning: comment on exported function IsLowS should be of the form "IsLowS ..." (golint)
    • Line 92: warning: exported function ToLowS should have comment or be unexported (golint)
    • go-common/incubator/kvdb/memorydb/memorydb.go
    • Line 34: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 102: warning: exported method Database.NewBatch should have comment or be unexported (golint)
    • Line 106: warning: exported method Database.NewIterator should have comment or be unexported (golint)
    • Line 110: warning: exported method Database.Stat should have comment or be unexported (golint)
    • go-common/stable/csp/sw/mocks/mocks.go
    • Line 11: warning: exported type Encryptor should have comment or be unexported (golint)
    • Line 20: warning: exported method Encryptor.Encrypt should have comment or be unexported (golint)
    • Line 34: warning: exported type Decryptor should have comment or be unexported (golint)
    • Line 37: warning: exported method Decryptor.Decrypt should have comment or be unexported (golint)
    • Line 41: warning: exported type Signer should have comment or be unexported (golint)
    • Line 50: warning: exported method Signer.Sign should have comment or be unexported (golint)
    • Line 64: warning: exported type Verifier should have comment or be unexported (golint)
    • Line 74: warning: exported method Verifier.Verify should have comment or be unexported (golint)
    • Line 91: warning: exported type Hasher should have comment or be unexported (golint)
    • Line 100: warning: exported method Hasher.Hash should have comment or be unexported (golint)
    • Line 111: warning: exported method Hasher.GetHash should have comment or be unexported (golint)
    • Line 119: warning: exported type KeyGenerator should have comment or be unexported (golint)
    • Line 126: warning: exported method KeyGenerator.KeyGen should have comment or be unexported (golint)
    • Line 134: warning: exported type KeyDeriver should have comment or be unexported (golint)
    • Line 142: warning: exported method KeyDeriver.KeyDeriv should have comment or be unexported (golint)
    • Line 153: warning: exported type KeyImporter should have comment or be unexported (golint)
    • Line 161: warning: exported method KeyImporter.KeyImport should have comment or be unexported (golint)
    • go-common/stable/csp/factory/swfactory.go
    • Line 64: warning: comment on exported type FileKeystoreOpts should be of the form "FileKeystoreOpts ..." (with optional leading article) (golint)
    • Line 69: warning: exported type DummyKeystoreOpts should have comment or be unexported (golint)
    • go-common/incubator/kvdb/leveldb/leveldb.go
    • Line 7: warning: exported type Database should have comment or be unexported (golint)
    • Line 11: warning: exported function Open should have comment or be unexported (golint)
    • Line 15: warning: exported method Database.Close should have comment or be unexported (golint)
    • Line 19: warning: exported method Database.Has should have comment or be unexported (golint)
    • Line 23: warning: exported method Database.Get should have comment or be unexported (golint)
    • Line 27: warning: exported method Database.Put should have comment or be unexported (golint)
    • Line 31: warning: exported method Database.Delete should have comment or be unexported (golint)
    • Line 35: warning: exported method Database.NewBatch should have comment or be unexported (golint)
    • Line 39: warning: exported method Database.NewIterator should have comment or be unexported (golint)
    • Line 43: warning: exported method Database.Stat should have comment or be unexported (golint)
    • go-common/stable/csp/opts.go
    • Line 10: warning: comment on exported const ECDSAP256 should be of the form "ECDSAP256 ..." (golint)
    • Line 13: warning: comment on exported const ECDSAP384 should be of the form "ECDSAP384 ..." (golint)
    • Line 23: warning: comment on exported const AES128 should be of the form "AES128 ..." (golint)
    • Line 25: warning: comment on exported const AES192 should be of the form "AES192 ..." (golint)
    • Line 27: warning: comment on exported const AES256 should be of the form "AES256 ..." (golint)
    • Line 45: warning: comment on exported const SHA256 should be of the form "SHA256 ..." (golint)
    • Line 47: warning: comment on exported const SHA384 should be of the form "SHA384 ..." (golint)
    • Line 49: warning: comment on exported const SHA3_256 should be of the form "SHA3_256 ..." (golint)
    • Line 51: warning: comment on exported const SHA3_384 should be of the form "SHA3_384 ..." (golint)
    • go-common/stable/csp/sw/aes.go
    • Line 139: warning: comment on exported function AESCBCPKCS7EncryptWithRand should be of the form "AESCBCPKCS7EncryptWithRand ..." (golint)
    • Line 148: warning: comment on exported function AESCBCPKCS7EncryptWithIV should be of the form "AESCBCPKCS7EncryptWithIV ..." (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!


misspell97%

Misspell Finds commonly misspelled English words