Preparing report...

Report for github.com/plgd-dev/kit

A+    Excellent!    Found 41 issues across 96 files

Tweet

gofmt98%

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!


gocyclo95%

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.


golint62%

Golint is a linter for Go source code.

    • kit/net/coap/status/status.go
    • Line 12: warning: exported const OK should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported function CodeToString should have comment or be unexported (golint)
    • kit/security/certManager/acme/ocf/client/client.go
    • Line 13: warning: exported type Client should have comment or be unexported (golint)
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 23: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 38: warning: exported method Client.Certificate should have comment or be unexported (golint)
    • Line 42: warning: exported method Client.Challenge should have comment or be unexported (golint)
    • Line 46: warning: exported method Client.Registration should have comment or be unexported (golint)
    • kit/sync/map.go
    • Line 23: warning: exported method Map.DeleteWithFunc should have comment or be unexported (golint)
    • Line 39: warning: exported method Map.LoadWithFunc should have comment or be unexported (golint)
    • Line 55: warning: exported method Map.LoadOrStoreWithFunc should have comment or be unexported (golint)
    • Line 75: warning: exported method Map.ReplaceWithFunc should have comment or be unexported (golint)
    • Line 105: warning: exported method Map.StoreWithFunc should have comment or be unexported (golint)
    • Line 116: warning: exported method Map.PullOutWithFunc should have comment or be unexported (golint)
    • kit/security/generateCertificate/config.go
    • Line 1: warning: don't use MixedCaps in package name; generateCertificate should be generatecertificate (golint)
    • Line 14: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 40: warning: exported method Configuration.ToPkixName should have comment or be unexported (golint)
    • Line 51: warning: exported method Configuration.ToValidFrom should have comment or be unexported (golint)
    • Line 89: warning: exported method Configuration.X509KeyUsages should have comment or be unexported (golint)
    • Line 119: warning: exported method Configuration.AsnKeyUsages should have comment or be unexported (golint)
    • Line 138: warning: exported method Configuration.X509ExtKeyUsages should have comment or be unexported (golint)
    • Line 211: warning: exported function OidFromExtKeyUsage should have comment or be unexported (golint)
    • Line 220: warning: exported method Configuration.AsnExtensionKeyUsages should have comment or be unexported (golint)
    • Line 237: warning: exported method Configuration.ToIPAddresses should have comment or be unexported (golint)
    • kit/net/grpc/stub.go
    • Line 7: warning: exported function StubGrpcServer should have comment or be unexported (golint)
    • Line 17: warning: exported function StubGrpcClient should have comment or be unexported (golint)
    • kit/net/coap/auth.go
    • Line 13: warning: exported type Claims should have comment or be unexported (golint)
    • Line 14: warning: exported type ClaimsFunc should have comment or be unexported (golint)
    • Line 19: warning: exported function CtxWithToken should have comment or be unexported (golint)
    • Line 20: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 23: warning: exported function TokenFromCtx should have comment or be unexported (golint)
    • Line 35: warning: exported function ValidateJWT should have comment or be unexported (golint)
    • kit/net/grpc/auth.go
    • Line 22: warning: exported type AuthInterceptors should have comment or be unexported (golint)
    • Line 26: warning: exported function MakeAuthInterceptors should have comment or be unexported (golint)
    • Line 39: warning: exported function MakeJWTInterceptors should have comment or be unexported (golint)
    • Line 43: warning: exported method AuthInterceptors.Unary should have comment or be unexported (golint)
    • Line 46: warning: exported method AuthInterceptors.Stream should have comment or be unexported (golint)
    • Line 50: warning: exported type ClaimsFunc should have comment or be unexported (golint)
    • Line 51: warning: exported type Claims should have comment or be unexported (golint)
    • Line 53: warning: exported function ValidateJWT should have comment or be unexported (golint)
    • kit/net/grpc/stream.go
    • Line 9: warning: exported function NewIterator should have comment or be unexported (golint)
    • Line 16: warning: exported type Iterator should have comment or be unexported (golint)
    • Line 21: warning: exported method Iterator.Next should have comment or be unexported (golint)
    • Line 38: warning: exported method Iterator.Close should have comment or be unexported (golint)
    • kit/security/oauth/redirect/server.go
    • Line 29: warning: exported type Handler should have comment or be unexported (golint)
    • Line 35: warning: exported method Handler.RedirectResult should have comment or be unexported (golint)
    • Line 58: warning: exported method Handler.OAuthCallback should have comment or be unexported (golint)
    • Line 86: warning: exported type Server should have comment or be unexported (golint)
    • Line 93: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 137: warning: exported method Server.Close should have comment or be unexported (golint)
    • Line 141: warning: exported method Server.GetAuthCodeURL should have comment or be unexported (golint)
    • Line 158: warning: exported method Server.Remove should have comment or be unexported (golint)
    • kit/sync/refcounter.go
    • Line 8: warning: exported type ReleaseDataFunc should have comment or be unexported (golint)
    • Line 10: warning: exported type RefCounter should have comment or be unexported (golint)
    • kit/security/jwt/validator.go
    • Line 10: warning: exported type Validator should have comment or be unexported (golint)
    • Line 14: warning: exported function NewValidator should have comment or be unexported (golint)
    • Line 18: warning: exported method Validator.Parse should have comment or be unexported (golint)
    • Line 33: warning: exported method Validator.ParseWithClaims should have comment or be unexported (golint)
    • kit/security/certManager/acme/certManager.go
    • Line 50: warning: exported function NewUser should have comment or be unexported (golint)
    • Line 57: warning: exported method LegoUser.SetRegistration should have comment or be unexported (golint)
    • Line 61: warning: exported method LegoUser.GetEmail should have comment or be unexported (golint)
    • Line 65: warning: exported method LegoUser.GetRegistration should have comment or be unexported (golint)
    • Line 69: warning: exported method LegoUser.GetPrivateKey should have comment or be unexported (golint)
    • Line 73: warning: exported type Certifier should have comment or be unexported (golint)
    • Line 78: warning: exported type Client should have comment or be unexported (golint)
    • Line 226: warning: exported method CertManager.GetClientTLSConfig should have comment or be unexported (golint)
    • Line 234: warning: exported method CertManager.GetServerTLSConfig should have comment or be unexported (golint)
    • kit/security/jwt/claims.go
    • Line 10: warning: exported type Claims should have comment or be unexported (golint)
    • Line 17: warning: exported method Claims.GetScope should have comment or be unexported (golint)
    • Line 21: warning: comment on exported type StandardClaims should be of the form "StandardClaims ..." (with optional leading article) (golint)
    • Line 32: warning: exported method StandardClaims.GetAudience should have comment or be unexported (golint)
    • Line 36: warning: exported method StandardClaims.Valid should have comment or be unexported (golint)
    • Line 52: warning: exported function SetTimeFunc should have comment or be unexported (golint)
    • kit/security/signer/basicCertificateSigner.go
    • Line 16: warning: exported type BasicCertificateSigner should have comment or be unexported (golint)
    • Line 23: warning: exported function NewBasicCertificateSigner should have comment or be unexported (golint)
    • Line 27: warning: exported method BasicCertificateSigner.Sign should have comment or be unexported (golint)
    • kit/strings/set.go
    • Line 3: warning: exported type Set should have comment or be unexported (golint)
    • Line 5: warning: exported function MakeSet should have comment or be unexported (golint)
    • Line 11: warning: exported method Set.ToSlice should have comment or be unexported (golint)
    • Line 21: warning: exported method Set.Add should have comment or be unexported (golint)
    • Line 27: warning: exported method Set.HasOneOf should have comment or be unexported (golint)
    • kit/net/http/auth.go
    • Line 13: warning: exported type Claims should have comment or be unexported (golint)
    • Line 14: warning: exported type ClaimsFunc should have comment or be unexported (golint)
    • Line 15: warning: exported type OnUnauthorizedAccessFunc should have comment or be unexported (golint)
    • Line 20: warning: exported function CtxWithToken should have comment or be unexported (golint)
    • Line 24: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 27: warning: exported function TokenFromCtx should have comment or be unexported (golint)
    • Line 39: warning: exported function ValidateJWT should have comment or be unexported (golint)
    • kit/net/http/interceptor.go
    • Line 13: warning: exported type Interceptor should have comment or be unexported (golint)
    • Line 15: warning: exported type AuthArgs should have comment or be unexported (golint)
    • Line 39: warning: exported function MakeClaimsFunc should have comment or be unexported (golint)
    • Line 54: warning: exported type DeniedClaims should have comment or be unexported (golint)
    • Line 58: warning: exported method DeniedClaims.Valid should have comment or be unexported (golint)
    • kit/security/jwt/scopeClaims.go
    • Line 8: warning: exported type ScopeClaims should have comment or be unexported (golint)
    • Line 13: warning: exported function NewScopeClaims should have comment or be unexported (golint)
    • Line 21: warning: exported function NewRegexpScopeClaims should have comment or be unexported (golint)
    • Line 25: warning: exported method ScopeClaims.Valid should have comment or be unexported (golint)
    • kit/net/coap/client.go
    • Line 30: warning: exported type Observation should have comment or be unexported (golint)
    • Line 34: warning: exported type ClientConn should have comment or be unexported (golint)
    • Line 44: warning: exported type Client should have comment or be unexported (golint)
    • Line 65: warning: don't use underscores in Go names; var ExtendedKeyUsage_IDENTITY_CERTIFICATE should be ExtendedKeyUsageIDENTITYCERTIFICATE (golint)
    • Line 65: warning: exported var ExtendedKeyUsage_IDENTITY_CERTIFICATE should have comment or be unexported (golint)
    • Line 67: warning: exported function GetDeviceIDFromIndetityCertificate should have comment or be unexported (golint)
    • Line 103: warning: exported function VerifyIndetityCertificate should have comment or be unexported (golint)
    • Line 129: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 133: warning: exported type OptionFunc should have comment or be unexported (golint)
    • Line 135: warning: exported function WithInterface should have comment or be unexported (golint)
    • Line 144: warning: exported function WithResourceType should have comment or be unexported (golint)
    • Line 153: warning: exported function WithInstanceID should have comment or be unexported (golint)
    • Line 162: warning: exported function WithDeviceID should have comment or be unexported (golint)
    • Line 171: warning: exported function WithCredentialId should have comment or be unexported (golint)
    • Line 180: warning: exported function WithCredentialSubject should have comment or be unexported (golint)
    • Line 189: warning: exported function WithAccept should have comment or be unexported (golint)
    • Line 197: warning: exported method Client.UpdateResource should have comment or be unexported (golint)
    • Line 207: warning: exported method Client.UpdateResourceWithCodec should have comment or be unexported (golint)
    • Line 240: warning: exported method Client.GetResource should have comment or be unexported (golint)
    • Line 249: warning: exported method Client.GetResourceWithCodec should have comment or be unexported (golint)
    • Line 273: warning: exported method Client.DeleteResourceWithCodec should have comment or be unexported (golint)
    • Line 297: warning: exported method Client.DeleteResource should have comment or be unexported (golint)
    • Line 306: warning: exported method Client.Close should have comment or be unexported (golint)
    • Line 356: warning: exported method Client.RemoteAddr should have comment or be unexported (golint)
    • Line 360: warning: exported method Client.Context should have comment or be unexported (golint)
    • Line 364: warning: exported type CloseHandlerFunc should have comment or be unexported (golint)
    • Line 366: warning: exported type OnCloseHandler should have comment or be unexported (golint)
    • Line 372: warning: exported function NewOnCloseHandler should have comment or be unexported (golint)
    • Line 378: warning: exported method OnCloseHandler.Add should have comment or be unexported (golint)
    • Line 387: warning: exported method OnCloseHandler.Remove should have comment or be unexported (golint)
    • Line 405: warning: exported method OnCloseHandler.OnClose should have comment or be unexported (golint)
    • Line 412: warning: exported type ClientCloseHandler should have comment or be unexported (golint)
    • Line 417: warning: exported method ClientCloseHandler.RegisterCloseHandler should have comment or be unexported (golint)
    • Line 421: warning: exported method ClientCloseHandler.UnregisterCloseHandler should have comment or be unexported (golint)
    • Line 439: warning: exported type DialOptionFunc should have comment or be unexported (golint)
    • Line 441: warning: exported function WithDialDisableTCPSignalMessageCSM should have comment or be unexported (golint)
    • Line 450: warning: exported function WithDialDisablePeerTCPSignalMessageCSMs should have comment or be unexported (golint)
    • Line 467: warning: exported function WithErrors should have comment or be unexported (golint)
    • Line 474: warning: exported function WithMaxMessageSize should have comment or be unexported (golint)
    • Line 481: warning: exported function WithDialer should have comment or be unexported (golint)
    • Line 488: warning: exported function WithHeartBeat should have comment or be unexported (golint)
    • Line 495: warning: exported function DialUDP should have comment or be unexported (golint)
    • Line 534: warning: exported function DialTCP should have comment or be unexported (golint)
    • Line 579: warning: exported function NewVerifyPeerCertificate should have comment or be unexported (golint)
    • Line 615: warning: exported function DialTCPSecure should have comment or be unexported (golint)
    • Line 661: warning: exported function DialUDPSecure should have comment or be unexported (golint)
    • kit/security/signer/identityCertificateSigner.go
    • Line 18: warning: exported type IdentityCertificateSigner should have comment or be unexported (golint)
    • Line 25: warning: exported function NewIdentityCertificateSigner should have comment or be unexported (golint)
    • Line 29: warning: exported method IdentityCertificateSigner.Sign should have comment or be unexported (golint)
    • kit/cmd/certificate-generator/main.go
    • Line 19: warning: exported type Options should have comment or be unexported (golint)
    • Line 126: warning: exported function WriteCertOut should have comment or be unexported (golint)
    • Line 140: warning: exported function WriteCsrOut should have comment or be unexported (golint)
    • Line 154: warning: exported function WritePrivateKey should have comment or be unexported (golint)
    • kit/net/grpc/interceptor.go
    • Line 10: warning: exported type Interceptor should have comment or be unexported (golint)
    • Line 12: warning: exported function UnaryServerInterceptor should have comment or be unexported (golint)
    • Line 23: warning: exported function StreamServerInterceptor should have comment or be unexported (golint)
    • kit/security/jwt/jwk.go
    • Line 15: warning: exported type KeyCache should have comment or be unexported (golint)
    • Line 22: warning: exported function NewKeyCache should have comment or be unexported (golint)
    • Line 29: warning: exported method KeyCache.GetOrFetchKey should have comment or be unexported (golint)
    • Line 39: warning: exported method KeyCache.GetKey should have comment or be unexported (golint)
    • Line 48: warning: exported method KeyCache.LookupKey should have comment or be unexported (golint)
    • Line 68: warning: exported method KeyCache.FetchKeys should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell97%

Misspell Finds commonly misspelled English words