horizoncd/horizon

View on GitHub

Showing 440 of 677 total issues

Function ofClusterModel has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func ofClusterModel(application *appmodels.Application, cluster *models.Cluster, fullPath, namespace string,
pipelineJSONBlob, applicationJSONBlob map[string]interface{}, tags ...*tagmodels.Tag) *GetClusterResponse {
Severity: Minor
Found in core/controller/cluster/models_basic.go - About 35 mins to fix

    Method controller.customizeTemplateInfo has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (c *controller) customizeTemplateInfo(ctx context.Context, r *CreateClusterRequest,
    application *models.Application, environment string, mergePatch bool) error {
    Severity: Minor
    Found in core/controller/cluster/controller_basic.go - About 35 mins to fix

      Method helper.AcceptMR has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (h *helper) AcceptMR(ctx context.Context, pid interface{}, mrID int,
      mergeCommitMsg *string, shouldRemoveSourceBranch *bool) (mr *gitlab.MergeRequest, err error) {
      Severity: Minor
      Found in lib/gitlab/gitlab.go - About 35 mins to fix

        Method controller.checkAllowDeploy has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (c *controller) checkAllowDeploy(ctx context.Context,
        application *amodels.Application, cluster *cmodels.Cluster,
        clusterFiles *gitrepo.ClusterFiles, configCommit *gitrepo.ClusterCommit) error {
        Severity: Minor
        Found in core/controller/cluster/controller_operation.go - About 35 mins to fix

          Method dao.UpdateByName has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func (d *dao) UpdateByName(ctx context.Context, resourceType string,
          resourceID uint, name string, badge *models.Badge) (*models.Badge, error) {
          Severity: Minor
          Found in pkg/badge/dao/dao.go - About 35 mins to fix

            Method controller.updatePipelineRunStatus has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func (c *controller) updatePipelineRunStatus(ctx context.Context,
            action string, prID uint, pState prmodels.PipelineStatus, revision string) error {
            Severity: Minor
            Found in core/controller/cluster/controller_operation.go - About 35 mins to fix

              Method controller.UpdateBadgeByName has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func (c *controller) UpdateBadgeByName(ctx context.Context, resourceType string,
              resourceID uint, name string, badge *Update) (*Badge, error) {
              Severity: Minor
              Found in core/controller/badge/controller.go - About 35 mins to fix

                Method controller.executeDeploy has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func (c *controller) executeDeploy(ctx context.Context, application *appmodels.Application,
                cluster *clustermodels.Cluster, pr *prmodels.Pipelinerun, currentUser user.User) error {
                Severity: Minor
                Found in core/controller/pipelinerun/controller.go - About 35 mins to fix

                  Function handleGetSchema has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func handleGetSchema(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
                  authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
                  Severity: Minor
                  Found in core/middleware/prehandle/prehandle.go - About 35 mins to fix

                    Function startProcess has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func startProcess(k8sClient kubernetes.Interface, cfg *rest.Config,
                    ref ContainerRef, cmd []string, ptyHandler PtyHandler) error {
                    Severity: Minor
                    Found in core/controller/terminal/terminal.go - About 35 mins to fix

                      Function handleCluster has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      func handleCluster(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
                      authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
                      Severity: Minor
                      Found in core/middleware/prehandle/prehandle.go - About 35 mins to fix

                        Method CreateClusterParamsV2.toClusterModel has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        func (r *CreateClusterParamsV2) toClusterModel(application *appmodels.Application,
                        er *envregionmodels.EnvironmentRegion, info *BuildTemplateInfo,
                        template *templatemodels.Template, expireSeconds uint) (*models.Cluster, []*tagmodels.Tag) {
                        Severity: Minor
                        Found in core/controller/cluster/models_basic_v2.go - About 35 mins to fix

                          Function ofApplicationModel has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          func ofApplicationModel(app *models.Application, fullPath string, trs []*trmodels.TemplateRelease,
                          pipelineJSONBlob, applicationJSONBlob map[string]interface{}, tags ...*tagmodels.Tag) *GetApplicationResponse {
                          Severity: Minor
                          Found in core/controller/application/models.go - About 35 mins to fix

                            Function handleApplication has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            func handleApplication(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
                            authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
                            Severity: Minor
                            Found in core/middleware/prehandle/prehandle.go - About 35 mins to fix

                              Function handleTemplate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              func handleTemplate(c *gin.Context, mgr *managerparam.Manager, r *gin.Engine,
                              authRecord auth.AttributesRecord, requestInfo *auth.RequestInfo) {
                              Severity: Minor
                              Found in core/middleware/prehandle/prehandle.go - About 35 mins to fix

                                Method manager.GetDefaultRegions has 5 return statements (exceeds 4 allowed).
                                Open

                                func (m manager) GetDefaultRegions(ctx context.Context, id uint) ([]*envregionmodels.EnvironmentRegion, error) {
                                selectableRegions, err := m.GetSelectableRegions(ctx, id)
                                if err != nil {
                                return nil, err
                                }
                                Severity: Major
                                Found in pkg/group/manager/manager.go - About 35 mins to fix

                                  Method service.CreateAccessToken has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (s *service) CreateAccessToken(ctx context.Context, name, expiresAtStr string,
                                  userID uint, scopes []string) (*tokenmodels.Token, error) {
                                  // 1. check expiration date
                                  createdAt := time.Now()
                                  expiresIn := time.Duration(0)
                                  Severity: Major
                                  Found in pkg/token/service/service.go - About 35 mins to fix

                                    Method clusterGitopsRepo.GetRestartTime has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (g *clusterGitopsRepo) GetRestartTime(ctx context.Context, application, cluster string,
                                    template string) (string, error) {
                                    ret := make(map[string]map[string]string)
                                    pid := fmt.Sprintf("%v/%v/%v", g.clustersGroup.FullPath, application, cluster)
                                    content, err := g.gitlabLib.GetFile(ctx, pid, g.defaultBranch, common.GitopsFileRestart)
                                    Severity: Major
                                    Found in pkg/cluster/gitrepo/gitrepo_cluster.go - About 35 mins to fix

                                      Method dao.DeleteByID has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (d *dao) DeleteByID(ctx context.Context, id uint) error {
                                      currentUser, err := corecommon.UserFromContext(ctx)
                                      if err != nil {
                                      return err
                                      }
                                      Severity: Major
                                      Found in pkg/application/dao/dao.go - About 35 mins to fix

                                        Method manager.GetSelectableRegions has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func (m manager) GetSelectableRegions(ctx context.Context, id uint) (regionmodels.RegionParts, error) {
                                        // get regionSelector field from group
                                        group, err := m.groupDAO.GetByID(ctx, id)
                                        if err != nil {
                                        return nil, err
                                        Severity: Major
                                        Found in pkg/group/manager/manager.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language