Preparing report...

Report for github.com/nickng/gospal

A+    Excellent!    Found 31 issues across 57 files

Tweet

gofmt98%

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!


gocyclo85%

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.

    • gospal/migoinfer/internal/migoinfer/instr.go
    • Line 40: warning: cyclomatic complexity 37 of function (*Instruction).VisitInstr() is high (> 15) (gocyclo)
    • Line 701: warning: cyclomatic complexity 20 of function (*Instruction).bindCallParameters() is high (> 15) (gocyclo)
    • Line 605: warning: cyclomatic complexity 16 of function (*Instruction).getSelectCases() is high (> 15) (gocyclo)
    • gospal/block/visitgraph_test.go
    • Line 199: warning: cyclomatic complexity 45 of function TestVisitGraphVisitedOnce() is high (> 15) (gocyclo)
    • Line 124: warning: cyclomatic complexity 20 of function TestVisitGraphVisited() is high (> 15) (gocyclo)

golint50%

Golint is a linter for Go source code.

    • gospal/store/chans/chans.go
    • Line 19: warning: exported function New should have comment or be unexported (golint)
    • Line 27: warning: exported method Chan.Size should have comment or be unexported (golint)
    • Line 31: warning: exported method Chan.UniqName should have comment or be unexported (golint)
    • gospal/funcs/instance.go
    • Line 46: warning: comment on exported method Instance.Definition should be of the form "Definition ..." (golint)
    • Line 56: warning: exported method Instance.Name should have comment or be unexported (golint)
    • Line 63: warning: exported method Instance.UniqName should have comment or be unexported (golint)
    • gospal/store/mock.go
    • Line 30: warning: exported method MockKey.Name should have comment or be unexported (golint)
    • Line 31: warning: exported method MockKey.Pos should have comment or be unexported (golint)
    • Line 32: warning: exported method MockKey.Type should have comment or be unexported (golint)
    • Line 44: warning: exported method MockValue.UniqName should have comment or be unexported (golint)
    • gospal/store/store.go
    • Line 54: warning: exported function New should have comment or be unexported (golint)
    • Line 136: warning: comment on exported method Store.SetLog should be of the form "SetLog ..." (golint)
    • Line 148: warning: comment on exported method Const.UniqName should be of the form "UniqName ..." (golint)
    • gospal/store/structs/structs.go
    • Line 30: warning: comment on exported type Typer should be of the form "Typer ..." (with optional leading article) (golint)
    • Line 35: warning: exported function New should have comment or be unexported (golint)
    • Line 58: warning: comment on exported type Field should be of the form "Field ..." (with optional leading article) (golint)
    • Line 77: warning: exported method SField.Type should have comment or be unexported (golint)
    • Line 99: warning: exported method SField.Pos should have comment or be unexported (golint)
    • Line 151: warning: exported method Struct.UniqName should have comment or be unexported (golint)
    • gospal/loop/detect.go
    • Line 15: warning: exported var ErrIdxNotInt should have comment or be unexported (golint)
    • Line 21: warning: exported const NonLoop should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type Detector should have comment or be unexported (golint)
    • Line 38: warning: exported function NewDetector should have comment or be unexported (golint)
    • Line 49: warning: exported method Detector.SetLog should have comment or be unexported (golint)
    • Line 98: warning: exported method Detector.ExtractCond should have comment or be unexported (golint)
    • Line 129: warning: exported method Detector.Detect should have comment or be unexported (golint)
    • Line 218: warning: exported method Detector.ForLoopAt should have comment or be unexported (golint)
    • gospal/loop/tree.go
    • Line 13: warning: exported type BinTreeVisitor should have comment or be unexported (golint)
    • Line 18: warning: exported function NewBinTreeVisitor should have comment or be unexported (golint)
    • Line 24: warning: exported method BinTreeVisitor.VisitRoot should have comment or be unexported (golint)
    • Line 73: warning: exported method BinTree.SetTrue should have comment or be unexported (golint)
    • Line 74: warning: exported method BinTree.SetFalse should have comment or be unexported (golint)
    • Line 80: warning: exported method BinTree.TrueString should have comment or be unexported (golint)
    • Line 99: warning: exported method BinTree.FalseString should have comment or be unexported (golint)
    • Line 123: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gospal/migoinfer/internal/migoinfer/block.go
    • Line 16: warning: exported type BlockData should have comment or be unexported (golint)
    • Line 36: warning: exported function NewBlock should have comment or be unexported (golint)
    • Line 66: warning: exported method Block.EnterBlk should have comment or be unexported (golint)
    • Line 78: warning: exported method Block.JumpBlk should have comment or be unexported (golint)
    • Line 95: warning: exported method Block.ExitBlk should have comment or be unexported (golint)
    • Line 100: warning: exported method Block.CurrBlk should have comment or be unexported (golint)
    • Line 104: warning: exported method Block.PrevBlk should have comment or be unexported (golint)
    • gospal/ssa/build/config.go
    • Line 22: warning: exported type Configurer should have comment or be unexported (golint)
    • Line 75: warning: exported method Config.Build should have comment or be unexported (golint)
    • gospal/fn/lookup.go
    • Line 14: warning: exported var ErrNilMeth should have comment or be unexported (golint)
    • Line 52: warning: exported type UnknownInvokeError should have comment or be unexported (golint)
    • gospal/store/pool.go
    • Line 53: warning: exported method Pool.Get should have comment or be unexported (golint)
    • Line 60: warning: exported method Pool.AddValue should have comment or be unexported (golint)
    • Line 76: warning: exported method Pool.AddWrapped should have comment or be unexported (golint)
    • gospal/funcs/def.go
    • Line 86: warning: comment on exported method Definition.Param should be of the form "Param ..." (golint)
    • Line 165: warning: exported method Definition.UniqName should have comment or be unexported (golint)
    • gospal/migoinfer/internal/migoinfer/instr.go
    • Line 30: warning: exported function NewInstruction should have comment or be unexported (golint)
    • Line 40: warning: exported method Instruction.VisitInstr should have comment or be unexported (golint)
    • Line 171: warning: exported method Instruction.VisitAlloc should have comment or be unexported (golint)
    • Line 185: warning: exported method Instruction.VisitBinOp should have comment or be unexported (golint)
    • Line 188: warning: exported method Instruction.VisitCall should have comment or be unexported (golint)
    • Line 200: warning: exported method Instruction.VisitChangeInterface should have comment or be unexported (golint)
    • Line 203: warning: exported method Instruction.VisitChangeType should have comment or be unexported (golint)
    • Line 209: warning: exported method Instruction.VisitConvert should have comment or be unexported (golint)
    • Line 212: warning: exported method Instruction.VisitDebugRef should have comment or be unexported (golint)
    • Line 215: warning: exported method Instruction.VisitDefer should have comment or be unexported (golint)
    • Line 218: warning: exported method Instruction.VisitExtract should have comment or be unexported (golint)
    • Line 221: warning: exported method Instruction.VisitField should have comment or be unexported (golint)
    • Line 224: warning: exported method Instruction.VisitFieldAddr should have comment or be unexported (golint)
    • Line 255: warning: exported method Instruction.VisitGo should have comment or be unexported (golint)
    • Line 267: warning: exported method Instruction.VisitIf should have comment or be unexported (golint)
    • Line 270: warning: exported method Instruction.VisitIndex should have comment or be unexported (golint)
    • Line 273: warning: exported method Instruction.VisitIndexAddr should have comment or be unexported (golint)
    • Line 276: warning: exported method Instruction.VisitJump should have comment or be unexported (golint)
    • Line 279: warning: exported method Instruction.VisitLookup should have comment or be unexported (golint)
    • Line 282: warning: exported method Instruction.VisitMakeChan should have comment or be unexported (golint)
    • Line 319: warning: exported method Instruction.VisitMakeClosure should have comment or be unexported (golint)
    • Line 327: warning: exported method Instruction.VisitMakeInterface should have comment or be unexported (golint)
    • Line 333: warning: exported method Instruction.VisitMakeMap should have comment or be unexported (golint)
    • Line 336: warning: exported method Instruction.VisitMakeSlice should have comment or be unexported (golint)
    • Line 339: warning: exported method Instruction.VisitMapUpdate should have comment or be unexported (golint)
    • Line 342: warning: exported method Instruction.VisitNext should have comment or be unexported (golint)
    • Line 345: warning: exported method Instruction.VisitPanic should have comment or be unexported (golint)
    • Line 348: warning: exported method Instruction.VisitPhi should have comment or be unexported (golint)
    • Line 351: warning: exported method Instruction.VisitRange should have comment or be unexported (golint)
    • Line 354: warning: exported method Instruction.VisitReturn should have comment or be unexported (golint)
    • Line 357: warning: exported method Instruction.VisitRunDefers should have comment or be unexported (golint)
    • Line 360: warning: exported method Instruction.VisitSelect should have comment or be unexported (golint)
    • Line 364: warning: exported method Instruction.VisitSend should have comment or be unexported (golint)
    • Line 368: warning: exported method Instruction.VisitSlice should have comment or be unexported (golint)
    • Line 375: warning: exported method Instruction.VisitStore should have comment or be unexported (golint)
    • Line 384: warning: exported method Instruction.VisitTypeAssert should have comment or be unexported (golint)
    • Line 388: warning: exported method Instruction.VisitUnOp should have comment or be unexported (golint)
    • gospal/loop/info.go
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 65: warning: exported method Info.AddTrue should have comment or be unexported (golint)
    • Line 81: warning: exported method Info.AddFalse should have comment or be unexported (golint)
    • Line 142: warning: exported method Info.BodyIdx should have comment or be unexported (golint)
    • Line 144: warning: exported method Info.DoneIdx should have comment or be unexported (golint)
    • gospal/migoinfer/inferer.go
    • Line 48: warning: exported method Inferer.SetEntryFunc should have comment or be unexported (golint)
    • Line 52: warning: exported method Inferer.Analyse should have comment or be unexported (golint)
    • Line 122: warning: exported method Inferer.SetOutput should have comment or be unexported (golint)
    • gospal/funcs/call.go
    • Line 101: warning: exported method Call.Definition should have comment or be unexported (golint)
    • Line 105: warning: exported method Call.Param should have comment or be unexported (golint)
    • Line 106: warning: exported method Call.Bind should have comment or be unexported (golint)
    • Line 107: warning: exported method Call.Return should have comment or be unexported (golint)
    • Line 108: warning: exported method Call.Function should have comment or be unexported (golint)
    • Line 109: warning: exported method Call.NParam should have comment or be unexported (golint)
    • Line 110: warning: exported method Call.NBind should have comment or be unexported (golint)
    • Line 111: warning: exported method Call.NReturn should have comment or be unexported (golint)
    • Line 113: warning: exported method Call.UniqName should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words