Showing 545 of 2,098 total issues
Function generate
has 1406 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const generate = (baseSpacing = 24, scale = 6) => {
// 24
const baseFontSize = baseSpacing * 0.75; // 18
const fontScale = baseSpacing / scale; // 4
Function DataChart
has a Cognitive Complexity of 265 (exceeds 5 allowed). Consider refactoring. Open
(
{
a11yTitle,
axis: axisProp = true,
bounds: boundsProp = 'align',
- 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 DataTable-test.tsx
has 1782 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import 'jest-styled-components';
import { render, fireEvent, screen } from '@testing-library/react';
import { Grommet } from '../../Grommet';
File base.js
has 1531 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Actions } from 'grommet-icons/icons/Actions';
import { AssistListening } from 'grommet-icons/icons/AssistListening';
import { CircleInformation } from 'grommet-icons/icons/CircleInformation';
import { ClosedCaption } from 'grommet-icons/icons/ClosedCaption';
import { Expand } from 'grommet-icons/icons/Expand';
File Select-test.js
has 1454 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { render, fireEvent, act, screen } from '@testing-library/react';
import { axe } from 'jest-axe';
import 'jest-axe/extend-expect';
import 'jest-styled-components';
File Form-test-uncontrolled.js
has 1421 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import 'jest-styled-components';
import 'jest-axe/extend-expect';
import 'regenerator-runtime/runtime';
File Form-test-controlled.js
has 1212 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import userEvent from '@testing-library/user-event';
import 'jest-styled-components';
Function Button
has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring. Open
(
{
active,
align = 'center',
'aria-label': ariaLabel,
- 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 DateInput-test.tsx
has 1070 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import 'jest-styled-components';
import { fireEvent, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { axe } from 'jest-axe';
Function Chart
has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring. Open
(
{
a11yTitle,
bounds: boundsProp,
color,
- 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 List-test.tsx
has 957 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 '@testing-library/jest-dom';
Function DataTable
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
const DataTable = ({
allowSelectAll = true,
background,
border,
columns: columnsProp,
- 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 FormField
has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring. Open
(
{
children,
className,
component,
- 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 Calendar.js
has 830 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
forwardRef,
useCallback,
useContext,
useEffect,
File styles.js
has 801 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { css } from 'styled-components';
import { backgroundStyle } from './background';
import { normalizeColor } from './colors';
import { getBreakpointStyle } from './responsive';
import { breakpointStyle, parseMetricToNum } from './mixins';
Function SelectContainer
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
(
{
clear,
children = null,
disabled,
- 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-kind-test.js
has 781 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import 'jest-styled-components';
import 'jest-axe/extend-expect';
import 'regenerator-runtime/runtime';
Function Calendar
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
(
{
activeDate: activeDateProp,
animate = true,
bounds: boundsProp,
- 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 StyledLayer.js
has 754 lines of code (exceeds 250 allowed). Consider refactoring. Open
import styled, { css, keyframes } from 'styled-components';
import {
baseStyle,
backgroundStyle,
Function Menu
has 345 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Menu = forwardRef((props, ref) => {
const {
a11yTitle,
'aria-label': ariaLabel,
children,