Showing 710 of 710 total issues
Function create
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const sourceCode = getSourceCode(context);
const option = getNormalizedOption(context);
// ----------------------------------------------------------------------
Function reportNoArrowFunctionLifecycle
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reportNoArrowFunctionLifecycle(properties) {
properties.forEach((node) => {
if (!node || !node.value) {
return;
}
Function create
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const sourceCode = getSourceCode(context);
const option = getNormalizedOption(context);
// ----------------------------------------------------------------------
- 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 getStringFromValue
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function getStringFromValue(value, targetValue) {
if (value) {
if (value.type === 'Literal') {
return value.value;
}
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const config = context.options[0] || {};
const validStrategies = new Set(config.validStrategies || DEFAULT_VALID_STRATEGIES);
const fixStrategy = find(from(validStrategies), () => 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 create
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const filename = context.getFilename();
let jsxNode;
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
create: Components.detect((context, components, utils) => {
return {
JSXOpeningElement(node) {
const openingElementName = node.name;
if (openingElementName.type !== 'JSXMemberExpression') {
- 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 checkAttribute
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkAttribute(context, node) {
const attribute = node.name.name;
const parentNodeName = node.parent.name.name;
if (!COMPONENT_ATTRIBUTE_MAP.has(attribute) || !COMPONENT_ATTRIBUTE_MAP.get(attribute).has(parentNodeName)) {
Function create
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const allowed = new Set(((context.options.length > 0) && context.options[0].allow) || []);
/**
* @param {ASTNode} expression An Identifier node
Function create
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const config = context.options[0] || {};
const checkAliases = config.checkAliases || false;
const isApplicable = testReactVersion(context, '>= 16.3.0');
Consider simplifying this complex logical expression. Open
if (
(node.property
&& (
!node.computed
&& node.property.type === 'Identifier'
Function markAnnotatedFunctionArgumentsAsDeclared
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function markAnnotatedFunctionArgumentsAsDeclared(node, rootNode) {
if (!node.params || !node.params.length) {
return;
}
Function contextCompare
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function contextCompare(a, b, options) {
let aProp = propName(a);
let bProp = propName(b);
const aSortToEnd = shouldSortToEnd(a);
Function create
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const configuration = context.options[0] || {};
const maximum = configuration.maximum || 1;
const maxConfig = typeof maximum === 'number'
Function JSXAttribute
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
JSXAttribute(node) {
const ignoreNames = getIgnoreConfig();
const actualName = getText(context, node.name);
if (ignoreNames.indexOf(actualName) >= 0) {
return;
Function getPropertyName
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function getPropertyName(context, node, utils, checkAsyncSafeLifeCycles) {
const property = node.property;
if (property) {
switch (property.type) {
case 'Identifier':
- 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 fixPropTypesSort
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function fixPropTypesSort(
context,
fixer,
declarations,
ignoreCase,
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const configuration = context.options[0] || {};
const ignoreHtmlTags = (configuration.html || DEFAULTS.html) === OPTIONS.ignore;
const ignoreCustomTags = (configuration.custom || DEFAULTS.custom) === OPTIONS.ignore;
const ignoreExplicitSpread = (configuration.explicitSpread || DEFAULTS.explicitSpread) === OPTIONS.ignore;
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const configuration = context.options[0] || {};
const forbidConfiguration = configuration.forbid || [];
/** @type {Record<string, { element: string, message?: string }>} */
- 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 getDeprecated
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDeprecated(pragma) {
const deprecated = {};
// 0.12.0
deprecated[`${pragma}.renderComponent`] = ['0.12.0', `${pragma}.render`];
deprecated[`${pragma}.renderComponentToString`] = ['0.12.0', `${pragma}.renderToString`];