Preparing report...

Report for github.com/h2non/filetype

A+    Excellent!    Found 9 issues across 22 files

Tweet

gofmt95%

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!


gocyclo90%

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.

    • filetype/matchers/video.go
    • Line 93: warning: cyclomatic complexity 117 of function Mp4() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 21 of function Mov() is high (> 15) (gocyclo)

golint59%

Golint is a linter for Go source code.

    • filetype/matchers/archive.go
    • Line 6: warning: exported const ZstdMagicSkippableStart should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported var TypeEpub should have comment or be unexported (golint)
    • Line 41: warning: exported var Archive should have comment or be unexported (golint)
    • Line 106: warning: exported function Zip should have comment or be unexported (golint)
    • Line 113: warning: exported function Tar should have comment or be unexported (golint)
    • Line 120: warning: exported function Rar should have comment or be unexported (golint)
    • Line 127: warning: exported function Swf should have comment or be unexported (golint)
    • Line 133: warning: exported function Cab should have comment or be unexported (golint)
    • Line 139: warning: exported function Eot should have comment or be unexported (golint)
    • Line 149: warning: exported function Z should have comment or be unexported (golint)
    • Line 155: warning: exported function Rpm should have comment or be unexported (golint)
    • Line 161: warning: exported function Elf should have comment or be unexported (golint)
    • Line 167: warning: exported function Dcm should have comment or be unexported (golint)
    • Line 173: warning: exported function Iso should have comment or be unexported (golint)
    • Line 180: warning: exported function MachO should have comment or be unexported (golint)
    • Line 190: warning: comment on exported function Zst should be of the form "Zst ..." (golint)
    • Line 196: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • filetype/matchers/document.go
    • Line 9: warning: exported var TypeDoc should have comment or be unexported (golint)
    • Line 17: warning: exported var Document should have comment or be unexported (golint)
    • Line 29: warning: exported const TYPE_DOC should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: comment on exported function Doc should be of the form "Doc ..." (golint)
    • Line 44: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 51: warning: exported function Docx should have comment or be unexported (golint)
    • Line 56: warning: exported function Xls should have comment or be unexported (golint)
    • Line 61: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 68: warning: exported function Xlsx should have comment or be unexported (golint)
    • Line 73: warning: exported function Ppt should have comment or be unexported (golint)
    • Line 78: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 85: warning: exported function Pptx should have comment or be unexported (golint)
    • Line 144: 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)
    • filetype/matchers/font.go
    • Line 4: warning: exported var TypeWoff should have comment or be unexported (golint)
    • Line 10: warning: exported var Font should have comment or be unexported (golint)
    • Line 17: warning: exported function Woff should have comment or be unexported (golint)
    • Line 25: warning: exported function Woff2 should have comment or be unexported (golint)
    • Line 33: warning: exported function Ttf should have comment or be unexported (golint)
    • Line 40: warning: exported function Otf should have comment or be unexported (golint)
    • filetype/matchers/matchers.go
    • Line 13: warning: comment on exported type Map should be of the form "Map ..." (with optional leading article) (golint)
    • Line 16: warning: comment on exported type TypeMatcher should be of the form "TypeMatcher ..." (with optional leading article) (golint)
    • Line 19: warning: comment on exported var Matchers should be of the form "Matchers ..." (golint)
    • Line 21: warning: exported var MatcherKeys should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function NewMatcher should be of the form "NewMatcher ..." (golint)
    • filetype/matchers/video.go
    • Line 6: warning: exported var TypeMp4 should have comment or be unexported (golint)
    • Line 18: warning: exported var Video should have comment or be unexported (golint)
    • Line 31: warning: exported function M4v should have comment or be unexported (golint)
    • Line 39: warning: exported function Mkv should have comment or be unexported (golint)
    • Line 46: warning: exported function Webm should have comment or be unexported (golint)
    • Line 53: warning: exported function Mov should have comment or be unexported (golint)
    • Line 63: warning: exported function Avi should have comment or be unexported (golint)
    • Line 71: warning: exported function Wmv should have comment or be unexported (golint)
    • Line 80: warning: exported function Mpeg should have comment or be unexported (golint)
    • Line 87: warning: exported function Flv should have comment or be unexported (golint)
    • Line 93: warning: exported function Mp4 should have comment or be unexported (golint)
    • Line 126: warning: exported function Match3gp should have comment or be unexported (golint)
    • filetype/matchers/audio.go
    • Line 4: warning: exported var TypeMidi should have comment or be unexported (golint)
    • Line 15: warning: exported var Audio should have comment or be unexported (golint)
    • Line 27: warning: exported function Midi should have comment or be unexported (golint)
    • Line 33: warning: exported function Mp3 should have comment or be unexported (golint)
    • Line 39: warning: exported function M4a should have comment or be unexported (golint)
    • Line 46: warning: exported function Ogg should have comment or be unexported (golint)
    • Line 52: warning: exported function Flac should have comment or be unexported (golint)
    • Line 58: warning: exported function Wav should have comment or be unexported (golint)
    • Line 66: warning: exported function Amr should have comment or be unexported (golint)
    • Line 73: warning: exported function Aac should have comment or be unexported (golint)
    • Line 79: warning: exported function Aiff should have comment or be unexported (golint)
    • filetype/matchers/image.go
    • Line 6: warning: exported var TypeJpeg should have comment or be unexported (golint)
    • Line 21: warning: exported var Image should have comment or be unexported (golint)
    • Line 37: warning: exported function Jpeg should have comment or be unexported (golint)
    • Line 44: warning: exported function Jpeg2000 should have comment or be unexported (golint)
    • Line 61: warning: exported function Png should have comment or be unexported (golint)
    • Line 67: warning: exported function Gif should have comment or be unexported (golint)
    • Line 72: warning: exported function Webp should have comment or be unexported (golint)
    • Line 78: warning: exported function CR2 should have comment or be unexported (golint)
    • Line 86: warning: exported function Tiff should have comment or be unexported (golint)
    • Line 93: warning: exported function Bmp should have comment or be unexported (golint)
    • Line 99: warning: exported function Jxr should have comment or be unexported (golint)
    • Line 106: warning: exported function Psd should have comment or be unexported (golint)
    • Line 112: warning: exported function Ico should have comment or be unexported (golint)
    • Line 118: warning: exported function Heif should have comment or be unexported (golint)
    • Line 139: warning: exported function Dwg 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!