yannickcr/eslint-plugin-react

View on GitHub

Showing 502 of 700 total issues

Function isReturningOnlyNull has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function isReturningOnlyNull(ASTnode, context) {
  let found = false;
  let foundSomethingElse = false;
  astUtil.traverseReturns(ASTnode, context, (node) => {
    // Traverse return statement
Severity: Minor
Found in lib/util/jsx.js - About 1 hr to fix

    Function CallExpression has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          CallExpression(node) {
            if (!isClassComponent(node)) {
              return;
            }
            // Appends all the methods that are calling another
    Severity: Minor
    Found in lib/rules/no-access-state-in-setstate.js - About 1 hr to fix

      Function validateAfterOpening has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function validateAfterOpening(context, node, option) {
        const sourceCode = getSourceCode(context);
        const openingToken = sourceCode.getTokenBefore(node.name);
      
        if (option === 'allow-multiline') {
      Severity: Minor
      Found in lib/rules/jsx-tag-spacing.js - About 1 hr to fix

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

          create(context) {
            function handleClosingElement(node) {
              if (!node.parent) {
                return;
              }
        Severity: Minor
        Found in lib/rules/jsx-closing-tag-location.js - About 1 hr to fix

          Function endAndStructDeclaredPropTypes has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              endAndStructDeclaredPropTypes() {
                if (this.shouldSpecifyOptionalChildrenProps) {
                  this.declaredPropTypes.children = {
                    fullName: 'children',
                    name: 'children',
          Severity: Minor
          Found in lib/util/propTypes.js - About 1 hr to fix

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

              create(context) {
                function validate(node, children) {
                  let currentIsInline = false;
                  let previousIsInline = false;
                  if (!children) {
            Severity: Minor
            Found in lib/rules/no-adjacent-inline-elements.js - About 1 hr to fix

              Function JSXOpeningElement has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    JSXOpeningElement(node) {
                      if (!node.attributes.length) {
                        return;
                      }
              
              
              Severity: Minor
              Found in lib/rules/jsx-max-props-per-line.js - About 1 hr to fix

                Function lintUnnecessaryCurly has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function lintUnnecessaryCurly(JSXExpressionNode) {
                      const expression = JSXExpressionNode.expression;
                      const expressionType = expression.type;
                
                      const sourceCode = getSourceCode(context);
                Severity: Minor
                Found in lib/rules/jsx-curly-brace-presence.js - About 1 hr to fix

                  Function comparePropsOrder has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function comparePropsOrder(propertiesInfos, propA, propB) {
                        let i;
                        let j;
                        let k;
                        let l;
                  Severity: Minor
                  Found in lib/rules/sort-comp.js - About 1 hr to fix

                    Function resolveBasedir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function resolveBasedir(contextOrFilename) {
                      if (contextOrFilename) {
                        const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.getFilename();
                        const dirname = path.dirname(filename);
                        try {
                    Severity: Minor
                    Found in lib/util/version.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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        const configuration = context.options[0] || 'always';
                    
                        // --------------------------------------------------------------------------
                        // Public
                    Severity: Minor
                    Found in lib/rules/jsx-space-before-closing.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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        const detectTemplateLiterals = context.options[0] ? context.options[0].noTemplateLiterals : false;
                        /**
                         * Checks if we are using refs
                         * @param {ASTNode} node The AST node being checked.
                    Severity: Minor
                    Found in lib/rules/no-string-refs.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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        function isComponent(node) {
                          return (
                            node.name
                            && (node.name.type === 'JSXIdentifier' || node.name.type === 'JSXMemberExpression')
                    Severity: Minor
                    Found in lib/rules/self-closing-comp.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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        // --------------------------------------------------------------------------
                        // Public
                        // --------------------------------------------------------------------------
                    
                    
                    Severity: Minor
                    Found in lib/rules/no-render-return-value.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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      create(context) {
                        return {
                          CallExpression(node) {
                            const callee = node.callee;
                            if (callee.type !== 'MemberExpression') {
                    Severity: Minor
                    Found in lib/rules/no-is-mounted.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 handleJSX has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        const handleJSX = (node) => {
                          let lastChild = null;
                          let child = null;
                          (node.children.concat([null])).forEach((nextChild) => {
                            if (
                    Severity: Minor
                    Found in lib/rules/jsx-child-element-spacing.js - About 1 hr to fix

                      Function getTokensLocations has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function getTokensLocations(node) {
                            const sourceCode = getSourceCode(context);
                            const opening = sourceCode.getFirstToken(node).loc.start;
                            const closing = sourceCode.getLastTokens(node, node.selfClosing ? 2 : 1)[0].loc.start;
                            const tag = sourceCode.getFirstToken(node.name).loc.start;
                      Severity: Minor
                      Found in lib/rules/jsx-closing-bracket-location.js - About 1 hr to fix

                        Function JSXOpeningElement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              JSXOpeningElement(node) {
                                if (
                                  (configuration === 'multiline' && isMultilineJSX(node))
                                  || (configuration === 'multiline-multiprop' && isMultilineJSX(node) && node.attributes.length > 1)
                                  || (configuration === 'multiprop' && node.attributes.length > 1)
                        Severity: Minor
                        Found in lib/rules/jsx-first-prop-new-line.js - About 1 hr to fix

                          Function checkIdentifierInJSX has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function checkIdentifierInJSX(node) {
                                let scope = eslintUtil.getScope(context, node);
                                const sourceCode = eslintUtil.getSourceCode(context);
                                const sourceType = sourceCode.ast.sourceType;
                                const scopeUpperBound = !allowGlobals && sourceType === 'module' ? 'module' : 'global';
                          Severity: Minor
                          Found in lib/rules/jsx-no-undef.js - About 1 hr to fix

                            Function sorter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function sorter(a, b, context, ignoreCase, requiredFirst, callbacksLast, noSortAlphabetically) {
                              const aKey = String(astUtil.getKeyValue(context, a));
                              const bKey = String(astUtil.getKeyValue(context, b));
                            
                              if (requiredFirst) {
                            Severity: Minor
                            Found in lib/util/propTypesSort.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language