Showing 11 of 31 total issues
Function SignupForm
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SignupForm = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const { logIn } = useAuth();
const rollbar = useRollbar();
Function LoginForm
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LoginForm = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const { logIn } = useAuth();
const rollbar = useRollbar();
Function RenameChannelModal
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const RenameChannelModal = () => {
const { renameChannel } = useChatApi();
const dispatch = useDispatch();
const { t } = useTranslation();
const { handleClose } = modalActions;
Function DeleteChannelModal
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DeleteChannelModal = () => {
const { removeChannel } = useChatApi();
const [isSubmitting, setIsSubmitting] = useState(false);
const dispatch = useDispatch();
const { t } = useTranslation();
Function Chat
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Chat = () => {
const [isLoading, setIsLoading] = useState(true);
const { user, logOut } = useAuth();
const { t } = useTranslation();
Function LoginForm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const LoginForm = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const { logIn } = useAuth();
const rollbar = useRollbar();
- 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 SignupForm
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const SignupForm = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const { logIn } = useAuth();
const rollbar = useRollbar();
- 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 Sidebar
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Sidebar = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const [btnFocused, setBtnFocused] = useState(false);
const { type } = useSelector((state) => state.modal);
Function Login
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Login = () => {
const { t } = useTranslation();
return (
<Container fluid>
<Row className="justify-content-center align-items-center">
Function Main
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Main = () => {
const { t } = useTranslation();
const currentChannelId = useSelector((state) => state.channels.currentChannelId) || null;
const currentChannel = useSelector((state) => channelSelectors
.selectById(state, currentChannelId)) || null;
Function RenameChannelModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const RenameChannelModal = () => {
const { renameChannel } = useChatApi();
const dispatch = useDispatch();
const { t } = useTranslation();
const { handleClose } = modalActions;
- 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"