Preparing report...

Report for github.com/cybozu-go/moco

A+    Excellent!    Found 20 issues across 97 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!


gocyclo91%

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.

    • moco/backup/backup.go
    • Line 196: warning: cyclomatic complexity 22 of function (*BackupManager).ChoosePod() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 19 of function (*BackupManager).backupBinlog() is high (> 15) (gocyclo)
    • Line 91: warning: cyclomatic complexity 17 of function (*BackupManager).Backup() is high (> 15) (gocyclo)
    • moco/controllers/mysqlcluster_controller.go
    • Line 798: warning: cyclomatic complexity 25 of function (*MySQLClusterReconciler).reconcileV1BackupJob() is high (> 15) (gocyclo)
    • Line 498: warning: cyclomatic complexity 19 of function (*MySQLClusterReconciler).reconcileV1Service1() is high (> 15) (gocyclo)
    • Line 597: warning: cyclomatic complexity 18 of function (*MySQLClusterReconciler).reconcileV1StatefulSet() is high (> 15) (gocyclo)
    • Line 154: warning: cyclomatic complexity 18 of function (*MySQLClusterReconciler).reconcileV1() is high (> 15) (gocyclo)
    • moco/clustering/operations.go
    • Line 239: warning: cyclomatic complexity 26 of function (*managerProcess).configure() is high (> 15) (gocyclo)
    • Line 401: warning: cyclomatic complexity 23 of function (*managerProcess).configureReplica() is high (> 15) (gocyclo)
    • Line 39: warning: cyclomatic complexity 18 of function (*managerProcess).clone() is high (> 15) (gocyclo)
    • moco/clustering/status.go
    • Line 134: warning: cyclomatic complexity 25 of function (*managerProcess).GatherStatus() is high (> 15) (gocyclo)
    • Line 377: warning: cyclomatic complexity 17 of function isDegraded() is high (> 15) (gocyclo)

golint83%

Golint is a linter for Go source code.

    • moco/backup/backup.go
    • Line 33: warning: exported type BackupManager should have comment or be unexported (golint)
    • Line 54: warning: exported function NewBackupManager should have comment or be unexported (golint)
    • Line 91: warning: exported method BackupManager.Backup should have comment or be unexported (golint)
    • Line 196: warning: exported method BackupManager.ChoosePod should have comment or be unexported (golint)
    • moco/pkg/dbop/operator.go
    • Line 73: warning: exported type Resolver should have comment or be unexported (golint)
    • Line 83: warning: exported function NewFactory should have comment or be unexported (golint)
    • moco/pkg/cert/cert.go
    • Line 88: warning: exported method Reloader.TLSClientConfig should have comment or be unexported (golint)
    • Line 94: warning: exported method Reloader.TLSServerConfig should have comment or be unexported (golint)
    • moco/pkg/dbop/test_util.go
    • Line 44: warning: exported function RunMySQLOnDocker should have comment or be unexported (golint)
    • Line 61: warning: exported function ConfigureMySQLOnDocker should have comment or be unexported (golint)
    • Line 106: warning: exported function NewTestFactory should have comment or be unexported (golint)
    • moco/backup/restore.go
    • Line 32: warning: exported type RestoreManager should have comment or be unexported (golint)
    • Line 46: warning: exported function NewRestoreManager should have comment or be unexported (golint)
    • Line 77: warning: exported method RestoreManager.Restore should have comment or be unexported (golint)
    • Line 191: warning: exported method RestoreManager.FindNearestDump should have comment or be unexported (golint)
    • moco/pkg/event/event.go
    • Line 12: warning: exported type MOCOEvent should have comment or be unexported (golint)
    • Line 18: warning: exported method MOCOEvent.Emit should have comment or be unexported (golint)
    • Line 22: warning: exported method MOCOEvent.ToEvent should have comment or be unexported (golint)
    • Line 45: warning: exported var InitCloneSucceeded should have comment or be unexported (golint)
    • moco/clustering/manager.go
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 31: warning: exported function NewClusterManager should have comment or be unexported (golint)
    • moco/clustering/operations.go
    • Line 55: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 60: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 72: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 77: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 82: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 87: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • moco/pkg/dbop/types.go
    • Line 7: warning: exported type AccessInfo should have comment or be unexported (golint)
    • Line 121: warning: exported method ReplicaStatus.IsRunning 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!