Showing 197 of 680 total issues
Function Tournament
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function Tournament({ waitingRoomMachine }) {
const dispatch = useDispatch();
const searchParams = useSearchParams();
- 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 updateGameHistoryState
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const updateGameHistoryState = nextRecordId => (dispatch, getState) => {
const state = getState();
const records = selectors.playbookRecordsSelector(state);
const nextRecord = parse(records[nextRecordId]) || {};
Function clearGameListeners
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const clearGameListeners = () => {
if (currentGameChannel) {
currentGameChannel.off(channelTopics.editorDataTopic, refs[0]);
currentGameChannel.off(channelTopics.userStartCheckTopic, refs[1]);
currentGameChannel.off(channelTopics.userCheckCompleteTopic, refs[2]);
Function GamesHeatmap
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GamesHeatmap() {
const [activities, setActivities] = useState(null);
const dispatch = useDispatch();
Function GameResult
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function GameResult() {
const currentUserId = useSelector(state => selectors.currentUserIdSelector(state));
const players = useSelector(state => selectors.gamePlayersSelector(state));
const isCurrentUserPlayer = hasIn(players, currentUserId);
const gameStatus = useSelector(state => selectors.gameStatusSelector(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 initGameChannel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const initGameChannel = (gameRoomMachine, waitingRoomMachine, currentChannel) => dispatch => {
const onJoinFailure = payload => {
gameRoomMachine.send('REJECT_LOADING_GAME', { payload });
gameRoomMachine.send('FAILURE_JOIN', { payload });
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 TimerContainer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function TimerContainer({
time, mode, timeoutSeconds, gameStateName,
}) {
const { mainService, taskService } = useContext(RoomContext);
const roomMachineState = useMachineStateSelector(mainService, roomStateSelector);
- 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 BuilderActions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function BuilderActions({
validExamples,
clearSuggests,
}) {
const dispatch = useDispatch();
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const initTournamentChannel = waitingRoomMachine => dispatch => {
const onJoinFailure = () => {
window.location.reload();
};
Function Notifications
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Notifications() {
const { mainService } = useContext(RoomContext);
const roomMachineState = useMachineStateSelector(mainService, roomStateSelector);
const { tournamentId } = useSelector(selectors.gameStatusSelector);
Function addCursorListeners
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addCursorListeners = (id, onChangePosition, onChangeSelection) => {
if (!id) {
return () => { };
}
Function handleSubmit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleSubmit = useCallback(() => {
setError();
setState(LoadingStatusCodes.LOADING);
const onError = err => {
Function getTitleByRoundType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getTitleByRoundType = (type, playersCount) => {
switch (type) {
case RoundTypes.one:
return 'Round 1';
case RoundTypes.two: {
Function establishChat
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const establishChat = () => dispatch => {
const oldChannel = channel;
const camelizeKeysAndDispatch = actionCreator => data => dispatch(actionCreator(camelizeKeys(data)));
oldChannel.join().receive('ok', data => {
Function TaskDescriptionModal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TaskDescriptionModal = NiceModal.create(() => {
const dispatch = useDispatch();
const modal = useModal(ModalCodes.taskDescriptionModal);
Function UserSettings
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function UserSettings() {
const [notification, setNotification] = useState(notifications.empty);
const settings = useSelector(userSettingsSelector);
const dispatch = useDispatch();
Method main
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
fun main(args: Array<String>) {
var oldOut: PrintStream = System.out
var executionResults: ArrayList<AssertResult> = ArrayList<AssertResult>()
try {
Function useEvent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const useEvent = (name, handler, target = defaultTarget, options) => {
useEffect(() => {
if (!handler) {
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 SignatureForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function SignatureForm({ signature, handleEdit }) {
const types = useMemo(() => resolveSignatureToTypes(signature), [signature]);
const handleSelect = useCallback((newType, nestedIndex) => {
const newTypes = types.map((type, index) => (index === nestedIndex ? newType : type));
- 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 TaskParamsModal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const TaskParamsModal = NiceModal.create(({
taskService,
mode: defaultMode = 'none',
action = 'none',
}) => {
- 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"