pedrojpj/recompose-extends

View on GitHub

Showing 10 of 52 total issues

Function withForm has 354 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const withForm = (input, handlers, errors) => BaseComponent => {
  const factory = createFactory(BaseComponent);

  class WithForm extends Component {
    constructor(props) {
Severity: Major
Found in src/withForm/index.js - About 1 day to fix

    File WithForm.test.js has 698 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import Enzyme, { mount } from 'enzyme';
    import Adapter from 'enzyme-adapter-react-16';
    import { compose, withState, withHandlers } from 'recompose';
    
    
    Severity: Major
    Found in src/withForm/WithForm.test.js - About 1 day to fix

      File index.js has 358 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { createFactory, Component } from 'react';
      
      const withForm = (input, handlers, errors) => BaseComponent => {
        const factory = createFactory(BaseComponent);
      
      
      Severity: Minor
      Found in src/withForm/index.js - About 4 hrs to fix

        File withForm.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { compose, withState, withProps, pure } from 'recompose';
        import { withForm } from '../src/index';
        
        const WithForm = ({
        Severity: Minor
        Found in example/withForm.js - About 2 hrs to fix

          Function withForm has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          const withForm = (input, handlers, errors) => BaseComponent => {
            const factory = createFactory(BaseComponent);
          
            class WithForm extends Component {
              constructor(props) {
          Severity: Minor
          Found in src/withForm/index.js - About 2 hrs 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 withErrors has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const withErrors = (input = {}, component) => BaseComponent => {
            const factoryError = createFactory(component);
            const factory = createFactory(BaseComponent);
          
            class withErrorClass extends Component {
          Severity: Major
          Found in src/withErrors/index.js - About 2 hrs to fix

            Function waitFor has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const waitFor = (input, loadingComponent) => BaseComponent => {
              const factory = createFactory(BaseComponent);
              const factoryLoading = createFactory(loadingComponent);
            
              class WaitFor extends Component {
            Severity: Minor
            Found in src/waitFor/index.js - About 1 hr to fix

              Function withErrors has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              const withErrors = (input = {}, component) => BaseComponent => {
                const factoryError = createFactory(component);
                const factory = createFactory(BaseComponent);
              
                class withErrorClass extends Component {
              Severity: Minor
              Found in src/withErrors/index.js - About 1 hr 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 render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  render() {
                    const {
                      form,
                      formError,
                      formFieldsWithErrors,
              Severity: Minor
              Found in src/withForm/index.js - About 1 hr to fix

                Function waitFor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const waitFor = (input, loadingComponent) => BaseComponent => {
                  const factory = createFactory(BaseComponent);
                  const factoryLoading = createFactory(loadingComponent);
                
                  class WaitFor extends Component {
                Severity: Minor
                Found in src/waitFor/index.js - About 35 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