Showing 545 of 2,098 total issues
Function CustomSearch
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CustomSearch = () => {
const [selectedContentPartners, setSelectedContentPartners] = useState([]);
const [contentPartners, setContentPartners] = useState(allContentPartners);
const [searching, setSearching] = useState(false);
const [searchQuery, setSearchQuery] = useState('');
File Menu.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useRef,
forwardRef,
useCallback,
useContext,
Function visibleValue
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
(i) => {
const optionValue =
valueKey && valueKey.reduce ? applyKey(i, valueKey) : i;
const optionSelected = arrayIncludes(
value,
Function Form
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
(
{
children,
errors: errorsProp = defaultValidationResults.errors,
infos: infosProp = defaultValidationResults.infos,
- 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 Carousel
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
const Carousel = ({
activeChild,
initialChild,
onChild,
play,
- 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 Sticky
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Sticky = () => {
const [open, setOpen] = useState(false);
const onOpen = () => setOpen(true);
const onClose = () => setOpen(undefined);
Function roundStyle
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const roundStyle = (data, responsive, theme) => {
const breakpoint = getBreakpointStyle(theme, theme.box.responsiveBreakpoint);
const styles = [];
if (typeof data === 'object') {
const size =
Function gapGapStyle
has 120 lines of code (exceeds 25 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];
File Box-layout-test.tsx
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { render } from '@testing-library/react';
import 'jest-styled-components';
import { Grommet } from '../../Grommet';
File InfiniteScroll-test.tsx
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { render, act } from '@testing-library/react';
import 'jest-styled-components';
import { Grommet, Image, Box, InfiniteScrollProps } from '../..';
Function place
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
const place = (preserveHeight) => {
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
const container = dropRef.current;
if (container && target) {
Function ArrayOfFormFields
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ArrayOfFormFields = () => {
const [values, setValues] = useState({
name: '',
phones: [{ number: '', ext: '' }],
});
File RangeSelector.js
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
forwardRef,
useCallback,
useContext,
useEffect,
File Accordion-test.tsx
has 358 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 kindPartStyles
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export const kindPartStyles = (obj, theme, colorValue) => {
const styles = [];
if (obj.padding || obj.pad) {
// button uses `padding` but other components use Grommet `pad`
const pad = obj.padding || obj.pad;
- 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 gapStyle
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const gapStyle = (directionProp, gap, responsive, wrap, 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 Tabs.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
forwardRef,
useCallback,
useContext,
useState,
Function SpaceX
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SpaceX = () => {
const [groups, setGroups] = useState([]);
const [expanded, setExpanded] = useState([]);
const [sort, setSort] = useState({ property: 'name', direction: 'asc' });
const [data, setData] = useState([]);
Function Header
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
(
{
allowSelectAll,
cellProps,
columns,
- 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 Notification
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const Notification = ({
actions: actionsProp,
message: messageProp,
onClose,
id,
- 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"