Preparing report...

Report for github.com/regnull/ubikom

(v0.5.0)

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


gocyclo91%

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.

    • db/badger.go
    • Line 449: warning: cyclomatic complexity 17 of function CheckRegisterNameAuthorization() is high (> 15) (gocyclo)
    • util/util.go
    • Line 80: warning: cyclomatic complexity 16 of function GetConfigFileLocation() is high (> 15) (gocyclo)

golint41%

Golint is a linter for Go source code.

    • store/badger.go
    • Line 14: warning: exported type Badger should have comment or be unexported (golint)
    • Line 19: warning: exported function NewBadger should have comment or be unexported (golint)
    • Line 27: warning: exported method Badger.Save should have comment or be unexported (golint)
    • Line 47: warning: exported method Badger.GetNext should have comment or be unexported (golint)
    • Line 71: warning: exported method Badger.GetAll should have comment or be unexported (golint)
    • Line 100: warning: exported method Badger.Remove should have comment or be unexported (golint)
    • store/file.go
    • Line 15: warning: exported type File should have comment or be unexported (golint)
    • Line 20: warning: exported function NewFile should have comment or be unexported (golint)
    • Line 24: warning: exported method File.Save should have comment or be unexported (golint)
    • Line 46: warning: exported method File.GetNext should have comment or be unexported (golint)
    • Line 82: warning: exported method File.GetAll should have comment or be unexported (golint)
    • Line 122: warning: exported method File.Remove should have comment or be unexported (golint)
    • globals/globals.go
    • Line 4: warning: exported const PublicIdentityServiceURL should have comment (or a comment on this block) or be unexported (golint)
    • protoutil/identity.go
    • Line 12: warning: exported function RegisterKey should have comment or be unexported (golint)
    • Line 32: warning: exported function RegisterChildKey should have comment or be unexported (golint)
    • Line 54: warning: exported function RegisterName should have comment or be unexported (golint)
    • Line 76: warning: exported function RegisterAddress should have comment or be unexported (golint)
    • gateway/sender.go
    • Line 18: warning: comment on exported type SenderOptions should be of the form "SenderOptions ..." (with optional leading article) (golint)
    • protoio/protoio.go
    • Line 11: warning: exported type Writer should have comment or be unexported (golint)
    • Line 15: warning: exported type ParseFunc should have comment or be unexported (golint)
    • Line 17: warning: exported type Reader should have comment or be unexported (golint)
    • Line 25: warning: exported function NewWriter should have comment or be unexported (golint)
    • Line 77: warning: exported function NewReader should have comment or be unexported (golint)
    • server/dump_server.go
    • Line 15: warning: exported type DumpServer should have comment or be unexported (golint)
    • Line 23: warning: exported function NewDumpServer should have comment or be unexported (golint)
    • Line 34: warning: exported method DumpServer.Send should have comment or be unexported (golint)
    • Line 63: warning: exported method DumpServer.Receive should have comment or be unexported (golint)
    • smtp/backend.go
    • Line 19: warning: exported type Backend should have comment or be unexported (golint)
    • Line 27: warning: exported function NewBackend should have comment or be unexported (golint)
    • Line 37: warning: exported method Backend.Login should have comment or be unexported (golint)
    • Line 62: warning: receiver name bkd should be consistent with previous receiver name b for Backend (golint)
    • Line 77: warning: exported method Session.Mail should have comment or be unexported (golint)
    • Line 84: warning: exported method Session.Rcpt should have comment or be unexported (golint)
    • Line 91: warning: exported method Session.Data should have comment or be unexported (golint)
    • Line 98: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 141: warning: exported method Session.Reset should have comment or be unexported (golint)
    • Line 145: warning: exported method Session.Logout should have comment or be unexported (golint)
    • smtp/server.go
    • Line 14: warning: exported type ServerOptions should have comment or be unexported (golint)
    • Line 26: warning: exported type Server should have comment or be unexported (golint)
    • Line 32: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 57: warning: exported method Server.ListenAndServe should have comment or be unexported (golint)
    • Line 61: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • server/server.go
    • Line 24: warning: exported var ErrKeyExists should have comment or be unexported (golint)
    • Line 25: warning: exported var ErrNotAuthorized should have comment or be unexported (golint)
    • Line 26: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 28: warning: exported type Server should have comment or be unexported (golint)
    • Line 35: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 39: warning: exported method Server.RegisterKey should have comment or be unexported (golint)
    • Line 78: warning: exported method Server.RegisterKeyRelationship should have comment or be unexported (golint)
    • Line 116: warning: exported method Server.DisableKey should have comment or be unexported (golint)
    • Line 156: warning: exported method Server.RegisterName should have comment or be unexported (golint)
    • Line 204: warning: exported method Server.RegisterAddress should have comment or be unexported (golint)
    • Line 249: warning: exported method Server.LookupKey should have comment or be unexported (golint)
    • Line 277: warning: exported method Server.LookupName should have comment or be unexported (golint)
    • Line 298: warning: exported method Server.LookupAddress should have comment or be unexported (golint)
    • Line 314: warning: exported function Int64ToBytes should have comment or be unexported (golint)
    • db/badger.go
    • Line 26: warning: exported type BadgerDB should have comment or be unexported (golint)
    • Line 30: warning: exported function NewBadgerDB should have comment or be unexported (golint)
    • Line 34: warning: exported method BadgerDB.RegisterKey should have comment or be unexported (golint)
    • Line 73: warning: exported method BadgerDB.RegisterKeyParent should have comment or be unexported (golint)
    • Line 128: warning: exported method BadgerDB.RegisterName should have comment or be unexported (golint)
    • Line 166: warning: exported method BadgerDB.RegisterAddress should have comment or be unexported (golint)
    • Line 216: warning: exported method BadgerDB.DisableKey should have comment or be unexported (golint)
    • Line 290: warning: exported method BadgerDB.GetKey should have comment or be unexported (golint)
    • Line 320: warning: exported method BadgerDB.GetName should have comment or be unexported (golint)
    • Line 354: warning: exported method BadgerDB.GetAddress should have comment or be unexported (golint)
    • Line 378: warning: exported function CheckSelfOrParent should have comment or be unexported (golint)
    • Line 413: warning: exported function GetParent should have comment or be unexported (golint)
    • Line 449: warning: exported function CheckRegisterNameAuthorization should have comment or be unexported (golint)
    • Line 509: warning: exported method BadgerDB.WriteKeys should have comment or be unexported (golint)
    • cmd/ubikom-server/main.go
    • Line 26: warning: exported type HealthChecker should have comment or be unexported (golint)
    • Line 28: warning: exported method HealthChecker.Check should have comment or be unexported (golint)
    • Line 36: warning: exported method HealthChecker.Watch should have comment or be unexported (golint)
    • Line 45: warning: exported type CmdArgs should have comment or be unexported (golint)
    • protoutil/protoutil.go
    • Line 80: warning: comment on exported function CreateMessage should be of the form "CreateMessage ..." (golint)
    • Line 163: warning: exported function DecryptMessage should have comment or be unexported (golint)
    • db/db.go
    • Line 7: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 8: warning: exported var ErrRecordExists should have comment or be unexported (golint)
    • Line 9: warning: exported var ErrNotAuthorized should have comment or be unexported (golint)
    • util/util.go
    • Line 34: warning: exported function TimeFromMs should have comment or be unexported (golint)
    • Line 70: warning: exported function GetDefaultKeyLocation should have comment or be unexported (golint)
    • Line 80: warning: exported function GetConfigFileLocation should have comment or be unexported (golint)
    • Line 158: warning: exported function StatusCodeFromError should have comment or be unexported (golint)
    • Line 193: warning: exported function EnterPassphrase should have comment or be unexported (golint)
    • Line 214: warning: exported function ReadPassphase should have comment or be unexported (golint)
    • Line 225: warning: exported function IsKeyEncrypted should have comment or be unexported (golint)
    • mail/mail.go
    • Line 41: warning: exported function ExtractReceiverInternalName should have comment or be unexported (golint)
    • Line 56: warning: exported function ExtractReceiverInternalNames should have comment or be unexported (golint)
    • pop/backend.go
    • Line 38: warning: exported type Session should have comment or be unexported (golint)
    • Line 57: warning: exported function NewBackend should have comment or be unexported (golint)
    • Line 69: warning: exported method Backend.Authorize should have comment or be unexported (golint)
    • Line 110: warning: exported method Backend.Poll should have comment or be unexported (golint)
    • Line 168: warning: comment on exported method Backend.Stat should be of the form "Stat ..." (golint)
    • Line 209: warning: comment on exported method Backend.ListMessage should be of the form "ListMessage ..." (golint)
    • Line 230: warning: comment on exported method Backend.Retr should be of the form "Retr ..." (golint)
    • Line 256: warning: comment on exported method Backend.Dele should be of the form "Dele ..." (golint)
    • Line 282: warning: comment on exported method Backend.Rset should be of the form "Rset ..." (golint)
    • Line 296: warning: comment on exported method Backend.Uidl should be of the form "Uidl ..." (golint)
    • Line 322: warning: comment on exported method Backend.UidlMessage should be of the form "UidlMessage ..." (golint)
    • Line 345: warning: comment on exported method Backend.Update should be of the form "Update ..." (golint)
    • Line 372: warning: exported method Backend.Top should have comment or be unexported (golint)
    • Line 424: warning: comment on exported method Backend.Unlock should be of the form "Unlock ..." (golint)
    • protoio/sha256.go
    • Line 10: warning: exported type Sha256Writer should have comment or be unexported (golint)
    • Line 15: warning: exported function NewSha256Writer should have comment or be unexported (golint)
    • Line 31: warning: exported method Sha256Writer.Hash should have comment or be unexported (golint)
    • cmd/ubikom-web/main.go
    • Line 46: warning: exported type CmdArgs should have comment or be unexported (golint)
    • Line 58: warning: exported type Server should have comment or be unexported (golint)
    • Line 67: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 79: warning: exported method Server.HandleNameLookup should have comment or be unexported (golint)
    • Line 102: warning: exported method Server.HandleEasySetup should have comment or be unexported (golint)
    • Line 237: warning: exported method Server.HandleGetKey should have comment or be unexported (golint)
    • pop/server.go
    • Line 15: warning: exported type ServerOptions should have comment or be unexported (golint)
    • Line 29: warning: exported type Server should have comment or be unexported (golint)
    • Line 34: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 43: warning: exported method Server.ListenAndServe should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign89%

IneffAssign detects ineffectual assignments in Go code.

    • db/badger.go
    • Line 40: warning: ineffectual assignment to err (ineffassign)
    • Line 89: warning: ineffectual assignment to err (ineffassign)
    • Line 132: warning: ineffectual assignment to err (ineffassign)
    • Line 242: warning: ineffectual assignment to err (ineffassign)
    • Line 305: warning: ineffectual assignment to err (ineffassign)
    • Line 40: warning: ineffectual assignment to err (ineffassign)
    • Line 89: warning: ineffectual assignment to err (ineffassign)
    • Line 132: warning: ineffectual assignment to err (ineffassign)
    • Line 242: warning: ineffectual assignment to err (ineffassign)
    • Line 305: warning: ineffectual assignment to err (ineffassign)

misspell97%

Misspell Finds commonly misspelled English words