Preparing report...

Report for github.com/subutai-io/p2p

A+    Excellent!    Found 28 issues across 69 files

Tweet

gofmt88%

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!


golint76%

Golint is a linter for Go source code.

    • p2p/daemon.go
    • Line 44: warning: exported var UsePMTU should have comment or be unexported (golint)
    • p2p/debug.go
    • Line 61: warning: receiver name p should be consistent with previous receiver name d for Daemon (golint)
    • p2p/lib/conf.go
    • Line 10: warning: exported type Conf should have comment or be unexported (golint)
    • Line 18: warning: exported method Conf.Load should have comment or be unexported (golint)
    • Line 34: warning: exported method Conf.SetDefaults should have comment or be unexported (golint)
    • Line 42: warning: exported method Conf.GetIPTool should have comment or be unexported (golint)
    • Line 49: warning: exported method Conf.GetTAPTool should have comment or be unexported (golint)
    • Line 56: warning: exported method Conf.GetINFFile should have comment or be unexported (golint)
    • Line 63: warning: exported method Conf.GetMTU should have comment or be unexported (golint)
    • Line 70: warning: exported method Conf.GetPMTU should have comment or be unexported (golint)
    • p2p/lib/tuntap_linux.go
    • Line 90: warning: exported method TAPLinux.GetSubnet should have comment or be unexported (golint)
    • Line 119: warning: exported method TAPLinux.SetSubnet should have comment or be unexported (golint)
    • Line 213: warning: exported method TAPLinux.Deconfigure should have comment or be unexported (golint)
    • Line 336: warning: exported method TAPLinux.IsConfigured should have comment or be unexported (golint)
    • Line 340: warning: exported method TAPLinux.MarkConfigured should have comment or be unexported (golint)
    • Line 344: warning: exported method TAPLinux.EnablePMTU should have comment or be unexported (golint)
    • Line 348: warning: exported method TAPLinux.DisablePMTU should have comment or be unexported (golint)
    • Line 352: warning: exported method TAPLinux.IsPMTUEnabled should have comment or be unexported (golint)
    • Line 356: warning: exported method TAPLinux.IsBroken should have comment or be unexported (golint)
    • Line 360: warning: exported method TAPLinux.SetAuto should have comment or be unexported (golint)
    • Line 364: warning: exported method TAPLinux.IsAuto should have comment or be unexported (golint)
    • Line 368: warning: exported method TAPLinux.GetStatus should have comment or be unexported (golint)
    • p2p/instance.go
    • Line 28: warning: exported type ShowArgs should have comment or be unexported (golint)
    • Line 48: warning: exported type InstOperation should have comment or be unexported (golint)
    • Line 56: warning: exported type InstanceList should have comment or be unexported (golint)
    • p2p/main.go
    • Line 34: warning: exported var SignalChannel should have comment or be unexported (golint)
    • Line 36: warning: exported var ReadyToServe should have comment or be unexported (golint)
    • Line 38: warning: exported var StartTime should have comment or be unexported (golint)
    • p2p/show.go
    • Line 26: warning: comment on exported function CommandShow should be of the form "CommandShow ..." (golint)
    • p2p/stop.go
    • Line 73: warning: receiver name p should be consistent with previous receiver name d for Daemon (golint)
    • Line 81: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • p2p/lib/log.go
    • Line 42: warning: comment on exported function SetMinLogLevelString should be of the form "SetMinLogLevelString ..." (golint)
    • p2p/rest.go
    • Line 39: warning: exported type RESTResponse should have comment or be unexported (golint)
    • p2p/set.go
    • Line 13: warning: comment on exported function CommandSet should be of the form "CommandSet ..." (golint)
    • Line 135: warning: receiver name p should be consistent with previous receiver name d for Daemon (golint)
    • p2p/lib/platform_posix.go
    • Line 12: warning: exported const MaximumInterfaceNameLength should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: comment on exported function HavePrivileges should be of the form "HavePrivileges ..." (golint)
    • Line 31: warning: exported function GetPrivilegesLevel should have comment or be unexported (golint)

gocyclo86%

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.

    • p2p/start.go
    • Line 124: warning: cyclomatic complexity 23 of function (*Daemon).run() is high (> 15) (gocyclo)
    • p2p/show.go
    • Line 27: warning: cyclomatic complexity 22 of function CommandShow() is high (> 15) (gocyclo)
    • p2p/daemon.go
    • Line 78: warning: cyclomatic complexity 17 of function ExecDaemon() is high (> 15) (gocyclo)
    • p2p/lib/packet_handler.go
    • Line 105: warning: cyclomatic complexity 24 of function (*PeerToPeer).HandleXpeerPingMessage() is high (> 15) (gocyclo)
    • Line 339: warning: cyclomatic complexity 23 of function (*PeerToPeer).HandleLatency() is high (> 15) (gocyclo)
    • Line 445: warning: cyclomatic complexity 19 of function (*PeerToPeer).HandleComm() is high (> 15) (gocyclo)
    • p2p/lib/p2p.go
    • Line 613: warning: cyclomatic complexity 16 of function (*PeerToPeer).discoverIP() is high (> 15) (gocyclo)
    • p2p/lib/peer.go
    • Line 382: warning: cyclomatic complexity 19 of function (*NetworkPeer).sortEndpoints() is high (> 15) (gocyclo)

ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell89%

Misspell Finds commonly misspelled English words