Preparing report...

Report for github.com/simon-root/parser/v5

(v5.2.5)

A+    Excellent!    Found 21 issues across 78 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!


gofmt92%

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


gocyclo79%

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/flag.go
    • Line 38: warning: cyclomatic complexity 26 of function (*flagSetter).Leave() is high (> 15) (gocyclo)
    • digester.go
    • Line 166: warning: cyclomatic complexity 17 of function (*sqlDigester).normalize() is high (> 15) (gocyclo)
    • ast/misc.go
    • Line 1926: warning: cyclomatic complexity 47 of function (*AdminStmt).Restore() is high (> 15) (gocyclo)
    • Line 2735: warning: cyclomatic complexity 23 of function (BRIEOptionType).String() is high (> 15) (gocyclo)
    • Line 3314: warning: cyclomatic complexity 23 of function (*TableOptimizerHint).Restore() is high (> 15) (gocyclo)
    • Line 758: warning: cyclomatic complexity 21 of function (*FlushStmt).Restore() is high (> 15) (gocyclo)
    • Line 2365: warning: cyclomatic complexity 18 of function (*GrantStmt).Restore() is high (> 15) (gocyclo)
    • Line 1427: warning: cyclomatic complexity 16 of function (*AlterUserStmt).Restore() is high (> 15) (gocyclo)
    • parser_test.go
    • Line 5829: warning: cyclomatic complexity 36 of function (*nodeTextCleaner).Enter() is high (> 15) (gocyclo)
    • ast/stats.go
    • Line 95: warning: cyclomatic complexity 18 of function (*AnalyzeTableStmt).Restore() is high (> 15) (gocyclo)
    • 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)
    • format/format.go
    • Line 78: warning: cyclomatic complexity 23 of function (*indentFormatter).format() is high (> 15) (gocyclo)
    • hintparserimpl.go
    • Line 44: warning: cyclomatic complexity 18 of function (*hintScanner).Lex() is high (> 15) (gocyclo)
    • lexer.go
    • Line 178: warning: cyclomatic complexity 22 of function (*Scanner).Lex() is high (> 15) (gocyclo)
    • Line 716: warning: cyclomatic complexity 19 of function startWithNumber() is high (> 15) (gocyclo)
    • Line 423: warning: cyclomatic complexity 19 of function startWithSlash() is high (> 15) (gocyclo)
    • ast/ddl.go
    • Line 2592: warning: cyclomatic complexity 173 of function (*AlterTableSpec).Restore() is high (> 15) (gocyclo)
    • Line 2058: warning: cyclomatic complexity 60 of function (*TableOption).Restore() is high (> 15) (gocyclo)
    • Line 519: warning: cyclomatic complexity 30 of function (*ColumnOption).Restore() is high (> 15) (gocyclo)
    • Line 996: warning: cyclomatic complexity 27 of function (*CreateTableStmt).Restore() is high (> 15) (gocyclo)
    • Line 773: warning: cyclomatic complexity 27 of function (*Constraint).Restore() is high (> 15) (gocyclo)
    • Line 3640: warning: cyclomatic complexity 21 of function (*PartitionOptions).Validate() is high (> 15) (gocyclo)
    • Line 3106: warning: cyclomatic complexity 20 of function (*AlterTableSpec).Accept() is high (> 15) (gocyclo)
    • Line 1588: warning: cyclomatic complexity 17 of function (*CreateIndexStmt).Restore() is high (> 15) (gocyclo)
    • ast/dml.go
    • Line 2648: warning: cyclomatic complexity 104 of function (*ShowStmt).Restore() is high (> 15) (gocyclo)
    • Line 1162: warning: cyclomatic complexity 65 of function (*SelectStmt).Restore() is high (> 15) (gocyclo)
    • Line 2013: warning: cyclomatic complexity 35 of function (*InsertStmt).Restore() is high (> 15) (gocyclo)
    • Line 1390: warning: cyclomatic complexity 29 of function (*SelectStmt).Accept() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 25 of function (*Join).Restore() is high (> 15) (gocyclo)
    • Line 2202: warning: cyclomatic complexity 25 of function (*DeleteStmt).Restore() is high (> 15) (gocyclo)
    • Line 2366: warning: cyclomatic complexity 22 of function (*UpdateStmt).Restore() is high (> 15) (gocyclo)
    • ast/functions.go
    • Line 374: warning: cyclomatic complexity 37 of function (*FuncCallExpr).Restore() is high (> 15) (gocyclo)
    • Line 969: warning: cyclomatic complexity 21 of function (TimeUnitType).String() is high (> 15) (gocyclo)

ineffassign98%

IneffAssign detects ineffectual assignments in Go code.

    • lexer_test.go
    • Line 350: warning: ineffectual assignment to pos (ineffassign)
    • Line 355: warning: ineffectual assignment to pos (ineffassign)
    • Line 359: warning: ineffectual assignment to pos (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words