Showing 188 of 670 total issues
Function TournamentStatisticsModal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const TournamentStatisticsModal = NiceModal.create(() => {
const modal = useModal(ModalCodes.tournamentStatisticsModal);
const gameId = useSelector(gameIdSelector);
const tournament = useSelector(tournamentSelector);
- 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 TournamentMainControlButtons
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const TournamentMainControlButtons = ({
accessType,
tournamentId,
canStart,
canStartRound,
- 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 BuilderExampleForm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function BuilderExampleForm() {
const dispatch = useDispatch();
const { taskService } = useContext(RoomContext);
const argumentsTabRef = 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 BuilderEditorsWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function BuilderEditorsWidget() {
const dispatch = useDispatch();
const { taskService } = useContext(RoomContext);
const [assertsPanelShowing, setAssertsPanelShowing] = useState(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 TournamentType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function TournamentType({ type }) {
if (type === TournamentTypeCodes.versus) {
return 'Versus';
}
- 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 EmojiTooltip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function EmojiTooltip({ colons, handleSelect, hide }) {
const [activeIndex, setActiveIndex] = useState(0);
const [emojis, setEmojis] = useState([]);
const increaseIndex = () => {
- 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 OutputTab
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const OutputTab = ({ sideOutput, large = false }) => {
const { successCount, assertsCount, status } = sideOutput;
const isShowMessage = status === 'failure';
const statusColor = color[status];
const message = getMessage(status);
- 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 ChatWidget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function ChatWidget() {
const { mainService } = useContext(RoomContext);
const users = useSelector(selectors.chatUsersSelector);
const messages = useSelector(selectors.chatMessagesSelector);
- 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 StageCard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. 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 initTournamentChannel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const initTournamentChannel = waitingRoomMachine => dispatch => {
const onJoinFailure = () => {
window.location.reload();
};
- 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 addCursorListeners
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const addCursorListeners = (id, onChangePosition, onChangeSelection) => {
if (!id) {
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 editorDataSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const editorDataSelector = (playerId, roomMachineState) => state => {
const meta = editorsMetaSelector(state)[playerId];
const editorTexts = editorTextsSelector(state);
const editorTextsHistory = editorTextsHistorySelector(state);
- 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
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
return [true];
Avoid too many return
statements within this function. Open
return <GameRoomTimer timeoutSeconds={timeoutSeconds} time={time} />;
Avoid too many return
statements within this function. Open
return { ...acc, records: [...records, newRecord] };
Avoid too many return
statements within this function. Open
return (
<>
<FontAwesomeIcon icon="users" />
vs
<FontAwesomeIcon icon="users" />
Avoid too many return
statements within this function. Open
return isArray(value) && !value.some(item => !isValidValueToSignature(item, signature.nested));
Avoid too many return
statements within this function. Open
return { ...acc, chat: newChatState, records: [...records, newRecord] };
Avoid too many return
statements within this function. Open
return 'Round 1';