Preparing report...

Report for github.com/quchunguang/trygo

A+    Excellent!    Found 93 issues across 221 files

Tweet

gofmt85%

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!


gocyclo99%

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.

    • trygo/demos/demo_yacc/yaccpar
    • Line 156: warning: cyclomatic complexity 39 of function (*yyParserImpl).Parse() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 20 of function yyErrorMessage() is high (> 15) (gocyclo)

golint68%

Golint is a linter for Go source code.

    • trygo/demos/demo_algorithms/lukasiewicz.go
    • Line 8: warning: comment on exported function PostfixCalc should be of the form "PostfixCalc ..." (golint)
    • Line 28: warning: comment on exported function Infix2Postfix should be of the form "Infix2Postfix ..." (golint)
    • Line 52: warning: comment on exported function PrefixCalc should be of the form "PrefixCalc ..." (golint)
    • trygo/demos/demo_beego2/demo_beego2.go
    • Line 8: warning: exported type FooController should have comment or be unexported (golint)
    • Line 12: warning: exported method FooController.Get should have comment or be unexported (golint)
    • Line 12: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • trygo/demos/demo_map/main.go
    • Line 10: warning: exported function Common should have comment or be unexported (golint)
    • Line 35: warning: exported function ZeroBool should have comment or be unexported (golint)
    • Line 53: warning: exported function ZeroSlice should have comment or be unexported (golint)
    • Line 73: warning: exported function MapMap should have comment or be unexported (golint)
    • Line 94: warning: comment on exported function StructMap should be of the form "StructMap ..." (golint)
    • trygo/demos/demo_slice_gotcha/main.go
    • Line 35: warning: comment on exported function FindDigits should be of the form "FindDigits ..." (golint)
    • Line 41: warning: exported function FindDigits2 should have comment or be unexported (golint)
    • Line 49: warning: exported function FindDigits3 should have comment or be unexported (golint)
    • trygo/demos/demo_pg2/main.go
    • Line 13: warning: exported type UserScores should have comment or be unexported (golint)
    • Line 24: warning: exported type FloatSlice should have comment or be unexported (golint)
    • Line 26: warning: exported method FloatSlice.Scan should have comment or be unexported (golint)
    • trygo/demos/demo_algorithms/permutation.go
    • Line 7: warning: exported function RecursiveSubsets should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function PrintAllSubsets1 should be of the form "PrintAllSubsets1 ..." (golint)
    • Line 29: warning: comment on exported function PrintAllSubsets2 should be of the form "PrintAllSubsets2 ..." (golint)
    • Line 58: warning: exported function Permutation should have comment or be unexported (golint)
    • trygo/demos/demo_pointer/demo_pointer.go
    • Line 5: warning: exported type Mutatable should have comment or be unexported (golint)
    • Line 10: warning: exported method Mutatable.StayTheSame should have comment or be unexported (golint)
    • Line 15: warning: exported method Mutatable.Mutate should have comment or be unexported (golint)
    • trygo/demos/demo_gotabulate/demo_gotabulate.go
    • Line 8: warning: exported var STRING_ARRAY should have comment or be unexported (golint)
    • Line 12: warning: don't use underscores in Go names; var row_1 should be row1 (golint)
    • Line 13: warning: don't use underscores in Go names; var row_2 should be row2 (golint)
    • Line 33: warning: don't use underscores in Go names; var string_1 should be string1 (golint)
    • Line 34: warning: don't use underscores in Go names; var string_2 should be string2 (golint)
    • trygo/demos/demo_heap/demo_heap.go
    • Line 8: warning: exported type IntHeap should have comment or be unexported (golint)
    • Line 14: warning: exported method IntHeap.Push should have comment or be unexported (golint)
    • Line 17: warning: exported method IntHeap.Pop should have comment or be unexported (golint)
    • trygo/demos/demo_algorithms/btree.go
    • Line 9: warning: exported type BTNode should have comment or be unexported (golint)
    • Line 14: warning: comment on exported function GenMax should be of the form "GenMax ..." (golint)
    • Line 37: warning: comment on exported function BTTraverseFront should be of the form "BTTraverseFront ..." (golint)
    • Line 47: warning: exported function BTTraverseMiddle should have comment or be unexported (golint)
    • Line 56: warning: exported function BTTraverseLast should have comment or be unexported (golint)
    • Line 65: warning: comment on exported function BTTraverseFrontNR should be of the form "BTTraverseFrontNR ..." (golint)
    • Line 81: warning: comment on exported function BTTraverseLevel should be of the form "BTTraverseLevel ..." (golint)
    • trygo/demos/demo_session/demo_session.go
    • Line 59: warning: exported type User should have comment or be unexported (golint)
    • Line 82: warning: don't use underscores in Go names; var db_user should be dbUser (golint)
    • Line 86: 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)
    • trygo/demos/demo_algorithms/simglelink.go
    • Line 7: warning: exported type Node should have comment or be unexported (golint)
    • Line 12: warning: exported function NewNode should have comment or be unexported (golint)
    • Line 19: warning: exported function SingleLink should have comment or be unexported (golint)
    • trygo/demos/demo_temp/demo_temp.go
    • Line 11: warning: exported type Person should have comment or be unexported (golint)
    • Line 20: warning: exported type OnlineUser should have comment or be unexported (golint)
    • Line 27: warning: exported function HandlerTest should have comment or be unexported (golint)
    • Line 40: warning: exported function Handler should have comment or be unexported (golint)
    • trygo/demos/demo_windows_dll/main.go
    • Line 22: warning: exported const MB_OK should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported function MessageBox should have comment or be unexported (golint)
    • Line 65: warning: exported function GetModuleHandle should have comment or be unexported (golint)
    • trygo/demos/demo_douban/douban_book.go
    • Line 15: warning: exported type Payload should have comment or be unexported (golint)
    • Line 60: warning: exported function WriteJson should have comment or be unexported (golint)
    • Line 69: warning: exported function ReadJson should have comment or be unexported (golint)
    • trygo/demos/demo_tmp/main.go
    • Line 28: warning: exported function PKCS5Padding should have comment or be unexported (golint)
    • Line 33: warning: exported function DesEncrypt should have comment or be unexported (golint)
    • Line 46: warning: exported function PKCS5UnPadding should have comment or be unexported (golint)
    • Line 52: warning: exported function DesDecrypt should have comment or be unexported (golint)
    • Line 102: warning: exported function RsaEncrypt should have comment or be unexported (golint)
    • Line 115: warning: exported function RsaDecrypt should have comment or be unexported (golint)
    • Line 207: warning: exported function Calc should have comment or be unexported (golint)
    • trygo/demos/demo_heap2/demo_heap2.go
    • Line 8: warning: exported type Item should have comment or be unexported (golint)
    • Line 14: warning: exported type PriorityQueue should have comment or be unexported (golint)
    • Line 28: warning: exported method PriorityQueue.Push should have comment or be unexported (golint)
    • Line 34: warning: exported method PriorityQueue.Pop should have comment or be unexported (golint)
    • Line 42: warning: exported method PriorityQueue.Update should have comment or be unexported (golint)
    • trygo/demos/demo_algorithms/searching.go
    • Line 9: warning: exported function Search should have comment or be unexported (golint)
    • Line 18: warning: exported function Search2 should have comment or be unexported (golint)
    • Line 33: warning: exported function Searching should have comment or be unexported (golint)
    • trygo/demos/demo_windows_hook/main.go
    • Line 25: warning: exported const WH_KEYBOARD_LL should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type DWORD should have comment or be unexported (golint)
    • Line 43: warning: exported type WPARAM should have comment or be unexported (golint)
    • Line 44: warning: exported type LPARAM should have comment or be unexported (golint)
    • Line 45: warning: exported type LRESULT should have comment or be unexported (golint)
    • Line 46: warning: exported type HANDLE should have comment or be unexported (golint)
    • Line 47: warning: exported type HINSTANCE should have comment or be unexported (golint)
    • Line 48: warning: exported type HHOOK should have comment or be unexported (golint)
    • Line 49: warning: exported type HWND should have comment or be unexported (golint)
    • Line 52: warning: exported type HOOKPROC should have comment or be unexported (golint)
    • Line 54: warning: exported type KBDLLHOOKSTRUCT should have comment or be unexported (golint)
    • Line 62: warning: comment on exported type POINT should be of the form "POINT ..." (with optional leading article) (golint)
    • Line 67: warning: comment on exported type MSG should be of the form "MSG ..." (with optional leading article) (golint)
    • Line 77: warning: exported function SetWindowsHookEx should have comment or be unexported (golint)
    • Line 87: warning: exported function CallNextHookEx should have comment or be unexported (golint)
    • Line 97: warning: exported function UnhookWindowsHookEx should have comment or be unexported (golint)
    • Line 104: warning: exported function GetMessage should have comment or be unexported (golint)
    • Line 113: warning: exported function TranslateMessage should have comment or be unexported (golint)
    • Line 119: warning: exported function DispatchMessage should have comment or be unexported (golint)
    • Line 125: warning: exported function Start should have comment or be unexported (golint)
    • trygo/demos/demo_rtree/demo_rtree.go
    • Line 14: warning: exported method Thing.Bounds should have comment or be unexported (golint)
    • Line 22: warning: exported type Somewhere should have comment or be unexported (golint)
    • Line 28: warning: exported method Somewhere.Bounds should have comment or be unexported (golint)
    • trygo/demos/demo_check/demo_check.go
    • Line 9: warning: exported type User should have comment or be unexported (golint)
    • Line 13: warning: exported type CustomStringContainValidator should have comment or be unexported (golint)
    • Line 17: warning: exported method CustomStringContainValidator.Validate should have comment or be unexported (golint)
    • trygo/searchtree.go
    • Line 7: warning: exported type SearchTreeNode should have comment or be unexported (golint)
    • Line 13: warning: exported function NewSearchTree should have comment or be unexported (golint)
    • Line 33: warning: exported method SearchTreeNode.Print should have comment or be unexported (golint)
    • Line 45: warning: exported method SearchTreeNode.Contain should have comment or be unexported (golint)
    • Line 60: warning: exported method SearchTreeNode.Add should have comment or be unexported (golint)
    • trygo/demos/demo_auth/authd.go
    • Line 12: warning: exported type ViewFunc should have comment or be unexported (golint)
    • Line 14: warning: exported function BasicAuth should have comment or be unexported (golint)
    • Line 45: warning: comment on exported function HelloServer should be of the form "HelloServer ..." (golint)
    • trygo/demos/demo_algorithms/map_reduce.go
    • Line 7: warning: exported type Thing should have comment or be unexported (golint)
    • Line 12: warning: exported method Thing.Times should have comment or be unexported (golint)
    • Line 17: warning: exported method Thing.Append should have comment or be unexported (golint)
    • Line 22: warning: exported method Thing.Delete should have comment or be unexported (golint)
    • Line 42: warning: exported type FuncMap should have comment or be unexported (golint)
    • Line 44: warning: exported method Thing.Map should have comment or be unexported (golint)
    • Line 51: warning: exported type FuncReduce should have comment or be unexported (golint)
    • Line 53: warning: exported method Thing.Reduce should have comment or be unexported (golint)
    • Line 64: warning: exported type FuncFilter should have comment or be unexported (golint)
    • Line 66: warning: exported method Thing.Filter should have comment or be unexported (golint)
    • Line 78: warning: exported function MapReduce should have comment or be unexported (golint)
    • trygo/demos/demo_web/demo_web.go
    • Line 11: warning: exported type User should have comment or be unexported (golint)
    • Line 42: warning: exported function Index should have comment or be unexported (golint)
    • Line 55: warning: exported function Favicon should have comment or be unexported (golint)
    • Line 57: warning: exported function Log should have comment or be unexported (golint)
    • Line 64: warning: exported function StaticServer should have comment or be unexported (golint)
    • trygo/demos/demo_gocraft/demo_gocraft.go
    • Line 10: warning: exported type User should have comment or be unexported (golint)
    • Line 15: warning: exported type Context should have comment or be unexported (golint)
    • Line 25: warning: exported method Context.UserRequired should have comment or be unexported (golint)
    • Line 37: warning: exported method Context.SetHelloCount should have comment or be unexported (golint)
    • Line 43: warning: exported method Context.SayHello should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • trygo/demo_lib.go
    • Line 621: warning: ineffectual assignment to err (ineffassign)
    • Line 621: warning: ineffectual assignment to err (ineffassign)
    • Line 788: warning: ineffectual assignment to xx (ineffassign)
    • trygo/demo_lang.go
    • Line 1375: warning: ineffectual assignment to m (ineffassign)
    • Line 1376: warning: ineffectual assignment to m (ineffassign)
    • Line 1394: warning: ineffectual assignment to mb (ineffassign)
    • Line 1404: warning: ineffectual assignment to mf (ineffassign)
    • Line 1410: warning: ineffectual assignment to f32 (ineffassign)
    • Line 1426: warning: ineffectual assignment to mc (ineffassign)
    • Line 1448: warning: ineffectual assignment to mi (ineffassign)

misspell99%

Misspell Finds commonly misspelled English words

    • trygo/even.go
    • Line 1: warning: "useage" is a misspelling of "usage" (misspell)
    • Line 9: warning: "charactor" is a misspelling of "character" (misspell)