Preparing report...

Report for github.com/No-Trust/peerster

A+    Excellent!    Found 35 issues across 51 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!


gocyclo96%

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.

    • peerster/common/standard_output_writer.go
    • Line 8: warning: exported method NewMessage.ClientNewMessageString should have comment or be unexported (golint)
    • Line 13: warning: exported method NewPrivateMessage.ClientNewPrivateMessageString should have comment or be unexported (golint)
    • Line 18: warning: exported method NewFile.ClientNewFileString should have comment or be unexported (golint)
    • Line 23: warning: exported method FileRequest.ClientNewFileRequestString should have comment or be unexported (golint)
    • Line 29: warning: exported method FileRequest.GossiperAlreadyHasFileString should have comment or be unexported (golint)
    • Line 37: warning: exported function DownloadingMetafileNotification should have comment or be unexported (golint)
    • Line 42: warning: exported function DownloadingChunkNotification should have comment or be unexported (golint)
    • Line 47: warning: exported function ReconstructedNotification should have comment or be unexported (golint)
    • Line 52: warning: exported function AlreadyHaveFileNotification should have comment or be unexported (golint)
    • peerster/rep/sig.go
    • Line 13: warning: comment on exported method ReputationTable.InitSigRepForPeer should be of the form "InitSigRepForPeer ..." (golint)
    • Line 29: warning: comment on exported method ReputationTable.GetSigRep should be of the form "GetSigRep ..." (golint)
    • Line 46: warning: comment on exported method ReputationTable.Reputation should be of the form "Reputation ..." (golint)
    • Line 54: warning: comment on exported method ReputationTable.ForEachSigRep should be of the form "ForEachSigRep ..." (golint)
    • Line 69: warning: exported method ReputationTable.DecreaseSigRep should have comment or be unexported (golint)
    • Line 73: warning: exported method ReputationTable.IncreaseSigRep should have comment or be unexported (golint)
    • peerster/common/clientmessage.go
    • Line 9: warning: exported type Packet should have comment or be unexported (golint)
    • Line 14: warning: comment on exported type ClientPacket should be of the form "ClientPacket ..." (with optional leading article) (golint)
    • Line 29: warning: exported type NewMessage should have comment or be unexported (golint)
    • Line 34: warning: exported type NewPrivateMessage should have comment or be unexported (golint)
    • Line 40: warning: exported type NewNode should have comment or be unexported (golint)
    • Line 44: warning: exported type NewFile should have comment or be unexported (golint)
    • Line 48: warning: exported type FileRequest should have comment or be unexported (golint)
    • Line 55: warning: comment on exported type ReputationMap should be of the form "ReputationMap ..." (with optional leading article) (golint)
    • Line 61: warning: comment on exported type RepUpdate should be of the form "RepUpdate ..." (with optional leading article) (golint)
    • peerster/gossiper/file_download.go
    • Line 30: warning: comment on exported type FileDownloads should be of the form "FileDownloads ..." (with optional leading article) (golint)
    • Line 36: warning: exported function NewFileDownloads should have comment or be unexported (golint)
    • Line 52: warning: comment on exported method FileDownloads.GetChunk should be of the form "GetChunk ..." (golint)
    • Line 72: warning: exported method FileDownloads.Add should have comment or be unexported (golint)
    • Line 84: warning: exported method FileDownloads.Remove should have comment or be unexported (golint)
    • peerster/gossiper/util.go
    • Line 44: warning: exported function UDPAddrToString should have comment or be unexported (golint)
    • Line 49: warning: comment on exported function AckString should be of the form "AckString ..." (golint)
    • Line 154: warning: exported function GetChunkFilename should have comment or be unexported (golint)
    • Line 166: warning: exported function GetChunkFilenameFromHash should have comment or be unexported (golint)
    • peerster/common/peer.go
    • Line 1: warning: package comment should be of the form "Package common ..." (golint)
    • Line 9: warning: comment on exported type Peer should be of the form "Peer ..." (with optional leading article) (golint)
    • Line 15: warning: comment on exported method Peer.Copy should be of the form "Copy ..." (golint)
    • Line 30: warning: exported method Peer.Str should have comment or be unexported (golint)
    • Line 35: warning: exported method Peer.Equals should have comment or be unexported (golint)
    • Line 35: warning: receiver name A should be consistent with previous receiver name peer for Peer (golint)
    • peerster/rep/constants.go
    • Line 7: warning: comment on exported const MIN_REP should be of the form "MIN_REP ..." (golint)
    • Line 9: warning: exported const MAX_REP should have comment or be unexported (golint)
    • Line 10: warning: exported const INIT_REP should have comment or be unexported (golint)
    • Line 12: warning: exported const REP_RANGE should have comment or be unexported (golint)
    • Line 14: warning: comment on exported const SIG_INCREASE_LIMIT should be of the form "SIG_INCREASE_LIMIT ..." (golint)
    • Line 16: warning: exported const SIG_DECREASE_LIMIT should have comment or be unexported (golint)
    • Line 18: warning: comment on exported const CONTRIB_ALPHA should be of the form "CONTRIB_ALPHA ..." (golint)
    • Line 20: warning: exported const CONTRIB_ONE_MINUS_ALPHA should have comment or be unexported (golint)
    • Line 22: warning: comment on exported const DEFAULT_REP_REQ_TIMER should be of the form "DEFAULT_REP_REQ_TIMER ..." (golint)
    • Line 24: warning: exported const REP_REQ_PEER_COUNT should have comment or be unexported (golint)
    • Line 26: warning: exported const UPDATE_WEIGHT_LIMIT should have comment or be unexported (golint)
    • Line 28: warning: exported const UPDATER_DECREASE_LIMIT should have comment or be unexported (golint)
    • peerster/gui/webserver.go
    • Line 18: warning: exported var UIPort should have comment or be unexported (golint)
    • Line 19: warning: exported var LocalAddr should have comment or be unexported (golint)
    • Line 20: warning: exported var ServerAddr should have comment or be unexported (golint)
    • Line 21: warning: exported var ServerConn should have comment or be unexported (golint)
    • Line 30: warning: exported var KeyRingJSON should have comment or be unexported (golint)
    • Line 32: warning: exported type WebMessage should have comment or be unexported (golint)
    • peerster/gossiper/routing.go
    • Line 12: warning: exported type RoutingTable should have comment or be unexported (golint)
    • Line 19: warning: exported method RoutingTable.Get should have comment or be unexported (golint)
    • Line 26: warning: exported function NewRoutingTable should have comment or be unexported (golint)
    • Line 36: warning: exported method RoutingTable.Str should have comment or be unexported (golint)
    • Line 46: warning: exported method RoutingTable.AddNextHop should have comment or be unexported (golint)
    • Line 77: warning: exported method RoutingTable.GetIds should have comment or be unexported (golint)
    • peerster/gossiper/standard_output_writer.go
    • Line 13: warning: exported function DirectRouteString should have comment or be unexported (golint)
    • Line 18: warning: exported method SimpleMessage.SimpleMessageString should have comment or be unexported (golint)
    • Line 23: warning: exported method RumorMessage.RumorString should have comment or be unexported (golint)
    • Line 34: warning: exported method RumorMessage.MongeringString should have comment or be unexported (golint)
    • Line 45: warning: exported method StatusPacket.StatusString should have comment or be unexported (golint)
    • Line 54: warning: exported function CoinFlipString should have comment or be unexported (golint)
    • Line 59: warning: exported function SyncString should have comment or be unexported (golint)
    • Line 64: warning: exported method StatusPacket.AntiEntropyString should have comment or be unexported (golint)
    • Line 73: warning: exported method PrivateMessage.PrivateMessageString should have comment or be unexported (golint)
    • Line 80: warning: exported method DataRequest.DataRequestString should have comment or be unexported (golint)
    • Line 85: warning: exported method DataReply.DataReplyString should have comment or be unexported (golint)
    • Line 90: warning: exported function FileSubmissionDone should have comment or be unexported (golint)
    • Line 97: warning: exported function FileWrongSigMetaUploader should have comment or be unexported (golint)
    • Line 103: warning: exported function FileGoodSigMetaUploader should have comment or be unexported (golint)
    • Line 107: warning: exported function FileWrongSigUploader should have comment or be unexported (golint)
    • Line 113: warning: exported function FileGoodSigUploader should have comment or be unexported (golint)
    • Line 117: warning: exported function FileWrongSigOrigin should have comment or be unexported (golint)
    • Line 124: warning: exported function FileGoodSigOrigin should have comment or be unexported (golint)
    • Line 128: warning: exported function FileGoodOrigin should have comment or be unexported (golint)
    • Line 132: warning: exported function FileWarningUnverifiedOrigin should have comment or be unexported (golint)
    • Line 136: warning: exported function FileErrorUnverifiedOrigin should have comment or be unexported (golint)
    • Line 142: warning: exported function KeyExchangeSignString should have comment or be unexported (golint)
    • Line 146: warning: exported function KeyExchangeSendString should have comment or be unexported (golint)
    • Line 151: warning: exported function KeyExchangeReceiveString should have comment or be unexported (golint)
    • Line 160: warning: exported function KeyExchangeReceiveUnverifiedString should have comment or be unexported (golint)
    • peerster/common/peerset.go
    • Line 1: warning: package comment should be of the form "Package common ..." (golint)
    • Line 11: warning: exported type PeerSlice should have comment or be unexported (golint)
    • Line 15: warning: comment on exported type PeerSet should be of the form "PeerSet ..." (with optional leading article) (golint)
    • Line 40: warning: comment on exported method PeerSet.Contains should be of the form "Contains ..." (golint)
    • Line 53: warning: exported method PeerSet.Remove should have comment or be unexported (golint)
    • Line 82: warning: exported method PeerSet.ToPeerArray should have comment or be unexported (golint)
    • Line 92: warning: exported method PeerSet.ToPeerSlice should have comment or be unexported (golint)
    • Line 97: warning: exported function NewSet should have comment or be unexported (golint)
    • Line 105: warning: exported function NewSetFromAddrs should have comment or be unexported (golint)
    • Line 114: warning: exported method PeerSet.RandomPeer should have comment or be unexported (golint)
    • Line 129: warning: exported method PeerSet.PeersListString should have comment or be unexported (golint)
    • Line 142: warning: exported method PeerSet.Str should have comment or be unexported (golint)
    • peerster/gossiper/file_metadata.go
    • Line 9: warning: exported type FileMetadata should have comment or be unexported (golint)
    • Line 18: warning: exported function GetNumberOfChunks should have comment or be unexported (golint)
    • Line 24: warning: comment on exported method FileMetadata.GetChunkHash should be of the form "GetChunkHash ..." (golint)
    • Line 30: warning: comment on exported method FileMetadata.ChunkHashes should be of the form "ChunkHashes ..." (golint)
    • Line 44: warning: comment on exported method FileMetadata.GetPositionOfChunk should be of the form "GetPositionOfChunk ..." (golint)
    • Line 57: warning: exported type MetadataSet should have comment or be unexported (golint)
    • Line 62: warning: exported method MetadataSet.Add should have comment or be unexported (golint)
    • Line 72: warning: comment on exported method MetadataSet.Get should be of the form "Get ..." (golint)
    • Line 85: warning: comment on exported method MetadataSet.GetByName should be of the form "GetByName ..." (golint)
    • Line 98: warning: comment on exported method MetadataSet.Contains should be of the form "Contains ..." (golint)
    • Line 112: warning: exported function NewMetadataSet should have comment or be unexported (golint)
    • peerster/common/math.go
    • Line 3: warning: comment on exported function ClampFloat32 should be of the form "ClampFloat32 ..." (golint)
    • Line 24: warning: comment on exported function AbsFloat32 should be of the form "AbsFloat32 ..." (golint)
    • peerster/rep/types.go
    • Line 13: warning: comment on exported type ReputationMap should be of the form "ReputationMap ..." (with optional leading article) (golint)
    • Line 19: warning: comment on exported type ReputationTable should be of the form "ReputationTable ..." (with optional leading article) (golint)
    • Line 30: warning: comment on exported type RepUpdate should be of the form "RepUpdate ..." (with optional leading article) (golint)
    • peerster/rep/contrib.go
    • Line 25: warning: comment on exported method ReputationTable.InitContribRepForPeer should be of the form "InitContribRepForPeer ..." (golint)
    • Line 41: warning: comment on exported method ReputationTable.GetContribRep should be of the form "GetContribRep ..." (golint)
    • Line 58: warning: comment on exported method ReputationTable.ForEachContribRep should be of the form "ForEachContribRep ..." (golint)
    • Line 73: warning: comment on exported method ReputationTable.DecreaseContribRep should be of the form "DecreaseContribRep ..." (golint)
    • Line 81: warning: comment on exported method ReputationTable.IncreaseContribRep should be of the form "IncreaseContribRep ..." (golint)
    • Line 121: warning: exported method ReputationTable.ContribRandomPeer should have comment or be unexported (golint)
    • peerster/gossiper/messages.go
    • Line 11: warning: comment on exported type Messages should be of the form "Messages ..." (with optional leading article) (golint)
    • Line 17: warning: comment on exported method Messages.Get should be of the form "Get ..." (golint)
    • Line 31: warning: comment on exported method Messages.Contains should be of the form "Contains ..." (golint)
    • peerster/gossiper/main.go
    • Line 16: warning: exported const HOP_LIMIT should have comment or be unexported (golint)
    • Line 17: warning: exported const CHANNEL_SIZE should have comment or be unexported (golint)
    • Line 18: warning: exported const CHUNK_SIZE should have comment or be unexported (golint)
    • Line 19: warning: exported const FILES_DIR should have comment or be unexported (golint)
    • Line 20: warning: exported const CHUNKS_DIR should have comment or be unexported (golint)
    • Line 21: warning: exported const HASH_LENGTH should have comment or be unexported (golint)
    • Line 22: warning: exported const KEY_DIRECTORY should have comment or be unexported (golint)
    • peerster/rep/main.go
    • Line 18: warning: comment on exported function NewReputationTable should be of the form "NewReputationTable ..." (golint)
    • Line 125: warning: comment on exported method ReputationTable.MostReputablePeers should be of the form "MostReputablePeers ..." (golint)
    • peerster/rep/update.go
    • Line 13: warning: comment on exported method ReputationTable.GetUpdate should be of the form "GetUpdate ..." (golint)
    • Line 29: warning: comment on exported method ReputationTable.GetSigUpdate should be of the form "GetSigUpdate ..." (golint)
    • Line 55: warning: comment on exported method ReputationTable.GetContribUpdate should be of the form "GetContribUpdate ..." (golint)
    • Line 81: warning: comment on exported method ReputationTable.UpdateReputations should be of the form "UpdateReputations ..." (golint)
    • Line 190: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • peerster/gossiper/packets.go
    • Line 17: warning: exported type Message should have comment or be unexported (golint)
    • Line 21: warning: exported type SimpleMessage should have comment or be unexported (golint)
    • Line 26: warning: exported type PeerMessage should have comment or be unexported (golint)
    • Line 31: warning: exported type RumorMessage should have comment or be unexported (golint)
    • Line 40: warning: exported type PeerStatus should have comment or be unexported (golint)
    • Line 45: warning: exported type StatusPacket should have comment or be unexported (golint)
    • Line 52: warning: exported type PrivateMessage should have comment or be unexported (golint)
    • Line 66: warning: exported type DataRequest should have comment or be unexported (golint)
    • Line 74: warning: exported type DataReply should have comment or be unexported (golint)
    • Line 87: warning: exported type GossipPacket should have comment or be unexported (golint)
    • Line 97: warning: exported type Packet should have comment or be unexported (golint)
    • Line 118: warning: exported method StatusPacket.Length should have comment or be unexported (golint)
    • Line 125: warning: exported method StatusPacket.GetIndex should have comment or be unexported (golint)
    • Line 133: warning: exported method StatusPacket.Copy should have comment or be unexported (golint)
    • Line 147: warning: exported method StatusPacket.Get should have comment or be unexported (golint)
    • Line 165: warning: comment on exported method StatusPacket.Update should be of the form "Update ..." (golint)
    • Line 184: warning: exported method StatusPacket.Add should have comment or be unexported (golint)
    • Line 195: warning: exported function NewStatusPacket should have comment or be unexported (golint)
    • peerster/common/logs.go
    • Line 68: warning: comment on exported function InitLogger should be of the form "InitLogger ..." (golint)
    • Line 89: warning: comment on exported function Log should be of the form "Log ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign80%

