Preparing report...

Report for github.com/provpn/dns

A+    Excellent!    Found 30 issues across 82 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!


golint89%

Golint is a linter for Go source code.

    • dns/acceptfunc.go
    • Line 29: warning: exported const MsgAccept should have comment (or a comment on this block) or be unexported (golint)
    • dns/client.go
    • Line 128: warning: exported method Client.Exchange should have comment or be unexported (golint)
    • dns/dns.go
    • Line 64: warning: don't use underscores in Go names; type RR_Header should be RRHeader (golint)
    • dns/edns.go
    • Line 95: warning: receiver name r1 should be consistent with previous receiver name rr for OPT (golint)
    • Line 455: warning: comment on exported type EDNS0_DAU should be of the form "EDNS0_DAU ..." (with optional leading article) (golint)
    • dns/dnssec.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • dns/privaterr.go
    • Line 93: warning: receiver name r1 should be consistent with previous receiver name r for PrivateRR (golint)
    • dns/scan_rr.go
    • Line 606: 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 614: 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 632: 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 643: 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 650: 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 673: 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)
    • dns/types.go
    • Line 703: warning: comment on exported type A should be of the form "A ..." (with optional leading article) (golint)
    • Line 1422: warning: receiver name a should be consistent with previous receiver name p for APLPrefix (golint)

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.

    • dns/format.go
    • Line 18: warning: cyclomatic complexity 18 of function Field() is high (> 15) (gocyclo)
    • dns/types.go
    • Line 444: warning: cyclomatic complexity 17 of function sprintName() is high (> 15) (gocyclo)
    • dns/update_test.go
    • Line 8: warning: cyclomatic complexity 18 of function TestDynamicUpdateParsing() is high (> 15) (gocyclo)
    • dns/scan_rr.go
    • Line 583: warning: cyclomatic complexity 33 of function (*LOC).parse() is high (> 15) (gocyclo)
    • Line 851: warning: cyclomatic complexity 19 of function (*RRSIG).parse() is high (> 15) (gocyclo)
    • Line 978: warning: cyclomatic complexity 19 of function (*NSEC3).parse() is high (> 15) (gocyclo)
    • Line 476: warning: cyclomatic complexity 19 of function (*NAPTR).parse() is high (> 15) (gocyclo)
    • Line 1679: warning: cyclomatic complexity 17 of function (*APL).parse() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 16 of function endingToTxtSlice() is high (> 15) (gocyclo)
    • dns/sig0.go
    • Line 78: warning: cyclomatic complexity 32 of function (*SIG).Verify() is high (> 15) (gocyclo)
    • dns/msg.go
    • Line 205: warning: cyclomatic complexity 26 of function packDomainName() is high (> 15) (gocyclo)
    • Line 737: warning: cyclomatic complexity 23 of function (*Msg).packBufferWithCompressionMap() is high (> 15) (gocyclo)
    • Line 373: warning: cyclomatic complexity 20 of function UnpackDomainName() is high (> 15) (gocyclo)
    • dns/generate.go
    • Line 129: warning: cyclomatic complexity 18 of function (*generateReader).ReadByte() is high (> 15) (gocyclo)
    • Line 21: warning: cyclomatic complexity 17 of function (*ZoneParser).generate() is high (> 15) (gocyclo)
    • dns/xfr.go
    • Line 119: warning: cyclomatic complexity 16 of function (*Transfer).inIxfr() is high (> 15) (gocyclo)
    • dns/scan.go
    • Line 279: warning: cyclomatic complexity 92 of function (*ZoneParser).Next() is high (> 15) (gocyclo)
    • Line 737: warning: cyclomatic complexity 69 of function (*zlexer).Next() is high (> 15) (gocyclo)
    • dns/dnssec.go
    • Line 649: warning: cyclomatic complexity 27 of function rawSignatureData() is high (> 15) (gocyclo)
    • Line 388: warning: cyclomatic complexity 22 of function (*RRSIG).Verify() is high (> 15) (gocyclo)
    • dns/client_test.go
    • Line 338: warning: cyclomatic complexity 24 of function TestTruncatedMsg() is high (> 15) (gocyclo)
    • Line 284: warning: cyclomatic complexity 16 of function TestClientConn() is high (> 15) (gocyclo)

ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • dns/labels.go
    • Line 93: warning: ineffectual assignment to end (ineffassign)
    • Line 113: warning: ineffectual assignment to end (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words