erikras/redux-form

View on GitHub

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

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

        it('should remove submit error from middle', () => {
          const state = reducer(
            fromJS({
              foo: {
                values: {
      Severity: Major
      Found in src/__tests__/helpers/reducer.arrayRemove.js and 1 other location - About 1 day to fix
      src/__tests__/helpers/reducer.arrayRemove.js on lines 423..474

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

      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

        it('should remove async error from end', () => {
          const state = reducer(
            fromJS({
              foo: {
                values: {
      Severity: Major
      Found in src/__tests__/helpers/reducer.arrayRemove.js and 1 other location - About 1 day to fix
      src/__tests__/helpers/reducer.arrayRemove.js on lines 528..579

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

      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

        it('should remove submit error from end', () => {
          const state = reducer(
            fromJS({
              foo: {
                values: {
      Severity: Major
      Found in src/__tests__/helpers/reducer.arrayRemove.js and 1 other location - About 1 day to fix
      src/__tests__/helpers/reducer.arrayRemove.js on lines 370..421

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

      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

        it('should remove async error from middle', () => {
          const state = reducer(
            fromJS({
              foo: {
                values: {
      Severity: Major
      Found in src/__tests__/helpers/reducer.arrayRemove.js and 1 other location - About 1 day to fix
      src/__tests__/helpers/reducer.arrayRemove.js on lines 581..632

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

      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

        it('should remove async error from beginning', () => {
          const state = reducer(
            fromJS({
              foo: {
                values: {
      Severity: Major
      Found in src/__tests__/helpers/reducer.arrayRemove.js and 1 other location - About 1 day to fix
      src/__tests__/helpers/reducer.arrayRemove.js on lines 475..526

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

      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

        it('should remove submit error from beginning', () => {
          const state = reducer(
            fromJS({
              foo: {
                values: {
      Severity: Major
      Found in src/__tests__/helpers/reducer.arrayRemove.js and 1 other location - About 1 day to fix
      src/__tests__/helpers/reducer.arrayRemove.js on lines 317..368

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

      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

        it('should remove sync errors', () => {
          expect(
            reducer(
              setIn(
                fromJS({
      Severity: Major
      Found in src/__tests__/helpers/reducer.unregisterField.js and 1 other location - About 7 hrs to fix
      src/__tests__/helpers/reducer.unregisterField.js on lines 236..291

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

      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

        it('should remove sync warnings', () => {
          expect(
            reducer(
              setIn(
                fromJS({
      Severity: Major
      Found in src/__tests__/helpers/reducer.unregisterField.js and 1 other location - About 7 hrs to fix
      src/__tests__/helpers/reducer.unregisterField.js on lines 19..74

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

      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

      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

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

          it('should persist errors if they exist', () => {
            const state = reducer(
              fromJS({
                foo: {
                  registeredFields: [{ name: 'myField', type: 'Field' }],
        Severity: Major
        Found in src/__tests__/helpers/reducer.initialize.js and 1 other location - About 4 hrs to fix
        src/__tests__/helpers/reducer.initialize.js on lines 354..388

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

        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

          it('should persist warnings if they exist', () => {
            const state = reducer(
              fromJS({
                foo: {
                  registeredFields: [{ name: 'myField', type: 'Field' }],
        Severity: Major
        Found in src/__tests__/helpers/reducer.initialize.js and 1 other location - About 4 hrs to fix
        src/__tests__/helpers/reducer.initialize.js on lines 390..424

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

        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

        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

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

            it('should update complex sync errors', () => {
              const state = reducer(
                fromJS({
                  foo: {
                    values: {
          Severity: Major
          Found in src/__tests__/helpers/reducer.updateSyncErrors.js and 1 other location - About 4 hrs to fix
          src/__tests__/helpers/reducer.updateSyncWarnings.js on lines 80..112

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

          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

            it('should update complex sync warnings', () => {
              const state = reducer(
                fromJS({
                  foo: {
                    values: {
          Severity: Major
          Found in src/__tests__/helpers/reducer.updateSyncWarnings.js and 1 other location - About 4 hrs to fix
          src/__tests__/helpers/reducer.updateSyncErrors.js on lines 77..109

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

          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

            it('should treat a matching dirty value as pristine when keepDirty is set', () => {
              const state = reducer(
                fromJS({
                  foo: {
                    registeredFields: {
          Severity: Major
          Found in src/__tests__/helpers/reducer.initialize.js and 2 other locations - About 3 hrs to fix
          src/__tests__/helpers/reducer.initialize.js on lines 226..256
          src/__tests__/helpers/reducer.initialize.js on lines 258..288

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

          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

            it('should retain dirty values when keepDirty is set', () => {
              const state = reducer(
                fromJS({
                  foo: {
                    registeredFields: {
          Severity: Major
          Found in src/__tests__/helpers/reducer.initialize.js and 2 other locations - About 3 hrs to fix
          src/__tests__/helpers/reducer.initialize.js on lines 258..288
          src/__tests__/helpers/reducer.initialize.js on lines 290..320

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

          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

            it('should replace pristine values when keepDirty is set', () => {
              const state = reducer(
                fromJS({
                  foo: {
                    registeredFields: {
          Severity: Major
          Found in src/__tests__/helpers/reducer.initialize.js and 2 other locations - About 3 hrs to fix
          src/__tests__/helpers/reducer.initialize.js on lines 226..256
          src/__tests__/helpers/reducer.initialize.js on lines 290..320

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

          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

          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
            Severity
            Category
            Status
            Source
            Language