Preparing report...

Report for github.com/astrogo/fitsio

A    Great!    Found 21 issues across 32 files

Tweet

gofmt93%

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!


gocyclo62%

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.

    • fitsio/decode.go
    • Line 218: warning: cyclomatic complexity 44 of function (*streamDecoder).loadTable() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 28 of function (*streamDecoder).DecodeHDU() is high (> 15) (gocyclo)
    • fitsio/image.go
    • Line 82: warning: cyclomatic complexity 42 of function (*imageHDU).Read() is high (> 15) (gocyclo)
    • Line 270: warning: cyclomatic complexity 34 of function (*imageHDU).Write() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 33 of function (*imageHDU).Image() is high (> 15) (gocyclo)
    • fitsio/table_test.go
    • Line 50: warning: cyclomatic complexity 39 of function TestTableNext() is high (> 15) (gocyclo)
    • Line 2003: warning: cyclomatic complexity 24 of function TestTableMapsRW() is high (> 15) (gocyclo)
    • Line 1824: warning: cyclomatic complexity 24 of function TestTableStructsRW() is high (> 15) (gocyclo)
    • Line 1090: warning: cyclomatic complexity 24 of function TestTableSliceRW() is high (> 15) (gocyclo)
    • Line 1456: warning: cyclomatic complexity 24 of function TestTableArrayRW() is high (> 15) (gocyclo)
    • Line 498: warning: cyclomatic complexity 24 of function TestTableBuiltinsRW() is high (> 15) (gocyclo)
    • Line 340: warning: cyclomatic complexity 20 of function TestTableScanMap() is high (> 15) (gocyclo)
    • Line 427: warning: cyclomatic complexity 16 of function TestTableScanStruct() is high (> 15) (gocyclo)
    • fitsio/column.go
    • Line 338: warning: cyclomatic complexity 57 of function (*Column).writeBin() is high (> 15) (gocyclo)
    • Line 49: warning: cyclomatic complexity 56 of function (*Column).readBin() is high (> 15) (gocyclo)
    • fitsio/utils.go
    • Line 265: warning: cyclomatic complexity 52 of function makeHeaderLine() is high (> 15) (gocyclo)
    • Line 76: warning: cyclomatic complexity 45 of function parseHeaderLine() is high (> 15) (gocyclo)
    • Line 531: warning: cyclomatic complexity 33 of function typeFromForm() is high (> 15) (gocyclo)
    • fitsio/image_test.go
    • Line 22: warning: cyclomatic complexity 36 of function TestImageRW() is high (> 15) (gocyclo)
    • Line 501: warning: cyclomatic complexity 25 of function TestImageImage() is high (> 15) (gocyclo)
    • Line 910: warning: cyclomatic complexity 20 of function benchImageWrite() is high (> 15) (gocyclo)
    • Line 793: warning: cyclomatic complexity 19 of function genImage() is high (> 15) (gocyclo)
    • fitsio/encode.go
    • Line 32: warning: cyclomatic complexity 20 of function (*streamEncoder).EncodeHDU() is high (> 15) (gocyclo)

golint59%

Golint is a linter for Go source code.

    • fitsio/reader.go
    • Line 9: warning: exported type Reader should have comment or be unexported (golint)
    • Line 13: warning: exported function NewReader should have comment or be unexported (golint)
    • fitsio/table.go
    • Line 12: warning: exported type Table should have comment or be unexported (golint)
    • Line 63: warning: exported method Table.NumRows should have comment or be unexported (golint)
    • Line 67: warning: exported method Table.NumCols should have comment or be unexported (golint)
    • Line 71: warning: exported method Table.Cols should have comment or be unexported (golint)
    • Line 75: warning: exported method Table.Col should have comment or be unexported (golint)
    • fitsio/utils.go
    • Line 765: warning: don't use underscores in Go names; var g_gotype2FITS should be gGotype2FITS (golint)
    • Line 863: warning: don't use underscores in Go names; var g_fits2go should be gFits2go (golint)
    • Line 887: warning: don't use underscores in Go names; var g_fits2tc should be gFits2tc (golint)
    • fitsio/fltimg/image.go
    • Line 5: warning: package comment should be of the form "Package fltimg ..." (golint)
    • Line 77: warning: exported method Gray32.ColorModel should have comment or be unexported (golint)
    • Line 78: warning: exported method Gray32.Bounds should have comment or be unexported (golint)
    • Line 79: warning: exported method Gray32.At should have comment or be unexported (golint)
    • Line 92: warning: exported method Gray32.Set should have comment or be unexported (golint)
    • Line 99: warning: exported method Gray32.PixOffset should have comment or be unexported (golint)
    • Line 162: warning: exported method Gray64.ColorModel should have comment or be unexported (golint)
    • Line 163: warning: exported method Gray64.Bounds should have comment or be unexported (golint)
    • Line 164: warning: exported method Gray64.At should have comment or be unexported (golint)
    • Line 177: warning: exported method Gray64.Set should have comment or be unexported (golint)
    • Line 184: warning: exported method Gray64.PixOffset should have comment or be unexported (golint)
    • fitsio/data_test.go
    • Line 8: warning: don't use underscores in Go names; var g_data_gross should be gDataGross (golint)
    • Line 137: warning: don't use underscores in Go names; var g_data_back should be gDataBack (golint)
    • Line 234: warning: don't use underscores in Go names; var g_data_net should be gDataNet (golint)
    • Line 363: warning: don't use underscores in Go names; var g_data_abnet should be gDataAbnet (golint)
    • Line 492: warning: don't use underscores in Go names; var g_data_epsilons should be gDataEpsilons (golint)
    • fitsio/doc.go
    • Line 5: warning: package comment should be of the form "Package fitsio ..." (golint)
    • fitsio/decode.go
    • Line 16: warning: exported type Decoder should have comment or be unexported (golint)
    • Line 42: warning: don't use underscores in Go names; var get_card should be getCard (golint)
    • Line 50: warning: don't use underscores in Go names; var add_card should be addCard (golint)
    • Line 291: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • fitsio/file.go
    • Line 17: warning: exported const ReadOnly should have comment (or a comment on this block) or be unexported (golint)
    • fitsio/file_test.go
    • Line 76: warning: don't use underscores in Go names; var txt_ref should be txtRef (golint)
    • Line 129: warning: don't use underscores in Go names; var txt_ref should be txtRef (golint)
    • fitsio/hdu.go
    • Line 15: warning: exported const IMAGE_HDU should have comment (or a comment on this block) or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign87%

IneffAssign detects ineffectual assignments in Go code.

    • fitsio/utils.go
    • Line 374: warning: ineffectual assignment to n (ineffassign)
    • Line 389: warning: ineffectual assignment to n (ineffassign)
    • Line 506: warning: ineffectual assignment to max (ineffassign)
    • Line 642: warning: ineffectual assignment to repeat (ineffassign)

misspell96%

Misspell Finds commonly misspelled English words