Preparing report...

Report for github.com/taktv6/tbgp

A+    Excellent!    Found 13 issues across 24 files

Tweet

gofmt95%

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.

    • tbgp/server/fsm.go
    • Line 645: warning: cyclomatic complexity 28 of function (*FSM).established() is high (> 15) (gocyclo)
    • Line 528: warning: cyclomatic complexity 24 of function (*FSM).openConfirm() is high (> 15) (gocyclo)
    • Line 358: warning: cyclomatic complexity 23 of function (*FSM).openSent() is high (> 15) (gocyclo)

golint58%

Golint is a linter for Go source code.

    • tbgp/config/server.go
    • Line 11: warning: exported type Global should have comment or be unexported (golint)
    • Line 19: warning: exported const BGPPORT should have comment or be unexported (golint)
    • Line 21: warning: exported method Global.SetDefaultGlobalConfigValues should have comment or be unexported (golint)
    • tbgp/packet/encoder.go
    • Line 9: warning: exported function SerializeKeepaliveMsg should have comment or be unexported (golint)
    • Line 17: warning: exported function SerializeNotificationMsg should have comment or be unexported (golint)
    • Line 27: warning: exported function SerializeOpenMsg should have comment or be unexported (golint)
    • tbgp/server/peer.go
    • Line 9: warning: exported type Peer should have comment or be unexported (golint)
    • Line 16: warning: exported function NewPeer should have comment or be unexported (golint)
    • Line 25: warning: exported method Peer.GetAddr should have comment or be unexported (golint)
    • Line 29: warning: exported method Peer.GetASN should have comment or be unexported (golint)
    • Line 33: warning: exported method Peer.Start should have comment or be unexported (golint)
    • tbgp/server/tcplistener.go
    • Line 11: warning: exported const BGPPORT should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported type TCPListener should have comment or be unexported (golint)
    • Line 19: warning: exported function NewTCPListener should have comment or be unexported (golint)
    • tbgp/lpm/lpm.go
    • Line 7: warning: exported type LPM should have comment or be unexported (golint)
    • Line 44: warning: exported method LPM.Remove should have comment or be unexported (golint)
    • Line 256: warning: exported method LPM.Dump should have comment or be unexported (golint)
    • tbgp/packet/bgp.go
    • Line 4: warning: exported const OctetLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: comment on exported const ConnectionNotSync should be of the form "ConnectionNotSync ..." (golint)
    • Line 29: warning: comment on exported const UnsupportedVersionNumber should be of the form "UnsupportedVersionNumber ..." (golint)
    • Line 37: warning: comment on exported const MalformedAttributeList should be of the form "MalformedAttributeList ..." (golint)
    • Line 50: warning: comment on exported const OriginAttr should be of the form "OriginAttr ..." (golint)
    • Line 59: warning: comment on exported const IGP should be of the form "IGP ..." (golint)
    • Line 64: warning: comment on exported const ASSet should be of the form "ASSet ..." (golint)
    • Line 68: warning: comment on exported const MaxPrefReached should be of the form "MaxPrefReached ..." (golint)
    • Line 79: warning: exported type BGPError should have comment or be unexported (golint)
    • Line 89: warning: exported type BGPMessage should have comment or be unexported (golint)
    • Line 94: warning: exported type BGPHeader should have comment or be unexported (golint)
    • Line 99: warning: exported type BGPOpen should have comment or be unexported (golint)
    • Line 107: warning: exported type BGPNotification should have comment or be unexported (golint)
    • Line 112: warning: exported type BGPUpdate should have comment or be unexported (golint)
    • Line 120: warning: exported type PathAttribute should have comment or be unexported (golint)
    • Line 131: warning: exported type NLRI should have comment or be unexported (golint)
    • Line 137: warning: exported type ASPath should have comment or be unexported (golint)
    • Line 138: warning: exported type ASPathSegment should have comment or be unexported (golint)
    • Line 144: warning: exported type Aggretator should have comment or be unexported (golint)
    • tbgp/server/fsm.go
    • Line 20: warning: comment on exported const ManualStart should be of the form "ManualStart ..." (golint)
    • Line 22: warning: exported const ManualStop should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: comment on exported const ConnectRetryTimerExpires should be of the form "ConnectRetryTimerExpires ..." (golint)
    • Line 35: warning: exported const Cease should have comment (or a comment on this block) or be unexported (golint)
    • Line 44: warning: exported type FSM should have comment or be unexported (golint)
    • Line 100: warning: exported function NewFSM should have comment or be unexported (golint)
    • Line 168: warning: exported method FSM.Stop should have comment or be unexported (golint)
    • tbgp/server/server.go
    • Line 16: warning: exported const BGPVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type BGPServer should have comment or be unexported (golint)
    • Line 26: warning: exported function NewBgpServer should have comment or be unexported (golint)
    • Line 32: warning: exported method BGPServer.RouterID should have comment or be unexported (golint)
    • Line 36: warning: exported method BGPServer.Start should have comment or be unexported (golint)
    • Line 86: warning: exported method BGPServer.AddPeer should have comment or be unexported (golint)
    • tbgp/server/sockopt.go
    • Line 10: warning: exported const TCP_MD5SIG should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported function SetListenTCPTTLSockopt 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!