Showing 49 of 120 total issues
Function LapsTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const LapsTable = ({ laps, timer }: LapTableProperties) => {
const finishedLaps = laps.slice(1);
let min = Number.MAX_SAFE_INTEGER;
let max = Number.MIN_SAFE_INTEGER;
if (finishedLaps.length >= 2)
- 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 EditItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const EditItem = () => {
const dispatch = useAppDispatch();
const activeMessage = useAppSelector(getActiveChatMessage);
const messageReference = useRef(activeMessage?.message ?? '');
- 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 (
<Notification
onCancel={handleClose}
title="bob"
/>
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return (
<Modal
onBackgroundPress={handleClose}
showOverlay
>
Avoid too many return
statements within this function. Open
return (
<Modal
onBackgroundPress={handleClose}
showOverlay
>
Avoid too many return
statements within this function. Open
return <Loading onBackgroundPress={handleClose} />;
Function RateApp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const RateApp = ({ onComplete }: Properties) => {
const ratingReference = useRef(0);
const navigatedToAppStore = useRef(false);
const [form, setForm] = useState<State>(initialState);
const styles = StyleSheet.create({
- 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 getPosition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getPosition = (position: Position): Vector => {
const dx = position.current.x - position.change.dx;
const dy = position.current.y + position.change.dy;
const y =
dy < 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"