yannickcr/eslint-plugin-react

View on GitHub

Showing 502 of 700 total issues

Function reportNodeAttribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedList) {
Severity: Minor
Found in lib/rules/jsx-sort-props.js - About 35 mins to fix

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

    function usedPropTypesAreEquivalent(propA, propB) {
      if (propA.name === propB.name) {
        if (!propA.allNames && !propB.allNames) {
          return true;
        }
    Severity: Minor
    Found in lib/util/Components.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

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

    function detectReactVersion(context) {
      if (cachedDetectedReactVersion) {
        return cachedDetectedReactVersion;
      }
    
    
    Severity: Minor
    Found in lib/util/version.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

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

    function isComponentInRenderProp(node, context) {
      if (
        node
        && node.parent
        && node.parent.type === 'Property'
    Severity: Minor
    Found in lib/rules/no-unstable-nested-components.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

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

      create: Components.detect((context, components, utils) => ({
        MemberExpression(node) {
          if (node.object.type === 'ThisExpression') {
            const component = components.get(utils.getParentStatelessComponent(node));
            if (!component || (component.node && component.node.parent && component.node.parent.type === 'Property')) {
    Severity: Minor
    Found in lib/rules/no-this-in-sfc.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

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

    function isCreateCloneElement(node, context) {
      if (!node) {
        return false;
      }
    
    
    Severity: Minor
    Found in lib/rules/no-array-index-key.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

    Avoid too many return statements within this function.
    Open

      return unwrappedObjectNode.name === 'props' && !ast.isAssignmentLHS(node);
    Severity: Major
    Found in lib/util/usedPropTypes.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                return '__COMPUTED_PROP__';
      Severity: Major
      Found in lib/util/usedPropTypes.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                  return undefined;
        Severity: Major
        Found in lib/util/Components.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return node;
          Severity: Major
          Found in lib/util/Components.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return key.type === 'Identifier' ? key.name : key.value;
            Severity: Major
            Found in lib/util/ast.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return false;
              Severity: Major
              Found in lib/util/isCreateContext.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return false;
                Severity: Major
                Found in lib/rules/jsx-fragments.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return null;
                  Severity: Major
                  Found in lib/util/Components.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return isFirstLetterCapitalized(node.id.name) ? node : undefined;
                    Severity: Major
                    Found in lib/util/Components.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return false;
                      Severity: Major
                      Found in lib/util/componentUtil.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return isJSXValue(node.left) || isJSXValue(node.right);
                        Severity: Major
                        Found in lib/util/jsx.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return aKey.localeCompare(bKey);
                          Severity: Major
                          Found in lib/util/propTypesSort.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return 0;
                            Severity: Major
                            Found in lib/util/propTypesSort.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return;
                              Severity: Major
                              Found in lib/util/usedPropTypes.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language