theforeman/foreman

View on GitHub

Showing 722 of 1,271 total issues

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('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('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('value', 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 param.value;

            Avoid too many return statements within this function.
            Open

                  return state.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('isMaximized', !state.isMaximized);
              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.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 function.
                    Open

                          return state
                            .set('isSelectOpen', !state.isSelectOpen)
                            .set('searchQuery', '');
                    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('diffViewType', 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('isMasked', !state.isMasked);
                        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 '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

                                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

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

                                Avoid too many return statements within this method.
                                Open

                                    return head(:method_not_allowed) unless allowed_to_install?
                                Severity: Major
                                Found in app/controllers/unattended_controller.rb - About 30 mins to fix

                                  Function getChartConfig has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export const getChartConfig = ({
                                    type,
                                    data,
                                    config,
                                    onclick,
                                  Severity: Minor
                                  Found in webpack/assets/javascripts/services/charts/ChartService.js - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

                                  Function ReportsTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const ReportsTable = ({ reports, status, fetchReports, error, origin }) => {
                                    const columns = getColumns(fetchReports, origin);
                                    let tableBody = null;
                                    let tableHead = null;
                                    let emptyState = null;

                                  Cognitive Complexity

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

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

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

                                  Further reading

                                  Function submit_with_all_params has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function submit_with_all_params() {
                                    $('form.hostresource-form input[type="submit"]').attr('disabled', true);
                                    stop_pooling = false;
                                    $('body').css('cursor', 'progress');
                                    clear_errors();
                                  Severity: Minor
                                  Found in app/assets/javascripts/host_edit.js - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

                                  Function HostsIndex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const HostsIndex = () => {
                                    const [menuOpen, setMenuOpen] = useState(false);
                                    const [allColumns, setAllColumns] = useState(
                                      getColumnData({ tableName: 'hosts' })
                                    );
                                  Severity: Minor
                                  Found in webpack/assets/javascripts/react_app/components/HostsIndex/index.js - About 25 mins to fix

                                  Cognitive Complexity

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

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

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

                                  Further reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language