Preparing report...

Report for github.com/int128/kubelogin

A+    Excellent!    Found 49 issues across 74 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!


gocyclo98%

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.


golint47%

Golint is a linter for Go source code.

    • kubelogin/pkg/kubeconfig/loader/load.go
    • Line 16: warning: exported var Set should have comment or be unexported (golint)
    • Line 21: warning: exported type Interface should have comment or be unexported (golint)
    • Line 25: warning: exported type Loader should have comment or be unexported (golint)
    • Line 27: warning: exported method Loader.GetCurrentAuthProvider should have comment or be unexported (golint)
    • kubelogin/pkg/usecases/setup/setup.go
    • Line 12: warning: exported var Set should have comment or be unexported (golint)
    • Line 17: warning: exported type Interface should have comment or be unexported (golint)
    • Line 22: warning: exported type Setup should have comment or be unexported (golint)
    • kubelogin/pkg/oidc/oidc.go
    • Line 27: warning: exported method TokenSet.DecodeWithoutVerify should have comment or be unexported (golint)
    • Line 31: warning: exported function NewState should have comment or be unexported (golint)
    • Line 39: warning: exported function NewNonce should have comment or be unexported (golint)
    • kubelogin/pkg/cmd/root.go
    • Line 39: warning: exported type Root should have comment or be unexported (golint)
    • Line 44: warning: exported method Root.New should have comment or be unexported (golint)
    • kubelogin/pkg/kubeconfig/writer/write.go
    • Line 14: warning: exported var Set should have comment or be unexported (golint)
    • Line 19: warning: exported type Interface should have comment or be unexported (golint)
    • Line 23: warning: exported type Writer should have comment or be unexported (golint)
    • Line 25: warning: exported method Writer.UpdateAuthProvider should have comment or be unexported (golint)
    • kubelogin/pkg/oidc/client/factory.go
    • Line 23: warning: exported var Set should have comment or be unexported (golint)
    • Line 28: warning: exported type FactoryInterface should have comment or be unexported (golint)
    • Line 32: warning: exported type Factory should have comment or be unexported (golint)
    • kubelogin/pkg/usecases/credentialplugin/get_token.go
    • Line 27: warning: exported var Set should have comment or be unexported (golint)
    • Line 32: warning: exported type Interface should have comment or be unexported (golint)
    • Line 44: warning: exported type GetToken should have comment or be unexported (golint)
    • Line 52: warning: exported method GetToken.Do should have comment or be unexported (golint)
    • kubelogin/pkg/cmd/setup.go
    • Line 32: warning: exported type Setup should have comment or be unexported (golint)
    • Line 36: warning: exported method Setup.New should have comment or be unexported (golint)
    • kubelogin/pkg/testing/jwt/encode.go
    • Line 11: warning: exported var PrivateKey should have comment or be unexported (golint)
    • Line 21: warning: exported type Claims should have comment or be unexported (golint)
    • Line 31: warning: exported function Encode should have comment or be unexported (golint)
    • Line 39: warning: exported function EncodeF should have comment or be unexported (golint)
    • kubelogin/pkg/pkce/pkce.go
    • Line 13: warning: exported var Plain should have comment or be unexported (golint)
    • Line 16: warning: comment on exported const MethodS256 should be of the form "MethodS256 ..." (golint)
    • Line 27: warning: exported method Params.IsZero should have comment or be unexported (golint)
    • kubelogin/integration_test/oidcserver/handler/types.go
    • Line 21: warning: exported type DiscoveryResponse should have comment or be unexported (golint)
    • Line 37: warning: exported type CertificatesResponse should have comment or be unexported (golint)
    • Line 41: warning: exported type CertificatesResponseKey should have comment or be unexported (golint)
    • Line 69: warning: exported type TokenResponse should have comment or be unexported (golint)
    • kubelogin/pkg/testing/logger/logger.go
    • Line 10: warning: exported function New should have comment or be unexported (golint)
    • Line 24: warning: exported method Logger.AddFlags should have comment or be unexported (golint)
    • Line 28: warning: exported method Logger.Printf should have comment or be unexported (golint)
    • Line 32: warning: exported method Logger.V should have comment or be unexported (golint)
    • Line 39: warning: exported method Logger.IsEnabled should have comment or be unexported (golint)
    • kubelogin/pkg/oidc/client/client.go
    • Line 20: warning: exported type Interface should have comment or be unexported (golint)
    • Line 29: warning: exported type AuthCodeURLInput should have comment or be unexported (golint)
    • Line 37: warning: exported type ExchangeAuthCodeInput should have comment or be unexported (golint)
    • Line 44: warning: exported type GetTokenByAuthCodeInput should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign86%

