Preparing report...

Report for github.com/clusternet/clusternet

(v0.8.0)

A+    Excellent!    Found 56 issues across 223 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!


gocyclo98%

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.


golint74%

Golint is a linter for Go source code.

    • pkg/apis/apps/v1alpha1/localization.go
    • Line 70: warning: exported type OverridePolicy should have comment or be unexported (golint)
    • Line 73: warning: comment on exported const ApplyNow should be of the form "ApplyNow ..." (golint)
    • Line 76: warning: comment on exported const ApplyLater should be of the form "ApplyLater ..." (golint)
    • Line 81: warning: exported type OverrideType should have comment or be unexported (golint)
    • pkg/apis/apps/v1alpha1/description.go
    • Line 75: warning: exported type DescriptionDeployer should have comment or be unexported (golint)
    • Line 78: warning: exported const DescriptionHelmDeployer should have comment (or a comment on this block) or be unexported (golint)
    • Line 82: warning: exported type DescriptionPhase should have comment or be unexported (golint)
    • Line 85: warning: exported const DescriptionPhaseSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 99: warning: exported type ChartReference should have comment or be unexported (golint)
    • pkg/utils/deployer.go
    • Line 91: warning: exported function DeployableByAgent should have comment or be unexported (golint)
    • Line 108: warning: exported function ReconcileHelmRelease should have comment or be unexported (golint)
    • Line 211: warning: exported function GetOverrides should have comment or be unexported (golint)
    • Line 255: warning: exported function GenerateHelmReleaseName should have comment or be unexported (golint)
    • Line 259: warning: exported function UpdateHelmReleaseStatus should have comment or be unexported (golint)
    • Line 337: warning: exported type ResourceCallbackHandler should have comment or be unexported (golint)
    • Line 339: warning: exported function ApplyDescription should have comment or be unexported (golint)
    • Line 431: warning: exported function OffloadDescription should have comment or be unexported (golint)
    • Line 486: warning: exported function ApplyResourceWithRetry should have comment or be unexported (golint)
    • Line 512: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 553: warning: exported function DeleteResourceWithRetry should have comment or be unexported (golint)
    • Line 608: warning: exported function GetDeployerCredentials should have comment or be unexported (golint)
    • Line 638: warning: exported function IsClusterLost should have comment or be unexported (golint)
    • pkg/registry/proxies/socket/rest.go
    • Line 43: warning: exported method REST.ShortNames should have comment or be unexported (golint)
    • Line 47: warning: exported method REST.NamespaceScoped should have comment or be unexported (golint)
    • Line 51: warning: exported method REST.Categories should have comment or be unexported (golint)
    • Line 55: warning: exported method REST.New should have comment or be unexported (golint)
    • pkg/hub/localizer/localizer.go
    • Line 76: warning: exported function NewLocalizer should have comment or be unexported (golint)
    • Line 124: warning: exported method Localizer.Run should have comment or be unexported (golint)
    • Line 255: warning: exported method Localizer.ApplyOverridesToDescription should have comment or be unexported (golint)
    • pkg/known/constant.go
    • Line 49: warning: comment on exported const NVIDIAGPUResourceName should be of the form "NVIDIAGPUResourceName ..." (golint)
    • Line 81: warning: exported const Category should have comment (or a comment on this block) or be unexported (golint)
    • pkg/utils/leaderelection.go
    • Line 30: warning: exported function GenerateIdentity should have comment or be unexported (golint)
    • Line 41: warning: exported function NewLeaderElectionConfigWithDefaultValue should have comment or be unexported (golint)
    • pkg/utils/patch.go
    • Line 31: warning: exported type MetaOption should have comment or be unexported (golint)
    • Line 35: warning: exported type MetaData should have comment or be unexported (golint)
    • Line 40: warning: exported type JsonPatchOption should have comment or be unexported (golint)
    • Line 46: warning: exported function PatchManifestLabelsAndAnnotations should have comment or be unexported (golint)
    • Line 67: warning: exported function PatchHelmChartLabelsAndAnnotations should have comment or be unexported (golint)
    • pkg/hub/deployer/helm/helm.go
    • Line 54: warning: exported type Deployer should have comment or be unexported (golint)
    • Line 89: warning: exported function NewDeployer should have comment or be unexported (golint)
    • Line 146: warning: exported method Deployer.Run should have comment or be unexported (golint)
    • pkg/apis/clusters/v1beta1/types.go
    • Line 27: warning: exported type ClusterType should have comment or be unexported (golint)
    • Line 37: warning: exported type ClusterSyncMode should have comment or be unexported (golint)
    • Line 136: warning: exported type ApprovedResult should have comment or be unexported (golint)
    • Line 307: warning: exported type NodeStatistics should have comment or be unexported (golint)
    • pkg/hub/deployer/generic/generic.go
    • Line 48: warning: exported type Deployer should have comment or be unexported (golint)
    • Line 72: warning: exported function NewDeployer should have comment or be unexported (golint)
    • Line 102: warning: exported method Deployer.Run should have comment or be unexported (golint)
    • Line 192: warning: exported method Deployer.PruneFeedsInDescription should have comment or be unexported (golint)
    • pkg/agent/deployer/deployer.go
    • Line 49: warning: exported type Deployer should have comment or be unexported (golint)
    • Line 61: warning: exported function NewDeployer should have comment or be unexported (golint)
    • Line 70: warning: exported method Deployer.Run should have comment or be unexported (golint)
    • Line 180: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pkg/agent/deployer/helm/helm.go
    • Line 36: warning: exported type Deployer should have comment or be unexported (golint)
    • Line 61: warning: exported function NewDeployer should have comment or be unexported (golint)
    • Line 92: warning: exported method Deployer.Run should have comment or be unexported (golint)
    • pkg/wrappers/clientgo/wrapper.go
    • Line 50: warning: exported method ClusternetTransport.RoundTrip should have comment or be unexported (golint)
    • Line 73: warning: exported function NewClusternetTransport should have comment or be unexported (golint)
    • pkg/registry/shadow/template/rest.go
    • Line 54: warning: exported const CoreGroupPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 404: warning: exported method REST.NewList should have comment or be unexported (golint)
    • Line 413: warning: exported method REST.ConvertToTable should have comment or be unexported (golint)
    • Line 418: warning: exported method REST.ShortNames should have comment or be unexported (golint)
    • Line 422: warning: exported method REST.SetShortNames should have comment or be unexported (golint)
    • Line 426: warning: exported method REST.SetName should have comment or be unexported (golint)
    • Line 430: warning: exported method REST.NamespaceScoped should have comment or be unexported (golint)
    • Line 434: warning: exported method REST.SetNamespaceScoped should have comment or be unexported (golint)
    • Line 438: warning: exported method REST.Categories should have comment or be unexported (golint)
    • Line 442: warning: exported method REST.SetGroup should have comment or be unexported (golint)
    • Line 446: warning: exported method REST.SetVersion should have comment or be unexported (golint)
    • Line 450: warning: exported method REST.SetKind should have comment or be unexported (golint)
    • Line 454: warning: exported method REST.New should have comment or be unexported (golint)
    • Line 461: warning: exported method REST.GroupVersionKind should have comment or be unexported (golint)
    • Line 466: warning: exported method REST.GroupVersion should have comment or be unexported (golint)
    • pkg/utils/feed.go
    • Line 44: warning: exported function GetLabelsSelectorFromFeed should have comment or be unexported (golint)
    • Line 68: warning: exported function ListManifestsBySelector should have comment or be unexported (golint)
    • Line 80: warning: exported function FormatFeed should have comment or be unexported (golint)
    • Line 89: warning: exported function RemoveFeedFromSubscription should have comment or be unexported (golint)
    • Line 124: warning: exported function FindObsoletedFeeds should have comment or be unexported (golint)
    • Line 139: warning: exported function FindBasesFromUIDs should have comment or be unexported (golint)
    • Line 155: warning: exported function HasFeed should have comment or be unexported (golint)
    • Line 165: warning: exported function HashSubscriptionSpec should have comment or be unexported (golint)
    • pkg/apis/apps/v1alpha1/helm.go
    • Line 71: warning: exported type HelmChartPhase should have comment or be unexported (golint)
    • Line 74: warning: exported const HelmChartFound should have comment (or a comment on this block) or be unexported (golint)
    • Line 78: warning: exported type HelmOptions should have comment or be unexported (golint)
    • pkg/registry/shadow/template/wrapper.go
    • Line 31: warning: exported type FixupFunc should have comment or be unexported (golint)
    • Line 33: warning: exported type WatchWrapper should have comment or be unexported (golint)
    • Line 45: warning: exported method WatchWrapper.Stop should have comment or be unexported (golint)
    • Line 52: warning: exported method WatchWrapper.ResultChan should have comment or be unexported (golint)
    • Line 56: warning: exported method WatchWrapper.Run should have comment or be unexported (golint)
    • Line 86: warning: exported function NewWatchWrapper should have comment or be unexported (golint)
    • pkg/agent/status_manager.go
    • Line 42: warning: exported type Manager should have comment or be unexported (golint)
    • Line 51: warning: exported function NewStatusManager should have comment or be unexported (golint)
    • Line 71: warning: exported method Manager.Run should have comment or be unexported (golint)
    • pkg/exchanger/exchanger.go
    • Line 46: warning: exported type Exchanger should have comment or be unexported (golint)
    • Line 63: warning: exported const TokenHeaderKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 73: warning: exported function NewExchanger should have comment or be unexported (golint)
    • Line 114: warning: exported method Exchanger.Connect should have comment or be unexported (golint)
    • Line 118: warning: exported method Exchanger.ProxyConnect should have comment or be unexported (golint)
    • Line 186: warning: exported method Exchanger.ClusterLocation should have comment or be unexported (golint)
    • pkg/agent/deployer/generic/generic.go
    • Line 50: warning: exported type Deployer should have comment or be unexported (golint)
    • Line 73: warning: exported function NewDeployer should have comment or be unexported (golint)
    • Line 112: warning: exported method Deployer.Run should have comment or be unexported (golint)
    • Line 147: warning: exported method Deployer.ResourceCallbackHandler should have comment or be unexported (golint)
    • Line 201: warning: exported method Deployer.ControllerHasStarted should have comment or be unexported (golint)
    • Line 206: 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 211: warning: exported method Deployer.AddController should have comment or be unexported (golint)
    • Line 216: 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)
    • pkg/utils/chart.go
    • Line 57: warning: exported var Settings should have comment or be unexported (golint)
    • Line 141: warning: exported function InstallRelease should have comment or be unexported (golint)
    • Line 152: warning: exported function UpgradeRelease should have comment or be unexported (golint)
    • Line 161: warning: exported function UninstallRelease should have comment or be unexported (golint)
    • Line 174: warning: exported function ReleaseNeedsUpgrade should have comment or be unexported (golint)
    • Line 196: warning: exported function UpdateRepo should have comment or be unexported (golint)
    • Line 216: warning: exported type DeployContext should have comment or be unexported (golint)
    • Line 223: warning: exported function NewDeployContext should have comment or be unexported (golint)
    • Line 250: warning: exported method DeployContext.ToRawKubeConfigLoader should have comment or be unexported (golint)
    • Line 254: warning: exported method DeployContext.ToRESTConfig should have comment or be unexported (golint)
    • Line 258: warning: exported method DeployContext.ToDiscoveryClient should have comment or be unexported (golint)
    • Line 262: warning: exported method DeployContext.ToRESTMapper should have comment or be unexported (golint)
    • pkg/controllers/apps/description/description.go
    • Line 49: warning: exported type SyncHandlerFunc should have comment or be unexported (golint)
    • Line 71: warning: exported function NewController should have comment or be unexported (golint)
    • Line 378: warning: exported method Controller.UpdateDescriptionStatus should have comment or be unexported (golint)
    • pkg/controllers/apps/helmchart/helmchart.go
    • Line 48: warning: exported type SyncHandlerFunc should have comment or be unexported (golint)
    • Line 72: warning: exported function NewController should have comment or be unexported (golint)
    • Line 337: warning: exported method Controller.UpdateChartStatus should have comment or be unexported (golint)
    • pkg/version/verflag.go
    • Line 38: warning: exported type Version should have comment or be unexported (golint)
    • Line 43: warning: exported function AddVersionFlag should have comment or be unexported (golint)
    • Line 48: warning: exported function PrintAndExitIfRequested should have comment or be unexported (golint)
    • pkg/hub/deployer/deployer.go
    • Line 108: warning: exported function NewDeployer should have comment or be unexported (golint)
    • Line 202: warning: exported method Deployer.Run should have comment or be unexported (golint)
    • Line 394: 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)
    • pkg/utils/resourceclient.go
    • Line 27: warning: exported type ResourceClient should have comment or be unexported (golint)
    • Line 39: warning: exported function NewResourceClient should have comment or be unexported (golint)
    • pkg/hub/hub.go
    • Line 50: warning: comment on exported const DefaultThreadiness should be of the form "DefaultThreadiness ..." (golint)

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!


misspell99%

Misspell Finds commonly misspelled English words