theforeman/foreman_remote_execution

View on GitHub

Showing 250 of 250 total issues

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 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

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

  const errorToast = response =>
    force
      ? sprintf(__(`Could not abort the job %s: ${response}`), jobId)
      : sprintf(__(`Could not cancel the job %s: ${response}`), jobId);
Severity: Minor
Found in webpack/JobInvocationDetail/JobInvocationActions.js and 1 other location - About 55 mins to fix
webpack/JobInvocationDetail/JobInvocationActions.js on lines 100..109

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

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

  template_inputs: [
    {
      name: 'plain hidden',
      required: true,
      input_type: 'user',
Severity: Minor
Found in webpack/JobWizard/__tests__/fixtures.js and 1 other location - About 55 mins to fix
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 336..348

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

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

  const errorToast = response =>
    enabled
      ? sprintf(
          __(`Could not disable recurring logic %s: ${response}`),
          recurrenceId
Severity: Minor
Found in webpack/JobInvocationDetail/JobInvocationActions.js and 1 other location - About 55 mins to fix
webpack/JobInvocationDetail/JobInvocationActions.js on lines 49..52

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

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

              template_inputs: [
                {
                  name: 'command',
                  required: true,
                  input_type: 'user',
webpack/JobWizard/__tests__/fixtures.js on lines 98..110

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 2 locations. Consider refactoring.
Open

      <FormGroup
        labelInfo={labelInfo}
        key={name}
        label={name}
        labelIcon={helpLabel(labelText, name)}
Severity: Minor
Found in webpack/JobWizard/steps/form/Formatter.js and 1 other location - About 50 mins to fix
webpack/JobWizard/steps/form/Formatter.js on lines 115..132

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 52.

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

      <FormGroup
        labelInfo={labelInfo}
        key={name}
        label={name}
        labelIcon={helpLabel(labelText, name)}
Severity: Minor
Found in webpack/JobWizard/steps/form/Formatter.js and 1 other location - About 50 mins to fix
webpack/JobWizard/steps/form/Formatter.js on lines 137..153

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 52.

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

        <Button
          ouiaId="show-advanced-fields"
          variant="link"
          isInline
          onClick={() => {
Severity: Minor
Found in webpack/JobWizard/steps/ReviewDetails/index.js and 1 other location - About 50 mins to fix
webpack/JobWizard/steps/ReviewDetails/index.js on lines 144..153

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 52.

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

          advancedInputs.forEach(input => {
            advancedTemplateValues[input.name] =
              currentAdvancedValues[input.name] || input?.default || '';
          });
Severity: Minor
Found in webpack/JobWizard/JobWizard.js and 1 other location - About 50 mins to fix
webpack/JobWizard/JobWizard.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 52.

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

    expect(
      screen
        .getByText('Rerun successful')
        .closest('a')
        .getAttribute('href')
Severity: Minor
Found in webpack/JobInvocationDetail/__tests__/MainInformation.test.js and 1 other location - About 50 mins to fix
webpack/JobInvocationDetail/__tests__/MainInformation.test.js on lines 156..161

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 52.

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

    expect(
      screen
        .getByText('Rerun failed')
        .closest('a')
        .getAttribute('href')
Severity: Minor
Found in webpack/JobInvocationDetail/__tests__/MainInformation.test.js and 1 other location - About 50 mins to fix
webpack/JobInvocationDetail/__tests__/MainInformation.test.js on lines 150..155

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 52.

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

          inputs.forEach(input => {
            defaultTemplateValues[input.name] =
              prev[input.name] || input?.default || '';
          });
Severity: Minor
Found in webpack/JobWizard/JobWizard.js and 1 other location - About 50 mins to fix
webpack/JobWizard/JobWizard.js on lines 110..113

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 52.

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

        <Button
          ouiaId="hide-advanced-fields"
          variant="link"
          isInline
          onClick={() => {
Severity: Minor
Found in webpack/JobWizard/steps/ReviewDetails/index.js and 1 other location - About 50 mins to fix
webpack/JobWizard/steps/ReviewDetails/index.js on lines 155..164

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 52.

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 6 locations. Consider refactoring.
Open

AdvancedFields.propTypes = {
  advancedValues: PropTypes.object.isRequired,
  setAdvancedValues: PropTypes.func.isRequired,
  templateValues: PropTypes.object.isRequired,
};
Severity: Major
Found in webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js and 5 other locations - About 50 mins to fix
webpack/JobWizard/steps/HostsAndInputs/HostPreviewModal.js on lines 66..70
webpack/JobWizard/steps/Schedule/RepeatCron.js on lines 82..86
webpack/JobWizard/steps/Schedule/RepeatDaily.js on lines 33..37
webpack/JobWizard/steps/Schedule/RepeatMonth.js on lines 43..47
webpack/JobWizard/steps/Schedule/RepeatWeek.js on lines 68..72

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 51.

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 7 locations. Consider refactoring.
Open

    act(() => {
      fireEvent.click(screen.getByRole('button', { name: 'Future execution' }));
      jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
    });
Severity: Major
Found in webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js and 6 other locations - About 50 mins to fix
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 88..95
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 106..109
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 144..147
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 201..206
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 251..256
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 285..290

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 51.

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 7 locations. Consider refactoring.
Open

    act(() => {
      fireEvent.click(screen.getByRole('button', { name: 'Future execution' }));
      jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
    });
Severity: Major
Found in webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js and 6 other locations - About 50 mins to fix
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 51..54
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 88..95
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 106..109
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 201..206
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 251..256
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 285..290

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 51.

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 7 locations. Consider refactoring.
Open

    act(() => {
      fireEvent.click(
        screen.getByRole('button', { name: 'Recurring execution' })
      );
      jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
Severity: Major
Found in webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js and 6 other locations - About 50 mins to fix
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 51..54
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 88..95
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 106..109
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 144..147
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 201..206
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 285..290

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 51.

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 6 locations. Consider refactoring.
Open

RepeatDaily.propTypes = {
  repeatData: PropTypes.object.isRequired,
  setRepeatData: PropTypes.func.isRequired,
  setValid: PropTypes.func.isRequired,
};
Severity: Major
Found in webpack/JobWizard/steps/Schedule/RepeatDaily.js and 5 other locations - About 50 mins to fix
webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js on lines 143..147
webpack/JobWizard/steps/HostsAndInputs/HostPreviewModal.js on lines 66..70
webpack/JobWizard/steps/Schedule/RepeatCron.js on lines 82..86
webpack/JobWizard/steps/Schedule/RepeatMonth.js on lines 43..47
webpack/JobWizard/steps/Schedule/RepeatWeek.js on lines 68..72

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 51.

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 7 locations. Consider refactoring.
Open

    act(() => {
      fireEvent.click(
        screen.getByRole('button', { name: 'Recurring execution' })
      );
      jest.advanceTimersByTime(1000); // to handle pf4 date picker popover useTimer
Severity: Major
Found in webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js and 6 other locations - About 50 mins to fix
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 51..54
webpack/JobWizard/steps/ReviewDetails/ReviewDetails.test.js on lines 88..95
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 106..109
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 144..147
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 251..256
webpack/JobWizard/steps/Schedule/__tests__/Schedule.test.js on lines 285..290

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 51.

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 6 locations. Consider refactoring.
Open

HostPreviewModal.propTypes = {
  isOpen: PropTypes.bool.isRequired,
  setIsOpen: PropTypes.func.isRequired,
  searchQuery: PropTypes.string.isRequired,
};
Severity: Major
Found in webpack/JobWizard/steps/HostsAndInputs/HostPreviewModal.js and 5 other locations - About 50 mins to fix
webpack/JobWizard/steps/AdvancedFields/AdvancedFields.js on lines 143..147
webpack/JobWizard/steps/Schedule/RepeatCron.js on lines 82..86
webpack/JobWizard/steps/Schedule/RepeatDaily.js on lines 33..37
webpack/JobWizard/steps/Schedule/RepeatMonth.js on lines 43..47
webpack/JobWizard/steps/Schedule/RepeatWeek.js on lines 68..72

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 51.

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