Showing 188 of 670 total issues
Avoid too many return
statements within this function. Open
return [false, 'Not valid expected'];
Avoid too many return
statements within this function. 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
return (
<FontAwesomeIcon
title="Unknown tournament type"
icon="question-circle"
/>
Avoid too many return
statements within this function. Open
return 'Round 1';
Avoid too many return
statements within this function. Open
return [false, 'Only lowercase latin'];
Avoid too many return
statements within this function. Open
return [false, 'Name must be unig'];
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return (
<button
type="button"
className={`btn btn-orange btn-sm ${type === 'table' ? 'ml-1 px-4' : ''} rounded-lg`}
data-method="post"
Avoid too many return
statements within this function. Open
return [true, ''];
Function SubMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function SubMenu({
children,
statusColor,
assert,
hasOutput,
- 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 useChatContextMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const useChatContextMenu = ({
type,
users,
canInvite = false,
}) => {
- 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 UserStats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const UserStats = ({ data, user: userInfo }) => {
const dispatch = useDispatch();
const avatarUrl = userInfo.avatarUrl || data?.user?.avatarUrl || '/assets/images/logo.svg';
const name = userInfo.name || data?.user?.name || 'Jon Doe';
- 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 calcRoundResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const calcRoundResult = matches => matches.reduce(
(acc, match) => {
const [gameResultPlayer1, gameResultPlayer2] = match.playerIds.map(
id => match.playerResults[id]?.result || 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 MatchConfirmationModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function MatchConfirmationModal({
players,
matches,
currentUserId,
currentRoundPosition,
- 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 InfoPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function InfoPanel({
currentUserId, tournament, playersCount, hideResults,
}) {
if (
tournament.state === TournamentStates.waitingParticipants
- 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 getUserStateByPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getUserStateByPath = () => {
const { pathname } = document.location;
if (pathname.startsWith('/tournament')) {
return ({ state: 'tournament' });
- 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 CustomTournamentInfoPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function CustomTournamentInfoPanel({
roundsLimit = 1,
currentRoundPosition = 0,
matchTimeoutSeconds,
matches,
- 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 InfoPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function InfoPanel({
currentUserId,
tournament,
playersCount,
hideResults,
- 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 TournamentStateDescription
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function TournamentStateDescription({
state,
startsAt,
breakState,
breakDurationSeconds,
- 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 updateCheckResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
updateCheckResult: (state, { payload }) => {
state.activeGames = state.activeGames.map(game => {
if (game.id === payload.gameId) {
const newPlayers = game.players.map(player => (player.id === payload.userId
? { ...player, checkResult: payload.checkResult }
- 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"