Preparing report...

Report for github.com/openfaas/faas-cli

A+    Excellent!    Found 39 issues across 142 files

Tweet

gofmt97%

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!


golint86%

Golint is a linter for Go source code.

    • faas-cli/schema/secret.go
    • Line 3: warning: exported type KubernetesSecret should have comment or be unexported (golint)
    • Line 10: warning: exported type KubernetesSecretMetadata should have comment or be unexported (golint)
    • faas-cli/commands/auth.go
    • Line 313: warning: exported type ClientCredentialsReq should have comment or be unexported (golint)
    • Line 320: warning: exported type ClientCredentialsToken should have comment or be unexported (golint)
    • faas-cli/commands/version_test.go
    • Line 179: warning: don't use underscores in Go names; const gateway_response_0_8_4_onwards should be gatewayResponse0_8_4Onwards (golint)
    • Line 195: warning: don't use underscores in Go names; const gateway_response_0_8_4_onwards_nil_values should be gatewayResponse0_8_4OnwardsNilValues (golint)
    • Line 204: warning: don't use underscores in Go names; const gateway_response_prior_to_0_8_4 should be gatewayResponsePriorTo0_8_4 (golint)
    • faas-cli/version/version.go
    • Line 3: warning: exported const UserAgent should have comment or be unexported (golint)
    • Line 6: warning: exported var GitCommit should have its own declaration (golint)
    • Line 9: warning: exported function BuildVersion should have comment or be unexported (golint)
    • faas-cli/versioncontrol/git.go
    • Line 17: warning: comment on exported var GitCloneDefault should be of the form "GitCloneDefault ..." (golint)
    • Line 88: warning: exported function GetGitBranch should have comment or be unexported (golint)
    • faas-cli/stack/stack_test.go
    • Line 15: warning: don't use underscores in Go names; const TestData_1 should be TestData1 (golint)
    • Line 49: warning: don't use underscores in Go names; const TestData_2 should be TestData2 (golint)
    • Line 60: warning: don't use underscores in Go names; var ParseYAMLTests_Regex should be ParseYAMLTestsRegex (golint)
    • Line 167: warning: don't use underscores in Go names; var ParseYAMLTests_Filter should be ParseYAMLTestsFilter (golint)
    • faas-cli/commands/registry_login.go
    • Line 184: warning: exported type Auth should have comment or be unexported (golint)
    • Line 188: warning: exported type RegistryAuth should have comment or be unexported (golint)
    • Line 192: warning: exported type ECRRegistryAuth should have comment or be unexported (golint)
    • faas-cli/schema/knative/v1/serving.go
    • Line 8: warning: exported const APIVersionLatest should have comment or be unexported (golint)
    • Line 20: warning: exported type ServingServiceSpec should have comment or be unexported (golint)
    • Line 24: warning: exported type ServingServiceSpecTemplateSpec should have comment or be unexported (golint)
    • Line 28: warning: exported type ServingServiceSpecTemplate should have comment or be unexported (golint)
    • Line 32: warning: exported type ServingSpecContainersContainerSpec should have comment or be unexported (golint)
    • Line 38: warning: exported type VolumeMount should have comment or be unexported (golint)
    • Line 44: warning: exported type Volume should have comment or be unexported (golint)
    • Line 49: warning: exported type Secret should have comment or be unexported (golint)
    • Line 53: warning: exported type EnvPair should have comment or be unexported (golint)
    • faas-cli/flags/log_format.go
    • Line 11: warning: exported const PlainLogFormat should have comment or be unexported (golint)
    • Line 12: warning: exported const KeyValueLogFormat should have comment or be unexported (golint)
    • Line 13: warning: exported const JSONLogFormat should have comment or be unexported (golint)
    • faas-cli/config/config_file.go
    • Line 35: warning: exported const DefaultDir should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported type AuthConfig should have comment or be unexported (golint)
    • faas-cli/test/utils.go
    • Line 13: warning: exported type Request should have comment or be unexported (golint)
    • Line 122: warning: exported function CaptureStdout should have comment or be unexported (golint)
    • faas-cli/stack/language_template.go
    • Line 16: warning: exported function ParseYAMLForLanguageTemplate should have comment or be unexported (golint)
    • Line 51: warning: exported function IsValidTemplate should have comment or be unexported (golint)
    • faas-cli/proxy/auth.go
    • Line 22: warning: exported method BasicAuth.Set should have comment or be unexported (golint)
    • Line 32: warning: exported method BearerToken.Set should have comment or be unexported (golint)
    • faas-cli/commands/update_gitignore.go
    • Line 18: warning: don't use underscores in Go names; func result updated_content should be updatedContent (golint)
    • Line 51: warning: don't use underscores in Go names; var string_content should be stringContent (golint)
    • Line 52: warning: don't use underscores in Go names; var write_content should be writeContent (golint)

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.


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words