theforeman/foreman_remote_execution

View on GitHub

Showing 250 of 250 total issues

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

    render(
      <MockedProvider mocks={gqlMock} addTypename={false}>
        <Provider store={store}>
          <JobWizard />
        </Provider>
webpack/JobWizard/__tests__/integration.test.js on lines 90..96
webpack/JobWizard/__tests__/validation.test.js on lines 32..38
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 103..109
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 180..186
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 19..25
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 117..123
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 173..179
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 192..198
webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js on lines 16..22
webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js on lines 54..60

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

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

    render(
      <MockedProvider mocks={gqlMock} addTypename={false}>
        <Provider store={store}>
          <JobWizard />
        </Provider>
webpack/JobWizard/__tests__/integration.test.js on lines 90..96
webpack/JobWizard/__tests__/validation.test.js on lines 32..38
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 103..109
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 180..186
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 19..25
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 117..123
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 149..155
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 173..179
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 192..198
webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js on lines 54..60

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

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

    render(
      <MockedProvider mocks={gqlMock} addTypename={false}>
        <Provider store={store}>
          <JobWizard />
        </Provider>
webpack/JobWizard/__tests__/integration.test.js on lines 90..96
webpack/JobWizard/__tests__/validation.test.js on lines 32..38
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 103..109
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 180..186
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 19..25
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 117..123
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 149..155
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 173..179
webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js on lines 16..22
webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js on lines 54..60

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

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

    render(
      <MockedProvider mocks={gqlMock} addTypename={false}>
        <Provider store={store}>
          <JobWizard />
        </Provider>
webpack/JobWizard/__tests__/integration.test.js on lines 90..96
webpack/JobWizard/__tests__/validation.test.js on lines 32..38
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 103..109
webpack/JobWizard/steps/AdvancedFields/__tests__/AdvancedFields.test.js on lines 180..186
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 19..25
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 117..123
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 149..155
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 173..179
webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js on lines 192..198
webpack/JobWizard/steps/HostsAndInputs/__tests__/TemplateInputs.test.js on lines 16..22

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

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 formatter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const formatter = (input, values, setValue) => {
  const isSelectType = !!input?.options;
  const inputType = input.value_type;
  const isTextType = inputType === 'plain' || !inputType; // null defaults to plain

Severity: Minor
Found in webpack/JobWizard/steps/form/Formatter.js - About 1 hr 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

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

            {jobOrganization?.id !== currentOrganization?.id && (
              <Alert
                ouiaId="job-wizard-alert-organization"
                isInline
                className="job-wizard-alert"
Severity: Major
Found in webpack/JobWizard/JobWizardPageRerun.js and 1 other location - About 1 hr to fix
webpack/JobWizard/JobWizardPageRerun.js on lines 152..166

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

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

            {jobLocation?.id !== currentLocation?.id && (
              <Alert
                ouiaId="job-wizard-alert-location"
                isInline
                className="job-wizard-alert"
Severity: Major
Found in webpack/JobWizard/JobWizardPageRerun.js and 1 other location - About 1 hr to fix
webpack/JobWizard/JobWizardPageRerun.js on lines 137..151

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

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 useNameSearchGQL has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useNameSearchGQL = apiKey => {
  const org = useForemanOrganization();
  const location = useForemanLocation();
  const [search, setSearch] = useState('');
  const queries = {
Severity: Minor
Found in webpack/JobWizard/steps/HostsAndInputs/SelectGQL.js - About 1 hr to fix

    Function enableRecurringLogic has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ) => dispatch => {
      const successToast = () =>
        enabled
          ? sprintf(__('Recurring logic %s disabled successfully.'), recurrenceId)
          : sprintf(__('Recurring logic %s enabled successfully.'), recurrenceId);
    Severity: Minor
    Found in webpack/JobInvocationDetail/JobInvocationActions.js - About 1 hr to fix

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

          render(
            <Provider store={store}>
              <JobInvocationDetailPage match={{ params: { id: `${jobId}` } }} />
            </Provider>
          );
      webpack/JobInvocationDetail/__tests__/MainInformation.test.js on lines 88..92

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

      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

          const { container } = render(
            <Provider store={store}>
              <JobInvocationDetailPage match={{ params: { id: `${jobId}` } }} />
            </Provider>
          );
      webpack/JobInvocationDetail/__tests__/MainInformation.test.js on lines 200..204

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

      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

      Method register has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.register(label, name, options = {})
          pending_migrations = ::Foreman::Plugin.registered_plugins[:foreman_remote_execution]&.pending_migrations
          begin
            # Let's not try to register features if rex is not registered as a plugin
            return false if pending_migrations || pending_migrations.nil?
      Severity: Minor
      Found in app/models/remote_execution_feature.rb - About 1 hr to fix

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

              <DescriptionListGroup>
                <DescriptionListTerm>{__('Effective user:')}</DescriptionListTerm>
                <DescriptionListDescription>
                  {effectiveUser || <DefaultLoaderEmptyState />}
                </DescriptionListDescription>
        Severity: Major
        Found in webpack/JobInvocationDetail/JobInvocationOverview.js and 2 other locations - About 1 hr to fix
        webpack/JobInvocationDetail/JobInvocationOverview.js on lines 51..56
        webpack/JobInvocationDetail/JobInvocationSystemStatusChart.js on lines 134..139

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

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

                    <DescriptionListGroup>
                      <DescriptionListTerm>{__('Scheduled at:')}</DescriptionListTerm>
                      <DescriptionListDescription>
                        {formattedStartDate || <DefaultLoaderEmptyState />}
                      </DescriptionListDescription>
        webpack/JobInvocationDetail/JobInvocationOverview.js on lines 39..44
        webpack/JobInvocationDetail/JobInvocationOverview.js on lines 51..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 58.

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

              <DescriptionListGroup>
                <DescriptionListTerm>{__('SSH user:')}</DescriptionListTerm>
                <DescriptionListDescription>
                  {sshUser || <DefaultLoaderEmptyState />}
                </DescriptionListDescription>
        Severity: Major
        Found in webpack/JobInvocationDetail/JobInvocationOverview.js and 2 other locations - About 1 hr to fix
        webpack/JobInvocationDetail/JobInvocationOverview.js on lines 39..44
        webpack/JobInvocationDetail/JobInvocationSystemStatusChart.js on lines 134..139

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

        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

                selected.hosts.length === 0 &&
                selected.hostCollections.length === 0 &&
                selected.hostGroups.length === 0 &&
                hostsSearchQuery.length === 0
        Severity: Major
        Found in webpack/JobWizard/steps/HostsAndInputs/index.js and 1 other location - About 1 hr to fix
        webpack/JobWizard/JobWizard.js on lines 248..251

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

        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

                label: (
                  <StepButton
                    stepName={
                      scheduleValue.scheduleType === SCHEDULE_TYPES.RECURRING
                        ? SCHEDULE_TYPES.RECURRING
        Severity: Major
        Found in webpack/JobWizard/steps/ReviewDetails/index.js and 1 other location - About 1 hr to fix
        webpack/JobWizard/steps/ReviewDetails/index.js on lines 179..189

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

        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

              label: (
                <StepButton
                  stepName={
                    scheduleValue.scheduleType === SCHEDULE_TYPES.RECURRING
                      ? SCHEDULE_TYPES.RECURRING
        Severity: Major
        Found in webpack/JobWizard/steps/ReviewDetails/index.js and 1 other location - About 1 hr to fix
        webpack/JobWizard/steps/ReviewDetails/index.js on lines 194..204

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

        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

            selectedTargets.hosts.length > 0 ||
            selectedTargets.hostCollections.length > 0 ||
            selectedTargets.hostGroups.length > 0 ||
            hostsSearchQuery.length > 0;
        Severity: Major
        Found in webpack/JobWizard/JobWizard.js and 1 other location - About 1 hr to fix
        webpack/JobWizard/steps/HostsAndInputs/index.js on lines 64..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 57.

        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

        Method render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def render
            @template_input_values ||= values_from_invocation
            @template.validate_unique_inputs!
            source = Foreman::Renderer.get_source(
              template: template,
        Severity: Minor
        Found in app/models/input_template_renderer.rb - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language