Preparing report...

Report for github.com/chenchun/ipset

A+    Excellent!    Found 4 issues across 8 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!


gocyclo75%

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.

    • ipset/ipset.go
    • Line 171: warning: cyclomatic complexity 24 of function (*Handle).List() is high (> 15) (gocyclo)
    • Line 268: warning: cyclomatic complexity 22 of function parseAdtAttr() is high (> 15) (gocyclo)

golint50%

Golint is a linter for Go source code.

    • ipset/constant.go
    • Line 10: warning: exported const NFNL_SUBSYS_IPSET should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported var IPSetCmdflags should have comment or be unexported (golint)
    • Line 118: warning: exported type Opt should have comment or be unexported (golint)
    • Line 254: warning: exported const NFPROTO_UNSPEC should have comment (or a comment on this block) or be unexported (golint)
    • Line 317: warning: exported const BitmapIP should have comment (or a comment on this block) or be unexported (golint)
    • Line 347: warning: exported const SizeofNFGenMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 350: warning: exported function DeserializeNFGenlMsg should have comment or be unexported (golint)
    • Line 362: warning: exported type ListItem should have comment or be unexported (golint)
    • ipset/ipset.go
    • Line 25: warning: exported function New should have comment or be unexported (golint)
    • Line 29: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 35: warning: exported method Handle.Create should have comment or be unexported (golint)
    • Line 63: warning: exported method Handle.Destroy should have comment or be unexported (golint)
    • Line 171: warning: exported method Handle.List should have comment or be unexported (golint)
    • Line 354: warning: exported method Handle.Add should have comment or be unexported (golint)
    • Line 358: warning: exported method Handle.Del should have comment or be unexported (golint)
    • Line 399: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • ipset/ipset_test.go
    • Line 215: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 233: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ipset/log/log.go
    • Line 8: warning: exported type LOG should have comment or be unexported (golint)
    • Line 14: warning: exported type Log should have comment or be unexported (golint)
    • Line 23: warning: exported method Log.Infof should have comment or be unexported (golint)
    • Line 27: warning: exported method Log.Fatalf 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!