Preparing report...

Report for github.com/yaproxy/yap

A    Great!    Found 15 issues across 18 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!


gocyclo72%

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.

    • yap/handler.go
    • Line 205: warning: cyclomatic complexity 39 of function (*HTTP2Handler).ServeHTTP() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 25 of function (*HTTPHandler).ServeHTTP() is high (> 15) (gocyclo)
    • yap/yaputil/tlsciphers.go
    • Line 7: warning: cyclomatic complexity 23 of function Cipher() is high (> 15) (gocyclo)
    • Line 57: warning: cyclomatic complexity 23 of function CipherName() is high (> 15) (gocyclo)
    • yap/yap.go
    • Line 98: warning: cyclomatic complexity 19 of function Main() is high (> 15) (gocyclo)
    • Line 304: warning: cyclomatic complexity 16 of function loadHTTP2Handler() is high (> 15) (gocyclo)
    • yap/cert.go
    • Line 29: warning: cyclomatic complexity 16 of function (*CertManager).Add() is high (> 15) (gocyclo)

golint27%

Golint is a linter for Go source code.

    • yap/yaputil/tlsciphers.go
    • Line 7: warning: exported function Cipher should have comment or be unexported (golint)
    • Line 57: warning: exported function CipherName should have comment or be unexported (golint)
    • Line 107: warning: exported function HasECCCiphers should have comment or be unexported (golint)
    • yap/yaputil/console_posix.go
    • Line 16: warning: exported function SetConsoleTitle should have comment or be unexported (golint)
    • Line 20: warning: exported function SetConsoleTextColorRed should have comment or be unexported (golint)
    • Line 25: warning: exported function SetConsoleTextColorYellow should have comment or be unexported (golint)
    • Line 30: warning: exported function SetConsoleTextColorGreen should have comment or be unexported (golint)
    • Line 35: warning: exported function SetConsoleTextColorReset should have comment or be unexported (golint)
    • yap/yaputil/dialer.go
    • Line 12: warning: exported const DefaultDNSCacheExpiry should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type Dialer should have comment or be unexported (golint)
    • Line 25: warning: exported method Dialer.Dial should have comment or be unexported (golint)
    • yap/yaputil/hostmatcher.go
    • Line 9: warning: exported type HostMatcher should have comment or be unexported (golint)
    • Line 50: warning: exported function NewHostMatcher should have comment or be unexported (golint)
    • Line 58: warning: exported function NewHostMatcherWithString should have comment or be unexported (golint)
    • Line 66: warning: exported function NewHostMatcherWithStrings should have comment or be unexported (golint)
    • Line 74: warning: exported function NewHostMatcherWithValue should have comment or be unexported (golint)
    • Line 84: warning: exported method HostMatcher.AddHost should have comment or be unexported (golint)
    • Line 88: warning: exported method HostMatcher.AddHostWithValue should have comment or be unexported (golint)
    • Line 92: warning: exported method HostMatcher.Match should have comment or be unexported (golint)
    • Line 97: warning: exported method HostMatcher.Lookup should have comment or be unexported (golint)
    • yap/yaputil/io.go
    • Line 10: warning: exported const BUFSZ should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported function IOCopy should have comment or be unexported (golint)
    • yap/yaputil/lookup.go
    • Line 13: warning: exported function LookupIP should have comment or be unexported (golint)
    • Line 17: warning: exported function GetLocalNameServers should have comment or be unexported (golint)
    • yap/yaputil/net.go
    • Line 8: warning: exported function LocalIPv4s should have comment or be unexported (golint)
    • Line 33: warning: exported function LocalPreferIPv4 should have comment or be unexported (golint)
    • yap/yaputil/resolver.go
    • Line 14: warning: exported type Resolver should have comment or be unexported (golint)
    • Line 23: warning: exported method Resolver.LookupHost should have comment or be unexported (golint)
    • Line 37: warning: exported method Resolver.LookupIP should have comment or be unexported (golint)
    • yap/cert.go
    • Line 18: warning: exported type CertManager should have comment or be unexported (golint)
    • Line 29: warning: exported method CertManager.Add should have comment or be unexported (golint)
    • Line 103: warning: exported method CertManager.HostPolicy should have comment or be unexported (golint)
    • Line 110: warning: exported method CertManager.GetCertificate should have comment or be unexported (golint)
    • Line 131: warning: exported method CertManager.GetConfigForClient should have comment or be unexported (golint)
    • yap/yaputil/algorithm.go
    • Line 7: warning: exported function ShuffleStrings should have comment or be unexported (golint)
    • Line 14: warning: exported function ShuffleStringsN should have comment or be unexported (golint)
    • Line 27: warning: exported function ShuffleInts should have comment or be unexported (golint)
    • Line 34: warning: exported function ShuffleUints should have comment or be unexported (golint)
    • Line 41: warning: exported function ShuffleUint16s should have comment or be unexported (golint)
    • Line 48: warning: exported function ContainsString should have comment or be unexported (golint)
    • Line 57: warning: exported function UniqueStrings should have comment or be unexported (golint)
    • yap/yaputil/dialer2.go
    • Line 17: warning: exported type MultiDialer should have comment or be unexported (golint)
    • Line 38: warning: exported method MultiDialer.ClearCache should have comment or be unexported (golint)
    • Line 44: warning: exported method MultiDialer.LookupAlias should have comment or be unexported (golint)
    • Line 87: warning: exported method MultiDialer.Dial should have comment or be unexported (golint)
    • Line 91: warning: exported method MultiDialer.DialTLS should have comment or be unexported (golint)
    • Line 95: warning: exported method MultiDialer.DialTLS2 should have comment or be unexported (golint)
    • Line 177: 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 306: warning: exported type MultiResolver should have comment or be unexported (golint)
    • Line 310: warning: exported method MultiResolver.LookupHost should have comment or be unexported (golint)
    • yap/yaputil/os.go
    • Line 9: warning: exported function SetFlagsIfAbsent should have comment or be unexported (golint)
    • yap/auth.go
    • Line 83: warning: exported type Authenticator should have comment or be unexported (golint)
    • Line 87: warning: exported type HtpasswdAuth should have comment or be unexported (golint)
    • Line 101: warning: exported method HtpasswdAuth.Authenticate should have comment or be unexported (golint)
    • Line 132: warning: exported type BuildInAuth should have comment or be unexported (golint)
    • Line 152: warning: exported method BuildInAuth.Authenticate should have comment or be unexported (golint)
    • Line 160: warning: exported type SimplePAM should have comment or be unexported (golint)
    • Line 186: warning: exported method SimplePAM.Authenticate 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!