Showing 445 of 2,739 total issues
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return onChange({
label,
name,
icon,
value: optionValue,
Avoid too many return
statements within this function. Open
return (
<div className={className}>
{description}
{propTypeEnumRender(type.value)}
</div>
Function hexToRgba
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function hexToRgba(color, alpha = 1) {
if (color.charAt(0) !== '#') {
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 colorToRgba
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function colorToRgba(color) {
if (typeof color !== 'string') return '';
try {
const { type, values } = decomposeColor(color);
- 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 PageButtons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function PageButtons(props) {
const { pages, activePage, onChange, variant } = props;
const getAriaCurrent = page => {
if (page === activePage) {
- 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 formatDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function formatDate(date, formatStyle = 'medium', locale = 'en-US') {
if (date) {
try {
const options = FORMATS[formatStyle] || FORMATS.medium;
const value = typeof date === 'string' ? new Date(date) : date;
- 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 Child
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Child(props) {
const {
label,
isExpanded,
isLoading,
- 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 getTabIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getTabIndex = ({ name, selectedNode, isSelected, isFirstNode, focusedNode }) => {
if (
(focusedNode && name === focusedNode) ||
(isSelected && !focusedNode) ||
(isFirstNode && !selectedNode && !focusedNode)
- 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 get24Hour
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function get24Hour(hour, ampm) {
const hourNumber = Number(hour);
if (ampm === 'AM') {
if (hourNumber === 12) {
return '00';
- 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 EditableCell
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function EditableCell(props) {
const { value, onChange, row, field } = props;
const [isEditMode, setIsEditMode] = useState(false);
const [internalValue, setInternalValue] = useState(value);
const inputRef = useRef(null);
- 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 getNextHour
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getNextHour(value, hour24 = false) {
const number = Number(value);
if ((!value || number === 12) && !hour24) {
return '1';
}
- 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 handleKeyDown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
handleKeyDown(event) {
const { keyCode } = event;
if (keyCode === RIGHT_KEY) {
this.handleRightKeyPressed();
- 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 Cell
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function Cell(props) {
const {
header,
component,
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 getFormattedEventTimeRange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getFormattedEventTimeRange(startDate, endDate, locale) {
const startDateParts = formatter(locale).formatToParts(startDate);
const endDateParts = formatter(locale).formatToParts(endDate);
const formattedStartDate = getFormattedEventTime(
- 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 getPrevHour
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getPrevHour(value, hour24 = false) {
const number = Number(value);
if ((!value || number === 1 || number === 0) && !hour24) {
return '12';
}
- 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 getFormattedValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getFormattedValue(value, highlightMatch, icon) {
if (!value) return null;
if (value && typeof value === 'string') {
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 AccordionTimeline
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function AccordionTimeline(props) {
const { id, children, className, style, multiple, activeSectionNames, onToggleSection } = props;
const registeredTimelineMarkers = useRef([]);
const [activeNames, setActiveNames] = useState(activeSectionNames);
const containerRef = 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 getTypeValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getTypeValue(value, dataType) {
switch (dataType.name) {
case 'String':
return 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 componentDidUpdate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
const {
children: prevChildren,
showCheckboxColumn: prevShowCheckboxColumn,
maxRowSelection: prevMaxRowSelection,
- 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"