erikras/redux-form

View on GitHub

Showing 22 of 125 total issues

Function createReduxForm has 735 lines of code (exceeds 100 allowed). Consider refactoring.
Open

export default function createReduxForm(structure: Structure<any, any>) {
  const { deepEqual, empty, getIn, setIn, keys, fromJS, toJS } = structure
  const isValid = createIsValid(structure)
  return (initialConfig: Config) => {
    const config = {
Severity: Major
Found in src/createReduxForm.js - About 3 days to fix

    Function createReducer has 706 lines of code (exceeds 100 allowed). Consider refactoring.
    Open

    function createReducer<M, L>(structure: Structure<M, L>) {
      const {
        deepEqual,
        empty,
        forEach,
    Severity: Major
    Found in src/createReducer.js - About 3 days to fix

      Function createConnectedField has 242 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

      function createConnectedField<L, M>(structure: Structure<L, M>) {
        const { deepEqual, getIn } = structure
        const getSyncError = (syncErrors: Object, name: string) => {
          const error = plain.getIn(syncErrors, name)
          // Because the error for this field might not be at a level in the error structure where
      Severity: Major
      Found in src/ConnectedField.js - About 6 hrs to fix

        behaviors has 34 functions (exceeds 20 allowed). Consider refactoring.
        Open

          const behaviors: { [string]: { (state: any, action: Action): M } } = {
            [ARRAY_INSERT](
              state,
              {
                meta: { field, index },
        Severity: Minor
        Found in src/createReducer.js - About 4 hrs to fix

          Function createConnectedFields has 149 lines of code (exceeds 100 allowed). Consider refactoring.
          Open

          export default function createConnectedFields(structure: Structure<any, any>) {
            const { deepEqual, getIn, size } = structure
          
            const getSyncError = (syncErrors: Object, name: string) => {
              // Because the error for this field might not be at a level in the error structure where
          Severity: Major
          Found in src/ConnectedFields.js - About 2 hrs to fix

            Function createConnectedFieldArray has 148 lines of code (exceeds 100 allowed). Consider refactoring.
            Open

            export default function createConnectedFieldArray(structure: Structure<any, any>) {
              const { deepEqual, getIn, size, equals, orderChanged } = structure
              const getSyncError = (syncErrors: Object, name: string) => {
                // For an array, the error can _ONLY_ be under _error.
                // This is why this getSyncError is not the same as the
            Severity: Major
            Found in src/ConnectedFieldArray.js - About 2 hrs to fix

              Function render has 123 lines of code (exceeds 100 allowed). Consider refactoring.
              Open

                      render() {
                        // remove some redux-form config-only props
                        /* eslint-disable no-unused-vars */
                        const {
                          anyTouched,
              Severity: Major
              Found in src/createReduxForm.js - About 1 hr to fix

                Function createFieldArrayProps has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  { getIn }: Structure<any, any>,
                  name: string,
                  form: string,
                  sectionPrefix?: string,
                  getValue: Function,
                Severity: Minor
                Found in src/createFieldArrayProps.js - About 45 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return copy
                  Severity: Major
                  Found in src/structure/plain/splice.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return getSelectedValues(event.target.options)
                    Severity: Major
                    Found in src/events/getValue.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return state
                      Severity: Major
                      Found in src/structure/plain/deleteIn.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return value
                        Severity: Major
                        Found in src/events/getValue.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return copy
                          Severity: Major
                          Found in src/structure/plain/deleteIn.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return {
                                ...state,
                                [first]: next
                              }
                            Severity: Major
                            Found in src/structure/plain/setIn.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return !keys(registeredFields)
                                      .filter(name => getIn(registeredFields, `['${name}'].count`) > 0)
                                      .some(name =>
                                        hasError(getIn(registeredFields, `['${name}']`), syncErrors, asyncErrors, submitErrors)
                                      )
                              Severity: Major
                              Found in src/selectors/isValid.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return event
                                Severity: Major
                                Found in src/events/getValue.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                    return list.set(index, value)
                                  Severity: Major
                                  Found in src/structure/immutable/splice.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                      if (React.isValidElement(obj) || React.isValidElement(other)) return false
                                    Severity: Major
                                    Found in src/structure/plain/deepEqual.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                        return props
                                      Severity: Major
                                      Found in src/createFieldProps.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                          return state
                                        Severity: Major
                                        Found in src/structure/plain/deleteIn.js - About 30 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language