Preparing report...

Report for github.com/DigitalChinaOpenSource/TiDB-for-PostgreSQL

A+    Excellent!    Found 101 issues across 1046 files

Tweet

gofmt97%

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!


golint98%

Golint is a linter for Go source code.

    • TiDB-for-PostgreSQL/planner/core/point_get_plan.go
    • Line 73: warning: comment on exported method PointGetPlan.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 85: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 91: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 96: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 101: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 110: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 119: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 148: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 171: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 176: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 181: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 190: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 195: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 198: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 201: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 206: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 211: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 216: warning: receiver name p should be consistent with previous receiver name pointGet for PointGetPlan (golint)
    • Line 254: warning: comment on exported method BatchPointGetPlan.SetParamType should be of the form "SetParamType ..." (golint)
    • TiDB-for-PostgreSQL/server/conn.go
    • Line 94: warning: exported const ProtocolVersionNumber should have comment or be unexported (golint)
    • Line 98: warning: exported const ProtocolSSL should have comment or be unexported (golint)
    • Line 1581: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 2214: warning: context.Context should be the first parameter of a function (golint)
    • Line 2346: warning: should omit 2nd value from range; this loop is equivalent to `for index := range ...` (golint)
    • TiDB-for-PostgreSQL/planner/core/logical_plans.go
    • Line 358: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 368: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 378: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 384: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 392: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 400: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 414: warning: receiver name la should be consistent with previous receiver name p for LogicalAggregation (golint)
    • Line 604: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 695: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 704: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 731: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 751: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 835: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 883: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 965: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 976: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 997: warning: receiver name ds should be consistent with previous receiver name p for DataSource (golint)
    • Line 1034: warning: receiver name ls should be consistent with previous receiver name p for LogicalSort (golint)
    • Line 1059: warning: receiver name lt should be consistent with previous receiver name p for LogicalTopN (golint)
    • Line 1068: warning: receiver name lt should be consistent with previous receiver name p for LogicalTopN (golint)
    • TiDB-for-PostgreSQL/planner/core/physical_plans.go
    • Line 98: warning: receiver name p should be consistent with previous receiver name tr for PhysicalTableReader (golint)
    • Line 103: warning: receiver name p should be consistent with previous receiver name tr for PhysicalTableReader (golint)
    • Line 137: warning: receiver name p should be consistent with previous receiver name tr for PhysicalTableReader (golint)
    • Line 154: warning: comment on exported method PhysicalIndexReader.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 202: warning: comment on exported method PhysicalIndexLookUpReader.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 221: warning: comment on exported method PhysicalIndexMergeReader.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 266: warning: comment on exported method PhysicalIndexScan.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 413: warning: comment on exported method PhysicalTopN.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 425: warning: comment on exported method PhysicalApply.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 520: warning: comment on exported method PhysicalIndexJoin.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 559: warning: comment on exported method PhysicalMergeJoin.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 570: warning: comment on exported method PhysicalBroadCastJoin.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 585: warning: comment on exported method PhysicalLock.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 598: warning: comment on exported method PhysicalLimit.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 608: warning: comment on exported method PhysicalUnionAll.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 625: warning: receiver name p should be consistent with previous receiver name agg for basePhysicalAgg (golint)
    • Line 634: warning: receiver name p should be consistent with previous receiver name agg for basePhysicalAgg (golint)
    • Line 654: warning: comment on exported method PhysicalHashAgg.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 685: warning: comment on exported method PhysicalSort.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 702: warning: comment on exported method NominalSort.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 716: warning: comment on exported method PhysicalUnionScan.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 762: warning: comment on exported method PhysicalMaxOneRow.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 778: warning: comment on exported method PhysicalTableDual.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 803: warning: comment on exported method PhysicalWindow.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 827: warning: comment on exported method PhysicalShuffle.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 849: warning: comment on exported method PhysicalShuffleDataSourceStub.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 884: warning: comment on exported method PhysicalShow.SetParamType should be of the form "SetParamType ..." (golint)
    • Line 896: warning: comment on exported method PhysicalShowDDLJobs.SetParamType should be of the form "SetParamType ..." (golint)

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.

    • TiDB-for-PostgreSQL/ddl/table.go
    • Line 221: warning: cyclomatic complexity 23 of function (*worker).onRecoverTable() is high (> 15) (gocyclo)
    • Line 834: warning: cyclomatic complexity 17 of function onUpdateFlashReplicaStatus() is high (> 15) (gocyclo)
    • Line 636: warning: cyclomatic complexity 16 of function onRenameTable() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/ddl/column_test.go
    • Line 337: warning: cyclomatic complexity 21 of function (*testColumnSuite).checkDeleteOnlyColumn() is high (> 15) (gocyclo)
    • Line 438: warning: cyclomatic complexity 21 of function (*testColumnSuite).checkWriteOnlyColumn() is high (> 15) (gocyclo)
    • Line 543: warning: cyclomatic complexity 19 of function (*testColumnSuite).checkReorganizationColumn() is high (> 15) (gocyclo)
    • Line 639: warning: cyclomatic complexity 18 of function (*testColumnSuite).checkPublicColumn() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/cmd/explaintest/main.go
    • Line 273: warning: cyclomatic complexity 30 of function (*tester).execute() is high (> 15) (gocyclo)
    • Line 96: warning: cyclomatic complexity 18 of function (*tester).Run() is high (> 15) (gocyclo)
    • Line 609: warning: cyclomatic complexity 16 of function main() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/server/util.go
    • Line 394: warning: cyclomatic complexity 24 of function dumpTextRow() is high (> 15) (gocyclo)
    • Line 519: warning: cyclomatic complexity 24 of function dumpTextRowData() is high (> 15) (gocyclo)
    • Line 345: warning: cyclomatic complexity 18 of function dumpBinaryRow() is high (> 15) (gocyclo)
    • Line 462: warning: cyclomatic complexity 17 of function dumpBinaryRowData() is high (> 15) (gocyclo)
    • Line 606: warning: cyclomatic complexity 16 of function appendFormatFloat() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/util/execdetails/execdetails.go
    • Line 787: warning: cyclomatic complexity 24 of function (*RuntimeStatsWithCommit).String() is high (> 15) (gocyclo)
    • Line 216: warning: cyclomatic complexity 22 of function (ExecDetails).String() is high (> 15) (gocyclo)
    • Line 290: warning: cyclomatic complexity 20 of function (ExecDetails).ToZapFields() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/util/codec/codec.go
    • Line 393: warning: cyclomatic complexity 71 of function HashChunkSelected() is high (> 15) (gocyclo)
    • Line 1026: warning: cyclomatic complexity 28 of function (*Decoder).DecodeOne() is high (> 15) (gocyclo)
    • Line 1183: warning: cyclomatic complexity 27 of function HashGroupKey() is high (> 15) (gocyclo)
    • Line 296: warning: cyclomatic complexity 24 of function encodeHashChunkRowIdx() is high (> 15) (gocyclo)
    • Line 82: warning: cyclomatic complexity 21 of function encode() is high (> 15) (gocyclo)
    • Line 781: warning: cyclomatic complexity 18 of function DecodeOne() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/store/tikv/tikvrpc/tikvrpc.go
    • Line 756: warning: cyclomatic complexity 38 of function CallRPC() is high (> 15) (gocyclo)
    • Line 517: warning: cyclomatic complexity 38 of function SetContext() is high (> 15) (gocyclo)
    • Line 82: warning: cyclomatic complexity 36 of function (CmdType).String() is high (> 15) (gocyclo)
    • Line 604: warning: cyclomatic complexity 32 of function GenRegionErrorResp() is high (> 15) (gocyclo)
    • Line 439: warning: cyclomatic complexity 27 of function FromBatchCommandsResponse() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 26 of function (*Request).ToBatchCommandsRequest() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/server/conn.go
    • Line 2468: warning: cyclomatic complexity 30 of function convertMysqlErrorToPgError() is high (> 15) (gocyclo)
    • Line 2365: warning: cyclomatic complexity 30 of function convertMySQLDataTypeToPgSQLDataType() is high (> 15) (gocyclo)
    • Line 909: warning: cyclomatic complexity 29 of function (*clientConn).dispatch() is high (> 15) (gocyclo)
    • Line 843: warning: cyclomatic complexity 24 of function (*clientConn).addMetrics() is high (> 15) (gocyclo)
    • Line 536: warning: cyclomatic complexity 18 of function (*clientConn).readOptionalSSLRequestAndHandshakeResponse() is high (> 15) (gocyclo)
    • Line 707: warning: cyclomatic complexity 17 of function (*clientConn).Run() is high (> 15) (gocyclo)
    • Line 1181: warning: cyclomatic complexity 16 of function processStream() is high (> 15) (gocyclo)
    • Line 1417: warning: cyclomatic complexity 16 of function (*clientConn).handleStmt() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/ddl/partition.go
    • Line 270: warning: cyclomatic complexity 19 of function buildTablePartitionInfo() is high (> 15) (gocyclo)
    • Line 523: warning: cyclomatic complexity 16 of function checkPartitionFuncCallValid() is high (> 15) (gocyclo)
    • Line 68: warning: cyclomatic complexity 16 of function onAddTablePartition() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/ddl/ddl_api.go
    • Line 2072: warning: cyclomatic complexity 52 of function (*ddl).AlterTable() is high (> 15) (gocyclo)
    • Line 619: warning: cyclomatic complexity 35 of function getDefaultValue() is high (> 15) (gocyclo)
    • Line 2930: warning: cyclomatic complexity 30 of function (*ddl).getModifiableColumnJob() is high (> 15) (gocyclo)
    • Line 484: warning: cyclomatic complexity 29 of function columnDefToCol() is high (> 15) (gocyclo)
    • Line 2325: warning: cyclomatic complexity 25 of function (*ddl).AddColumn() is high (> 15) (gocyclo)
    • Line 2722: warning: cyclomatic complexity 24 of function CheckModifyTypeCompatible() is high (> 15) (gocyclo)
    • Line 2850: warning: cyclomatic complexity 23 of function processColumnOptions() is high (> 15) (gocyclo)
    • Line 1153: warning: cyclomatic complexity 21 of function buildTableInfo() is high (> 15) (gocyclo)
    • Line 1496: warning: cyclomatic complexity 21 of function (*ddl).CreateTableWithInfo() is high (> 15) (gocyclo)
    • Line 3949: warning: cyclomatic complexity 21 of function (*ddl).CreateIndex() is high (> 15) (gocyclo)
    • Line 410: warning: cyclomatic complexity 19 of function checkColumnDefaultValue() is high (> 15) (gocyclo)
    • Line 3527: warning: cyclomatic complexity 18 of function checkAlterTableCharset() is high (> 15) (gocyclo)
    • Line 4042: warning: cyclomatic complexity 18 of function buildFKInfo() is high (> 15) (gocyclo)
    • Line 4340: warning: cyclomatic complexity 18 of function checkRangeColumnsTypeAndValuesMatch() is high (> 15) (gocyclo)
    • Line 4583: warning: cyclomatic complexity 17 of function (*ddl).RepairTable() is high (> 15) (gocyclo)
    • Line 4174: warning: cyclomatic complexity 17 of function (*ddl).DropIndex() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/util/ranger/points.go
    • Line 203: warning: cyclomatic complexity 23 of function (*builder).buildFormBinOp() is high (> 15) (gocyclo)
    • Line 307: warning: cyclomatic complexity 17 of function handleUnsignedCol() is high (> 15) (gocyclo)
    • Line 445: warning: cyclomatic complexity 16 of function (*builder).newBuildFromPatternLike() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/ddl/column.go
    • Line 371: warning: cyclomatic complexity 33 of function (*worker).doModifyColumn() is high (> 15) (gocyclo)
    • Line 158: warning: cyclomatic complexity 18 of function onAddColumn() is high (> 15) (gocyclo)
    • Line 243: warning: cyclomatic complexity 16 of function onDropColumn() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/table/column.go
    • Line 251: warning: cyclomatic complexity 30 of function CastValue() is high (> 15) (gocyclo)
    • Line 582: warning: cyclomatic complexity 20 of function GetZeroValue() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 20 of function handleZeroDatetime() is high (> 15) (gocyclo)
    • Line 335: warning: cyclomatic complexity 16 of function NewColDesc() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/ddl/index.go
    • Line 363: warning: cyclomatic complexity 42 of function (*worker).onCreateIndex() is high (> 15) (gocyclo)
    • Line 560: warning: cyclomatic complexity 18 of function onDropIndex() is high (> 15) (gocyclo)
    • Line 1421: warning: cyclomatic complexity 18 of function (*worker).addPhysicalTableIndex() is high (> 15) (gocyclo)
    • TiDB-for-PostgreSQL/table/tables/tables.go
    • Line 472: warning: cyclomatic complexity 28 of function (*TableCommon).AddRecord() is high (> 15) (gocyclo)
    • Line 325: warning: cyclomatic complexity 18 of function (*TableCommon).UpdateRecord() is high (> 15) (gocyclo)
    • Line 930: warning: cyclomatic complexity 17 of function (*TableCommon).IterRecords() is high (> 15) (gocyclo)

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!