Preparing report...

Report for github.com/mirrorhub-io/platform

A    Great!    Found 16 issues across 18 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!


gocyclo100%

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.

No problems detected. Good job!


golint11%

Golint is a linter for Go source code.

    • platform/models/abstract.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 13: warning: exported function Connection should have comment or be unexported (golint)
    • Line 20: warning: don't use underscores in Go names; func db_init should be dbInit (golint)
    • platform/models/contact.go
    • Line 14: warning: exported type Contact should have comment or be unexported (golint)
    • Line 23: warning: exported method Contact.DelToken should have comment or be unexported (golint)
    • Line 27: warning: exported method Contact.GenerateToken should have comment or be unexported (golint)
    • Line 36: warning: exported function FindContactByEmail should have comment or be unexported (golint)
    • Line 45: warning: exported method Contact.Update should have comment or be unexported (golint)
    • Line 61: warning: exported function AuthContactWithToken should have comment or be unexported (golint)
    • Line 69: warning: exported function AuthContactWithPassword should have comment or be unexported (golint)
    • Line 82: warning: exported method Contact.ToProto should have comment or be unexported (golint)
    • Line 92: warning: exported method Contact.Mirrors should have comment or be unexported (golint)
    • Line 101: warning: exported function CreateContact should have comment or be unexported (golint)
    • platform/controllers/contact_service.go
    • Line 10: warning: exported type ContactServiceServer should have comment or be unexported (golint)
    • Line 13: warning: exported method ContactServiceServer.Create should have comment or be unexported (golint)
    • Line 31: warning: exported method ContactServiceServer.Update should have comment or be unexported (golint)
    • Line 37: warning: don't use underscores in Go names; var new_contact should be newContact (golint)
    • Line 41: warning: exported method ContactServiceServer.Get should have comment or be unexported (golint)
    • Line 50: warning: exported method ContactServiceServer.Authorize should have comment or be unexported (golint)
    • platform/controllers/mirror_service.go
    • Line 11: warning: exported type MirrorServiceServer should have comment or be unexported (golint)
    • Line 14: warning: exported method MirrorServiceServer.Get should have comment or be unexported (golint)
    • Line 26: warning: exported method MirrorServiceServer.Find should have comment or be unexported (golint)
    • Line 35: warning: exported method MirrorServiceServer.Connect should have comment or be unexported (golint)
    • Line 40: warning: don't use underscores in Go names; var base_err should be baseErr (golint)
    • Line 44: warning: don't use underscores in Go names; var endpoint_err should be endpointErr (golint)
    • Line 53: warning: exported method MirrorServiceServer.FindById should have comment or be unexported (golint)
    • Line 58: warning: don't use underscores in Go names; var base_err should be baseErr (golint)
    • Line 65: warning: exported method MirrorServiceServer.UpdateById should have comment or be unexported (golint)
    • Line 71: warning: don't use underscores in Go names; var base_err should be baseErr (golint)
    • Line 84: warning: exported method MirrorServiceServer.Create should have comment or be unexported (golint)
    • platform/client/services.go
    • Line 7: warning: exported type ServiceClient should have comment or be unexported (golint)
    • Line 19: warning: exported method ServiceClient.List should have comment or be unexported (golint)
    • Line 26: warning: exported method ServiceClient.Create should have comment or be unexported (golint)
    • platform/balancer/monitor.go
    • Line 13: warning: exported type Service should have comment or be unexported (golint)
    • Line 21: warning: exported const FileOnline should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type File should have comment or be unexported (golint)
    • Line 32: warning: exported const FileCacheSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported type Monitor should have comment or be unexported (golint)
    • Line 44: warning: exported function NewMonitor should have comment or be unexported (golint)
    • Line 54: warning: exported method Monitor.Authorize should have comment or be unexported (golint)
    • Line 62: warning: exported method Monitor.Preload should have comment or be unexported (golint)
    • Line 78: warning: exported function NewService should have comment or be unexported (golint)
    • Line 89: warning: exported method Service.Preload should have comment or be unexported (golint)
    • platform/models/mirror.go
    • Line 11: warning: exported type Mirror should have comment or be unexported (golint)
    • Line 31: warning: exported type MirrorCollection should have comment or be unexported (golint)
    • Line 35: warning: exported function MirrorList should have comment or be unexported (golint)
    • Line 41: warning: exported function MirrorFromProto should have comment or be unexported (golint)
    • Line 61: warning: exported method MirrorCollection.ToProto should have comment or be unexported (golint)
    • Line 69: warning: exported method Mirror.FetchServices should have comment or be unexported (golint)
    • Line 77: warning: exported method Mirror.Update should have comment or be unexported (golint)
    • Line 81: warning: exported method Mirror.BeforeCreate should have comment or be unexported (golint)
    • Line 85: warning: exported function FindMirrorById should have comment or be unexported (golint)
    • Line 96: warning: exported method Mirror.ServiceEndpoint should have comment or be unexported (golint)
    • Line 101: warning: exported method Mirror.Service should have comment or be unexported (golint)
    • Line 113: warning: exported method Mirror.ToProto should have comment or be unexported (golint)
    • platform/models/service.go
    • Line 10: warning: exported type Service should have comment or be unexported (golint)
    • Line 18: warning: exported type ServiceCollection should have comment or be unexported (golint)
    • Line 23: warning: exported function ServiceFromProto should have comment or be unexported (golint)
    • Line 30: warning: exported function FindServiceById should have comment or be unexported (golint)
    • Line 41: warning: exported function ServiceList should have comment or be unexported (golint)
    • Line 47: warning: exported method ServiceCollection.ToServices should have comment or be unexported (golint)
    • Line 55: warning: exported method ServiceCollection.ToProto should have comment or be unexported (golint)
    • Line 63: warning: exported method Service.Files should have comment or be unexported (golint)
    • Line 67: warning: exported method Service.ToProto should have comment or be unexported (golint)
    • platform/controllers/abstract.go
    • Line 16: warning: exported function StartApi should have comment or be unexported (golint)
    • Line 17: warning: don't use underscores in Go names; var bind_uri should be bindURI (golint)
    • Line 34: warning: exported function StartGateway should have comment or be unexported (golint)
    • Line 35: warning: don't use underscores in Go names; var bind_uri should be bindURI (golint)
    • Line 49: warning: exported function AuthContact should have comment or be unexported (golint)
    • Line 67: warning: exported function AuthMirror should have comment or be unexported (golint)
    • platform/controllers/service_service.go
    • Line 11: warning: exported type ServiceServiceServer should have comment or be unexported (golint)
    • Line 14: warning: exported method ServiceServiceServer.Get should have comment or be unexported (golint)
    • Line 26: warning: exported method ServiceServiceServer.Find should have comment or be unexported (golint)
    • Line 31: warning: don't use underscores in Go names; var base_err should be baseErr (golint)
    • Line 38: warning: exported method ServiceServiceServer.Update should have comment or be unexported (golint)
    • Line 44: warning: don't use underscores in Go names; var base_err should be baseErr (golint)
    • Line 61: warning: exported method ServiceServiceServer.Create should have comment or be unexported (golint)
    • platform/client/base.go
    • Line 12: warning: exported type Client should have comment or be unexported (golint)
    • Line 21: warning: exported function Initialize should have comment or be unexported (golint)
    • Line 29: warning: exported method Client.Connection should have comment or be unexported (golint)
    • Line 40: warning: exported method Client.Contact should have comment or be unexported (golint)
    • Line 47: warning: exported method Client.Mirror should have comment or be unexported (golint)
    • Line 54: warning: exported method Client.Service should have comment or be unexported (golint)
    • Line 61: warning: exported method Client.PrepareHeader should have comment or be unexported (golint)
    • platform/client/contacts.go
    • Line 7: warning: exported type ContactClient should have comment or be unexported (golint)
    • Line 19: warning: exported method ContactClient.Authorize should have comment or be unexported (golint)
    • Line 33: warning: exported method ContactClient.UpdateSession should have comment or be unexported (golint)
    • Line 39: warning: exported method ContactClient.Create should have comment or be unexported (golint)
    • Line 54: warning: exported method ContactClient.Update should have comment or be unexported (golint)
    • Line 69: warning: exported method ContactClient.Get should have comment or be unexported (golint)
    • platform/cmd/client.go
    • Line 142: warning: don't use underscores in Go names; var endpoint_id should be endpointID (golint)
    • Line 166: warning: don't use underscores in Go names; var m_bandwidth should be mBandwidth (golint)
    • Line 167: warning: don't use underscores in Go names; var m_domain should be mDomain (golint)
    • Line 168: warning: don't use underscores in Go names; var m_ipv4 should be mIpv4 (golint)
    • Line 169: warning: don't use underscores in Go names; var m_ipv6 should be mIpv6 (golint)
    • Line 170: warning: don't use underscores in Go names; var m_name should be mName (golint)
    • Line 171: warning: don't use underscores in Go names; var m_storage should be mStorage (golint)
    • Line 172: warning: don't use underscores in Go names; var m_traffic should be mTraffic (golint)
    • Line 173: warning: don't use underscores in Go names; var m_service_id should be mServiceID (golint)
    • Line 243: warning: don't use underscores in Go names; var s_name should be sName (golint)
    • Line 244: warning: don't use underscores in Go names; var s_storage should be sStorage (golint)
    • platform/client/mirrors.go
    • Line 7: warning: exported type MirrorClient should have comment or be unexported (golint)
    • Line 19: warning: exported method MirrorClient.List should have comment or be unexported (golint)
    • Line 26: warning: exported method MirrorClient.FindById should have comment or be unexported (golint)
    • Line 35: warning: exported method MirrorClient.UpdateById should have comment or be unexported (golint)
    • Line 43: warning: exported method MirrorClient.Connect should have comment or be unexported (golint)
    • Line 43: warning: don't use underscores in Go names; method parameter service_id should be serviceID (golint)
    • Line 53: warning: exported method MirrorClient.Create should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign88%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!