Preparing report...

Report for github.com/SphereSoftware/objstore

A    Great!    Found 17 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!


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.

    • objstore/journal/meta_gen.go
    • Line 291: warning: cyclomatic complexity 31 of function (*FileMeta).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 59: warning: cyclomatic complexity 31 of function (*FileMeta).DecodeMsg() is high (> 15) (gocyclo)
    • Line 156: warning: cyclomatic complexity 22 of function (*FileMeta).EncodeMsg() is high (> 15) (gocyclo)
    • Line 713: warning: cyclomatic complexity 18 of function (*JournalMeta).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 568: warning: cyclomatic complexity 18 of function (*JournalMeta).DecodeMsg() is high (> 15) (gocyclo)
    • objstore/objstore.go
    • Line 201: warning: cyclomatic complexity 25 of function (*objStore).sync() is high (> 15) (gocyclo)
    • Line 514: warning: cyclomatic complexity 19 of function (*objStore).handleEvent() is high (> 15) (gocyclo)
    • Line 105: warning: cyclomatic complexity 17 of function NewStore() is high (> 15) (gocyclo)
    • Line 652: warning: cyclomatic complexity 16 of function (*objStore).FindObject() is high (> 15) (gocyclo)
    • objstore/journal/journal.go
    • Line 205: warning: cyclomatic complexity 40 of function (*btreeJournal).Diff() is high (> 15) (gocyclo)
    • Line 383: warning: cyclomatic complexity 40 of function (*kvJournal).Diff() is high (> 15) (gocyclo)

golint33%

