Showing 512 of 708 total issues
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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const config = context.options[0];
let option = defaultOption;
if (typeof config === '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 create
has a Cognitive Complexity of 23 (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 propPattern = value.propNamePattern;
- 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 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
const config = context.options[0] || {};
const allowInPropTypes = config.allowInPropTypes || false;
// --------------------------------------------------------------------------
Function create
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
function isPrefixDisabled(prefix) {
return prefix === false;
}
Function create
has 79 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 nodeTypeArguments = propsUtil.getTypeArguments(node);
if (nodeTypeArguments) {
if (nodeTypeArguments.params.length === 1) {
Function create
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(context) {
function getIgnoreConfig() {
return (context.options[0] && context.options[0].ignore) || DEFAULTS.ignore;
}
Function getRelatedComponent
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRelatedComponent(node) {
let i;
let j;
let k;
let l;
Function checkSorted
has 75 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;
File ast.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileoverview Utility functions for AST
*/
'use strict';
Function create
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
create(context) {
const pragma = pragmaUtil.getFromContext(context);
const deprecated = getDeprecated(pragma);
function isDeprecated(method) {
- 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
File jsx-indent.js
has 287 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.
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);
Function searchDeclarationByName
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchDeclarationByName(node) {
let typeName;
if (astUtil.isTSTypeReference(node)) {
typeName = node.typeName.name;
const leftMostName = getLeftMostTypeName(node.typeName);