Preparing report...

Report for github.com/halturin/ergo

A    Great!    Found 41 issues across 55 files

Tweet

gofmt74%

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!


gocyclo90%

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.

    • ergo/dist/dist.go
    • Line 950: warning: cyclomatic complexity 24 of function (*Link).Writer() is high (> 15) (gocyclo)
    • Line 238: warning: cyclomatic complexity 19 of function Handshake() is high (> 15) (gocyclo)
    • Line 698: warning: cyclomatic complexity 19 of function (*Link).decodeFragment() is high (> 15) (gocyclo)
    • Line 362: warning: cyclomatic complexity 18 of function HandshakeAccept() is high (> 15) (gocyclo)
    • Line 619: warning: cyclomatic complexity 16 of function (*Link).ReadDist() is high (> 15) (gocyclo)
    • ergo/etf/etf.go
    • Line 189: warning: cyclomatic complexity 25 of function termIntoStruct() is high (> 15) (gocyclo)

golint49%

Golint is a linter for Go source code.

    • ergo/dist/epmd.go
    • Line 18: warning: exported const EPMD_ALIVE2_REQ should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type EPMD should have comment or be unexported (golint)
    • Line 57: warning: exported method EPMD.Init should have comment or be unexported (golint)
    • Line 131: warning: exported method EPMD.AddStaticRoute should have comment or be unexported (golint)
    • Line 151: warning: exported method EPMD.RemoveStaticRoute should have comment or be unexported (golint)
    • Line 158: warning: exported method EPMD.ResolvePort should have comment or be unexported (golint)
    • Line 203: warning: don't use underscores in Go names; func compose_ALIVE2_REQ should be composeALIVE2REQ (golint)
    • Line 222: warning: don't use underscores in Go names; func read_ALIVE2_RESP should be readALIVE2RESP (golint)
    • Line 229: warning: don't use underscores in Go names; func compose_PORT_PLEASE2_REQ should be composePORTPLEASE2REQ (golint)
    • Line 294: warning: exported function Server should have comment or be unexported (golint)
    • Line 373: warning: don't use underscores in Go names; method compose_ALIVE2_RESP should be composeALIVE2RESP (golint)
    • Line 406: warning: don't use underscores in Go names; method compose_EPMD_PORT2_RESP should be composeEPMDPORT2RESP (golint)
    • Line 440: warning: don't use underscores in Go names; method compose_EPMD_NAMES_RESP should be composeEPMDNAMESRESP (golint)
    • ergo/etf/cache.go
    • Line 12: warning: exported type AtomCache should have comment or be unexported (golint)
    • Line 20: warning: exported type CacheItem should have comment or be unexported (golint)
    • Line 26: warning: exported type ListAtomCache should have comment or be unexported (golint)
    • Line 44: warning: exported method AtomCache.Append should have comment or be unexported (golint)
    • Line 54: warning: exported method AtomCache.GetLastID should have comment or be unexported (golint)
    • Line 61: warning: exported function NewAtomCache should have comment or be unexported (golint)
    • Line 96: warning: exported method AtomCache.List should have comment or be unexported (golint)
    • Line 103: warning: exported method AtomCache.ListSince should have comment or be unexported (golint)
    • Line 107: warning: exported function TakeListAtomCache should have comment or be unexported (golint)
    • Line 111: warning: exported function ReleaseListAtomCache should have comment or be unexported (golint)
    • Line 115: warning: exported method ListAtomCache.Reset should have comment or be unexported (golint)
    • Line 119: warning: exported method ListAtomCache.Append should have comment or be unexported (golint)
    • Line 126: warning: exported method ListAtomCache.Len should have comment or be unexported (golint)
    • ergo/etf/encode.go
    • Line 13: warning: exported var ErrStringTooLong should have comment or be unexported (golint)
    • Line 20: warning: exported function Encode should have comment or be unexported (golint)
    • ergo/linux.go
    • Line 9: warning: don't use underscores in Go names; func os_dep_getResourceUsage should be osDepGetResourceUsage (golint)
    • ergo/node.go
    • Line 231: warning: exported method Node.Unregister should have comment or be unexported (golint)
    • Line 756: warning: exported method Node.VersionERTS should have comment or be unexported (golint)
    • Line 760: warning: exported method Node.VersionOTP should have comment or be unexported (golint)
    • ergo/lib/tools.go
    • Line 12: warning: exported type Buffer should have comment or be unexported (golint)
    • Line 19: warning: exported var DefaultBufferLength should have comment or be unexported (golint)
    • Line 43: warning: exported function Log should have comment or be unexported (golint)
    • Line 49: warning: exported function TakeTimer should have comment or be unexported (golint)
    • Line 53: warning: exported function ReleaseTimer should have comment or be unexported (golint)
    • Line 58: warning: exported function TakeBuffer should have comment or be unexported (golint)
    • Line 62: warning: exported function ReleaseBuffer should have comment or be unexported (golint)
    • Line 73: warning: exported method Buffer.Reset should have comment or be unexported (golint)
    • Line 78: warning: exported method Buffer.Set should have comment or be unexported (golint)
    • Line 82: warning: exported method Buffer.AppendByte should have comment or be unexported (golint)
    • Line 86: warning: exported method Buffer.Append should have comment or be unexported (golint)
    • Line 94: warning: exported method Buffer.Len should have comment or be unexported (golint)
    • Line 98: warning: exported method Buffer.WriteDataTo should have comment or be unexported (golint)
    • Line 122: warning: exported method Buffer.ReadDataFrom should have comment or be unexported (golint)
    • Line 147: warning: exported method Buffer.Allocate should have comment or be unexported (golint)
    • Line 158: warning: exported method Buffer.Extend should have comment or be unexported (golint)
    • ergo/dist/dist.go
    • Line 25: warning: exported var ErrMissingInCache should have comment or be unexported (golint)
    • Line 57: warning: comment on exported const PUBLISHED should be of the form "PUBLISHED ..." (golint)
    • Line 59: warning: exported const ATOM_CACHE should have comment (or a comment on this block) or be unexported (golint)
    • Line 106: warning: exported type Link should have comment or be unexported (golint)
    • Line 138: warning: exported method Link.GetPeerName should have comment or be unexported (golint)
    • Line 238: warning: exported function Handshake should have comment or be unexported (golint)
    • Line 362: warning: exported function HandshakeAccept should have comment or be unexported (golint)
    • Line 482: warning: exported method Link.Close should have comment or be unexported (golint)
    • Line 488: warning: exported method Link.PeerName should have comment or be unexported (golint)
    • Line 536: warning: exported method Link.ReadHandlePacket should have comment or be unexported (golint)
    • Line 603: warning: exported method Link.ReadPacket should have comment or be unexported (golint)
    • Line 619: warning: exported method Link.ReadDist should have comment or be unexported (golint)
    • Line 686: 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 880: warning: exported method Link.SetAtomCache should have comment or be unexported (golint)
    • Line 950: warning: exported method Link.Writer should have comment or be unexported (golint)
    • Line 1139: warning: exported method Link.GetRemoteName should have comment or be unexported (golint)
    • ergo/gen_stage_test.go
    • Line 31: warning: error should be the last type when returning multiple items (golint)
    • Line 62: warning: error should be the last type when returning multiple items (golint)
    • ergo/gen_server.go
    • Line 11: warning: exported const DefaultCallTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported method GenServer.Loop should have comment or be unexported (golint)
    • ergo/examples/genstage/main.go
    • Line 15: warning: don't use underscores in Go names; var node_abc should be nodeAbc (golint)
    • Line 16: warning: don't use underscores in Go names; var node_def should be nodeDef (golint)
    • Line 38: warning: don't use underscores in Go names; var c1_sub_opts should be c1SubOpts (golint)
    • Line 46: warning: don't use underscores in Go names; var c2_sub_opts should be c2SubOpts (golint)
    • ergo/etf/etf.go
    • Line 10: warning: exported type Term should have comment or be unexported (golint)
    • Line 11: warning: exported type Tuple should have comment or be unexported (golint)
    • Line 12: warning: exported type List should have comment or be unexported (golint)
    • Line 13: warning: exported type Atom should have comment or be unexported (golint)
    • Line 14: warning: exported type Map should have comment or be unexported (golint)
    • Line 16: warning: exported type Pid should have comment or be unexported (golint)
    • Line 23: warning: exported type Port should have comment or be unexported (golint)
    • Line 29: warning: exported type Ref should have comment or be unexported (golint)
    • Line 39: warning: exported type Function should have comment or be unexported (golint)
    • Line 55: warning: exported function StringTerm should have comment or be unexported (golint)
    • Line 71: warning: exported type Export should have comment or be unexported (golint)
    • Line 122: warning: exported method Map.Element should have comment or be unexported (golint)
    • Line 126: warning: exported method List.Element should have comment or be unexported (golint)
    • Line 130: warning: exported method Tuple.Element should have comment or be unexported (golint)
    • Line 134: warning: exported method Pid.Str should have comment or be unexported (golint)
    • Line 140: warning: exported type ProplistElement should have comment or be unexported (golint)
    • Line 145: warning: comment on exported function TermProplistIntoStruct should be of the form "TermProplistIntoStruct ..." (golint)
    • Line 175: warning: comment on exported function TermMapIntoStruct should be of the form "TermMapIntoStruct ..." (golint)
    • Line 299: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 332: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 387: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 474: warning: exported type StructPopulatorError should have comment or be unexported (golint)
    • Line 483: warning: exported function NewInvalidTypesError should have comment or be unexported (golint)
    • Line 490: warning: exported type InvalidStructKeyError should have comment or be unexported (golint)
    • ergo/gen_stage.go
    • Line 10: warning: exported type GenStageCancelMode should have comment or be unexported (golint)
    • Line 42: warning: exported const GenStageCancelPermanent should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: exported var ErrNotAProducer should have comment or be unexported (golint)
    • Line 110: warning: exported type GenStageSubscription should have comment or be unexported (golint)
    • Line 124: warning: exported type GenStageSubscribeTo should have comment or be unexported (golint)
    • Line 129: warning: exported type GenStageSubscribeOptions should have comment or be unexported (golint)
    • Line 152: warning: exported type GenStageCancelReason should have comment or be unexported (golint)
    • Line 157: warning: exported type GenStage should have comment or be unexported (golint)
    • Line 326: warning: don't use underscores in Go names; var subscription_id should be subscriptionID (golint)
    • Line 330: warning: don't use underscores in Go names; var subscribe_opts should be subscribeOpts (golint)
    • Line 388: warning: comment on exported method GenStage.Cancel should be of the form "Cancel ..." (golint)
    • Line 401: warning: comment on exported method GenStage.Init should be of the form "Init ..." (golint)
    • Line 432: warning: exported method GenStage.HandleCall should have comment or be unexported (golint)
    • Line 549: warning: exported method GenStage.HandleCast should have comment or be unexported (golint)
    • Line 556: warning: exported method GenStage.HandleInfo should have comment or be unexported (golint)
    • Line 594: warning: exported method GenStage.Terminate should have comment or be unexported (golint)
    • Line 600: warning: exported method GenStage.InitStage should have comment or be unexported (golint)
    • Line 606: warning: exported method GenStage.HandleGenStageCall should have comment or be unexported (golint)
    • Line 612: warning: exported method GenStage.HandleGenStageCast should have comment or be unexported (golint)
    • Line 617: warning: exported method GenStage.HandleGenStageInfo should have comment or be unexported (golint)
    • Line 623: warning: exported method GenStage.HandleSubscribe should have comment or be unexported (golint)
    • Line 628: warning: error should be the last type when returning multiple items (golint)
    • Line 628: warning: exported method GenStage.HandleSubscribed should have comment or be unexported (golint)
    • Line 632: warning: exported method GenStage.HandleCancel should have comment or be unexported (golint)
    • Line 637: warning: exported method GenStage.HandleCanceled should have comment or be unexported (golint)
    • Line 642: warning: exported method GenStage.HandleEvents should have comment or be unexported (golint)
    • Line 647: warning: error should be the last type when returning multiple items (golint)
    • Line 647: warning: exported method GenStage.HandleDemand should have comment or be unexported (golint)
    • ergo/process.go
    • Line 13: warning: exported type ProcessType should have comment or be unexported (golint)
    • Line 16: warning: exported const DefaultProcessMailboxSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type Process should have comment or be unexported (golint)
    • Line 76: warning: exported type ProcessOptions should have comment or be unexported (golint)
    • ergo/types.go
    • Line 11: warning: exported var ErrAppAlreadyLoaded should have comment or be unexported (golint)
    • Line 29: warning: don't use underscores in Go names; const distProtoNODE_LINK should be distProtoNODELINK (golint)
    • Line 30: warning: don't use underscores in Go names; const distProtoREG_SEND should be distProtoREGSEND (golint)
    • Line 31: warning: don't use underscores in Go names; const distProtoGROUP_LEADER should be distProtoGROUPLEADER (golint)
    • Line 33: warning: don't use underscores in Go names; const distProtoSEND_TT should be distProtoSENDTT (golint)
    • Line 34: warning: don't use underscores in Go names; const distProtoEXIT_TT should be distProtoEXITTT (golint)
    • Line 35: warning: don't use underscores in Go names; const distProtoREG_SEND_TT should be distProtoREGSENDTT (golint)
    • Line 36: warning: don't use underscores in Go names; const distProtoEXIT2_TT should be distProtoEXIT2TT (golint)
    • Line 39: warning: don't use underscores in Go names; const distProtoMONITOR_EXIT should be distProtoMONITOREXIT (golint)
    • Line 40: warning: don't use underscores in Go names; const distProtoSEND_SENDER should be distProtoSENDSENDER (golint)
    • Line 41: warning: don't use underscores in Go names; const distProtoSEND_SENDER_TT should be distProtoSENDSENDERTT (golint)
    • Line 42: warning: don't use underscores in Go names; const distProtoPAYLOAD_EXIT should be distProtoPAYLOADEXIT (golint)
    • Line 43: warning: don't use underscores in Go names; const distProtoPAYLOAD_EXIT_TT should be distProtoPAYLOADEXITTT (golint)
    • Line 44: warning: don't use underscores in Go names; const distProtoPAYLOAD_EXIT2 should be distProtoPAYLOADEXIT2 (golint)
    • Line 45: warning: don't use underscores in Go names; const distProtoPAYLOAD_EXIT2_TT should be distProtoPAYLOADEXIT2TT (golint)
    • Line 46: warning: don't use underscores in Go names; const distProtoPAYLOAD_MONITOR_P_EXIT should be distProtoPAYLOADMONITORPEXIT (golint)
    • ergo/examples/genstage/producer.go
    • Line 10: warning: exported type Producer should have comment or be unexported (golint)
    • Line 15: warning: exported method Producer.InitStage should have comment or be unexported (golint)
    • Line 34: warning: error should be the last type when returning multiple items (golint)
    • Line 34: warning: exported method Producer.HandleDemand should have comment or be unexported (golint)
    • Line 39: warning: exported method Producer.HandleSubscribe should have comment or be unexported (golint)
    • ergo/registrar.go
    • Line 300: warning: should omit 2nd value from range; this loop is equivalent to `for n := range ...` (golint)
    • ergo/supervisor.go
    • Line 11: warning: exported type SupervisorStrategy should have comment or be unexported (golint)
    • Line 17: warning: exported type SupervisorStrategyType should have comment or be unexported (golint)
    • Line 18: warning: exported type SupervisorChildRestart should have comment or be unexported (golint)
    • Line 19: warning: exported type SupervisorChild should have comment or be unexported (golint)
    • Line 24: warning: comment on exported const SupervisorRestartIntensity should be of the form "SupervisorRestartIntensity ..." (golint)
    • Line 27: warning: comment on exported const SupervisorRestartPeriod should be of the form "SupervisorRestartPeriod ..." (golint)
    • Line 103: warning: exported type SupervisorSpec should have comment or be unexported (golint)
    • Line 110: warning: exported type SupervisorChildSpec should have comment or be unexported (golint)
    • Line 125: warning: exported method Supervisor.Loop should have comment or be unexported (golint)
    • ergo/examples/genstage/consumer.go
    • Line 10: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 14: warning: exported type ConsumerState should have comment or be unexported (golint)
    • Line 18: warning: exported method Consumer.InitStage should have comment or be unexported (golint)
    • Line 26: warning: exported method Consumer.HandleEvents should have comment or be unexported (golint)
    • ergo/application.go
    • Line 14: warning: exported type ApplicationStartType should have comment or be unexported (golint)
    • Line 41: warning: exported type ApplicationSpec should have comment or be unexported (golint)
    • Line 56: warning: exported type ApplicationChildSpec should have comment or be unexported (golint)
    • Line 66: warning: exported type ApplicationInfo should have comment or be unexported (golint)
    • Line 73: warning: exported method Application.Loop should have comment or be unexported (golint)
    • ergo/gen_stage_dispatcher.go
    • Line 29: warning: exported type GenStageDispatcher should have comment or be unexported (golint)
    • Line 72: warning: exported type GenStageDispatchItem should have comment or be unexported (golint)
    • Line 306: warning: don't use underscores in Go names; var broadcast_item should be broadcastItem (golint)
    • Line 438: warning: don't use underscores in Go names; var order_index should be orderIndex (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign92%

