Preparing report...

Report for github.com/hootsuite/vault-ctrl-tool

A+    Excellent!    Found 30 issues across 40 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!


gocyclo92%

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.

    • vault-ctrl-tool/config/config.go
    • Line 205: warning: cyclomatic complexity 49 of function (*VaultConfig).prepareConfig() is high (> 15) (gocyclo)
    • Line 390: warning: cyclomatic complexity 17 of function (VaultConfig).Cleanup() is high (> 15) (gocyclo)

golint30%

Golint is a linter for Go source code.

    • vault-ctrl-tool/util/clock/clock.go
    • Line 16: warning: exported type Factory should have comment or be unexported (golint)
    • Line 18: warning: exported function Now should have comment or be unexported (golint)
    • Line 22: warning: exported function SetFactory should have comment or be unexported (golint)
    • Line 31: warning: exported function Get should have comment or be unexported (golint)
    • vault-ctrl-tool/briefcase/ssh.go
    • Line 16: warning: exported method Briefcase.ShouldRefreshSSHCertificate should have comment or be unexported (golint)
    • Line 26: warning: exported method Briefcase.EnrollSSHCertificate should have comment or be unexported (golint)
    • vault-ctrl-tool/util/paths.go
    • Line 11: warning: exported function AbsolutePath should have comment or be unexported (golint)
    • Line 34: warning: exported function MustMkdirAllForFile should have comment or be unexported (golint)
    • vault-ctrl-tool/briefcase/aws_sts.go
    • Line 17: warning: exported method Briefcase.AWSCredentialExpiresBefore should have comment or be unexported (golint)
    • Line 26: warning: exported method Briefcase.EnrollAWSCredential should have comment or be unexported (golint)
    • vault-ctrl-tool/briefcase/secrets_cache.go
    • Line 13: warning: exported method Briefcase.HasCachedSecrets should have comment or be unexported (golint)
    • Line 26: warning: exported method Briefcase.StoreSecrets should have comment or be unexported (golint)
    • Line 30: warning: exported method Briefcase.GetSecrets should have comment or be unexported (golint)
    • vault-ctrl-tool/briefcase/template.go
    • Line 8: warning: exported method Briefcase.ShouldRefreshTemplate should have comment or be unexported (golint)
    • Line 20: warning: exported method Briefcase.EnrollTemplate should have comment or be unexported (golint)
    • vault-ctrl-tool/metrics/metrics.go
    • Line 5: warning: exported type MetricName should have comment or be unexported (golint)
    • Line 7: warning: exported const BriefcaseReset should have comment or be unexported (golint)
    • Line 8: warning: exported const VaultTokenWritten should have comment or be unexported (golint)
    • Line 9: warning: exported const VaultTokenRefreshed should have comment or be unexported (golint)
    • Line 10: warning: exported const SecretUpdates should have comment or be unexported (golint)
    • Line 12: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 17: warning: exported function NewMetrics should have comment or be unexported (golint)
    • Line 23: warning: exported method Metrics.Increment should have comment or be unexported (golint)
    • Line 32: warning: exported method Metrics.Decrement should have comment or be unexported (golint)
    • Line 41: warning: exported method Metrics.Counter should have comment or be unexported (golint)
    • Line 52: warning: exported method Metrics.IncrementBy should have comment or be unexported (golint)
    • vault-ctrl-tool/briefcase/json_secrets.go
    • Line 9: warning: exported method Briefcase.ShouldRefreshSecret should have comment or be unexported (golint)
    • Line 26: warning: exported method Briefcase.EnrollSecret should have comment or be unexported (golint)
    • Line 39: warning: exported method Briefcase.ShouldRefreshComposite should have comment or be unexported (golint)
    • Line 55: warning: exported method Briefcase.EnrollComposite should have comment or be unexported (golint)
    • vault-ctrl-tool/config/config.go
    • Line 102: warning: exported type CompositeSecretFile should have comment or be unexported (golint)
    • Line 109: warning: exported type ControlToolConfig should have comment or be unexported (golint)
    • Line 115: warning: exported function ReadConfig should have comment or be unexported (golint)
    • Line 153: warning: exported function ReadConfigFile should have comment or be unexported (golint)
    • Line 390: warning: exported method VaultConfig.Cleanup should have comment or be unexported (golint)
    • vault-ctrl-tool/syncer/sync.go
    • Line 26: warning: exported type Syncer should have comment or be unexported (golint)
    • Line 34: warning: exported function NewSyncer should have comment or be unexported (golint)
    • Line 44: warning: exported function SetupSyncer should have comment or be unexported (golint)
    • Line 73: warning: exported method Syncer.PerformSync should have comment or be unexported (golint)
    • Line 252: 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)
    • vault-ctrl-tool/perform.go
    • Line 22: warning: exported const ShutdownFileCheckFrequency should have comment or be unexported (golint)
    • Line 24: warning: exported function PerformOneShotSidecar should have comment or be unexported (golint)
    • Line 49: warning: exported function PerformInit should have comment or be unexported (golint)
    • Line 102: warning: exported function PerformSidecar should have comment or be unexported (golint)
    • Line 143: warning: exported function PerformCleanup should have comment or be unexported (golint)
    • vault-ctrl-tool/util/constants.go
    • Line 3: warning: exported const VaultEC2AuthPath should have comment or be unexported (golint)
    • Line 12: warning: exported type SecretLifetime should have comment or be unexported (golint)
    • Line 14: warning: comment on exported const LifetimeStatic should be of the form "LifetimeStatic ..." (golint)
    • Line 17: warning: exported const LifetimeToken should have comment or be unexported (golint)
    • Line 25: warning: comment on exported const EncodingBase64 should be of the form "EncodingBase64 ..." (golint)
    • Line 28: warning: exported const EncodingNone should have comment or be unexported (golint)
    • vault-ctrl-tool/briefcase/briefcase.go
    • Line 55: warning: exported type LeasedAuthToken should have comment or be unexported (golint)
    • Line 109: warning: exported function LoadBriefcase should have comment or be unexported (golint)
    • Line 175: warning: exported method Briefcase.SaveAs should have comment or be unexported (golint)
    • vault-ctrl-tool/util/flags.go
    • Line 11: warning: comment on exported type CliFlags should be of the form "CliFlags ..." (with optional leading article) (golint)
    • Line 38: warning: exported type RunMode should have comment or be unexported (golint)
    • Line 41: warning: exported const ModeShowVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported type AuthMechanismType should have comment or be unexported (golint)
    • Line 52: warning: exported const EC2AMIAuth should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported method CliFlags.AuthMechanism should have comment or be unexported (golint)
    • Line 74: warning: exported method CliFlags.RunMode should have comment or be unexported (golint)
    • Line 96: warning: exported function ProcessFlags should have comment or be unexported (golint)
    • vault-ctrl-tool/vaulttoken/vault_token.go
    • Line 18: warning: exported var ErrNoValidVaultTokenAvailable should have comment or be unexported (golint)
    • Line 20: warning: exported type VaultToken should have comment or be unexported (golint)
    • Line 41: warning: exported function NewVaultToken should have comment or be unexported (golint)
    • vault-ctrl-tool/vaultclient/vaultclient.go
    • Line 11: warning: exported const SecretsServicePathV1 should have comment or be unexported (golint)
    • Line 12: warning: exported const SecretsServicePathV2 should have comment or be unexported (golint)
    • Line 14: warning: exported type VaultClient should have comment or be unexported (golint)
    • Line 34: warning: exported function NewVaultClient should have comment or be unexported (golint)
    • Line 96: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!