Showing 501 of 699 total issues
Function getRelatedComponent
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRelatedComponent(node) {
let i;
let j;
let k;
let l;
Function getRefPropIndexes
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getRefPropIndexes(method) {
const methodGroupIndexes = [];
methodsOrder.forEach((currentGroup, groupIndex) => {
if (currentGroup === 'getters') {
Function create
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const configuration = context.options[0] || {};
const ignoreCase = configuration.ignoreCase || false;
/**
Function create
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
create: Components.detect((context, components) => {
/**
* @param {Array} properties list of component properties
*/
function reportNoArrowFunctionLifecycle(properties) {
Function JSXOpeningElement
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
JSXOpeningElement(node) {
const targetIndex = findLastIndex(node.attributes, (attr) => attr.name && attr.name.name === 'target');
const spreadAttributeIndex = findLastIndex(node.attributes, (attr) => (attr.type === 'JSXSpreadAttribute'));
if (linkComponents.has(node.name.name)) {
Function create
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const sourceCode = getSourceCode(context);
function getPropName(propNode) {
switch (propNode.type) {
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const options = Object.assign({}, optionDefaults, context.options[0]);
function nodeKey(node) {
return `${node.loc.start.line},${node.loc.start.column}`;
- 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 convertReturnTypeToPropTypes
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
convertReturnTypeToPropTypes(node, rootNode) {
// ReturnType<T> should always have one parameter
const nodeTypeParams = node.typeParameters;
if (nodeTypeParams) {
if (nodeTypeParams.params.length === 1) {
File ast.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileoverview Utility functions for AST
*/
'use strict';
Function create
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const config = context.options[0] || {};
const allowInPropTypes = config.allowInPropTypes || false;
// --------------------------------------------------------------------------
Function create
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
function getIgnoreConfig() {
return (context.options[0] && context.options[0].ignore) || DEFAULTS.ignore;
}
Function checkAttribute
has 75 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 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
function isPrefixDisabled(prefix) {
return prefix === false;
}
Function checkSorted
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkSorted(declarations) {
// Declarations will be `undefined` if the `shape` is not a literal. For
// example, if it is a propType imported from another file.
if (!declarations) {
return;
Function create
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const configuration = context.options[0] || {};
const forbid = new Map((configuration.forbid || DEFAULTS).map((value) => {
const propName = typeof value === 'string' ? value : value.propName;
const options = {
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const configuration = context.options[0] || {};
const allowAllCaps = configuration.allowAllCaps || false;
const allowLeadingUnderscore = configuration.allowLeadingUnderscore || false;
const allowNamespace = configuration.allowNamespace || 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 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const jsxElementParents = new Set();
function isBlockCommentInCurlyBraces(element) {
const elementRawValue = getText(context, element);
File jsx-indent.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileoverview Validate JSX indentation
* @author Yannick Croissant
* This rule has been ported and modified from eslint and nodeca.
File jsx-tag-spacing.js
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileoverview Validates whitespace in and around the JSX opening and closing brackets
* @author Diogo Franco (Kovensky)
*/
Function create
has 70 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');