Preparing report...

Report for github.com/arvancloud/redins

A    Great!    Found 15 issues across 21 files

Tweet

gofmt80%

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!


golint47%

Golint is a linter for Go source code.

    • redins/redins.go
    • Line 38: warning: exported type RedinsConfig should have comment or be unexported (golint)
    • Line 45: warning: exported function LoadConfig should have comment or be unexported (golint)
    • Line 167: warning: exported function Start should have comment or be unexported (golint)
    • Line 190: warning: exported function Stop should have comment or be unexported (golint)
    • redins/handler/dnssec.go
    • Line 13: warning: exported var NSecTypes should have comment or be unexported (golint)
    • Line 46: warning: exported function Sign should have comment or be unexported (golint)
    • Line 94: warning: exported function NSec should have comment or be unexported (golint)
    • redins/handler/geoip.go
    • Line 11: warning: exported type GeoIp should have comment or be unexported (golint)
    • Line 17: warning: exported type GeoIpConfig should have comment or be unexported (golint)
    • Line 23: warning: exported function NewGeoIp should have comment or be unexported (golint)
    • Line 42: warning: exported method GeoIp.GetSameCountry should have comment or be unexported (golint)
    • Line 87: warning: exported method GeoIp.GetSameASN should have comment or be unexported (golint)
    • Line 132: warning: exported method GeoIp.GetMinimumDistance should have comment or be unexported (golint)
    • Line 182: warning: exported method GeoIp.GetGeoLocation should have comment or be unexported (golint)
    • Line 206: warning: exported method GeoIp.GetASN should have comment or be unexported (golint)
    • redins/handler/handler.go
    • Line 19: warning: exported type DnsRequestHandler should have comment or be unexported (golint)
    • Line 35: warning: exported type HandlerConfig should have comment or be unexported (golint)
    • Line 48: warning: exported function NewHandler should have comment or be unexported (golint)
    • Line 93: warning: exported method DnsRequestHandler.ShutDown should have comment or be unexported (golint)
    • Line 102: warning: exported method DnsRequestHandler.HandleRequest should have comment or be unexported (golint)
    • Line 303: warning: exported method DnsRequestHandler.Filter should have comment or be unexported (golint)
    • Line 352: warning: exported method DnsRequestHandler.LogRequest should have comment or be unexported (golint)
    • Line 359: warning: exported function GetSourceIp should have comment or be unexported (golint)
    • Line 372: warning: exported function GetSourceSubnet should have comment or be unexported (golint)
    • Line 394: warning: exported method DnsRequestHandler.LoadZones should have comment or be unexported (golint)
    • Line 407: warning: exported method DnsRequestHandler.FetchRecord should have comment or be unexported (golint)
    • Line 413: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 423: warning: exported method DnsRequestHandler.A should have comment or be unexported (golint)
    • Line 437: warning: exported method DnsRequestHandler.AAAA should have comment or be unexported (golint)
    • Line 451: warning: exported method DnsRequestHandler.CNAME should have comment or be unexported (golint)
    • Line 463: warning: exported method DnsRequestHandler.TXT should have comment or be unexported (golint)
    • Line 477: warning: exported method DnsRequestHandler.NS should have comment or be unexported (golint)
    • Line 491: warning: exported method DnsRequestHandler.MX should have comment or be unexported (golint)
    • Line 506: warning: exported method DnsRequestHandler.SRV should have comment or be unexported (golint)
    • Line 523: warning: exported method DnsRequestHandler.CAA should have comment or be unexported (golint)
    • Line 536: warning: exported method DnsRequestHandler.PTR should have comment or be unexported (golint)
    • Line 548: warning: exported method DnsRequestHandler.TLSA should have comment or be unexported (golint)
    • Line 601: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 665: warning: exported method DnsRequestHandler.Matches should have comment or be unexported (golint)
    • Line 673: warning: exported method DnsRequestHandler.GetRecord should have comment or be unexported (golint)
    • Line 734: warning: exported method DnsRequestHandler.LoadZone should have comment or be unexported (golint)
    • Line 821: warning: exported method DnsRequestHandler.LoadLocation should have comment or be unexported (golint)
    • Line 858: warning: exported method DnsRequestHandler.SetLocation should have comment or be unexported (golint)
    • Line 873: warning: exported function ChooseIp should have comment or be unexported (golint)
    • Line 905: warning: exported method DnsRequestHandler.FindCAA should have comment or be unexported (golint)
    • redins/handler/upstream.go
    • Line 12: warning: exported type UpstreamConnection should have comment or be unexported (golint)
    • Line 17: warning: exported type Upstream should have comment or be unexported (golint)
    • Line 22: warning: exported type UpstreamConfig should have comment or be unexported (golint)
    • Line 29: warning: exported function NewUpstream should have comment or be unexported (golint)
    • Line 49: warning: exported method Upstream.Query should have comment or be unexported (golint)
    • redins/handler/dns_types.go
    • Line 11: warning: exported type RRSets should have comment or be unexported (golint)
    • Line 25: warning: exported type Record should have comment or be unexported (golint)
    • Line 31: warning: exported type ZoneKey should have comment or be unexported (golint)
    • Line 38: warning: exported type ZoneConfig should have comment or be unexported (golint)
    • Line 45: warning: exported type Zone should have comment or be unexported (golint)
    • Line 54: warning: don't use underscores in Go names; type IP_RRSet should be IPRRSet (golint)
    • Line 54: warning: exported type IP_RRSet should have comment or be unexported (golint)
    • Line 61: warning: exported type IP_RR should have comment or be unexported (golint)
    • Line 75: warning: exported method IP_RR.UnmarshalJSON should have comment or be unexported (golint)
    • Line 76: warning: don't use underscores in Go names; var _ip_rr should be _ipRr (golint)
    • Line 120: warning: exported type IpHealthCheckConfig should have comment or be unexported (golint)
    • Line 130: warning: exported type IpFilterConfig should have comment or be unexported (golint)
    • Line 136: warning: don't use underscores in Go names; type CNAME_RRSet should be CNAMERRSet (golint)
    • Line 136: warning: exported type CNAME_RRSet should have comment or be unexported (golint)
    • Line 141: warning: don't use underscores in Go names; type TXT_RRSet should be TXTRRSet (golint)
    • Line 141: warning: exported type TXT_RRSet should have comment or be unexported (golint)
    • Line 146: warning: exported type TXT_RR should have comment or be unexported (golint)
    • Line 150: warning: don't use underscores in Go names; type NS_RRSet should be NSRRSet (golint)
    • Line 150: warning: exported type NS_RRSet should have comment or be unexported (golint)
    • Line 155: warning: exported type NS_RR should have comment or be unexported (golint)
    • Line 159: warning: don't use underscores in Go names; type MX_RRSet should be MXRRSet (golint)
    • Line 159: warning: exported type MX_RRSet should have comment or be unexported (golint)
    • Line 164: warning: exported type MX_RR should have comment or be unexported (golint)
    • Line 169: warning: don't use underscores in Go names; type SRV_RRSet should be SRVRRSet (golint)
    • Line 169: warning: exported type SRV_RRSet should have comment or be unexported (golint)
    • Line 174: warning: exported type SRV_RR should have comment or be unexported (golint)
    • Line 181: warning: don't use underscores in Go names; type CAA_RRSet should be CAARRSet (golint)
    • Line 181: warning: exported type CAA_RRSet should have comment or be unexported (golint)
    • Line 186: warning: exported type CAA_RR should have comment or be unexported (golint)
    • Line 192: warning: don't use underscores in Go names; type PTR_RRSet should be PTRRRSet (golint)
    • Line 192: warning: exported type PTR_RRSet should have comment or be unexported (golint)
    • Line 197: warning: don't use underscores in Go names; type TLSA_RRSet should be TLSARRSet (golint)
    • Line 197: warning: exported type TLSA_RRSet should have comment or be unexported (golint)
    • Line 202: warning: exported type TLSA_RR should have comment or be unexported (golint)
    • Line 209: warning: don't use underscores in Go names; type SOA_RRSet should be SOARRSet (golint)
    • Line 209: warning: exported type SOA_RRSet should have comment or be unexported (golint)
    • Line 221: warning: don't use underscores in Go names; type ANAME_Record should be ANAMERecord (golint)
    • Line 221: warning: exported type ANAME_Record should have comment or be unexported (golint)
    • redins/handler/healthcheck.go
    • Line 23: warning: exported type HealthCheckItem should have comment or be unexported (golint)
    • Line 39: warning: exported type Healthcheck should have comment or be unexported (golint)
    • Line 55: warning: exported function HandleHealthCheck should have comment or be unexported (golint)
    • Line 162: warning: exported type HealthcheckConfig should have comment or be unexported (golint)
    • Line 172: warning: exported function NewHealthcheck should have comment or be unexported (golint)
    • Line 197: warning: exported method Healthcheck.ShutDown should have comment or be unexported (golint)
    • Line 276: warning: exported method Healthcheck.Start should have comment or be unexported (golint)
    • Line 349: warning: exported method Healthcheck.FilterHealthcheck should have comment or be unexported (golint)
    • Line 377: warning: exported method Healthcheck.Transfer should have comment or be unexported (golint)
    • redins/handler/limiter.go
    • Line 10: warning: exported type RateLimiter should have comment or be unexported (golint)
    • Line 19: warning: exported type RateLimiterConfig should have comment or be unexported (golint)
    • Line 27: warning: exported function NewRateLimiter should have comment or be unexported (golint)
    • Line 45: warning: exported type Limiter should have comment or be unexported (golint)
    • Line 51: warning: exported method RateLimiter.CanHandle should have comment or be unexported (golint)
    • redins/handler/server.go
    • Line 12: warning: exported type TlsConfig should have comment or be unexported (golint)
    • Line 19: warning: exported type ServerConfig should have comment or be unexported (golint)
    • Line 55: warning: exported function NewServer should have comment or be unexported (golint)

gocyclo66%

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.

    • redins/handler/handler.go
    • Line 102: warning: cyclomatic complexity 56 of function (*DnsRequestHandler).HandleRequest() is high (> 15) (gocyclo)
    • Line 303: warning: cyclomatic complexity 16 of function (*DnsRequestHandler).Filter() is high (> 15) (gocyclo)
    • redins/handler/handler_test.go
    • Line 636: warning: cyclomatic complexity 33 of function TestWeight() is high (> 15) (gocyclo)
    • Line 1371: warning: cyclomatic complexity 26 of function TestSingleFilter() is high (> 15) (gocyclo)
    • Line 1217: warning: cyclomatic complexity 26 of function TestMultiFilter() is high (> 15) (gocyclo)
    • Line 815: warning: cyclomatic complexity 22 of function TestWeightedANAME() is high (> 15) (gocyclo)

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!