Showing 545 of 2,098 total issues
Function TextInput
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
(
{
a11yTitle,
defaultSuggestion,
defaultValue,
- 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 Components
has 226 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Components = () => {
const [checkBox, setCheckBox] = useState(true);
const [textInput, setTextInput] = useState('');
const [maskedInput, setMaskedInput] = useState('');
const [radioButton, setRadioButton] = useState('RadioButton 1');
File Menu-test.js
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { getByText as getByTextDOM } from '@testing-library/dom';
import { axe } from 'jest-axe';
File DataTable.js
has 536 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useCallback,
useContext,
useEffect,
useMemo,
Function edgeStyle
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
export const edgeStyle = (
kind,
data,
responsive,
responsiveBreakpoint,
- 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 Button-test.tsx
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { axe } from 'jest-axe';
import userEvent from '@testing-library/user-event';
File FileInput.js
has 523 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { forwardRef, useContext, useRef, useState } from 'react';
import styled, { ThemeContext } from 'styled-components';
import { CircleAlert } from 'grommet-icons/icons/CircleAlert';
import { MessageContext } from '../../contexts/MessageContext';
File FormField-test.js
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { axe } from 'jest-axe';
import 'jest-axe/extend-expect';
import 'jest-styled-components';
import React from 'react';
File SelectMultiple.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
forwardRef,
isValidElement,
useCallback,
useContext,
Function Tab
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
(
{
active: activeProp, // don't pass with rest
disabled,
children,
- 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 FormField.js
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
Children,
cloneElement,
forwardRef,
useContext,
File Button.js
has 492 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
cloneElement,
Children,
forwardRef,
useContext,
File TextInput.js
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
forwardRef,
useCallback,
useContext,
useEffect,
File MaskedInput-test.js
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import 'jest-styled-components';
import { fireEvent, render, waitFor } from '@testing-library/react';
Function FormatInline
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FormatInline = () => {
const [date, setDate] = useState();
const [emptyDate, setEmptyDate] = useState();
const [dateRange, setDateRange] = useState();
const [dateNoTZ, setDateNoTZ] = useState();
Function SelectionSummary
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
const SelectionSummary = ({
allOptions,
clearRef,
disabled,
disabledKey,
- 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 SelectContainer.js
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
forwardRef,
useCallback,
useContext,
useEffect,
File Pagination-test.tsx
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import 'jest-styled-components';
import 'jest-axe/extend-expect';
import 'regenerator-runtime/runtime';
import 'jest-styled-components';
Function gapGapStyle
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
const gapGapStyle = (directionProp, gap, responsive, border, theme) => {
const metric = theme.global.edgeSize[gap] || gap;
const breakpoint = getBreakpointStyle(theme, theme.box.responsiveBreakpoint);
const responsiveMetric = responsive && breakpoint && breakpoint.edgeSize[gap];
- 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 Layer-test.js
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import 'jest-styled-components';
import { render, fireEvent } from '@testing-library/react';
import { getByTestId, queryByTestId } from '@testing-library/dom';
import 'regenerator-runtime/runtime';