Preparing report...

Report for github.com/luizbafilho/fusis

A    Great!    Found 31 issues across 44 files

Tweet

gofmt84%

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!


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!


golint38%

Golint is a linter for Go source code.

    • fusis/bgp/bgp.go
    • Line 19: warning: exported type BgpService should have comment or be unexported (golint)
    • Line 25: warning: exported type Syncer should have comment or be unexported (golint)
    • Line 29: warning: exported method BgpService.Sync should have comment or be unexported (golint)
    • Line 86: warning: exported function NewBgpService should have comment or be unexported (golint)
    • Line 93: warning: exported method BgpService.Serve should have comment or be unexported (golint)
    • Line 127: warning: exported method BgpService.AddPath should have comment or be unexported (golint)
    • Line 140: warning: exported method BgpService.GetPaths should have comment or be unexported (golint)
    • Line 157: warning: exported method BgpService.DelPath should have comment or be unexported (golint)
    • fusis/fusis/operations.go
    • Line 31: warning: exported method FusisBalancer.DeleteService should have comment or be unexported (golint)
    • Line 40: warning: exported method FusisBalancer.GetDestinations should have comment or be unexported (golint)
    • Line 44: warning: exported method FusisBalancer.AddDestination should have comment or be unexported (golint)
    • Line 56: warning: exported method FusisBalancer.DeleteDestination should have comment or be unexported (golint)
    • Line 65: warning: exported method FusisBalancer.AddCheck should have comment or be unexported (golint)
    • Line 78: warning: exported method FusisBalancer.DeleteCheck should have comment or be unexported (golint)
    • fusis/ipvs/structs.go
    • Line 70: warning: exported function ToIpvsService should have comment or be unexported (golint)
    • Line 88: warning: exported function ToIpvsDestination should have comment or be unexported (golint)
    • Line 98: warning: exported function FromService should have comment or be unexported (golint)
    • fusis/health/check.go
    • Line 20: warning: exported type Check should have comment or be unexported (golint)
    • Line 28: warning: exported type CheckTCP should have comment or be unexported (golint)
    • Line 40: warning: exported method CheckTCP.GetStatus should have comment or be unexported (golint)
    • Line 44: warning: exported method CheckTCP.Stop should have comment or be unexported (golint)
    • Line 48: warning: exported method CheckTCP.GetId should have comment or be unexported (golint)
    • Line 52: warning: comment on exported method CheckTCP.Init should be of the form "Init ..." (golint)
    • Line 98: warning: exported method CheckTCP.Start should have comment or be unexported (golint)
    • Line 114: warning: comment on exported function RandomStagger should be of the form "RandomStagger ..." (golint)
    • fusis/fusis/balancer.go
    • Line 27: warning: exported type Balancer should have comment or be unexported (golint)
    • Line 46: warning: comment on exported type FusisBalancer should be of the form "FusisBalancer ..." (with optional leading article) (golint)
    • Line 157: warning: should omit values from range; this loop is equivalent to `for range ...` (golint)
    • Line 196: warning: should omit values from range; this loop is equivalent to `for range ...` (golint)
    • Line 243: warning: exported method FusisBalancer.IsLeader should have comment or be unexported (golint)
    • Line 307: warning: exported method FusisBalancer.Shutdown should have comment or be unexported (golint)
    • fusis/metrics/metrics.go
    • Line 12: warning: exported type Collector should have comment or be unexported (golint)
    • Line 16: warning: exported type Publisher should have comment or be unexported (golint)
    • Line 21: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 26: warning: exported function NewMetrics should have comment or be unexported (golint)
    • Line 32: warning: exported method Metrics.Monitor should have comment or be unexported (golint)
    • Line 46: warning: should omit values from range; this loop is equivalent to `for range ...` (golint)
    • Line 58: warning: exported method Metrics.InitPublisher should have comment or be unexported (golint)
    • fusis/ipam/ipam.go
    • Line 13: warning: exported type Allocator should have comment or be unexported (golint)
    • Line 18: warning: exported type Ipam should have comment or be unexported (golint)
    • Line 25: warning: exported var ErrNoVipAvailable should have comment or be unexported (golint)
    • Line 28: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 44: warning: comment on exported method Ipam.AllocateVIP should be of the form "AllocateVIP ..." (golint)
    • Line 69: warning: comment on exported method Ipam.ReleaseVIP should be of the form "ReleaseVIP ..." (golint)
    • fusis/vip/vip.go
    • Line 14: warning: exported type VipMngr should have comment or be unexported (golint)
    • Line 18: warning: exported type Syncer should have comment or be unexported (golint)
    • Line 22: warning: exported function New should have comment or be unexported (golint)
    • Line 28: warning: exported method VipMngr.Sync should have comment or be unexported (golint)
    • fusis/net/arp.go
    • Line 14: warning: exported function SendGratuitousARPReply should have comment or be unexported (golint)
    • fusis/net/net.go
    • Line 27: warning: exported function DelIp should have comment or be unexported (golint)
    • Line 41: warning: exported function DelVips should have comment or be unexported (golint)
    • Line 61: warning: exported function SetLinkUp should have comment or be unexported (golint)
    • Line 70: warning: exported function GetVips should have comment or be unexported (golint)
    • Line 79: warning: exported function GetFusisVipsIps should have comment or be unexported (golint)
    • Line 92: warning: exported function GetIpByInterface should have comment or be unexported (golint)
    • Line 106: warning: exported function SetIpForwarding should have comment or be unexported (golint)
    • Line 110: warning: exported function AddDefaultGateway should have comment or be unexported (golint)
    • Line 122: warning: exported function GetDefaultGateway should have comment or be unexported (golint)
    • Line 142: warning: exported function DeleteDefaultGateway should have comment or be unexported (golint)
    • fusis/metrics/logstash.go
    • Line 13: warning: exported type Logstash should have comment or be unexported (golint)
    • Line 18: warning: exported function NewLogstashPublisher should have comment or be unexported (golint)
    • Line 31: warning: comment on exported method Logstash.Close should be of the form "Close ..." (golint)
    • Line 36: warning: exported method Logstash.PublishServiceStats should have comment or be unexported (golint)
    • fusis/api/error.go
    • Line 10: warning: exported type ErrResponse should have comment or be unexported (golint)
    • Line 12: warning: exported function CustomHTTPErrorHandler should have comment or be unexported (golint)
    • fusis/config/config.go
    • Line 9: warning: exported var LOG_LEVELS should have comment or be unexported (golint)
    • Line 12: warning: exported type BalancerConfig should have comment or be unexported (golint)
    • Line 28: warning: exported type AgentConfig should have comment or be unexported (golint)
    • Line 40: warning: exported type Interfaces should have comment or be unexported (golint)
    • Line 45: warning: exported type Bgp should have comment or be unexported (golint)
    • Line 51: warning: exported type Neighbor should have comment or be unexported (golint)
    • Line 56: warning: exported type Ipam should have comment or be unexported (golint)
    • Line 60: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 67: warning: exported method BalancerConfig.GetIpByInterface should have comment or be unexported (golint)
    • Line 71: warning: exported method AgentConfig.GetIpByInterface should have comment or be unexported (golint)
    • fusis/types/types.go
    • Line 10: warning: exported var NAT should have comment or be unexported (golint)
    • Line 16: warning: exported var Protocols should have comment or be unexported (golint)
    • Line 21: warning: exported var ErrServiceNotFound should have comment or be unexported (golint)
    • Line 28: warning: exported type ErrConflict should have comment or be unexported (golint)
    • Line 34: warning: exported type ErrNotFound should have comment or be unexported (golint)
    • Line 40: warning: exported type ErrValidation should have comment or be unexported (golint)
    • Line 49: warning: exported type Service should have comment or be unexported (golint)
    • Line 59: warning: exported method Service.GetId should have comment or be unexported (golint)
    • Line 63: warning: exported method Service.IsNat should have comment or be unexported (golint)
    • Line 67: warning: exported method Service.IpvsId should have comment or be unexported (golint)
    • Line 71: warning: exported method Service.Equal should have comment or be unexported (golint)
    • Line 71: warning: receiver name s should be consistent with previous receiver name svc for Service (golint)
    • Line 75: warning: exported type Destination should have comment or be unexported (golint)
    • Line 84: warning: exported method Destination.GetId should have comment or be unexported (golint)
    • Line 88: warning: exported method Destination.IpvsId should have comment or be unexported (golint)
    • Line 92: warning: exported method Destination.Equal should have comment or be unexported (golint)
    • Line 92: warning: receiver name d should be consistent with previous receiver name dst for Destination (golint)
    • Line 96: warning: exported type DestinationList should have comment or be unexported (golint)
    • Line 104: warning: exported type CheckSpec should have comment or be unexported (golint)
    • fusis/store/store.go
    • Line 19: warning: exported type DistributedLocker should have comment or be unexported (golint)
    • Line 24: warning: exported type Store should have comment or be unexported (golint)
    • Line 45: warning: exported type FusisStore should have comment or be unexported (golint)
    • Line 55: warning: exported function New should have comment or be unexported (golint)
    • Line 81: warning: exported method FusisStore.Close should have comment or be unexported (golint)
    • Line 85: warning: exported method FusisStore.AddWatcher should have comment or be unexported (golint)
    • Line 91: warning: exported method FusisStore.Watch should have comment or be unexported (golint)
    • Line 121: warning: exported method FusisStore.GetState should have comment or be unexported (golint)
    • Line 165: warning: exported method FusisStore.GetServices should have comment or be unexported (golint)
    • Line 184: warning: exported method FusisStore.GetService should have comment or be unexported (golint)
    • Line 203: warning: exported method FusisStore.GetDestinations should have comment or be unexported (golint)
    • Line 262: warning: exported method FusisStore.DeleteService should have comment or be unexported (golint)
    • Line 293: warning: exported method FusisStore.AddDestination should have comment or be unexported (golint)
    • Line 329: warning: exported method FusisStore.DeleteDestination should have comment or be unexported (golint)
    • Line 355: warning: exported method FusisStore.AddCheck should have comment or be unexported (golint)
    • Line 372: warning: exported method FusisStore.GetCheck should have comment or be unexported (golint)
    • Line 393: warning: exported method FusisStore.DeleteCheck should have comment or be unexported (golint)
    • fusis/command/fusis.go
    • Line 17: warning: exported var FusisCmd should have comment or be unexported (golint)
    • Line 67: warning: exported type Node should have comment or be unexported (golint)
    • fusis/api/client.go
    • Line 18: warning: exported type Client should have comment or be unexported (golint)
    • Line 23: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 44: warning: exported method Client.GetServices should have comment or be unexported (golint)
    • Line 65: warning: exported method Client.GetService should have comment or be unexported (golint)
    • Line 87: warning: exported method Client.CreateService should have comment or be unexported (golint)
    • Line 106: warning: exported method Client.DeleteService should have comment or be unexported (golint)
    • Line 125: warning: exported method Client.AddDestination should have comment or be unexported (golint)
    • Line 139: warning: exported method Client.DeleteDestination should have comment or be unexported (golint)
    • fusis/config/validation.go
    • Line 24: warning: exported method BalancerConfig.Validate should have comment or be unexported (golint)
    • Line 62: warning: exported method Bgp.Validate should have comment or be unexported (golint)
    • Line 66: warning: exported method Ipam.Validate should have comment or be unexported (golint)
    • Line 70: warning: exported method Interfaces.Validate should have comment or be unexported (golint)
    • fusis/election/election.go
    • Line 15: warning: exported type Election should have comment or be unexported (golint)
    • Line 21: warning: exported function New should have comment or be unexported (golint)
    • Line 44: warning: exported method Election.Run should have comment or be unexported (golint)
    • Line 48: warning: exported method Election.IsLeader should have comment or be unexported (golint)
    • Line 58: warning: exported method Election.Resign should have comment or be unexported (golint)
    • fusis/ipvs/ipvs.go
    • Line 16: warning: exported type Ipvs should have comment or be unexported (golint)
    • Line 21: warning: exported type Syncer should have comment or be unexported (golint)
    • Line 152: warning: receiver name i should be consistent with previous receiver name ipvs for Ipvs (golint)
    • Line 193: warning: receiver name i should be consistent with previous receiver name ipvs for Ipvs (golint)
    • fusis/state/state.go
    • Line 11: warning: exported type Services should have comment or be unexported (golint)
    • Line 12: warning: exported type Destinations should have comment or be unexported (golint)
    • Line 13: warning: exported type Checks should have comment or be unexported (golint)
    • Line 15: warning: exported type State should have comment or be unexported (golint)
    • Line 30: warning: comment on exported type FusisState should be of the form "FusisState ..." (with optional leading article) (golint)
    • Line 49: warning: exported method FusisState.Copy should have comment or be unexported (golint)
    • Line 67: warning: exported method FusisState.AddCheck should have comment or be unexported (golint)
    • Line 73: warning: exported method FusisState.GetChecks should have comment or be unexported (golint)
    • Line 79: warning: exported method FusisState.SetChecks should have comment or be unexported (golint)
    • Line 85: warning: exported method FusisState.GetServices should have comment or be unexported (golint)
    • Line 91: warning: exported method FusisState.AddService should have comment or be unexported (golint)
    • Line 97: warning: exported method FusisState.GetDestinations should have comment or be unexported (golint)
    • Line 119: warning: exported method FusisState.AddDestination should have comment or be unexported (golint)
    • Line 126: warning: exported method FusisState.DeleteDestination should have comment or be unexported (golint)
    • fusis/net/sysctl.go
    • Line 13: warning: error var invalidKeyError should have name of the form errFoo (golint)
    • Line 15: warning: exported function GetSysctl should have comment or be unexported (golint)
    • Line 24: warning: exported function SetSysctl should have comment or be unexported (golint)
    • fusis/health/monitor.go
    • Line 13: warning: exported type HealthMonitor should have comment or be unexported (golint)
    • Line 19: warning: exported type ServiceID should have comment or be unexported (golint)
    • Line 20: warning: exported type DestinationID should have comment or be unexported (golint)
    • Line 21: warning: exported type Status should have comment or be unexported (golint)
    • Line 23: warning: exported type FusisMonitor should have comment or be unexported (golint)
    • Line 39: warning: exported function NewMonitor should have comment or be unexported (golint)
    • Line 73: warning: exported method FusisMonitor.UpdateChecks should have comment or be unexported (golint)
    • Line 132: warning: exported method FusisMonitor.Start should have comment or be unexported (golint)
    • Line 136: warning: exported method FusisMonitor.FilterHealthy should have comment or be unexported (golint)
    • fusis/iptables/iptables.go
    • Line 22: warning: exported var ErrIptablesNotFound should have comment or be unexported (golint)
    • Line 33: warning: exported type Syncer should have comment or be unexported (golint)
    • Line 37: warning: exported type IptablesMngr should have comment or be unexported (golint)
    • Line 43: warning: exported type SnatRule should have comment or be unexported (golint)
    • Line 49: warning: exported function New should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words