IneffAssign detects ineffectual assignments in Go code.

    • kubelogin/pkg/usecases/standalone/standalone_test.go
    • Line 11: warning: no required module provides package github.com/int128/kubelogin/pkg/kubeconfig/loader/mock_loader; to add it: (ineffassign)
    • Line 12: warning: no required module provides package github.com/int128/kubelogin/pkg/kubeconfig/writer/mock_writer; to add it: (ineffassign)
    • Line 18: warning: no required module provides package github.com/int128/kubelogin/pkg/usecases/authentication/mock_authentication; to add it: (ineffassign)
    • Line 11: warning: could not import github.com/int128/kubelogin/pkg/kubeconfig/loader/mock_loader (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/int128/kubelogin/pkg/kubeconfig/writer/mock_writer (invalid package name: "") (ineffassign)
    • Line 18: warning: could not import github.com/int128/kubelogin/pkg/usecases/authentication/mock_authentication (invalid package name: "") (ineffassign)
    • kubelogin/main.go
    • Line 7: warning: could not import github.com/int128/kubelogin/pkg/di (invalid package name: "") (ineffassign)
    • kubelogin/pkg/usecases/credentialplugin/get_token_test.go
    • Line 15: warning: no required module provides package github.com/int128/kubelogin/pkg/credentialplugin/writer/mock_writer; to add it: (ineffassign)
    • Line 11: warning: no required module provides package github.com/int128/kubelogin/pkg/infrastructure/mutex/mock_mutex; to add it: (ineffassign)
    • Line 20: warning: no required module provides package github.com/int128/kubelogin/pkg/tokencache/repository/mock_repository; to add it: (ineffassign)
    • Line 22: warning: no required module provides package github.com/int128/kubelogin/pkg/usecases/authentication/mock_authentication; to add it: (ineffassign)
    • Line 11: warning: could not import github.com/int128/kubelogin/pkg/infrastructure/mutex/mock_mutex (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/int128/kubelogin/pkg/credentialplugin/writer/mock_writer (invalid package name: "") (ineffassign)
    • Line 20: warning: could not import github.com/int128/kubelogin/pkg/tokencache/repository/mock_repository (invalid package name: "") (ineffassign)
    • Line 22: warning: could not import github.com/int128/kubelogin/pkg/usecases/authentication/mock_authentication (invalid package name: "") (ineffassign)
    • kubelogin/pkg/usecases/authentication/ropc/ropc_test.go
    • Line 11: warning: no required module provides package github.com/int128/kubelogin/pkg/infrastructure/reader/mock_reader; to add it: (ineffassign)
    • Line 13: warning: no required module provides package github.com/int128/kubelogin/pkg/oidc/client/mock_client; to add it: (ineffassign)
    • Line 11: warning: could not import github.com/int128/kubelogin/pkg/infrastructure/reader/mock_reader (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/int128/kubelogin/pkg/oidc/client/mock_client (invalid package name: "") (ineffassign)
    • kubelogin/pkg/usecases/authentication/authcode/browser_test.go
    • Line 10: warning: no required module provides package github.com/int128/kubelogin/pkg/infrastructure/browser/mock_browser; to add it: (ineffassign)
    • Line 13: warning: no required module provides package github.com/int128/kubelogin/pkg/oidc/client/mock_client; to add it: (ineffassign)
    • Line 10: warning: could not import github.com/int128/kubelogin/pkg/infrastructure/browser/mock_browser (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/int128/kubelogin/pkg/oidc/client/mock_client (invalid package name: "") (ineffassign)
    • kubelogin/pkg/usecases/setup/stage2_test.go
    • Line 14: warning: no required module provides package github.com/int128/kubelogin/pkg/usecases/authentication/mock_authentication; to add it: (ineffassign)
    • Line 14: warning: could not import github.com/int128/kubelogin/pkg/usecases/authentication/mock_authentication (invalid package name: "") (ineffassign)
    • kubelogin/pkg/cmd/cmd_test.go
    • Line 17: warning: no required module provides package github.com/int128/kubelogin/pkg/usecases/credentialplugin/mock_credentialplugin; to add it: (ineffassign)
    • Line 19: warning: no required module provides package github.com/int128/kubelogin/pkg/usecases/standalone/mock_standalone; to add it: (ineffassign)
    • Line 17: warning: could not import github.com/int128/kubelogin/pkg/usecases/credentialplugin/mock_credentialplugin (invalid package name: "") (ineffassign)
    • Line 19: warning: could not import github.com/int128/kubelogin/pkg/usecases/standalone/mock_standalone (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!