Preparing report...

Report for github.com/Orange-OpenSource/nifikop

A+    Excellent!    Found 44 issues across 110 files

Tweet

gofmt95%

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.

    • nifikop/pkg/resources/nifi/nifi.go
    • Line 509: warning: cyclomatic complexity 38 of function (*Reconciler).reconcileNifiPod() is high (> 15) (gocyclo)
    • Line 105: warning: cyclomatic complexity 35 of function (*Reconciler).Reconcile() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 31 of function (*Reconciler).reconcileNifiPodDelete() is high (> 15) (gocyclo)
    • Line 444: warning: cyclomatic complexity 16 of function (*Reconciler).reconcileNifiPVC() is high (> 15) (gocyclo)

golint70%

Golint is a linter for Go source code.

    • nifikop/pkg/util/pki/common.go
    • Line 35: warning: exported const NodeCACertTemplate should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: comment on exported const SpiffeIdTemplate should be of the form "SpiffeIdTemplate ..." (golint)
    • Line 110: warning: exported function GetNodeUserName should have comment or be unexported (golint)
    • Line 115: warning: comment on exported function ClusterDNSNames should be of the form "ClusterDNSNames ..." (golint)
    • nifikop/pkg/resources/nifi/pod.go
    • Line 53: warning: exported const ContainerName should have comment (or a comment on this block) or be unexported (golint)
    • Line 291: warning: comment on exported function GetServerPort should be of the form "GetServerPort ..." (golint)
    • nifikop/pkg/clientwrappers/registryclient/registryclient.go
    • Line 15: warning: exported function ExistRegistryClient should have comment or be unexported (golint)
    • Line 38: warning: exported function CreateRegistryClient should have comment or be unexported (golint)
    • Line 59: warning: exported function SyncRegistryClient should have comment or be unexported (golint)
    • Line 87: warning: exported function RemoveRegistryClient should have comment or be unexported (golint)
    • nifikop/pkg/clientwrappers/parametercontext/parametercontext.go
    • Line 17: warning: exported function ExistParameterContext should have comment or be unexported (golint)
    • Line 40: warning: exported function CreateParameterContext should have comment or be unexported (golint)
    • Line 64: warning: exported function SyncParameterContext should have comment or be unexported (golint)
    • Line 116: warning: exported function RemoveParameterContext should have comment or be unexported (golint)
    • nifikop/pkg/clientwrappers/reportingtask/reportingtask.go
    • Line 19: warning: don't use underscores in Go names; const reportingTaskType_ should be reportingTaskType (golint)
    • Line 27: warning: exported function ExistReportingTaks should have comment or be unexported (golint)
    • Line 49: warning: exported function CreateReportingTask should have comment or be unexported (golint)
    • Line 69: warning: exported function SyncReportingTask should have comment or be unexported (golint)
    • Line 127: warning: exported function RemoveReportingTaks should have comment or be unexported (golint)
    • nifikop/pkg/util/zookeeper/common.go
    • Line 25: warning: comment on exported function GetHostnameAddress should be of the form "GetHostnameAddress ..." (golint)
    • Line 30: warning: comment on exported function GetPortAddress should be of the form "GetPortAddress ..." (golint)
    • nifikop/pkg/clientwrappers/usergroup/usergroup.go
    • Line 16: warning: exported function ExistUserGroup should have comment or be unexported (golint)
    • Line 41: warning: exported function CreateUserGroup should have comment or be unexported (golint)
    • Line 62: warning: exported function SyncUserGroup should have comment or be unexported (golint)
    • Line 147: warning: exported function RemoveUserGroup should have comment or be unexported (golint)
    • nifikop/pkg/clientwrappers/user/user.go
    • Line 16: warning: exported function ExistUser should have comment or be unexported (golint)
    • Line 39: warning: exported function FindUserByIdentity should have comment or be unexported (golint)
    • Line 67: warning: exported function CreateUser should have comment or be unexported (golint)
    • Line 89: warning: exported function SyncUser should have comment or be unexported (golint)
    • Line 162: warning: exported function RemoveUser should have comment or be unexported (golint)
    • nifikop/api/v1alpha1/nificluster_types.go
    • Line 28: warning: exported const ClusterListenerType should have comment (or a comment on this block) or be unexported (golint)
    • Line 101: warning: exported type ServicePolicy should have comment or be unexported (golint)
    • Line 109: warning: exported type PodPolicy should have comment or be unexported (golint)
    • Line 144: warning: exported type ReadOnlyConfig should have comment or be unexported (golint)
    • Line 209: warning: comment on exported type LogbackConfig should be of the form "LogbackConfig ..." (with optional leading article) (golint)
    • Line 217: warning: exported type BootstrapNotificationServicesConfig should have comment or be unexported (golint)
    • Line 336: warning: exported type ExternalServiceConfig should have comment or be unexported (golint)
    • Line 354: warning: exported type ExternalServiceSpec should have comment or be unexported (golint)
    • Line 412: warning: exported type PortConfig should have comment or be unexported (golint)
    • Line 452: warning: exported type PrometheusReportingTaskStatus should have comment or be unexported (golint)
    • Line 484: warning: exported type ManagedUser should have comment or be unexported (golint)
    • Line 493: warning: exported method ManagedUser.GetIdentity should have comment or be unexported (golint)
    • Line 512: warning: exported method NifiClusterSpec.GetInitContainerImage should have comment or be unexported (golint)
    • Line 520: warning: exported method ListenersConfig.GetClusterDomain should have comment or be unexported (golint)
    • Line 528: warning: exported method ReadOnlyConfig.GetMaximumTimerDrivenThreadCount should have comment or be unexported (golint)
    • Line 535: warning: exported method NifiClusterTaskSpec.GetDurationMinutes should have comment or be unexported (golint)
    • Line 570: warning: comment on exported method NodeConfig.GetNodeAnnotations should be of the form "GetNodeAnnotations ..." (golint)
    • Line 592: warning: comment on exported method NodeConfig.GetRunAsUser should be of the form "GetRunAsUser ..." (golint)
    • Line 602: warning: exported method NodeConfig.GetFSGroup should have comment or be unexported (golint)
    • Line 611: warning: comment on exported method NodeConfig.GetIsNode should be of the form "GetIsNode ..." (golint)
    • Line 619: warning: exported method NodeConfig.GetProvenanceStorage should have comment or be unexported (golint)
    • Line 634: warning: comment on exported method NifiProperties.GetAuthorizer should be of the form "GetAuthorizer ..." (golint)
    • Line 642: warning: comment on exported method NifiClusterSpec.GetMetricPort should be of the form "GetMetricPort ..." (golint)
    • nifikop/api/v1alpha1/common_types.go
    • Line 34: warning: comment on exported type ActionStep should be of the form "ActionStep ..." (with optional leading article) (golint)
    • Line 43: warning: comment on exported type InitClusterNode should be of the form "InitClusterNode ..." (with optional leading article) (golint)
    • Line 58: warning: exported method State.IsUpscale should have comment or be unexported (golint)
    • Line 62: warning: exported method State.IsDownscale should have comment or be unexported (golint)
    • Line 66: warning: exported method State.IsRunningState should have comment or be unexported (golint)
    • Line 70: warning: exported method State.IsRequiredState should have comment or be unexported (golint)
    • Line 74: warning: exported method State.Complete should have comment or be unexported (golint)
    • Line 146: warning: exported type AccessPolicy should have comment or be unexported (golint)
    • Line 165: warning: exported method AccessPolicy.GetResource should have comment or be unexported (golint)
    • Line 181: warning: comment on exported const GlobalAccessPolicyType should be of the form "GlobalAccessPolicyType ..." (golint)
    • Line 183: warning: comment on exported const ComponentAccessPolicyType should be of the form "ComponentAccessPolicyType ..." (golint)
    • Line 186: warning: comment on exported const ReadAccessPolicyAction should be of the form "ReadAccessPolicyAction ..." (golint)
    • Line 188: warning: comment on exported const WriteAccessPolicyAction should be of the form "WriteAccessPolicyAction ..." (golint)
    • Line 191: warning: comment on exported const FlowAccessPolicyResource should be of the form "FlowAccessPolicyResource ..." (golint)
    • Line 194: warning: comment on exported const ControllerAccessPolicyResource should be of the form "ControllerAccessPolicyResource ..." (golint)
    • Line 196: warning: comment on exported const ParameterContextAccessPolicyResource should be of the form "ParameterContextAccessPolicyResource ..." (golint)
    • Line 199: warning: comment on exported const ProvenanceAccessPolicyResource should be of the form "ProvenanceAccessPolicyResource ..." (golint)
    • Line 201: warning: comment on exported const RestrictedComponentsAccessPolicyResource should be of the form "RestrictedComponentsAccessPolicyResource ..." (golint)
    • Line 206: warning: comment on exported const PoliciesAccessPolicyResource should be of the form "PoliciesAccessPolicyResource ..." (golint)
    • Line 208: warning: comment on exported const TenantsAccessPolicyResource should be of the form "TenantsAccessPolicyResource ..." (golint)
    • Line 210: warning: comment on exported const SiteToSiteAccessPolicyResource should be of the form "SiteToSiteAccessPolicyResource ..." (golint)
    • Line 212: warning: comment on exported const SystemAccessPolicyResource should be of the form "SystemAccessPolicyResource ..." (golint)
    • Line 214: warning: comment on exported const ProxyAccessPolicyResource should be of the form "ProxyAccessPolicyResource ..." (golint)
    • Line 216: warning: comment on exported const CountersAccessPolicyResource should be of the form "CountersAccessPolicyResource ..." (golint)
    • Line 219: warning: comment on exported const ComponentsAccessPolicyResource should be of the form "ComponentsAccessPolicyResource ..." (golint)
    • Line 222: warning: comment on exported const OperationAccessPolicyResource should be of the form "OperationAccessPolicyResource ..." (golint)
    • Line 225: warning: comment on exported const ProvenanceDataAccessPolicyResource should be of the form "ProvenanceDataAccessPolicyResource ..." (golint)
    • Line 227: warning: comment on exported const DataAccessPolicyResource should be of the form "DataAccessPolicyResource ..." (golint)
    • Line 230: warning: comment on exported const PoliciesComponentAccessPolicyResource should be of the form "PoliciesComponentAccessPolicyResource ..." (golint)
    • Line 232: warning: comment on exported const DataTransferAccessPolicyResource should be of the form "DataTransferAccessPolicyResource ..." (golint)
    • Line 235: warning: comment on exported const ProcessGroupType should be of the form "ProcessGroupType ..." (golint)
    • Line 252: warning: comment on exported const DataflowStateRan should be of the form "DataflowStateRan ..." (golint)
    • Line 274: warning: comment on exported const TLSKey should be of the form "TLSKey ..." (golint)
    • Line 310: warning: comment on exported type NodeState should be of the form "NodeState ..." (with optional leading article) (golint)
    • Line 334: warning: comment on exported const GracefulDownscaleRequired should be of the form "GracefulDownscaleRequired ..." (golint)
    • Line 339: warning: comment on exported const GracefulDownscaleSucceeded should be of the form "GracefulDownscaleSucceeded ..." (golint)
    • Line 368: warning: comment on exported const RemovePodStatus should be of the form "RemovePodStatus ..." (golint)
    • nifikop/pkg/clientwrappers/scale/scale.go
    • Line 32: warning: comment on exported function UpScaleCluster should be of the form "UpScaleCluster ..." (golint)
    • Line 41: warning: comment on exported function DisconnectClusterNode should be of the form "DisconnectClusterNode ..." (golint)
    • Line 67: warning: comment on exported function OffloadClusterNode should be of the form "OffloadClusterNode ..." (golint)
    • Line 93: warning: comment on exported function ConnectClusterNode should be of the form "ConnectClusterNode ..." (golint)
    • Line 119: warning: comment on exported function RemoveClusterNode should be of the form "RemoveClusterNode ..." (golint)
    • Line 149: warning: comment on exported function CheckIfNCActionStepFinished should be of the form "CheckIfNCActionStepFinished ..." (golint)
    • Line 198: warning: exported function EnsureRemovedNodes should have comment or be unexported (golint)
    • Line 233: warning: should omit 2nd value from range; this loop is equivalent to `for nodeId := range ...` (golint)
    • nifikop/pkg/nificlient/common.go
    • Line 23: warning: exported var ErrNodeNotConnected should have comment or be unexported (golint)
    • Line 24: warning: exported var ErrNifiClusterNotReturned200 should have comment or be unexported (golint)
    • Line 25: warning: exported var ErrNifiClusterNotReturned201 should have comment or be unexported (golint)
    • Line 26: warning: exported var ErrNifiClusterReturned404 should have comment or be unexported (golint)
    • Line 27: warning: exported var ErrNifiClusterNodeNotFound should have comment or be unexported (golint)
    • Line 29: warning: exported var ErrNoNodeClientsAvailable should have comment or be unexported (golint)
    • nifikop/pkg/clientwrappers/common.go
    • Line 10: warning: exported function ErrorUpdateOperation should have comment or be unexported (golint)
    • Line 21: warning: exported function ErrorGetOperation should have comment or be unexported (golint)
    • Line 33: warning: exported function ErrorCreateOperation should have comment or be unexported (golint)
    • Line 45: warning: exported function ErrorRemoveOperation should have comment or be unexported (golint)
    • nifikop/pkg/k8sutil/resource.go
    • Line 137: warning: exported function IsPodContainsTerminatedContainer should have comment or be unexported (golint)
    • Line 146: warning: exported function IsPodContainsPendingContainer should have comment or be unexported (golint)
    • Line 155: warning: exported function PodReady should have comment or be unexported (golint)
    • nifikop/pkg/clientwrappers/accesspolicies/policies.go
    • Line 15: warning: exported function ExistAccessPolicies should have comment or be unexported (golint)
    • Line 34: warning: exported function CreateAccessPolicy should have comment or be unexported (golint)
    • Line 58: warning: exported function UpdateAccessPolicy should have comment or be unexported (golint)
    • Line 95: warning: exported function UpdateAccessPolicyEntity should have comment or be unexported (golint)
    • nifikop/api/v1alpha1/nifidataflow_types.go
    • Line 53: warning: exported type UpdateRequest should have comment or be unexported (golint)
    • Line 72: warning: exported type DropRequest should have comment or be unexported (golint)
    • Line 146: warning: exported method NifiDataflowSpec.GetRunOnce should have comment or be unexported (golint)
    • Line 153: warning: exported method NifiDataflowSpec.GetParentProcessGroupID should have comment or be unexported (golint)
    • nifikop/pkg/util/nifi/common.go
    • Line 26: warning: exported const PrefixNodeNameTemplate should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported function ParseStringToInt32 should have comment or be unexported (golint)
    • Line 56: warning: comment on exported function ComputeNodeName should be of the form "ComputeNodeName ..." (golint)
    • Line 62: warning: exported function ComputeRequestNiFiNodeService should have comment or be unexported (golint)
    • Line 72: warning: exported function ComputeRequestNiFiNodeNamespace should have comment or be unexported (golint)
    • Line 80: warning: exported function ComputeRequestNiFiNodeNamespaceFull should have comment or be unexported (golint)
    • Line 92: warning: exported function ComputeRequestNiFiNodeHostname should have comment or be unexported (golint)
    • Line 104: warning: exported function ComputeRequestNiFiNodeAddress should have comment or be unexported (golint)
    • Line 117: warning: exported function GenerateRequestNiFiNodeAddressFromCluster should have comment or be unexported (golint)
    • Line 129: warning: exported function GenerateRequestNiFiNodeHostnameFromCluster should have comment or be unexported (golint)
    • Line 140: warning: comment on exported function ComputeRequestNiFiAllNodeService should be of the form "ComputeRequestNiFiAllNodeService ..." (golint)
    • Line 149: warning: exported function ComputeRequestNiFiAllNodeNamespace should have comment or be unexported (golint)
    • Line 157: warning: exported function ComputeRequestNiFiAllNodeNamespaceFull should have comment or be unexported (golint)
    • Line 168: warning: exported function ComputeRequestNiFiAllNodeHostname should have comment or be unexported (golint)
    • Line 179: warning: exported function ComputeRequestNiFiAllNodeAddress should have comment or be unexported (golint)
    • Line 191: warning: exported function GenerateRequestNiFiAllNodeAddressFromCluster should have comment or be unexported (golint)
    • Line 202: warning: exported function GenerateRequestNiFiAllNodeHostnameFromCluster should have comment or be unexported (golint)
    • Line 214: warning: exported function ComputeHostListenerNodeHostname should have comment or be unexported (golint)
    • Line 225: warning: exported function ComputeHostListenerNodeAddress should have comment or be unexported (golint)
    • Line 238: warning: exported function GenerateHostListenerNodeAddressFromCluster should have comment or be unexported (golint)
    • Line 250: warning: exported function GenerateHostListenerNodeHostnameFromCluster should have comment or be unexported (golint)
    • Line 261: warning: exported function InternalListenerForComm should have comment or be unexported (golint)
    • nifikop/controllers/controller_common.go
    • Line 32: warning: exported var ClusterRefLabel should have comment or be unexported (golint)
    • Line 34: warning: comment on exported function RequeueWithError should be of the form "RequeueWithError ..." (golint)
    • Line 43: warning: exported function Requeue should have comment or be unexported (golint)
    • Line 47: warning: exported function RequeueAfter should have comment or be unexported (golint)
    • Line 51: warning: comment on exported function Reconciled should be of the form "Reconciled ..." (golint)
    • Line 57: warning: comment on exported function ClusterLabelString should be of the form "ClusterLabelString ..." (golint)
    • Line 62: warning: comment on exported function CheckNodeConnectionError should be of the form "CheckNodeConnectionError ..." (golint)
    • Line 87: warning: comment on exported function ApplyClusterRefLabel should be of the form "ApplyClusterRefLabel ..." (golint)
    • Line 103: warning: comment on exported function GetClusterRefNamespace should be of the form "GetClusterRefNamespace ..." (golint)
    • nifikop/pkg/nificlient/client.go
    • Line 1: warning: package comment should be of the form "Package nificlient ..." (golint)
    • Line 31: warning: exported const PRIMARY_NODE should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: comment on exported type NifiClient should be of the form "NifiClient ..." (with optional leading article) (golint)
    • Line 138: warning: exported function New should have comment or be unexported (golint)
    • Line 153: warning: should omit 2nd value from range; this loop is equivalent to `for nodeId := range ...` (golint)
    • nifikop/pkg/util/util.go
    • Line 90: warning: exported function MergeAnnotations should have comment or be unexported (golint)
    • Line 208: warning: comment on exported function Max should be of the form "Max ..." (golint)
    • Line 216: warning: exported function Hash should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 3)