Preparing report...

Report for github.com/VictoriaMetrics/operator

(v0.23.3)

A+    Excellent!    Found 44 issues across 92 files

Tweet

gofmt93%

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!


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.

    • controllers/factory/vmuser.go
    • Line 369: warning: cyclomatic complexity 31 of function genUrlMaps() is high (> 15) (gocyclo)
    • Line 253: warning: cyclomatic complexity 19 of function FetchCRDCache() is high (> 15) (gocyclo)
    • Line 132: warning: cyclomatic complexity 18 of function injectAuthSettings() is high (> 15) (gocyclo)
    • controllers/factory/vmcluster.go
    • Line 41: warning: cyclomatic complexity 38 of function CreateOrUpdateVMCluster() is high (> 15) (gocyclo)
    • Line 518: warning: cyclomatic complexity 20 of function makePodSpecForVMSelect() is high (> 15) (gocyclo)
    • Line 1102: warning: cyclomatic complexity 19 of function makePodSpecForVMStorage() is high (> 15) (gocyclo)
    • Line 1002: warning: cyclomatic complexity 17 of function GenVMStorageSpec() is high (> 15) (gocyclo)
    • Line 422: warning: cyclomatic complexity 17 of function genVMSelectSpec() is high (> 15) (gocyclo)
    • controllers/factory/vmagent.go
    • Line 658: warning: cyclomatic complexity 42 of function loadTLSAssets() is high (> 15) (gocyclo)
    • Line 884: warning: cyclomatic complexity 33 of function BuildRemoteWrites() is high (> 15) (gocyclo)
    • Line 69: warning: cyclomatic complexity 19 of function CreateOrUpdateVMAgent() is high (> 15) (gocyclo)
    • controllers/factory/vmsingle.go
    • Line 352: warning: cyclomatic complexity 25 of function makeSpecForVMBackuper() is high (> 15) (gocyclo)
    • Line 151: warning: cyclomatic complexity 16 of function makeSpecForVMSingle() is high (> 15) (gocyclo)
    • controllers/factory/vmalert.go
    • Line 391: warning: cyclomatic complexity 26 of function buildVMAlertArgs() is high (> 15) (gocyclo)
    • Line 60: warning: cyclomatic complexity 24 of function CreateOrUpdateVMAlert() is high (> 15) (gocyclo)
    • Line 572: warning: cyclomatic complexity 18 of function loadTLSAssetsForVMAlert() is high (> 15) (gocyclo)
    • Line 657: warning: cyclomatic complexity 18 of function BuildNotifiersArgs() is high (> 15) (gocyclo)
    • controllers/factory/scrapes_build.go
    • Line 525: warning: cyclomatic complexity 56 of function generateServiceScrapeConfig() is high (> 15) (gocyclo)
    • Line 270: warning: cyclomatic complexity 45 of function generatePodScrapeConfig() is high (> 15) (gocyclo)
    • Line 866: warning: cyclomatic complexity 39 of function generateNodeScrapeConfig() is high (> 15) (gocyclo)
    • Line 42: warning: cyclomatic complexity 18 of function generateConfig() is high (> 15) (gocyclo)

golint67%

