Preparing report...

Report for github.com/pingcap/ticdc

(v0.0.0-20211217120037-9455667fa945)

An error occurred while generating the report.    Found 111 issues across 1013 files

Tweet

gofmt0%

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

An error occurred while running this test (AddError: could not parse "_repos/src/github.com/pingcap/ticdc@v0.0.0-20211217120037-9455667fa945/cmd/kafka-consumer/fatal error: out of memory allocating heap arena map:1::warning: file is not gofmted with -s (gofmt)" - strconv.Atoi: parsing " out of memory allocating heap arena map": invalid syntax)


go_vet0%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

An error occurred while running this test (exit status 2)


gocyclo89%

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.

    • cdc/sink/mq.go
    • Line 275: warning: cyclomatic complexity 21 of function (*mqSink).runWorker() is high (> 15) (gocyclo)
    • dm/syncer/syncer.go
    • Line 1389: warning: cyclomatic complexity 111 of function (*Syncer).Run() is high (> 15) (gocyclo)
    • Line 2325: warning: cyclomatic complexity 42 of function (*Syncer).handleQueryEvent() is high (> 15) (gocyclo)
    • Line 894: warning: cyclomatic complexity 32 of function (*Syncer).addJob() is high (> 15) (gocyclo)
    • Line 2824: warning: cyclomatic complexity 30 of function (*Syncer).trackDDL() is high (> 15) (gocyclo)
    • Line 308: warning: cyclomatic complexity 28 of function (*Syncer).Init() is high (> 15) (gocyclo)
    • Line 2610: warning: cyclomatic complexity 26 of function (*Syncer).handleQueryEventPessimistic() is high (> 15) (gocyclo)
    • Line 1222: warning: cyclomatic complexity 26 of function (*Syncer).syncDDL() is high (> 15) (gocyclo)
    • Line 2099: warning: cyclomatic complexity 25 of function (*Syncer).handleRowsEvent() is high (> 15) (gocyclo)
    • Line 3253: warning: cyclomatic complexity 18 of function (*Syncer).Update() is high (> 15) (gocyclo)
    • dm/dm/config/task_converters.go
    • Line 112: warning: cyclomatic complexity 29 of function OpenAPITaskToSubTaskConfigs() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 16 of function SubTaskConfigsToOpenAPITask() is high (> 15) (gocyclo)
    • dm/checker/checker.go
    • Line 105: warning: cyclomatic complexity 28 of function (*Checker).Init() is high (> 15) (gocyclo)
    • Line 255: warning: cyclomatic complexity 18 of function (*Checker).Process() is high (> 15) (gocyclo)
    • dm/pkg/binlog/event/event.go
    • Line 519: warning: cyclomatic complexity 36 of function GenRowsEvent() is high (> 15) (gocyclo)
    • Line 364: warning: cyclomatic complexity 26 of function GenTableMapEvent() is high (> 15) (gocyclo)
    • pkg/applier/redo.go
    • Line 93: warning: cyclomatic complexity 19 of function (*RedoApplier).consumeLogs() is high (> 15) (gocyclo)
    • dm/relay/relay.go
    • Line 551: warning: cyclomatic complexity 33 of function (*Relay).handleEvents() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 30 of function (*Relay).process() is high (> 15) (gocyclo)
    • Line 746: warning: cyclomatic complexity 18 of function (*Relay).reSetupMeta() is high (> 15) (gocyclo)
    • Line 360: warning: cyclomatic complexity 17 of function (*Relay).tryRecoverLatestFile() is high (> 15) (gocyclo)
    • cdc/model/sink_gen.go
    • Line 1318: warning: cyclomatic complexity 27 of function (*RedoLog).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 1087: warning: cyclomatic complexity 27 of function (*RedoLog).DecodeMsg() is high (> 15) (gocyclo)
    • Line 1734: warning: cyclomatic complexity 26 of function (*RedoRowChangedEvent).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 2097: warning: cyclomatic complexity 26 of function (*RowChangedEvent).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 1868: warning: cyclomatic complexity 26 of function (*RowChangedEvent).DecodeMsg() is high (> 15) (gocyclo)
    • Line 1508: warning: cyclomatic complexity 26 of function (*RedoRowChangedEvent).DecodeMsg() is high (> 15) (gocyclo)
    • Line 2430: warning: cyclomatic complexity 26 of function (*SimpleTableInfo).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 2215: warning: cyclomatic complexity 26 of function (*SimpleTableInfo).DecodeMsg() is high (> 15) (gocyclo)
    • Line 486: warning: cyclomatic complexity 21 of function (*DDLEvent).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 295: warning: cyclomatic complexity 21 of function (*DDLEvent).DecodeMsg() is high (> 15) (gocyclo)
    • Line 638: warning: cyclomatic complexity 21 of function (*RedoColumn).DecodeMsg() is high (> 15) (gocyclo)
    • Line 815: warning: cyclomatic complexity 21 of function (*RedoColumn).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 1971: warning: cyclomatic complexity 19 of function (*RowChangedEvent).EncodeMsg() is high (> 15) (gocyclo)
    • Line 1617: warning: cyclomatic complexity 17 of function (*RedoRowChangedEvent).EncodeMsg() is high (> 15) (gocyclo)
    • Line 2322: warning: cyclomatic complexity 16 of function (*SimpleTableInfo).EncodeMsg() is high (> 15) (gocyclo)
    • Line 1203: warning: cyclomatic complexity 16 of function (*RedoLog).EncodeMsg() is high (> 15) (gocyclo)
    • pkg/cmd/cli/cli_changefeed_create.go
    • Line 177: warning: cyclomatic complexity 23 of function (*createChangefeedOptions).completeCfg() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 17 of function (*createChangefeedOptions).run() is high (> 15) (gocyclo)
    • dm/pkg/ha/keepalive.go
    • Line 82: warning: cyclomatic complexity 17 of function KeepAlive() is high (> 15) (gocyclo)
    • Line 185: warning: cyclomatic complexity 16 of function WatchWorkerEvent() is high (> 15) (gocyclo)
    • cdc/kv/client.go
    • Line 1059: warning: cyclomatic complexity 16 of function (*eventFeedSession).receiveFromStream() is high (> 15) (gocyclo)
    • dm/loader/loader.go
    • Line 1356: warning: cyclomatic complexity 26 of function (*Loader).restoreData() is high (> 15) (gocyclo)
    • Line 140: warning: cyclomatic complexity 19 of function (*Worker).run() is high (> 15) (gocyclo)
    • Line 287: warning: cyclomatic complexity 18 of function (*Worker).dispatchSQL() is high (> 15) (gocyclo)
    • Line 488: warning: cyclomatic complexity 16 of function (*Loader).Init() is high (> 15) (gocyclo)
    • dm/pkg/shardddl/optimism/lock.go
    • Line 115: warning: cyclomatic complexity 50 of function (*Lock).TrySync() is high (> 15) (gocyclo)
    • Line 619: warning: cyclomatic complexity 18 of function (*Lock).DeleteColumnsByOp() is high (> 15) (gocyclo)
    • dm/dm/master/scheduler/scheduler.go
    • Line 506: warning: cyclomatic complexity 32 of function (*Scheduler).transferWorkerAndSource() is high (> 15) (gocyclo)
    • Line 1067: warning: cyclomatic complexity 25 of function (*Scheduler).StartRelay() is high (> 15) (gocyclo)
    • Line 1594: warning: cyclomatic complexity 23 of function (*Scheduler).recoverWorkersBounds() is high (> 15) (gocyclo)
    • Line 2010: warning: cyclomatic complexity 22 of function (*Scheduler).tryBoundForSource() is high (> 15) (gocyclo)
    • Line 2292: warning: cyclomatic complexity 19 of function (*Scheduler).getNextLoadTaskTransfer() is high (> 15) (gocyclo)
    • Line 1181: warning: cyclomatic complexity 19 of function (*Scheduler).StopRelay() is high (> 15) (gocyclo)
    • Line 713: warning: cyclomatic complexity 19 of function (*Scheduler).AddSubTasks() is high (> 15) (gocyclo)
    • Line 623: warning: cyclomatic complexity 18 of function (*Scheduler).TransferSource() is high (> 15) (gocyclo)
    • Line 813: warning: cyclomatic complexity 16 of function (*Scheduler).RemoveSubTasks() is high (> 15) (gocyclo)
    • dm/syncer/checkpoint.go
    • Line 919: warning: cyclomatic complexity 16 of function (*RemoteCheckPoint).Load() is high (> 15) (gocyclo)
    • Line 604: warning: cyclomatic complexity 16 of function (*RemoteCheckPoint).FlushPointsExcept() is high (> 15) (gocyclo)
    • dm/relay/local_reader.go
    • Line 500: warning: cyclomatic complexity 33 of function (*BinlogReader).parseFile() is high (> 15) (gocyclo)
    • Line 654: warning: cyclomatic complexity 19 of function (*BinlogReader).waitBinlogChanged() is high (> 15) (gocyclo)
    • dm/dm/worker/server.go
    • Line 93: warning: cyclomatic complexity 25 of function (*Server).Start() is high (> 15) (gocyclo)
    • Line 264: warning: cyclomatic complexity 20 of function (*Server).observeRelayConfig() is high (> 15) (gocyclo)
    • Line 357: warning: cyclomatic complexity 18 of function (*Server).observeSourceBound() is high (> 15) (gocyclo)
    • cdc/model/kv_gen.go
    • Line 62: warning: cyclomatic complexity 19 of function (*RawKVEntry).DecodeMsg() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 19 of function (*RawKVEntry).UnmarshalMsg() is high (> 15) (gocyclo)
    • cdc/model/schema_storage.go
    • Line 175: warning: cyclomatic complexity 17 of function (*TableInfo).initColumnsFlag() is high (> 15) (gocyclo)
    • Line 67: warning: cyclomatic complexity 16 of function WrapTableInfo() is high (> 15) (gocyclo)
    • cdc/kv/region_worker.go
    • Line 439: warning: cyclomatic complexity 26 of function (*regionWorker).eventHandler() is high (> 15) (gocyclo)
    • Line 620: warning: cyclomatic complexity 24 of function (*regionWorker).handleEventEntry() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 19 of function (*regionWorker).resolveLock() is high (> 15) (gocyclo)
    • dm/syncer/error.go
    • Line 64: warning: cyclomatic complexity 32 of function (*Syncer).handleSpecialDDLError() is high (> 15) (gocyclo)
    • cdc/sink/mysql.go
    • Line 601: warning: cyclomatic complexity 18 of function (*mysqlSink).prepareDMLs() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 16 of function newMySQLSink() is high (> 15) (gocyclo)
    • cdc/kv/client_test.go
    • Line 1503: warning: cyclomatic complexity 18 of function (*clientSuite).TestStreamRecvWithErrorAndResolvedGoBack() is high (> 15) (gocyclo)
    • dm/dm/master/server.go
    • Line 1577: warning: cyclomatic complexity 61 of function (*Server).waitOperationOk() is high (> 15) (gocyclo)
    • Line 993: warning: cyclomatic complexity 27 of function (*Server).getStatusFromWorkers() is high (> 15) (gocyclo)
    • Line 1268: warning: cyclomatic complexity 26 of function (*Server).OperateSource() is high (> 15) (gocyclo)
    • Line 2134: warning: cyclomatic complexity 18 of function (*Server).GetCfg() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 17 of function (*Server).StartTask() is high (> 15) (gocyclo)
    • dm/syncer/optimist.go
    • Line 64: warning: cyclomatic complexity 30 of function (*Syncer).handleQueryEventOptimistic() is high (> 15) (gocyclo)
    • cdc/sink/codec/avro.go
    • Line 379: warning: cyclomatic complexity 37 of function columnToAvroNativeData() is high (> 15) (gocyclo)
    • Line 321: warning: cyclomatic complexity 19 of function getAvroDataTypeFromColumn() is high (> 15) (gocyclo)
    • cdc/sink/common/flow_control_test.go
    • Line 503: warning: cyclomatic complexity 22 of function BenchmarkTableFlowController() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 22 of function (*flowControlSuite).TestFlowControlBasic() is high (> 15) (gocyclo)
    • Line 314: warning: cyclomatic complexity 20 of function (*flowControlSuite).TestFlowControlCallBack() is high (> 15) (gocyclo)

golint0%

Golint is a linter for Go source code.

An error occurred while running this test (exit status 2)


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!