Preparing report...

Report for github.com/klauspost/compress

A+    Excellent!    Found 69 issues across 125 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!


golint91%

Golint is a linter for Go source code.

    • compress/zstd/framedec.go
    • Line 53: warning: comment on exported const MinWindowSize should be of the form "MinWindowSize ..." (golint)
    • Line 55: warning: exported const MaxWindowSize should have comment (or a comment on this block) or be unexported (golint)
    • compress/huff0/huff0.go
    • Line 43: warning: exported type ReusePolicy should have comment or be unexported (golint)
    • Line 63: warning: exported type Scratch should have comment or be unexported (golint)
    • compress/gzip/gunzip.go
    • Line 48: warning: comment on exported type Header should be of the form "Header ..." (with optional leading article) (golint)
    • Line 286: warning: comment on exported method Reader.WriteTo should be of the form "WriteTo ..." (golint)
    • compress/zip/reader.go
    • Line 20: warning: exported var ErrFormat should have comment or be unexported (golint)
    • Line 25: warning: exported type Reader should have comment or be unexported (golint)
    • Line 32: warning: exported type ReadCloser should have comment or be unexported (golint)
    • Line 37: warning: exported type File should have comment or be unexported (golint)
    • compress/zip/struct.go
    • Line 266: warning: don't use underscores in Go names; const s_IFMT should be sIFMT (golint)
    • Line 267: warning: don't use underscores in Go names; const s_IFSOCK should be sIFSOCK (golint)
    • Line 268: warning: don't use underscores in Go names; const s_IFLNK should be sIFLNK (golint)
    • Line 269: warning: don't use underscores in Go names; const s_IFREG should be sIFREG (golint)
    • Line 270: warning: don't use underscores in Go names; const s_IFBLK should be sIFBLK (golint)
    • Line 271: warning: don't use underscores in Go names; const s_IFDIR should be sIFDIR (golint)
    • Line 272: warning: don't use underscores in Go names; const s_IFCHR should be sIFCHR (golint)
    • Line 273: warning: don't use underscores in Go names; const s_IFIFO should be sIFIFO (golint)
    • Line 274: warning: don't use underscores in Go names; const s_ISUID should be sISUID (golint)
    • Line 275: warning: don't use underscores in Go names; const s_ISGID should be sISGID (golint)
    • Line 276: warning: don't use underscores in Go names; const s_ISVTX should be sISVTX (golint)

