Preparing report...

Report for github.com/cectc/dbpack

(v0.1.2)

A+    Excellent!    Found 55 issues across 150 files

Tweet

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!


gofmt100%

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

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo63%

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.

    • third_party/types/mydecimal.go
    • Line 2082: warning: cyclomatic complexity 45 of function doDivMod() is high (> 15) (gocyclo)
    • Line 1598: warning: cyclomatic complexity 40 of function doSub() is high (> 15) (gocyclo)
    • Line 815: warning: cyclomatic complexity 40 of function (*MyDecimal).Round() is high (> 15) (gocyclo)
    • Line 397: warning: cyclomatic complexity 36 of function (*MyDecimal).FromString() is high (> 15) (gocyclo)
    • Line 1217: warning: cyclomatic complexity 34 of function (*MyDecimal).WriteBin() is high (> 15) (gocyclo)
    • Line 546: warning: cyclomatic complexity 25 of function (*MyDecimal).Shift() is high (> 15) (gocyclo)
    • Line 1917: warning: cyclomatic complexity 22 of function DecimalMul() is high (> 15) (gocyclo)
    • Line 1381: warning: cyclomatic complexity 21 of function (*MyDecimal).FromBin() is high (> 15) (gocyclo)
    • Line 1763: warning: cyclomatic complexity 19 of function doAdd() is high (> 15) (gocyclo)
    • pkg/cond/shard.go
    • Line 216: warning: cyclomatic complexity 70 of function And() is high (> 15) (gocyclo)
    • Line 87: warning: cyclomatic complexity 32 of function (*ComplexCondition).Shard() is high (> 15) (gocyclo)
    • third_party/types/datum.go
    • Line 2199: warning: cyclomatic complexity 30 of function ChangeReverseResultByUpperLowerBound() is high (> 15) (gocyclo)
    • Line 556: warning: cyclomatic complexity 22 of function (*Datum).Compare() is high (> 15) (gocyclo)
    • Line 1055: warning: cyclomatic complexity 21 of function (*Datum).convertToUint() is high (> 15) (gocyclo)
    • Line 1698: warning: cyclomatic complexity 21 of function (*Datum).toSignedInteger() is high (> 15) (gocyclo)
    • Line 459: warning: cyclomatic complexity 20 of function (*Datum).SetValueWithDefaultCollation() is high (> 15) (gocyclo)
    • Line 507: warning: cyclomatic complexity 20 of function (*Datum).SetValue() is high (> 15) (gocyclo)
    • Line 1238: warning: cyclomatic complexity 19 of function (*Datum).convertToMysqlDuration() is high (> 15) (gocyclo)
    • Line 941: warning: cyclomatic complexity 19 of function (*Datum).convertToString() is high (> 15) (gocyclo)
    • Line 1310: warning: cyclomatic complexity 18 of function (*Datum).convertToMysqlDecimal() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 18 of function (Datum).String() is high (> 15) (gocyclo)
    • Line 825: warning: cyclomatic complexity 16 of function (*Datum).ConvertTo() is high (> 15) (gocyclo)
    • Line 995: warning: cyclomatic complexity 16 of function ProduceStrWithSpecifiedTp() is high (> 15) (gocyclo)
    • Line 866: warning: cyclomatic complexity 16 of function (*Datum).convertToFloat() is high (> 15) (gocyclo)
    • third_party/parser/types/field_type.go
    • Line 281: warning: cyclomatic complexity 25 of function (*FieldType).RestoreAsCastType() is high (> 15) (gocyclo)
    • Line 68: warning: cyclomatic complexity 18 of function (*FieldType).Equal() is high (> 15) (gocyclo)
    • Line 224: warning: cyclomatic complexity 18 of function (*FieldType).Restore() is high (> 15) (gocyclo)
    • Line 134: warning: cyclomatic complexity 16 of function (*FieldType).CompactStr() is high (> 15) (gocyclo)
    • pkg/cond/condition.go
    • Line 328: warning: cyclomatic complexity 22 of function ParseCompareExpression() is high (> 15) (gocyclo)
    • Line 120: warning: cyclomatic complexity 17 of function (*ComplexCondition).And() is high (> 15) (gocyclo)
    • third_party/types/time.go
    • Line 926: warning: cyclomatic complexity 76 of function parseDatetime() is high (> 15) (gocyclo)
    • Line 2605: warning: cyclomatic complexity 42 of function (Time).convertDateFormat() is high (> 15) (gocyclo)
    • Line 2243: warning: cyclomatic complexity 36 of function parseSingleTimeValue() is high (> 15) (gocyclo)
    • Line 2456: warning: cyclomatic complexity 26 of function ExtractDurationValue() is high (> 15) (gocyclo)
    • Line 825: warning: cyclomatic complexity 24 of function GetTimezone() is high (> 15) (gocyclo)
    • Line 1356: warning: cyclomatic complexity 17 of function (Duration).convertDateFormat() is high (> 15) (gocyclo)
    • Line 2201: warning: cyclomatic complexity 16 of function ExtractDurationNum() is high (> 15) (gocyclo)
    • Line 3033: warning: cyclomatic complexity 16 of function time12Hour() is high (> 15) (gocyclo)
    • pkg/misc/other.go
    • Line 140: warning: cyclomatic complexity 82 of function ComputeUnary() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 19 of function Compare() is high (> 15) (gocyclo)
    • pkg/listener/mysql.go
    • Line 510: warning: cyclomatic complexity 62 of function (*MysqlListener).ExecuteCommand() is high (> 15) (gocyclo)
    • Line 344: warning: cyclomatic complexity 22 of function (*MysqlListener).parseClientHandshakePacket() is high (> 15) (gocyclo)
    • pkg/driver/dsn.go
    • Line 235: warning: cyclomatic complexity 51 of function parseDSNParams() is high (> 15) (gocyclo)
    • Line 101: warning: cyclomatic complexity 18 of function (*Config).normalize() is high (> 15) (gocyclo)
    • Line 157: warning: cyclomatic complexity 18 of function ParseDSN() is high (> 15) (gocyclo)
    • third_party/parser/ast/misc.go
    • Line 1927: warning: cyclomatic complexity 47 of function (*AdminStmt).Restore() is high (> 15) (gocyclo)
    • Line 2736: warning: cyclomatic complexity 23 of function (BRIEOptionType).String() is high (> 15) (gocyclo)
    • Line 3315: warning: cyclomatic complexity 23 of function (*TableOptimizerHint).Restore() is high (> 15) (gocyclo)
    • Line 759: warning: cyclomatic complexity 21 of function (*FlushStmt).Restore() is high (> 15) (gocyclo)
    • Line 2366: warning: cyclomatic complexity 18 of function (*GrantStmt).Restore() is high (> 15) (gocyclo)
    • Line 1428: warning: cyclomatic complexity 16 of function (*AlterUserStmt).Restore() is high (> 15) (gocyclo)
    • third_party/types/convert.go
    • Line 437: warning: cyclomatic complexity 29 of function floatStrToIntStr() is high (> 15) (gocyclo)
    • Line 673: warning: cyclomatic complexity 22 of function getValidFloatPrefix() is high (> 15) (gocyclo)
    • Line 727: warning: cyclomatic complexity 16 of function ToString() is high (> 15) (gocyclo)
    • pkg/driver/client.go
    • Line 181: warning: cyclomatic complexity 22 of function (*BackendConnection).parseInitialHandshakePacket() is high (> 15) (gocyclo)
    • Line 601: warning: cyclomatic complexity 18 of function (*BackendConnection).ReadColumnDefinition() is high (> 15) (gocyclo)
    • third_party/parser/ast/dml.go
    • Line 2649: warning: cyclomatic complexity 104 of function (*ShowStmt).Restore() is high (> 15) (gocyclo)
    • Line 1163: warning: cyclomatic complexity 65 of function (*SelectStmt).Restore() is high (> 15) (gocyclo)
    • Line 2014: warning: cyclomatic complexity 35 of function (*InsertStmt).Restore() is high (> 15) (gocyclo)
    • Line 1391: warning: cyclomatic complexity 29 of function (*SelectStmt).Accept() is high (> 15) (gocyclo)
    • Line 151: warning: cyclomatic complexity 25 of function (*Join).Restore() is high (> 15) (gocyclo)
    • Line 2203: warning: cyclomatic complexity 25 of function (*DeleteStmt).Restore() is high (> 15) (gocyclo)
    • Line 2367: warning: cyclomatic complexity 22 of function (*UpdateStmt).Restore() is high (> 15) (gocyclo)
    • third_party/types/field_type.go
    • Line 208: warning: cyclomatic complexity 24 of function DefaultTypeForValue() is high (> 15) (gocyclo)
    • Line 65: warning: cyclomatic complexity 19 of function AggFieldType() is high (> 15) (gocyclo)
    • pkg/plan/result.go
    • Line 156: warning: cyclomatic complexity 18 of function mergeResultWithOrderByAndLimit() is high (> 15) (gocyclo)
    • Line 255: warning: cyclomatic complexity 16 of function mergeResultWithOrderBy() is high (> 15) (gocyclo)
    • pkg/packet/mysql.go
    • Line 350: warning: cyclomatic complexity 62 of function Val2MySQL() is high (> 15) (gocyclo)
    • Line 121: warning: cyclomatic complexity 53 of function ParseStmtArgs() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 19 of function ParseComStmtExecute() is high (> 15) (gocyclo)
    • Line 665: warning: cyclomatic complexity 17 of function Val2MySQLLen() is high (> 15) (gocyclo)
    • third_party/parser/lexer.go
    • Line 179: warning: cyclomatic complexity 22 of function (*Scanner).Lex() is high (> 15) (gocyclo)
    • Line 424: warning: cyclomatic complexity 19 of function startWithSlash() is high (> 15) (gocyclo)
    • Line 717: warning: cyclomatic complexity 19 of function startWithNumber() is high (> 15) (gocyclo)
    • third_party/types/json/binary_functions.go
    • Line 1110: warning: cyclomatic complexity 31 of function (BinaryJSON).extractToCallback() is high (> 15) (gocyclo)
    • Line 705: warning: cyclomatic complexity 26 of function CompareBinary() is high (> 15) (gocyclo)
    • Line 231: warning: cyclomatic complexity 19 of function (BinaryJSON).extractTo() is high (> 15) (gocyclo)
    • Line 1193: warning: cyclomatic complexity 17 of function (BinaryJSON).Walk() is high (> 15) (gocyclo)
    • pkg/function/function.go
    • Line 126: warning: cyclomatic complexity 19 of function castFunc2script() is high (> 15) (gocyclo)
    • Line 272: warning: cyclomatic complexity 16 of function expr2script() is high (> 15) (gocyclo)
    • pkg/misc/utils.go
    • Line 888: warning: cyclomatic complexity 66 of function convertAssignRows() is high (> 15) (gocyclo)
    • Line 125: warning: cyclomatic complexity 21 of function ParseDateTime() is high (> 15) (gocyclo)
    • pkg/mysql/fields.go
    • Line 73: warning: cyclomatic complexity 36 of function (*Field).TypeDatabaseName() is high (> 15) (gocyclo)
    • Line 157: warning: cyclomatic complexity 19 of function (*Field).scanType() is high (> 15) (gocyclo)
    • third_party/parser/ast/ddl.go
    • Line 2593: warning: cyclomatic complexity 173 of function (*AlterTableSpec).Restore() is high (> 15) (gocyclo)
    • Line 2059: warning: cyclomatic complexity 60 of function (*TableOption).Restore() is high (> 15) (gocyclo)
    • Line 520: warning: cyclomatic complexity 30 of function (*ColumnOption).Restore() is high (> 15) (gocyclo)
    • Line 997: warning: cyclomatic complexity 27 of function (*CreateTableStmt).Restore() is high (> 15) (gocyclo)
    • Line 774: warning: cyclomatic complexity 27 of function (*Constraint).Restore() is high (> 15) (gocyclo)
    • Line 3641: warning: cyclomatic complexity 21 of function (*PartitionOptions).Validate() is high (> 15) (gocyclo)
    • Line 3107: warning: cyclomatic complexity 20 of function (*AlterTableSpec).Accept() is high (> 15) (gocyclo)
    • Line 1589: warning: cyclomatic complexity 17 of function (*CreateIndexStmt).Restore() is high (> 15) (gocyclo)
    • pkg/driver/auth.go
    • Line 326: warning: cyclomatic complexity 27 of function (*BackendConnection).handleAuthResult() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!