Preparing report...

Report for github.com/fogleman/primitive

A    Great!    Found 16 issues across 18 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!


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.


golint11%

Golint is a linter for Go source code.

    • primitive/primitive/rectangle.go
    • Line 10: warning: exported type Rectangle should have comment or be unexported (golint)
    • Line 16: warning: exported function NewRandomRectangle should have comment or be unexported (golint)
    • Line 37: warning: exported method Rectangle.Draw should have comment or be unexported (golint)
    • Line 43: warning: exported method Rectangle.SVG should have comment or be unexported (golint)
    • Line 52: warning: exported method Rectangle.Copy should have comment or be unexported (golint)
    • Line 57: warning: exported method Rectangle.Mutate should have comment or be unexported (golint)
    • Line 71: warning: exported method Rectangle.Rasterize should have comment or be unexported (golint)
    • Line 80: warning: exported type RotatedRectangle should have comment or be unexported (golint)
    • Line 87: warning: exported function NewRandomRotatedRectangle should have comment or be unexported (golint)
    • Line 99: warning: exported method RotatedRectangle.Draw should have comment or be unexported (golint)
    • Line 109: warning: exported method RotatedRectangle.SVG should have comment or be unexported (golint)
    • Line 115: warning: exported method RotatedRectangle.Copy should have comment or be unexported (golint)
    • Line 120: warning: exported method RotatedRectangle.Mutate should have comment or be unexported (golint)
    • Line 140: warning: exported method RotatedRectangle.Valid should have comment or be unexported (golint)
    • Line 149: warning: exported method RotatedRectangle.Rasterize should have comment or be unexported (golint)
    • primitive/primitive/triangle.go
    • Line 10: warning: exported type Triangle should have comment or be unexported (golint)
    • Line 17: warning: exported function NewRandomTriangle should have comment or be unexported (golint)
    • Line 30: warning: exported method Triangle.Draw should have comment or be unexported (golint)
    • Line 38: warning: exported method Triangle.SVG should have comment or be unexported (golint)
    • Line 44: warning: exported method Triangle.Copy should have comment or be unexported (golint)
    • Line 49: warning: exported method Triangle.Mutate should have comment or be unexported (golint)
    • Line 72: warning: exported method Triangle.Valid should have comment or be unexported (golint)
    • Line 105: warning: exported method Triangle.Rasterize should have comment or be unexported (golint)
    • primitive/main.go
    • Line 20: warning: exported var Input should have comment or be unexported (golint)
    • Line 31: warning: exported var VV should have its own declaration (golint)
    • primitive/primitive/heatmap.go
    • Line 9: warning: exported type Heatmap should have comment or be unexported (golint)
    • Line 14: warning: exported function NewHeatmap should have comment or be unexported (golint)
    • Line 19: warning: exported method Heatmap.Clear should have comment or be unexported (golint)
    • Line 25: warning: exported method Heatmap.Add should have comment or be unexported (golint)
    • Line 35: warning: exported method Heatmap.AddHeatmap should have comment or be unexported (golint)
    • Line 41: warning: exported method Heatmap.Image should have comment or be unexported (golint)
    • primitive/primitive/log.go
    • Line 5: warning: exported var LogLevel should have comment or be unexported (golint)
    • Line 7: warning: exported function Log should have comment or be unexported (golint)
    • primitive/primitive/optimize.go
    • Line 8: warning: exported type Annealable should have comment or be unexported (golint)
    • Line 15: warning: exported function HillClimb should have comment or be unexported (golint)
    • Line 36: warning: exported function PreAnneal should have comment or be unexported (golint)
    • Line 49: warning: exported function Anneal should have comment or be unexported (golint)
    • primitive/primitive/polygon.go
    • Line 11: warning: exported type Polygon should have comment or be unexported (golint)
    • Line 18: warning: exported function NewRandomPolygon should have comment or be unexported (golint)
    • Line 33: warning: exported method Polygon.Draw should have comment or be unexported (golint)
    • Line 42: warning: exported method Polygon.SVG should have comment or be unexported (golint)
    • Line 54: warning: exported method Polygon.Copy should have comment or be unexported (golint)
    • Line 63: warning: exported method Polygon.Mutate should have comment or be unexported (golint)
    • Line 84: warning: exported method Polygon.Valid should have comment or be unexported (golint)
    • Line 111: warning: exported method Polygon.Rasterize should have comment or be unexported (golint)
    • primitive/primitive/color.go
    • Line 9: warning: exported type Color should have comment or be unexported (golint)
    • Line 13: warning: exported function MakeColor should have comment or be unexported (golint)
    • Line 18: warning: exported function MakeHexColor should have comment or be unexported (golint)
    • Line 42: warning: exported method Color.NRGBA should have comment or be unexported (golint)
    • primitive/primitive/ellipse.go
    • Line 11: warning: exported type Ellipse should have comment or be unexported (golint)
    • Line 18: warning: exported function NewRandomEllipse should have comment or be unexported (golint)
    • Line 27: warning: exported function NewRandomCircle should have comment or be unexported (golint)
    • Line 35: warning: exported method Ellipse.Draw should have comment or be unexported (golint)
    • Line 40: warning: exported method Ellipse.SVG should have comment or be unexported (golint)
    • Line 46: warning: exported method Ellipse.Copy should have comment or be unexported (golint)
    • Line 51: warning: exported method Ellipse.Mutate should have comment or be unexported (golint)
    • Line 72: warning: exported method Ellipse.Rasterize should have comment or be unexported (golint)
    • Line 102: warning: exported type RotatedEllipse should have comment or be unexported (golint)
    • Line 109: warning: exported function NewRandomRotatedEllipse should have comment or be unexported (golint)
    • Line 119: warning: exported method RotatedEllipse.Draw should have comment or be unexported (golint)
    • Line 127: warning: exported method RotatedEllipse.SVG should have comment or be unexported (golint)
    • Line 133: warning: exported method RotatedEllipse.Copy should have comment or be unexported (golint)
    • Line 138: warning: exported method RotatedEllipse.Mutate should have comment or be unexported (golint)
    • Line 154: warning: exported method RotatedEllipse.Rasterize should have comment or be unexported (golint)
    • primitive/primitive/model.go
    • Line 11: warning: exported type Model should have comment or be unexported (golint)
    • Line 25: warning: exported function NewModel should have comment or be unexported (golint)
    • Line 66: warning: exported method Model.Frames should have comment or be unexported (golint)
    • Line 86: warning: exported method Model.SVG should have comment or be unexported (golint)
    • Line 103: warning: exported method Model.Add should have comment or be unexported (golint)
    • Line 119: warning: exported method Model.Step should have comment or be unexported (golint)
    • primitive/primitive/state.go
    • Line 3: warning: exported type State should have comment or be unexported (golint)
    • Line 11: warning: exported function NewState should have comment or be unexported (golint)
    • Line 20: warning: exported method State.Energy should have comment or be unexported (golint)
    • Line 27: warning: exported method State.DoMove should have comment or be unexported (golint)
    • Line 38: warning: exported method State.UndoMove should have comment or be unexported (golint)
    • Line 45: warning: exported method State.Copy should have comment or be unexported (golint)
    • primitive/primitive/util.go
    • Line 19: warning: exported function LoadImage should have comment or be unexported (golint)
    • Line 23: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 34: warning: exported function SaveFile should have comment or be unexported (golint)
    • Line 38: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 49: warning: exported function SavePNG should have comment or be unexported (golint)
    • Line 58: warning: exported function SaveJPG should have comment or be unexported (golint)
    • Line 67: warning: exported function SaveGIF should have comment or be unexported (golint)
    • Line 87: warning: exported function SaveGIFImageMagick should have comment or be unexported (golint)
    • Line 111: warning: exported function NumberString should have comment or be unexported (golint)
    • Line 188: warning: exported function AverageImageColor should have comment or be unexported (golint)
    • primitive/primitive/quadratic.go
    • Line 11: warning: exported type Quadratic should have comment or be unexported (golint)
    • Line 19: warning: exported function NewRandomQuadratic should have comment or be unexported (golint)
    • Line 33: warning: exported method Quadratic.Draw should have comment or be unexported (golint)
    • Line 40: warning: exported method Quadratic.SVG should have comment or be unexported (golint)
    • Line 48: warning: exported method Quadratic.Copy should have comment or be unexported (golint)
    • Line 53: warning: exported method Quadratic.Mutate should have comment or be unexported (golint)
    • Line 78: warning: exported method Quadratic.Valid should have comment or be unexported (golint)
    • Line 91: warning: exported method Quadratic.Rasterize should have comment or be unexported (golint)
    • primitive/primitive/shape.go
    • Line 5: warning: exported type Shape should have comment or be unexported (golint)
    • Line 13: warning: exported type ShapeType should have comment or be unexported (golint)
    • Line 16: warning: exported const ShapeTypeAny should have comment (or a comment on this block) or be unexported (golint)
    • primitive/primitive/worker.go
    • Line 11: warning: exported type Worker should have comment or be unexported (golint)
    • Line 24: warning: exported function NewWorker should have comment or be unexported (golint)
    • Line 39: warning: exported method Worker.Init should have comment or be unexported (golint)
    • Line 46: warning: exported method Worker.Energy should have comment or be unexported (golint)
    • Line 56: warning: exported method Worker.BestHillClimbState should have comment or be unexported (golint)
    • Line 73: warning: exported method Worker.BestRandomState should have comment or be unexported (golint)
    • Line 87: warning: exported method Worker.RandomState should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!