yannickcr/eslint-plugin-react

View on GitHub

Showing 501 of 696 total issues

File no-unknown-property.js has 479 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @fileoverview Prevent usage of unknown DOM property
 * @author Yannick Croissant
 */

Severity: Minor
Found in lib/rules/no-unknown-property.js - About 7 hrs to fix

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

      create(context) {
        const options = Object.assign({}, defaultOptions, context.options[0]);
        const checkFragmentShorthand = options.checkFragmentShorthand;
        const checkKeyMustBeforeSpread = options.checkKeyMustBeforeSpread;
        const warnOnDuplicates = options.warnOnDuplicates;
    Severity: Major
    Found in lib/rules/jsx-key.js - About 7 hrs to fix

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

        create: Components.detect((context, components, utils) => {
          let propTypesPackageName = null;
          let reactPackageName = null;
      
          function checkValidPropTypeQualifier(node) {
      Severity: Major
      Found in lib/rules/no-typos.js - About 7 hrs to fix

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

          create: Components.detect((context, components) => {
            const configuration = context.options[0] || {};
            const ignored = configuration.ignore || [];
            const skipUndeclared = configuration.skipUndeclared || false;
        
        
        Severity: Minor
        Found in lib/rules/prop-types.js - About 7 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 178 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          create(context) {
            const MESSAGE_LOCATION = {
              'after-props': 'placed after the last prop',
              'after-tag': 'placed after the opening tag',
              'props-aligned': 'aligned with the last prop',
        Severity: Major
        Found in lib/rules/jsx-closing-bracket-location.js - About 7 hrs to fix

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

            create(context) {
              function isSetStateCall(node) {
                return node.type === 'CallExpression'
                  && node.callee.property
                  && node.callee.property.name === 'setState'
          Severity: Minor
          Found in lib/rules/no-access-state-in-setstate.js - About 7 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 175 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            create(context) {
              // --------------------------------------------------------------------------
              // Public
              // --------------------------------------------------------------------------
              const indexParamNames = [];
          Severity: Major
          Found in lib/rules/no-array-index-key.js - About 7 hrs to fix

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

              create: Components.detect((context, components, utils) => {
                const config = context.options[0] || {};
                const ignoreTranspilerName = config.ignoreTranspilerName || false;
                const checkContextObjects = (config.checkContextObjects || false) && testReactVersion(context, '>= 16.3.0');
            
            
            Severity: Major
            Found in lib/rules/display-name.js - About 6 hrs to fix

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

                create(context) {
                  const allowed = new Set(((context.options.length > 0) && context.options[0].allow) || []);
              
                  /**
                   * @param {ASTNode} expression An Identifier node
              Severity: Minor
              Found in lib/rules/style-prop-object.js - About 6 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 43 (exceeds 5 allowed). Consider refactoring.
              Open

                create(context) {
                  const config = context.options[0] || {};
                  const allowExpressions = config.allowExpressions || false;
              
                  const reactPragma = pragmaUtil.getFromContext(context);
              Severity: Minor
              Found in lib/rules/jsx-no-useless-fragment.js - About 6 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 156 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                create: Components.detect((context, components, utils) => {
                  const configuration = context.options[0] || DEFAULT_OPTION;
                  const ignoreClassFields = (context.options[1] && (context.options[1].ignoreClassFields === true)) || false;
                  const destructureInSignature = (context.options[1] && context.options[1].destructureInSignature) || 'ignore';
                  const sfcParams = createSFCParams();
              Severity: Major
              Found in lib/rules/destructuring-assignment.js - About 6 hrs to fix

                Function create has 156 lines of code (exceeds 25 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: Major
                Found in lib/rules/jsx-one-expression-per-line.js - About 6 hrs to fix

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

                    create(context) {
                      function getOption(type) {
                        const userOptions = context.options[0] || {};
                        if (has(userOptions, type)) {
                          return userOptions[type];
                  Severity: Major
                  Found in lib/rules/jsx-wrap-multilines.js - About 6 hrs to fix

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

                      create(context) {
                        const defaults = {
                          noStrings: false,
                          allowedStrings: [],
                          ignoreProps: false,
                    Severity: Minor
                    Found in lib/rules/jsx-no-literals.js - About 6 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

                    File jsx-sort-props.js has 413 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                     * @fileoverview Enforce props alphabetical sorting
                     * @author Ilya Volodin, Yannick Croissant
                     */
                    
                    
                    Severity: Minor
                    Found in lib/rules/jsx-sort-props.js - About 5 hrs to fix

                      Function checkLiteralValueNode has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function checkLiteralValueNode(context, attributeName, node, parentNode, parentNodeName) {
                        if (typeof node.value !== 'string') {
                          report(context, messages.onlyStrings, 'onlyStrings', {
                            node,
                            data: { attributeName },
                      Severity: Minor
                      Found in lib/rules/no-invalid-html-attribute.js - About 5 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 handleJSX has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function handleJSX(node) {
                            const children = node.children;
                      
                            if (!children || !children.length) {
                              return;
                      Severity: Major
                      Found in lib/rules/jsx-one-expression-per-line.js - About 5 hrs to fix

                        File no-unused-state.js has 403 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * @fileoverview  Attempts to discover all state fields in a React component and
                         * warn if any of them are never read.
                         *
                         * State field definitions are collected from `this.state = {}` assignments in
                        Severity: Minor
                        Found in lib/rules/no-unused-state.js - About 5 hrs to fix

                          Function getGroupsOfSortableAttributes has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function getGroupsOfSortableAttributes(attributes, context) {
                            const sourceCode = context.getSourceCode();
                          
                            const sortableAttributeGroups = [];
                            let groupCount = 0;
                          Severity: Minor
                          Found in lib/rules/jsx-sort-props.js - About 5 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 defaultPropsInstructions has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function defaultPropsInstructions(context, components, utils) {
                            const sourceCode = context.getSourceCode();
                          
                            /**
                             * Try to resolve the node passed in to a variable in the current scope. If the node passed in is not
                          Severity: Major
                          Found in lib/util/defaultProps.js - About 5 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language