Showing 12 of 21 total issues
Function SignUpPage
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SignUpPage = () => {
const auth = useAuth();
const inputRef = useRef();
const navigate = useNavigate();
const { t } = useTranslation();
Function LoginPage
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LoginPage = () => {
const auth = useAuth();
const inputRef = useRef();
const navigate = useNavigate();
const { t } = useTranslation();
Function ChannelModal
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ChannelModal = (props) => {
const { handleClose } = props;
const socket = useSocket();
const { t } = useTranslation();
const inputRef = useRef();
Function SignUpPage
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
const SignUpPage = () => {
const auth = useAuth();
const inputRef = useRef();
const navigate = useNavigate();
const { t } = useTranslation();
- 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 ModalRenameChannel
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ModalRenameChannel = (props) => {
const { handleClose } = props;
const socket = useSocket();
const inputRef = useRef();
const { t } = useTranslation();
Function MessageForm
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const MessageForm = () => {
const inputRef = useRef();
const { t } = useTranslation();
const socket = useSocket();
const activeChannelId = useSelector((state) => {
Function ChatPage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ChatPage = () => {
const auth = useAuth();
const dispatch = useDispatch();
const { t } = useTranslation();
Function App
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const App = () => {
const ruDictionary = leoProfanity.getDictionary('ru');
leoProfanity.loadDictionary(ruDictionary);
const socket = io();
const dispatch = useDispatch();
Function Channels
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Channels = () => {
const dispatch = useDispatch();
const channels = useSelector(channelsSelectors.selectAll);
const activeChannelId = useSelector((state) => {
const { currentChannelId } = state.channels;
Function ModalDeleteChannel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ModalDeleteChannel = (props) => {
const { handleClose } = props;
const socket = useSocket();
const dispatch = useDispatch();
const { t } = useTranslation();
Function DropdownChannel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DropdownChannel = (props) => {
const { item, activeChannelId, handleClick } = props;
const { t } = useTranslation();
const dispatch = useDispatch();
Function LoginPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
const LoginPage = () => {
const auth = useAuth();
const inputRef = useRef();
const navigate = useNavigate();
const { t } = useTranslation();
- 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"