Showing 445 of 2,739 total issues
Function useKeyNavigation
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
export default function useKeyNavigation({
visibleNodes,
selectedNode,
onNodeSelect,
onNodeExpand,
- 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 index.js
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, {
useState,
useRef,
useEffect,
useMemo,
Function CurrencyInput
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CurrencyInput = forwardRef((props, ref) => {
const {
value,
name,
placeholder,
Function PercentInput
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PercentInput = forwardRef((props, ref) => {
const {
value,
name,
placeholder,
Function resolveOptions
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function resolveOptions(conditions) {
const {
disableAnimations,
disableLines,
disableCurves,
Function render
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
style,
className,
label,
Function MultiSelect
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const MultiSelect = React.forwardRef((props, ref) => {
const {
id,
className,
style,
- 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 CounterInput
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CounterInput = React.forwardRef((props, ref) => {
const {
id,
name,
value,
Function UserSignUp
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function UserSignUp(props) {
const { className, style } = props;
return (
<svg
className={className}
File button.js
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
import styled from 'styled-components';
import {
BORDER_RADIUS_2,
BORDER_RADIUS_SQUARE,
BORDER_RADIUS_SEMI_SQUARE,
Function useHandleKeyDown
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export default function useHandleKeyDown(
focusedDate,
currentMonth,
rightCalendarMonth,
minDate,
- 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 useHandleKeyDown
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function useHandleKeyDown(
focusedDate,
currentMonth,
rightCalendarMonth,
minDate,
File index.js
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable react/no-unescaped-entities, import/no-extraneous-dependencies */
import React, { useState, useContext, useRef } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faList } from '@fortawesome/free-solid-svg-icons';
Function Testing
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Testing = props => {
const { className } = props;
return (
<svg
className={className}
File lookup.spec.js
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { mount } from 'enzyme';
import ButtonIcon from '../../ButtonIcon';
import Lookup from '..';
import StyledTextError from '../../Input/styled/errorText';
Function DatePicker
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DatePicker = React.forwardRef((props, ref) => {
const {
value,
minDate,
maxDate,
Function Drawer
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Drawer(props) {
const {
id,
isOpen,
hideCloseButton,
File button.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable indent */
import styled from 'styled-components';
import {
FONT_SIZE_HEADING_SMALL,
FONT_SIZE_TEXT_MEDIUM,
Function DateTimePicker
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DateTimePicker = React.forwardRef((props, ref) => {
const {
placeholder,
labelAlignment,
hideLabel,
Function TimePicker
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TimePicker = React.forwardRef((props, ref) => {
const {
placeholder,
label,
required,