Preparing report...

Report for github.com/svent/sift

C    Needs some work    Found 6 issues across 8 files

Tweet

gofmt37%

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!


gocyclo50%

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.

    • sift/sift.go
    • Line 188: warning: cyclomatic complexity 61 of function processDirectory() is high (> 15) (gocyclo)
    • Line 576: warning: cyclomatic complexity 29 of function main() is high (> 15) (gocyclo)
    • sift/matching.go
    • Line 28: warning: cyclomatic complexity 51 of function processReader() is high (> 15) (gocyclo)
    • Line 247: warning: cyclomatic complexity 45 of function getMatches() is high (> 15) (gocyclo)
    • Line 427: warning: cyclomatic complexity 37 of function (*Result).applyConditions() is high (> 15) (gocyclo)
    • sift/options.go
    • Line 627: warning: cyclomatic complexity 43 of function (*Options).checkCompatibility() is high (> 15) (gocyclo)
    • Line 398: warning: cyclomatic complexity 28 of function (*Options).checkFormats() is high (> 15) (gocyclo)
    • Line 520: warning: cyclomatic complexity 27 of function (*Options).processConditions() is high (> 15) (gocyclo)
    • Line 755: warning: cyclomatic complexity 26 of function (*Options).performAutoDetections() is high (> 15) (gocyclo)
    • sift/output.go
    • Line 233: warning: cyclomatic complexity 41 of function printResult() is high (> 15) (gocyclo)
    • Line 77: warning: cyclomatic complexity 29 of function printMatch() is high (> 15) (gocyclo)

golint62%

Golint is a linter for Go source code.

    • sift/gitignore/gitignore.go
    • Line 40: warning: exported const GitIgnoreFilename should have comment (or a comment on this block) or be unexported (golint)
    • Line 198: warning: receiver name c should be consistent with previous receiver name gi for gitIgnore (golint)
    • Line 219: warning: receiver name c should be consistent with previous receiver name gi for gitIgnore (golint)
    • Line 351: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 390: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • sift/sift.go
    • Line 52: warning: exported const SiftConfigFile should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type ConditionType should have comment or be unexported (golint)
    • Line 59: warning: exported const ConditionPreceded should have comment (or a comment on this block) or be unexported (golint)
    • Line 67: warning: exported type Condition should have comment or be unexported (golint)
    • Line 76: warning: exported type FileType should have comment or be unexported (golint)
    • Line 81: warning: exported type Match should have comment or be unexported (golint)
    • Line 104: warning: exported type Matches should have comment or be unexported (golint)
    • Line 110: warning: exported type Result should have comment or be unexported (golint)
    • Line 122: warning: exported var InputBlockSize should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign75%

IneffAssign detects ineffectual assignments in Go code.

    • sift/matching.go
    • Line 289: warning: ineffectual assignment to start (ineffassign)
    • Line 290: warning: ineffectual assignment to end (ineffassign)
    • Line 475: warning: ineffectual assignment to conditionFulfilled (ineffassign)
    • Line 477: warning: ineffectual assignment to actualDistance (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!