Golint is a linter for Go source code.

    • objstore/storage/local.go
    • Line 28: warning: exported function NewLocalStorage should have comment or be unexported (golint)
    • Line 87: warning: exported type DiskStats should have comment or be unexported (golint)
    • objstore/api/private.go
    • Line 26: warning: exported type PrivateServer should have comment or be unexported (golint)
    • Line 35: warning: exported function NewPrivateServer should have comment or be unexported (golint)
    • Line 45: warning: exported method PrivateServer.SetDebug should have comment or be unexported (golint)
    • Line 49: warning: exported method PrivateServer.Env should have comment or be unexported (golint)
    • Line 53: warning: exported method PrivateServer.Router should have comment or be unexported (golint)
    • Line 123: warning: exported type NodeInfo should have comment or be unexported (golint)
    • Line 129: warning: exported type NodeIter should have comment or be unexported (golint)
    • Line 132: warning: error var RangeStop should have name of the form ErrFoo (golint)
    • Line 132: warning: exported var RangeStop should have comment or be unexported (golint)
    • Line 167: warning: exported method PrivateServer.RouteAPI should have comment or be unexported (golint)
    • Line 180: warning: exported method PrivateServer.PingHandler should have comment or be unexported (golint)
    • Line 186: warning: exported method PrivateServer.ListNodesHandler should have comment or be unexported (golint)
    • Line 204: warning: exported method PrivateServer.AnnounceHandler should have comment or be unexported (golint)
    • Line 215: warning: exported method PrivateServer.MessageHandler should have comment or be unexported (golint)
    • Line 228: warning: exported method PrivateServer.GetHandler should have comment or be unexported (golint)
    • Line 281: warning: exported method PrivateServer.PutHandler should have comment or be unexported (golint)
    • Line 332: warning: exported type SyncResponse should have comment or be unexported (golint)
    • Line 337: warning: exported method PrivateServer.SyncHandler should have comment or be unexported (golint)
    • Line 370: warning: exported method PrivateServer.DeleteHandler should have comment or be unexported (golint)
    • objstore/api/public.go
    • Line 11: warning: exported type PublicServer should have comment or be unexported (golint)
    • Line 17: warning: exported function NewPublicServer should have comment or be unexported (golint)
    • Line 23: warning: exported method PublicServer.ListenAndServe should have comment or be unexported (golint)
    • Line 27: warning: exported method PublicServer.RouteAPI should have comment or be unexported (golint)
    • Line 40: warning: exported method PublicServer.PingHandler should have comment or be unexported (golint)
    • Line 46: warning: exported method PublicServer.IDHandler should have comment or be unexported (golint)
    • Line 52: warning: exported method PublicServer.VersionHandler should have comment or be unexported (golint)
    • Line 60: warning: exported const KB should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: exported type DiskStats should have comment or be unexported (golint)
    • Line 81: warning: exported type Stats should have comment or be unexported (golint)
    • Line 86: warning: exported method PublicServer.StatsHandler should have comment or be unexported (golint)
    • Line 107: warning: exported method PublicServer.GetHandler should have comment or be unexported (golint)
    • Line 129: warning: exported method PublicServer.MetaHandler should have comment or be unexported (golint)
    • Line 146: warning: exported method PublicServer.PutHandler should have comment or be unexported (golint)
    • Line 152: warning: exported method PublicServer.DeleteHandler should have comment or be unexported (golint)
    • objstore/journal/manager.go
    • Line 12: warning: exported type JournalManager should have comment or be unexported (golint)
    • Line 27: warning: exported type JournalIter should have comment or be unexported (golint)
    • Line 29: warning: exported function NewJournalManager should have comment or be unexported (golint)
    • Line 78: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 100: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 268: warning: error var RangeStop should have name of the form ErrFoo (golint)
    • Line 268: warning: exported var RangeStop should have comment or be unexported (golint)
    • objstore/journal/meta.go
    • Line 10: warning: exported type FileMeta should have comment or be unexported (golint)
    • Line 22: warning: exported method FileMeta.Map should have comment or be unexported (golint)
    • Line 36: warning: exported method FileMeta.Unmap should have comment or be unexported (golint)
    • Line 67: warning: exported type FileMetaList should have comment or be unexported (golint)
    • Line 69: warning: receiver name m should be consistent with previous receiver name f for FileMeta (golint)
    • Line 76: warning: exported type ConsistencyLevel should have comment or be unexported (golint)
    • Line 89: warning: exported type ID should have comment or be unexported (golint)
    • Line 91: warning: exported type JournalMeta should have comment or be unexported (golint)
    • objstore/cluster/client.go
    • Line 16: warning: exported type PrivateClient should have comment or be unexported (golint)
    • Line 49: warning: exported type NodeIter should have comment or be unexported (golint)
    • Line 51: warning: exported method PrivateClient.ForEachNode should have comment or be unexported (golint)
    • Line 87: warning: error var RangeStop should have name of the form ErrFoo (golint)
    • Line 87: warning: exported var RangeStop should have comment or be unexported (golint)
    • Line 91: warning: exported method PrivateClient.GET should have comment or be unexported (golint)
    • Line 100: warning: exported method PrivateClient.POST should have comment or be unexported (golint)
    • objstore/cluster/events.go
    • Line 5: warning: exported type EventType should have comment or be unexported (golint)
    • Line 8: warning: exported const EventUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported type EventAnnounce should have comment or be unexported (golint)
    • objstore/cluster/manager.go
    • Line 14: warning: exported type ClusterManager should have comment or be unexported (golint)
    • Line 22: warning: exported type NodeInfo should have comment or be unexported (golint)
    • Line 28: warning: exported function NewClusterManager should have comment or be unexported (golint)
    • Line 73: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 96: warning: exported type SyncResponse should have comment or be unexported (golint)
    • objstore/objstore.go
    • Line 20: warning: exported type Store should have comment or be unexported (golint)
    • Line 54: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 56: warning: exported type DiskStats should have comment or be unexported (golint)
    • Line 58: warning: exported type EventAnnounce should have comment or be unexported (golint)
    • Line 60: warning: exported type ConsistencyLevel should have comment or be unexported (golint)
    • Line 62: warning: exported method ConsistencyLevel.Check should have comment or be unexported (golint)
    • Line 73: warning: exported const EventOpaqueData should have comment (or a comment on this block) or be unexported (golint)
    • Line 105: warning: exported function NewStore should have comment or be unexported (golint)
    • Line 429: warning: receiver name s should be consistent with previous receiver name o for objStore (golint)
    • Line 433: warning: exported function GenerateID should have comment or be unexported (golint)
    • Line 437: warning: exported function CheckID should have comment or be unexported (golint)
    • Line 604: warning: exported type FileMeta should have comment or be unexported (golint)
    • Line 605: warning: exported type FileMetaList should have comment or be unexported (golint)
    • objstore/journal/journal.go
    • Line 19: warning: exported type Journal should have comment or be unexported (golint)
    • Line 117: warning: error var closedErr should have name of the form errFoo (golint)
    • Line 205: warning: receiver name prev should be consistent with previous receiver name b for btreeJournal (golint)
    • Line 383: warning: receiver name prev should be consistent with previous receiver name j for kvJournal (golint)
    • Line 659: warning: exported var ErrRangeStop should have comment or be unexported (golint)
    • objstore/journal/mapping.go
    • Line 5: warning: exported type Mapping should have comment or be unexported (golint)
    • Line 16: warning: exported function NewMapping should have comment or be unexported (golint)
    • objstore/storage/remote.go
    • Line 29: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 36: warning: exported function NewS3Storage should have comment or be unexported (golint)
    • Line 46: warning: exported type Spec should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign38%

