Showing 8 of 160 total issues
Function reducers
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const reducers = (state = initialState, action) => {
switch (action.type) {
case SET_CURRENT_USER:
return {
...state,
Function useEvents
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useEvents = (
onSyncOffice,
onAddUser,
onRemoveUser,
onUserEnterMeeting,
File reducers.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
ADD_ERROR,
SET_CURRENT_USER,
SET_CURRENT_ROOM,
ADD_ROOMS,
Function LanguageSwitcher
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const LanguageSwitcher = () => {
const { t } = useTranslation();
const [anchorEl, setAnchorEl] = useState(null);
Function start
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
start() {
this.io.use((socket, next) => {
const serializedUser = socket.handshake.query.user;
try {
Function Login
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function Login() {
const [error, setError] = useState(null);
const isDark = isDarkTheme();
useEffect(() => {
Function useSocket
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useSocket = (
toggleLoading,
setLoggedIn,
onSetCurrentUser,
onSetCurrentRoom,
Function useEvents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
const useEvents = (
onSyncOffice,
onAddUser,
onRemoveUser,
onUserEnterMeeting,
- 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"