Preparing report...

Report for github.com/percona/pmm-client

A+    Excellent!    Found 17 issues across 44 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!


golint77%

Golint is a linter for Go source code.

    • pmm-client/pmm/qan_api.go
    • Line 36: warning: exported type API should have comment or be unexported (golint)
    • Line 48: warning: exported function NewAPI should have comment or be unexported (golint)
    • Line 60: warning: exported method API.Hostname should have comment or be unexported (golint)
    • Line 64: warning: exported method API.Ping should have comment or be unexported (golint)
    • Line 91: warning: exported method API.URL should have comment or be unexported (golint)
    • Line 95: warning: exported method API.Get should have comment or be unexported (golint)
    • Line 134: warning: exported method API.Post should have comment or be unexported (golint)
    • Line 138: warning: exported method API.Put should have comment or be unexported (golint)
    • Line 142: warning: exported method API.Delete should have comment or be unexported (golint)
    • pmm-client/tests/fakeapi/handlers.go
    • Line 55: warning: exported method FakeApi.AppendPrometheusAPIV1Query should have comment or be unexported (golint)
    • Line 83: warning: exported method FakeApi.AppendQanAPIInstancesId should have comment or be unexported (golint)
    • Line 114: warning: exported method FakeApi.AppendConsulV1CatalogService should have comment or be unexported (golint)
    • Line 149: warning: exported method FakeApi.AppendConsulV1CatalogRegister should have comment or be unexported (golint)
    • Line 151: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 176: warning: exported method FakeApi.AppendConsulV1KV should have comment or be unexported (golint)
    • Line 192: warning: exported method FakeApi.AppendQanAPIInstances should have comment or be unexported (golint)
    • Line 214: warning: exported method FakeApi.AppendQanAPIAgents should have comment or be unexported (golint)
    • Line 226: warning: exported method FakeApi.AppendManaged should have comment or be unexported (golint)
    • pmm-client/pmm/external.go
    • Line 30: warning: exported type ExternalLabelPair should have comment or be unexported (golint)
    • Line 35: warning: exported type ExternalTarget should have comment or be unexported (golint)
    • Line 110: warning: exported method Admin.AddExternalService should have comment or be unexported (golint)
    • pmm-client/pmm/list.go
    • Line 34: warning: comment on exported type ServiceStatus should be of the form "ServiceStatus ..." (with optional leading article) (golint)
    • Line 70: warning: exported type List should have comment or be unexported (golint)
    • pmm-client/pmm/constants.go
    • Line 30: warning: exported const NameRegex should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: comment on exported var Version should be of the form "Version ..." (golint)
    • Line 38: warning: comment on exported var RootDir should be of the form "RootDir ..." (golint)
    • Line 42: warning: exported var PMMBaseDir should have comment or be unexported (golint)
    • Line 54: warning: exported type Errors should have comment or be unexported (golint)
    • pmm-client/pmm/pmm.go
    • Line 202: warning: exported const ServerInfoTemplate should have comment (or a comment on this block) or be unexported (golint)
    • Line 210: warning: exported type ServerInfo should have comment or be unexported (golint)
    • pmm-client/pmm/managed/client.go
    • Line 36: warning: exported const ErrCanceled should have comment (or a comment on this block) or be unexported (golint)
    • Line 54: warning: exported type Error should have comment or be unexported (golint)
    • Line 63: warning: exported type Client should have comment or be unexported (golint)
    • Line 71: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 143: warning: exported method Client.ScrapeConfigsList should have comment or be unexported (golint)
    • Line 151: warning: exported method Client.ScrapeConfigsGet should have comment or be unexported (golint)
    • Line 159: warning: exported method Client.ScrapeConfigsCreate should have comment or be unexported (golint)
    • Line 163: warning: exported method Client.ScrapeConfigsUpdate should have comment or be unexported (golint)
    • Line 167: warning: exported method Client.ScrapeConfigsDelete should have comment or be unexported (golint)
    • pmm-client/pmm/managed/models.go
    • Line 22: warning: exported type APIBasicAuth should have comment or be unexported (golint)
    • Line 30: warning: exported type APITLSConfig should have comment or be unexported (golint)
    • Line 35: warning: exported type APILabelPair should have comment or be unexported (golint)
    • Line 43: warning: exported type APIStaticConfig should have comment or be unexported (golint)
    • Line 51: warning: exported type APIScrapeConfig should have comment or be unexported (golint)
    • Line 77: warning: exported type ScrapeTargetHealthHealth should have comment or be unexported (golint)
    • Line 88: warning: exported type APIScrapeTargetHealth should have comment or be unexported (golint)
    • Line 105: warning: exported type APIScrapeConfigsListResponse should have comment or be unexported (golint)
    • Line 113: warning: exported type APIScrapeConfigsGetResponse should have comment or be unexported (golint)
    • Line 121: warning: exported type APIScrapeConfigsCreateRequest should have comment or be unexported (golint)
    • Line 129: warning: exported type APIScrapeConfigsUpdateRequest should have comment or be unexported (golint)
    • pmm-client/tests/fakeapi/fakeapi.go
    • Line 29: warning: exported type FakeApi should have comment or be unexported (golint)
    • Line 37: warning: exported function New should have comment or be unexported (golint)
    • Line 63: warning: exported method FakeApi.Append should have comment or be unexported (golint)

gocyclo77%

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.

    • pmm-client/pmm/pmm.go
    • Line 360: warning: cyclomatic complexity 28 of function (*Admin).RemoveAllMonitoring() is high (> 15) (gocyclo)
    • Line 70: warning: cyclomatic complexity 16 of function (*Admin).SetAPI() is high (> 15) (gocyclo)
    • pmm-client/pmm/queries.go
    • Line 41: warning: cyclomatic complexity 28 of function (*Admin).AddQueries() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 17 of function (*Admin).RemoveQueries() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!