theforeman/foreman_remote_execution

View on GitHub

Showing 250 of 250 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    await act(async () => {
      fireEvent.click(screen.getByText(WIZARD_TITLES.hostsAndInputs));
      await new Promise(resolve => setTimeout(resolve, 0)); // to resolve gql
    });
Severity: Major
Found in webpack/JobWizard/__tests__/validation.test.js and 1 other location - About 1 hr to fix
webpack/JobWizard/__tests__/validation.test.js on lines 101..104

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    await act(async () => {
      fireEvent.click(screen.getByText(WIZARD_TITLES.hostsAndInputs));
      await new Promise(resolve => setTimeout(resolve, 0)); // to resolve gql
    });
Severity: Major
Found in webpack/JobWizard/__tests__/validation.test.js and 1 other location - About 1 hr to fix
webpack/JobWizard/__tests__/validation.test.js on lines 42..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const jobTemplate = {
  id: 178,
  name: 'template1',
  template:
    "---\n- hosts: all\n  tasks:\n    - shell:\n        cmd: |\n<%=       indent(10) { input('command') } %>\n      register: out\n    - debug: var=out",
Severity: Major
Found in webpack/JobWizard/__tests__/fixtures.js and 1 other location - About 1 hr to fix
webpack/JobWizard/__tests__/fixtures.js on lines 18..29

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const pupptetJobTemplate = {
  id: 163,
  name: 'Puppet Agent Disable - Script Default',
  template:
    '<% if @host.operatingsystem.family == \'Debian\' -%>\nexport PATH=/opt/puppetlabs/bin:$PATH\n<% end -%>\npuppet agent --disable "<%= input("comment").present? ? input("comment") : "Disabled using Foreman Remote Execution"  %> - <%= current_user %> - $(date "+%d/%m/%Y %H:%M")"',
Severity: Major
Found in webpack/JobWizard/__tests__/fixtures.js and 1 other location - About 1 hr to fix
webpack/JobWizard/__tests__/fixtures.js on lines 6..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function runFeature has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const runFeature = (hostId, feature, label, hostSearch) => dispatch => {
  const url = foremanUrl(
    hostId
      ? `/job_invocations?feature=${feature}&host_ids%5B%5D=${hostId}`
      : `/job_invocations?feature=${feature}&search=${hostSearch}`
Severity: Minor
Found in webpack/react_app/components/FeaturesDropdown/actions.js - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            <ConcurrencyLevelField
              value={advancedValues.concurrencyLevel}
              defaultValue={jobTemplate.concurrency_control?.level}
              setValue={newValue =>
                setAdvancedValues({
    Severity: Minor
    Found in webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js and 1 other location - About 55 mins to fix
    webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js on lines 59..67

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            <DropdownItem
              href={foremanUrl(`${JOB_BASE_URL}${id}`)}
              key="link-to-all"
              ouiaId="link-to-all-dropdown-item"
            >
    Severity: Major
    Found in webpack/react_app/components/RecentJobsCard/RecentJobsCard.js and 3 other locations - About 55 mins to fix
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 34..42
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 43..49
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 50..56

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            <DropdownItem
              href={foremanUrl(`${JOB_BASE_URL}${id}+and+status+%3D+running`)}
              key="link-to-running"
              ouiaId="link-to-running-dropdown-item"
            >
    Severity: Major
    Found in webpack/react_app/components/RecentJobsCard/RecentJobsCard.js and 3 other locations - About 55 mins to fix
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 27..33
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 34..42
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 50..56

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

              handleSuccess: ({ data: { results } }) => {
                setTemplateInputId(
                  results.find(result => result.name === 'job_id')?.id
                );
              },
    Severity: Minor
    Found in webpack/JobInvocationDetail/JobInvocationToolbarButtons.js and 1 other location - About 55 mins to fix
    webpack/JobInvocationDetail/JobInvocationToolbarButtons.js on lines 75..80

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            handleSuccess: ({ data: { results } }) => {
              setReportTemplateJobId(
                results.find(result => result.name === 'Job - Invocation Report')
                  ?.id
              );
    Severity: Minor
    Found in webpack/JobInvocationDetail/JobInvocationToolbarButtons.js and 1 other location - About 55 mins to fix
    webpack/JobInvocationDetail/JobInvocationToolbarButtons.js on lines 93..97

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

              <EffectiveUserField
                value={advancedValues.effectiveUserValue}
                defaultValue={jobTemplate.effective_user?.value}
                setValue={newValue =>
                  setAdvancedValues({
    Severity: Minor
    Found in webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js and 1 other location - About 55 mins to fix
    webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js on lines 121..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            <DropdownItem
              href={foremanUrl(`${JOB_BASE_URL}${id}+and+status+%3D+queued`)}
              key="link-to-scheduled"
              ouiaId="link-to-scheduled-dropdown-item"
            >
    Severity: Major
    Found in webpack/react_app/components/RecentJobsCard/RecentJobsCard.js and 3 other locations - About 55 mins to fix
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 27..33
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 34..42
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 43..49

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            <DropdownItem
              href={foremanUrl(
                `${JOB_BASE_URL}${id}+and+status+%3D+failed+or+status%3D+succeeded`
              )}
              key="link-to-finished"
    Severity: Major
    Found in webpack/react_app/components/RecentJobsCard/RecentJobsCard.js and 3 other locations - About 55 mins to fix
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 27..33
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 43..49
    webpack/react_app/components/RecentJobsCard/RecentJobsCard.js on lines 50..56

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function FeaturesDropdown has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    const FeaturesDropdown = ({
      hostId,
      hostSearch,
      hostResponse,
      selectedCount,
    Severity: Minor
    Found in webpack/react_app/components/FeaturesDropdown/index.js - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function cancelJob has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    export const cancelJob = (jobId, force) => dispatch => {
      const infoToast = () =>
        force
          ? sprintf(__('Trying to abort the job %s.'), jobId)
          : sprintf(__('Trying to cancel the job %s.'), jobId);
    Severity: Minor
    Found in webpack/JobInvocationDetail/JobInvocationActions.js - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function JobInvocationToolbarButtons has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    const JobInvocationToolbarButtons = ({
      jobId,
      data,
      currentPermissions,
      permissionsStatus,
    Severity: Minor
    Found in webpack/JobInvocationDetail/JobInvocationToolbarButtons.js - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method verify_permissions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

          def verify_permissions(host, template_invocation)
            raise _('User can not execute job on host %s') % host.name unless User.current.can?(:view_hosts, host)
            raise _('User can not execute this job template') unless User.current.can?(:view_job_templates, template_invocation.template)
            infra_facet = host.infrastructure_facet
            if (infra_facet&.foreman_instance || infra_facet&.smart_proxy_id) && !User.current.can?(:execute_jobs_on_infrastructure_hosts)
    Severity: Minor
    Found in app/lib/actions/remote_execution/run_host_job.rb - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method remote_execution_proxies has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def remote_execution_proxies(provider, authorized = true)
          proxies = {}
          proxies[:subnet] = []
          proxies[:subnet] += execution_interface.subnet6.remote_execution_proxies.with_features(provider) if execution_interface&.subnet6
          proxies[:subnet] += execution_interface.subnet.remote_execution_proxies.with_features(provider) if execution_interface&.subnet
    Severity: Minor
    Found in app/models/concerns/foreman_remote_execution/host_extensions.rb - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

          errorToast: ({ response }) =>
            errorToast(
              // eslint-disable-next-line camelcase
              response?.data?.error?.full_messages ||
                response?.data?.error?.message ||
    Severity: Major
    Found in webpack/JobInvocationDetail/JobInvocationActions.js and 2 other locations - About 55 mins to fix
    webpack/JobInvocationDetail/JobInvocationActions.js on lines 61..67
    webpack/JobInvocationDetail/JobInvocationActions.js on lines 117..123

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 53.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 3 locations. Consider refactoring.
    Open

          errorToast: ({ response }) =>
            errorToast(
              // eslint-disable-next-line camelcase
              response?.data?.error?.full_messages ||
                response?.data?.error?.message ||
    Severity: Major
    Found in webpack/JobInvocationDetail/JobInvocationActions.js and 2 other locations - About 55 mins to fix
    webpack/JobInvocationDetail/JobInvocationActions.js on lines 117..123
    webpack/JobInvocationDetail/JobInvocationActions.js on lines 143..149

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 53.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language