Preparing report...

Report for github.com/qiniu/dyn

A+    Excellent!    Found 16 issues across 46 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!


gocyclo80%

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.

    • dyn/jsonext/decode_test.go
    • Line 592: warning: cyclomatic complexity 17 of function TestNumberAccessors() is high (> 15) (gocyclo)
    • Line 1126: warning: cyclomatic complexity 16 of function TestUnmarshalNulls() is high (> 15) (gocyclo)
    • dyn/jsonext/decode.go
    • Line 629: warning: cyclomatic complexity 52 of function (*decodeState).literalStore() is high (> 15) (gocyclo)
    • Line 451: warning: cyclomatic complexity 31 of function (*decodeState).object() is high (> 15) (gocyclo)
    • Line 954: warning: cyclomatic complexity 30 of function unquoteBytes() is high (> 15) (gocyclo)
    • Line 345: warning: cyclomatic complexity 23 of function (*decodeState).array() is high (> 15) (gocyclo)
    • Line 302: warning: cyclomatic complexity 19 of function (*decodeState).indirect() is high (> 15) (gocyclo)
    • dyn/jsonext/encode.go
    • Line 355: warning: cyclomatic complexity 22 of function newTypeEncoder() is high (> 15) (gocyclo)
    • Line 786: warning: cyclomatic complexity 21 of function (*encodeState).string() is high (> 15) (gocyclo)
    • Line 994: warning: cyclomatic complexity 21 of function typeFields() is high (> 15) (gocyclo)
    • Line 859: warning: cyclomatic complexity 21 of function (*encodeState).stringBytes() is high (> 15) (gocyclo)
    • dyn/text/internal/encoding/json/decode.go
    • Line 594: warning: cyclomatic complexity 39 of function (*decodeState).literalStore() is high (> 15) (gocyclo)
    • Line 410: warning: cyclomatic complexity 32 of function (*decodeState).object() is high (> 15) (gocyclo)
    • Line 869: warning: cyclomatic complexity 30 of function unquoteBytes() is high (> 15) (gocyclo)
    • Line 315: warning: cyclomatic complexity 21 of function (*decodeState).array() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 18 of function (*decodeState).indirect() is high (> 15) (gocyclo)
    • dyn/flag/parser.go
    • Line 158: warning: cyclomatic complexity 21 of function parseArg() is high (> 15) (gocyclo)
    • Line 66: warning: cyclomatic complexity 18 of function parseFlagArg() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 16 of function parseStructArgs() is high (> 15) (gocyclo)
    • dyn/cmdargs/parser.go
    • Line 133: warning: cyclomatic complexity 19 of function parseArg() is high (> 15) (gocyclo)
    • Line 45: warning: cyclomatic complexity 16 of function parseFlagArg() is high (> 15) (gocyclo)
    • Line 218: warning: cyclomatic complexity 16 of function parseStructArgs() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • dyn/cmdarg/unmarshal.go
    • Line 11: warning: exported function UnmarshalText should have comment or be unexported (golint)
    • Line 20: warning: exported function Unmarshal should have comment or be unexported (golint)
    • dyn/unsafe/unsafe.go
    • Line 10: warning: exported function ToBytes should have comment or be unexported (golint)
    • Line 17: warning: exported function ToString should have comment or be unexported (golint)
    • dyn/flag/parser.go
    • Line 15: warning: should not use dot imports (golint)
    • Line 19: warning: exported var ErrParamsNotEnough should have comment or be unexported (golint)
    • Line 27: warning: exported type Context should have comment or be unexported (golint)
    • Line 324: warning: exported function Parse should have comment or be unexported (golint)
    • Line 349: warning: exported var ErrMethodNotFound should have comment or be unexported (golint)
    • Line 353: warning: exported function ExecMethod should have comment or be unexported (golint)
    • Line 385: warning: exported function Exec should have comment or be unexported (golint)
    • Line 397: warning: exported type Cmd should have comment or be unexported (golint)
    • Line 399: warning: exported function HelpMethod should have comment or be unexported (golint)
    • Line 404: warning: exported function HelpCmd should have comment or be unexported (golint)
    • Line 414: warning: exported function Help should have comment or be unexported (golint)
    • dyn/cmdargs/parser.go
    • Line 15: warning: should not use dot imports (golint)
    • Line 19: warning: exported var ErrParamsNotEnough should have comment or be unexported (golint)
    • Line 290: warning: exported function Parse should have comment or be unexported (golint)
    • dyn/text/internal/encoding/json/encode.go
    • Line 170: warning: exported type UnsupportedValueError should have comment or be unexported (golint)
    • Line 179: warning: exported type InvalidUTF8Error should have comment or be unexported (golint)
    • Line 187: warning: exported type MarshalerError should have comment or be unexported (golint)
    • dyn/jsonext/jsonext.go
    • Line 7: warning: should not use dot imports (golint)
    • Line 25: warning: exported function UnmarshalString should have comment or be unexported (golint)
    • Line 32: warning: exported function MarshalToString should have comment or be unexported (golint)
    • Line 41: warning: exported function MarshalIndentToString should have comment or be unexported (golint)
    • dyn/doc.go
    • Line 4: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • dyn/proto/var.go
    • Line 6: warning: don't use underscores in Go names; const Fmttype_Invalid should be FmttypeInvalid (golint)
    • Line 6: warning: exported const Fmttype_Invalid should have comment (or a comment on this block) or be unexported (golint)
    • Line 7: warning: don't use underscores in Go names; const Fmttype_Json should be FmttypeJSON (golint)
    • Line 8: warning: don't use underscores in Go names; const Fmttype_Form should be FmttypeForm (golint)
    • Line 9: warning: don't use underscores in Go names; const Fmttype_Text should be FmttypeText (golint)
    • Line 10: warning: don't use underscores in Go names; const Fmttype_Jsonstr should be FmttypeJsonstr (golint)
    • Line 15: warning: exported type Var should have comment or be unexported (golint)
    • dyn/dyn/dyn.go
    • Line 13: warning: exported function TagName should have comment or be unexported (golint)
    • Line 20: warning: exported function FieldByTag should have comment or be unexported (golint)
    • Line 41: warning: exported function GetVal should have comment or be unexported (golint)
    • Line 92: warning: exported function Get should have comment or be unexported (golint)
    • Line 103: warning: exported function Int should have comment or be unexported (golint)
    • Line 139: warning: exported function GetInt should have comment or be unexported (golint)
    • Line 150: warning: exported function Float should have comment or be unexported (golint)
    • Line 172: warning: exported function GetFloat should have comment or be unexported (golint)
    • Line 183: warning: exported function String should have comment or be unexported (golint)
    • Line 199: warning: exported function GetString should have comment or be unexported (golint)
    • dyn/vars/context.go
    • Line 17: warning: don't use underscores in Go names; const Fmttype_Invalid should be FmttypeInvalid (golint)
    • Line 17: warning: exported const Fmttype_Invalid should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: don't use underscores in Go names; const Fmttype_Json should be FmttypeJSON (golint)
    • Line 19: warning: don't use underscores in Go names; const Fmttype_Form should be FmttypeForm (golint)
    • Line 20: warning: don't use underscores in Go names; const Fmttype_Text should be FmttypeText (golint)
    • Line 21: warning: don't use underscores in Go names; const Fmttype_Jsonstr should be FmttypeJsonstr (golint)
    • Line 25: warning: exported var ErrNotVar should have comment or be unexported (golint)
    • Line 32: warning: exported type Context should have comment or be unexported (golint)
    • Line 36: warning: exported function New should have comment or be unexported (golint)
    • Line 46: warning: exported method Context.GetVars should have comment or be unexported (golint)
    • Line 51: warning: exported method Context.GetVar should have comment or be unexported (golint)
    • Line 56: warning: exported method Context.DeleteVar should have comment or be unexported (golint)
    • Line 76: warning: exported method Context.MatchVar should have comment or be unexported (golint)
    • Line 106: warning: exported method Context.Match should have comment or be unexported (golint)
    • Line 181: warning: exported method Context.Let should have comment or be unexported (golint)
    • Line 192: warning: exported method Context.Subst should have comment or be unexported (golint)
    • Line 237: warning: exported method Context.SubstText should have comment or be unexported (golint)
    • dyn/text/subst.go
    • Line 17: warning: don't use underscores in Go names; const Fmttype_Json should be FmttypeJSON (golint)
    • Line 17: warning: exported const Fmttype_Json should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: don't use underscores in Go names; const Fmttype_Form should be FmttypeForm (golint)
    • Line 19: warning: don't use underscores in Go names; const Fmttype_Text should be FmttypeText (golint)
    • Line 20: warning: don't use underscores in Go names; const Fmttype_Jsonstr should be FmttypeJsonstr (golint)
    • Line 25: warning: exported function AsJsonString should have comment or be unexported (golint)
    • Line 47: warning: exported function AsJsonstrString should have comment or be unexported (golint)
    • Line 72: warning: exported function AsQueryString should have comment or be unexported (golint)
    • Line 81: warning: exported function AsTextString should have comment or be unexported (golint)
    • Line 109: warning: exported function AsString should have comment or be unexported (golint)
    • Line 124: warning: exported function GetAsString should have comment or be unexported (golint)
    • Line 176: warning: exported function Subst should have comment or be unexported (golint)
    • dyn/jsonext/encode.go
    • Line 5: warning: package comment should be of the form "Package jsonext ..." (golint)
    • Line 205: warning: exported type UnsupportedValueError should have comment or be unexported (golint)
    • Line 214: warning: comment on exported type InvalidUTF8Error should be of the form "InvalidUTF8Error ..." (with optional leading article) (golint)
    • Line 228: warning: exported type MarshalerError should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!