Preparing report...

Report for github.com/cloudnativelabs/kube-router

A+    Excellent!    Found 18 issues across 44 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!


gocyclo77%

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.

    • kube-router/pkg/controllers/proxy/network_services_controller.go
    • Line 1512: warning: cyclomatic complexity 28 of function (*NetworkServicesController).syncHairpinIptablesRules() is high (> 15) (gocyclo)
    • Line 291: warning: cyclomatic complexity 27 of function (*NetworkServicesController).Run() is high (> 15) (gocyclo)
    • Line 987: warning: cyclomatic complexity 23 of function (*linuxNetworking).prepareEndpointForDsr() is high (> 15) (gocyclo)
    • Line 1136: warning: cyclomatic complexity 23 of function (*linuxNetworking).prepareEndpointForDsrWithCRI() is high (> 15) (gocyclo)
    • Line 1285: warning: cyclomatic complexity 18 of function (*NetworkServicesController).buildServicesInfo() is high (> 15) (gocyclo)
    • Line 1916: warning: cyclomatic complexity 18 of function (*linuxNetworking).ipvsAddFWMarkService() is high (> 15) (gocyclo)
    • Line 2167: warning: cyclomatic complexity 18 of function (*linuxNetworking).setupRoutesForExternalIPForDSR() is high (> 15) (gocyclo)
    • Line 493: warning: cyclomatic complexity 18 of function (*NetworkServicesController).setupIpvsFirewall() is high (> 15) (gocyclo)
    • Line 747: warning: cyclomatic complexity 16 of function (*NetworkServicesController).publishMetrics() is high (> 15) (gocyclo)
    • Line 1841: warning: cyclomatic complexity 16 of function (*linuxNetworking).ipvsAddService() is high (> 15) (gocyclo)
    • kube-router/pkg/controllers/netpol/policy.go
    • Line 146: warning: cyclomatic complexity 34 of function (*NetworkPolicyController).processIngressRules() is high (> 15) (gocyclo)
    • Line 438: warning: cyclomatic complexity 32 of function (*NetworkPolicyController).buildNetworkPoliciesInfo() is high (> 15) (gocyclo)
    • Line 291: warning: cyclomatic complexity 30 of function (*NetworkPolicyController).processEgressRules() is high (> 15) (gocyclo)
    • kube-router/pkg/controllers/netpol/network_policy_controller.go
    • Line 268: warning: cyclomatic complexity 24 of function (*NetworkPolicyController).ensureTopLevelChains() is high (> 15) (gocyclo)
    • Line 479: warning: cyclomatic complexity 23 of function (*NetworkPolicyController).Cleanup() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 20 of function (*NetworkPolicyController).cleanupStaleRules() is high (> 15) (gocyclo)
    • kube-router/pkg/controllers/routing/network_routes_controller.go
    • Line 132: warning: cyclomatic complexity 45 of function (*NetworkRoutingController).Run() is high (> 15) (gocyclo)
    • Line 793: warning: cyclomatic complexity 41 of function (*NetworkRoutingController).startBgpServer() is high (> 15) (gocyclo)
    • Line 1019: warning: cyclomatic complexity 34 of function NewNetworkRoutingController() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 30 of function (*NetworkRoutingController).injectRoute() is high (> 15) (gocyclo)
    • kube-router/pkg/controllers/proxy/service_endpoints_sync.go
    • Line 246: warning: cyclomatic complexity 49 of function (*NetworkServicesController).setupExternalIPServices() is high (> 15) (gocyclo)
    • Line 152: warning: cyclomatic complexity 21 of function (*NetworkServicesController).setupNodePortServices() is high (> 15) (gocyclo)
    • Line 500: warning: cyclomatic complexity 17 of function (*NetworkServicesController).cleanupStaleIPVSConfig() is high (> 15) (gocyclo)

golint75%

Golint is a linter for Go source code.

    • kube-router/pkg/controllers/netpol/policy.go
    • Line 652: warning: exported method NetworkPolicyController.ListPodsByNamespaceAndLabels should have comment or be unexported (golint)
    • Line 661: warning: exported method NetworkPolicyController.ListNamespaceByLabels should have comment or be unexported (golint)
    • kube-router/pkg/options/options.go
    • Line 11: warning: exported const DefaultBgpPort should have comment or be unexported (golint)
    • Line 12: warning: exported const DefaultBgpHoldTime should have comment or be unexported (golint)
    • Line 14: warning: exported type KubeRouterConfig should have comment or be unexported (golint)
    • Line 74: warning: exported function NewKubeRouterConfig should have comment or be unexported (golint)
    • Line 91: warning: exported method KubeRouterConfig.AddFlags should have comment or be unexported (golint)
    • kube-router/pkg/utils/utils.go
    • Line 8: warning: exported type Listener should have comment or be unexported (golint)
    • Line 12: warning: exported type ListenerFunc should have comment or be unexported (golint)
    • Line 14: warning: exported method ListenerFunc.OnUpdate 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!