Showing 95 of 95 total issues
Function fixImportsMessage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function fixImportsMessage(
removedItems: Set<string>,
addedItems: Set<string>,
): ?string {
const messageParts = [];
- 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 importStatementStyle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function importStatementStyle(importStatement: ImportStatement): string {
if (importStatement.hasSideEffects) {
return STYLE_SIDE_EFFECT;
}
- 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 merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
merge(importStatement: ImportStatement) {
if (
importStatement.defaultImport &&
this.defaultImport !== importStatement.defaultImport
) {
- 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 findESNamedExports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function findESNamedExports(node, { absolutePathToFile }) {
if (node.type === 'ExportAllDeclaration') {
// Recurse the file referenced by the declaration
// eslint-disable-next-line no-use-before-define
return resolveNestedNamedExports(node, absolutePathToFile);
- 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 _importStrings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_importStrings(maxLineLength: number, tab: string): Array<string> {
if (this.originalImportString) {
return [this.originalImportString];
}
- 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
Avoid too many return
statements within this function. Open
return strings;
Avoid too many return
statements within this function. Open
return STYLE_CUSTOM;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return definedNames[right.name] || [];
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return `./${rawPath}`;
Avoid too many return
statements within this function. Open
return left.object.name === 'module' && left.property.name === 'exports';
Avoid too many return
statements within this function. Open
return new ImportStatement({
declarationKeyword: node.kind,
defaultImport,
hasSideEffects: false,
importFunction: declaration.init.callee.name,
Avoid too many return
statements within this function. Open
return [];
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return result;
Avoid too many return
statements within this function. Open
return nestedNamed;
Avoid too many return
statements within this function. Open
return [left.property.name];