Preparing report...

Report for github.com/pingcap/br

A+    Excellent!    Found 60 issues across 246 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!


gocyclo92%

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.

    • br/pkg/backup/client.go
    • Line 252: warning: cyclomatic complexity 22 of function BuildBackupRangeAndSchema() is high (> 15) (gocyclo)
    • Line 555: warning: cyclomatic complexity 21 of function (*Client).fineGrainedBackup() is high (> 15) (gocyclo)
    • Line 842: warning: cyclomatic complexity 18 of function SendBackup() is high (> 15) (gocyclo)
    • Line 682: warning: cyclomatic complexity 18 of function OnBackupResponse() is high (> 15) (gocyclo)
    • br/pkg/kv/kv.go
    • Line 303: warning: cyclomatic complexity 20 of function (*tableKVEncoder).AddRecord() is high (> 15) (gocyclo)
    • br/pkg/lightning/backend/tidb/tidb.go
    • Line 446: warning: cyclomatic complexity 18 of function (*tidbBackend).FetchRemoteTableModels() is high (> 15) (gocyclo)
    • Line 175: warning: cyclomatic complexity 17 of function (*tidbEncoder).appendSQL() is high (> 15) (gocyclo)
    • br/pkg/restore/ingester.go
    • Line 310: warning: cyclomatic complexity 25 of function (*Ingester).writeToTiKV() is high (> 15) (gocyclo)
    • Line 521: warning: cyclomatic complexity 21 of function (*Ingester).isIngestRetryable() is high (> 15) (gocyclo)

golint82%

