Preparing report...

Report for github.com/pravega/pravega-operator

A+    Excellent!    Found 22 issues across 54 files

Tweet

gofmt92%

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!


gocyclo88%

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.


golint70%

Golint is a linter for Go source code.

    • pravega-operator/pkg/apis/pravega/v1beta1/status.go
    • Line 20: warning: exported type ClusterConditionType should have comment or be unexported (golint)
    • Line 23: warning: exported const ClusterConditionPodsReady should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: comment on exported const UpdatingControllerReason should be of the form "UpdatingControllerReason ..." (golint)
    • Line 102: warning: exported method ClusterStatus.Init should have comment or be unexported (golint)
    • Line 123: warning: exported method ClusterStatus.SetPodsReadyConditionTrue should have comment or be unexported (golint)
    • Line 128: warning: exported method ClusterStatus.SetPodsReadyConditionFalse should have comment or be unexported (golint)
    • Line 133: warning: exported method ClusterStatus.SetUpgradingConditionTrue should have comment or be unexported (golint)
    • Line 138: warning: exported method ClusterStatus.SetUpgradingConditionFalse should have comment or be unexported (golint)
    • Line 143: warning: exported method ClusterStatus.SetErrorConditionTrue should have comment or be unexported (golint)
    • Line 148: warning: exported method ClusterStatus.SetErrorConditionFalse should have comment or be unexported (golint)
    • Line 153: warning: exported method ClusterStatus.SetRollbackConditionTrue should have comment or be unexported (golint)
    • Line 157: warning: exported method ClusterStatus.SetRollbackConditionFalse should have comment or be unexported (golint)
    • Line 173: warning: exported method ClusterStatus.GetClusterCondition should have comment or be unexported (golint)
    • Line 206: warning: exported method ClusterStatus.AddToVersionHistory should have comment or be unexported (golint)
    • Line 214: warning: exported method ClusterStatus.GetLastVersion should have comment or be unexported (golint)
    • Line 219: warning: exported method ClusterStatus.IsClusterInErrorState should have comment or be unexported (golint)
    • Line 227: warning: exported method ClusterStatus.IsClusterInUpgradeFailedState should have comment or be unexported (golint)
    • Line 238: warning: exported method ClusterStatus.IsClusterInUpgradeFailedOrRollbackState should have comment or be unexported (golint)
    • Line 245: warning: exported method ClusterStatus.IsClusterInRollbackState should have comment or be unexported (golint)
    • Line 256: warning: exported method ClusterStatus.IsClusterInUpgradingState should have comment or be unexported (golint)
    • Line 267: warning: exported method ClusterStatus.IsClusterInRollbackFailedState should have comment or be unexported (golint)
    • Line 278: warning: exported method ClusterStatus.IsClusterInReadyState should have comment or be unexported (golint)
    • Line 286: warning: exported method ClusterStatus.UpdateProgress should have comment or be unexported (golint)
    • Line 295: warning: exported method ClusterStatus.GetLastCondition should have comment or be unexported (golint)
    • pravega-operator/pkg/controller/pravegacluster/pravegacluster_controller.go
    • Line 645: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 715: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 765: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1005: warning: comment on exported method ReconcilePravegaCluster.IsClusterUpgradingTo07 should be of the form "IsClusterUpgradingTo07 ..." (golint)
    • pravega-operator/pkg/util/zookeeper_util.go
    • Line 22: warning: comment on exported const PravegaPath should be of the form "PravegaPath ..." (golint)
    • Line 24: warning: exported const ZkFinalizer should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: comment on exported function DeleteAllZnodes should be of the form "DeleteAllZnodes ..." (golint)
    • Line 62: warning: comment on exported function ListSubTreeBFS should be of the form "ListSubTreeBFS ..." (golint)
    • pravega-operator/pkg/controller/pravega/pravega_controller.go
    • Line 28: warning: exported function MakeControllerDeployment should have comment or be unexported (golint)
    • Line 53: warning: exported function MakeControllerPodTemplate should have comment or be unexported (golint)
    • Line 258: warning: exported function MakeControllerConfigMap should have comment or be unexported (golint)
    • Line 312: warning: exported function MakeControllerService should have comment or be unexported (golint)
    • Line 350: warning: exported function MakeControllerPodDisruptionBudget should have comment or be unexported (golint)
    • pravega-operator/pkg/controller/pravega/pravega_segmentstore.go
    • Line 34: warning: exported function MakeSegmentStoreStatefulSet should have comment or be unexported (golint)
    • Line 64: warning: exported function MakeSegmentStorePodTemplate should have comment or be unexported (golint)
    • Line 269: warning: exported function MakeSegmentstoreConfigMap should have comment or be unexported (golint)
    • Line 474: warning: exported function MakeSegmentStoreHeadlessService should have comment or be unexported (golint)
    • Line 534: warning: exported function MakeSegmentStoreExternalServices should have comment or be unexported (golint)
    • Line 588: warning: exported function MakeSegmentstorePodDisruptionBudget should have comment or be unexported (golint)
    • pravega-operator/pkg/util/pravegacluster.go
    • Line 31: warning: exported const MajorMinorVersionRegexp should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: comment on exported function IsVersionBelow07 should be of the form "IsVersionBelow07 ..." (golint)
    • Line 50: warning: exported function CompareConfigMap should have comment or be unexported (golint)
    • Line 58: warning: exported function IsOrphan should have comment or be unexported (golint)
    • Line 72: warning: exported function HealthcheckCommand should have comment or be unexported (golint)
    • Line 76: warning: comment on exported function ControllerReadinessCheck should be of the form "ControllerReadinessCheck ..." (golint)
    • Line 105: warning: exported function ContainsString should have comment or be unexported (golint)
    • Line 114: warning: exported function RemoveString should have comment or be unexported (golint)
    • Line 124: warning: exported function GetPodVersion should have comment or be unexported (golint)
    • Line 128: warning: exported function CompareVersions should have comment or be unexported (golint)
    • Line 148: warning: exported function ContainsVersion should have comment or be unexported (golint)
    • Line 158: warning: exported function NormalizeVersion should have comment or be unexported (golint)
    • Line 173: warning: comment on exported function UpdateOneJVMOption should be of the form "UpdateOneJVMOption ..." (golint)
    • Line 210: warning: comment on exported function GenerateJVMOption should be of the form "GenerateJVMOption ..." (golint)
    • Line 227: warning: comment on exported function OverrideDefaultJVMOptions should be of the form "OverrideDefaultJVMOptions ..." (golint)
    • Line 259: warning: exported function IsPodReady should have comment or be unexported (golint)
    • Line 268: warning: exported function IsPravegaContainer should have comment or be unexported (golint)
    • Line 272: warning: exported function IsPodFaulty should have comment or be unexported (golint)
    • Line 282: warning: exported function DownwardAPIEnv should have comment or be unexported (golint)
    • Line 305: warning: exported function PodAntiAffinity should have comment or be unexported (golint)
    • pravega-operator/pkg/apis/pravega/v1beta1/pravegacluster_types.go
    • Line 45: warning: exported var Mgr should have comment or be unexported (golint)
    • Line 87: warning: comment on exported type PravegaCluster should be of the form "PravegaCluster ..." (with optional leading article) (golint)
    • Line 252: warning: exported type TLSPolicy should have comment or be unexported (golint)
    • Line 257: warning: exported type StaticTLS should have comment or be unexported (golint)
    • Line 263: warning: exported method TLSPolicy.IsSecureController should have comment or be unexported (golint)
    • Line 270: warning: exported method TLSPolicy.IsSecureSegmentStore should have comment or be unexported (golint)
    • Line 277: warning: exported method TLSPolicy.IsCaBundlePresent should have comment or be unexported (golint)
    • Line 284: warning: exported type AuthenticationParameters should have comment or be unexported (golint)
    • Line 301: warning: exported method AuthenticationParameters.IsEnabled should have comment or be unexported (golint)
    • Line 316: warning: exported method PravegaCluster.ConvertTo should have comment or be unexported (golint)
    • Line 316: warning: receiver name src should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 321: warning: receiver name dst should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 411: warning: exported method PravegaCluster.ConvertFrom should have comment or be unexported (golint)
    • Line 411: warning: receiver name dst should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 433: warning: receiver name dst should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 457: warning: receiver name dst should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 534: warning: receiver name dst should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 891: warning: exported method PravegaCluster.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 955: warning: exported method PravegaCluster.ValidatePravegaVersion should have comment or be unexported (golint)
    • Line 1033: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1052: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1053: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1077: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1078: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1102: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1103: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1127: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1128: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1152: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1153: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1177: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1178: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1202: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1203: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1227: warning: don't use underscores in Go names; var old_key should be oldKey (golint)
    • Line 1228: warning: don't use underscores in Go names; var new_key should be newKey (golint)
    • Line 1242: warning: comment on exported method PravegaCluster.StatefulSetNameForSegmentstore should be of the form "StatefulSetNameForSegmentstore ..." (golint)
    • Line 1250: warning: comment on exported method PravegaCluster.StatefulSetNameForSegmentstoreAbove07 should be of the form "StatefulSetNameForSegmentstoreAbove07 ..." (golint)
    • Line 1255: warning: comment on exported method PravegaCluster.StatefulSetNameForSegmentstoreBelow07 should be of the form "StatefulSetNameForSegmentstoreBelow07 ..." (golint)
    • Line 1260: warning: exported method PravegaCluster.PravegaControllerServiceURL should have comment or be unexported (golint)
    • Line 1264: warning: exported method PravegaCluster.LabelsForController should have comment or be unexported (golint)
    • Line 1275: warning: exported method PravegaCluster.LabelsForSegmentStore should have comment or be unexported (golint)
    • Line 1286: warning: exported method PravegaCluster.AnnotationsForController should have comment or be unexported (golint)
    • Line 1296: warning: exported method PravegaCluster.AnnotationsForSegmentStore should have comment or be unexported (golint)
    • Line 1306: warning: exported method PravegaCluster.LabelsForPravegaCluster should have comment or be unexported (golint)
    • Line 1306: warning: receiver name pravegaCluster should be consistent with previous receiver name p for PravegaCluster (golint)
    • Line 1313: warning: exported method PravegaCluster.PdbNameForController should have comment or be unexported (golint)
    • Line 1317: warning: exported method PravegaCluster.ConfigMapNameForController should have comment or be unexported (golint)
    • Line 1321: warning: exported method PravegaCluster.ServiceNameForController should have comment or be unexported (golint)
    • Line 1325: warning: exported method PravegaCluster.ServiceNameForSegmentStore should have comment or be unexported (golint)
    • Line 1332: warning: exported method PravegaCluster.ServiceNameForSegmentStoreBelow07 should have comment or be unexported (golint)
    • Line 1336: warning: exported method PravegaCluster.ServiceNameForSegmentStoreAbove07 should have comment or be unexported (golint)
    • Line 1340: warning: exported method PravegaCluster.HeadlessServiceNameForSegmentStore should have comment or be unexported (golint)
    • Line 1344: warning: exported method PravegaCluster.HeadlessServiceNameForBookie should have comment or be unexported (golint)
    • Line 1348: warning: exported method PravegaCluster.DeploymentNameForController should have comment or be unexported (golint)
    • Line 1352: warning: exported method PravegaCluster.PdbNameForSegmentstore should have comment or be unexported (golint)
    • Line 1356: warning: exported method PravegaCluster.ConfigMapNameForSegmentstore should have comment or be unexported (golint)
    • Line 1360: warning: exported method PravegaCluster.GetClusterExpectedSize should have comment or be unexported (golint)
    • Line 1364: warning: exported method PravegaCluster.PravegaImage should have comment or be unexported (golint)
    • Line 1368: warning: exported method PravegaCluster.PravegaTargetImage should have comment or be unexported (golint)
    • Line 1375: warning: comment on exported method PravegaCluster.WaitForClusterToTerminate should be of the form "WaitForClusterToTerminate ..." (golint)
    • Line 1402: warning: exported method PravegaCluster.NewEvent should have comment or be unexported (golint)
    • Line 1431: warning: exported method PravegaCluster.NewApplicationEvent should have comment or be unexported (golint)
    • pravega-operator/pkg/apis/pravega/v1alpha1/status.go
    • Line 20: warning: exported type ClusterConditionType should have comment or be unexported (golint)
    • Line 23: warning: exported const ClusterConditionPodsReady should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: comment on exported const UpdatingControllerReason should be of the form "UpdatingControllerReason ..." (golint)
    • Line 102: warning: exported method ClusterStatus.Init should have comment or be unexported (golint)
    • Line 123: warning: exported method ClusterStatus.SetPodsReadyConditionTrue should have comment or be unexported (golint)
    • Line 128: warning: exported method ClusterStatus.SetPodsReadyConditionFalse should have comment or be unexported (golint)
    • Line 133: warning: exported method ClusterStatus.SetUpgradingConditionTrue should have comment or be unexported (golint)
    • Line 138: warning: exported method ClusterStatus.SetUpgradingConditionFalse should have comment or be unexported (golint)
    • Line 143: warning: exported method ClusterStatus.SetErrorConditionTrue should have comment or be unexported (golint)
    • Line 148: warning: exported method ClusterStatus.SetErrorConditionFalse should have comment or be unexported (golint)
    • Line 153: warning: exported method ClusterStatus.SetRollbackConditionTrue should have comment or be unexported (golint)
    • Line 157: warning: exported method ClusterStatus.SetRollbackConditionFalse should have comment or be unexported (golint)
    • Line 173: warning: exported method ClusterStatus.GetClusterCondition should have comment or be unexported (golint)
    • Line 206: warning: exported method ClusterStatus.AddToVersionHistory should have comment or be unexported (golint)
    • Line 214: warning: exported method ClusterStatus.GetLastVersion should have comment or be unexported (golint)
    • Line 219: warning: exported method ClusterStatus.IsClusterInErrorState should have comment or be unexported (golint)
    • Line 227: warning: exported method ClusterStatus.IsClusterInUpgradeFailedState should have comment or be unexported (golint)
    • Line 238: warning: exported method ClusterStatus.IsClusterInUpgradeFailedOrRollbackState should have comment or be unexported (golint)
    • Line 245: warning: exported method ClusterStatus.IsClusterInRollbackState should have comment or be unexported (golint)
    • Line 256: warning: exported method ClusterStatus.IsClusterInUpgradingState should have comment or be unexported (golint)
    • Line 267: warning: exported method ClusterStatus.IsClusterInRollbackFailedState should have comment or be unexported (golint)
    • Line 278: warning: exported method ClusterStatus.IsClusterInReadyState should have comment or be unexported (golint)
    • Line 286: warning: exported method ClusterStatus.UpdateProgress should have comment or be unexported (golint)
    • Line 295: warning: exported method ClusterStatus.GetLastCondition should have comment or be unexported (golint)
    • pravega-operator/pkg/test/e2e/e2eutil/pravegacluster_util.go
    • Line 35: warning: exported var RetryInterval should have comment or be unexported (golint)
    • Line 45: warning: exported function InitialSetup should have comment or be unexported (golint)
    • Line 265: warning: exported function DeletePods should have comment or be unexported (golint)
    • Line 442: warning: comment on exported function WaitForBookkeeperClusterToBecomeReady should be of the form "WaitForBookkeeperClusterToBecomeReady ..." (golint)
    • Line 590: warning: exported function WaitForCMPravegaClusterToUpgrade should have comment or be unexported (golint)
    • Line 875: warning: exported function CheckServiceExists should have comment or be unexported (golint)
    • Line 883: warning: exported function CheckStsExists should have comment or be unexported (golint)
    • Line 893: warning: exported function CheckConfigMapUpdated should have comment or be unexported (golint)
    • Line 912: warning: exported function RestartTier2 should have comment or be unexported (golint)
    • pravega-operator/pkg/controller/pravegacluster/upgrade.go
    • Line 409: warning: comment on exported method ReconcilePravegaCluster.IsClusterRollbackingFrom07 should be of the form "IsClusterRollbackingFrom07 ..." (golint)
    • Line 417: warning: comment on exported method ReconcilePravegaCluster.IsAbove07STSPresent should be of the form "IsAbove07STSPresent ..." (golint)
    • pravega-operator/pkg/apis/pravega/v1alpha1/pravegacluster_types.go
    • Line 33: warning: exported method PravegaCluster.Hub should have comment or be unexported (golint)
    • Line 35: warning: exported method PravegaCluster.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 60: warning: comment on exported type PravegaCluster should be of the form "PravegaCluster ..." (with optional leading article) (golint)
    • Line 207: warning: exported type TLSPolicy should have comment or be unexported (golint)
    • Line 212: warning: exported type StaticTLS should have comment or be unexported (golint)
    • Line 218: warning: exported method TLSPolicy.IsSecureController should have comment or be unexported (golint)
    • Line 225: warning: exported method TLSPolicy.IsSecureSegmentStore should have comment or be unexported (golint)
    • Line 232: warning: exported method TLSPolicy.IsCaBundlePresent should have comment or be unexported (golint)
    • Line 239: warning: exported type AuthenticationParameters should have comment or be unexported (golint)
    • Line 250: warning: exported method AuthenticationParameters.IsEnabled should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell96%

Misspell Finds commonly misspelled English words