Preparing report...

Report for github.com/mholt/caddy

A+    Excellent!    Found 52 issues across 203 files

Tweet

gofmt96%

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!


gocyclo77%

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.

    • caddy/caddyhttp/httpserver/plugin.go
    • Line 232: warning: cyclomatic complexity 24 of function (*httpContext).MakeServers() is high (> 15) (gocyclo)
    • Line 129: warning: cyclomatic complexity 24 of function (*httpContext).InspectServerBlocks() is high (> 15) (gocyclo)
    • Line 506: warning: cyclomatic complexity 16 of function standardizeAddress() is high (> 15) (gocyclo)
    • caddy/caddytls/config.go
    • Line 329: warning: cyclomatic complexity 20 of function assertConfigsCompatible() is high (> 15) (gocyclo)
    • Line 156: warning: cyclomatic complexity 17 of function (*Config).buildStandardTLSConfig() is high (> 15) (gocyclo)
    • caddy/caddytls/setup.go
    • Line 53: warning: cyclomatic complexity 84 of function setupTLS() is high (> 15) (gocyclo)
    • Line 389: warning: cyclomatic complexity 22 of function loadCertsInDir() is high (> 15) (gocyclo)
    • caddy/caddyhttp/httpserver/mitm.go
    • Line 237: warning: cyclomatic complexity 23 of function parseRawClientHello() is high (> 15) (gocyclo)
    • Line 54: warning: cyclomatic complexity 20 of function (*tlsHandler).ServeHTTP() is high (> 15) (gocyclo)
    • caddy/caddy.go
    • Line 691: warning: cyclomatic complexity 31 of function startServers() is high (> 15) (gocyclo)
    • Line 488: warning: cyclomatic complexity 21 of function startWithListenerFds() is high (> 15) (gocyclo)
    • Line 184: warning: cyclomatic complexity 20 of function (*Instance).Restart() is high (> 15) (gocyclo)
    • caddy/caddyhttp/proxy/upstream.go
    • Line 337: warning: cyclomatic complexity 78 of function parseBlock() is high (> 15) (gocyclo)
    • Line 109: warning: cyclomatic complexity 23 of function NewStaticUpstreams() is high (> 15) (gocyclo)
    • Line 622: warning: cyclomatic complexity 17 of function (*staticUpstream).healthCheck() is high (> 15) (gocyclo)

golint96%

Golint is a linter for Go source code.

    • caddy/caddyhttp/log/setup.go
    • Line 74: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 87: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 168: warning: comment on exported const DefaultIP4Mask should be of the form "DefaultIP4Mask ..." (golint)
    • Line 171: warning: exported const DefaultIP6Mask should have comment (or a comment on this block) or be unexported (golint)
    • caddy/caddyhttp/httpserver/condition_test.go
    • Line 215: warning: don't use underscores in Go names; var rex_b should be rexB (golint)
    • Line 289: warning: don't use underscores in Go names; var test_if should be testIf (golint)
    • Line 303: warning: don't use underscores in Go names; range var if_c should be ifC (golint)
    • Line 304: warning: don't use underscores in Go names; var expected_c should be expectedC (golint)
    • caddy/caddyhttp/httpserver/replacer.go
    • Line 435: 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)
    • Line 444: 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)
    • Line 514: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!