Preparing report...

Report for github.com/milochristiansen/lua

A    Great!    Found 19 issues across 35 files

Tweet

gofmt88%

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


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!


gocyclo71%

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.

    • lua/compile.go
    • Line 308: warning: cyclomatic complexity 51 of function statement() is high (> 15) (gocyclo)
    • Line 248: warning: cyclomatic complexity 16 of function closeBlock() is high (> 15) (gocyclo)
    • lua/ast/lexer.go
    • Line 185: warning: cyclomatic complexity 45 of function (*lexer).advance() is high (> 15) (gocyclo)
    • Line 640: warning: cyclomatic complexity 37 of function (*lexer).matchString() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 30 of function (*lexer).eatWS() is high (> 15) (gocyclo)
    • Line 399: warning: cyclomatic complexity 18 of function (*lexer).nextchar() is high (> 15) (gocyclo)
    • Line 567: warning: cyclomatic complexity 16 of function (*lexer).matchNumber() is high (> 15) (gocyclo)
    • lua/ast/parse.go
    • Line 115: warning: cyclomatic complexity 37 of function (*parser).statement() is high (> 15) (gocyclo)
    • lua/value.go
    • Line 424: warning: cyclomatic complexity 53 of function (*State).arith() is high (> 15) (gocyclo)
    • Line 628: warning: cyclomatic complexity 32 of function (*State).compare() is high (> 15) (gocyclo)
    • lua/vm.go
    • Line 125: warning: cyclomatic complexity 45 of function init() is high (> 15) (gocyclo)
    • lua/function.go
    • Line 57: warning: cyclomatic complexity 29 of function (funcProto).str() is high (> 15) (gocyclo)
    • lua/table.go
    • Line 94: warning: cyclomatic complexity 17 of function (*table).maybeExtend() is high (> 15) (gocyclo)
    • lua/luautil/strconv.go
    • Line 112: warning: cyclomatic complexity 42 of function convFloatBroken() is high (> 15) (gocyclo)
    • Line 61: warning: cyclomatic complexity 18 of function convInt() is high (> 15) (gocyclo)
    • lua/compile_expr.go
    • Line 477: warning: cyclomatic complexity 57 of function expr() is high (> 15) (gocyclo)
    • Line 142: warning: cyclomatic complexity 23 of function lowerIdent() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • lua/supermeta/supermeta.go
    • Line 23: warning: package comment should be of the form "Package supermeta ..." (golint)
    • Line 115: warning: comment on exported var ErrCantSet should be of the form "ErrCantSet ..." (golint)
    • Line 117: warning: exported var ErrCantConv should have comment or be unexported (golint)
    • Line 118: warning: exported var ErrBadConv should have comment or be unexported (golint)
    • lua/ast/stmt.go
    • Line 97: warning: exported type Goto should have comment or be unexported (golint)
    • Line 107: warning: exported type Label should have comment or be unexported (golint)
    • Line 113: warning: exported type Return should have comment or be unexported (golint)
    • lua/api.go
    • Line 741: warning: comment on exported method State.Length should be of the form "Length ..." (golint)
    • Line 772: warning: comment on exported method State.LengthRaw should be of the form "LengthRaw ..." (golint)
    • lua/state.go
    • Line 23: warning: package comment should be of the form "Package lua ..." (golint)
    • Line 58: warning: comment on exported const RegistryIndex should be of the form "RegistryIndex ..." (golint)
    • Line 60: warning: exported const GlobalsIndex should have comment (or a comment on this block) or be unexported (golint)
    • lua/value.go
    • Line 30: warning: exported type TypeID should have comment or be unexported (golint)
    • Line 31: warning: exported type STypeID should have comment or be unexported (golint)
    • Line 34: warning: exported const TypNil should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported const STypNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 536: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 548: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • lua/vm.go
    • Line 118: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • lua/opcode.go
    • Line 54: warning: comment on exported const OpAdd should be of the form "OpAdd ..." (golint)
    • Line 56: warning: exported const OpSub should have comment (or a comment on this block) or be unexported (golint)
    • lua/table.go
    • Line 34: warning: comment on exported var TableIndexOffset should be of the form "TableIndexOffset ..." (golint)
    • Line 110: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign85%

IneffAssign detects ineffectual assignments in Go code.

    • lua/api.go
    • Line 915: warning: ineffectual assignment to ok (ineffassign)
    • Line 944: warning: ineffectual assignment to ok (ineffassign)
    • Line 985: warning: ineffectual assignment to ok (ineffassign)
    • lua/compile_expr.go
    • Line 156: warning: ineffectual assignment to usedreg (ineffassign)
    • Line 180: warning: ineffectual assignment to idx (ineffassign)
    • Line 186: warning: ineffectual assignment to usedreg (ineffassign)
    • Line 194: warning: ineffectual assignment to usedreg (ineffassign)
    • Line 202: warning: ineffectual assignment to usedreg (ineffassign)
    • Line 229: warning: ineffectual assignment to usedreg (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!