Golint is a linter for Go source code.

    • br/pkg/lightning/glue/glue.go
    • Line 34: warning: exported type Glue should have comment or be unexported (golint)
    • Line 46: warning: exported type SQLExecutor should have comment or be unexported (golint)
    • Line 88: warning: exported type ExternalTiDBGlue should have comment or be unexported (golint)
    • Line 93: warning: exported function NewExternalTiDBGlue should have comment or be unexported (golint)
    • Line 100: warning: exported method ExternalTiDBGlue.GetSQLExecutor should have comment or be unexported (golint)
    • Line 104: warning: exported method ExternalTiDBGlue.ExecuteWithLog should have comment or be unexported (golint)
    • Line 112: warning: exported method ExternalTiDBGlue.ObtainStringWithLog should have comment or be unexported (golint)
    • Line 121: warning: exported method ExternalTiDBGlue.QueryStringsWithLog should have comment or be unexported (golint)
    • Line 153: warning: exported method ExternalTiDBGlue.GetDB should have comment or be unexported (golint)
    • Line 157: warning: exported method ExternalTiDBGlue.GetParser should have comment or be unexported (golint)
    • Line 161: warning: exported method ExternalTiDBGlue.GetTables should have comment or be unexported (golint)
    • Line 165: warning: exported method ExternalTiDBGlue.GetSession should have comment or be unexported (golint)
    • Line 173: warning: exported method ExternalTiDBGlue.OpenCheckpointsDB should have comment or be unexported (golint)
    • Line 177: warning: exported method ExternalTiDBGlue.OwnsSQLExecutor should have comment or be unexported (golint)
    • Line 181: warning: exported method ExternalTiDBGlue.Close should have comment or be unexported (golint)
    • Line 185: warning: exported method ExternalTiDBGlue.Record should have comment or be unexported (golint)
    • Line 189: warning: exported const RecordEstimatedChunk should have comment (or a comment on this block) or be unexported (golint)
    • br/pkg/lightning/backend/tidb/tidb.go
    • Line 574: warning: exported type Writer should have comment or be unexported (golint)
    • Line 579: warning: exported method Writer.Close should have comment or be unexported (golint)
    • Line 583: warning: exported method Writer.AppendRows should have comment or be unexported (golint)
    • Line 587: warning: exported method Writer.IsSynced should have comment or be unexported (golint)
    • Line 591: warning: exported type TableAutoIDInfo should have comment or be unexported (golint)
    • Line 597: warning: exported function FetchTableAutoIDInfos should have comment or be unexported (golint)
    • br/pkg/lightning/checkpoints/checkpoints.go
    • Line 41: warning: exported type CheckpointStatus should have comment or be unexported (golint)
    • Line 44: warning: exported const CheckpointStatusMissing should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported const WholeTableEngineID should have comment or be unexported (golint)
    • Line 61: warning: comment on exported const CheckpointTableNameTask should be of the form "CheckpointTableNameTask ..." (golint)
    • Line 64: warning: exported const CheckpointTableNameTable should have comment (or a comment on this block) or be unexported (golint)
    • Line 75: warning: comment on exported const CreateDBTemplate should be of the form "CreateDBTemplate ..." (golint)
    • Line 77: warning: exported const CreateTaskTableTemplate should have comment (or a comment on this block) or be unexported (golint)
    • Line 186: warning: exported function IsCheckpointTable should have comment or be unexported (golint)
    • Line 195: warning: exported method CheckpointStatus.MetricName should have comment or be unexported (golint)
    • Line 220: warning: exported type ChunkCheckpointKey should have comment or be unexported (golint)
    • Line 240: warning: exported type ChunkCheckpoint should have comment or be unexported (golint)
    • Line 249: warning: exported method ChunkCheckpoint.DeepCopy should have comment or be unexported (golint)
    • Line 262: warning: exported type EngineCheckpoint should have comment or be unexported (golint)
    • Line 267: warning: exported method EngineCheckpoint.DeepCopy should have comment or be unexported (golint)
    • Line 278: warning: exported type TableCheckpoint should have comment or be unexported (golint)
    • Line 287: warning: exported method TableCheckpoint.DeepCopy should have comment or be unexported (golint)
    • Line 301: warning: exported method TableCheckpoint.CountChunks should have comment or be unexported (golint)
    • Line 322: warning: exported type TableCheckpointDiff should have comment or be unexported (golint)
    • Line 332: warning: exported function NewTableCheckpointDiff should have comment or be unexported (golint)
    • Line 394: warning: exported type TableCheckpointMerger should have comment or be unexported (golint)
    • Line 403: warning: exported type StatusCheckpointMerger should have comment or be unexported (golint)
    • Line 408: warning: exported method StatusCheckpointMerger.SetInvalid should have comment or be unexported (golint)
    • Line 412: warning: exported method StatusCheckpointMerger.MergeInto should have comment or be unexported (golint)
    • Line 426: warning: exported type ChunkCheckpointMerger should have comment or be unexported (golint)
    • Line 435: warning: exported method ChunkCheckpointMerger.MergeInto should have comment or be unexported (golint)
    • Line 448: warning: exported type TableChecksumMerger should have comment or be unexported (golint)
    • Line 452: warning: exported method TableChecksumMerger.MergeInto should have comment or be unexported (golint)
    • Line 457: warning: exported type RebaseCheckpointMerger should have comment or be unexported (golint)
    • Line 461: warning: exported method RebaseCheckpointMerger.MergeInto should have comment or be unexported (golint)
    • Line 466: warning: exported type DestroyedTableCheckpoint should have comment or be unexported (golint)
    • Line 472: warning: exported type TaskCheckpoint should have comment or be unexported (golint)
    • Line 484: warning: exported type DB should have comment or be unexported (golint)
    • Line 509: warning: exported function OpenCheckpointsDB should have comment or be unexported (golint)
    • Line 535: warning: exported function IsCheckpointsDBExists should have comment or be unexported (golint)
    • Line 575: warning: exported function NewNullCheckpointsDB should have comment or be unexported (golint)
    • Line 579: warning: exported method NullCheckpointsDB.Initialize should have comment or be unexported (golint)
    • Line 583: warning: exported method NullCheckpointsDB.TaskCheckpoint should have comment or be unexported (golint)
    • Line 587: warning: exported method NullCheckpointsDB.Close should have comment or be unexported (golint)
    • Line 591: warning: exported method NullCheckpointsDB.Get should have comment or be unexported (golint)
    • Line 598: warning: exported method NullCheckpointsDB.InsertEngineCheckpoints should have comment or be unexported (golint)
    • Line 602: warning: exported method NullCheckpointsDB.Update should have comment or be unexported (golint)
    • Line 604: warning: exported type MySQLCheckpointsDB should have comment or be unexported (golint)
    • Line 609: warning: exported function NewMySQLCheckpointsDB should have comment or be unexported (golint)
    • Line 647: warning: exported method MySQLCheckpointsDB.Initialize should have comment or be unexported (golint)
    • Line 695: warning: exported method MySQLCheckpointsDB.TaskCheckpoint should have comment or be unexported (golint)
    • Line 716: warning: exported method MySQLCheckpointsDB.Close should have comment or be unexported (golint)
    • Line 720: warning: exported method MySQLCheckpointsDB.Get should have comment or be unexported (golint)
    • Line 813: warning: exported method MySQLCheckpointsDB.InsertEngineCheckpoints should have comment or be unexported (golint)
    • Line 862: warning: exported method MySQLCheckpointsDB.Update should have comment or be unexported (golint)
    • Line 941: warning: exported type FileCheckpointsDB should have comment or be unexported (golint)
    • Line 947: warning: exported function NewFileCheckpointsDB should have comment or be unexported (golint)
    • Line 1003: warning: exported method FileCheckpointsDB.Initialize should have comment or be unexported (golint)
    • Line 1040: warning: exported method FileCheckpointsDB.TaskCheckpoint should have comment or be unexported (golint)
    • Line 1060: warning: exported method FileCheckpointsDB.Close should have comment or be unexported (golint)
    • Line 1067: warning: exported method FileCheckpointsDB.Get should have comment or be unexported (golint)
    • Line 1129: warning: exported method FileCheckpointsDB.InsertEngineCheckpoints should have comment or be unexported (golint)
    • Line 1168: warning: exported method FileCheckpointsDB.Update should have comment or be unexported (golint)
    • Line 1212: warning: exported method NullCheckpointsDB.RemoveCheckpoint should have comment or be unexported (golint)
    • Line 1216: warning: exported method NullCheckpointsDB.MoveCheckpoints should have comment or be unexported (golint)
    • Line 1220: warning: exported method NullCheckpointsDB.GetLocalStoringTables should have comment or be unexported (golint)
    • Line 1224: warning: exported method NullCheckpointsDB.IgnoreErrorCheckpoint should have comment or be unexported (golint)
    • Line 1228: warning: exported method NullCheckpointsDB.DestroyErrorCheckpoint should have comment or be unexported (golint)
    • Line 1232: warning: exported method NullCheckpointsDB.DumpTables should have comment or be unexported (golint)
    • Line 1236: warning: exported method NullCheckpointsDB.DumpEngines should have comment or be unexported (golint)
    • Line 1240: warning: exported method NullCheckpointsDB.DumpChunks should have comment or be unexported (golint)
    • Line 1244: warning: exported method MySQLCheckpointsDB.RemoveCheckpoint should have comment or be unexported (golint)
    • Line 1272: warning: exported method MySQLCheckpointsDB.MoveCheckpoints should have comment or be unexported (golint)
    • Line 1299: warning: exported method MySQLCheckpointsDB.GetLocalStoringTables should have comment or be unexported (golint)
    • Line 1347: warning: exported method MySQLCheckpointsDB.IgnoreErrorCheckpoint should have comment or be unexported (golint)
    • Line 1380: warning: exported method MySQLCheckpointsDB.DestroyErrorCheckpoint should have comment or be unexported (golint)
    • Line 1457: warning: comment on exported method MySQLCheckpointsDB.DumpTables should be of the form "DumpTables ..." (golint)
    • Line 1478: warning: comment on exported method MySQLCheckpointsDB.DumpEngines should be of the form "DumpEngines ..." (golint)
    • Line 1497: warning: comment on exported method MySQLCheckpointsDB.DumpChunks should be of the form "DumpChunks ..." (golint)
    • Line 1528: warning: exported method FileCheckpointsDB.RemoveCheckpoint should have comment or be unexported (golint)
    • Line 1541: warning: exported method FileCheckpointsDB.MoveCheckpoints should have comment or be unexported (golint)
    • Line 1549: warning: exported method FileCheckpointsDB.GetLocalStoringTables should have comment or be unexported (golint)
    • Line 1578: warning: exported method FileCheckpointsDB.IgnoreErrorCheckpoint should have comment or be unexported (golint)
    • Line 1598: warning: exported method FileCheckpointsDB.DestroyErrorCheckpoint should have comment or be unexported (golint)
    • Line 1639: warning: exported method FileCheckpointsDB.DumpTables should have comment or be unexported (golint)
    • Line 1643: warning: exported method FileCheckpointsDB.DumpEngines should have comment or be unexported (golint)
    • Line 1647: warning: exported method FileCheckpointsDB.DumpChunks should have comment or be unexported (golint)
    • br/pkg/lightning/common/security.go
    • Line 33: warning: comment on exported type TLS should be of the form "TLS ..." (with optional leading article) (golint)
    • Line 148: warning: exported method TLS.GetJSON should have comment or be unexported (golint)
    • Line 152: warning: exported method TLS.ToPDSecurityOption should have comment or be unexported (golint)
    • Line 160: warning: exported method TLS.TLSConfig should have comment or be unexported (golint)
    • br/pkg/lightning/restore/check_template.go
    • Line 23: warning: exported type CheckType should have comment or be unexported (golint)
    • Line 26: warning: exported const Critical should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type Template should have comment or be unexported (golint)
    • Line 46: warning: exported type SimpleTemplate should have comment or be unexported (golint)
    • Line 53: warning: exported function NewSimpleTemplate should have comment or be unexported (golint)
    • Line 70: warning: exported method SimpleTemplate.Collect should have comment or be unexported (golint)
    • Line 86: warning: exported method SimpleTemplate.Success should have comment or be unexported (golint)
    • Line 90: warning: exported method SimpleTemplate.FailedCount should have comment or be unexported (golint)
    • Line 100: warning: exported method SimpleTemplate.Output should have comment or be unexported (golint)
    • br/pkg/lightning/restore/restore.go
    • Line 63: warning: exported const FullLevelCompact should have comment (or a comment on this block) or be unexported (golint)
    • Line 225: warning: exported type Controller should have comment or be unexported (golint)
    • Line 259: warning: exported function NewRestoreController should have comment or be unexported (golint)
    • Line 269: warning: exported function NewRestoreControllerWithPauser should have comment or be unexported (golint)
    • Line 385: warning: exported method Controller.Close should have comment or be unexported (golint)
    • Line 390: warning: exported method Controller.Run should have comment or be unexported (golint)
    • br/pkg/lightning/worker/worker.go
    • Line 23: warning: exported type Pool should have comment or be unexported (golint)
    • Line 29: warning: exported type Worker should have comment or be unexported (golint)
    • Line 33: warning: exported function NewPool should have comment or be unexported (golint)
    • Line 47: warning: exported method Pool.Apply should have comment or be unexported (golint)
    • Line 55: warning: exported method Pool.Recycle should have comment or be unexported (golint)
    • Line 63: warning: exported method Pool.HasWorker should have comment or be unexported (golint)
    • br/pkg/lightning/mydump/region.go
    • Line 35: warning: exported type TableRegion should have comment or be unexported (golint)
    • Line 45: warning: exported method TableRegion.RowIDMin should have comment or be unexported (golint)
    • Line 49: warning: exported method TableRegion.Rows should have comment or be unexported (golint)
    • Line 53: warning: exported method TableRegion.Offset should have comment or be unexported (golint)
    • Line 57: warning: exported method TableRegion.Size should have comment or be unexported (golint)
    • Line 61: warning: exported function AllocateEngineIDs should have comment or be unexported (golint)
    • Line 132: warning: exported function MakeTableRegions should have comment or be unexported (golint)
    • br/pkg/lightning/common/util.go
    • Line 62: warning: exported method MySQLConnectParam.ToDSN should have comment or be unexported (golint)
    • Line 74: warning: exported method MySQLConnectParam.Connect should have comment or be unexported (golint)
    • Line 101: warning: exported type QueryExecutor should have comment or be unexported (golint)
    • Line 106: warning: exported type DBExecutor should have comment or be unexported (golint)
    • Line 155: warning: exported method SQLWithRetry.QueryRow should have comment or be unexported (golint)
    • Line 286: warning: comment on exported function WriteMySQLIdentifier should be of the form "WriteMySQLIdentifier ..." (golint)
    • Line 305: warning: exported function InterpolateMySQLString should have comment or be unexported (golint)
    • br/pkg/lightning/mydump/loader.go
    • Line 31: warning: exported type MDDatabaseMeta should have comment or be unexported (golint)
    • Line 39: warning: exported type MDTableMeta should have comment or be unexported (golint)
    • Line 50: warning: exported type SourceFileMeta should have comment or be unexported (golint)
    • Line 58: warning: exported method MDTableMeta.GetSchema should have comment or be unexported (golint)
    • Line 70: warning: comment on exported type MDLoader should be of the form "MDLoader ..." (with optional leading article) (golint)
    • Line 92: warning: exported function NewMyDumpLoader should have comment or be unexported (golint)
    • Line 105: warning: exported function NewMyDumpLoaderWithStore should have comment or be unexported (golint)
    • Line 186: warning: exported type FileInfo should have comment or be unexported (golint)
    • Line 461: warning: exported method MDLoader.GetDatabases should have comment or be unexported (golint)
    • Line 465: warning: exported method MDLoader.GetStore should have comment or be unexported (golint)
    • br/pkg/lightning/config/config.go
    • Line 101: warning: exported var DefaultFilter should have comment or be unexported (golint)
    • Line 112: warning: exported type DBStore should have comment or be unexported (golint)
    • Line 132: warning: exported type Config should have comment or be unexported (golint)
    • Line 157: warning: exported method Config.ToTLS should have comment or be unexported (golint)
    • Line 162: warning: exported type Lightning should have comment or be unexported (golint)
    • Line 171: warning: exported type PostOpLevel should have comment or be unexported (golint)
    • Line 174: warning: exported const OpLevelOff should have comment (or a comment on this block) or be unexported (golint)
    • Line 179: warning: exported method PostOpLevel.UnmarshalTOML should have comment or be unexported (golint)
    • Line 195: warning: exported method PostOpLevel.MarshalText should have comment or be unexported (golint)
    • Line 199: warning: comment on exported method PostOpLevel.FromStringValue should be of the form "FromStringValue ..." (golint)
    • Line 215: warning: exported method PostOpLevel.MarshalJSON should have comment or be unexported (golint)
    • Line 219: warning: exported method PostOpLevel.UnmarshalJSON should have comment or be unexported (golint)
    • Line 245: warning: exported type CSVConfig should have comment or be unexported (golint)
    • Line 256: warning: exported type MydumperRuntime should have comment or be unexported (golint)
    • Line 274: warning: exported type AllIgnoreColumns should have comment or be unexported (golint)
    • Line 276: warning: exported type IgnoreColumns should have comment or be unexported (golint)
    • Line 304: warning: exported type FileRouteRule should have comment or be unexported (golint)
    • Line 314: warning: exported type TikvImporter should have comment or be unexported (golint)
    • Line 330: warning: exported type Checkpoint should have comment or be unexported (golint)
    • Line 338: warning: exported type Cron should have comment or be unexported (golint)
    • Line 344: warning: exported type Security should have comment or be unexported (golint)
    • Line 352: warning: comment on exported method Security.RegisterMySQL should be of the form "RegisterMySQL ..." (golint)
    • Line 371: warning: comment on exported type Duration should be of the form "Duration ..." (with optional leading article) (golint)
    • Line 377: warning: exported method Duration.UnmarshalText should have comment or be unexported (golint)
    • Line 383: warning: exported method Duration.MarshalText should have comment or be unexported (golint)
    • Line 387: warning: exported method Duration.MarshalJSON should have comment or be unexported (golint)
    • Line 391: warning: exported function NewConfig should have comment or be unexported (golint)
    • Line 664: warning: exported method Config.CheckAndAdjustForLocalBackend should have comment or be unexported (golint)
    • Line 688: warning: exported method Config.DefaultVarsForTiDBBackend should have comment or be unexported (golint)
    • Line 715: warning: exported method Config.DefaultVarsForImporterAndLocalBackend should have comment or be unexported (golint)
    • Line 757: warning: exported method Config.CheckAndAdjustTiDBPort should have comment or be unexported (golint)
    • Line 788: warning: exported method Config.CheckAndAdjustFilePath should have comment or be unexported (golint)
    • Line 836: warning: exported method Config.AdjustCheckPoint should have comment or be unexported (golint)
    • Line 862: warning: exported method Config.AdjustMydumper should have comment or be unexported (golint)
    • Line 885: warning: exported method Config.CheckAndAdjustSecurity should have comment or be unexported (golint)
    • br/pkg/lightning/config/global.go
    • Line 31: warning: exported type GlobalLightning should have comment or be unexported (golint)
    • Line 42: warning: exported type GlobalTiDB should have comment or be unexported (golint)
    • Line 52: warning: exported type GlobalMydumper should have comment or be unexported (golint)
    • Line 60: warning: exported type GlobalImporter should have comment or be unexported (golint)
    • Line 66: warning: exported type GlobalConfig should have comment or be unexported (golint)
    • Line 78: warning: exported type GlobalCheckpoint should have comment or be unexported (golint)
    • Line 82: warning: exported type GlobalPostRestore should have comment or be unexported (golint)
    • Line 87: warning: exported function NewGlobalConfig should have comment or be unexported (golint)
    • br/pkg/lightning/backend/local/local.go
    • Line 167: warning: exported type File should have comment or be unexported (golint)
    • Line 218: warning: exported method File.Close should have comment or be unexported (golint)
    • Line 2598: warning: exported type RangePropertiesCollector should have comment or be unexported (golint)
    • Line 2628: warning: comment on exported method RangePropertiesCollector.Add should be of the form "Add ..." (golint)
    • Line 2641: warning: exported method RangePropertiesCollector.Finish should have comment or be unexported (golint)
    • Line 2650: warning: comment on exported method RangePropertiesCollector.Name should be of the form "Name ..." (golint)
    • Line 2705: warning: exported type Writer should have comment or be unexported (golint)
    • Line 2802: warning: exported method Writer.AppendRows should have comment or be unexported (golint)
    • Line 2868: warning: exported method Writer.Close should have comment or be unexported (golint)
    • Line 2879: warning: exported method Writer.IsSynced should have comment or be unexported (golint)
    • br/pkg/lightning/manual/allocator.go
    • Line 16: warning: exported type Allocator should have comment or be unexported (golint)
    • Line 18: warning: exported method Allocator.Alloc should have comment or be unexported (golint)
    • Line 20: warning: exported method Allocator.Free should have comment or be unexported (golint)
    • br/pkg/lightning/metric/metric.go
    • Line 24: warning: comment on exported const TableStatePending should be of the form "TableStatePending ..." (golint)
    • Line 26: warning: exported const TableStateWritten should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: comment on exported const TableResultSuccess should be of the form "TableResultSuccess ..." (golint)
    • Line 37: warning: comment on exported const ChunkStateEstimated should be of the form "ChunkStateEstimated ..." (golint)
    • Line 49: warning: exported var ImporterEngineCounter should have comment or be unexported (golint)
    • Line 223: warning: exported function RecordTableCount should have comment or be unexported (golint)
    • Line 233: warning: exported function RecordEngineCount should have comment or be unexported (golint)
    • br/pkg/lightning/backend/importer/importer.go
    • Line 393: warning: exported type Writer should have comment or be unexported (golint)
    • Line 398: warning: exported method Writer.Close should have comment or be unexported (golint)
    • Line 402: warning: exported method Writer.AppendRows should have comment or be unexported (golint)
    • Line 406: warning: exported method Writer.IsSynced should have comment or be unexported (golint)
    • br/pkg/lightning/mydump/reader.go
    • Line 34: warning: exported var ErrInsertStatementNotFound should have comment or be unexported (golint)
    • Line 70: warning: exported function ExportStatement should have comment or be unexported (golint)
    • br/pkg/lightning/restore/table_restore.go
    • Line 45: warning: exported type TableRestore should have comment or be unexported (golint)
    • Line 58: warning: exported function NewTableRestore should have comment or be unexported (golint)
    • Line 84: warning: exported method TableRestore.Close should have comment or be unexported (golint)
    • Line 135: warning: exported method TableRestore.RebaseChunkRowIDs should have comment or be unexported (golint)
    • Line 135: warning: receiver name t should be consistent with previous receiver name tr for TableRestore (golint)
    • br/pkg/lightning/mydump/router.go
    • Line 16: warning: exported type SourceType should have comment or be unexported (golint)
    • Line 19: warning: exported const SourceTypeIgnore should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported const SchemaSchema should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported type Compression should have comment or be unexported (golint)
    • Line 41: warning: exported const CompressionNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 120: warning: comment on exported type FileRouter should be of the form "FileRouter ..." (with optional leading article) (golint)
    • Line 143: warning: exported function NewFileRouter should have comment or be unexported (golint)
    • Line 156: warning: comment on exported type RegexRouter should be of the form "RegexRouter ..." (with optional leading article) (golint)
    • Line 164: warning: exported method RegexRouter.Route should have comment or be unexported (golint)
    • Line 333: warning: exported type RouteResult should have comment or be unexported (golint)
    • br/pkg/lightning/checkpoints/glue_checkpoint.go
    • Line 38: warning: exported type Session should have comment or be unexported (golint)
    • Line 68: warning: exported function NewGlueCheckpointsDB should have comment or be unexported (golint)
    • Line 125: warning: exported method GlueCheckpointsDB.Initialize should have comment or be unexported (golint)
    • Line 179: warning: exported method GlueCheckpointsDB.TaskCheckpoint should have comment or be unexported (golint)
    • Line 224: warning: exported method GlueCheckpointsDB.Get should have comment or be unexported (golint)
    • Line 349: warning: exported method GlueCheckpointsDB.Close should have comment or be unexported (golint)
    • Line 353: warning: exported method GlueCheckpointsDB.InsertEngineCheckpoints should have comment or be unexported (golint)
    • Line 414: warning: exported method GlueCheckpointsDB.Update should have comment or be unexported (golint)
    • Line 509: warning: exported method GlueCheckpointsDB.RemoveCheckpoint should have comment or be unexported (golint)
    • Line 545: warning: exported method GlueCheckpointsDB.MoveCheckpoints should have comment or be unexported (golint)
    • Line 577: warning: exported method GlueCheckpointsDB.GetLocalStoringTables should have comment or be unexported (golint)
    • Line 627: warning: exported method GlueCheckpointsDB.IgnoreErrorCheckpoint should have comment or be unexported (golint)
    • Line 663: warning: exported method GlueCheckpointsDB.DestroyErrorCheckpoint should have comment or be unexported (golint)
    • Line 755: warning: exported method GlueCheckpointsDB.DumpTables should have comment or be unexported (golint)
    • Line 759: warning: exported method GlueCheckpointsDB.DumpEngines should have comment or be unexported (golint)
    • Line 763: warning: exported method GlueCheckpointsDB.DumpChunks should have comment or be unexported (golint)
    • Line 767: warning: exported function Transact should have comment or be unexported (golint)
    • br/pkg/lightning/config/const.go
    • Line 21: warning: comment on exported const ReadBlockSize should be of the form "ReadBlockSize ..." (golint)
    • Line 23: warning: exported const MinRegionSize should have comment (or a comment on this block) or be unexported (golint)
    • br/pkg/lightning/tikv/tikv.go
    • Line 189: warning: comment on exported function FetchModeFromMetrics should be of the form "FetchModeFromMetrics ..." (golint)
    • Line 202: warning: exported function FetchRemoteTableModelsFromTLS should have comment or be unexported (golint)
    • Line 211: warning: exported function CheckPDVersion should have comment or be unexported (golint)
    • Line 220: warning: exported function CheckTiKVVersion should have comment or be unexported (golint)
    • br/pkg/lightning/lightning.go
    • Line 54: warning: exported type Lightning should have comment or be unexported (golint)
    • Line 74: warning: exported function New should have comment or be unexported (golint)
    • Line 96: warning: exported method Lightning.GoServe should have comment or be unexported (golint)
    • Line 194: warning: exported method Lightning.RunServer should have comment or be unexported (golint)
    • Line 315: warning: exported method Lightning.Stop should have comment or be unexported (golint)
    • br/pkg/lightning/backend/local/duplicate.go
    • Line 56: warning: exported type DuplicateRequest should have comment or be unexported (golint)
    • Line 63: warning: exported type DuplicateManager should have comment or be unexported (golint)
    • Line 74: warning: exported function NewDuplicateManager should have comment or be unexported (golint)
    • Line 91: warning: exported method DuplicateManager.CollectDuplicateRowsFromTiKV should have comment or be unexported (golint)
    • Line 294: warning: exported method DuplicateManager.ReportDuplicateData should have comment or be unexported (golint)
    • Line 298: warning: exported method DuplicateManager.RepairDuplicateData should have comment or be unexported (golint)
    • Line 303: warning: comment on exported method DuplicateManager.CollectDuplicateRowsFromLocalIndex should be of the form "CollectDuplicateRowsFromLocalIndex ..." (golint)
    • br/pkg/lightning/backend/backend.go
    • Line 78: warning: exported function MakeUUID should have comment or be unexported (golint)
    • Line 86: warning: exported type EngineFileSize should have comment or be unexported (golint)
    • Line 241: warning: exported type LocalEngineWriter should have comment or be unexported (golint)
    • Line 246: warning: exported function MakeBackend should have comment or be unexported (golint)
    • Line 250: warning: exported method Backend.Close should have comment or be unexported (golint)
    • Line 254: warning: exported method Backend.MakeEmptyRows should have comment or be unexported (golint)
    • Line 258: warning: exported method Backend.NewEncoder should have comment or be unexported (golint)
    • Line 262: warning: exported method Backend.ShouldPostProcess should have comment or be unexported (golint)
    • Line 266: warning: exported method Backend.CheckRequirements should have comment or be unexported (golint)
    • Line 270: warning: exported method Backend.FetchRemoteTableModels should have comment or be unexported (golint)
    • Line 274: warning: exported method Backend.FlushAll should have comment or be unexported (golint)
    • Line 362: warning: exported method Backend.CollectLocalDuplicateRows should have comment or be unexported (golint)
    • Line 366: warning: exported method Backend.CollectRemoteDuplicateRows should have comment or be unexported (golint)
    • Line 384: warning: exported method OpenedEngine.LocalWriter should have comment or be unexported (golint)
    • Line 397: warning: exported method LocalEngineWriter.Close should have comment or be unexported (golint)
    • Line 401: warning: exported method LocalEngineWriter.IsSynced should have comment or be unexported (golint)
    • Line 464: warning: exported method ClosedEngine.Logger should have comment or be unexported (golint)
    • Line 468: warning: exported type ChunkFlushStatus should have comment or be unexported (golint)
    • Line 472: warning: exported type EngineWriter should have comment or be unexported (golint)
    • br/pkg/lightning/backend/kv/sql2kv.go
    • Line 49: warning: exported var ExtraHandleColumnInfo should have comment or be unexported (golint)
    • Line 67: warning: exported function NewTableKVEncoder should have comment or be unexported (golint)
    • Line 286: warning: exported type KvPairs should have comment or be unexported (golint)
    • Line 456: warning: exported method KvPairs.Size should have comment or be unexported (golint)
    • Line 464: warning: exported method KvPairs.ClassifyAndAppend should have comment or be unexported (golint)
    • Line 495: warning: exported method KvPairs.SplitIntoChunks should have comment or be unexported (golint)
    • Line 525: warning: exported method KvPairs.Clear should have comment or be unexported (golint)
    • br/pkg/lightning/mydump/parquet_parser.go
    • Line 32: warning: exported type ParquetParser should have comment or be unexported (golint)
    • Line 108: warning: exported function OpenParquetReader should have comment or be unexported (golint)
    • Line 138: warning: comment on exported function ReadParquetFileRowCount should be of the form "ReadParquetFileRowCount ..." (golint)
    • Line 165: warning: exported function NewParquetParser should have comment or be unexported (golint)
    • Line 315: warning: exported method ParquetParser.SetPos should have comment or be unexported (golint)
    • Line 342: warning: exported method ParquetParser.Close should have comment or be unexported (golint)
    • Line 347: warning: exported method ParquetParser.ReadRow should have comment or be unexported (golint)
    • Line 392: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 532: warning: exported method ParquetParser.LastRow should have comment or be unexported (golint)
    • Line 536: warning: exported method ParquetParser.RecycleRow should have comment or be unexported (golint)
    • Line 550: warning: exported method ParquetParser.SetLogger should have comment or be unexported (golint)
    • br/pkg/lightning/web/progress.go
    • Line 116: warning: exported function BroadcastStartTask should have comment or be unexported (golint)
    • Line 124: warning: exported function BroadcastEndTask should have comment or be unexported (golint)
    • Line 133: warning: exported function BroadcastInitProgress should have comment or be unexported (golint)
    • Line 148: warning: exported function BroadcastTableCheckpoint should have comment or be unexported (golint)
    • Line 157: warning: exported function BroadcastCheckpointDiff should have comment or be unexported (golint)
    • Line 167: warning: exported function BroadcastError should have comment or be unexported (golint)
    • Line 178: warning: exported function MarshalTaskProgress should have comment or be unexported (golint)
    • Line 184: warning: exported function MarshalTableCheckpoints should have comment or be unexported (golint)
    • br/pkg/lightning/backend/kv/kv2sql.go
    • Line 27: warning: exported type TableKVDecoder should have comment or be unexported (golint)
    • Line 32: warning: exported method TableKVDecoder.DecodeHandleFromTable should have comment or be unexported (golint)
    • Line 36: warning: exported method TableKVDecoder.EncodeHandleKey should have comment or be unexported (golint)
    • Line 40: warning: exported method TableKVDecoder.DecodeHandleFromIndex should have comment or be unexported (golint)
    • Line 50: warning: exported function NewTableKVDecoder should have comment or be unexported (golint)
    • br/pkg/lightning/common/conn.go
    • Line 27: warning: comment on exported type ConnPool should be of the form "ConnPool ..." (with optional leading article) (golint)
    • Line 39: warning: exported method ConnPool.TakeConns should have comment or be unexported (golint)
    • Line 74: warning: comment on exported function NewConnPool should be of the form "NewConnPool ..." (golint)
    • Line 85: warning: exported type GRPCConns should have comment or be unexported (golint)
    • Line 90: warning: exported method GRPCConns.Close should have comment or be unexported (golint)
    • Line 99: warning: exported method GRPCConns.GetGrpcConn should have comment or be unexported (golint)
    • Line 108: warning: exported function NewGRPCConns should have comment or be unexported (golint)
    • br/pkg/lightning/restore/check_info.go
    • Line 51: warning: comment on exported const OnlineBytesLimitation should be of the form "OnlineBytesLimitation ..." (golint)
    • Line 56: warning: exported const OnlineKeysLimitation should have comment (or a comment on this block) or be unexported (golint)
    • Line 194: warning: exported method Controller.EstimateSourceData should have comment or be unexported (golint)
    • Line 495: warning: exported method Controller.SampleDataFromTable should have comment or be unexported (golint)
    • br/pkg/lightning/restore/tidb.go
    • Line 58: warning: exported type TiDBManager should have comment or be unexported (golint)
    • Line 81: warning: exported function DBFromConfig should have comment or be unexported (golint)
    • Line 121: warning: exported function NewTiDBManager should have comment or be unexported (golint)
    • Line 142: warning: exported method TiDBManager.Close should have comment or be unexported (golint)
    • Line 146: warning: exported function InitSchema should have comment or be unexported (golint)
    • Line 229: warning: exported method TiDBManager.DropTable should have comment or be unexported (golint)
    • Line 237: warning: exported function LoadSchemaInfo should have comment or be unexported (golint)
    • Line 288: warning: exported function ObtainGCLifeTime should have comment or be unexported (golint)
    • Line 299: warning: exported function UpdateGCLifeTime should have comment or be unexported (golint)
    • Line 310: warning: exported function ObtainImportantVariables should have comment or be unexported (golint)
    • Line 343: warning: exported function ObtainNewCollationEnabled should have comment or be unexported (golint)
    • Line 378: warning: exported function AlterAutoRandom should have comment or be unexported (golint)
    • br/pkg/lightning/verification/checksum.go
    • Line 27: warning: exported type KVChecksum should have comment or be unexported (golint)
    • Line 33: warning: exported function NewKVChecksum should have comment or be unexported (golint)
    • Line 39: warning: exported function MakeKVChecksum should have comment or be unexported (golint)
    • Line 47: warning: exported method KVChecksum.UpdateOne should have comment or be unexported (golint)
    • Line 56: warning: exported method KVChecksum.Update should have comment or be unexported (golint)
    • Line 77: warning: exported method KVChecksum.Add should have comment or be unexported (golint)
    • Line 83: warning: exported method KVChecksum.Sum should have comment or be unexported (golint)
    • Line 87: warning: exported method KVChecksum.SumSize should have comment or be unexported (golint)
    • Line 91: warning: exported method KVChecksum.SumKVS should have comment or be unexported (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words