Preparing report...

Report for github.com/gigawattio/zklib

A    Great!    Found 15 issues across 22 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!


gocyclo63%

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.


golint45%

Golint is a linter for Go source code.

    • zklib/candidate/node.go
    • Line 3: warning: exported type Node should have comment or be unexported (golint)
    • Line 10: warning: exported function NewNode should have comment or be unexported (golint)
    • zklib/util/create_p.go
    • Line 45: warning: exported function MustCreateProtectedEphemeralSequential should have comment or be unexported (golint)
    • zklib/cluster/primitives/primitives.go
    • Line 10: warning: exported const Leader should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported type Node should have comment or be unexported (golint)
    • Line 20: warning: exported function NewNode should have comment or be unexported (golint)
    • Line 33: warning: exported type Update should have comment or be unexported (golint)
    • zklib/dmutex/distributed_mutex_service.go
    • Line 19: warning: exported type DistributedMutexService should have comment or be unexported (golint)
    • Line 28: warning: error var DistributedMutexAcquisitionFailed should have name of the form ErrFoo (golint)
    • Line 28: warning: exported var DistributedMutexAcquisitionFailed should have comment or be unexported (golint)
    • Line 29: warning: error var DistributedMutexNoLeader should have name of the form ErrFoo (golint)
    • Line 32: warning: exported function NewDistributedMutexService should have comment or be unexported (golint)
    • Line 42: warning: exported method DistributedMutexService.Lock should have comment or be unexported (golint)
    • Line 54: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 79: 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 107: warning: exported method DistributedMutexService.Unlock should have comment or be unexported (golint)
    • Line 128: warning: exported method DistributedMutexService.List should have comment or be unexported (golint)
    • Line 148: warning: exported method DistributedMutexService.Clean should have comment or be unexported (golint)
    • Line 227: warning: exported function IsAcquisitionFailedError should have comment or be unexported (golint)
    • zklib/candidate/candidate.go
    • Line 20: warning: exported const LeaderChanSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: error var AlreadyRegisteredError should have name of the form ErrFoo (golint)
    • Line 24: warning: exported var AlreadyRegisteredError should have comment or be unexported (golint)
    • Line 25: warning: error var NotRegisteredError should have name of the form ErrFoo (golint)
    • Line 26: warning: error var NotEnrolledError should have name of the form ErrFoo (golint)
    • Line 27: warning: error var InvalidChildrenLenError should have name of the form ErrFoo (golint)
    • Line 36: warning: exported type Candidate should have comment or be unexported (golint)
    • Line 48: warning: exported function New should have comment or be unexported (golint)
    • Line 58: warning: exported method Candidate.Registered should have comment or be unexported (golint)
    • Line 64: warning: exported method Candidate.Register should have comment or be unexported (golint)
    • Line 266: warning: exported method Candidate.Unregister should have comment or be unexported (golint)
    • Line 334: warning: exported method Candidate.Participants should have comment or be unexported (golint)
    • zklib/cluster/cluster.go
    • Line 27: warning: exported type Coordinator should have comment or be unexported (golint)
    • Line 95: warning: exported method Coordinator.Start should have comment or be unexported (golint)
    • Line 119: warning: exported method Coordinator.Stop should have comment or be unexported (golint)
    • Line 140: warning: exported method Coordinator.Id should have comment or be unexported (golint)
    • Line 164: warning: exported method Coordinator.LeaderData should have comment or be unexported (golint)
    • Line 197: warning: exported method Coordinator.Members should have comment or be unexported (golint)
    • zklib/testutil/zk_test_util.go
    • Line 72: warning: exported function WithTestZkCluster should have comment or be unexported (golint)
    • Line 88: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 195: warning: exported function WhenZkHasSession should have comment or be unexported (golint)
    • zklib/candidate/participant.go
    • Line 15: warning: exported type ParticipantConfig should have comment or be unexported (golint)
    • Line 23: warning: exported type Event should have comment or be unexported (golint)
    • Line 25: warning: exported const EventsChanSize should have comment or be unexported (golint)
    • Line 28: warning: exported const ConnectedEvent should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported type Participant should have comment or be unexported (golint)
    • Line 40: warning: exported function Participate should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!