Preparing report...

Report for github.com/pingcap/tidb-operator

(v1.3.7)

A+    Excellent!    Found 65 issues across 467 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!


gofmt99%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo86%

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/manager/member/dm_master_member_manager.go
    • Line 182: warning: cyclomatic complexity 22 of function (*masterMemberManager).syncMasterStatefulSetForDMCluster() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 17 of function (*masterMemberManager).syncDMClusterStatus() is high (> 15) (gocyclo)
    • pkg/manager/member/tikv_member_manager.go
    • Line 327: warning: cyclomatic complexity 39 of function getNewTiKVSetForTidbCluster() is high (> 15) (gocyclo)
    • Line 765: warning: cyclomatic complexity 27 of function (*tikvMemberManager).syncTiKVClusterStatus() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 25 of function (*tikvMemberManager).syncStatefulSetForTidbCluster() is high (> 15) (gocyclo)
    • Line 895: warning: cyclomatic complexity 17 of function (*tikvMemberManager).setStoreLabelsForTiKV() is high (> 15) (gocyclo)
    • pkg/manager/member/pvc_resizer.go
    • Line 181: warning: cyclomatic complexity 22 of function (*pvcResizer).buildContextForTC() is high (> 15) (gocyclo)
    • Line 615: warning: cyclomatic complexity 21 of function (*pvcResizer).beforeResizeForPod() is high (> 15) (gocyclo)
    • Line 397: warning: cyclomatic complexity 18 of function (*pvcResizer).resizeVolumes() is high (> 15) (gocyclo)
    • Line 309: warning: cyclomatic complexity 16 of function (*pvcResizer).updateVolumeStatus() is high (> 15) (gocyclo)
    • tests/e2e/br/br.go
    • Line 405: warning: cyclomatic complexity 21 of function createXK8sTidbClusterWithComponentsReady() is high (> 15) (gocyclo)
    • pkg/manager/member/pvc_cleaner.go
    • Line 71: warning: cyclomatic complexity 30 of function (*realPVCCleaner).reclaimPV() is high (> 15) (gocyclo)
    • Line 197: warning: cyclomatic complexity 20 of function (*realPVCCleaner).cleanScheduleLock() is high (> 15) (gocyclo)
    • pkg/manager/member/pd_member_manager.go
    • Line 565: warning: cyclomatic complexity 30 of function getNewPDSetForTidbCluster() is high (> 15) (gocyclo)
    • Line 191: warning: cyclomatic complexity 25 of function (*pdMemberManager).syncPDStatefulSetForTidbCluster() is high (> 15) (gocyclo)
    • Line 310: warning: cyclomatic complexity 23 of function (*pdMemberManager).syncTidbClusterStatus() is high (> 15) (gocyclo)
    • pkg/monitor/monitor/monitor_manager.go
    • Line 69: warning: cyclomatic complexity 27 of function (*MonitorManager).SyncMonitor() is high (> 15) (gocyclo)
    • Line 284: warning: cyclomatic complexity 25 of function (*MonitorManager).syncTidbMonitorConfig() is high (> 15) (gocyclo)
    • Line 531: warning: cyclomatic complexity 22 of function (*MonitorManager).smoothMigrationToStatefulSet() is high (> 15) (gocyclo)
    • pkg/tkctl/cmd/get/get.go
    • Line 130: warning: cyclomatic complexity 18 of function (*GetOptions).Complete() is high (> 15) (gocyclo)
    • Line 248: warning: cyclomatic complexity 16 of function (*GetOptions).PrintOutput() is high (> 15) (gocyclo)
    • tests/failover.go
    • Line 154: warning: cyclomatic complexity 27 of function (*OperatorActions).TruncateSSTFileThenCheckFailover() is high (> 15) (gocyclo)
    • Line 1077: warning: cyclomatic complexity 23 of function GetPodStatus() is high (> 15) (gocyclo)
    • Line 46: warning: cyclomatic complexity 18 of function (*OperatorActions).DeletePDDataThenCheckFailover() is high (> 15) (gocyclo)
    • Line 488: warning: cyclomatic complexity 18 of function (*OperatorActions).CheckRecover() is high (> 15) (gocyclo)
    • Line 332: warning: cyclomatic complexity 17 of function (*OperatorActions).CheckFailoverPending() is high (> 15) (gocyclo)
    • pkg/manager/member/tidb_member_manager.go
    • Line 668: warning: cyclomatic complexity 28 of function getNewTiDBSetForTidbCluster() is high (> 15) (gocyclo)
    • Line 202: warning: cyclomatic complexity 19 of function (*tidbMemberManager).syncTiDBStatefulSetForTidbCluster() is high (> 15) (gocyclo)
    • Line 971: warning: cyclomatic complexity 17 of function (*tidbMemberManager).syncTidbClusterStatus() is high (> 15) (gocyclo)
    • Line 403: warning: cyclomatic complexity 17 of function (*tidbMemberManager).syncTiDBService() is high (> 15) (gocyclo)
    • tests/actions.go
    • Line 1700: warning: cyclomatic complexity 37 of function (*OperatorActions).metaSyncFn() is high (> 15) (gocyclo)
    • Line 796: warning: cyclomatic complexity 30 of function (*OperatorActions).CheckTidbClusterStatus() is high (> 15) (gocyclo)
    • Line 2913: warning: cyclomatic complexity 27 of function (*OperatorActions).CheckIncrementalBackup() is high (> 15) (gocyclo)
    • Line 1120: warning: cyclomatic complexity 22 of function (*OperatorActions).CheckUpgrade() is high (> 15) (gocyclo)
    • Line 3330: warning: cyclomatic complexity 19 of function (*OperatorActions).checkManualPauseComponent() is high (> 15) (gocyclo)
    • pkg/manager/member/tiflash_member_manager.go
    • Line 162: warning: cyclomatic complexity 26 of function (*tiflashMemberManager).syncStatefulSet() is high (> 15) (gocyclo)
    • Line 306: warning: cyclomatic complexity 22 of function getNewStatefulSet() is high (> 15) (gocyclo)
    • Line 661: warning: cyclomatic complexity 21 of function (*tiflashMemberManager).syncTidbClusterStatus() is high (> 15) (gocyclo)
    • Line 770: warning: cyclomatic complexity 16 of function (*tiflashMemberManager).setStoreLabelsForTiFlash() is high (> 15) (gocyclo)
    • pkg/monitor/monitor/util.go
    • Line 1465: warning: cyclomatic complexity 21 of function generateRemoteWrite() is high (> 15) (gocyclo)
    • Line 924: warning: cyclomatic complexity 17 of function getMonitorService() is high (> 15) (gocyclo)
    • Line 1325: warning: cyclomatic complexity 16 of function getThanosSidecarContainer() is high (> 15) (gocyclo)
    • tests/backup.go
    • Line 66: warning: cyclomatic complexity 24 of function (*OperatorActions).BackupAndRestoreToMultipleClusters() is high (> 15) (gocyclo)
    • tests/crd_test_util.go
    • Line 313: warning: cyclomatic complexity 18 of function (*CrdTestUtil).tikvMembersReadyFn() is high (> 15) (gocyclo)
    • Line 173: warning: cyclomatic complexity 16 of function (*CrdTestUtil).WaitForTidbClusterReady() is high (> 15) (gocyclo)
    • Line 228: warning: cyclomatic complexity 16 of function (*CrdTestUtil).pdMembersReadyFn() is high (> 15) (gocyclo)
    • pkg/backup/util/util.go
    • Line 515: warning: cyclomatic complexity 22 of function ValidateRestore() is high (> 15) (gocyclo)
    • Line 460: warning: cyclomatic complexity 22 of function ValidateBackup() is high (> 15) (gocyclo)
    • Line 246: warning: cyclomatic complexity 18 of function GenerateStorageCertEnv() 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!