Preparing report...

Report for github.com/fluxcd/toolkit

A+    Excellent!    Found 52 issues across 186 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!


golint74%

Golint is a linter for Go source code.

    • toolkit/internal/flags/helm_release_values.go
    • Line 28: warning: exported type HelmReleaseValuesFrom should have comment or be unexported (golint)
    • Line 40: warning: exported method HelmReleaseValuesFrom.Set should have comment or be unexported (golint)
    • Line 62: warning: exported method HelmReleaseValuesFrom.Type should have comment or be unexported (golint)
    • Line 66: warning: exported method HelmReleaseValuesFrom.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/kustomization_source.go
    • Line 30: warning: exported type KustomizationSource should have comment or be unexported (golint)
    • Line 43: warning: exported method KustomizationSource.Set should have comment or be unexported (golint)
    • Line 72: warning: exported method KustomizationSource.Type should have comment or be unexported (golint)
    • Line 76: warning: exported method KustomizationSource.Description should have comment or be unexported (golint)
    • toolkit/internal/bootstrap/bootstrap.go
    • Line 42: warning: exported var ErrReconciledWithWarning should have comment or be unexported (golint)
    • Line 45: warning: exported type Reconciler should have comment or be unexported (golint)
    • Line 72: warning: exported type RepositoryReconciler should have comment or be unexported (golint)
    • Line 77: warning: exported type PostGenerateSecretFunc should have comment or be unexported (golint)
    • Line 79: warning: exported function Run should have comment or be unexported (golint)
    • toolkit/cmd/flux/create_alert.go
    • Line 158: 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)
    • toolkit/cmd/flux/main.go
    • Line 31: warning: exported var VERSION should have comment or be unexported (golint)
    • Line 120: warning: exported function NewRootFlags should have comment or be unexported (golint)
    • toolkit/internal/utils/utils.go
    • Line 59: warning: exported type Utils should have comment or be unexported (golint)
    • Line 62: warning: exported type ExecMode should have comment or be unexported (golint)
    • Line 65: warning: exported const ModeOS should have comment (or a comment on this block) or be unexported (golint)
    • Line 70: warning: exported function ExecKubectlCommand should have comment or be unexported (golint)
    • Line 94: 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 104: 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 112: warning: exported function ExecTemplate should have comment or be unexported (golint)
    • Line 142: warning: exported function KubeConfig should have comment or be unexported (golint)
    • Line 166: warning: exported function KubeClient should have comment or be unexported (golint)
    • Line 210: warning: exported function ContainsItemString should have comment or be unexported (golint)
    • Line 219: warning: exported function ContainsEqualFoldItemString should have comment or be unexported (golint)
    • Line 256: warning: exported function MakeDependsOn should have comment or be unexported (golint)
    • Line 276: warning: exported function PrintTable should have comment or be unexported (golint)
    • Line 294: warning: exported function ValidateComponents should have comment or be unexported (golint)
    • Line 326: warning: exported function ExtractCRDs should have comment or be unexported (golint)
    • toolkit/cmd/flux/logs.go
    • Line 204: warning: context.Context should be the first parameter of a function (golint)
    • Line 252: warning: exported type ControllerLogEntry should have comment or be unexported (golint)
    • toolkit/internal/flags/git_implementation.go
    • Line 30: warning: exported type GitImplementation should have comment or be unexported (golint)
    • Line 36: warning: exported method GitImplementation.Set should have comment or be unexported (golint)
    • Line 49: warning: exported method GitImplementation.Type should have comment or be unexported (golint)
    • Line 53: warning: exported method GitImplementation.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/safe_relative_path.go
    • Line 27: warning: exported type SafeRelativePath should have comment or be unexported (golint)
    • Line 33: warning: exported method SafeRelativePath.ToSlash should have comment or be unexported (golint)
    • Line 37: warning: exported method SafeRelativePath.Set should have comment or be unexported (golint)
    • Line 49: warning: exported method SafeRelativePath.Type should have comment or be unexported (golint)
    • Line 53: warning: exported method SafeRelativePath.Description should have comment or be unexported (golint)
    • toolkit/cmd/flux/create_source_bucket.go
    • Line 90: warning: exported function NewSourceBucketFlags should have comment or be unexported (golint)
    • Line 220: 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)
    • toolkit/cmd/flux/create_tenant.go
    • Line 151: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 167: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 200: 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 229: 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 258: 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)
    • toolkit/internal/flags/ecdsa_curve.go
    • Line 26: warning: exported type ECDSACurve should have comment or be unexported (golint)
    • Line 43: warning: exported method ECDSACurve.Set should have comment or be unexported (golint)
    • Line 51: warning: exported method ECDSACurve.Type should have comment or be unexported (golint)
    • Line 55: warning: exported method ECDSACurve.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/public_key_algorithm.go
    • Line 26: warning: exported type PublicKeyAlgorithm should have comment or be unexported (golint)
    • Line 32: warning: exported method PublicKeyAlgorithm.Set should have comment or be unexported (golint)
    • Line 47: warning: exported method PublicKeyAlgorithm.Type should have comment or be unexported (golint)
    • Line 51: warning: exported method PublicKeyAlgorithm.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/decryption_provider.go
    • Line 28: warning: exported type DecryptionProvider should have comment or be unexported (golint)
    • Line 34: warning: exported method DecryptionProvider.Set should have comment or be unexported (golint)
    • Line 48: warning: exported method DecryptionProvider.Type should have comment or be unexported (golint)
    • Line 52: warning: exported method DecryptionProvider.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/helm_chart_source.go
    • Line 30: warning: exported type HelmChartSource should have comment or be unexported (golint)
    • Line 43: warning: exported method HelmChartSource.Set should have comment or be unexported (golint)
    • Line 66: warning: exported method HelmChartSource.Type should have comment or be unexported (golint)
    • Line 70: warning: exported method HelmChartSource.Description should have comment or be unexported (golint)
    • toolkit/cmd/flux/create_secret.go
    • Line 51: 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)
    • toolkit/internal/bootstrap/git/git.go
    • Line 26: warning: exported var ErrNoGitRepository should have comment or be unexported (golint)
    • Line 30: warning: exported type Author should have comment or be unexported (golint)
    • Line 35: warning: exported type Commit should have comment or be unexported (golint)
    • toolkit/internal/bootstrap/git/gogit/gogit.go
    • Line 37: warning: exported type GoGit should have comment or be unexported (golint)
    • Line 43: warning: exported function New should have comment or be unexported (golint)
    • Line 50: warning: exported method GoGit.Init should have comment or be unexported (golint)
    • Line 85: warning: exported method GoGit.Clone should have comment or be unexported (golint)
    • Line 129: warning: exported method GoGit.Commit should have comment or be unexported (golint)
    • Line 149: warning: should omit 2nd value from range; this loop is equivalent to `for file := range ...` (golint)
    • Line 188: warning: exported method GoGit.Push should have comment or be unexported (golint)
    • Line 200: warning: exported method GoGit.Status should have comment or be unexported (golint)
    • Line 215: warning: exported method GoGit.Head should have comment or be unexported (golint)
    • Line 226: warning: exported method GoGit.Path should have comment or be unexported (golint)
    • toolkit/cmd/flux/install.go
    • Line 109: warning: exported function NewInstallFlags should have comment or be unexported (golint)
    • Line 127: 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)
    • toolkit/pkg/status/status.go
    • Line 38: warning: exported type StatusChecker should have comment or be unexported (golint)
    • Line 46: warning: exported function NewStatusChecker should have comment or be unexported (golint)
    • Line 65: warning: exported method StatusChecker.Assess should have comment or be unexported (golint)
    • toolkit/internal/flags/crds.go
    • Line 34: warning: exported type CRDsPolicy should have comment or be unexported (golint)
    • Line 40: warning: exported method CRDsPolicy.Set should have comment or be unexported (golint)
    • Line 54: warning: exported method CRDsPolicy.Type should have comment or be unexported (golint)
    • Line 58: warning: exported method CRDsPolicy.Description should have comment or be unexported (golint)
    • toolkit/internal/bootstrap/bootstrap_plain_git.go
    • Line 49: warning: exported type PlainGitBootstrapper should have comment or be unexported (golint)
    • Line 66: warning: exported type GitOption should have comment or be unexported (golint)
    • Line 70: warning: exported function WithRepositoryURL should have comment or be unexported (golint)
    • Line 80: warning: exported function WithPostGenerateSecretFunc should have comment or be unexported (golint)
    • Line 90: warning: exported function NewPlainGitProvider should have comment or be unexported (golint)
    • Line 101: warning: exported method PlainGitBootstrapper.ReconcileComponents should have comment or be unexported (golint)
    • Line 208: warning: exported method PlainGitBootstrapper.ReconcileSourceSecret should have comment or be unexported (golint)
    • Line 250: warning: exported method PlainGitBootstrapper.ReconcileSyncConfig should have comment or be unexported (golint)
    • Line 331: warning: exported method PlainGitBootstrapper.ReportKustomizationHealth should have comment or be unexported (golint)
    • Line 354: warning: exported method PlainGitBootstrapper.ReportComponentsHealth should have comment or be unexported (golint)
    • toolkit/internal/bootstrap/bootstrap_provider.go
    • Line 37: warning: exported type GitProviderBootstrapper should have comment or be unexported (golint)
    • Line 62: warning: exported function NewGitProviderBootstrapper should have comment or be unexported (golint)
    • Line 79: warning: exported type GitProviderOption should have comment or be unexported (golint)
    • Line 83: warning: exported function WithProviderRepository should have comment or be unexported (golint)
    • Line 103: warning: exported function WithProviderRepositoryConfig should have comment or be unexported (golint)
    • Line 123: warning: exported function WithProviderTeamPermissions should have comment or be unexported (golint)
    • Line 133: warning: exported function WithReadWriteKeyPermissions should have comment or be unexported (golint)
    • Line 143: warning: exported function WithBootstrapTransportType should have comment or be unexported (golint)
    • Line 153: warning: exported function WithSyncTransportType should have comment or be unexported (golint)
    • Line 163: warning: exported function WithSSHHostname should have comment or be unexported (golint)
    • Line 173: warning: exported function WithReconcile should have comment or be unexported (golint)
    • Line 183: warning: exported method GitProviderBootstrapper.ReconcileSyncConfig should have comment or be unexported (golint)
    • toolkit/pkg/manifestgen/sourcesecret/options.go
    • Line 23: warning: exported type PrivateKeyAlgorithm should have comment or be unexported (golint)
    • Line 26: warning: exported const RSAPrivateKeyAlgorithm should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported const UsernameSecretKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type Options should have comment or be unexported (golint)
    • Line 60: warning: exported function MakeDefaultOptions should have comment or be unexported (golint)
    • toolkit/pkg/log/log.go
    • Line 1: warning: package comment should be of the form "Package log ..." (golint)
    • Line 18: warning: exported type Logger should have comment or be unexported (golint)
    • toolkit/cmd/flux/create_kustomization.go
    • Line 114: warning: exported function NewKustomizationFlags should have comment or be unexported (golint)
    • Line 263: 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)
    • toolkit/internal/flags/log_level.go
    • Line 28: warning: exported type LogLevel should have comment or be unexported (golint)
    • Line 34: warning: exported method LogLevel.Set should have comment or be unexported (golint)
    • Line 48: warning: exported method LogLevel.Type should have comment or be unexported (golint)
    • Line 52: warning: exported method LogLevel.Description should have comment or be unexported (golint)
    • toolkit/internal/bootstrap/options.go
    • Line 24: warning: exported type Option should have comment or be unexported (golint)
    • Line 29: warning: exported function WithBranch should have comment or be unexported (golint)
    • Line 43: warning: exported function WithAuthor should have comment or be unexported (golint)
    • Line 65: warning: exported function WithCommitMessageAppendix should have comment or be unexported (golint)
    • Line 79: warning: exported function WithKubeconfig should have comment or be unexported (golint)
    • Line 100: warning: exported function WithLogger should have comment or be unexported (golint)
    • toolkit/internal/flags/arch.go
    • Line 28: warning: exported type Arch should have comment or be unexported (golint)
    • Line 34: warning: exported method Arch.Set should have comment or be unexported (golint)
    • Line 48: warning: exported method Arch.Type should have comment or be unexported (golint)
    • Line 52: warning: exported method Arch.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/source_bucket_provider.go
    • Line 29: warning: exported type SourceBucketProvider should have comment or be unexported (golint)
    • Line 35: warning: exported method SourceBucketProvider.Set should have comment or be unexported (golint)
    • Line 48: warning: exported method SourceBucketProvider.Type should have comment or be unexported (golint)
    • Line 52: warning: exported method SourceBucketProvider.Description should have comment or be unexported (golint)
    • toolkit/internal/flags/rsa_key_bits.go
    • Line 27: warning: exported type RSAKeyBits should have comment or be unexported (golint)
    • Line 33: warning: exported method RSAKeyBits.Set should have comment or be unexported (golint)
    • Line 49: warning: exported method RSAKeyBits.Type should have comment or be unexported (golint)
    • Line 53: warning: exported method RSAKeyBits.Description should have comment or be unexported (golint)

gocyclo91%

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.

    • toolkit/cmd/flux/uninstall.go
    • Line 183: warning: cyclomatic complexity 19 of function uninstallFinalizers() is high (> 15) (gocyclo)
    • Line 106: warning: cyclomatic complexity 19 of function uninstallComponents() is high (> 15) (gocyclo)

ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words