IneffAssign detects ineffectual assignments in Go code.

    • peerster/awot/key_record.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: could not import github.com/No-Trust/peerster/common (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/No-Trust/peerster/common (invalid package name: "") (ineffassign)
    • peerster/awot/key_ring.go
    • 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 12: warning: could not import gonum.org/v1/gonum/graph (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import gonum.org/v1/gonum/graph/path (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import gonum.org/v1/gonum/graph/simple (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import gonum.org/v1/gonum/graph (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import gonum.org/v1/gonum/graph/path (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import gonum.org/v1/gonum/graph/simple (invalid package name: "") (ineffassign)
    • peerster/awot/key_ring_visualization.go
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: could not import gonum.org/v1/gonum/graph/encoding/dot (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import gonum.org/v1/gonum/graph/encoding/dot (invalid package name: "") (ineffassign)
    • peerster/rep/main.go
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: could not import github.com/No-Trust/peerster/common (invalid package name: "") (ineffassign)
    • peerster/cli/client.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/No-Trust/peerster/common (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/dedis/protobuf (invalid package name: "") (ineffassign)
    • peerster/gossiper/gossiper.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/No-Trust/peerster/rep (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/dedis/protobuf (invalid package name: "") (ineffassign)
    • peerster/gui/util.go
    • Line 4: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 4: warning: could not import github.com/No-Trust/peerster/common (invalid package name: "") (ineffassign)
    • Line 5: warning: could not import github.com/dedis/protobuf (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!