Showing 445 of 2,739 total issues
File AscensionIsland.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
function SvgAscensionIsland({ className, style }) {
return (
File styled.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import styled from 'styled-components';
import attachThemeAttrs from '../../../styles/helpers/attachThemeAttrs';
import {
FONT_SIZE_HEADING_X_LARGE,
FONT_SIZE_HEADING_LARGE,
Function Trash
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Trash = props => {
const { className, style } = props;
return (
<svg
className={className}
File index.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable react/no-unused-prop-types */
import React, { forwardRef, useState, useEffect, useRef, useImperativeHandle } from 'react';
import PropTypes from 'prop-types';
import {
useLocale,
Function useScrollControls
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function useScrollControls(scrollableRef) {
const [showScrollUp, setShowScrollUp] = useState();
const [showScrollDown, setShowScrollDown] = useState();
const timer = useRef();
Function Tree
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Tree(props) {
const {
data,
onNodeExpand,
onNodeCheck,
PageTimePicker
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class PageTimePicker {
/**
* Create a new TimePicker page object.
* @constructor
* @param {string} rootElement - The selector of the TimePicker root element.
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<aside className="rainbow-admin_vertical-navigation rainbow-p-vertical_medium">
<VerticalNavigation
selectedItem={this.state.selectedItem}
Function getFormattedValue
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function getFormattedValue(value, highlightMatch, icon) {
if (!value) return null;
if (value && typeof value === 'string') {
return {
Function YearSelect
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const YearSelect = React.forwardRef((props, ref) => {
const { currentYear, yearsRange, onYearChange, onClick, onFocus, onBlur, tabIndex } = props;
const selectRef = useRef();
const selectId = useUniqueIdentifier('select');
const [isEditMode, setEditMode] = useState(false);
Function Csv
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Csv(props) {
const { className, style } = props;
return (
<svg
className={className}
Function FeatureList
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function FeatureList(props) {
const { className, style } = props;
const getContainerClassNames = () => classnames('react-rainbow-feature-list', className);
Function SearchIcon
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SearchIcon = props => {
const { className, style } = props;
return (
<svg
className={className}
File tabset.spec.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { mount } from 'enzyme';
import Tabset from '../index';
import Tab from '../../Tab';
import {
File index.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable react/no-unused-prop-types */
import React, { useState, useRef, useImperativeHandle } from 'react';
import PropTypes from 'prop-types';
import Label from '../Input/label';
import RenderIf from '../RenderIf';
Function UniversalSearch
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UniversalSearch = () => {
const [recents, addRecents] = useLocalRecentSearches('rainbow-algolia-recent-searches');
return (
<>
<StyledGlobalSearch
Function AccordionSection
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
const AccordionSection = props => {
const {
style,
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
Function InternalOverlay
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const InternalOverlay = props => {
const {
render: ContentComponent,
isVisible,
triggerElementRef,
Function Drop
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function Drop(props) {
const { className, style } = props;
return (
<svg className={className} style={style} width="64" height="70" viewBox="0 0 64 70">
<g fill="none">
Function CompressArrow
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CompressArrow = props => {
const { className, style } = props;
return (
<svg
className={className}