Preparing report...

Report for github.com/chaos-mesh/go-sqlancer

A    Great!    Found 36 issues across 73 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo95%

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.


golint53%

Golint is a linter for Go source code.

    • go-sqlancer/pkg/generator/generator.go
    • Line 6: warning: should not use dot imports (golint)
    • Line 23: warning: exported type Generator should have comment or be unexported (golint)
    • Line 28: warning: exported method Generator.SelectStmt should have comment or be unexported (golint)
    • Line 49: warning: exported method Generator.ConditionClause should have comment or be unexported (golint)
    • Line 246: warning: comment on exported method Generator.UpdateStmt should be of the form "UpdateStmt ..." (golint)
    • Line 295: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 300: warning: comment on exported method Generator.DeleteStmt should be of the form "DeleteStmt ..." (golint)
    • Line 331: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • go-sqlancer/pkg/util/rand.go
    • Line 20: warning: exported function RdInt63 should have comment or be unexported (golint)
    • Line 35: warning: exported function RdInt64 should have comment or be unexported (golint)
    • Line 68: warning: comment on exported function RdString should be of the form "RdString ..." (golint)
    • Line 152: warning: exported function RdBool should have comment or be unexported (golint)
    • go-sqlancer/pkg/types/table.go
    • Line 32: warning: exported method Table.Rename should have comment or be unexported (golint)
    • Line 48: warning: exported method Table.JoinWithName should have comment or be unexported (golint)
    • Line 48: warning: receiver name a should be consistent with previous receiver name t for Table (golint)
    • go-sqlancer/pkg/knownbugs/dustbin.go
    • Line 12: warning: exported type Dustbin should have comment or be unexported (golint)
    • Line 19: warning: exported type KnownBug should have comment or be unexported (golint)
    • Line 20: warning: exported type NodeCb should have comment or be unexported (golint)
    • Line 21: warning: exported type Visitor should have comment or be unexported (golint)
    • Line 26: warning: exported function NewVisitor should have comment or be unexported (golint)
    • Line 34: warning: exported var Bugs should have comment or be unexported (golint)
    • Line 40: warning: exported function NewDustbin should have comment or be unexported (golint)
    • Line 44: warning: exported method Dustbin.IsKnownBug should have comment or be unexported (golint)
    • Line 61: warning: exported method Visitor.Enter should have comment or be unexported (golint)
    • Line 65: warning: exported method Visitor.Leave should have comment or be unexported (golint)
    • Line 69: warning: exported method Visitor.SetEnter should have comment or be unexported (golint)
    • Line 73: warning: exported method Visitor.SetLeave should have comment or be unexported (golint)
    • Line 77: warning: exported method Visitor.ClearEnter should have comment or be unexported (golint)
    • Line 81: warning: exported method Visitor.ClearLeave should have comment or be unexported (golint)
    • go-sqlancer/pkg/generator/context.go
    • Line 14: warning: exported type GenConfig should have comment or be unexported (golint)
    • Line 22: warning: exported type GenCtx should have comment or be unexported (golint)
    • Line 34: warning: exported function NewGenCtx should have comment or be unexported (golint)
    • go-sqlancer/pkg/transformer/combine.go
    • Line 6: warning: exported type CombinedTransformer should have comment or be unexported (golint)
    • Line 12: warning: exported function Combine should have comment or be unexported (golint)
    • Line 16: warning: exported method CombinedTransformer.Transform should have comment or be unexported (golint)
    • go-sqlancer/pkg/mutation/rollback.go
    • Line 9: warning: exported type Rollback should have comment or be unexported (golint)
    • Line 12: warning: exported method Rollback.Condition should have comment or be unexported (golint)
    • Line 16: warning: exported method Rollback.Mutate should have comment or be unexported (golint)
    • go-sqlancer/pkg/transformer/no-rec.go
    • Line 15: warning: exported const NOREC_TMP_TABLE_NAME should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: comment on exported var NoREC should be of the form "NoREC ..." (golint)
    • Line 46: warning: exported type NoRECVisitor should have comment or be unexported (golint)
    • Line 50: warning: exported method NoRECVisitor.Enter should have comment or be unexported (golint)
    • Line 56: warning: exported method NoRECVisitor.Leave should have comment or be unexported (golint)
    • go-sqlancer/pkg/sqlancer/mutasql.go
    • Line 25: warning: exported type MutaSql should have comment or be unexported (golint)
    • Line 34: warning: exported function NewMutaSql should have comment or be unexported (golint)
    • Line 52: warning: exported method MutaSql.Start should have comment or be unexported (golint)
    • Line 445: warning: exported method MutaSql.PrintError should have comment or be unexported (golint)
    • Line 470: warning: error should be the last type when returning multiple items (golint)
    • Line 481: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 491: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 495: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 499: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • go-sqlancer/pkg/knownbugs/issue16788.go
    • Line 49: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 70: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • go-sqlancer/pkg/types/column.go
    • Line 44: warning: exported type Columns should have comment or be unexported (golint)
    • Line 106: warning: comment on exported method Column.GetAliasTableName should be of the form "GetAliasTableName ..." (golint)
    • Line 122: warning: exported method Columns.RandColumn should have comment or be unexported (golint)
    • Line 122: warning: receiver name cs should be consistent with previous receiver name c for Columns (golint)
    • go-sqlancer/pkg/generator/operator/comparison.go
    • Line 19: warning: comment on exported var NullEq should be of the form "NullEq ..." (golint)
    • Line 39: warning: comment on exported var IsNull should be of the form "IsNull ..." (golint)
    • Line 74: warning: comment on exported var In should be of the form "In ..." (golint)
    • Line 141: warning: comment on exported var Between should be of the form "Between ..." (golint)
    • Line 206: warning: comment on exported var StrCmp should be of the form "StrCmp ..." (golint)
    • go-sqlancer/pkg/types/op.go
    • Line 13: warning: exported type Evaluator should have comment or be unexported (golint)
    • Line 14: warning: exported type TypedExprNodeGen should have comment or be unexported (golint)
    • Line 15: warning: exported type TypedExprNodeGenSel should have comment or be unexported (golint)
    • Line 16: warning: exported type RetTypeGen should have comment or be unexported (golint)
    • Line 18: warning: exported type OpFuncEval should have comment or be unexported (golint)
    • Line 37: warning: comment on exported type OpFuncIndex should be of the form "OpFuncIndex ..." (with optional leading article) (golint)
    • Line 40: warning: exported method OpFuncIndex.RandOpFn should have comment or be unexported (golint)
    • Line 43: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 52: warning: exported type OpFuncMap should have comment or be unexported (golint)
    • Line 54: warning: exported method OpFuncMap.Eval should have comment or be unexported (golint)
    • Line 58: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 63: warning: exported method OpFuncMap.Add should have comment or be unexported (golint)
    • Line 67: warning: exported method OpFuncMap.Find should have comment or be unexported (golint)
    • Line 71: warning: exported type BaseOpFunc should have comment or be unexported (golint)
    • Line 82: warning: exported method BaseOpFunc.GetMinArgs should have comment or be unexported (golint)
    • Line 86: warning: exported method BaseOpFunc.SetMinArgs should have comment or be unexported (golint)
    • Line 90: warning: exported method BaseOpFunc.GetMaxArgs should have comment or be unexported (golint)
    • Line 94: warning: exported method BaseOpFunc.SetMaxArgs should have comment or be unexported (golint)
    • Line 98: warning: exported method BaseOpFunc.GetName should have comment or be unexported (golint)
    • Line 102: warning: exported method BaseOpFunc.SetName should have comment or be unexported (golint)
    • Line 106: warning: exported method BaseOpFunc.SetEvalFn should have comment or be unexported (golint)
    • Line 110: warning: exported method BaseOpFunc.Eval should have comment or be unexported (golint)
    • Line 114: warning: exported method BaseOpFunc.SetNodeFn should have comment or be unexported (golint)
    • Line 118: warning: exported method BaseOpFunc.Node should have comment or be unexported (golint)
    • Line 124: warning: exported method BaseOpFunc.SetIsValidParam should have comment or be unexported (golint)
    • Line 128: warning: exported method BaseOpFunc.MakeArgTable should have comment or be unexported (golint)
    • Line 171: warning: exported method BaseOpFunc.GetPossibleReturnType should have comment or be unexported (golint)
    • Line 186: warning: exported method BaseOpFunc.GetArgTable should have comment or be unexported (golint)
    • Line 190: warning: exported type Op should have comment or be unexported (golint)
    • Line 196: warning: exported method Op.GetOpcode should have comment or be unexported (golint)
    • Line 200: warning: exported method Op.SetOpcode should have comment or be unexported (golint)
    • Line 205: warning: exported function NewOp should have comment or be unexported (golint)
    • Line 218: warning: exported type Fn should have comment or be unexported (golint)
    • Line 222: warning: exported function NewFn should have comment or be unexported (golint)
    • go-sqlancer/pkg/types/string.go
    • Line 9: warning: exported type CIStr should have comment or be unexported (golint)
    • Line 26: warning: comment on exported method CIStr.EqModel should be of the form "EqModel ..." (golint)
    • go-sqlancer/pkg/transformer/tlp.go
    • Line 18: warning: exported type TLPType should have comment or be unexported (golint)
    • Line 20: warning: exported type SelectExprType should have comment or be unexported (golint)
    • Line 22: warning: exported type TLPTrans should have comment or be unexported (golint)
    • Line 27: warning: exported type AggregateDetector should have comment or be unexported (golint)
    • Line 33: warning: exported const WHERE should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported var TLPTypes should have comment or be unexported (golint)
    • Line 48: warning: exported method TLPTrans.Transform should have comment or be unexported (golint)
    • Line 164: warning: exported function RandTLPType should have comment or be unexported (golint)
    • Line 171: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 189: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 213: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 262: warning: exported method AggregateDetector.Enter should have comment or be unexported (golint)
    • Line 271: warning: exported method AggregateDetector.Leave should have comment or be unexported (golint)
    • go-sqlancer/pkg/types/argument.go
    • Line 31: warning: exported var SupportArgs should have comment or be unexported (golint)
    • Line 40: warning: exported type ArgTable should have comment or be unexported (golint)
    • Line 50: warning: exported type OpFuncArg0DTable should have comment or be unexported (golint)
    • Line 51: warning: exported type OpFuncArgNDTable should have comment or be unexported (golint)
    • Line 56: warning: comment on exported type OpFuncArgInfTable should be of the form "OpFuncArgInfTable ..." (with optional leading article) (golint)
    • Line 59: warning: exported method OpFuncArg0DTable.Filter should have comment or be unexported (golint)
    • Line 63: warning: exported method OpFuncArg0DTable.RandByFilter should have comment or be unexported (golint)
    • Line 66: warning: exported method OpFuncArg0DTable.Insert should have comment or be unexported (golint)
    • Line 70: warning: exported method OpFuncArgNDTable.Filter should have comment or be unexported (golint)
    • Line 102: warning: exported method OpFuncArgNDTable.RandByFilter should have comment or be unexported (golint)
    • Line 110: warning: exported method OpFuncArgNDTable.Insert should have comment or be unexported (golint)
    • Line 119: warning: exported function NewArgTable should have comment or be unexported (golint)
    • go-sqlancer/pkg/types/mutasql/mutasql.go
    • Line 17: warning: exported type Pool should have comment or be unexported (golint)
    • Line 19: warning: exported type TestCase should have comment or be unexported (golint)
    • Line 31: warning: exported const INDENT_LEVEL_1 should have comment or be unexported (golint)
    • Line 32: warning: exported const INDENT_LEVEL_2 should have comment or be unexported (golint)
    • Line 33: warning: exported const INDENT_LEVEL_3 should have comment or be unexported (golint)
    • Line 34: warning: exported const INDENT_LEVEL_4 should have comment or be unexported (golint)
    • Line 59: warning: comment on exported method TestCase.Clone should be of the form "Clone ..." (golint)
    • Line 85: warning: exported method TestCase.ReplaceTableName should have comment or be unexported (golint)
    • Line 120: warning: exported type Visitor should have comment or be unexported (golint)
    • Line 124: warning: exported method Visitor.Enter should have comment or be unexported (golint)
    • Line 146: warning: exported method Visitor.Leave should have comment or be unexported (golint)
    • Line 156: warning: exported method TestCase.GetAllTables should have comment or be unexported (golint)
    • Line 156: warning: receiver name r should be consistent with previous receiver name t for TestCase (golint)
    • Line 168: warning: exported type Dataset should have comment or be unexported (golint)
    • Line 175: warning: comment on exported method Dataset.MakeQueryItem should be of the form "MakeQueryItem ..." (golint)
    • Line 219: warning: exported method Dataset.ReplaceTableName should have comment or be unexported (golint)
    • Line 241: warning: exported method Dataset.Clone should have comment or be unexported (golint)
    • Line 265: warning: exported type Mutation should have comment or be unexported (golint)
    • go-sqlancer/pkg/transformer/transform.go
    • Line 9: warning: exported type Transformer should have comment or be unexported (golint)
    • Line 13: warning: exported type TransformerSingleton should have comment or be unexported (golint)
    • Line 16: warning: exported method TransformerSingleton.Transform should have comment or be unexported (golint)
    • Line 20: warning: exported function RandTransformer should have comment or be unexported (golint)
    • go-sqlancer/pkg/mutation/addition_select.go
    • Line 8: warning: exported type AdditionSelect should have comment or be unexported (golint)
    • Line 11: warning: exported method AdditionSelect.Condition should have comment or be unexported (golint)
    • Line 15: warning: exported method AdditionSelect.Mutate should have comment or be unexported (golint)
    • go-sqlancer/pkg/util/generator.go
    • Line 20: warning: exported var OpFuncGroupByRet should have comment or be unexported (golint)
    • Line 22: warning: exported function RegisterToOpFnIndex should have comment or be unexported (golint)
    • Line 39: warning: comment on exported function ConvertToBoolOrNull should be of the form "ConvertToBoolOrNull ..." (golint)
    • Line 94: warning: comment on exported function CompareValueExpr should be of the form "CompareValueExpr ..." (golint)
    • Line 100: warning: exported function BufferOut should have comment or be unexported (golint)
    • Line 109: warning: comment on exported function TransMysqlType should be of the form "TransMysqlType ..." (golint)
    • Line 129: warning: comment on exported function TransStringType should be of the form "TransStringType ..." (golint)
    • Line 146: warning: exported function TransToMysqlType should have comment or be unexported (golint)
    • go-sqlancer/pkg/sqlancer/sqlancer.go
    • Line 24: warning: should not use dot imports (golint)
    • Line 25: warning: should not use dot imports (golint)
    • Line 40: warning: exported type SQLancer should have comment or be unexported (golint)
    • Line 504: warning: exported method SQLancer.GenPQSSelectStmt should have comment or be unexported (golint)
    • Line 512: warning: exported method SQLancer.ExecAndVerify should have comment or be unexported (golint)
    • Line 588: warning: exported method SQLancer.GenSelectStmt should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words