Preparing report...

Report for github.com/companyzero/zkc

A+    Excellent!    Found 30 issues across 58 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!


gocyclo77%

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.

    • zkc/ratchet/ratchet_test.go
    • Line 343: warning: cyclomatic complexity 23 of function TestDiskState() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 16 of function testScript() is high (> 15) (gocyclo)
    • zkc/ratchet/ratchet.go
    • Line 582: warning: cyclomatic complexity 22 of function (*Ratchet).Unmarshal() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 16 of function (*Ratchet).Decrypt() is high (> 15) (gocyclo)
    • zkc/zkclient/mainwindow.go
    • Line 354: warning: cyclomatic complexity 78 of function (*mainWindow).action() is high (> 15) (gocyclo)
    • Line 160: warning: cyclomatic complexity 24 of function (*mainWindow).KeyHandler() is high (> 15) (gocyclo)
    • zkc/zkclient/push.go
    • Line 399: warning: cyclomatic complexity 54 of function (*ZKC).handlePush() is high (> 15) (gocyclo)
    • Line 162: warning: cyclomatic complexity 19 of function (*ZKC).step2IDKX() is high (> 15) (gocyclo)
    • Line 293: warning: cyclomatic complexity 16 of function (*ZKC).step2IDKX2() is high (> 15) (gocyclo)
    • Line 54: warning: cyclomatic complexity 16 of function (*ZKC).step3IDKX() is high (> 15) (gocyclo)
    • zkc/zkclient/msg.go
    • Line 253: warning: cyclomatic complexity 28 of function (*ZKC).compress() is high (> 15) (gocyclo)
    • Line 45: warning: cyclomatic complexity 25 of function (*ZKC).scheduler() is high (> 15) (gocyclo)
    • Line 365: warning: cyclomatic complexity 16 of function (*ZKC).crpc() is high (> 15) (gocyclo)
    • zkc/zkserver/zkserver.go
    • Line 336: warning: cyclomatic complexity 38 of function (*ZKS).handleSession() is high (> 15) (gocyclo)
    • Line 862: warning: cyclomatic complexity 21 of function _main() is high (> 15) (gocyclo)
    • Line 592: warning: cyclomatic complexity 18 of function (*ZKS).preSession() is high (> 15) (gocyclo)
    • zkc/zkclient/zkclient.go
    • Line 1186: warning: cyclomatic complexity 55 of function (*ZKC).handleRPC() is high (> 15) (gocyclo)
    • Line 2052: warning: cyclomatic complexity 40 of function _main() is high (> 15) (gocyclo)
    • Line 776: warning: cyclomatic complexity 35 of function (*ZKC).welcomePhase() is high (> 15) (gocyclo)

golint60%

