Preparing report...

Report for github.com/feiin/go-xss

A    Great!    Found 5 issues across 12 files

Tweet

gofmt91%

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!


gocyclo58%

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.

    • go-xss/xss_test.go
    • Line 427: warning: cyclomatic complexity 64 of function TestProcess_Evasion_Cheat_Sheet() is high (> 15) (gocyclo)
    • Line 8: warning: cyclomatic complexity 52 of function TestProcess_normal() is high (> 15) (gocyclo)
    • Line 914: warning: cyclomatic complexity 51 of function TestOnTagCustomMethod() is high (> 15) (gocyclo)
    • Line 1203: warning: cyclomatic complexity 18 of function TestOnTagAttr() is high (> 15) (gocyclo)
    • Line 1103: warning: cyclomatic complexity 16 of function TestOnIgnoreTag() is high (> 15) (gocyclo)
    • go-xss/xss.go
    • Line 86: warning: cyclomatic complexity 19 of function (*Xss).Process() is high (> 15) (gocyclo)

golint75%

Golint is a linter for Go source code.

    • go-xss/xss.go
    • Line 11: warning: exported type Xss should have comment or be unexported (golint)
    • Line 15: warning: comment on exported function NewXSS should be of the form "NewXSS ..." (golint)
    • Line 58: warning: exported type AttrResult should have comment or be unexported (golint)
    • Line 63: warning: exported function GetAttrs should have comment or be unexported (golint)
    • Line 168: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 197: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-xss/xss_option.go
    • Line 9: warning: exported type XssOption should have comment or be unexported (golint)
    • Line 37: warning: exported type TagOption should have comment or be unexported (golint)
    • Line 44: warning: comment on exported function NewXssOption should be of the form "NewXssOption ..." (golint)
    • Line 50: warning: comment on exported function NewDefaultXssOption should be of the form "NewDefaultXssOption ..." (golint)
    • Line 66: warning: exported type OnIgnoreTagFunc should have comment or be unexported (golint)
    • Line 68: warning: exported type StripTagBodyResult should have comment or be unexported (golint)
    • Line 400: warning: exported function EscapeAttrValue should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign91%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!