theforeman/foreman

View on GitHub

Showing 1,262 of 1,262 total issues

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

                <FormattedMessage
                  defaultMessage="{count, plural, one {# {singular}} other {# {plural}}}"
                  values={{
                    count: selectedCount,
                    singular: __('host'),
webpack/assets/javascripts/react_app/components/HostsIndex/BulkActions/bulkDelete.js on lines 35..43

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

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 LineChart = ({
  data,
  title,
  config,
  noDataMsg,
webpack/assets/javascripts/react_app/components/common/forms/Form.js on lines 10..36

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

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 {
    selectAll,
    selectPage,
    selectNone,
    selectedCount,
webpack/assets/javascripts/react_app/components/HostDetails/Tabs/Details/Cards/SystemProperties/index.js on lines 21..30

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

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 {
    name,
    model_name: model,
    location_name: location,
    organization_name: organization,
webpack/assets/javascripts/react_app/components/HostsIndex/index.js on lines 126..135

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

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 selectable_f has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def selectable_f(f, attr, array, select_options = {}, html_options = {})
Severity: Minor
Found in app/helpers/form_helper.rb - About 35 mins to fix

    Method form_select_f has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def form_select_f(f, attr, array, select_options = {}, html_options = {})
    Severity: Minor
    Found in app/helpers/form_helper.rb - About 35 mins to fix

      Method checkbox_f has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def checkbox_f(f, attr, options = {}, checked_value = "1", unchecked_value = "0")
      Severity: Minor
      Found in app/helpers/form_helper.rb - About 35 mins to fix

        Method orderable_select_f has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def orderable_select_f(f, attr, choices, select_options = {}, html_options = {})
        Severity: Minor
        Found in app/helpers/form_helper.rb - About 35 mins to fix

          Method time_zone_select_f has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def time_zone_select_f(f, attr, default_timezone, select_options = {}, html_options = {})
          Severity: Minor
          Found in app/helpers/form_helper.rb - About 35 mins to fix

            Method selectable_f_inline has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def selectable_f_inline(f, attr, array, select_options = {}, html_options = {})
            Severity: Minor
            Found in app/helpers/form_helper.rb - About 35 mins to fix

              Method link_to_add_fields has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def link_to_add_fields(name, f, association, partial = nil, options = {})
              Severity: Minor
              Found in app/helpers/form_helper.rb - About 35 mins to fix

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

                  'should call the API put action': () =>
                    APIActions.put({ key, url, params, headers, payload, actionTypes }),
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 13..14
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 15..16
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 19..20

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

                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

                  it('should handle NOTIFICATIONS_MARK_AS_CLEAR', () => {
                    expect(
                      reducer(stateWithNotifications, {
                        type: types.NOTIFICATIONS_MARK_AS_CLEAR,
                        payload: NotificationRequest,
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 17..24
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 26..33
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 44..51

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

                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

                  it('should handle NOTIFICATIONS_MARK_AS_READ', () => {
                    expect(
                      reducer(stateWithNotifications, {
                        type: types.NOTIFICATIONS_MARK_AS_READ,
                        payload: NotificationRequest,
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 17..24
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 26..33
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 35..42

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

                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

                    ok: details
                      .filter(({ global_status: gs }) => gs === GLOBAL_STATUS_OK)
                      .reduce(calculate, { total: 0, owned: 0 }),
                webpack/assets/javascripts/react_app/components/HostStatuses/HostStatusesSelectors.js on lines 79..81
                webpack/assets/javascripts/react_app/components/HostStatuses/HostStatusesSelectors.js on lines 82..84

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

                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

                    warn: details
                      .filter(({ global_status: gs }) => gs === GLOBAL_STATUS_WARN)
                      .reduce(calculate, { total: 0, owned: 0 }),
                webpack/assets/javascripts/react_app/components/HostStatuses/HostStatusesSelectors.js on lines 76..78
                webpack/assets/javascripts/react_app/components/HostStatuses/HostStatusesSelectors.js on lines 82..84

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

                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

                  it('should handle NOTIFICATIONS_MARK_GROUP_AS_READ', () => {
                    expect(
                      reducer(stateWithNotifications, {
                        type: types.NOTIFICATIONS_MARK_GROUP_AS_READ,
                        payload: panelRequest,
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 26..33
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 35..42
                webpack/assets/javascripts/react_app/redux/reducers/notifications/notifications.test.js on lines 44..51

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

                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

                  'should call the API get action': () =>
                    APIActions.get({ key, url, params, headers, payload, actionTypes }),
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 15..16
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 17..18
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 19..20

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

                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

                    error: details
                      .filter(({ global_status: gs }) => gs === GLOBAL_STATUS_ERROR)
                      .reduce(calculate, { total: 0, owned: 0 }),
                webpack/assets/javascripts/react_app/components/HostStatuses/HostStatusesSelectors.js on lines 76..78
                webpack/assets/javascripts/react_app/components/HostStatuses/HostStatusesSelectors.js on lines 79..81

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

                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

                  'should call the API post action': () =>
                    APIActions.post({ key, url, params, headers, payload, actionTypes }),
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 13..14
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 17..18
                webpack/assets/javascripts/react_app/redux/API/__tests__/APIActions.test.js on lines 19..20

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

                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