Preparing report...

Report for github.com/dennis-tra/pcp

A+    Excellent!    Found 31 issues across 45 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!


golint35%

Golint is a linter for Go source code.

    • pcp/pkg/node/transfer.go
    • Line 34: warning: exported type TransferHandler should have comment or be unexported (golint)
    • Line 39: warning: exported method TransferProtocol.RegisterTransferHandler should have comment or be unexported (golint)
    • Line 47: warning: exported method TransferProtocol.UnregisterTransferHandler should have comment or be unexported (golint)
    • Line 55: warning: comment on exported function NewTransferProtocol should be of the form "NewTransferProtocol ..." (golint)
    • Line 228: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pcp/internal/wrap/xdg.go
    • Line 7: warning: exported type Xdger should have comment or be unexported (golint)
    • Line 11: warning: exported type Xdg should have comment or be unexported (golint)
    • Line 13: warning: exported method Xdg.ConfigFile should have comment or be unexported (golint)
    • pcp/pkg/crypt/crypt.go
    • Line 1: warning: package comment should be of the form "Package crypt ..." (golint)
    • Line 15: warning: exported const NonceLength should have comment or be unexported (golint)
    • pcp/pkg/mdns/advertiser.go
    • Line 11: warning: exported type Advertiser should have comment or be unexported (golint)
    • Line 15: warning: exported function NewAdvertiser should have comment or be unexported (golint)
    • Line 57: warning: exported method Advertiser.Shutdown should have comment or be unexported (golint)
    • pcp/pkg/node/node.go
    • Line 36: warning: exported type State should have comment or be unexported (golint)
    • Line 39: warning: exported const Idle should have comment (or a comment on this block) or be unexported (golint)
    • Line 118: warning: exported method Node.Shutdown should have comment or be unexported (golint)
    • Line 126: warning: exported method Node.SetState should have comment or be unexported (golint)
    • Line 134: warning: exported method Node.GetState should have comment or be unexported (golint)
    • pcp/pkg/node/pake.go
    • Line 19: warning: comment on exported const ProtocolPake should be of the form "ProtocolPake ..." (golint)
    • Line 22: warning: exported type PakeProtocol should have comment or be unexported (golint)
    • Line 43: warning: exported function NewPakeProtocol should have comment or be unexported (golint)
    • Line 89: warning: exported type KeyExchangeHandler should have comment or be unexported (golint)
    • Line 93: warning: exported method PakeProtocol.RegisterKeyExchangeHandler should have comment or be unexported (golint)
    • Line 101: warning: exported method PakeProtocol.UnregisterKeyExchangeHandler should have comment or be unexported (golint)
    • Line 217: warning: exported method PakeProtocol.StartKeyExchange should have comment or be unexported (golint)
    • pcp/pkg/service/service.go
    • Line 16: warning: comment on exported const Idle should be of the form "Idle ..." (golint)
    • Line 18: warning: exported const Started should have comment (or a comment on this block) or be unexported (golint)
    • pcp/internal/log/log.go
    • Line 13: warning: exported type Level should have comment or be unexported (golint)
    • Line 16: warning: exported const DebugLevel should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported function SetLevel should have comment or be unexported (golint)
    • Line 54: warning: exported function Info should have comment or be unexported (golint)
    • Line 62: warning: exported function Infoln should have comment or be unexported (golint)
    • Line 70: warning: exported function Infor should have comment or be unexported (golint)
    • Line 85: warning: exported function Infof should have comment or be unexported (golint)
    • Line 93: warning: exported function Debug should have comment or be unexported (golint)
    • Line 101: warning: exported function Debugln should have comment or be unexported (golint)
    • Line 109: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 117: warning: exported function Warning should have comment or be unexported (golint)
    • Line 125: warning: exported function Warningln should have comment or be unexported (golint)
    • Line 133: warning: exported function Warningf should have comment or be unexported (golint)
    • Line 141: warning: exported function Error should have comment or be unexported (golint)
    • Line 146: warning: exported function Errorln should have comment or be unexported (golint)
    • Line 151: warning: exported function Errorf should have comment or be unexported (golint)
    • pcp/pkg/receive/node.go
    • Line 21: warning: exported type PeerState should have comment or be unexported (golint)
    • Line 24: warning: exported const NotConnected should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type Node should have comment or be unexported (golint)
    • Line 39: warning: exported type Discoverer should have comment or be unexported (golint)
    • Line 44: warning: exported function InitNode should have comment or be unexported (golint)
    • Line 62: warning: exported method Node.Shutdown should have comment or be unexported (golint)
    • Line 69: warning: exported method Node.StartDiscovering should have comment or be unexported (golint)
    • Line 114: warning: exported method Node.StopDiscovering should have comment or be unexported (golint)
    • Line 175: warning: exported method Node.HandlePushRequest should have comment or be unexported (golint)
    • Line 239: warning: exported method Node.TransferFinishHandler should have comment or be unexported (golint)
    • pcp/pkg/pb/p2p.aux.go
    • Line 8: warning: exported type HeaderMessage should have comment or be unexported (golint)
    • Line 15: warning: exported method PushRequest.SetHeader should have comment or be unexported (golint)
    • Line 19: warning: exported method PushResponse.SetHeader should have comment or be unexported (golint)
    • Line 23: warning: exported method PushRequest.PeerID should have comment or be unexported (golint)
    • Line 27: warning: exported method PushResponse.PeerID should have comment or be unexported (golint)
    • Line 31: warning: exported function NewPushResponse should have comment or be unexported (golint)
    • Line 35: warning: exported function NewPushRequest should have comment or be unexported (golint)
    • pcp/pkg/config/settings.go
    • Line 8: warning: exported type Settings should have comment or be unexported (golint)
    • Line 13: warning: exported function LoadSettings should have comment or be unexported (golint)
    • Line 34: warning: exported method Settings.Save should have comment or be unexported (golint)
    • pcp/internal/wrap/manet.go
    • Line 8: warning: exported type Maneter should have comment or be unexported (golint)
    • Line 12: warning: exported type Manet should have comment or be unexported (golint)
    • Line 14: warning: exported method Manet.IsPublicAddr should have comment or be unexported (golint)
    • pcp/pkg/mdns/discoverer.go
    • Line 17: warning: exported type Discoverer should have comment or be unexported (golint)
    • Line 21: warning: exported function NewDiscoverer should have comment or be unexported (golint)
    • Line 25: warning: exported method Discoverer.Discover should have comment or be unexported (golint)
    • Line 59: warning: exported method Discoverer.Shutdown should have comment or be unexported (golint)
    • pcp/gen.go
    • Line 1: warning: package comment should be of the form "Package pcp ..." (golint)
    • pcp/internal/wrap/discovery.go
    • Line 11: warning: exported type Discoverer should have comment or be unexported (golint)
    • Line 15: warning: exported type Discovery should have comment or be unexported (golint)
    • Line 17: warning: exported method Discovery.NewMdnsService should have comment or be unexported (golint)
    • pcp/internal/wrap/time.go
    • Line 7: warning: exported type Timer should have comment or be unexported (golint)
    • Line 14: warning: exported type Time should have comment or be unexported (golint)
    • Line 16: warning: exported method Time.AfterFunc should have comment or be unexported (golint)
    • Line 20: warning: exported method Time.Now should have comment or be unexported (golint)
    • Line 24: warning: exported method Time.NewTimer should have comment or be unexported (golint)
    • Line 28: warning: exported method Time.Sleep should have comment or be unexported (golint)
    • pcp/pkg/words/words.go
    • Line 12: warning: exported type Language should have comment or be unexported (golint)
    • Line 15: warning: exported const English should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported var Lists should have comment or be unexported (golint)
    • Line 38: warning: exported var ErrUnsupportedLanguage should have comment or be unexported (golint)
    • Line 60: warning: exported function ToInts should have comment or be unexported (golint)
    • pcp/pkg/config/config.go
    • Line 16: warning: exported const Prefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: exported function LoadConfig should have comment or be unexported (golint)
    • Line 61: warning: exported function FillContext should have comment or be unexported (golint)
    • Line 66: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 70: warning: exported function FromContext should have comment or be unexported (golint)
    • pcp/pkg/send/node.go
    • Line 32: warning: exported type Advertiser should have comment or be unexported (golint)
    • Line 57: warning: exported method Node.Shutdown should have comment or be unexported (golint)
    • Line 106: warning: exported method Node.StopAdvertising should have comment or be unexported (golint)
    • Line 118: warning: exported method Node.HandleSuccessfulKeyExchange should have comment or be unexported (golint)
    • Line 137: warning: exported method Node.Transfer should have comment or be unexported (golint)
    • pcp/pkg/receive/transfer.go
    • Line 14: warning: exported type TransferHandler should have comment or be unexported (golint)
    • Line 20: warning: exported function NewTransferHandler should have comment or be unexported (golint)
    • Line 24: warning: exported method TransferHandler.Done should have comment or be unexported (golint)
    • Line 29: warning: exported method TransferHandler.HandleFile should have comment or be unexported (golint)
    • pcp/pkg/dht/error.go
    • Line 9: warning: exported type ErrConnThresholdNotReached should have comment or be unexported (golint)
    • Line 17: warning: exported method ErrConnThresholdNotReached.Log should have comment or be unexported (golint)
    • pcp/internal/wrap/ioutil.go
    • Line 9: warning: exported type Ioutiler should have comment or be unexported (golint)
    • Line 14: warning: exported type Ioutil should have comment or be unexported (golint)
    • Line 16: warning: exported method Ioutil.ReadFile should have comment or be unexported (golint)
    • Line 20: warning: exported method Ioutil.WriteFile should have comment or be unexported (golint)
    • pcp/pkg/dht/discoverer.go
    • Line 70: warning: exported method Discoverer.SetOffset should have comment or be unexported (golint)
    • Line 75: warning: exported method Discoverer.Shutdown should have comment or be unexported (golint)
    • pcp/pkg/node/push.go
    • Line 14: warning: comment on exported const ProtocolPushRequest should be of the form "ProtocolPushRequest ..." (golint)
    • Line 24: warning: exported type PushRequestHandler should have comment or be unexported (golint)
    • Line 28: warning: exported function NewPushProtocol should have comment or be unexported (golint)
    • Line 32: warning: exported method PushProtocol.RegisterPushRequestHandler should have comment or be unexported (golint)
    • Line 40: warning: exported method PushProtocol.UnregisterPushRequestHandler should have comment or be unexported (golint)
    • Line 85: warning: exported method PushProtocol.SendPushRequest should have comment or be unexported (golint)
    • pcp/internal/wrap/dht.go
    • Line 12: warning: exported type DHTer should have comment or be unexported (golint)
    • Line 16: warning: exported type DHT should have comment or be unexported (golint)
    • Line 18: warning: exported method DHT.GetDefaultBootstrapPeerAddrInfos should have comment or be unexported (golint)
    • Line 22: warning: exported type IpfsDHT should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell97%

Misspell Finds commonly misspelled English words