theforeman/foreman

View on GitHub

Showing 1,249 of 1,249 total issues

Avoid too many return statements within this function.
Open

      return state.set('templateKindId', payload);
Severity: Major
Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return state.set('searchQuery', '').set('isSearchingHosts', false);
    Severity: Major
    Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return state.set('isLoading', false);
      Severity: Major
      Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return state
                .set('searchQuery', '')
                .set('isFetchingHosts', false)
                .set('isSearchingHosts', false);
        Severity: Major
        Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return state.set('isRendering', !state.isRendering);
          Severity: Major
          Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return state.set('isFetchingHosts', false).merge(payload);
            Severity: Major
            Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return state.set('hosts', payload);
              Severity: Major
              Found in webpack/assets/javascripts/react_app/components/Editor/EditorReducer.js - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return 'AuthSource' if klass <= AuthSource
                Severity: Major
                Found in app/models/permission.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return 'Setting' if klass <= Setting
                  Severity: Major
                  Found in app/models/permission.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                        (handle_realm || return) if kind == 'provision'
                    Severity: Major
                    Found in app/controllers/unattended_controller.rb - About 30 mins to fix

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

                        const { result } = renderHook(() => useBulkSelect({
                          results,
                          metadata,
                          idColumn,
                          isSelectable,
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/TableHooks.test.js on lines 25..30
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/TableHooks.test.js on lines 40..45

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 45.

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

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

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

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

                      Refactorings

                      Further Reading

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

                        const { result } = renderHook(() => useBulkSelect({
                          results,
                          metadata,
                          idColumn,
                          isSelectable,
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/TableHooks.test.js on lines 25..30
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/TableHooks.test.js on lines 59..64

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

                      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

                          case OK_STATUS_STATE:
                            return (
                              <span className="status-success" style={style}>
                                <CheckCircleIcon noVerticalAlign /> {label}
                              </span>
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 25..30
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 32..37
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 38..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 45.

                      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

                          case WARNING_STATUS_STATE:
                            return (
                              <span className="status-warning" style={style}>
                                <ExclamationTriangleIcon noVerticalAlign /> {label}
                              </span>
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 19..24
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 32..37
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 38..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 45.

                      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

                              errorToast: ({ response }) =>
                                // eslint-disable-next-line camelcase
                                response?.data?.error?.full_messages ||
                                response?.data?.error?.message,
                      webpack/assets/javascripts/react_app/components/HostDetails/Tabs/Parameters/EditTableRow.js on lines 42..44

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

                      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

                          case NA_STATUS_STATE:
                            return (
                              <span className="disabled" style={style}>
                                <BanIcon noVerticalAlign /> {label}
                              </span>
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 19..24
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 25..30
                      webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusIcon.js on lines 32..37

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

                      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

                        get initialDate() {
                          const { value } = this.props;
                          return this.hasDefaultValue ? new Date(value) : new Date();
                        }
                      webpack/assets/javascripts/react_app/components/common/DateTimePicker/DatePicker.js on lines 16..19

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                        const { result } = renderHook(() => useBulkSelect({
                          results,
                          metadata,
                          idColumn,
                          isSelectable,
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/TableHooks.test.js on lines 40..45
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/TableHooks.test.js on lines 59..64

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

                      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

                          errorToast: ({ response }) =>
                            // eslint-disable-next-line camelcase
                            response?.data?.error?.full_messages || response?.data?.error?.message,
                      webpack/assets/javascripts/react_app/components/HostDetails/Tabs/Parameters/RowActions.js on lines 20..23

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

                      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

                        userInfo: PropTypes.shape({
                          search_path: PropTypes.string,
                          display_name: PropTypes.string,
                          audit_path: PropTypes.string,
                        }).isRequired,
                      webpack/assets/javascripts/react_app/components/HostDetails/Tabs/Details/Cards/TemplatesCard/ReviewModal.js on lines 116..120
                      webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/Table.js on lines 166..170

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

                      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