Showing 200 of 693 total issues
Function checkTaskSolution
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const checkTaskSolution = editorService => (dispatch, getState) => {
const state = getState();
const currentUserId = selectors.currentUserIdSelector(state);
const { text, lang } = selectors.getSolution(currentUserId)(state);
const task = selectors.builderTaskSelector(state);
Function Heatmap
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Heatmap() {
const [activities, setActivities] = useState(null);
const dispatch = useDispatch();
Function initGameChannel
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const initGameChannel = (gameRoomService, waitingRoomService) => dispatch => {
const onJoinFailure = payload => {
gameRoomService.send('REJECT_LOADING_GAME', { payload });
gameRoomService.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 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 getTitleByRoundType
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const getTitleByRoundType = (type, playersCount) => {
switch (type) {
case RoundTypes.one:
return 'Round 1';
case RoundTypes.two: {
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
const UserStats = ({ data, user: userInfo }) => {
const dispatch = useDispatch();
const activeGameId = data?.activeGameId;
const avatarUrl = userInfo.avatarUrl || data?.user?.avatarUrl || '/assets/images/logo.svg';
- 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 GamesHeatmap
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GamesHeatmap() {
const [activities, setActivities] = useState(null);
const dispatch = useDispatch();
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 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 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, currentChannel) => dispatch => {
const onJoinFailure = err => {
console.error(err);
// 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 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 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 CreateGameDialog
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function CreateGameDialog({ hideModal }) {
const dispatch = useDispatch();
const { gameOptions: givenGameOptions, opponentInfo } = useSelector(selectors.modalSelector);
const [opponent, setOpponent] = useState(opponentInfo);
const [chosenTask, setChosenTask] = useState(unchosenTask);
- 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"