yannickcr/eslint-plugin-react

View on GitHub

Showing 710 of 710 total issues

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

  create(context) {
    const sourceCode = getSourceCode(context);
    const option = getNormalizedOption(context);

    // ----------------------------------------------------------------------
Severity: Major
Found in lib/rules/jsx-curly-newline.js - About 2 hrs to fix

    Function reportNoArrowFunctionLifecycle has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function reportNoArrowFunctionLifecycle(properties) {
          properties.forEach((node) => {
            if (!node || !node.value) {
              return;
            }
    Severity: Major
    Found in lib/rules/no-arrow-function-lifecycle.js - About 2 hrs to fix

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

        create(context) {
          const sourceCode = getSourceCode(context);
          const option = getNormalizedOption(context);
      
          // ----------------------------------------------------------------------
      Severity: Minor
      Found in lib/rules/jsx-curly-newline.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 getStringFromValue has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function getStringFromValue(value, targetValue) {
        if (value) {
          if (value.type === 'Literal') {
            return value.value;
          }
      Severity: Minor
      Found in lib/rules/jsx-no-target-blank.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 20 (exceeds 5 allowed). Consider refactoring.
      Open

        create(context) {
          const config = context.options[0] || {};
          const validStrategies = new Set(config.validStrategies || DEFAULT_VALID_STRATEGIES);
          const fixStrategy = find(from(validStrategies), () => true);
      
      
      Severity: Minor
      Found in lib/rules/jsx-no-leaked-render.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 20 (exceeds 5 allowed). Consider refactoring.
      Open

        create(context) {
          const filename = context.getFilename();
      
          let jsxNode;
      
      
      Severity: Minor
      Found in lib/rules/jsx-filename-extension.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 20 (exceeds 5 allowed). Consider refactoring.
      Open

        create: Components.detect((context, components, utils) => {
          return {
            JSXOpeningElement(node) {
              const openingElementName = node.name;
              if (openingElementName.type !== 'JSXMemberExpression') {
      Severity: Minor
      Found in lib/rules/jsx-no-constructed-context-values.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 checkAttribute has 68 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 2 hrs to fix

        Function create has 67 lines of code (exceeds 25 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: Major
        Found in lib/rules/style-prop-object.js - About 2 hrs to fix

          Function create has 67 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

            Consider simplifying this complex logical expression.
            Open

                    if (
                      (node.property
                      && (
                        !node.computed
                        && node.property.type === 'Identifier'
            Severity: Critical
            Found in lib/rules/forbid-foreign-prop-types.js - About 2 hrs to fix

              Function markAnnotatedFunctionArgumentsAsDeclared has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function markAnnotatedFunctionArgumentsAsDeclared(node, rootNode) {
                  if (!node.params || !node.params.length) {
                    return;
                  }
              
              
              Severity: Major
              Found in lib/util/propTypes.js - About 2 hrs to fix

                Function contextCompare has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function contextCompare(a, b, options) {
                  let aProp = propName(a);
                  let bProp = propName(b);
                
                  const aSortToEnd = shouldSortToEnd(a);
                Severity: Major
                Found in lib/rules/jsx-sort-props.js - About 2 hrs to fix

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

                    create(context) {
                      const configuration = context.options[0] || {};
                      const maximum = configuration.maximum || 1;
                  
                      const maxConfig = typeof maximum === 'number'
                  Severity: Major
                  Found in lib/rules/jsx-max-props-per-line.js - About 2 hrs to fix

                    Function JSXAttribute has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          JSXAttribute(node) {
                            const ignoreNames = getIgnoreConfig();
                            const actualName = getText(context, node.name);
                            if (ignoreNames.indexOf(actualName) >= 0) {
                              return;
                    Severity: Major
                    Found in lib/rules/no-unknown-property.js - About 2 hrs to fix

                      Function getPropertyName has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function getPropertyName(context, node, utils, checkAsyncSafeLifeCycles) {
                        const property = node.property;
                        if (property) {
                          switch (property.type) {
                            case 'Identifier':
                      Severity: Minor
                      Found in lib/util/usedPropTypes.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 fixPropTypesSort has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function fixPropTypesSort(
                        context,
                        fixer,
                        declarations,
                        ignoreCase,
                      Severity: Minor
                      Found in lib/util/propTypesSort.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 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                        create(context) {
                          const configuration = context.options[0] || {};
                          const ignoreHtmlTags = (configuration.html || DEFAULTS.html) === OPTIONS.ignore;
                          const ignoreCustomTags = (configuration.custom || DEFAULTS.custom) === OPTIONS.ignore;
                          const ignoreExplicitSpread = (configuration.explicitSpread || DEFAULTS.explicitSpread) === OPTIONS.ignore;
                      Severity: Minor
                      Found in lib/rules/jsx-props-no-spreading.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 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                        create(context) {
                          const configuration = context.options[0] || {};
                          const forbidConfiguration = configuration.forbid || [];
                      
                          /** @type {Record<string, { element: string, message?: string }>} */
                      Severity: Minor
                      Found in lib/rules/forbid-elements.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 getDeprecated has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getDeprecated(pragma) {
                        const deprecated = {};
                        // 0.12.0
                        deprecated[`${pragma}.renderComponent`] = ['0.12.0', `${pragma}.render`];
                        deprecated[`${pragma}.renderComponentToString`] = ['0.12.0', `${pragma}.renderToString`];
                      Severity: Major
                      Found in lib/rules/no-deprecated.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language