portainer/portainer

View on GitHub
app/react/docker/containers/CreateView/useCreateMutation.tsx

Summary

Maintainability
B
5 hrs
Test Coverage

File useCreateMutation.tsx has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { useMutation, useQueryClient } from '@tanstack/react-query';

import axios, { parseAxiosError } from '@/portainer/services/axios';
import {
  Environment,
Severity: Minor
Found in app/react/docker/containers/CreateView/useCreateMutation.tsx - About 3 hrs to fix

    Function applyContainerSettings has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      containerId: string,
      environment: Environment,
      accessControl: AccessControlFormData,
      enableWebhook?: boolean,
      resourceControl?: ResourceControlResponse,
    Severity: Minor
    Found in app/react/docker/containers/CreateView/useCreateMutation.tsx - About 45 mins to fix

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

        environmentId: EnvironmentId,
        pull: boolean,
        image: string,
        nodeName?: string,
        registry?: Registry
      Severity: Minor
      Found in app/react/docker/containers/CreateView/useCreateMutation.tsx - About 35 mins to fix

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

          environmentId: EnvironmentId,
          name: string,
          oldContainer: DockerContainer,
          config: CreateContainerRequest,
          nodeName?: string
        Severity: Minor
        Found in app/react/docker/containers/CreateView/useCreateMutation.tsx - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status