Showing 445 of 2,739 total issues
Function Indicator
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Indicator = props => {
const { id, containerId, header, onSelect, selectedItem, onCreate, onDestroy } = props;
const indicatorRef = useRef();
useEffect(() => {
Function CSVCell
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function CSVCell(props) {
const { onClick, row, value, borderRadius } = props;
return (
<CellContainer>
<RenderIf isTrue={value}>
Function Dataset
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Dataset(props) {
const datasetId = useUniqueIdentifier('dataset');
const { title: label, values: data, ...rest } = props;
const { registerDataset, unregisterDataset, updateDataset } = React.useContext(ChartContext);
const isRegistered = useRef();
Function scrollToSelectedTab
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
scrollToSelectedTab(name) {
const { tabsetChildren } = this;
const tabset = this.tabsetRef.current;
const { scrollLeft, offsetWidth: tabsetWidth } = tabset;
const tabIndex = getTabIndexFromName(tabsetChildren, name);
Function Saturation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Saturation = React.forwardRef((_props, ref) => {
const { rgba, hsv, tabIndex, onChange } = useContext(ColorPickerContext);
const containerRef = useRef();
const isMouseDown = useRef(false);
const [h, s, v] = hsv;
- 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 DatePicker
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const DatePicker = React.forwardRef((props, ref) => {
const {
value,
minDate,
maxDate,
- 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 rgbToHsv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function rgbToHsv(color) {
const { type, values } = decomposeColor(color);
if (!type || !values || type.indexOf('rgb') === -1) {
return '';
}
- 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 useScrollControls
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function useScrollControls(scrollableRef) {
const [showScrollUp, setShowScrollUp] = useState();
const [showScrollDown, setShowScrollDown] = useState();
const timer = useRef();
- 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 Accordion
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Accordion = props => {
const { id, children, style, className, activeSectionNames, multiple, onToggleSection } = props;
const containerRef = useRef();
const [activeNames, setActiveNames] = useState(activeSectionNames);
- 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 handleChange
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
handleChange(optionName, isChecked) {
const { onChange, multiple, value } = this.props;
let currentValue = optionName;
if (multiple) {
if (!Array.isArray(value)) {
- 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 PrimitiveMenu
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const PrimitiveMenu = 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 extractTime
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function extractTime(date, hour24 = false) {
if (date) {
const value = typeof date === 'string' ? new Date(date) : date;
if (!isValidDate(value)) {
return '';
- 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 MinusIcon
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MinusIcon = props => {
const { className, style } = props;
return (
<svg
Function NavigationButton
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function NavigationButton(props) {
const { onClick, icon, disabled, dataId, ariaLabel, variant } = props;
const handleOnClick = event => {
if (!disabled) {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { minColumnWidth, maxColumnWidth, isResizable, ariaLabel } = this.props;
const { resizeBarStyle } = this.state;
return (
Function Event
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Event(props) {
const { onEventClick, locale, ...event } = props;
const { title, startDate, endDate, color, backgroundColor } = event;
const eventId = useUniqueIdentifier('calendar-event');
const duration = useEventDuration(startDate, endDate);
Function VerticalNavigation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function VerticalNavigation(props) {
const {
id,
ariaLabel,
style,
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { src, initials, title, icon, assistiveText, initialsVariant } = this.props;
const { imageFailed } = this.state;
if (src && !imageFailed) {
Function UserAvatar
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UserAvatar = props => {
const { className, style } = props;
return (
<svg
className={className}
Function buildUnionTypeList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function buildUnionTypeList(data) {
return Object.keys(data).map(index => {
const type = data[index].name;
const value = data[index].value;