portainer/portainer

View on GitHub
api/internal/edge/edgestacks/service.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method Service.PersistEdgeStack has 7 return statements (exceeds 4 allowed).
Open

func (service *Service) PersistEdgeStack(
    tx dataservices.DataStoreTx,
    stack *portainer.EdgeStack,
    storeManifest edgetypes.StoreManifestFunc) (*portainer.EdgeStack, error) {

Severity: Major
Found in api/internal/edge/edgestacks/service.go - About 45 mins to fix

    Method Service.BuildEdgeStack has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        tx dataservices.DataStoreTx,
        name string,
        deploymentType portainer.EdgeStackDeploymentType,
        edgeGroups []portainer.EdgeGroupID,
        registries []portainer.RegistryID,
    Severity: Minor
    Found in api/internal/edge/edgestacks/service.go - About 45 mins to fix

      Method Service.DeleteEdgeStack has 6 return statements (exceeds 4 allowed).
      Open

      func (service *Service) DeleteEdgeStack(tx dataservices.DataStoreTx, edgeStackID portainer.EdgeStackID, relatedEdgeGroupsIds []portainer.EdgeGroupID) error {
          relationConfig, err := edge.FetchEndpointRelationsConfig(tx)
          if err != nil {
              return errors.WithMessage(err, "Unable to retrieve environments relations config from database")
          }
      Severity: Major
      Found in api/internal/edge/edgestacks/service.go - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status