Preparing report...

Report for github.com/tdewolff/canvas

(v0.0.0-20230718094109-e09ac786d611)

A+    Excellent!    Found 46 issues across 106 files

Tweet

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!


gofmt86%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo66%

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.

    • renderers/pdf/writer.go
    • Line 852: warning: cyclomatic complexity 33 of function (*pdfPageWriter).WriteText() is high (> 15) (gocyclo)
    • Line 253: warning: cyclomatic complexity 28 of function (*pdfWriter).writeFont() is high (> 15) (gocyclo)
    • Line 129: warning: cyclomatic complexity 27 of function (*pdfWriter).writeVal() is high (> 15) (gocyclo)
    • path_util.go
    • Line 64: warning: cyclomatic complexity 16 of function ellipseToCenter() is high (> 15) (gocyclo)
    • path_intersection.go
    • Line 183: warning: cyclomatic complexity 84 of function boolean() is high (> 15) (gocyclo)
    • Line 840: warning: cyclomatic complexity 73 of function collisions() is high (> 15) (gocyclo)
    • Line 581: warning: cyclomatic complexity 45 of function intersectionNodes() is high (> 15) (gocyclo)
    • Line 365: warning: cyclomatic complexity 26 of function booleanIntersections() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 26 of function cut() is high (> 15) (gocyclo)
    • Line 1102: warning: cyclomatic complexity 17 of function (*Path).rayIntersections() is high (> 15) (gocyclo)
    • canvas.go
    • Line 550: warning: cyclomatic complexity 17 of function (*Context).FitImage() is high (> 15) (gocyclo)
    • Line 614: warning: cyclomatic complexity 16 of function (*Context).DrawPath() is high (> 15) (gocyclo)
    • text.go
    • Line 483: warning: cyclomatic complexity 120 of function (*RichText).ToText() is high (> 15) (gocyclo)
    • Line 1089: warning: cyclomatic complexity 16 of function (*Text).WalkDecorations() is high (> 15) (gocyclo)
    • font/sfnt.go
    • Line 559: warning: cyclomatic complexity 69 of function (*SFNT).parseCmap() is high (> 15) (gocyclo)
    • Line 197: warning: cyclomatic complexity 64 of function parseSFNT() is high (> 15) (gocyclo)
    • Line 1554: warning: cyclomatic complexity 25 of function (*SFNT).parsePost() is high (> 15) (gocyclo)
    • Line 1387: warning: cyclomatic complexity 19 of function (*SFNT).parseOS2() is high (> 15) (gocyclo)
    • Line 1103: warning: cyclomatic complexity 17 of function (*SFNT).parseKern() is high (> 15) (gocyclo)
    • Line 1277: warning: cyclomatic complexity 17 of function (*SFNT).parseName() is high (> 15) (gocyclo)
    • font/sfnt_cff.go
    • Line 188: warning: cyclomatic complexity 124 of function (*cffTable).ToPath() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 35 of function parseTopDICT() is high (> 15) (gocyclo)
    • Line 20: warning: cyclomatic complexity 22 of function (*SFNT).parseCFF() is high (> 15) (gocyclo)
    • Line 926: warning: cyclomatic complexity 21 of function parsePrivateDICT() is high (> 15) (gocyclo)
    • Line 1158: warning: cyclomatic complexity 19 of function parseFontINDEX() is high (> 15) (gocyclo)
    • Line 1006: warning: cyclomatic complexity 17 of function parseDICT() is high (> 15) (gocyclo)
    • text/linebreak.go
    • Line 560: warning: cyclomatic complexity 55 of function GlyphsToItems() is high (> 15) (gocyclo)
    • Line 434: warning: cyclomatic complexity 30 of function Linebreak() is high (> 15) (gocyclo)
    • Line 329: warning: cyclomatic complexity 28 of function (*linebreaker).mainLoop() is high (> 15) (gocyclo)
    • Line 728: warning: cyclomatic complexity 23 of function LinebreakGlyphs() is high (> 15) (gocyclo)
    • font/woff.go
    • Line 48: warning: cyclomatic complexity 33 of function ParseWOFF() is high (> 15) (gocyclo)
    • latex_bin.go
    • Line 33: warning: cyclomatic complexity 32 of function ParseLaTeX() is high (> 15) (gocyclo)
    • cmd/pdftext/main.go
    • Line 41: warning: cyclomatic complexity 21 of function (*Extract).Run() is high (> 15) (gocyclo)
    • Line 107: warning: cyclomatic complexity 19 of function (*Replace).Run() is high (> 15) (gocyclo)
    • Line 268: warning: cyclomatic complexity 16 of function walkStrings() is high (> 15) (gocyclo)
    • latex_dvi.go
    • Line 44: warning: cyclomatic complexity 67 of function DVI2Path() is high (> 15) (gocyclo)
    • latex.go
    • Line 110: warning: cyclomatic complexity 35 of function (*dviFonts).Get() is high (> 15) (gocyclo)
    • path_intersection_util.go
    • Line 183: warning: cyclomatic complexity 30 of function (Intersections).appendSegment() is high (> 15) (gocyclo)
    • Line 303: warning: cyclomatic complexity 21 of function (Intersections).LineLine() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 19 of function (Intersections).LineCube() is high (> 15) (gocyclo)
    • Line 467: warning: cyclomatic complexity 17 of function (Intersections).LineEllipse() is high (> 15) (gocyclo)
    • font/woff2.go
    • Line 53: warning: cyclomatic complexity 75 of function ParseWOFF2() is high (> 15) (gocyclo)
    • Line 332: warning: cyclomatic complexity 59 of function reconstructGlyfLoca() is high (> 15) (gocyclo)
    • Line 610: warning: cyclomatic complexity 29 of function reconstructHmtx() is high (> 15) (gocyclo)
    • renderers/svg/svg.go
    • Line 156: warning: cyclomatic complexity 46 of function (*SVG).RenderPath() is high (> 15) (gocyclo)
    • Line 286: warning: cyclomatic complexity 28 of function (*SVG).writeFontStyle() is high (> 15) (gocyclo)
    • Line 363: warning: cyclomatic complexity 21 of function (*SVG).RenderText() is high (> 15) (gocyclo)
    • cmd/pdftext/writer.go
    • Line 191: warning: cyclomatic complexity 31 of function pdfWriteVal() is high (> 15) (gocyclo)
    • Line 99: warning: cyclomatic complexity 17 of function (*pdfWriter).Close() is high (> 15) (gocyclo)
    • path_stroke.go
    • Line 300: warning: cyclomatic complexity 24 of function offsetSegment() is high (> 15) (gocyclo)
    • Line 185: warning: cyclomatic complexity 20 of function (ArcsJoiner).Join() is high (> 15) (gocyclo)
    • util.go
    • Line 657: warning: cyclomatic complexity 17 of function solveCubicFormula() is high (> 15) (gocyclo)
    • cmd/pdftext/reader.go
    • Line 551: warning: cyclomatic complexity 139 of function pdfReadVal() is high (> 15) (gocyclo)
    • Line 143: warning: cyclomatic complexity 30 of function (*pdfReader).readCrossReferenceStream() is high (> 15) (gocyclo)
    • Line 77: warning: cyclomatic complexity 20 of function (*pdfReader).readCrossReferenceTable() is high (> 15) (gocyclo)
    • path.go
    • Line 1708: warning: cyclomatic complexity 55 of function ParseSVGPath() is high (> 15) (gocyclo)
    • Line 1209: warning: cyclomatic complexity 34 of function (*Path).SplitAt() is high (> 15) (gocyclo)
    • Line 608: warning: cyclomatic complexity 31 of function (*Path).Filling() is high (> 15) (gocyclo)
    • Line 772: warning: cyclomatic complexity 29 of function (*Path).Bounds() is high (> 15) (gocyclo)
    • Line 1528: warning: cyclomatic complexity 17 of function (*Path).Reverse() is high (> 15) (gocyclo)
    • Line 180: warning: cyclomatic complexity 17 of function (*Path).Join() is high (> 15) (gocyclo)
    • Line 1471: warning: cyclomatic complexity 16 of function (*Path).Dash() is high (> 15) (gocyclo)
    • Line 1915: warning: cyclomatic complexity 16 of function (*Path).ToSVG() is high (> 15) (gocyclo)
    • font.go
    • Line 344: warning: cyclomatic complexity 40 of function (*FontFamily).Face() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words