Preparing report...

Report for github.com/qiniu/qlang

A+    Excellent!    Found 40 issues across 155 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!


gocyclo87%

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.

    • qlang/exec/golang/internal/go/printer/nodes.go
    • Line 740: warning: cyclomatic complexity 58 of function (*printer).expr1() is high (> 15) (gocyclo)
    • Line 130: warning: cyclomatic complexity 48 of function (*printer).exprList() is high (> 15) (gocyclo)
    • Line 1173: warning: cyclomatic complexity 41 of function (*printer).stmt() is high (> 15) (gocyclo)
    • Line 439: warning: cyclomatic complexity 32 of function (*printer).fieldList() is high (> 15) (gocyclo)
    • Line 572: warning: cyclomatic complexity 19 of function walkBinary() is high (> 15) (gocyclo)
    • qlang/parser/parser.go
    • Line 1491: warning: cyclomatic complexity 21 of function (*parser).checkExpr() is high (> 15) (gocyclo)
    • Line 1592: warning: cyclomatic complexity 20 of function (*parser).parsePrimaryExpr() is high (> 15) (gocyclo)
    • Line 2434: warning: cyclomatic complexity 17 of function (*parser).parseStmt() is high (> 15) (gocyclo)
    • Line 1814: warning: cyclomatic complexity 16 of function (*parser).parseSimpleStmt() is high (> 15) (gocyclo)
    • qlang/printer/printer.go
    • Line 356: warning: cyclomatic complexity 32 of function (*printer).writeCommentPrefix() is high (> 15) (gocyclo)
    • Line 879: warning: cyclomatic complexity 27 of function (*printer).print() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 26 of function stripCommonPrefix() is high (> 15) (gocyclo)
    • Line 1076: warning: cyclomatic complexity 24 of function (*printer).printNode() is high (> 15) (gocyclo)
    • Line 746: warning: cyclomatic complexity 19 of function (*printer).intersperseComments() is high (> 15) (gocyclo)
    • Line 1202: warning: cyclomatic complexity 18 of function (*trimmer).Write() is high (> 15) (gocyclo)
    • qlang/exec/golang/internal/go/printer/printer.go
    • Line 353: warning: cyclomatic complexity 32 of function (*printer).writeCommentPrefix() is high (> 15) (gocyclo)
    • Line 876: warning: cyclomatic complexity 27 of function (*printer).print() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 26 of function stripCommonPrefix() is high (> 15) (gocyclo)
    • Line 1073: warning: cyclomatic complexity 24 of function (*printer).printNode() is high (> 15) (gocyclo)
    • Line 743: warning: cyclomatic complexity 19 of function (*printer).intersperseComments() is high (> 15) (gocyclo)
    • Line 1199: warning: cyclomatic complexity 18 of function (*trimmer).Write() is high (> 15) (gocyclo)
    • qlang/printer/nodes.go
    • Line 742: warning: cyclomatic complexity 65 of function (*printer).expr1() is high (> 15) (gocyclo)
    • Line 132: warning: cyclomatic complexity 48 of function (*printer).exprList() is high (> 15) (gocyclo)
    • Line 1226: warning: cyclomatic complexity 43 of function (*printer).stmt() is high (> 15) (gocyclo)
    • Line 441: warning: cyclomatic complexity 32 of function (*printer).fieldList() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 19 of function walkBinary() is high (> 15) (gocyclo)

golint86%

