yannickcr/eslint-plugin-react

View on GitHub

Showing 501 of 696 total issues

Avoid too many return statements within this function.
Open

    return fixer.replaceText(reportedNode, `${leftSideText} ? ${rightSideText} : null`);
Severity: Major
Found in lib/rules/jsx-no-leaked-render.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                  if (isWithoutNewLine === prevent) return;
    Severity: Major
    Found in lib/rules/jsx-newline.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                return;
      Severity: Major
      Found in lib/rules/no-unknown-property.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return curr;
        Severity: Major
        Found in lib/rules/sort-prop-types.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  if (tagName === 'fbt' || tagName === 'fbs') { return; } // fbt/fbs nodes are bonkers, let's not go there
          Severity: Major
          Found in lib/rules/no-unknown-property.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    if (!isValidHTMLTagInJSX(node)) { return; }
            Severity: Major
            Found in lib/rules/no-unknown-property.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return prev;
              Severity: Major
              Found in lib/rules/sort-prop-types.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return;
                Severity: Major
                Found in lib/rules/no-unknown-property.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                            return;
                  Severity: Major
                  Found in lib/rules/no-unknown-property.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return prev;
                    Severity: Major
                    Found in lib/rules/sort-prop-types.js - About 30 mins to fix

                      Function isSuperTypeParameterPropsDeclaration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function isSuperTypeParameterPropsDeclaration(node) {
                        if (node && (node.type === 'ClassDeclaration' || node.type === 'ClassExpression')) {
                          if (node.superTypeParameters && node.superTypeParameters.params.length > 0) {
                            return true;
                          }
                      Severity: Minor
                      Found in lib/util/propTypes.js - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        create(context) {
                          const configuration = context.options[0] || 'always';
                      
                          return {
                            ObjectExpression(node) {
                      Severity: Minor
                      Found in lib/rules/prefer-es6-class.js - About 25 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 isPropTypesDeclaration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function isPropTypesDeclaration(node) {
                        if (node && (node.type === 'ClassProperty' || node.type === 'PropertyDefinition')) {
                          // Flow support
                          if (node.typeAnnotation && node.key.name === 'props') {
                            return true;
                      Severity: Minor
                      Found in lib/util/props.js - About 25 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 iterateProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function iterateProperties(context, properties, fn, handleSpreadFn) {
                        if (properties && properties.length && typeof fn === 'function') {
                          for (let i = 0, j = properties.length; i < j; i++) {
                            const node = properties[i];
                            const key = astUtil.getKeyValue(context, node);
                      Severity: Minor
                      Found in lib/util/propTypes.js - About 25 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 isAnnotatedFunctionPropsDeclaration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function isAnnotatedFunctionPropsDeclaration(node, context) {
                        if (!node || !node.params || !node.params.length) {
                          return false;
                        }
                      
                      
                      Severity: Minor
                      Found in lib/util/annotations.js - About 25 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 isCreateContext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function isCreateContext(node) {
                        if (
                          node.init
                          && node.init.type === 'CallExpression'
                          && node.init.callee
                      Severity: Minor
                      Found in lib/util/isCreateContext.js - About 25 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 traverseReturns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function traverseReturns(ASTNode, context, onReturn) {
                        const nodeType = ASTNode.type;
                      
                        if (nodeType === 'ReturnStatement') {
                          onReturn(ASTNode.argument, () => {});
                      Severity: Minor
                      Found in lib/util/ast.js - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        create(context) {
                          const option = context.options[0] || 'always';
                          return {
                            'ClassProperty, PropertyDefinition'(node) {
                              if (
                      Severity: Minor
                      Found in lib/rules/state-in-constructor.js - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        create: Components.detect((context, components, utils) => {
                          const configuration = context.options[0] || {};
                          const ignoreStateless = configuration.ignoreStateless || false;
                      
                          /**
                      Severity: Minor
                      Found in lib/rules/no-multi-comp.js - About 25 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 getMethodsOrder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function getMethodsOrder(userConfig) {
                        userConfig = userConfig || {};
                      
                        const groups = Object.assign({}, defaultConfig.groups, userConfig.groups);
                        const order = userConfig.order || defaultConfig.order;
                      Severity: Minor
                      Found in lib/rules/sort-comp.js - About 25 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