Showing 445 of 2,739 total issues
Function CounterInput
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CounterInput = React.forwardRef((props, ref) => {
const {
id,
name,
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 detach
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function detach(elem, listener) {
if (!elem) {
return;
}
if (elem.resizedAttached && typeof listener === 'function') {
- 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 Rgba
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Rgba = React.forwardRef((_props, ref) => {
const { rgba, hsv, hex, tabIndex, onChange } = useContext(ColorPickerContext) || {};
const firstRef = useRef();
const lastRef = 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 clearAllBodyScrollLocks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function clearAllBodyScrollLocks() {
if (isIosDevice) {
// Clear all locks ontouchstart/ontouchmove handlers, and the references.
locks.forEach(lock => {
lock.targetElement.ontouchstart = 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 DayComponent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function DayComponent(props) {
const {
date,
firstDayMonth,
isSelected,
- 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 buildNewRangeFromValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function buildNewRangeFromValue(value, currentRange) {
if (currentRange && currentRange.length > 0) {
const [rangeStart, rangeEnd] = currentRange;
const newRangeStart = new Date(rangeStart);
newRangeStart.setHours(0, 0, 0, 0);
- 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 getSearchParams
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function getSearchParams(searchOptions) {
let searchParams = {};
if (searchOptions) {
const { bounds, country, location, ...otherSearchOptions } = searchOptions;
- 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
Avoid too many return
statements within this function. Open
return recomposeColor({ type, values });
Avoid too many return
statements within this function. Open
return {
left: leftUpAnchor.x,
top: leftUpAnchor.y - contentHeight - margin,
};
Avoid too many return
statements within this function. Open
return 'right-to-left';
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
if (type === 'hsla') return hslToRgb(color);
Avoid too many return
statements within this function. Open
return {
left: leftBottomAnchor.x,
top: leftBottomAnchor.y + margin,
};
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return (
<StyledCell
as="td"
role="gridcell"
tabIndex={-1}
Avoid too many return
statements within this function. Open
return hour;
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return onChange([option]);
Avoid too many return
statements within this function. Open
return <div className="react-rainbow-defualt-array">{value}</div>;