Golint is a linter for Go source code.

    • controllers/factory/vmagent.go
    • Line 41: warning: exported function CreateOrUpdateVMAgentService should have comment or be unexported (golint)
    • Line 69: warning: exported function CreateOrUpdateVMAgent should have comment or be unexported (golint)
    • Line 603: warning: exported function CreateOrUpdateTlsAssets should have comment or be unexported (golint)
    • Line 830: warning: exported function LoadRemoteWriteSecrets should have comment or be unexported (golint)
    • Line 845: warning: exported function BuildRemoteWriteSettings should have comment or be unexported (golint)
    • Line 884: warning: exported function BuildRemoteWrites should have comment or be unexported (golint)
    • controllers/factory/psp/psp.go
    • Line 19: warning: exported type CRDObject should have comment or be unexported (golint)
    • Line 52: warning: exported function CreateServiceAccountForCRD should have comment or be unexported (golint)
    • Line 179: warning: exported function BuildPSP should have comment or be unexported (golint)
    • controllers/factory/k8stools/sts.go
    • Line 22: warning: exported type STSOptions should have comment or be unexported (golint)
    • Line 28: warning: exported function HandleSTSUpdate should have comment or be unexported (golint)
    • Line 194: warning: exported function PodIsReady should have comment or be unexported (golint)
    • controllers/factory/rulescm.go
    • Line 53: warning: exported function CreateOrUpdateRuleConfigMaps should have comment or be unexported (golint)
    • Line 218: warning: exported function SelectRules should have comment or be unexported (golint)
    • controllers/factory/vmsingle.go
    • Line 26: warning: exported const SecretsDir should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported function CreateVMSingleStorage should have comment or be unexported (golint)
    • Line 83: warning: exported function CreateOrUpdateVMSingle should have comment or be unexported (golint)
    • Line 323: warning: exported function CreateOrUpdateVMSingleService should have comment or be unexported (golint)
    • controllers/factory/vmuser.go
    • Line 253: warning: exported function FetchCRDCache should have comment or be unexported (golint)
    • Line 614: 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)
    • internal/config/config.go
    • Line 25: warning: exported const UnLimitedResource should have comment or be unexported (golint)
    • Line 32: warning: exported type Resource should have comment or be unexported (golint)
    • Line 43: warning: comment on exported type BaseOperatorConf should be of the form "BaseOperatorConf ..." (with optional leading article) (golint)
    • Line 292: warning: exported function MustGetBaseConfig should have comment or be unexported (golint)
    • Line 341: warning: exported function MustGetNamespaceListOptions should have comment or be unexported (golint)
    • Line 347: warning: exported type Labels should have comment or be unexported (golint)
    • Line 386: warning: exported type Namespaces should have comment or be unexported (golint)
    • internal/manager/manager.go
    • Line 25: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 60: warning: exported function RunManager should have comment or be unexported (golint)
    • controllers/converter/apis.go
    • Line 21: warning: exported function ConvertPromRule should have comment or be unexported (golint)
    • Line 68: warning: exported function ConvertServiceMonitor should have comment or be unexported (golint)
    • Line 114: warning: exported function ConvertEndpoint should have comment or be unexported (golint)
    • Line 142: warning: exported function ConvertBasicAuth should have comment or be unexported (golint)
    • Line 152: warning: exported function ConvertTlsConfig should have comment or be unexported (golint)
    • Line 168: warning: exported function ConvertPodTlsConfig should have comment or be unexported (golint)
    • Line 182: warning: exported function ConvertSecretOrConfigmap should have comment or be unexported (golint)
    • Line 189: warning: exported function ConvertRelabelConfig should have comment or be unexported (golint)
    • Line 209: warning: exported function ConvertPodEndpoints should have comment or be unexported (golint)
    • Line 239: warning: exported function ConvertPodMonitor should have comment or be unexported (golint)
    • Line 274: warning: exported function ConvertProbe should have comment or be unexported (golint)
    • controllers/factory/alertmanager.go
    • Line 59: warning: exported function CreateOrUpdateAlertManager should have comment or be unexported (golint)
    • Line 201: warning: exported function CreateOrUpdateAlertManagerService should have comment or be unexported (golint)
    • Line 533: warning: exported function MakeVolumeClaimTemplate should have comment or be unexported (golint)
    • Line 683: warning: exported function CreateOrUpdatePodDisruptionBudgetForAlertManager should have comment or be unexported (golint)
    • controllers/factory/vmalert.go
    • Line 31: warning: exported function CreateOrUpdateVMAlertService should have comment or be unexported (golint)
    • Line 60: warning: exported function CreateOrUpdateVMAlert should have comment or be unexported (golint)
    • Line 535: warning: exported function CreateOrUpdateTlsAssetsForVMAlert should have comment or be unexported (golint)
    • Line 657: warning: exported function BuildNotifiersArgs should have comment or be unexported (golint)
    • Line 745: warning: exported function CreateOrUpdatePodDisruptionBudgetForVMAlert should have comment or be unexported (golint)
    • controllers/factory/scrapes.go
    • Line 28: warning: exported function CreateOrUpdateConfigurationSecret should have comment or be unexported (golint)
    • Line 119: warning: exported function SelectServiceScrapes should have comment or be unexported (golint)
    • Line 174: warning: exported function SelectPodScrapes should have comment or be unexported (golint)
    • Line 211: warning: exported function SelectVMProbes should have comment or be unexported (golint)
    • Line 248: warning: exported function SelectVMNodeScrapes should have comment or be unexported (golint)
    • Line 286: warning: exported function SelectStaticScrapes should have comment or be unexported (golint)
    • Line 772: warning: exported function CreateVMServiceScrapeFromService should have comment or be unexported (golint)
    • e2e/suite/suite.go
    • Line 10: warning: should not use dot imports (golint)
    • Line 11: warning: should not use dot imports (golint)
    • Line 24: warning: exported var K8sClient should have comment or be unexported (golint)
    • Line 29: warning: exported function Before should have comment or be unexported (golint)
    • Line 102: warning: exported function After should have comment or be unexported (golint)
    • controllers/factory/vmcluster.go
    • Line 271: warning: exported function CreateOrUpdateVMSelectService should have comment or be unexported (golint)
    • Line 399: warning: exported function CreateOrUpdateVMStorageService should have comment or be unexported (golint)
    • Line 737: warning: exported function CreateOrUpdatePodDisruptionBudgetForVMSelect should have comment or be unexported (golint)
    • Line 982: warning: exported function CreateOrUpdatePodDisruptionBudgetForVMInsert should have comment or be unexported (golint)
    • Line 1002: warning: exported function GenVMStorageSpec should have comment or be unexported (golint)
    • Line 1382: warning: exported function CreateOrUpdatePodDisruptionBudgetForVMStorage should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell93%

Misspell Finds commonly misspelled English words