Preparing report...

Report for github.com/chenhg5/collection

B    Not bad!    Found 9 issues across 10 files

Tweet

gofmt80%

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!


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.

    • collection/collection.go
    • Line 15: warning: cyclomatic complexity 49 of function Collect() is high (> 15) (gocyclo)
    • Line 592: warning: cyclomatic complexity 16 of function newDecimalArray() is high (> 15) (gocyclo)
    • Line 523: warning: cyclomatic complexity 16 of function isTrue() is high (> 15) (gocyclo)
    • collection/map_array_collection.go
    • Line 403: warning: cyclomatic complexity 22 of function (MapArrayCollection).FirstWhere() is high (> 15) (gocyclo)
    • Line 785: warning: cyclomatic complexity 22 of function (MapArrayCollection).Where() is high (> 15) (gocyclo)

golint10%

Golint is a linter for Go source code.

    • collection/collection.go
    • Line 227: warning: exported type Collection should have comment or be unexported (golint)
    • Line 562: warning: exported type CB should have comment or be unexported (golint)
    • Line 563: warning: exported type FilterFun should have comment or be unexported (golint)
    • Line 564: warning: exported type MapCB should have comment or be unexported (golint)
    • Line 565: warning: exported type PartCB should have comment or be unexported (golint)
    • Line 566: warning: exported type ReduceCB should have comment or be unexported (golint)
    • Line 644: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • collection/map_array_collection.go
    • Line 13: warning: exported type MapArrayCollection should have comment or be unexported (golint)
    • Line 67: warning: comment on exported method MapArrayCollection.Avg should be of the form "Avg ..." (golint)
    • Line 393: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 396: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 535: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 538: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 623: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 717: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • collection/map_collection.go
    • Line 9: warning: exported type MapCollection should have comment or be unexported (golint)
    • Line 217: 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)
    • collection/string_array_collection.go
    • Line 10: warning: exported type StringArrayCollection should have comment or be unexported (golint)
    • Line 324: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 327: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 362: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 389: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 392: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 445: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 509: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 610: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • collection/base_collection.go
    • Line 8: warning: exported type BaseCollection should have comment or be unexported (golint)
    • Line 13: warning: exported method BaseCollection.Value should have comment or be unexported (golint)
    • Line 304: warning: exported method BaseCollection.Nth should have comment or be unexported (golint)
    • Line 379: warning: comment on exported method BaseCollection.Split should be of the form "Split ..." (golint)
    • Line 384: warning: comment on exported method BaseCollection.Splice should be of the form "Splice ..." (golint)
    • Line 418: warning: comment on exported method BaseCollection.ToMultiDimensionalArray should be of the form "ToMultiDimensionalArray ..." (golint)
    • collection/number_array_collection.go
    • Line 11: warning: exported type NumberArrayCollection should have comment or be unexported (golint)
    • Line 367: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 370: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 389: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 416: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 419: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 473: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 537: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 639: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • collection/collection_test.go
    • Line 820: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 832: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • collection/muti_dimensional_array_collection.go
    • Line 5: warning: exported type MultiDimensionalArrayCollection should have comment or be unexported (golint)
    • Line 10: warning: exported method MultiDimensionalArrayCollection.Value should have comment or be unexported (golint)
    • Line 14: warning: exported method MultiDimensionalArrayCollection.ToMultiDimensionalArray 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!