Showing 502 of 700 total issues
Function reportNodeAttribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedList) {
Function usedPropTypesAreEquivalent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function usedPropTypesAreEquivalent(propA, propB) {
if (propA.name === propB.name) {
if (!propA.allNames && !propB.allNames) {
return true;
}
- 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 detectReactVersion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function detectReactVersion(context) {
if (cachedDetectedReactVersion) {
return cachedDetectedReactVersion;
}
- 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 isComponentInRenderProp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function isComponentInRenderProp(node, context) {
if (
node
&& node.parent
&& node.parent.type === 'Property'
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
create: Components.detect((context, components, utils) => ({
MemberExpression(node) {
if (node.object.type === 'ThisExpression') {
const component = components.get(utils.getParentStatelessComponent(node));
if (!component || (component.node && component.node.parent && component.node.parent.type === 'Property')) {
- 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 isCreateCloneElement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function isCreateCloneElement(node, context) {
if (!node) {
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
Avoid too many return
statements within this function. Open
return unwrappedObjectNode.name === 'props' && !ast.isAssignmentLHS(node);
Avoid too many return
statements within this function. Open
return '__COMPUTED_PROP__';
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return node;
Avoid too many return
statements within this function. Open
return key.type === 'Identifier' ? key.name : key.value;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return isFirstLetterCapitalized(node.id.name) ? node : undefined;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return isJSXValue(node.left) || isJSXValue(node.right);
Avoid too many return
statements within this function. Open
return aKey.localeCompare(bKey);
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return;