Golint is a linter for Go source code.

    • zkc/blobshare/blobshare.go
    • Line 22: warning: exported function SetNrp should have comment or be unexported (golint)
    • Line 34: warning: exported function NewKey should have comment or be unexported (golint)
    • Line 53: warning: exported function DeriveKey should have comment or be unexported (golint)
    • Line 65: warning: exported function PackSaltNonce should have comment or be unexported (golint)
    • Line 75: warning: exported function UnpackSaltNonce should have comment or be unexported (golint)
    • Line 91: warning: exported function PackNonce should have comment or be unexported (golint)
    • Line 100: warning: exported function UnpackNonce should have comment or be unexported (golint)
    • Line 110: warning: exported function Encrypt should have comment or be unexported (golint)
    • Line 125: warning: exported function Decrypt should have comment or be unexported (golint)
    • zkc/tagstack/tagstack.go
    • Line 5: warning: package comment should be of the form "Package tagstack ..." (golint)
    • Line 20: warning: exported var ErrOverflow should have comment or be unexported (golint)
    • zkc/inidb/inidb.go
    • Line 5: warning: package comment should be of the form "Package inidb ..." (golint)
    • Line 30: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • zkc/debug/debug.go
    • Line 18: warning: exported var ErrNoSubystems should have comment or be unexported (golint)
    • Line 22: warning: exported type Debug should have comment or be unexported (golint)
    • Line 31: warning: exported method Debug.Log should have comment or be unexported (golint)
    • Line 36: warning: exported method Debug.Info should have comment or be unexported (golint)
    • Line 40: warning: exported method Debug.Warn should have comment or be unexported (golint)
    • Line 48: warning: exported method Debug.Critical should have comment or be unexported (golint)
    • Line 52: warning: exported method Debug.Dbg should have comment or be unexported (golint)
    • Line 61: warning: exported method Debug.T should have comment or be unexported (golint)
    • Line 92: warning: exported function New should have comment or be unexported (golint)
    • Line 109: warning: exported method Debug.Register should have comment or be unexported (golint)
    • Line 121: warning: exported method Debug.EnableDebug should have comment or be unexported (golint)
    • Line 128: warning: exported method Debug.DisableDebug should have comment or be unexported (golint)
    • Line 135: warning: exported method Debug.EnableTrace should have comment or be unexported (golint)
    • Line 142: warning: exported method Debug.DisableTrace should have comment or be unexported (golint)
    • zkc/zkclient/mainwindow.go
    • Line 44: warning: exported var REDBOLD should have its own declaration (golint)
    • Line 45: warning: exported var MAGENTABOLD should have comment or be unexported (golint)
    • Line 48: warning: exported var STATUSCYAN should have its own declaration (golint)
    • Line 512: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 733: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • zkc/session/kx.go
    • Line 23: warning: exported var ErrDecrypt should have comment or be unexported (golint)
    • Line 98: warning: exported type Printable should have comment or be unexported (golint)
    • Line 109: warning: exported function D should have comment or be unexported (golint)
    • Line 115: warning: exported method KX.SetWriteDeadline should have comment or be unexported (golint)
    • Line 119: warning: exported method KX.SetReadDeadline should have comment or be unexported (golint)
    • Line 123: warning: exported method KX.Close should have comment or be unexported (golint)
    • Line 127: warning: exported method KX.TheirIdentity should have comment or be unexported (golint)
    • zkc/tools/tools.go
    • Line 20: warning: exported const ZKSIdentityFilename should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported type ServerRecord should have comment or be unexported (golint)
    • Line 34: warning: exported type ClientRecord should have comment or be unexported (golint)
    • Line 70: warning: exported function Fingerprint should have comment or be unexported (golint)
    • Line 77: warning: exported function FingerprintDER should have comment or be unexported (golint)
    • Line 85: warning: exported function InFours should have comment or be unexported (golint)
    • zkc/zkutil/zkutil.go
    • Line 77: warning: exported const DefaultZKClientDir should have comment (or a comment on this block) or be unexported (golint)
    • Line 83: warning: exported function DefaultClientRootPath should have comment or be unexported (golint)
    • Line 91: warning: exported function DefaultServerRootPath should have comment or be unexported (golint)
    • zkc/ratchet/ratchet.go
    • Line 94: warning: exported function New should have comment or be unexported (golint)
    • Line 103: warning: exported type KeyExchange should have comment or be unexported (golint)
    • Line 408: warning: exported method Ratchet.Decrypt should have comment or be unexported (golint)
    • Line 531: warning: exported method Ratchet.Marshal should have comment or be unexported (golint)
    • Line 580: warning: error var badSerialisedKeyLengthErr should have name of the form errFoo (golint)
    • Line 582: warning: exported method Ratchet.Unmarshal should have comment or be unexported (golint)
    • zkc/zkserver/account/account.go
    • Line 26: warning: exported const CacheDir should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type ErrAlreadyOnline should have comment or be unexported (golint)
    • Line 121: warning: comment on exported method Account.Create should be of the form "Create ..." (golint)
    • Line 170: warning: exported method Account.Push should have comment or be unexported (golint)
    • Line 193: warning: exported method Account.Find should have comment or be unexported (golint)
    • Line 236: warning: exported method Account.Disabled should have comment or be unexported (golint)
    • Line 241: warning: exported method Account.Enabled should have comment or be unexported (golint)
    • Line 246: warning: exported method Account.Disable should have comment or be unexported (golint)
    • Line 267: warning: exported method Account.Enable should have comment or be unexported (golint)
    • Line 288: warning: exported method Account.Pull should have comment or be unexported (golint)
    • Line 364: warning: exported method Account.Delete should have comment or be unexported (golint)
    • zkc/zkclient/zkclient.go
    • Line 113: warning: exported method ZKC.PrintfT should have comment or be unexported (golint)
    • Line 117: warning: exported method ZKC.PrintfTS should have comment or be unexported (golint)
    • Line 600: warning: exported type ZKC should have comment or be unexported (golint)
    • Line 1048: warning: exported method ZKC.PrintIdentity should have comment or be unexported (golint)
    • zkc/ratchet/disk/disk.go
    • Line 7: warning: exported type RatchetState should have comment or be unexported (golint)
    • Line 27: warning: don't use underscores in Go names; type RatchetState_SavedKeys should be RatchetStateSavedKeys (golint)
    • Line 27: warning: exported type RatchetState_SavedKeys should have comment or be unexported (golint)
    • Line 32: warning: don't use underscores in Go names; type RatchetState_SavedKeys_MessageKey should be RatchetStateSavedKeysMessageKey (golint)
    • Line 32: warning: exported type RatchetState_SavedKeys_MessageKey should have comment or be unexported (golint)
    • zkc/rpc/rpc.go
    • Line 5: warning: package comment should be of the form "Package rpc ..." (golint)
    • Line 41: warning: exported type MessageMode should have comment or be unexported (golint)
    • Line 44: warning: comment on exported const InitialCmdIdentify should be of the form "InitialCmdIdentify ..." (golint)
    • Line 46: warning: exported const InitialCmdCreateAccount should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: comment on exported const SessionCmdWelcome should be of the form "SessionCmdWelcome ..." (golint)
    • Line 53: warning: comment on exported const TaggedCmdRendezvous should be of the form "TaggedCmdRendezvous ..." (golint)
    • Line 68: warning: comment on exported const MessageModeNormal should be of the form "MessageModeNormal ..." (golint)
    • Line 113: warning: exported const ProtocolVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 136: warning: exported type ServerProperty should have comment or be unexported (golint)
    • Line 143: warning: comment on exported const PropTagDepth should be of the form "PropTagDepth ..." (golint)
    • Line 146: warning: exported const PropTagDepthDefault should have comment (or a comment on this block) or be unexported (golint)
    • Line 148: warning: comment on exported const PropMOTD should be of the form "PropMOTD ..." (golint)
    • Line 153: warning: comment on exported const PropMaxAttachmentSize should be of the form "PropMaxAttachmentSize ..." (golint)
    • Line 159: warning: comment on exported const PropMaxChunkSize should be of the form "PropMaxChunkSize ..." (golint)
    • Line 165: warning: comment on exported const PropMaxMsgSize should be of the form "PropMaxMsgSize ..." (golint)
    • Line 171: warning: comment on exported const PropServerTime should be of the form "PropServerTime ..." (golint)
    • Line 176: warning: comment on exported const PropDirectory should be of the form "PropDirectory ..." (golint)
    • Line 183: warning: comment on exported var DefaultPropTagDepth should be of the form "DefaultPropTagDepth ..." (golint)
    • Line 189: warning: exported var DefaultPropMaxAttachmentSize should have comment or be unexported (golint)
    • Line 215: warning: comment on exported var DefaultPropMOTD should be of the form "DefaultPropMOTD ..." (golint)
    • Line 222: warning: comment on exported var SupportedServerProperties should be of the form "SupportedServerProperties ..." (golint)
    • Line 291: warning: exported type Pong should have comment or be unexported (golint)
    • Line 350: warning: comment on exported const CRPCCmdPrivateMessage should be of the form "CRPCCmdPrivateMessage ..." (golint)
    • Line 352: warning: exported const CRPCCmdGroupInvite should have comment (or a comment on this block) or be unexported (golint)
    • Line 364: warning: comment on exported const CRPCCompNone should be of the form "CRPCCompNone ..." (golint)
    • Line 368: warning: comment on exported const CRPCJanitorDeleted should be of the form "CRPCJanitorDeleted ..." (golint)
    • Line 393: warning: comment on exported type GroupInvite should be of the form "GroupInvite ..." (with optional leading article) (golint)
    • Line 404: warning: comment on exported type GroupJoin should be of the form "GroupJoin ..." (with optional leading article) (golint)
    • Line 411: warning: comment on exported type GroupPart should be of the form "GroupPart ..." (with optional leading article) (golint)
    • Line 417: warning: comment on exported type GroupKill should be of the form "GroupKill ..." (with optional leading article) (golint)
    • Line 423: warning: comment on exported type GroupKick should be of the form "GroupKick ..." (with optional leading article) (golint)
    • Line 438: warning: comment on exported type GroupList should be of the form "GroupList ..." (with optional leading article) (golint)
    • Line 469: warning: exported type Chunk should have comment or be unexported (golint)
    • zkc/zkclient/settings.go
    • Line 25: warning: exported var ErrIniNotFound should have comment or be unexported (golint)
    • Line 28: warning: exported type Settings should have comment or be unexported (golint)
    • Line 113: warning: exported function ObtainSettings should have comment or be unexported (golint)
    • zkc/zkidentity/zkidentity.go
    • Line 5: warning: package comment should be of the form "Package zkidentity ..." (golint)
    • Line 24: warning: exported var ErrNotEqual should have comment or be unexported (golint)
    • Line 29: warning: exported const IdentitySize should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: comment on exported type PublicIdentity should be of the form "PublicIdentity ..." (with optional leading article) (golint)
    • Line 47: warning: exported type FullIdentity should have comment or be unexported (golint)
    • Line 53: warning: exported method FullIdentity.Marshal should have comment or be unexported (golint)
    • Line 63: warning: exported function UnmarshalFullIdentity should have comment or be unexported (golint)
    • Line 74: warning: exported function New should have comment or be unexported (golint)
    • Line 106: warning: exported function Fingerprint should have comment or be unexported (golint)
    • Line 110: warning: exported method FullIdentity.RecalculateDigest should have comment or be unexported (golint)
    • Line 130: warning: exported method FullIdentity.SignMessage should have comment or be unexported (golint)
    • Line 136: warning: exported method PublicIdentity.VerifyMessage should have comment or be unexported (golint)
    • Line 144: warning: exported method PublicIdentity.Fingerprint should have comment or be unexported (golint)
    • Line 148: warning: exported method PublicIdentity.Verify should have comment or be unexported (golint)
    • Line 161: warning: exported method PublicIdentity.Marshal should have comment or be unexported (golint)
    • Line 171: warning: exported function UnmarshalPublicIdentity should have comment or be unexported (golint)
    • Line 196: warning: exported function String2ID 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!