portainer/portainer

View on GitHub
api/http/handler/edgestacks/edgestack_create_git.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method Handler.storeManifestFromGitRepository has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (handler *Handler) storeManifestFromGitRepository(tx dataservices.DataStoreTx, stackFolder string, relatedEndpointIds []portainer.EndpointID, deploymentType portainer.EdgeStackDeploymentType, currentUserID portainer.UserID, repositoryConfig gittypes.RepoConfig) (composePath, manifestPath, projectPath string, err error) {
Severity: Minor
Found in api/http/handler/edgestacks/edgestack_create_git.go - About 45 mins to fix

    Method edgeStackFromGitRepositoryPayload.Validate has 6 return statements (exceeds 4 allowed).
    Open

    func (payload *edgeStackFromGitRepositoryPayload) Validate(r *http.Request) error {
        if govalidator.IsNull(payload.Name) {
            return httperrors.NewInvalidPayloadError("Invalid stack name")
        }
    
    
    Severity: Major
    Found in api/http/handler/edgestacks/edgestack_create_git.go - About 40 mins to fix

      Method Handler.storeManifestFromGitRepository has 6 return statements (exceeds 4 allowed).
      Open

      func (handler *Handler) storeManifestFromGitRepository(tx dataservices.DataStoreTx, stackFolder string, relatedEndpointIds []portainer.EndpointID, deploymentType portainer.EdgeStackDeploymentType, currentUserID portainer.UserID, repositoryConfig gittypes.RepoConfig) (composePath, manifestPath, projectPath string, err error) {
          hasWrongType, err := hasWrongEnvironmentType(tx.Endpoint(), relatedEndpointIds, deploymentType)
          if err != nil {
              return "", "", "", fmt.Errorf("unable to check for existence of non fitting environments: %w", err)
          }
      Severity: Major
      Found in api/http/handler/edgestacks/edgestack_create_git.go - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status