IneffAssign detects ineffectual assignments in Go code.

    • objstore/journal/meta_gen.go
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: could not import github.com/tinylib/msgp/msgp (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/tinylib/msgp/msgp (invalid package name: "") (ineffassign)
    • objstore/cluster/client.go
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: could not import github.com/astranet/astranet (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/astranet/astranet/addr (invalid package name: "") (ineffassign)
    • objstore/helpers.go
    • Line 3: warning: cannot find package "." in: (ineffassign)
    • Line 3: warning: could not import sphere.software/objstore/cluster (invalid package name: "") (ineffassign)
    • Line 43: warning: e.Type undefined (type *EventAnnounce has no field or method Type) (ineffassign)
    • objstore/storage/remote.go
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 14: warning: cannot find package "." in: (ineffassign)
    • Line 15: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: could not import github.com/aws/aws-sdk-go/aws (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/aws/aws-sdk-go/aws/session (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/aws/aws-sdk-go/service/s3 (invalid package name: "") (ineffassign)
    • objstore/journal/helpers.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/oklog/ulid (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/oklog/ulid (invalid package name: "") (ineffassign)
    • objstore/cmd/objstore/main.go
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 14: warning: cannot find package "." in: (ineffassign)
    • Line 16: warning: cannot find package "." in: (ineffassign)
    • Line 17: warning: cannot find package "." in: (ineffassign)
    • Line 18: warning: cannot find package "." in: (ineffassign)
    • Line 19: warning: cannot find package "." in: (ineffassign)
    • Line 20: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: could not import github.com/boltdb/bolt (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/gin-gonic/gin (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/jawher/mow.cli (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/xlab/closer (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import sphere.software/objstore (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import sphere.software/objstore/api (invalid package name: "") (ineffassign)
    • Line 18: warning: could not import sphere.software/objstore/cluster (invalid package name: "") (ineffassign)
    • Line 19: warning: could not import sphere.software/objstore/journal (invalid package name: "") (ineffassign)
    • Line 20: warning: could not import sphere.software/objstore/storage (invalid package name: "") (ineffassign)
    • Line 23: warning: undeclared name: cli (ineffassign)
    • Line 27: warning: undeclared name: cli (ineffassign)
    • Line 34: warning: undeclared name: cli (ineffassign)
    • Line 41: warning: undeclared name: cli (ineffassign)
    • Line 47: warning: undeclared name: cli (ineffassign)
    • Line 53: warning: undeclared name: cli (ineffassign)
    • Line 59: warning: undeclared name: cli (ineffassign)
    • Line 65: warning: undeclared name: cli (ineffassign)
    • Line 71: warning: undeclared name: cli (ineffassign)
    • Line 77: warning: undeclared name: cli (ineffassign)
    • Line 83: warning: undeclared name: cli (ineffassign)
    • Line 13: warning: "github.com/jawher/mow.cli" imported but not used (ineffassign)
    • objstore/cluster/events.go
    • Line 3: warning: cannot find package "." in: (ineffassign)
    • Line 3: warning: could not import sphere.software/objstore/journal (invalid package name: "") (ineffassign)
    • objstore/api/private.go
    • Line 19: warning: cannot find package "." in: (ineffassign)
    • Line 20: warning: cannot find package "." in: (ineffassign)
    • Line 21: warning: cannot find package "." in: (ineffassign)
    • Line 23: warning: cannot find package "." in: (ineffassign)
    • Line 19: warning: could not import github.com/astranet/astranet (invalid package name: "") (ineffassign)
    • Line 20: warning: could not import github.com/astranet/astranet/addr (invalid package name: "") (ineffassign)
    • Line 21: warning: could not import github.com/gin-gonic/gin (invalid package name: "") (ineffassign)
    • Line 23: warning: could not import sphere.software/objstore (invalid package name: "") (ineffassign)
    • objstore/objstore.go
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 16: warning: cannot find package "." in: (ineffassign)
    • Line 17: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: could not import github.com/oklog/ulid (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/xlab/closer (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import sphere.software/objstore/journal (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import sphere.software/objstore/storage (invalid package name: "") (ineffassign)
    • Line 234: warning: added declared but not used (ineffassign)
    • Line 234: warning: deleted declared but not used (ineffassign)
    • Line 415: warning: event.Type undefined (type *EventAnnounce has no field or method Type) (ineffassign)
    • Line 423: warning: event.Type undefined (type *EventAnnounce has no field or method Type) (ineffassign)
    • Line 515: warning: ev.Type undefined (type *EventAnnounce has no field or method Type) (ineffassign)
    • Line 517: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 521: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 522: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 530: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 537: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 562: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 567: warning: ev.FileMeta undefined (type *EventAnnounce has no field or method FileMeta) (ineffassign)
    • Line 589: warning: ev.OpaqueData undefined (type *EventAnnounce has no field or method OpaqueData) (ineffassign)
    • Line 591: warning: ev.Type undefined (type *EventAnnounce has no field or method Type) (ineffassign)
    • Line 638: warning: meta.IsSymlink undefined (type *FileMeta has no field or method IsSymlink) (ineffassign)
    • Line 641: warning: meta.IsDeleted undefined (type *FileMeta has no field or method IsDeleted) (ineffassign)
    • Line 684: warning: meta.ID undefined (type *FileMeta has no field or method ID) (ineffassign)
    • Line 686: warning: meta.IsSymlink undefined (type *FileMeta has no field or method IsSymlink) (ineffassign)
    • Line 687: warning: meta.Consistency undefined (type *FileMeta has no field or method Consistency) (ineffassign)
    • Line 688: warning: meta.Consistency undefined (type *FileMeta has no field or method Consistency) (ineffassign)
    • Line 690: warning: meta.Timestamp undefined (type *FileMeta has no field or method Timestamp) (ineffassign)
    • Line 717: warning: copyMeta.IsFetched undefined (type FileMeta has no field or method IsFetched) (ineffassign)
    • Line 742: warning: meta.ID undefined (type *FileMeta has no field or method ID) (ineffassign)
    • Line 752: warning: meta.ID undefined (type *FileMeta has no field or method ID) (ineffassign)
    • Line 754: warning: meta.ID undefined (type *FileMeta has no field or method ID) (ineffassign)
    • Line 766: warning: meta.Consistency undefined (type *FileMeta has no field or method Consistency) (ineffassign)
    • Line 793: warning: meta.ID undefined (type *FileMeta has no field or method ID) (ineffassign)
    • Line 800: warning: meta.ID undefined (type *FileMeta has no field or method ID) (ineffassign)
    • Line 806: warning: meta.Consistency undefined (type *FileMeta has no field or method Consistency) (ineffassign)
    • Line 844: warning: cannot use nil (untyped nil value) as FileMetaList value in return statement (ineffassign)
    • Line 844: warning: cannot use nil (untyped nil value) as FileMetaList value in return statement (ineffassign)
    • objstore/journal/journal.go
    • Line 15: warning: cannot find package "." in: (ineffassign)
    • Line 16: warning: cannot find package "." in: (ineffassign)
    • Line 15: warning: could not import github.com/boltdb/bolt (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/cznic/b (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/boltdb/bolt (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/cznic/b (invalid package name: "") (ineffassign)
    • objstore/journal/journal_test.go
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: could not import github.com/stretchr/testify/assert (invalid package name: "") (ineffassign)
    • Line 14: warning: undeclared name: Meta (ineffassign)
    • Line 17: warning: undeclared name: Meta (ineffassign)
    • Line 22: warning: undeclared name: Meta (ineffassign)
    • Line 23: warning: undeclared name: Meta (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!