IneffAssign detects ineffectual assignments in Go code.

    • ergo/dist/dist_test.go
    • Line 115: warning: cannot use "atom1" (untyped string constant) as *etf.Atom value in assignment (ineffassign)
    • Line 116: warning: cannot use "atom2" (untyped string constant) as *etf.Atom value in assignment (ineffassign)
    • Line 135: warning: cannot use "reg" (untyped string constant) as *etf.Atom value in assignment (ineffassign)
    • Line 136: warning: cannot use "call" (untyped string constant) as *etf.Atom value in assignment (ineffassign)
    • Line 137: warning: cannot use "set_get_state" (untyped string constant) as *etf.Atom value in assignment (ineffassign)
    • Line 140: warning: cannot initialize 2 variables with 3 values (ineffassign)
    • ergo/etf/decode_test.go
    • Line 24: warning: ineffectual assignment to term (ineffassign)
    • Line 30: warning: ineffectual assignment to term (ineffassign)
    • Line 46: warning: ineffectual assignment to term (ineffassign)
    • Line 61: warning: ineffectual assignment to term (ineffassign)
    • Line 77: warning: ineffectual assignment to term (ineffassign)
    • Line 90: warning: ineffectual assignment to term (ineffassign)

misspell87%

Misspell Finds commonly misspelled English words

    • ergo/etf/decode.go
    • Line 58: warning: "implementaion" is a misspelling of "implementation" (misspell)
    • Line 73: warning: "happend" is a misspelling of "happened" (misspell)
    • ergo/gen_stage_test.go
    • Line 170: warning: "calback" is a misspelling of "callback" (misspell)
    • Line 175: warning: "calback" is a misspelling of "callback" (misspell)
    • Line 178: warning: "calback" is a misspelling of "callback" (misspell)
    • Line 412: warning: "normaly" is a misspelling of "normally" (misspell)