Preparing report...

Report for github.com/smlxl/sqlparser

(v0.0.0-20240515162133-cf7d110943f2)

A+    Excellent!    Found 24 issues across 93 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!


gocyclo75%

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.

    • ast_clone.go
    • Line 21: warning: cyclomatic complexity 269 of function CloneSQLNode() is high (> 15) (gocyclo)
    • Line 3810: warning: cyclomatic complexity 117 of function CloneExpr() is high (> 15) (gocyclo)
    • Line 3546: warning: cyclomatic complexity 80 of function CloneCallable() is high (> 15) (gocyclo)
    • Line 4138: warning: cyclomatic complexity 51 of function CloneStatement() is high (> 15) (gocyclo)
    • Line 3490: warning: cyclomatic complexity 24 of function CloneAlterOption() is high (> 15) (gocyclo)
    • Line 3442: warning: cyclomatic complexity 20 of function CloneAggrFunc() is high (> 15) (gocyclo)
    • goyacc/goyacc.go
    • Line 380: warning: cyclomatic complexity 76 of function setup() is high (> 15) (gocyclo)
    • Line 846: warning: cyclomatic complexity 58 of function gettok() is high (> 15) (gocyclo)
    • Line 1415: warning: cyclomatic complexity 49 of function cpyact() is high (> 15) (gocyclo)
    • Line 2933: warning: cyclomatic complexity 30 of function others() is high (> 15) (gocyclo)
    • Line 1931: warning: cyclomatic complexity 26 of function closure() is high (> 15) (gocyclo)
    • Line 2273: warning: cyclomatic complexity 22 of function output() is high (> 15) (gocyclo)
    • Line 2691: warning: cyclomatic complexity 21 of function callopt() is high (> 15) (gocyclo)
    • Line 2208: warning: cyclomatic complexity 20 of function apack() is high (> 15) (gocyclo)
    • Line 2396: warning: cyclomatic complexity 20 of function wract() is high (> 15) (gocyclo)
    • Line 2061: warning: cyclomatic complexity 19 of function state() is high (> 15) (gocyclo)
    • Line 1692: warning: cyclomatic complexity 18 of function cempty() is high (> 15) (gocyclo)
    • Line 1112: warning: cyclomatic complexity 17 of function parsetypes() is high (> 15) (gocyclo)
    • Line 2853: warning: cyclomatic complexity 17 of function stin() is high (> 15) (gocyclo)
    • Line 1223: warning: cyclomatic complexity 17 of function isPackageClause() is high (> 15) (gocyclo)
    • Line 1342: warning: cyclomatic complexity 16 of function cpyyvalaccess() is high (> 15) (gocyclo)
    • Line 2484: warning: cyclomatic complexity 16 of function wrstate() is high (> 15) (gocyclo)
    • Line 1841: warning: cyclomatic complexity 16 of function stagen() is high (> 15) (gocyclo)
    • token.go
    • Line 112: warning: cyclomatic complexity 60 of function (*Tokenizer).Scan() is high (> 15) (gocyclo)
    • Line 474: warning: cyclomatic complexity 18 of function (*Tokenizer).scanNumber() is high (> 15) (gocyclo)
    • Line 573: warning: cyclomatic complexity 16 of function (*Tokenizer).scanStringSlow() is high (> 15) (gocyclo)
    • ast_format.go
    • Line 350: warning: cyclomatic complexity 39 of function (*PartitionSpec).Format() is high (> 15) (gocyclo)
    • Line 700: warning: cyclomatic complexity 39 of function (*ColumnType).Format() is high (> 15) (gocyclo)
    • Line 276: warning: cyclomatic complexity 19 of function (*AlterMigration).Format() is high (> 15) (gocyclo)
    • tracked_buffer.go
    • Line 147: warning: cyclomatic complexity 20 of function (*TrackedBuffer).astPrintf() is high (> 15) (gocyclo)
    • ast_copy_on_rewrite.go
    • Line 20: warning: cyclomatic complexity 270 of function (*cow).copyOnRewriteSQLNode() is high (> 15) (gocyclo)
    • Line 7040: warning: cyclomatic complexity 118 of function (*cow).copyOnRewriteExpr() is high (> 15) (gocyclo)
    • Line 6788: warning: cyclomatic complexity 81 of function (*cow).copyOnRewriteCallable() is high (> 15) (gocyclo)
    • Line 7356: warning: cyclomatic complexity 52 of function (*cow).copyOnRewriteStatement() is high (> 15) (gocyclo)
    • Line 6734: warning: cyclomatic complexity 25 of function (*cow).copyOnRewriteAlterOption() is high (> 15) (gocyclo)
    • Line 6688: warning: cyclomatic complexity 21 of function (*cow).copyOnRewriteAggrFunc() is high (> 15) (gocyclo)
    • Line 5168: warning: cyclomatic complexity 20 of function (*cow).copyOnRewriteRefOfSelect() is high (> 15) (gocyclo)
    • Line 5869: warning: cyclomatic complexity 18 of function (*cow).copyOnRewriteRefOfTableSpec() is high (> 15) (gocyclo)
    • Line 1843: warning: cyclomatic complexity 17 of function (*cow).copyOnRewriteRefOfDelete() is high (> 15) (gocyclo)
    • Line 6071: warning: cyclomatic complexity 16 of function (*cow).copyOnRewriteRefOfUpdate() is high (> 15) (gocyclo)
    • ast_funcs.go
    • Line 217: warning: cyclomatic complexity 44 of function SQLTypeToQueryType() is high (> 15) (gocyclo)
    • Line 1991: warning: cyclomatic complexity 41 of function (ShowCommandType).ToString() is high (> 15) (gocyclo)
    • Line 1341: warning: cyclomatic complexity 16 of function (DDLAction).ToString() is high (> 15) (gocyclo)
    • dependency/sqltypes/type.go
    • Line 297: warning: cyclomatic complexity 21 of function AreTypesEquivalent() is high (> 15) (gocyclo)
    • Line 239: warning: cyclomatic complexity 21 of function modifyType() is high (> 15) (gocyclo)
    • literal.go
    • Line 33: warning: cyclomatic complexity 22 of function LiteralToValue() is high (> 15) (gocyclo)
    • precedence.go
    • Line 48: warning: cyclomatic complexity 19 of function precedenceFor() is high (> 15) (gocyclo)
    • ast_equals.go
    • Line 21: warning: cyclomatic complexity 539 of function (*Comparator).SQLNode() is high (> 15) (gocyclo)
    • Line 5891: warning: cyclomatic complexity 235 of function (*Comparator).Expr() is high (> 15) (gocyclo)
    • Line 5225: warning: cyclomatic complexity 161 of function (*Comparator).Callable() is high (> 15) (gocyclo)
    • Line 6749: warning: cyclomatic complexity 103 of function (*Comparator).Statement() is high (> 15) (gocyclo)
    • Line 5078: warning: cyclomatic complexity 49 of function (*Comparator).AlterOption() is high (> 15) (gocyclo)
    • Line 4955: warning: cyclomatic complexity 41 of function (*Comparator).AggrFunc() is high (> 15) (gocyclo)
    • Line 5801: warning: cyclomatic complexity 21 of function (*Comparator).DDLStatement() is high (> 15) (gocyclo)
    • Line 7186: warning: cyclomatic complexity 19 of function (*Comparator).RefOfColumnTypeOptions() is high (> 15) (gocyclo)
    • Line 4141: warning: cyclomatic complexity 19 of function (*Comparator).RefOfSelect() is high (> 15) (gocyclo)
    • ast_rewrite.go
    • Line 20: warning: cyclomatic complexity 269 of function (*application).rewriteSQLNode() is high (> 15) (gocyclo)
    • Line 9988: warning: cyclomatic complexity 117 of function (*application).rewriteExpr() is high (> 15) (gocyclo)
    • Line 9736: warning: cyclomatic complexity 80 of function (*application).rewriteCallable() is high (> 15) (gocyclo)
    • Line 10304: warning: cyclomatic complexity 51 of function (*application).rewriteStatement() is high (> 15) (gocyclo)
    • Line 9682: warning: cyclomatic complexity 24 of function (*application).rewriteAlterOption() is high (> 15) (gocyclo)
    • Line 9636: warning: cyclomatic complexity 20 of function (*application).rewriteAggrFunc() is high (> 15) (gocyclo)
    • Line 7394: warning: cyclomatic complexity 18 of function (*application).rewriteRefOfSelect() is high (> 15) (gocyclo)
    • ast_visit.go
    • Line 20: warning: cyclomatic complexity 269 of function VisitSQLNode() is high (> 15) (gocyclo)
    • Line 4791: warning: cyclomatic complexity 117 of function VisitExpr() is high (> 15) (gocyclo)
    • Line 4539: warning: cyclomatic complexity 80 of function VisitCallable() is high (> 15) (gocyclo)
    • Line 5107: warning: cyclomatic complexity 51 of function VisitStatement() is high (> 15) (gocyclo)
    • Line 4485: warning: cyclomatic complexity 24 of function VisitAlterOption() is high (> 15) (gocyclo)
    • Line 4439: warning: cyclomatic complexity 20 of function VisitAggrFunc() is high (> 15) (gocyclo)
    • Line 3476: warning: cyclomatic complexity 16 of function VisitRefOfSelect() is high (> 15) (gocyclo)
    • analyzer.go
    • Line 257: warning: cyclomatic complexity 32 of function (StatementType).String() is high (> 15) (gocyclo)
    • Line 70: warning: cyclomatic complexity 31 of function ASTToStatementType() is high (> 15) (gocyclo)
    • Line 175: warning: cyclomatic complexity 29 of function Preview() is high (> 15) (gocyclo)
    • ast_rewriting.go
    • Line 445: warning: cyclomatic complexity 21 of function (*astRewriter).unnestSubQueries() is high (> 15) (gocyclo)

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!


misspell96%

Misspell Finds commonly misspelled English words

    • precedence.go
    • Line 19: warning: "Precendence" is a misspelling of "Precedence" (misspell)
    • Line 21: warning: "Precendence" is a misspelling of "Precedence" (misspell)
    • Line 24: warning: "Precendence" is a misspelling of "Precedence" (misspell)
    • Line 48: warning: "Precendence" is a misspelling of "Precedence" (misspell)