yannickcr/eslint-plugin-react

View on GitHub

Showing 502 of 700 total issues

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

        CallExpression(node) {
          const callee = node.callee;
          if (
            callee.type !== 'MemberExpression'
            || callee.object.type !== 'ThisExpression'
Severity: Minor
Found in lib/util/makeNoMethodSetStateRule.js - About 1 hr to fix

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

          CallExpression(node) {
            if (
              node.callee
              && node.callee.type === 'MemberExpression'
              && node.callee.property.name === 'createElement'
    Severity: Minor
    Found in lib/rules/no-danger-with-children.js - About 1 hr to fix

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

            CallExpression(node) {
              if (!classInfo) {
                return;
              }
      
      
      Severity: Minor
      Found in lib/rules/no-unused-state.js - About 1 hr to fix

        Function fix has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                      fix(fixer) {
                        // eslint 5 uses `node.attributes`; eslint 6+ uses `node.parent.attributes`
                        const nodeWithAttrs = node.parent.attributes ? node.parent : node;
                        // eslint 5 does not provide a `name` property on JSXSpreadElements
                        const relAttribute = nodeWithAttrs.attributes.find((attr) => attr.name && attr.name.name === 'rel');
        Severity: Minor
        Found in lib/rules/jsx-no-target-blank.js - About 1 hr to fix

          Function getComponentTypeAnnotation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function getComponentTypeAnnotation(component) {
                // If this is a functional component that uses a global type, check it
                if (
                  (component.node.type === 'FunctionDeclaration' || component.node.type === 'ArrowFunctionExpression')
                  && component.node.params
          Severity: Minor
          Found in lib/rules/boolean-prop-naming.js - About 1 hr to fix

            Function Program:exit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  'Program:exit'() {
                    flatMap(
                      values(components.list()),
                      (component) => component.declaredPropTypes || []
                    ).forEach((declaredPropTypes) => {
            Severity: Minor
            Found in lib/rules/prefer-read-only-props.js - About 1 hr to fix

              Function getFixer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function getFixer(node, options) {
                    const source = getText(context);
              
                    const typeAnnotation = getTypeAnnotation(node, source);
              
              
              Severity: Minor
              Found in lib/rules/function-component-definition.js - About 1 hr to fix

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

                      JSXOpeningElement(node) {
                        const isCompatTag = jsxUtil.isDOMComponent(node);
                        if (isCompatTag) return undefined;
                
                        const name = elementType(node);
                Severity: Minor
                Found in lib/rules/jsx-pascal-case.js - About 1 hr to fix

                  Function list has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    list() {
                      const thisList = Lists.get(this);
                      const list = {};
                      const usedPropTypes = {};
                  
                  
                  Severity: Minor
                  Found in lib/util/Components.js - About 1 hr to fix

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

                      create(context) {
                        const options = Object.assign({}, optionDefaults, context.options[0]);
                    
                        return {
                          JSXOpeningElement(node) {
                    Severity: Minor
                    Found in lib/rules/jsx-tag-spacing.js - About 1 hr to fix

                      Function getFixerFunction has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function getFixerFunction(node, needed) {
                            const indent = Array(needed + 1).join(indentChar);
                      
                            if (node.type === 'JSXText' || node.type === 'Literal') {
                              return function fix(fixer) {
                      Severity: Minor
                      Found in lib/rules/jsx-indent.js - About 1 hr to fix

                        Function getNodeViolationType has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function getNodeViolationType(node) {
                              const nodeType = node.type;
                              if (
                                !configuration.allowBind
                                && nodeType === 'CallExpression'
                        Severity: Minor
                        Found in lib/rules/jsx-no-bind.js - About 1 hr to fix

                          Function JSXExpressionContainer > LogicalExpression[operator="&&"] has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                'JSXExpressionContainer > LogicalExpression[operator="&&"]'(node) {
                                  const leftSide = node.left;
                          
                                  const isCoerceValidLeftSide = COERCE_VALID_LEFT_SIDE_EXPRESSIONS
                                    .some((validExpression) => validExpression === leftSide.type);
                          Severity: Minor
                          Found in lib/rules/jsx-no-leaked-render.js - About 1 hr to fix

                            Function validateSandboxAttribute has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function validateSandboxAttribute(context, node, attribute) {
                              if (typeof attribute !== 'string') {
                                // Only string literals are supported for now
                                return;
                              }
                            Severity: Minor
                            Found in lib/rules/iframe-missing-sandbox.js - About 1 hr to fix

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

                                create(context) {
                                  return {
                                    JSXAttribute(node) {
                                      const attributes = new Set(context.options[0] || DEFAULT_ATTRIBUTES);
                              
                              
                              Severity: Minor
                              Found in lib/rules/no-invalid-html-attribute.js - About 1 hr to fix

                                Function getReactVersionFromContext has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function getReactVersionFromContext(context) {
                                  let confVer = defaultVersion;
                                  // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings)
                                  if (context.settings && context.settings.react && context.settings.react.version) {
                                    let settingsVersion = context.settings.react.version;
                                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 getFlowVersionFromContext has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function getFlowVersionFromContext(context) {
                                  let confVer = defaultVersion;
                                  // .eslintrc shared settings (https://eslint.org/docs/user-guide/configuring#adding-shared-settings)
                                  if (context.settings.react && context.settings.react.flowVersion) {
                                    let flowVersion = context.settings.react.flowVersion;
                                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 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  create: Components.detect((context, components) => {
                                    const defaults = { skipShapeProps: true, customValidators: [], ignore: [] };
                                    const configuration = Object.assign({}, defaults, context.options[0] || {});
                                
                                    /**
                                Severity: Minor
                                Found in lib/rules/no-unused-prop-types.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 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  create(context) {
                                    /**
                                     * Checks for shouldComponentUpdate property
                                     * @param {ASTNode} node The AST node being checked.
                                     * @returns {Boolean} Whether or not the property exists.
                                Severity: Minor
                                Found in lib/rules/no-redundant-should-component-update.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 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  create(context) {
                                    const configuration = context.options[0] || NEVER;
                                    const configObject = context.options[1] || {};
                                    const exceptions = new Set((configuration === ALWAYS ? configObject[NEVER] : configObject[ALWAYS]) || []);
                                
                                
                                Severity: Minor
                                Found in lib/rules/jsx-boolean-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

                                Severity
                                Category
                                Status
                                Source
                                Language