Showing 1,251 of 1,982 total issues
Avoid too many return
statements within this function. Open
if (path.scope.getBindingIdentifier(name)) return;
Avoid too many return
statements within this function. Open
return evaluateQuasis(path, node.quasi.quasis, state, true);
Avoid too many return
statements within this function. Open
if (!state.confident) return;
Avoid too many return
statements within this function. Open
return evaluateCached(path.get("alternate"), state);
Avoid too many return
statements within this function. Open
return binding ? deopt(binding.path, state) : NaN;
Avoid too many return
statements within this function. Open
return deopt(keyPath, state);
Avoid too many return
statements within this function. Open
return left && right;
Avoid too many return
statements within this function. Open
return getConditionalAnnotation(ifStatement, name);
Avoid too many return
statements within this function. Open
return evaluateQuasis(path, node.quasis, state);
Avoid too many return
statements within this function. Open
if (!state.confident) return;
Avoid too many return
statements within this function. Open
return value[property.node.name];
Avoid too many return
statements within this function. Open
return this.parentPath.getTypeAnnotation();
Avoid too many return
statements within this function. Open
return binding.value;
Avoid too many return
statements within this function. Open
return node;
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") {
- Read upRead up
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;
}
- Read upRead up
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();
- Read upRead up
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
- Read upRead up
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);
}
- Read upRead up
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,
- Read upRead up
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"