Showing 200 of 693 total issues
Function StageCard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
function StageCard({
type,
playerId,
opponentId,
stage,
- 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 TaskConfigurationModal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
const TaskConfigurationModal = NiceModal.create(() => {
const dispatch = useDispatch();
const visibilityInputRef = 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
Avoid too many return
statements within this function. Open
Open
return !isArray(value)
&& isObject(value)
&& !Object.keys(value).some(item => item.length === 0)
&& !Object.values(value).some(item => !isValidValueToSignature(item, signature.nested));
Avoid too many return
statements within this function. Open
Open
return [false, 'Not valid expected'];
Avoid too many return
statements within this function. Open
Open
return gameStatuses[gameStateName];
Avoid too many return
statements within this function. Open
Open
return 'Round 3';
Avoid too many return
statements within this function. Open
Open
return isBoolean(value);
Avoid too many return
statements within this function. Open
Open
return [false, 'Doesn\'t match with signature'];
Avoid too many return
statements within this function. Open
Open
return { ...acc, chat: newChatState, records: [...records, newRecord] };
Avoid too many return
statements within this function. Open
Open
return (
<>
<FontAwesomeIcon icon="users" />
vs
<FontAwesomeIcon icon="users" />
Avoid too many return
statements within this function. Open
Open
return <GameRoomTimer timeoutSeconds={timeoutSeconds} time={time} />;
Avoid too many return
statements within this function. Open
Open
return 'Task Testing';
Avoid too many return
statements within this function. Open
Open
return { state: 'online' };
Avoid too many return
statements within this function. Open
Open
return { ...acc, players: newPlayers, records: [...records, newRecord] };
Avoid too many return
statements within this function. Open
Open
return 'Round 1';
Avoid too many return
statements within this function. Open
Open
return (
<FontAwesomeIcon icon="wine-bottle" />
);
Avoid too many return
statements within this function. Open
Open
return 'Task Is Invalid';
Avoid too many return
statements within this function. Open
Open
return 'Task Builder';
Avoid too many return
statements within this function. Open
Open
return isArray(value) && !value.some(item => !isValidValueToSignature(item, signature.nested));
Avoid too many return
statements within this function. Open
Open
return null;