yannickcr/eslint-plugin-react

View on GitHub

Showing 501 of 699 total issues

Function getRelatedComponent has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getRelatedComponent(node) {
      let i;
      let j;
      let k;
      let l;
Severity: Major
Found in lib/util/Components.js - About 3 hrs to fix

    Function getRefPropIndexes has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function getRefPropIndexes(method) {
          const methodGroupIndexes = [];
    
          methodsOrder.forEach((currentGroup, groupIndex) => {
            if (currentGroup === 'getters') {
    Severity: Major
    Found in lib/rules/sort-comp.js - About 3 hrs to fix

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

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

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

          create: Components.detect((context, components) => {
            /**
             * @param {Array} properties list of component properties
             */
            function reportNoArrowFunctionLifecycle(properties) {
        Severity: Major
        Found in lib/rules/no-arrow-function-lifecycle.js - About 3 hrs to fix

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

                JSXOpeningElement(node) {
                  const targetIndex = findLastIndex(node.attributes, (attr) => attr.name && attr.name.name === 'target');
                  const spreadAttributeIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXSpreadAttribute'));
          
                  if (linkComponents.has(node.name.name)) {
          Severity: Major
          Found in lib/rules/jsx-no-target-blank.js - About 3 hrs to fix

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

              create(context) {
                const sourceCode = getSourceCode(context);
            
                function getPropName(propNode) {
                  switch (propNode.type) {
            Severity: Minor
            Found in lib/rules/jsx-props-no-multi-spaces.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 22 (exceeds 5 allowed). Consider refactoring.
            Open

              create(context) {
                const options = Object.assign({}, optionDefaults, context.options[0]);
            
                function nodeKey(node) {
                  return `${node.loc.start.line},${node.loc.start.column}`;
            Severity: Minor
            Found in lib/rules/jsx-one-expression-per-line.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 convertReturnTypeToPropTypes has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                convertReturnTypeToPropTypes(node, rootNode) {
                  // ReturnType<T> should always have one parameter
                  const nodeTypeParams = node.typeParameters;
                  if (nodeTypeParams) {
                    if (nodeTypeParams.params.length === 1) {
            Severity: Major
            Found in lib/util/propTypes.js - About 3 hrs to fix

              File ast.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * @fileoverview Utility functions for AST
               */
              
              'use strict';
              Severity: Minor
              Found in lib/util/ast.js - About 3 hrs to fix

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

                  create(context) {
                    const config = context.options[0] || {};
                    const allowInPropTypes = config.allowInPropTypes || false;
                
                    // --------------------------------------------------------------------------
                Severity: Major
                Found in lib/rules/forbid-foreign-prop-types.js - About 3 hrs to fix

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

                    create(context) {
                      function getIgnoreConfig() {
                        return (context.options[0] && context.options[0].ignore) || DEFAULTS.ignore;
                      }
                  
                  
                  Severity: Major
                  Found in lib/rules/no-unknown-property.js - About 3 hrs to fix

                    Function checkAttribute has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function checkAttribute(context, node) {
                      const attribute = node.name.name;
                    
                      const parentNodeName = node.parent.name.name;
                      if (!COMPONENT_ATTRIBUTE_MAP.has(attribute) || !COMPONENT_ATTRIBUTE_MAP.get(attribute).has(parentNodeName)) {
                    Severity: Major
                    Found in lib/rules/no-invalid-html-attribute.js - About 3 hrs to fix

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

                        create(context) {
                          function isPrefixDisabled(prefix) {
                            return prefix === false;
                          }
                      
                      
                      Severity: Major
                      Found in lib/rules/jsx-handler-names.js - About 2 hrs to fix

                        Function checkSorted has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function checkSorted(declarations) {
                              // Declarations will be `undefined` if the `shape` is not a literal. For
                              // example, if it is a propType imported from another file.
                              if (!declarations) {
                                return;
                        Severity: Major
                        Found in lib/rules/sort-prop-types.js - About 2 hrs to fix

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

                            create(context) {
                              const configuration = context.options[0] || {};
                              const forbid = new Map((configuration.forbid || DEFAULTS).map((value) => {
                                const propName = typeof value === 'string' ? value : value.propName;
                                const options = {
                          Severity: Minor
                          Found in lib/rules/forbid-component-props.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 create has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                            create(context) {
                              const configuration = context.options[0] || {};
                              const allowAllCaps = configuration.allowAllCaps || false;
                              const allowLeadingUnderscore = configuration.allowLeadingUnderscore || false;
                              const allowNamespace = configuration.allowNamespace || false;
                          Severity: Minor
                          Found in lib/rules/jsx-pascal-case.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 create has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            create(context) {
                              const jsxElementParents = new Set();
                          
                              function isBlockCommentInCurlyBraces(element) {
                                const elementRawValue = getText(context, element);
                          Severity: Major
                          Found in lib/rules/jsx-newline.js - About 2 hrs to fix

                            File jsx-indent.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /**
                             * @fileoverview Validate JSX indentation
                             * @author Yannick Croissant
                            
                             * This rule has been ported and modified from eslint and nodeca.
                            Severity: Minor
                            Found in lib/rules/jsx-indent.js - About 2 hrs to fix

                              File jsx-tag-spacing.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /**
                               * @fileoverview Validates whitespace in and around the JSX opening and closing brackets
                               * @author Diogo Franco (Kovensky)
                               */
                              
                              
                              Severity: Minor
                              Found in lib/rules/jsx-tag-spacing.js - About 2 hrs to fix

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

                                  create(context) {
                                    const config = context.options[0] || {};
                                    const checkAliases = config.checkAliases || false;
                                
                                    const isApplicable = testReactVersion(context, '>= 16.3.0');
                                Severity: Major
                                Found in lib/rules/no-unsafe.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language