Preparing report...

Report for github.com/epam/edp-gerrit-operator/v2

(v2.10.0)

A+    Excellent!    Found 31 issues across 58 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!


gocyclo93%

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.

    • pkg/service/gerrit/gerrit.go
    • Line 87: warning: cyclomatic complexity 42 of function (ComponentService).Configure() is high (> 15) (gocyclo)
    • Line 289: warning: cyclomatic complexity 21 of function (ComponentService).ExposeConfiguration() is high (> 15) (gocyclo)

golint48%

Golint is a linter for Go source code.

    • pkg/service/platform/helper/helper.go
    • Line 16: warning: exported const DefaultConfigFilesAbsolutePath should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: comment on exported const DefaultTemplatesDirectory should be of the form "DefaultTemplatesDirectory ..." (golint)
    • Line 24: warning: comment on exported const DefaultScriptsDirectory should be of the form "DefaultScriptsDirectory ..." (golint)
    • Line 33: warning: comment on exported const JenkinsPluginConfigFileName should be of the form "JenkinsPluginConfigFileName ..." (golint)
    • Line 36: warning: comment on exported const RouteHTTPSScheme should be of the form "RouteHTTPSScheme ..." (golint)
    • Line 39: warning: comment on exported const RouteHTTPScheme should be of the form "RouteHTTPScheme ..." (golint)
    • Line 45: warning: exported type JenkinsPluginData should have comment or be unexported (golint)
    • Line 53: warning: exported function InitNewJenkinsPluginInfo should have comment or be unexported (golint)
    • Line 57: warning: exported function ParseDefaultTemplate should have comment or be unexported (golint)
    • Line 91: warning: exported function GetExecutableFilePath should have comment or be unexported (golint)
    • Line 99: warning: exported function RunningInCluster should have comment or be unexported (golint)
    • Line 111: warning: exported function SelectContainer should have comment or be unexported (golint)
    • Line 121: warning: exported function UpdateEnv should have comment or be unexported (golint)
    • pkg/controller/gerritgroupmember/controller.go
    • Line 27: warning: exported type Reconcile should have comment or be unexported (golint)
    • Line 33: warning: exported function NewReconcile should have comment or be unexported (golint)
    • Line 46: warning: exported method Reconcile.SetupWithManager should have comment or be unexported (golint)
    • Line 64: warning: exported method Reconcile.Reconcile should have comment or be unexported (golint)
    • pkg/apis/v2/v1alpha1/gerrit_types.go
    • Line 16: warning: exported type GerritVolumes should have comment or be unexported (golint)
    • Line 22: warning: exported type GerritSpec should have comment or be unexported (golint)
    • Line 36: warning: exported type GerritUsers should have comment or be unexported (golint)
    • Line 54: warning: exported type KeycloakSpec should have comment or be unexported (golint)
    • pkg/client/ssh/ssh.go
    • Line 12: warning: exported type SSHCommand should have comment or be unexported (golint)
    • Line 20: warning: exported type SSHClient should have comment or be unexported (golint)
    • Line 26: warning: exported method SSHClient.RunCommand should have comment or be unexported (golint)
    • Line 65: warning: exported function SshInit should have comment or be unexported (golint)
    • pkg/service/gerrit/spec/spec.go
    • Line 13: warning: comment on exported const SSHListnerEnvName should be of the form "SSHListnerEnvName ..." (golint)
    • Line 55: warning: comment on exported const GerritPort should be of the form "GerritPort ..." (golint)
    • Line 91: warning: comment on exported const EdpCiUSerSshKeySuffix should be of the form "EdpCiUSerSshKeySuffix ..." (golint)
    • Line 94: warning: comment on exported const GerritDefaultProjectCreatorSecretPostfix should be of the form "GerritDefaultProjectCreatorSecretPostfix ..." (golint)
    • Line 97: warning: comment on exported const JenkinsPluginConfigPostfix should be of the form "JenkinsPluginConfigPostfix ..." (golint)
    • Line 100: warning: comment on exported const EdpProjectCreatorUserSuffix should be of the form "EdpProjectCreatorUserSuffix ..." (golint)
    • Line 103: warning: comment on exported const EdpProjectCreatorSshKeySuffix should be of the form "EdpProjectCreatorSshKeySuffix ..." (golint)
    • Line 118: warning: comment on exported const IdentityServiceCredentialsSecretPostfix should be of the form "IdentityServiceCredentialsSecretPostfix ..." (golint)
    • pkg/controller/gerritproject/controller.go
    • Line 27: warning: exported type Reconcile should have comment or be unexported (golint)
    • Line 33: warning: exported function NewReconcile should have comment or be unexported (golint)
    • Line 46: warning: exported method Reconcile.SetupWithManager should have comment or be unexported (golint)
    • Line 66: warning: exported method Reconcile.Reconcile should have comment or be unexported (golint)
    • pkg/service/gerrit/mock.go
    • Line 9: warning: exported type Mock should have comment or be unexported (golint)
    • Line 13: warning: exported method Mock.IsDeploymentReady should have comment or be unexported (golint)
    • Line 17: warning: exported method Mock.Configure should have comment or be unexported (golint)
    • Line 21: warning: exported method Mock.ExposeConfiguration should have comment or be unexported (golint)
    • Line 25: warning: exported method Mock.Integrate should have comment or be unexported (golint)
    • Line 29: warning: exported method Mock.GetGerritSSHUrl should have comment or be unexported (golint)
    • Line 33: warning: exported method Mock.GetServicePort should have comment or be unexported (golint)
    • Line 37: warning: exported method Mock.GetRestClient should have comment or be unexported (golint)
    • pkg/apis/v2/v1alpha1/gerritproject_types.go
    • Line 5: warning: exported type GerritProjectStatus should have comment or be unexported (golint)
    • Line 10: warning: exported type GerritProjectSpec should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type GerritProject should be of the form "GerritProject ..." (with optional leading article) (golint)
    • Line 32: warning: comment on exported type GerritProjectList should be of the form "GerritProjectList ..." (with optional leading article) (golint)
    • pkg/controller/gerritprojectaccess/controller.go
    • Line 27: warning: exported type Reconcile should have comment or be unexported (golint)
    • Line 33: warning: exported function NewReconcile should have comment or be unexported (golint)
    • Line 46: warning: exported method Reconcile.SetupWithManager should have comment or be unexported (golint)
    • Line 64: warning: exported method Reconcile.Reconcile should have comment or be unexported (golint)
    • pkg/service/platform/openshift/openshift.go
    • Line 91: warning: exported method OpenshiftService.GetExternalEndpoint should have comment or be unexported (golint)
    • Line 107: warning: exported method OpenshiftService.GetDeploymentSSHPort should have comment or be unexported (golint)
    • Line 129: warning: exported method OpenshiftService.IsDeploymentReady should have comment or be unexported (golint)
    • Line 141: warning: exported method OpenshiftService.PatchDeploymentEnv should have comment or be unexported (golint)
    • pkg/client/gerrit/mock.go
    • Line 8: warning: exported type Mock should have comment or be unexported (golint)
    • Line 13: warning: exported method Mock.GetResty should have comment or be unexported (golint)
    • Line 17: warning: exported method Mock.SetProjectParent should have comment or be unexported (golint)
    • Line 21: warning: exported method Mock.DeleteAccessRights should have comment or be unexported (golint)
    • Line 25: warning: exported method Mock.UpdateAccessRights should have comment or be unexported (golint)
    • Line 28: warning: exported method Mock.AddAccessRights should have comment or be unexported (golint)
    • Line 32: warning: exported method Mock.CreateGroup should have comment or be unexported (golint)
    • Line 41: warning: exported method Mock.UpdateGroup should have comment or be unexported (golint)
    • Line 45: warning: exported method Mock.AddUserToGroup should have comment or be unexported (golint)
    • Line 49: warning: exported method Mock.DeleteUserFromGroup should have comment or be unexported (golint)
    • Line 53: warning: exported method Mock.CreateProject should have comment or be unexported (golint)
    • Line 57: warning: exported method Mock.GetProject should have comment or be unexported (golint)
    • Line 66: warning: exported method Mock.UpdateProject should have comment or be unexported (golint)
    • Line 70: warning: exported method Mock.DeleteProject should have comment or be unexported (golint)
    • Line 74: warning: exported method Mock.ListProjects should have comment or be unexported (golint)
    • Line 83: warning: exported method Mock.ListProjectBranches should have comment or be unexported (golint)
    • pkg/client/edp_client.go
    • Line 12: warning: exported var SchemeGroupVersion should have comment or be unexported (golint)
    • Line 14: warning: exported type EdpV1Client should have comment or be unexported (golint)
    • Line 18: warning: exported function NewForConfig should have comment or be unexported (golint)
    • pkg/controller/gerritgroup/controller.go
    • Line 26: warning: exported type Reconcile should have comment or be unexported (golint)
    • Line 32: warning: exported function NewReconcile should have comment or be unexported (golint)
    • Line 45: warning: exported method Reconcile.SetupWithManager should have comment or be unexported (golint)
    • Line 63: warning: exported method Reconcile.Reconcile should have comment or be unexported (golint)
    • pkg/controller/helper/helper.go
    • Line 26: warning: exported const StatusOK should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: comment on exported function RunningInCluster should be of the form "RunningInCluster ..." (golint)
    • Line 59: warning: exported function NewTrue should have comment or be unexported (golint)
    • Line 64: warning: exported function GetPlatformTypeEnv should have comment or be unexported (golint)
    • Line 72: warning: exported function GetExecutableFilePath should have comment or be unexported (golint)
    • Line 80: warning: exported function FileExists should have comment or be unexported (golint)
    • Line 88: warning: exported function SetOwnerReference should have comment or be unexported (golint)
    • Line 105: warning: exported function IsInstanceOwnerSet should have comment or be unexported (golint)
    • Line 110: warning: exported function FindCROwnerName should have comment or be unexported (golint)
    • Line 118: warning: exported function GetInstanceOwner should have comment or be unexported (golint)
    • Line 138: warning: exported function GetGerritOwner should have comment or be unexported (golint)
    • Line 147: warning: exported function GetGerritInstance should have comment or be unexported (golint)
    • Line 176: warning: exported function ContainsString should have comment or be unexported (golint)
    • Line 185: warning: exported function RemoveString should have comment or be unexported (golint)
    • Line 195: warning: exported function GetGerritClient should have comment or be unexported (golint)
    • Line 225: warning: exported function TryToDelete should have comment or be unexported (golint)
    • pkg/client/gerrit/project_access.go
    • Line 10: warning: exported type AccessInfo should have comment or be unexported (golint)
    • Line 39: warning: exported method Client.AddAccessRights should have comment or be unexported (golint)
    • Line 49: warning: exported method Client.UpdateAccessRights should have comment or be unexported (golint)
    • Line 59: warning: exported method Client.DeleteAccessRights should have comment or be unexported (golint)
    • Line 103: warning: exported method Client.SetProjectParent should have comment or be unexported (golint)
    • pkg/apis/v2/v1alpha1/gerritgroup_types.go
    • Line 5: warning: comment on exported type GerritGroupSpec should be of the form "GerritGroupSpec ..." (with optional leading article) (golint)
    • Line 13: warning: comment on exported type GerritGroupStatus should be of the form "GerritGroupStatus ..." (with optional leading article) (golint)
    • Line 20: warning: comment on exported type GerritGroup should be of the form "GerritGroup ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported type GerritGroupList should be of the form "GerritGroupList ..." (with optional leading article) (golint)
    • pkg/controller/gerritreplicationconfig/gerritreplicationconfig_controller.go
    • Line 33: warning: exported function NewReconcileGerritReplicationConfig should have comment or be unexported (golint)
    • Line 48: warning: exported type ReconcileGerritReplicationConfig should have comment or be unexported (golint)
    • Line 56: warning: exported method ReconcileGerritReplicationConfig.SetupWithManager should have comment or be unexported (golint)
    • Line 69: warning: exported method ReconcileGerritReplicationConfig.Reconcile should have comment or be unexported (golint)
    • pkg/apis/v2/v1alpha1/gerritgroupmember_types.go
    • Line 5: warning: exported type GerritGroupMemberStatus should have comment or be unexported (golint)
    • Line 9: warning: exported type GerritGroupMemberSpec should have comment or be unexported (golint)
    • Line 15: warning: comment on exported type GerritGroupMember should be of the form "GerritGroupMember ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported type GerritGroupMemberList should be of the form "GerritGroupMemberList ..." (with optional leading article) (golint)
    • pkg/service/platform/k8s/k8s.go
    • Line 47: warning: exported method K8SService.GetExternalEndpoint should have comment or be unexported (golint)
    • Line 58: warning: exported method K8SService.IsDeploymentReady should have comment or be unexported (golint)
    • Line 71: warning: exported method K8SService.PatchDeploymentEnv should have comment or be unexported (golint)
    • Line 136: warning: exported method K8SService.GetDeploymentSSHPort should have comment or be unexported (golint)
    • Line 136: warning: receiver name service should be consistent with previous receiver name s for K8SService (golint)
    • Line 266: warning: comment on exported method K8SService.GetSecretData should be of the form "GetSecretData ..." (golint)
    • Line 267: warning: receiver name service should be consistent with previous receiver name s for K8SService (golint)
    • Line 440: warning: exported method K8SService.CreateConfigMap should have comment or be unexported (golint)
    • Line 469: warning: exported method K8SService.CreateJenkinsServiceAccount should have comment or be unexported (golint)
    • Line 509: warning: exported method K8SService.CreateJenkinsScript should have comment or be unexported (golint)
    • Line 541: warning: exported method K8SService.CreateEDPComponentIfNotExist should have comment or be unexported (golint)
    • pkg/client/gerrit/project.go
    • Line 13: warning: exported type Project should have comment or be unexported (golint)
    • Line 25: warning: exported method Project.SlugifyName should have comment or be unexported (golint)
    • Line 29: warning: exported type Branch should have comment or be unexported (golint)
    • Line 36: warning: exported type WebLink should have comment or be unexported (golint)
    • Line 43: warning: exported method Client.CreateProject should have comment or be unexported (golint)
    • Line 50: warning: exported method Client.GetProject should have comment or be unexported (golint)
    • Line 76: warning: exported method Client.UpdateProject should have comment or be unexported (golint)
    • Line 96: warning: exported method Client.DeleteProject should have comment or be unexported (golint)
    • Line 106: warning: exported method Client.ListProjects should have comment or be unexported (golint)
    • Line 137: warning: exported method Client.ListProjectBranches should have comment or be unexported (golint)
    • pkg/service/helpers/helpers.go
    • Line 65: warning: exported function GenerateKeyPairs should have comment or be unexported (golint)
    • Line 79: warning: exported function IsStringInSlice should have comment or be unexported (golint)
    • Line 88: warning: exported function GenerateAnnotationKey should have comment or be unexported (golint)
    • pkg/service/gerrit/gerrit.go
    • Line 52: warning: exported type ErrUserNotFound should have comment or be unexported (golint)
    • Line 58: warning: exported function IsErrUserNotFound should have comment or be unexported (golint)
    • Line 558: warning: exported method ComponentService.GetRestClient should have comment or be unexported (golint)
    • Line 629: warning: exported method ComponentService.GetGerritSSHUrl should have comment or be unexported (golint)
    • Line 699: warning: exported method ComponentService.GetServicePort should have comment or be unexported (golint)
    • pkg/client/gerrit/gerrit.go
    • Line 24: warning: exported type Client should have comment or be unexported (golint)
    • Line 30: warning: exported method Client.GetResty should have comment or be unexported (golint)
    • Line 41: warning: exported method Client.InitNewSshClient should have comment or be unexported (golint)
    • Line 99: warning: exported method Client.InitAdminUser should have comment or be unexported (golint)
    • Line 126: warning: exported method Client.ChangePassword should have comment or be unexported (golint)
    • Line 142: warning: exported method Client.ReloadPlugin should have comment or be unexported (golint)
    • Line 158: warning: exported method Client.CreateUser should have comment or be unexported (golint)
    • Line 184: warning: exported method Client.AddUserToGroups should have comment or be unexported (golint)
    • Line 236: warning: exported method Client.InitAllProjects should have comment or be unexported (golint)
    • pkg/apis/v2/v1alpha1/gerritprojectaccess_types.go
    • Line 5: warning: comment on exported type GerritProjectAccessSpec should be of the form "GerritProjectAccessSpec ..." (with optional leading article) (golint)
    • Line 13: warning: comment on exported type Reference should be of the form "Reference ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported type GerritProjectAccessStatus should be of the form "GerritProjectAccessStatus ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported type GerritProjectAccess should be of the form "GerritProjectAccess ..." (with optional leading article) (golint)
    • Line 40: warning: comment on exported type GerritProjectAccessList should be of the form "GerritProjectAccessList ..." (with optional leading article) (golint)
    • pkg/controller/helper/logger_mock.go
    • Line 5: warning: exported type InfoLogger should have comment or be unexported (golint)
    • Line 9: warning: exported method InfoLogger.Info should have comment or be unexported (golint)
    • Line 17: warning: exported method InfoLogger.Enabled should have comment or be unexported (golint)
    • Line 21: warning: exported type Logger should have comment or be unexported (golint)
    • Line 30: warning: exported method Logger.LastError should have comment or be unexported (golint)
    • Line 38: warning: exported method Logger.V should have comment or be unexported (golint)
    • Line 42: warning: exported method Logger.WithValues should have comment or be unexported (golint)
    • Line 46: warning: exported method Logger.WithName should have comment or be unexported (golint)
    • pkg/controller/gerrit/gerrit_controller.go
    • Line 50: warning: exported function NewReconcileGerrit should have comment or be unexported (golint)
    • Line 63: warning: exported type ReconcileGerrit should have comment or be unexported (golint)
    • Line 69: warning: exported method ReconcileGerrit.SetupWithManager should have comment or be unexported (golint)
    • Line 75: warning: exported method ReconcileGerrit.Reconcile should have comment or be unexported (golint)
    • pkg/client/gerrit/group.go
    • Line 12: warning: exported type ErrAlreadyExists should have comment or be unexported (golint)
    • Line 18: warning: exported function IsErrAlreadyExists should have comment or be unexported (golint)
    • Line 27: warning: exported type ErrDoesNotExist should have comment or be unexported (golint)
    • Line 33: warning: exported function IsErrDoesNotExist should have comment or be unexported (golint)
    • Line 38: warning: exported type Group should have comment or be unexported (golint)
    • Line 44: warning: exported type GroupMember should have comment or be unexported (golint)
    • Line 49: warning: exported method Client.RemoveUsersFromGroup should have comment or be unexported (golint)
    • Line 130: warning: exported method Client.DeleteUserFromGroup should have comment or be unexported (golint)
    • Line 145: warning: exported method Client.AddUserToGroup should have comment or be unexported (golint)
    • Line 150: warning: exported method Client.UpdateGroup should have comment or be unexported (golint)
    • Line 186: warning: exported method Client.CreateGroup 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!