yannickcr/eslint-plugin-react

View on GitHub

Showing 501 of 696 total issues

Function create has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

  create(context) {
    const configuration = context.options[0] || {};
    const ignoreCase = configuration.ignoreCase || false;

    /**
Severity: Minor
Found in lib/rules/sort-default-props.js - About 4 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 create has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  create: Components.detect((context, components) => {
    const configuration = context.options[0] || {};
    const ignored = configuration.ignore || [];
    const skipUndeclared = configuration.skipUndeclared || false;

Severity: Major
Found in lib/rules/prop-types.js - About 4 hrs to fix

    Function create has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      create: Components.detect((context, components, utils) => {
        const typeAliases = {};
        const exactWrappers = propWrapperUtil.getExactPropWrapperFunctions(context);
        const sourceCode = context.getSourceCode();
    
    
    Severity: Major
    Found in lib/rules/prefer-exact-props.js - About 4 hrs to fix

      Function create has 107 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        create(context) {
          const configuration = context.options[0] || {};
          const ignoreCase = configuration.ignoreCase || false;
          const callbacksLast = configuration.callbacksLast || false;
          const shorthandFirst = configuration.shorthandFirst || false;
      Severity: Major
      Found in lib/rules/jsx-sort-props.js - About 4 hrs to fix

        Function create has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

          create(context) {
            function findSpreadVariable(name) {
              return variableUtil.variablesInScope(context).find((item) => item.name === name);
            }
            /**
        Severity: Minor
        Found in lib/rules/no-danger-with-children.js - About 4 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 create has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

          create: (context) => ({
            JSXElement(node) {
              const elementName = node.openingElement.name.name;
        
              if (!isVoidDOMElement(elementName)) {
        Severity: Minor
        Found in lib/rules/void-dom-elements-no-children.js - About 4 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 create has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

          create(context) {
            const extraColumnStart = 0;
            let indentType = 'space';
            /** @type {number|'first'} */
            let indentSize = 4;
        Severity: Minor
        Found in lib/rules/jsx-indent-props.js - About 4 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 create has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          create(context) {
            const defaults = {
              noStrings: false,
              allowedStrings: [],
              ignoreProps: false,
        Severity: Major
        Found in lib/rules/jsx-no-literals.js - About 4 hrs to fix

          Function create has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

            create: Components.detect((context, components, utils) => {
              const allowAsProps = context.options.some((option) => option && option.allowAsProps);
          
              /**
               * Check whether given node is declared inside class component's render block
          Severity: Minor
          Found in lib/rules/no-unstable-nested-components.js - About 4 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 isConstruction has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          function isConstruction(node, callScope) {
            switch (node.type) {
              case 'Literal':
                if (node.regex != null) {
                  return { type: 'regular expression', node };
          Severity: Minor
          Found in lib/rules/jsx-no-constructed-context-values.js - About 4 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 create has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

            create: Components.detect((context, components) => {
              const configuration = context.options[0] || {};
              let fileVarType = 'var';
          
              const namedConfig = [].concat(
          Severity: Minor
          Found in lib/rules/function-component-definition.js - About 4 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 create has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            create(context) {
              const extraColumnStart = 0;
              let indentType = 'space';
              /** @type {number|'first'} */
              let indentSize = 4;
          Severity: Major
          Found in lib/rules/jsx-indent-props.js - About 4 hrs to fix

            File sort-comp.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * @fileoverview Enforce component methods order
             * @author Yannick Croissant
             */
            
            
            Severity: Minor
            Found in lib/rules/sort-comp.js - About 4 hrs to fix

              Function markPropTypesAsUsed has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function markPropTypesAsUsed(node, parentNames) {
                  parentNames = parentNames || [];
                  let type;
                  let name;
                  let allNames;
              Severity: Major
              Found in lib/util/usedPropTypes.js - About 4 hrs to fix

                Function create has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  create(context) {
                    const pragma = pragmaUtil.getFromContext(context);
                    const deprecated = getDeprecated(pragma);
                
                    function isDeprecated(method) {
                Severity: Major
                Found in lib/rules/no-deprecated.js - About 4 hrs to fix

                  Function create has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    create: Components.detect((context, components, utils) => {
                      const allowAsProps = context.options.some((option) => option && option.allowAsProps);
                  
                      /**
                       * Check whether given node is declared inside class component's render block
                  Severity: Major
                  Found in lib/rules/no-unstable-nested-components.js - About 3 hrs to fix

                    Function create has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        const config = context.options[0] || {};
                        const allowInPropTypes = config.allowInPropTypes || false;
                    
                        // --------------------------------------------------------------------------
                    Severity: Minor
                    Found in lib/rules/forbid-foreign-prop-types.js - About 3 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 create has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        const config = context.options[0] || {};
                        const allowGlobals = config.allowGlobals || false;
                    
                        /**
                    Severity: Minor
                    Found in lib/rules/jsx-no-undef.js - About 3 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 create has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      create: Components.detect((context, components) => {
                        const configuration = context.options[0] || {};
                        const forbidDefaultForRequired = configuration.forbidDefaultForRequired || false;
                        const classes = configuration.classes || 'defaultProps';
                        /**
                    Severity: Major
                    Found in lib/rules/require-default-props.js - About 3 hrs to fix

                      Function create has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        create(context) {
                          const configuration = Object.assign(
                            {
                              allowReferrer: false,
                              warnOnSpreadAttributes: false,
                      Severity: Major
                      Found in lib/rules/jsx-no-target-blank.js - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language