Preparing report...

Report for github.com/kubeovn/kube-ovn

(v1.12.3)

A+    Excellent!    Found 63 issues across 387 files

Tweet

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!


gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo83%

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.

    • pkg/controller/controller.go
    • Line 250: warning: cyclomatic complexity 38 of function Run() is high (> 15) (gocyclo)
    • Line 931: warning: cyclomatic complexity 16 of function (*Controller).startWorkers() is high (> 15) (gocyclo)
    • pkg/controller/vpc_nat_gw_nat.go
    • Line 730: warning: cyclomatic complexity 25 of function (*Controller).handleUpdateIptablesDnatRule() is high (> 15) (gocyclo)
    • Line 1380: warning: cyclomatic complexity 25 of function (*Controller).patchDnatStatus() is high (> 15) (gocyclo)
    • Line 903: warning: cyclomatic complexity 25 of function (*Controller).handleUpdateIptablesSnatRule() is high (> 15) (gocyclo)
    • Line 562: warning: cyclomatic complexity 24 of function (*Controller).handleUpdateIptablesFip() is high (> 15) (gocyclo)
    • Line 1518: warning: cyclomatic complexity 17 of function (*Controller).patchSnatStatus() is high (> 15) (gocyclo)
    • Line 1247: warning: cyclomatic complexity 16 of function (*Controller).patchFipStatus() is high (> 15) (gocyclo)
    • pkg/ovs/ovn-nb-acl_test.go
    • Line 1633: warning: cyclomatic complexity 17 of function (*OvnClientTestSuite).testACLFilter() is high (> 15) (gocyclo)
    • Line 743: warning: cyclomatic complexity 16 of function (*OvnClientTestSuite).testSetLogicalSwitchPrivate() is high (> 15) (gocyclo)
    • pkg/util/net.go
    • Line 347: warning: cyclomatic complexity 18 of function ExpandExcludeIPs() is high (> 15) (gocyclo)
    • pkg/controller/ovn_dnat.go
    • Line 526: warning: cyclomatic complexity 29 of function (*Controller).patchOvnDnatStatus() is high (> 15) (gocyclo)
    • Line 210: warning: cyclomatic complexity 27 of function (*Controller).handleAddOvnDnatRule() is high (> 15) (gocyclo)
    • Line 365: warning: cyclomatic complexity 24 of function (*Controller).handleUpdateOvnDnatRule() is high (> 15) (gocyclo)
    • pkg/controller/pod_iptables_fip.go
    • Line 56: warning: cyclomatic complexity 18 of function (*Controller).enqueueUpdatePodAnnotatedIptablesFip() is high (> 15) (gocyclo)
    • Line 223: warning: cyclomatic complexity 16 of function (*Controller).handleAddPodAnnotatedIptablesFip() is high (> 15) (gocyclo)
    • pkg/daemon/controller_linux.go
    • Line 124: warning: cyclomatic complexity 42 of function (*Controller).reconcileRouters() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 30 of function routeDiff() is high (> 15) (gocyclo)
    • Line 420: warning: cyclomatic complexity 22 of function (*Controller).getPolicyRouting() is high (> 15) (gocyclo)
    • Line 504: warning: cyclomatic complexity 16 of function (*Controller).handlePod() is high (> 15) (gocyclo)
    • pkg/controller/pod.go
    • Line 1558: warning: cyclomatic complexity 48 of function (*Controller).acquireAddress() is high (> 15) (gocyclo)
    • Line 762: warning: cyclomatic complexity 44 of function (*Controller).reconcileRouteSubnets() is high (> 15) (gocyclo)
    • Line 940: warning: cyclomatic complexity 41 of function (*Controller).handleDeletePod() is high (> 15) (gocyclo)
    • Line 612: warning: cyclomatic complexity 33 of function (*Controller).reconcileAllocateSubnets() is high (> 15) (gocyclo)
    • Line 253: warning: cyclomatic complexity 27 of function (*Controller).enqueueUpdatePod() is high (> 15) (gocyclo)
    • Line 1757: warning: cyclomatic complexity 23 of function appendCheckPodToDel() is high (> 15) (gocyclo)
    • Line 1128: warning: cyclomatic complexity 19 of function (*Controller).syncKubeOvnNet() is high (> 15) (gocyclo)
    • Line 1429: warning: cyclomatic complexity 19 of function (*Controller).getPodAttachmentNet() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 16 of function (*Controller).enqueueAddPod() is high (> 15) (gocyclo)
    • pkg/daemon/gateway_linux.go
    • Line 495: warning: cyclomatic complexity 40 of function (*Controller).setIptables() is high (> 15) (gocyclo)
    • Line 791: warning: cyclomatic complexity 31 of function (*Controller).reconcileTProxyIPTableRules() is high (> 15) (gocyclo)
    • Line 1451: warning: cyclomatic complexity 27 of function (*Controller).getLocalPodIPsNeedPR() is high (> 15) (gocyclo)
    • Line 1343: warning: cyclomatic complexity 26 of function (*Controller).setExGateway() is high (> 15) (gocyclo)
    • Line 1196: warning: cyclomatic complexity 23 of function (*Controller).setOvnSubnetGatewayMetric() is high (> 15) (gocyclo)
    • Line 941: warning: cyclomatic complexity 20 of function (*Controller).generateNatOutgoingPolicyChainRules() is high (> 15) (gocyclo)
    • Line 1525: warning: cyclomatic complexity 17 of function (*Controller).getSubnetsNeedPR() is high (> 15) (gocyclo)
    • Line 1064: warning: cyclomatic complexity 17 of function (*Controller).cleanObsoleteIptablesRules() is high (> 15) (gocyclo)
    • pkg/controller/gc.go
    • Line 392: warning: cyclomatic complexity 38 of function (*Controller).gcLoadBalancer() is high (> 15) (gocyclo)
    • Line 288: warning: cyclomatic complexity 26 of function (*Controller).markAndCleanLSP() is high (> 15) (gocyclo)
    • Line 576: warning: cyclomatic complexity 18 of function (*Controller).gcPortGroup() is high (> 15) (gocyclo)
    • Line 115: warning: cyclomatic complexity 17 of function (*Controller).gcLogicalSwitch() is high (> 15) (gocyclo)
    • pkg/util/arp.go
    • Line 75: warning: cyclomatic complexity 25 of function ArpDetectIPConflict() is high (> 15) (gocyclo)
    • pkg/controller/service.go
    • Line 300: warning: cyclomatic complexity 34 of function (*Controller).handleUpdateService() is high (> 15) (gocyclo)
    • Line 449: warning: cyclomatic complexity 19 of function (*Controller).handleAddService() is high (> 15) (gocyclo)
    • pkg/controller/ovn_fip.go
    • Line 195: warning: cyclomatic complexity 28 of function (*Controller).handleAddOvnFip() is high (> 15) (gocyclo)
    • Line 329: warning: cyclomatic complexity 26 of function (*Controller).handleUpdateOvnFip() is high (> 15) (gocyclo)
    • Line 522: warning: cyclomatic complexity 17 of function (*Controller).patchOvnFipStatus() is high (> 15) (gocyclo)
    • pkg/controller/init.go
    • Line 278: warning: cyclomatic complexity 41 of function (*Controller).InitIPAM() is high (> 15) (gocyclo)
    • Line 442: warning: cyclomatic complexity 16 of function (*Controller).initDefaultProviderNetwork() is high (> 15) (gocyclo)
    • pkg/controller/node.go
    • Line 189: warning: cyclomatic complexity 40 of function (*Controller).handleAddNode() is high (> 15) (gocyclo)
    • Line 748: warning: cyclomatic complexity 27 of function (*Controller).checkGatewayReady() is high (> 15) (gocyclo)
    • Line 375: warning: cyclomatic complexity 25 of function (*Controller).handleNodeAnnotationsForProviderNetworks() is high (> 15) (gocyclo)
    • Line 1074: warning: cyclomatic complexity 20 of function (*Controller).deletePolicyRouteForNode() is high (> 15) (gocyclo)
    • Line 1145: warning: cyclomatic complexity 20 of function (*Controller).addPolicyRouteForCentralizedSubnetOnNode() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 18 of function (*Controller).handleDeleteNode() is high (> 15) (gocyclo)
    • pkg/ipam/subnet.go
    • Line 317: warning: cyclomatic complexity 33 of function (*Subnet).GetStaticAddress() is high (> 15) (gocyclo)
    • Line 453: warning: cyclomatic complexity 19 of function (*Subnet).releaseAddr() is high (> 15) (gocyclo)
    • pkg/ipam/ipam.go
    • Line 150: warning: cyclomatic complexity 31 of function (*IPAM).AddOrUpdateSubnet() is high (> 15) (gocyclo)
    • pkg/controller/ovn_snat.go
    • Line 287: warning: cyclomatic complexity 30 of function (*Controller).handleUpdateOvnSnatRule() is high (> 15) (gocyclo)
    • Line 175: warning: cyclomatic complexity 27 of function (*Controller).handleAddOvnSnatRule() is high (> 15) (gocyclo)
    • Line 436: warning: cyclomatic complexity 17 of function (*Controller).patchOvnSnatStatus() is high (> 15) (gocyclo)
    • pkg/controller/vpc_nat_gw_eip.go
    • Line 283: warning: cyclomatic complexity 30 of function (*Controller).handleUpdateIptablesEip() is high (> 15) (gocyclo)
    • Line 628: warning: cyclomatic complexity 17 of function (*Controller).createOrUpdateCrdEip() is high (> 15) (gocyclo)
    • Line 857: warning: cyclomatic complexity 17 of function (*Controller).patchEipStatus() is high (> 15) (gocyclo)
    • pkg/daemon/nm_linux.go
    • Line 187: warning: cyclomatic complexity 24 of function (*networkManagerSyncer).SetManaged() is high (> 15) (gocyclo)
    • Line 57: warning: cyclomatic complexity 20 of function (*networkManagerSyncer).Run() is high (> 15) (gocyclo)
    • pkg/daemon/handler.go
    • Line 60: warning: cyclomatic complexity 68 of function (cniServerHandler).handleAdd() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 21 of function (cniServerHandler).handleDel() is high (> 15) (gocyclo)
    • pkg/controller/endpoint.go
    • Line 97: warning: cyclomatic complexity 32 of function (*Controller).handleUpdateEndpoint() is high (> 15) (gocyclo)
    • Line 343: warning: cyclomatic complexity 20 of function getIPPortMappingBackend() is high (> 15) (gocyclo)
    • pkg/controller/vpc_nat_gateway.go
    • Line 590: warning: cyclomatic complexity 26 of function (*Controller).handleUpdateNatGwSubnetRoute() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 23 of function (*Controller).handleAddOrUpdateVpcNatGw() is high (> 15) (gocyclo)
    • pkg/ovs/ovn-nb-acl.go
    • Line 474: warning: cyclomatic complexity 16 of function (*OVNNbClient).SetLogicalSwitchPrivate() is high (> 15) (gocyclo)
    • pkg/controller/pod_iptables_eip.go
    • Line 68: warning: cyclomatic complexity 18 of function (*Controller).enqueueUpdatePodAnnotatedIptablesEip() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 18 of function (*Controller).handleAddPodAnnotatedIptablesEip() is high (> 15) (gocyclo)
    • pkg/pinger/util.go
    • Line 201: warning: cyclomatic complexity 16 of function (*Exporter).setOvsInterfaceStatisticsMetric() is high (> 15) (gocyclo)
    • pkg/daemon/ovs_windows.go
    • Line 137: warning: cyclomatic complexity 20 of function configureNic() is high (> 15) (gocyclo)
    • Line 29: warning: cyclomatic complexity 17 of function (cniServerHandler).configureNic() is high (> 15) (gocyclo)
    • pkg/controller/vpc.go
    • Line 256: warning: cyclomatic complexity 86 of function (*Controller).handleAddOrUpdateVpc() is high (> 15) (gocyclo)
    • Line 1059: warning: cyclomatic complexity 21 of function (*Controller).handleAddVpcExternalSubnet() is high (> 15) (gocyclo)
    • Line 842: warning: cyclomatic complexity 16 of function formatVpc() is high (> 15) (gocyclo)
    • pkg/controller/subnet.go
    • Line 58: warning: cyclomatic complexity 49 of function (*Controller).enqueueUpdateSubnet() is high (> 15) (gocyclo)
    • Line 677: warning: cyclomatic complexity 42 of function (*Controller).handleAddOrUpdateSubnet() is high (> 15) (gocyclo)
    • Line 1435: warning: cyclomatic complexity 30 of function (*Controller).reconcileDistributedSubnetRouteInDefaultVpc() is high (> 15) (gocyclo)
    • Line 1694: warning: cyclomatic complexity 27 of function (*Controller).reconcileOvnDefaultVpcRoute() is high (> 15) (gocyclo)
    • Line 1206: warning: cyclomatic complexity 23 of function (*Controller).reconcileCustomVpcBfdStaticRoute() is high (> 15) (gocyclo)
    • Line 1889: warning: cyclomatic complexity 22 of function (*Controller).reconcileU2OInterconnectionIP() is high (> 15) (gocyclo)
    • Line 1304: warning: cyclomatic complexity 20 of function (*Controller).reconcileCustomVpcAddNormalStaticRoute() is high (> 15) (gocyclo)
    • Line 2501: warning: cyclomatic complexity 20 of function (*Controller).addPolicyRouteForU2OInterconn() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 20 of function formatSubnet() is high (> 15) (gocyclo)
    • Line 1791: warning: cyclomatic complexity 17 of function (*Controller).reconcileCustomVpcStaticRoute() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 17 of function (*Controller).checkSubnetConflict() is high (> 15) (gocyclo)
    • Line 2445: warning: cyclomatic complexity 17 of function (*Controller).deletePolicyRouteByGatewayType() is high (> 15) (gocyclo)
    • Line 1961: warning: cyclomatic complexity 17 of function calcDualSubnetStatusIP() is high (> 15) (gocyclo)
    • Line 2170: warning: cyclomatic complexity 17 of function filterRepeatIPRange() is high (> 15) (gocyclo)
    • Line 1622: warning: cyclomatic complexity 16 of function (*Controller).reconcileEcmpCentralizedSubnetRouteInDefaultVpc() is high (> 15) (gocyclo)
    • pkg/daemon/ovs_linux.go
    • Line 883: warning: cyclomatic complexity 47 of function (*Controller).transferAddrsAndRoutes() is high (> 15) (gocyclo)
    • Line 214: warning: cyclomatic complexity 31 of function configureContainerNic() is high (> 15) (gocyclo)
    • Line 774: warning: cyclomatic complexity 25 of function configureNic() is high (> 15) (gocyclo)
    • Line 613: warning: cyclomatic complexity 20 of function (*Controller).loopOvnExt0Check() is high (> 15) (gocyclo)
    • Line 1103: warning: cyclomatic complexity 20 of function (*Controller).removeProviderNic() is high (> 15) (gocyclo)
    • Line 496: warning: cyclomatic complexity 18 of function configureNodeGwNic() is high (> 15) (gocyclo)
    • Line 1211: warning: cyclomatic complexity 17 of function setupSriovInterface() is high (> 15) (gocyclo)
    • pkg/util/validator.go
    • Line 15: warning: cyclomatic complexity 43 of function ValidateSubnet() is high (> 15) (gocyclo)
    • Line 189: warning: cyclomatic complexity 24 of function ValidatePodNetwork() is high (> 15) (gocyclo)
    • Line 304: warning: cyclomatic complexity 18 of function ValidateVpc() is high (> 15) (gocyclo)
    • pkg/controller/network_policy.go
    • Line 133: warning: cyclomatic complexity 80 of function (*Controller).handleUpdateNp() is high (> 15) (gocyclo)
    • Line 696: warning: cyclomatic complexity 22 of function (*Controller).fetchPolicySelectedAddresses() is high (> 15) (gocyclo)
    • pkg/controller/switch_lb_rule.go
    • Line 257: warning: cyclomatic complexity 22 of function (*Controller).handleDelSwitchLBRule() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 17 of function (*Controller).handleAddOrUpdateSwitchLBRule() is high (> 15) (gocyclo)
    • pkg/controller/ovn_ic.go
    • Line 30: warning: cyclomatic complexity 31 of function (*Controller).resyncInterConnection() is high (> 15) (gocyclo)
    • Line 451: warning: cyclomatic complexity 16 of function (*Controller).syncOneRouteToPolicy() is high (> 15) (gocyclo)
    • pkg/controller/security_group.go
    • Line 226: warning: cyclomatic complexity 20 of function (*Controller).handleAddOrUpdateSg() is high (> 15) (gocyclo)
    • Line 339: warning: cyclomatic complexity 19 of function (*Controller).validateSgRule() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!