erikras/redux-form

View on GitHub

Showing 22 of 119 total issues

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

const createReduxForm = (structure: Structure<*, *>) => {
  const { deepEqual, empty, getIn, setIn, keys, fromJS } = 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 251 lines of code (exceeds 100 allowed). Consider refactoring.
      Open

      const createConnectedField = (structure: Structure<*, *>) => {
        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 7 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 163 lines of code (exceeds 100 allowed). Consider refactoring.
          Open

          const createConnectedFields = (structure: Structure<*, *>) => {
            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 3 hrs to fix

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

            const createConnectedFieldArray = (structure: Structure<*, *>) => {
              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 3 hrs to fix

              Function render has 127 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 2 hrs to fix

                Function createField has 110 lines of code (exceeds 100 allowed). Consider refactoring.
                Open

                const createField = (structure: Structure<*, *>) => {
                  const ConnectedField = createConnectedField(structure)
                
                  const { setIn } = structure
                
                
                Severity: Major
                Found in src/createField.js - About 1 hr 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 event
                    Severity: Major
                    Found in src/events/getValue.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,
                            [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

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

                                      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 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 !keys(registeredFields)
                                            .filter(name => getIn(registeredFields, `['${name}'].count`) > 0)
                                            .some(name =>
                                              hasError(
                                                getIn(registeredFields, `['${name}']`),
                                      Severity: Major
                                      Found in src/selectors/isValid.js - About 30 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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language