Preparing report...

Report for github.com/prologic/monkey-lang

A+    Excellent!    Found 33 issues across 89 files

Tweet

gofmt95%

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!


gocyclo94%

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.

    • monkey-lang/eval/eval.go
    • Line 69: warning: cyclomatic complexity 47 of function Eval() is high (> 15) (gocyclo)
    • Line 334: warning: cyclomatic complexity 36 of function evalInfixExpression() is high (> 15) (gocyclo)
    • Line 437: warning: cyclomatic complexity 18 of function evalIntegerInfixExpression() is high (> 15) (gocyclo)
    • monkey-lang/vm/vm.go
    • Line 647: warning: cyclomatic complexity 62 of function (*VM).Run() is high (> 15) (gocyclo)
    • Line 215: warning: cyclomatic complexity 30 of function (*VM).executeBinaryOperation() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • monkey-lang/typing/typing.go
    • Line 9: warning: exported type CheckFunc should have comment or be unexported (golint)
    • Line 11: warning: exported function Check should have comment or be unexported (golint)
    • Line 20: warning: exported function ExactArgs should have comment or be unexported (golint)
    • Line 32: warning: exported function MinimumArgs should have comment or be unexported (golint)
    • Line 44: warning: exported function RangeOfArgs should have comment or be unexported (golint)
    • Line 56: warning: exported function WithTypes should have comment or be unexported (golint)
    • monkey-lang/compiler/symbol_table.go
    • Line 3: warning: exported type SymbolScope should have comment or be unexported (golint)
    • Line 6: warning: exported const BuiltinScope should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported type Symbol should have comment or be unexported (golint)
    • Line 18: warning: exported type SymbolTable should have comment or be unexported (golint)
    • Line 27: warning: exported function NewSymbolTable should have comment or be unexported (golint)
    • Line 35: warning: exported function NewEnclosedSymbolTable should have comment or be unexported (golint)
    • Line 43: warning: exported method SymbolTable.DefineFree should have comment or be unexported (golint)
    • Line 53: warning: exported method SymbolTable.Define should have comment or be unexported (golint)
    • Line 66: warning: exported method SymbolTable.DefineBuiltin should have comment or be unexported (golint)
    • Line 72: warning: exported method SymbolTable.Resolve should have comment or be unexported (golint)
    • monkey-lang/parser/parser.go
    • Line 14: warning: exported const LOWEST should have comment (or a comment on this block) or be unexported (golint)
    • Line 66: warning: exported type Parser should have comment or be unexported (golint)
    • Line 77: warning: exported function New should have comment or be unexported (golint)
    • Line 157: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 163: warning: exported method Parser.Errors should have comment or be unexported (golint)
    • Line 183: warning: exported method Parser.ParseProgram should have comment or be unexported (golint)
    • monkey-lang/repl/repl.go
    • Line 40: warning: exported type Options should have comment or be unexported (golint)
    • Line 46: warning: exported type REPL should have comment or be unexported (golint)
    • Line 52: warning: exported function New should have comment or be unexported (golint)
    • Line 215: warning: exported method REPL.Run should have comment or be unexported (golint)
    • monkey-lang/object/bool.go
    • Line 13: warning: exported method Boolean.Bool should have comment or be unexported (golint)
    • Line 17: warning: exported method Boolean.Int should have comment or be unexported (golint)
    • Line 24: warning: exported method Boolean.Compare should have comment or be unexported (golint)
    • monkey-lang/vm/frame.go
    • Line 8: warning: exported type Frame should have comment or be unexported (golint)
    • Line 14: warning: exported function NewFrame should have comment or be unexported (golint)
    • Line 29: warning: exported method Frame.Instructions should have comment or be unexported (golint)
    • monkey-lang/vm/vm.go
    • Line 24: warning: exported const StackSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported var True should have comment or be unexported (golint)
    • Line 94: warning: exported type VMState should have comment or be unexported (golint)
    • Line 100: warning: exported function NewVMState should have comment or be unexported (golint)
    • Line 131: warning: exported type VM should have comment or be unexported (golint)
    • Line 157: warning: exported function New should have comment or be unexported (golint)
    • Line 179: warning: exported function NewWithState should have comment or be unexported (golint)
    • Line 643: warning: exported method VM.LastPopped should have comment or be unexported (golint)
    • Line 647: warning: exported method VM.Run should have comment or be unexported (golint)
    • monkey-lang/code/code.go
    • Line 12: warning: exported type Definition should have comment or be unexported (golint)
    • Line 17: warning: exported type Instructions should have comment or be unexported (golint)
    • Line 60: warning: exported type Opcode should have comment or be unexported (golint)
    • Line 71: warning: exported const LoadConstant should have comment (or a comment on this block) or be unexported (golint)
    • Line 169: warning: exported function Lookup should have comment or be unexported (golint)
    • Line 178: warning: exported function Make should have comment or be unexported (golint)
    • Line 207: warning: exported function ReadOperands should have comment or be unexported (golint)
    • Line 225: warning: exported function ReadUint8 should have comment or be unexported (golint)
    • Line 227: warning: exported function ReadUint16 should have comment or be unexported (golint)
    • monkey-lang/object/closure.go
    • Line 17: warning: exported method CompiledFunction.Bool should have comment or be unexported (golint)
    • Line 40: warning: exported method Closure.Bool should have comment or be unexported (golint)
    • monkey-lang/object/module.go
    • Line 13: warning: exported method Module.Bool should have comment or be unexported (golint)
    • Line 17: warning: exported method Module.Compare should have comment or be unexported (golint)
    • monkey-lang/object/null.go
    • Line 6: warning: exported method Null.Bool should have comment or be unexported (golint)
    • Line 10: warning: exported method Null.Compare should have comment or be unexported (golint)
    • monkey-lang/compiler/compiler.go
    • Line 18: warning: exported type EmittedInstruction should have comment or be unexported (golint)
    • Line 23: warning: exported type Scope should have comment or be unexported (golint)
    • Line 29: warning: exported type Compiler should have comment or be unexported (golint)
    • Line 41: warning: exported function New should have comment or be unexported (golint)
    • Line 64: warning: exported function NewWithState should have comment or be unexported (golint)
    • Line 183: warning: exported method Compiler.Compile should have comment or be unexported (golint)
    • Line 656: warning: exported method Compiler.Bytecode should have comment or be unexported (golint)
    • Line 663: warning: exported type Bytecode should have comment or be unexported (golint)
    • monkey-lang/token/token.go
    • Line 45: warning: comment on exported const LeftShift should be of the form "LeftShift ..." (golint)
    • Line 47: warning: comment on exported const RightShift should be of the form "RightShift ..." (golint)
    • Line 54: warning: comment on exported const BitwiseAND should be of the form "BitwiseAND ..." (golint)
    • Line 56: warning: comment on exported const BitwiseOR should be of the form "BitwiseOR ..." (golint)
    • Line 58: warning: comment on exported const BitwiseXOR should be of the form "BitwiseXOR ..." (golint)
    • Line 60: warning: comment on exported const BitwiseNOT should be of the form "BitwiseNOT ..." (golint)
    • monkey-lang/utils/utils.go
    • Line 11: warning: exported var SearchPaths should have comment or be unexported (golint)
    • Line 29: warning: exported function AddPath should have comment or be unexported (golint)
    • Line 39: warning: exported function Exists should have comment or be unexported (golint)
    • Line 44: warning: exported function FindModule should have comment or be unexported (golint)
    • monkey-lang/object/array.go
    • Line 13: warning: exported method Array.Bool should have comment or be unexported (golint)
    • Line 17: warning: exported method Array.PopLeft should have comment or be unexported (golint)
    • Line 26: warning: exported method Array.PopRight should have comment or be unexported (golint)
    • Line 35: warning: exported method Array.Prepend should have comment or be unexported (golint)
    • Line 39: warning: exported method Array.Append should have comment or be unexported (golint)
    • Line 43: warning: exported method Array.Copy should have comment or be unexported (golint)
    • Line 51: warning: exported method Array.Reverse should have comment or be unexported (golint)
    • Line 72: warning: exported method Array.Compare should have comment or be unexported (golint)
    • Line 72: warning: receiver name ao should be consistent with previous receiver name a for Array (golint)
    • Line 92: warning: receiver name ao should be consistent with previous receiver name a for Array (golint)
    • Line 97: warning: receiver name ao should be consistent with previous receiver name a for Array (golint)
    • Line 100: warning: receiver name ao should be consistent with previous receiver name a for Array (golint)
    • monkey-lang/object/hash.go
    • Line 54: warning: exported method Hash.Len should have comment or be unexported (golint)
    • Line 58: warning: exported method Hash.Bool should have comment or be unexported (golint)
    • Line 62: warning: exported method Hash.Compare should have comment or be unexported (golint)
    • monkey-lang/object/int.go
    • Line 13: warning: exported method Integer.Bool should have comment or be unexported (golint)
    • Line 17: warning: exported method Integer.Compare should have comment or be unexported (golint)
    • monkey-lang/object/str.go
    • Line 14: warning: exported method String.Len should have comment or be unexported (golint)
    • Line 18: warning: exported method String.Bool should have comment or be unexported (golint)
    • Line 22: warning: exported method String.Compare should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell94%

Misspell Finds commonly misspelled English words

    • monkey-lang/token/token.go
    • Line 37: warning: "substraction" is a misspelling of "subtraction" (misspell)
    • Line 75: warning: "Comparision" is a misspelling of "Comparison" (misspell)
    • Line 78: warning: "comparision" is a misspelling of "comparison" (misspell)
    • Line 80: warning: "comparision" is a misspelling of "comparison" (misspell)
    • Line 83: warning: "comparision" is a misspelling of "comparison" (misspell)
    • Line 85: warning: "comparision" is a misspelling of "comparison" (misspell)
    • Line 106: warning: "paranthesis" is a misspelling of "parenthesis" (misspell)