Golint is a linter for Go source code.

    • qlang/ast/ast.go
    • Line 33: warning: comment on exported type Node should be of the form "Node ..." (with optional leading article) (golint)
    • Line 39: warning: comment on exported type Expr should be of the form "Expr ..." (with optional leading article) (golint)
    • Line 45: warning: comment on exported type Stmt should be of the form "Stmt ..." (with optional leading article) (golint)
    • Line 51: warning: comment on exported type Decl should be of the form "Decl ..." (with optional leading article) (golint)
    • Line 66: warning: exported method Comment.Pos should have comment or be unexported (golint)
    • Line 67: warning: exported method Comment.End should have comment or be unexported (golint)
    • Line 76: warning: exported method CommentGroup.Pos should have comment or be unexported (golint)
    • Line 77: warning: exported method CommentGroup.End should have comment or be unexported (golint)
    • Line 166: warning: exported method Field.Pos should have comment or be unexported (golint)
    • Line 173: warning: exported method Field.End should have comment or be unexported (golint)
    • Line 187: warning: exported method FieldList.Pos should have comment or be unexported (golint)
    • Line 199: warning: exported method FieldList.End should have comment or be unexported (golint)
    • Line 361: warning: comment on exported type ChanDir should be of the form "ChanDir ..." (with optional leading article) (golint)
    • Line 367: warning: exported const SEND should have comment (or a comment on this block) or be unexported (golint)
    • Line 424: warning: exported method BadExpr.Pos should have comment or be unexported (golint)
    • Line 425: warning: exported method Ident.Pos should have comment or be unexported (golint)
    • Line 426: warning: exported method Ellipsis.Pos should have comment or be unexported (golint)
    • Line 427: warning: exported method BasicLit.Pos should have comment or be unexported (golint)
    • Line 428: warning: exported method FuncLit.Pos should have comment or be unexported (golint)
    • Line 429: warning: exported method CompositeLit.Pos should have comment or be unexported (golint)
    • Line 435: warning: exported method ParenExpr.Pos should have comment or be unexported (golint)
    • Line 436: warning: exported method SelectorExpr.Pos should have comment or be unexported (golint)
    • Line 437: warning: exported method IndexExpr.Pos should have comment or be unexported (golint)
    • Line 438: warning: exported method SliceExpr.Pos should have comment or be unexported (golint)
    • Line 439: warning: exported method TypeAssertExpr.Pos should have comment or be unexported (golint)
    • Line 440: warning: exported method CallExpr.Pos should have comment or be unexported (golint)
    • Line 441: warning: exported method StarExpr.Pos should have comment or be unexported (golint)
    • Line 442: warning: exported method UnaryExpr.Pos should have comment or be unexported (golint)
    • Line 443: warning: exported method BinaryExpr.Pos should have comment or be unexported (golint)
    • Line 444: warning: exported method KeyValueExpr.Pos should have comment or be unexported (golint)
    • Line 445: warning: exported method ArrayType.Pos should have comment or be unexported (golint)
    • Line 446: warning: exported method StructType.Pos should have comment or be unexported (golint)
    • Line 447: warning: exported method FuncType.Pos should have comment or be unexported (golint)
    • Line 453: warning: exported method InterfaceType.Pos should have comment or be unexported (golint)
    • Line 454: warning: exported method MapType.Pos should have comment or be unexported (golint)
    • Line 455: warning: exported method ChanType.Pos should have comment or be unexported (golint)
    • Line 457: warning: exported method BadExpr.End should have comment or be unexported (golint)
    • Line 458: warning: exported method Ident.End should have comment or be unexported (golint)
    • Line 459: warning: exported method Ellipsis.End should have comment or be unexported (golint)
    • Line 465: warning: exported method BasicLit.End should have comment or be unexported (golint)
    • Line 466: warning: exported method FuncLit.End should have comment or be unexported (golint)
    • Line 467: warning: exported method CompositeLit.End should have comment or be unexported (golint)
    • Line 468: warning: exported method ParenExpr.End should have comment or be unexported (golint)
    • Line 469: warning: exported method SelectorExpr.End should have comment or be unexported (golint)
    • Line 470: warning: exported method IndexExpr.End should have comment or be unexported (golint)
    • Line 471: warning: exported method SliceExpr.End should have comment or be unexported (golint)
    • Line 472: warning: exported method TypeAssertExpr.End should have comment or be unexported (golint)
    • Line 473: warning: exported method CallExpr.End should have comment or be unexported (golint)
    • Line 474: warning: exported method StarExpr.End should have comment or be unexported (golint)
    • Line 475: warning: exported method UnaryExpr.End should have comment or be unexported (golint)
    • Line 476: warning: exported method BinaryExpr.End should have comment or be unexported (golint)
    • Line 477: warning: exported method KeyValueExpr.End should have comment or be unexported (golint)
    • Line 478: warning: exported method ArrayType.End should have comment or be unexported (golint)
    • Line 479: warning: exported method StructType.End should have comment or be unexported (golint)
    • Line 480: warning: exported method FuncType.End should have comment or be unexported (golint)
    • Line 486: warning: exported method InterfaceType.End should have comment or be unexported (golint)
    • Line 487: warning: exported method MapType.End should have comment or be unexported (golint)
    • Line 488: warning: exported method ChanType.End should have comment or be unexported (golint)
    • Line 531: warning: receiver name id should be consistent with previous receiver name x for Ident (golint)
    • Line 533: warning: receiver name id should be consistent with previous receiver name x for Ident (golint)
    • Line 710: warning: exported method BadStmt.Pos should have comment or be unexported (golint)
    • Line 711: warning: exported method DeclStmt.Pos should have comment or be unexported (golint)
    • Line 712: warning: exported method EmptyStmt.Pos should have comment or be unexported (golint)
    • Line 713: warning: exported method LabeledStmt.Pos should have comment or be unexported (golint)
    • Line 714: warning: exported method ExprStmt.Pos should have comment or be unexported (golint)
    • Line 715: warning: exported method SendStmt.Pos should have comment or be unexported (golint)
    • Line 716: warning: exported method IncDecStmt.Pos should have comment or be unexported (golint)
    • Line 717: warning: exported method AssignStmt.Pos should have comment or be unexported (golint)
    • Line 718: warning: exported method GoStmt.Pos should have comment or be unexported (golint)
    • Line 719: warning: exported method DeferStmt.Pos should have comment or be unexported (golint)
    • Line 720: warning: exported method ReturnStmt.Pos should have comment or be unexported (golint)
    • Line 721: warning: exported method BranchStmt.Pos should have comment or be unexported (golint)
    • Line 722: warning: exported method BlockStmt.Pos should have comment or be unexported (golint)
    • Line 723: warning: exported method IfStmt.Pos should have comment or be unexported (golint)
    • Line 724: warning: exported method CaseClause.Pos should have comment or be unexported (golint)
    • Line 725: warning: exported method SwitchStmt.Pos should have comment or be unexported (golint)
    • Line 726: warning: exported method TypeSwitchStmt.Pos should have comment or be unexported (golint)
    • Line 727: warning: exported method CommClause.Pos should have comment or be unexported (golint)
    • Line 728: warning: exported method SelectStmt.Pos should have comment or be unexported (golint)
    • Line 729: warning: exported method ForStmt.Pos should have comment or be unexported (golint)
    • Line 730: warning: exported method RangeStmt.Pos should have comment or be unexported (golint)
    • Line 732: warning: exported method BadStmt.End should have comment or be unexported (golint)
    • Line 733: warning: exported method DeclStmt.End should have comment or be unexported (golint)
    • Line 734: warning: exported method EmptyStmt.End should have comment or be unexported (golint)
    • Line 740: warning: exported method LabeledStmt.End should have comment or be unexported (golint)
    • Line 741: warning: exported method ExprStmt.End should have comment or be unexported (golint)
    • Line 742: warning: exported method SendStmt.End should have comment or be unexported (golint)
    • Line 743: warning: exported method IncDecStmt.End should have comment or be unexported (golint)
    • Line 746: warning: exported method AssignStmt.End should have comment or be unexported (golint)
    • Line 747: warning: exported method GoStmt.End should have comment or be unexported (golint)
    • Line 748: warning: exported method DeferStmt.End should have comment or be unexported (golint)
    • Line 749: warning: exported method ReturnStmt.End should have comment or be unexported (golint)
    • Line 755: warning: exported method BranchStmt.End should have comment or be unexported (golint)
    • Line 761: warning: exported method BlockStmt.End should have comment or be unexported (golint)
    • Line 770: warning: exported method IfStmt.End should have comment or be unexported (golint)
    • Line 776: warning: exported method CaseClause.End should have comment or be unexported (golint)
    • Line 782: warning: exported method SwitchStmt.End should have comment or be unexported (golint)
    • Line 783: warning: exported method TypeSwitchStmt.End should have comment or be unexported (golint)
    • Line 784: warning: exported method CommClause.End should have comment or be unexported (golint)
    • Line 790: warning: exported method SelectStmt.End should have comment or be unexported (golint)
    • Line 791: warning: exported method ForStmt.End should have comment or be unexported (golint)
    • Line 792: warning: exported method RangeStmt.End should have comment or be unexported (golint)
    • Line 864: warning: exported method ImportSpec.Pos should have comment or be unexported (golint)
    • Line 870: warning: exported method ValueSpec.Pos should have comment or be unexported (golint)
    • Line 871: warning: exported method TypeSpec.Pos should have comment or be unexported (golint)
    • Line 873: warning: exported method ImportSpec.End should have comment or be unexported (golint)
    • Line 880: warning: exported method ValueSpec.End should have comment or be unexported (golint)
    • Line 889: warning: exported method TypeSpec.End should have comment or be unexported (golint)
    • Line 941: warning: exported method BadDecl.Pos should have comment or be unexported (golint)
    • Line 942: warning: exported method GenDecl.Pos should have comment or be unexported (golint)
    • Line 943: warning: exported method FuncDecl.Pos should have comment or be unexported (golint)
    • Line 945: warning: exported method BadDecl.End should have comment or be unexported (golint)
    • Line 946: warning: exported method GenDecl.End should have comment or be unexported (golint)
    • Line 952: warning: exported method FuncDecl.End should have comment or be unexported (golint)
    • Line 1001: warning: exported method File.Pos should have comment or be unexported (golint)
    • Line 1002: warning: exported method File.End should have comment or be unexported (golint)
    • Line 1019: warning: exported method Package.Pos should have comment or be unexported (golint)
    • Line 1020: warning: exported method Package.End should have comment or be unexported (golint)
    • qlang/cl/expr.go
    • Line 254: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1395: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1461: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • qlang/exec/golang/type.go
    • Line 194: warning: exported type GoType should have comment or be unexported (golint)
    • Line 199: warning: comment on exported method Builder.DefineType should be of the form "DefineType ..." (golint)
    • Line 208: warning: exported method GoType.Type should have comment or be unexported (golint)
    • Line 212: warning: exported method GoType.Name should have comment or be unexported (golint)
    • qlang/cl/context.go
    • Line 240: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 252: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 269: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 278: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 289: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 299: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 310: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 321: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 333: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 344: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 355: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 377: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 390: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 397: warning: receiver name p should be consistent with previous receiver name ctx for blockCtx (golint)
    • Line 432: warning: receiver name c should be consistent with previous receiver name ctx for blockCtx (golint)
    • qlang/ast/gopiter/gop_iter.go
    • Line 35: warning: exported type Iterator should have comment or be unexported (golint)
    • Line 41: warning: exported function NewIter should have comment or be unexported (golint)
    • Line 60: warning: exported function Key should have comment or be unexported (golint)
    • Line 64: warning: exported function Value should have comment or be unexported (golint)
    • Line 67: warning: exported function Next should have comment or be unexported (golint)
    • qlang/ast/ast_ql.go
    • Line 356: warning: exported method ForPhrase.Pos should have comment or be unexported (golint)
    • Line 360: warning: exported method ForPhrase.End should have comment or be unexported (golint)
    • qlang/token/token.go
    • Line 25: warning: don't use underscores in Go names; const literal_beg should be literalBeg (golint)
    • Line 34: warning: don't use underscores in Go names; const literal_end should be literalEnd (golint)
    • Line 36: warning: don't use underscores in Go names; const operator_beg should be operatorBeg (golint)
    • Line 93: warning: don't use underscores in Go names; const operator_end should be operatorEnd (golint)
    • Line 95: warning: don't use underscores in Go names; const keyword_beg should be keywordBeg (golint)
    • Line 126: warning: don't use underscores in Go names; const keyword_end should be keywordEnd (golint)
    • Line 267: warning: receiver name op should be consistent with previous receiver name tok for Token (golint)
    • Line 295: warning: don't use underscores in Go names; var is_keyword should be isKeyword (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.

    • qlang/cl/stmt.go
    • Line 414: warning: ineffectual assignment to withoutCheck (ineffassign)
    • Line 453: warning: ineffectual assignment to withoutCheck (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!