Preparing report...

Report for github.com/objectrocket/percona-backup-mongodb

A    Great!    Found 43 issues across 57 files

Tweet

gofmt98%

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!


gocyclo84%

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.


golint35%

Golint is a linter for Go source code.

    • percona-backup-mongodb/pbm/storage/blackhole/blackhole.go
    • Line 10: warning: exported type Blackhole should have comment or be unexported (golint)
    • Line 12: warning: exported function New should have comment or be unexported (golint)
    • Line 16: warning: exported method Blackhole.Save should have comment or be unexported (golint)
    • Line 21: warning: exported method Blackhole.Files should have comment or be unexported (golint)
    • Line 22: warning: exported method Blackhole.List should have comment or be unexported (golint)
    • Line 23: warning: exported method Blackhole.Delete should have comment or be unexported (golint)
    • Line 24: warning: exported method Blackhole.FileStat should have comment or be unexported (golint)
    • Line 32: warning: exported method NopReadCloser.Close should have comment or be unexported (golint)
    • Line 34: warning: exported method Blackhole.SourceReader should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/log/log.go
    • Line 20: warning: exported type Logger should have comment or be unexported (golint)
    • Line 27: warning: exported type LogEntry should have comment or be unexported (golint)
    • Line 37: warning: exported type LogKeys should have comment or be unexported (golint)
    • Line 62: warning: exported method LogEntry.StringNode should have comment or be unexported (golint)
    • Line 90: warning: exported type Severity should have comment or be unexported (golint)
    • Line 93: warning: exported const Fatal should have comment (or a comment on this block) or be unexported (golint)
    • Line 117: warning: exported function New should have comment or be unexported (golint)
    • Line 160: warning: exported method Logger.Printf should have comment or be unexported (golint)
    • Line 164: warning: exported method Logger.Debug should have comment or be unexported (golint)
    • Line 168: warning: exported method Logger.Info should have comment or be unexported (golint)
    • Line 172: warning: exported method Logger.Warning should have comment or be unexported (golint)
    • Line 180: warning: exported method Logger.Fatal should have comment or be unexported (golint)
    • Line 184: warning: exported method Logger.Output should have comment or be unexported (golint)
    • Line 217: warning: exported method Logger.NewEvent should have comment or be unexported (golint)
    • Line 227: warning: exported method Event.Debug should have comment or be unexported (golint)
    • Line 231: warning: exported method Event.Info should have comment or be unexported (golint)
    • Line 235: warning: exported method Event.Warning should have comment or be unexported (golint)
    • Line 243: warning: exported method Event.Fatal should have comment or be unexported (golint)
    • Line 247: warning: exported type LogRequest should have comment or be unexported (golint)
    • Line 253: warning: exported type OutFormat should have comment or be unexported (golint)
    • Line 256: warning: exported const FormatText should have comment (or a comment on this block) or be unexported (golint)
    • Line 260: warning: exported method Logger.PrintLogs should have comment or be unexported (golint)
    • Line 297: warning: exported method Logger.Get should have comment or be unexported (golint)
    • percona-backup-mongodb/e2e-tests/pkg/pbm/docker.go
    • Line 16: warning: exported type Docker should have comment or be unexported (golint)
    • Line 21: warning: exported function NewDocker should have comment or be unexported (golint)
    • Line 106: warning: exported method Docker.RunOnReplSet should have comment or be unexported (golint)
    • Line 139: warning: exported method Docker.RunCmd should have comment or be unexported (golint)
    • percona-backup-mongodb/e2e-tests/pkg/tests/sharded/backuper.go
    • Line 11: warning: exported type Backuper should have comment or be unexported (golint)
    • Line 19: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 26: warning: exported function NewSnapshot should have comment or be unexported (golint)
    • Line 34: warning: exported method Snapshot.Backup should have comment or be unexported (golint)
    • Line 44: warning: exported method Snapshot.WaitSnapshot should have comment or be unexported (golint)
    • Line 45: warning: exported method Snapshot.WaitDone should have comment or be unexported (golint)
    • Line 46: warning: exported method Snapshot.WaitStarted should have comment or be unexported (golint)
    • Line 48: warning: exported method Snapshot.Restore should have comment or be unexported (golint)
    • Line 52: warning: exported type Pitr should have comment or be unexported (golint)
    • Line 60: warning: exported function NewPitr should have comment or be unexported (golint)
    • Line 69: warning: exported method Pitr.Backup should have comment or be unexported (golint)
    • Line 95: warning: exported method Pitr.WaitSnapshot should have comment or be unexported (golint)
    • Line 96: warning: exported method Pitr.WaitDone should have comment or be unexported (golint)
    • Line 97: warning: exported method Pitr.WaitStarted should have comment or be unexported (golint)
    • Line 99: warning: exported method Pitr.Restore should have comment or be unexported (golint)
    • percona-backup-mongodb/speedt/speedt.go
    • Line 26: warning: exported type Results should have comment or be unexported (golint)
    • Line 35: warning: exported type Byte should have comment or be unexported (golint)
    • Line 39: warning: exported const KB should have comment (or a comment on this block) or be unexported (golint)
    • Line 59: warning: exported type Rand should have comment or be unexported (golint)
    • Line 63: warning: exported function NewRand should have comment or be unexported (golint)
    • Line 70: warning: exported method Rand.WriteTo should have comment or be unexported (golint)
    • Line 82: warning: exported type Collection should have comment or be unexported (golint)
    • Line 87: warning: exported function NewCollection should have comment or be unexported (golint)
    • Line 99: warning: exported method Collection.WriteTo should have comment or be unexported (golint)
    • Line 131: warning: exported function Run should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/node.go
    • Line 14: warning: exported type Node should have comment or be unexported (golint)
    • Line 27: warning: exported const ReplRoleUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported function NewNode should have comment or be unexported (golint)
    • Line 76: warning: exported method Node.Connect should have comment or be unexported (golint)
    • Line 102: warning: exported method Node.GetInfo should have comment or be unexported (golint)
    • Line 133: warning: exported type MongoVersion should have comment or be unexported (golint)
    • Line 138: warning: exported method Node.GetMongoVersion should have comment or be unexported (golint)
    • Line 144: warning: exported method Node.GetReplsetStatus should have comment or be unexported (golint)
    • Line 153: warning: exported method Node.Status should have comment or be unexported (golint)
    • Line 192: warning: exported method Node.ConnURI should have comment or be unexported (golint)
    • Line 196: warning: exported method Node.DumpConns should have comment or be unexported (golint)
    • Line 200: warning: exported method Node.Session should have comment or be unexported (golint)
    • Line 204: warning: exported method Node.CurrentUser should have comment or be unexported (golint)
    • Line 214: warning: exported method Node.DropTMPcoll should have comment or be unexported (golint)
    • Line 228: warning: exported method Node.EnsureNoTMPcoll should have comment or be unexported (golint)
    • percona-backup-mongodb/e2e-tests/pkg/pbm/mongo_pbm.go
    • Line 14: warning: exported type MongoPBM should have comment or be unexported (golint)
    • Line 19: warning: exported function NewMongoPBM should have comment or be unexported (golint)
    • Line 31: warning: exported method MongoPBM.BackupsList should have comment or be unexported (golint)
    • Line 35: warning: exported method MongoPBM.GetBackupMeta should have comment or be unexported (golint)
    • Line 39: warning: exported method MongoPBM.StoreResync should have comment or be unexported (golint)
    • Line 43: warning: exported method MongoPBM.Conn should have comment or be unexported (golint)
    • percona-backup-mongodb/e2e-tests/pkg/pbm/mongod.go
    • Line 21: warning: exported type Mongo should have comment or be unexported (golint)
    • Line 26: warning: exported function NewMongo should have comment or be unexported (golint)
    • Line 66: warning: exported method Mongo.GenBallast should have comment or be unexported (golint)
    • Line 70: warning: exported type TestData should have comment or be unexported (golint)
    • Line 78: warning: exported method Mongo.ServerVersion should have comment or be unexported (golint)
    • Line 90: warning: exported method Mongo.GenData should have comment or be unexported (golint)
    • Line 130: warning: exported method Mongo.ResetBallast should have comment or be unexported (golint)
    • Line 138: warning: exported method Mongo.DBhashes should have comment or be unexported (golint)
    • Line 153: warning: exported type Counter should have comment or be unexported (golint)
    • Line 170: warning: exported method Mongo.ResetCounters should have comment or be unexported (golint)
    • Line 178: warning: exported method Mongo.WriteCounter should have comment or be unexported (golint)
    • Line 201: warning: exported method Mongo.GetCounters should have comment or be unexported (golint)
    • Line 234: warning: exported method Mongo.GetNodeInfo should have comment or be unexported (golint)
    • Line 243: warning: exported method Mongo.GetLastWrite should have comment or be unexported (golint)
    • Line 254: warning: exported method Mongo.Conn should have comment or be unexported (golint)
    • percona-backup-mongodb/version/version.go
    • Line 20: warning: exported type Info should have comment or be unexported (golint)
    • Line 36: warning: exported var DefaultInfo should have comment or be unexported (golint)
    • Line 52: warning: exported method Info.Short should have comment or be unexported (golint)
    • Line 56: warning: exported method Info.All should have comment or be unexported (golint)
    • percona-backup-mongodb/e2e-tests/pkg/tests/sharded/cluster.go
    • Line 14: warning: exported type Cluster should have comment or be unexported (golint)
    • Line 25: warning: exported type ClusterConf should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 62: warning: exported method Cluster.ApplyConfig should have comment or be unexported (golint)
    • Line 81: warning: exported method Cluster.ServerVersion should have comment or be unexported (golint)
    • Line 89: warning: exported method Cluster.DeleteBallast should have comment or be unexported (golint)
    • Line 98: warning: exported method Cluster.Restore should have comment or be unexported (golint)
    • Line 115: warning: exported method Cluster.PITRestore should have comment or be unexported (golint)
    • Line 132: warning: exported method Cluster.Backup should have comment or be unexported (golint)
    • Line 144: warning: exported method Cluster.BackupWaitDone should have comment or be unexported (golint)
    • Line 162: warning: exported method Cluster.GenerateBallastData should have comment or be unexported (golint)
    • Line 171: warning: exported method Cluster.DataChecker should have comment or be unexported (golint)
    • percona-backup-mongodb/e2e-tests/pkg/pbm/pbm_ctl.go
    • Line 17: warning: exported type Ctl should have comment or be unexported (golint)
    • Line 26: warning: exported function NewCtl should have comment or be unexported (golint)
    • Line 39: warning: exported method Ctl.PITRon should have comment or be unexported (golint)
    • Line 48: warning: exported method Ctl.PITRoff should have comment or be unexported (golint)
    • Line 58: warning: exported method Ctl.ApplyConfig should have comment or be unexported (golint)
    • Line 68: warning: exported method Ctl.Backup should have comment or be unexported (golint)
    • Line 82: warning: exported method Ctl.CheckBackup should have comment or be unexported (golint)
    • Line 114: warning: exported method Ctl.CheckRestore should have comment or be unexported (golint)
    • Line 146: warning: exported method Ctl.CheckPITRestore should have comment or be unexported (golint)
    • Line 182: warning: exported method Ctl.Restore should have comment or be unexported (golint)
    • Line 187: warning: exported method Ctl.PITRestore should have comment or be unexported (golint)
    • Line 192: warning: exported method Ctl.RunCmd should have comment or be unexported (golint)
    • Line 238: warning: exported method Ctl.ContainerLogs should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/bsontypes.go
    • Line 9: warning: exported type OpTime should have comment or be unexported (golint)
    • Line 75: warning: exported type ClusterTime should have comment or be unexported (golint)
    • Line 83: warning: exported type ConfigServerState should have comment or be unexported (golint)
    • Line 87: warning: exported type Operation should have comment or be unexported (golint)
    • Line 90: warning: exported const OperationInsert should have comment (or a comment on this block) or be unexported (golint)
    • Line 97: warning: exported type NodeHealth should have comment or be unexported (golint)
    • Line 100: warning: exported const NodeHealthDown should have comment (or a comment on this block) or be unexported (golint)
    • Line 104: warning: exported type NodeState should have comment or be unexported (golint)
    • Line 107: warning: exported const NodeStateStartup should have comment (or a comment on this block) or be unexported (golint)
    • Line 119: warning: exported type StatusOpTimes should have comment or be unexported (golint)
    • Line 126: warning: exported type NodeStatus should have comment or be unexported (golint)
    • Line 148: warning: exported type ReplsetStatus should have comment or be unexported (golint)
    • Line 170: warning: exported type ConnectionStatus should have comment or be unexported (golint)
    • Line 174: warning: exported type AuthInfo should have comment or be unexported (golint)
    • Line 179: warning: exported type AuthUser should have comment or be unexported (golint)
    • Line 183: warning: exported type AuthUserRoles should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/cmd.go
    • Line 11: warning: exported type ErrorCursor should have comment or be unexported (golint)
    • Line 19: warning: exported method PBM.ListenCmd should have comment or be unexported (golint)
    • Line 78: warning: exported method PBM.SendCmd should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/restore.go
    • Line 13: warning: exported type RestoreMeta should have comment or be unexported (golint)
    • Line 27: warning: exported type RestoreReplset should have comment or be unexported (golint)
    • Line 37: warning: exported method PBM.SetRestoreMeta should have comment or be unexported (golint)
    • Line 49: warning: exported method PBM.GetRestoreMetaByOPID should have comment or be unexported (golint)
    • Line 53: warning: exported method PBM.GetRestoreMeta should have comment or be unexported (golint)
    • Line 90: warning: exported method PBM.AddRestoreRSMeta should have comment or be unexported (golint)
    • Line 105: warning: exported method PBM.RestoreHB should have comment or be unexported (golint)
    • Line 122: warning: exported method PBM.ChangeRestoreStateOPID should have comment or be unexported (golint)
    • Line 126: warning: exported method PBM.ChangeRestoreState should have comment or be unexported (golint)
    • Line 146: warning: exported method PBM.SetRestoreBackup should have comment or be unexported (golint)
    • Line 158: warning: exported method PBM.SetRestorePITR should have comment or be unexported (golint)
    • Line 170: warning: exported method PBM.ChangeRestoreRSState should have comment or be unexported (golint)
    • Line 186: warning: exported method PBM.RestoresList should have comment or be unexported (golint)
    • percona-backup-mongodb/agent/agent.go
    • Line 19: warning: exported type Agent should have comment or be unexported (golint)
    • Line 34: warning: exported function New should have comment or be unexported (golint)
    • Line 40: warning: exported method Agent.AddNode should have comment or be unexported (golint)
    • Line 45: warning: exported method Agent.InitLogger should have comment or be unexported (golint)
    • Line 269: warning: exported method Agent.HbStatus should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/storage/fs/fs.go
    • Line 16: warning: exported type Conf should have comment or be unexported (golint)
    • Line 20: warning: exported type FS should have comment or be unexported (golint)
    • Line 24: warning: exported function New should have comment or be unexported (golint)
    • Line 30: warning: exported method FS.Save should have comment or be unexported (golint)
    • Line 51: warning: exported method FS.SourceReader should have comment or be unexported (golint)
    • Line 57: warning: exported method FS.FileStat should have comment or be unexported (golint)
    • Line 76: warning: exported method FS.List should have comment or be unexported (golint)
    • Line 106: warning: exported method FS.Files should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/restore/restore.go
    • Line 52: warning: exported type Restore should have comment or be unexported (golint)
    • Line 224: warning: exported method Restore.PreparePITR should have comment or be unexported (golint)
    • Line 280: warning: exported method Restore.PrepareBackup should have comment or be unexported (golint)
    • Line 294: warning: exported var ErrNoDatForShard should have comment or be unexported (golint)
    • Line 384: warning: exported method Restore.RunSnapshot should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/config.go
    • Line 40: warning: exported const StorageUndef should have comment (or a comment on this block) or be unexported (golint)
    • Line 89: warning: exported method PBM.SetConfigByte should have comment or be unexported (golint)
    • Line 98: warning: exported method PBM.SetConfig should have comment or be unexported (golint)
    • Line 125: warning: exported method PBM.SetConfigVar should have comment or be unexported (golint)
    • Line 215: warning: exported method PBM.GetConfigYaml should have comment or be unexported (golint)
    • Line 240: warning: exported method PBM.GetConfig should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/lock.go
    • Line 15: warning: exported const StaleFrameSec should have comment or be unexported (golint)
    • Line 28: warning: exported type LockData should have comment or be unexported (golint)
    • Line 167: warning: exported method PBM.MarkBcpStale should have comment or be unexported (golint)
    • Line 182: warning: exported method PBM.MarkRestoreStale should have comment or be unexported (golint)
    • Line 263: warning: exported method PBM.GetLockData should have comment or be unexported (golint)
    • Line 267: warning: exported method PBM.GetOpLockData should have comment or be unexported (golint)
    • Line 281: warning: exported method PBM.GetLocks should have comment or be unexported (golint)
    • Line 285: warning: exported method PBM.GetOpLocks should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/pbm.go
    • Line 67: warning: exported const CmdUndefined should have comment (or a comment on this block) or be unexported (golint)
    • Line 98: warning: exported type OPID should have comment or be unexported (golint)
    • Line 100: warning: exported type Cmd should have comment or be unexported (golint)
    • Line 110: warning: exported function OPIDfromStr should have comment or be unexported (golint)
    • Line 118: warning: exported function NilOPID should have comment or be unexported (golint)
    • Line 124: warning: exported method OPID.Obj should have comment or be unexported (golint)
    • Line 152: warning: exported type BackupCmd should have comment or be unexported (golint)
    • Line 161: warning: exported type RestoreCmd should have comment or be unexported (golint)
    • Line 170: warning: exported type PITRestoreCmd should have comment or be unexported (golint)
    • Line 179: warning: exported type DeleteBackupCmd should have comment or be unexported (golint)
    • Line 188: warning: exported type CompressionType should have comment or be unexported (golint)
    • Line 191: warning: exported const CompressionTypeNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 200: warning: exported const PITRcheckRange should have comment (or a comment on this block) or be unexported (golint)
    • Line 205: warning: exported var WaitActionStart should have comment or be unexported (golint)
    • Line 217: warning: exported type PBM should have comment or be unexported (golint)
    • Line 283: warning: exported method PBM.InitLogger should have comment or be unexported (golint)
    • Line 287: warning: exported method PBM.Logger should have comment or be unexported (golint)
    • Line 448: warning: exported type Condition should have comment or be unexported (golint)
    • Line 454: warning: exported type BackupReplset should have comment or be unexported (golint)
    • Line 471: warning: exported const StatusStarting should have comment (or a comment on this block) or be unexported (golint)
    • Line 479: warning: exported method PBM.SetBackupMeta should have comment or be unexported (golint)
    • Line 502: warning: exported method PBM.ChangeBackupStateOPID should have comment or be unexported (golint)
    • Line 505: warning: exported method PBM.ChangeBackupState should have comment or be unexported (golint)
    • Line 524: warning: exported method PBM.BackupHB should have comment or be unexported (golint)
    • Line 541: warning: exported method PBM.SetLastWrite should have comment or be unexported (golint)
    • Line 553: warning: exported method PBM.AddRSMeta should have comment or be unexported (golint)
    • Line 568: warning: exported method PBM.ChangeRSState should have comment or be unexported (golint)
    • Line 584: warning: exported method PBM.SetRSFirstWrite should have comment or be unexported (golint)
    • Line 596: warning: exported method PBM.SetRSLastWrite should have comment or be unexported (golint)
    • Line 608: warning: exported method PBM.GetBackupMeta should have comment or be unexported (golint)
    • Line 612: warning: exported method PBM.GetBackupByOPID should have comment or be unexported (golint)
    • Line 664: warning: exported method PBM.BackupGetNext should have comment or be unexported (golint)
    • Line 685: warning: exported method PBM.BackupsList should have comment or be unexported (golint)
    • Line 803: warning: exported method PBM.LogGet should have comment or be unexported (golint)
    • Line 807: warning: exported method PBM.LogGetExactSeverity should have comment or be unexported (golint)
    • Line 811: warning: exported type Epoch should have comment or be unexported (golint)
    • Line 813: warning: exported method PBM.GetEpoch should have comment or be unexported (golint)
    • Line 822: warning: exported method PBM.ResetEpoch should have comment or be unexported (golint)
    • Line 836: warning: exported method Epoch.TS should have comment or be unexported (golint)
    • Line 854: warning: exported type AgentStat should have comment or be unexported (golint)
    • Line 864: warning: exported type SubsysStatus should have comment or be unexported (golint)
    • Line 869: warning: exported method AgentStat.OK should have comment or be unexported (golint)
    • Line 887: warning: exported method PBM.SetAgentStatus should have comment or be unexported (golint)
    • Line 903: warning: exported method PBM.RmAgentStatus should have comment or be unexported (golint)
    • percona-backup-mongodb/pbm/storage/s3/s3.go
    • Line 38: warning: exported type Conf should have comment or be unexported (golint)
    • Line 49: warning: exported type AWSsse should have comment or be unexported (golint)
    • Line 54: warning: exported method Conf.Cast should have comment or be unexported (golint)
    • Line 74: warning: exported type Credentials should have comment or be unexported (golint)
    • Line 84: warning: exported type S3Provider should have comment or be unexported (golint)
    • Line 87: warning: exported const S3ProviderUndef should have comment (or a comment on this block) or be unexported (golint)
    • Line 92: warning: exported type S3 should have comment or be unexported (golint)
    • Line 97: warning: exported function New should have comment or be unexported (golint)
    • Line 111: warning: exported method S3.Save should have comment or be unexported (golint)
    • Line 181: warning: exported method S3.Files should have comment or be unexported (golint)
    • Line 244: warning: exported method S3.List should have comment or be unexported (golint)
    • Line 291: warning: exported method S3.FileStat should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell85%

Misspell Finds commonly misspelled English words

    • percona-backup-mongodb/speedt/dataset.go
    • Line 130: warning: "Nothern" is a misspelling of "Northern" (misspell)
    • Line 131: warning: "Nothern" is a misspelling of "Northern" (misspell)
    • Line 588: warning: "Bradfrod" is a misspelling of "Bradford" (misspell)
    • Line 804: warning: "Restraunt" is a misspelling of "Restraint" (misspell)
    • Line 1096: warning: "Supermare" is a misspelling of "Supermarket" (misspell)
    • Line 1689: warning: "Leciester" is a misspelling of "Leicester" (misspell)
    • Line 1999: warning: "Resturant" is a misspelling of "Restaurant" (misspell)
    • Line 2081: warning: "Restuarant" is a misspelling of "Restaurant" (misspell)
    • Line 2124: warning: "Pavillion" is a misspelling of "Pavilion" (misspell)
    • Line 2125: warning: "Pavillion" is a misspelling of "Pavilion" (misspell)
    • Line 2126: warning: "Pavillion" is a misspelling of "Pavilion" (misspell)