Showing 445 of 2,739 total issues
Function Accordion
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Accordion = props => {
const { id, children, style, className, activeSectionNames, multiple, onToggleSection } = props;
const containerRef = useRef();
const [activeNames, setActiveNames] = useState(activeSectionNames);
Function StepThree
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function StepThree(props) {
const { attributes, columns, onAssignField, fieldsMap, data, matchField, borderRadius } = props;
const previewData = data.slice(0, 3);
const [assignData, setAssignData] = useState([]);
Function CustomWorkIcon
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CustomWorkIcon = props => {
const { className } = props;
return (
<svg className={className} width="24px" height="22px" viewBox="0 0 24 22" version="1.1">
<g id="pages" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
Function File
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const File = props => {
const { className, style } = props;
return (
<svg className={className} style={style} width="16px" height="20px" viewBox="0 0 16 20">
<g id="components" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
Function filterCountries
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export default function filterCountries(query, countries, country) {
if (query === '' || query === '+') {
const filteredCountries = countries.filter(value => value.isoCode !== country.isoCode);
filteredCountries.unshift(country);
return filteredCountries;
- 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 tableWithBrowserPagination.spec.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { mount } from 'enzyme';
import TableWithBrowserPagination from '../index';
import Pagination from '../../Pagination';
import Table from '../../Table';
Function renderCards
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderCards() {
const {
forms,
dataViews,
layouts,
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
title,
style,
className,
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { isOpen } = this.state;
const { componentLibraryVersion, prismicLibraryVersion } = this.state;
return (
<ul
Function User
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const User = props => {
const { className, style } = props;
return (
<svg
className={className}
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
style,
label,
children,
Function render
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
label,
value,
name,
Function Row
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Row(props) {
const { rowData, columns, isSelected, ...rest } = props;
const cells = columns.map((column, index) => {
const {
Function RibbonRenderer
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function RibbonRenderer() {
return (
<StyledHeading>
<UniversalSearch />
<StyledContainer>
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
style,
className,
label,
Function getColumns
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getColumns(params) {
const {
children = [],
showCheckboxColumn,
showRowNumberColumn,
Function getUpdatedRowsWhenSelect
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getUpdatedRowsWhenSelect(params = {}) {
const {
maxRowSelection,
rows = [],
indexes = {},
Function InteractiveExamples
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InteractiveExamples = props => {
const { className } = props;
return (
<svg
className={className}
Function toBeFocusable
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export default function toBeFocusable(component) {
if (component && isMountedByEnzyme(component)) {
const onClickMockFn = jest.fn();
const onBlurMockFn = jest.fn();
const onFocusMockFn = jest.fn();
- 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 useArrowKeyNav
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export default function useArrowKeyNav({ childrenRefs, isLoading }) {
const [focusedChildIndex, setFocusedChildIndex] = useState(null);
const focusChild = useCallback(
index => {
- 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"