Showing 200 of 693 total issues
Function StairwayGameContainer
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function StairwayGameContainer() {
const dispatch = useDispatch();
const meta = useSelector(state => state.tournament?.tournament?.meta);
const activeMatch = useSelector(state => state.tournament?.activeMatch);
Function BuilderSettingsWidget
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function BuilderSettingsWidget() {
const dispatch = useDispatch();
const task = useSelector(selectors.builderTaskSelector);
const {
Function PremiumRestrictionModal
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PremiumRestrictionModal = NiceModal.create(() => {
const dispatch = useDispatch();
const [sended, setSended] = useState(false);
const modal = useModal(ModalCodes.premiumRestrictionModal);
Function useMatchesStatistics
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function useMatchesStatistics(playerId, matches) {
return useMemo(() => {
if (!matches || (matches.length === 0 && playerId)) {
return [emptyStats, emptyStats];
}
Function buildTaskAsserts
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const buildTaskAsserts = taskService => (dispatch, getState) => {
const state = getState();
if (state.builder.templates.state !== taskTemplatesStates.init) {
dispatch(
Function useEditor
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useEditor = props => {
const [editor, setEditor] = useState();
const [monaco, setMonaco] = useState();
// const convertRemToPixels = rem => rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
// this.statusBarHeight = lineHeight = current fontSize * 1.5
Function TournamentClanTable
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TournamentClanTable() {
const currentUserClanId = useSelector(currentUserClanIdSelector);
const { clans, ranking, rankingType } = useSelector(tournamentSelector);
const items = Array.isArray(ranking) ? ranking : ranking?.entries;
File TournamentAdminWidget.jsx
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {
useState, useCallback, useEffect, useMemo,
} from 'react';
import { useInterpret } from '@xstate/react';
File BuilderExampleForm.jsx
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {
useRef,
useState,
useCallback,
memo,
File player.js
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import find from 'lodash/find';
import partition from 'lodash/partition';
import Delta from 'quill-delta';
import PlaybookStatusCodes from '../config/playbookStatusCodes';
File Registration.jsx
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState } from 'react';
import axios from 'axios';
import cn from 'classnames';
import { useFormik } from 'formik';
Function connectToTournament
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const connectToTournament = (waitingRoomMachine, newTournamentId) => dispatch => {
setTournamentChannel(newTournamentId);
initTournamentChannel(waitingRoomMachine, channel)(dispatch);
const handleUpdate = response => {
Function useCursorUpdates
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useCursorUpdates = (editor, monaco, props) => {
const params = useMemo(
() => pick(props, ['userId', 'roomMode']),
// eslint-disable-next-line react-hooks/exhaustive-deps
Function connectToTournament
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const connectToTournament = (_machine, newTournamentId) => dispatch => {
setTournamentChannel(newTournamentId);
initTournamentChannel(dispatch);
const handleUpdate = response => {
Function run
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.run = function run(args = [], count) {
let output = '';
let oldConsole = console;
const fakeStream = new Writable();
Function run
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const run = function run(args = []) {
let output = '';
const fakeStream = new Writable();
const myConsole = new Console(fakeStream);
File RubyOriginalIcon.jsx
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable max-len */
import React from 'react';
const RubyOriginalIcon = ({ className, size = '1em' }) => (
<svg viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg" className={className} style={{ width: size, height: size }}>
File BuilderEditorsWidget.jsx
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {
useState,
useContext,
useCallback,
memo,
Function RatingPanel
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
function RatingPanel({
searchedUser,
roundsLimit,
currentRoundPosition,
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 ChatWidget
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ChatWidget() {
const { mainService } = useContext(RoomContext);
const users = useSelector(selectors.chatUsersSelector);
const messages = useSelector(selectors.chatMessagesSelector);