yannickcr/eslint-plugin-react

View on GitHub

Showing 501 of 696 total issues

Function create has a Cognitive Complexity of 60 (exceeds 5 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: Minor
Found in lib/rules/destructuring-assignment.js - About 1 day 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 234 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  create: Components.detect((context, components) => {
    const errors = {};
    const methodsOrder = getMethodsOrder(context.options[0]);

    // --------------------------------------------------------------------------
Severity: Major
Found in lib/rules/sort-comp.js - About 1 day to fix

    Function create has a Cognitive Complexity of 59 (exceeds 5 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: Minor
    Found in lib/rules/jsx-key.js - About 1 day 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 58 (exceeds 5 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: Minor
    Found in lib/rules/display-name.js - About 1 day 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 no-invalid-html-attribute.js has 545 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * @fileoverview Check if tag attributes to have non-valid value
     * @author Sebastian Malton
     */
    
    
    Severity: Major
    Found in lib/rules/no-invalid-html-attribute.js - About 1 day to fix

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

        create(context) {
          function getOption(type) {
            const userOptions = context.options[0] || {};
            if (has(userOptions, type)) {
              return userOptions[type];
      Severity: Minor
      Found in lib/rules/jsx-wrap-multilines.js - About 1 day 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 57 (exceeds 5 allowed). Consider refactoring.
      Open

        create(context) {
          const configuration = context.options[0] || {};
          const checkContextTypes = configuration.checkContextTypes || false;
          const checkChildContextTypes = configuration.checkChildContextTypes || false;
          let propTypesPackageName = null;
      Severity: Minor
      Found in lib/rules/forbid-prop-types.js - About 1 day 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 57 (exceeds 5 allowed). Consider refactoring.
      Open

        create(context) {
          // --------------------------------------------------------------------------
          // Public
          // --------------------------------------------------------------------------
          const indexParamNames = [];
      Severity: Minor
      Found in lib/rules/no-array-index-key.js - About 1 day 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 55 (exceeds 5 allowed). Consider refactoring.
      Open

        create: Components.detect((context, components) => {
          const configuration = context.options[0] || {};
          const allowDecorators = configuration.allowDecorators || [];
      
          /**
      Severity: Minor
      Found in lib/rules/require-optimization.js - About 1 day 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 55 (exceeds 5 allowed). Consider refactoring.
      Open

        create: Components.detect((context, components) => {
          const errors = {};
          const methodsOrder = getMethodsOrder(context.options[0]);
      
          // --------------------------------------------------------------------------
      Severity: Minor
      Found in lib/rules/sort-comp.js - About 1 day 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 214 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        create(context) {
          function normalizeConfig(configOrTrue, defaults, lastPass) {
            const config = configOrTrue === true ? {} : configOrTrue;
            const when = config.when || defaults.when;
            const allowMultiline = has(config, 'allowMultiline') ? config.allowMultiline : defaults.allowMultiline;
      Severity: Major
      Found in lib/rules/jsx-curly-spacing.js - About 1 day to fix

        Function usedPropTypesInstructions has 211 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function usedPropTypesInstructions(context, components, utils) {
          const checkAsyncSafeLifeCycles = testReactVersion(context, '>= 16.3.0');
        
          const propVariables = createPropVariables();
          const pushScope = propVariables.pushScope;
        Severity: Major
        Found in lib/util/usedPropTypes.js - About 1 day to fix

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

            create: Components.detect((context, components, utils) => {
              const configuration = context.options[0] || {};
              const ignorePureComponents = configuration.ignorePureComponents || false;
          
              // --------------------------------------------------------------------------
          Severity: Minor
          Found in lib/rules/prefer-stateless-function.js - About 1 day 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 54 (exceeds 5 allowed). Consider refactoring.
          Open

            create(context) {
              const configuration = context.options[0] || {};
              const requiredFirst = configuration.requiredFirst || false;
              const callbacksLast = configuration.callbacksLast || false;
              const ignoreCase = configuration.ignoreCase || false;
          Severity: Minor
          Found in lib/rules/sort-prop-types.js - About 1 day 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 210 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            create: Components.detect((context, components, utils) => {
              const configuration = context.options[0] || {};
              const ignorePureComponents = configuration.ignorePureComponents || false;
          
              // --------------------------------------------------------------------------
          Severity: Major
          Found in lib/rules/prefer-stateless-function.js - About 1 day to fix

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

              create(context) {
                const configuration = context.options[0] || {};
                const checkContextTypes = configuration.checkContextTypes || false;
                const checkChildContextTypes = configuration.checkChildContextTypes || false;
                let propTypesPackageName = null;
            Severity: Major
            Found in lib/rules/forbid-prop-types.js - About 1 day to fix

              Function defaultPropsInstructions has a Cognitive Complexity of 52 (exceeds 5 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: Minor
              Found in lib/util/defaultProps.js - About 1 day 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 202 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                create(context) {
                  const configuration = context.options[0] || {};
                  const requiredFirst = configuration.requiredFirst || false;
                  const callbacksLast = configuration.callbacksLast || false;
                  const ignoreCase = configuration.ignoreCase || false;
              Severity: Major
              Found in lib/rules/sort-prop-types.js - About 1 day to fix

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

                  create: Components.detect((context, components, util) => {
                    const configuration = context.options[0] || {};
                    const allowDestructuredState = configuration.allowDestructuredState || false;
                
                    return {
                Severity: Minor
                Found in lib/rules/hook-use-state.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 a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                Open

                  create: ((context) => {
                    let classInfo = null;
                
                    // Takes an ObjectExpression node and adds all named Property nodes to the
                    // current set of properties.
                Severity: Minor
                Found in lib/rules/no-unused-class-component-methods.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

                Severity
                Category
                Status
                Source
                Language