Showing 1,251 of 1,982 total issues

Avoid too many return statements within this function.
Open

          if (path.scope.getBindingIdentifier(name)) return;
Severity: Major
Found in packages/babel-plugin-transform-runtime/src/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return evaluateQuasis(path, node.quasi.quasis, state, true);
    Severity: Major
    Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          if (!state.confident) return;
      Severity: Major
      Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return evaluateCached(path.get("alternate"), state);
        Severity: Major
        Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return binding ? deopt(binding.path, state) : NaN;
          Severity: Major
          Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                      return deopt(keyPath, state);
            Severity: Major
            Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return left && right;
              Severity: Major
              Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return getConditionalAnnotation(ifStatement, name);
                Severity: Major
                Found in packages/babel-traverse/src/path/inference/inferer-reference.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return evaluateQuasis(path, node.quasis, state);
                  Severity: Major
                  Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        if (!state.confident) return;
                    Severity: Major
                    Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return value[property.node.name];
                      Severity: Major
                      Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return this.parentPath.getTypeAnnotation();
                        Severity: Major
                        Found in packages/babel-traverse/src/path/inference/index.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return binding.value;
                          Severity: Major
                          Found in packages/babel-traverse/src/path/evaluation.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return node;
                            Severity: Major
                            Found in packages/babel-helper-builder-react-jsx/src/index.js - About 30 mins to fix

                              Function convertComments has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export default function convertComments(comments) {
                                for (const comment of comments) {
                                  if (comment.type === "CommentBlock") {
                                    comment.type = "Block";
                                  } else if (comment.type === "CommentLine") {
                              Severity: Minor
                              Found in eslint/babel-eslint-parser/src/convert/convertComments.js - About 25 mins 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 isUnnecessarySemicolon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function isUnnecessarySemicolon(context, lastToken) {
                                if (!isSemicolon(lastToken)) {
                                  return false;
                                }
                              
                              
                              Severity: Minor
                              Found in eslint/babel-eslint-plugin/src/rules/semi.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                create(context) {
                                  return {
                                    CallExpression(node) {
                                      const { callee } = node;
                                      const scope = context.getScope();

                              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 copyApiObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function copyApiObject(api) {
                                // Babel >= 7 <= beta.41 passed the API as a new object that had
                                // babel/core as the prototype. While slightly faster, it also
                                // means that the Object.assign copy below fails. Rather than
                                // keep complexity, the Babel 6 behavior has been reverted and this
                              Severity: Minor
                              Found in packages/babel-helper-plugin-utils/src/index.js - About 25 mins 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 toNonOptional has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function toNonOptional(path, base) {
                                const { node } = path;
                                if (path.isOptionalMemberExpression()) {
                                  return t.memberExpression(base, node.property, node.computed);
                                }
                              Severity: Minor
                              Found in packages/babel-helper-member-expression-to-functions/src/index.js - About 25 mins 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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                parse(test, parser) {
                                  try {
                                    parser(test.contents, {
                                      sourceType: "module",
                                      plugins: test.plugins,
                              Severity: Minor
                              Found in scripts/parser-tests/flow/index.js - About 25 mins 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