rrebase/knboard

View on GitHub

Showing 16 of 40 total issues

Function EditTaskDialog has 380 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const EditTaskDialog = () => {
  const theme = useTheme();
  const dispatch = useDispatch();
  const columns = useSelector(selectAllColumns);
  const labels = useSelector(selectAllLabels);
Severity: Major
Found in frontend/src/features/task/EditTaskDialog.tsx - About 1 day to fix

File EditTaskDialog.tsx has 535 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useState, useEffect, useRef } from "react";
import {
  Dialog,
  Button,
  TextField,
Severity: Major
Found in frontend/src/features/task/EditTaskDialog.tsx - About 1 day to fix

Function EditTaskDialog has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

const EditTaskDialog = () => {
  const theme = useTheme();
  const dispatch = useDispatch();
  const columns = useSelector(selectAllColumns);
  const labels = useSelector(selectAllLabels);
Severity: Minor
Found in frontend/src/features/task/EditTaskDialog.tsx - About 7 hrs to fix

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 RegisterDialog has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RegisterDialog = () => {
  const dispatch = useDispatch();
  const { register, handleSubmit, errors, setError } = useForm<FormData>();
  const apiErrors = useSelector(
    (state: RootState) => state.auth.registerErrors
Severity: Major
Found in frontend/src/features/auth/RegisterDialog.tsx - About 5 hrs to fix

Function Profile has 127 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Profile = () => {
  const theme = useTheme();
  const dispatch = useDispatch();
  const userDetail = useSelector(
    (state: RootState) => state.profile.userDetail
Severity: Major
Found in frontend/src/features/profile/Profile.tsx - About 5 hrs to fix

Function UserAvatar has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UserAvatar = () => {
  const user = useSelector((state: RootState) => state.profile.userDetail);
  const avatars = useSelector((state: RootState) => state.profile.avatars);
  const loading = useSelector(
    (state: RootState) => state.profile.avatarLoading
Severity: Major
Found in frontend/src/features/profile/UserAvatar.tsx - About 4 hrs to fix

Function LoginDialog has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LoginDialog = () => {
  const dispatch = useDispatch();
  const [open, setOpen] = useState(false);
  const apiErrors = useSelector((state: RootState) => state.auth.loginErrors);
  const loading = useSelector((state: RootState) => state.auth.loginLoading);
Severity: Major
Found in frontend/src/features/auth/LoginDialog.tsx - About 3 hrs to fix

Function Board has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Board = () => {
  const detail = useSelector((state: RootState) => state.board.detail);
  const error = useSelector((state: RootState) => state.board.detailError);
  const columns = useSelector(columnSelectors.selectAll);
  const tasksByColumn = useSelector((state: RootState) => state.task.byColumn);
Severity: Major
Found in frontend/src/features/board/Board.tsx - About 3 hrs to fix

Function MemberListDialog has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const MemberListDialog = () => {
  const theme = useTheme();
  const dispatch = useDispatch();
  const members = useSelector(selectAllMembers);
  const open = useSelector((state: RootState) => state.member.memberListOpen);
Severity: Major
Found in frontend/src/features/member/MemberList.tsx - About 3 hrs to fix

Function UserMenu has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UserMenu = () => {
  const user = useSelector((state: RootState) => state.auth.user);
  const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
  const dispatch = useDispatch();
  const history = useHistory();
Severity: Major
Found in frontend/src/components/UserMenu.tsx - About 2 hrs to fix

File CreateTaskDialog.tsx has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

import React, { useEffect, useState } from "react";
import {
  Dialog,
  TextField,
  Button,
Severity: Minor
Found in frontend/src/features/task/CreateTaskDialog.tsx - About 2 hrs to fix

Function extraReducers has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  extraReducers: (builder) => {
    builder.addCase(fetchBoardById.fulfilled, (state, action) => {
      const byColumn: TasksByColumn = {};
      const byId: TasksById = {};
      for (const col of action.payload.columns) {
Severity: Major
Found in frontend/src/features/task/TaskSlice.tsx - About 2 hrs to fix

Function ColumnTitle has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

const ColumnTitle = ({ id, title, tasksCount, ...props }: Props) => {
  const dispatch = useDispatch();
  const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(
    null
  );
Severity: Minor
Found in frontend/src/components/ColumnTitle.tsx - About 2 hrs to fix

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 extraReducers has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  extraReducers: (builder) => {
    builder.addCase(fetchAllBoards.pending, (state) => {
      state.fetchLoading = true;
      state.fetchError = null;
      state.detailError = undefined;
Severity: Major
Found in frontend/src/features/board/BoardSlice.tsx - About 2 hrs to fix

Function BoardName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

const BoardName = ({ id, name, isOwner, ...props }: Props) => {
  const dispatch = useDispatch();
  const [pendingName, setPendingName] = useState<string>(name);
  const [editing, setEditing] = useState<boolean>(false);
  const nameTextAreaRef = useRef<HTMLTextAreaElement>(null);
Severity: Minor
Found in frontend/src/components/BoardName.tsx - About 1 hr to fix

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 MemberDialog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const MemberDialog = ({ board }: Props) => {
  const theme = useTheme();
  const dispatch = useDispatch();
  const memberId = useSelector((state: RootState) => state.member.dialogMember);
  const members = useSelector(selectMembersEntities);
Severity: Minor
Found in frontend/src/features/member/MemberDialog.tsx - About 35 mins to fix

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

Severity
Category
Status
Source
Language