Preparing report...

Report for github.com/projectcalico/node

A+    Excellent!    Found 17 issues across 33 files

Tweet

gofmt96%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


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!


gocyclo87%

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.

    • node/pkg/allocateip/allocateip.go
    • Line 235: warning: cyclomatic complexity 22 of function ensureHostTunnelAddress() is high (> 15) (gocyclo)
    • Line 482: warning: cyclomatic complexity 21 of function removeHostTunnelAddr() is high (> 15) (gocyclo)
    • Line 582: warning: cyclomatic complexity 20 of function determineEnabledPoolCIDRs() is high (> 15) (gocyclo)
    • node/pkg/lifecycle/startup/startup.go
    • Line 807: warning: cyclomatic complexity 30 of function configureIPPools() is high (> 15) (gocyclo)
    • Line 1003: warning: cyclomatic complexity 25 of function checkConflictingNodes() is high (> 15) (gocyclo)
    • Line 1084: warning: cyclomatic complexity 25 of function ensureDefaultConfig() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 21 of function configureIPsAndSubnets() is high (> 15) (gocyclo)
    • Line 91: warning: cyclomatic complexity 20 of function Run() is high (> 15) (gocyclo)

golint57%

Golint is a linter for Go source code.

    • node/pkg/health/health.go
    • Line 1: warning: package comment should be of the form "Package health ..." (golint)
    • Line 55: warning: exported function Run should have comment or be unexported (golint)
    • node/pkg/lifecycle/utils/utils.go
    • Line 68: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 148: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 172: warning: comment on exported function WriteNodeConfig should be of the form "WriteNodeConfig ..." (golint)
    • Line 184: warning: comment on exported function SetNodeNetworkUnavailableCondition should be of the form "SetNodeNetworkUnavailableCondition ..." (golint)
    • node/pkg/lifecycle/startup/startup.go
    • Line 1: warning: package comment should be of the form "Package startup ..." (golint)
    • Line 53: warning: exported const DEFAULT_IPV4_POOL_CIDR should have comment (or a comment on this block) or be unexported (golint)
    • Line 68: warning: comment on exported const RancherStateConfigMap should be of the form "RancherStateConfigMap ..." (golint)
    • Line 75: warning: comment on exported var VERSION should be of the form "VERSION ..." (golint)
    • Line 85: warning: comment on exported function Run should be of the form "Run ..." (golint)
    • Line 301: warning: exported function MonitorIPAddressSubnets should have comment or be unexported (golint)
    • Line 375: warning: exported function ConfigureLogging should have comment or be unexported (golint)
    • Line 746: 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 791: warning: comment on exported function GenerateIPv6ULAPrefix should be of the form "GenerateIPv6ULAPrefix ..." (golint)
    • Line 1010: 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)
    • node/pkg/health/bird/bird.go
    • Line 34: warning: exported function GRInProgress should have comment or be unexported (golint)
    • Line 135: warning: exported function GetPeers 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!