gocyclo49%

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.

    • compress/huff0/compress_test.go
    • Line 92: warning: cyclomatic complexity 40 of function TestCompressRegression() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 22 of function TestCompress1XMustReuse() is high (> 15) (gocyclo)
    • compress/zstd/snappy.go
    • Line 82: warning: cyclomatic complexity 41 of function (*SnappyConverter).Convert() is high (> 15) (gocyclo)
    • Line 287: warning: cyclomatic complexity 23 of function decodeSnappy() is high (> 15) (gocyclo)
    • compress/zstd/encoder.go
    • Line 436: warning: cyclomatic complexity 32 of function (*Encoder).EncodeAll() is high (> 15) (gocyclo)
    • Line 167: warning: cyclomatic complexity 26 of function (*Encoder).nextBlock() is high (> 15) (gocyclo)
    • compress/zstd/enc_better.go
    • Line 54: warning: cyclomatic complexity 118 of function (*betterFastEncoder).Encode() is high (> 15) (gocyclo)
    • Line 570: warning: cyclomatic complexity 117 of function (*betterFastEncoderDict).Encode() is high (> 15) (gocyclo)
    • Line 1101: warning: cyclomatic complexity 27 of function (*betterFastEncoderDict).Reset() is high (> 15) (gocyclo)
    • compress/zstd/fse_encoder.go
    • Line 504: warning: cyclomatic complexity 19 of function (*fseEncoder).writeCount() is high (> 15) (gocyclo)
    • Line 350: warning: cyclomatic complexity 18 of function (*fseEncoder).normalizeCount2() is high (> 15) (gocyclo)
    • Line 118: warning: cyclomatic complexity 16 of function (*fseEncoder).buildCTable() is high (> 15) (gocyclo)
    • compress/zstd/dict_test.go
    • Line 74: warning: cyclomatic complexity 34 of function TestEncoder_SmallDict() is high (> 15) (gocyclo)
    • Line 221: warning: cyclomatic complexity 22 of function benchmarkEncodeAllLimitedBySize() is high (> 15) (gocyclo)
    • Line 346: warning: cyclomatic complexity 16 of function TestDecoder_MoreDicts() is high (> 15) (gocyclo)
    • compress/huff0/decompress_test.go
    • Line 188: warning: cyclomatic complexity 23 of function TestRoundtrip1XFuzz() is high (> 15) (gocyclo)
    • Line 279: warning: cyclomatic complexity 23 of function TestRoundtrip4XFuzz() is high (> 15) (gocyclo)
    • Line 8: warning: cyclomatic complexity 21 of function TestDecompress1X() is high (> 15) (gocyclo)
    • Line 98: warning: cyclomatic complexity 21 of function TestDecompress4X() is high (> 15) (gocyclo)
    • compress/zstd/decoder_test.go
    • Line 435: warning: cyclomatic complexity 39 of function TestDecoderRegression() is high (> 15) (gocyclo)
    • Line 34: warning: cyclomatic complexity 25 of function TestNewReaderMismatch() is high (> 15) (gocyclo)
    • Line 802: warning: cyclomatic complexity 17 of function testDecoderFile() is high (> 15) (gocyclo)
    • Line 1257: warning: cyclomatic complexity 16 of function testDecoderDecodeAll() is high (> 15) (gocyclo)
    • Line 730: warning: cyclomatic complexity 16 of function TestDecoderMultiFrameReset() is high (> 15) (gocyclo)
    • compress/zstd/encoder_test.go
    • Line 492: warning: cyclomatic complexity 21 of function testEncoderRoundtrip() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 20 of function TestWithEncoderPadding() is high (> 15) (gocyclo)
    • Line 594: warning: cyclomatic complexity 20 of function testEncoderRoundtripWriter() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 16 of function TestEncoderRegression() is high (> 15) (gocyclo)
    • compress/zstd/decoder.go
    • Line 288: warning: cyclomatic complexity 19 of function (*Decoder).DecodeAll() is high (> 15) (gocyclo)
    • Line 481: warning: cyclomatic complexity 18 of function (*Decoder).startStreamDecoder() is high (> 15) (gocyclo)
    • compress/huff0/compress.go
    • Line 42: warning: cyclomatic complexity 29 of function compress() is high (> 15) (gocyclo)
    • Line 541: warning: cyclomatic complexity 20 of function (*Scratch).setMaxHeight() is high (> 15) (gocyclo)
    • compress/s2/decode.go
    • Line 363: warning: cyclomatic complexity 37 of function (*Reader).Skip() is high (> 15) (gocyclo)
    • Line 222: warning: cyclomatic complexity 32 of function (*Reader).Read() is high (> 15) (gocyclo)
    • compress/flate/inflate.go
    • Line 575: warning: cyclomatic complexity 44 of function (*decompressor).huffmanBlockGeneric() is high (> 15) (gocyclo)
    • Line 127: warning: cyclomatic complexity 41 of function (*huffmanDecoder).init() is high (> 15) (gocyclo)
    • Line 436: warning: cyclomatic complexity 33 of function (*decompressor).readHuffman() is high (> 15) (gocyclo)
    • compress/zstd/enc_dfast.go
    • Line 691: warning: cyclomatic complexity 69 of function (*doubleFastEncoderDict).Encode() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 68 of function (*doubleFastEncoder).Encode() is high (> 15) (gocyclo)
    • Line 379: warning: cyclomatic complexity 55 of function (*doubleFastEncoder).EncodeNoHist() is high (> 15) (gocyclo)
    • compress/zip/writer.go
    • Line 81: warning: cyclomatic complexity 21 of function (*Writer).Close() is high (> 15) (gocyclo)
    • Line 279: warning: cyclomatic complexity 16 of function (*Writer).CreateHeader() is high (> 15) (gocyclo)
    • compress/fse/compress.go
    • Line 561: warning: cyclomatic complexity 18 of function (*Scratch).normalizeCount2() is high (> 15) (gocyclo)
    • Line 351: warning: cyclomatic complexity 16 of function (*Scratch).buildCTable() is high (> 15) (gocyclo)
    • compress/zstd/framedec.go
    • Line 78: warning: cyclomatic complexity 50 of function (*frameDec).reset() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 19 of function (*frameDec).startDecoder() is high (> 15) (gocyclo)
    • compress/flate/writer_test.go
    • Line 68: warning: cyclomatic complexity 21 of function TestWriterRegression() is high (> 15) (gocyclo)
    • Line 323: warning: cyclomatic complexity 17 of function TestWriter_Reset() is high (> 15) (gocyclo)
    • compress/huff0/decompress.go
    • Line 490: warning: cyclomatic complexity 28 of function (*Decoder).Decompress4X() is high (> 15) (gocyclo)
    • Line 680: warning: cyclomatic complexity 25 of function (*Decoder).decompress4X8bit() is high (> 15) (gocyclo)
    • Line 892: warning: cyclomatic complexity 24 of function (*Decoder).decompress4X8bitExactly() is high (> 15) (gocyclo)
    • Line 36: warning: cyclomatic complexity 22 of function ReadTable() is high (> 15) (gocyclo)
    • Line 1098: warning: cyclomatic complexity 17 of function (*Scratch).matches() is high (> 15) (gocyclo)
    • compress/s2/s2_test.go
    • Line 1505: warning: cyclomatic complexity 31 of function benchFile() is high (> 15) (gocyclo)
    • Line 1660: warning: cyclomatic complexity 22 of function benchFileSnappy() is high (> 15) (gocyclo)
    • Line 493: warning: cyclomatic complexity 18 of function TestDecodeLengthOffset() is high (> 15) (gocyclo)
    • Line 655: warning: cyclomatic complexity 16 of function TestEncoderSkip() is high (> 15) (gocyclo)
    • compress/zstd/enc_fast.go
    • Line 629: warning: cyclomatic complexity 67 of function (*fastEncoderDict).Encode() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 65 of function (*fastEncoder).Encode() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 60 of function (*fastEncoder).EncodeNoHist() is high (> 15) (gocyclo)
    • compress/zip/reader.go
    • Line 263: warning: cyclomatic complexity 34 of function readDirectoryHeader() is high (> 15) (gocyclo)
    • Line 473: warning: cyclomatic complexity 17 of function readDirectoryEnd() is high (> 15) (gocyclo)
    • compress/flate/huffman_bit_writer.go
    • Line 743: warning: cyclomatic complexity 26 of function (*huffmanBitWriter).writeTokens() is high (> 15) (gocyclo)
    • Line 911: warning: cyclomatic complexity 24 of function (*huffmanBitWriter).writeBlockHuff() is high (> 15) (gocyclo)
    • Line 620: warning: cyclomatic complexity 16 of function (*huffmanBitWriter).writeBlockDynamic() is high (> 15) (gocyclo)
    • compress/zstd/blockdec.go
    • Line 317: warning: cyclomatic complexity 98 of function (*blockDec).decodeCompressed() is high (> 15) (gocyclo)
    • Line 124: warning: cyclomatic complexity 19 of function (*blockDec).reset() is high (> 15) (gocyclo)
    • compress/zstd/blockenc.go
    • Line 471: warning: cyclomatic complexity 59 of function (*blockEnc).encode() is high (> 15) (gocyclo)
    • Line 799: warning: cyclomatic complexity 20 of function (*blockEnc).genCodes() is high (> 15) (gocyclo)
    • Line 335: warning: cyclomatic complexity 18 of function (*blockEnc).encodeLits() is high (> 15) (gocyclo)

ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words

    • compress/zstd/enc_dfast.go
    • Line 142: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 144: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 170: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 174: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 802: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 804: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 830: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 834: warning: "lenght" is a misspelling of "length" (misspell)
    • compress/zstd/enc_better.go
    • Line 172: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 174: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 203: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 208: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 234: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 236: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 264: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 268: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 692: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 694: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 723: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 728: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 757: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 759: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 787: warning: "lenght" is a misspelling of "length" (misspell)
    • Line 791: warning: "lenght" is a misspelling of "length" (misspell)