ResultadosDigitais/matrix

View on GitHub

Showing 8 of 160 total issues

Function reducers has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const reducers = (state = initialState, action) => {
  switch (action.type) {
    case SET_CURRENT_USER:
      return {
        ...state,
Severity: Major
Found in frontend/src/morpheus/store/reducers.js - About 5 hrs to fix

    Function useEvents has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const useEvents = (
      onSyncOffice,
      onAddUser,
      onRemoveUser,
      onUserEnterMeeting,
    Severity: Major
    Found in frontend/src/morpheus/hooks/useEvents.js - About 2 hrs to fix

      File reducers.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        ADD_ERROR,
        SET_CURRENT_USER,
        SET_CURRENT_ROOM,
        ADD_ROOMS,
      Severity: Minor
      Found in frontend/src/morpheus/store/reducers.js - About 2 hrs to fix

        Function LanguageSwitcher has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const LanguageSwitcher = () => {
          const { t } = useTranslation();
        
          const [anchorEl, setAnchorEl] = useState(null);
        
        
        Severity: Minor
        Found in frontend/src/components/LanguageSwitcher.js - About 1 hr to fix

          Function start has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            start() {
              this.io.use((socket, next) => {
                const serializedUser = socket.handshake.query.user;
          
                try {
          Severity: Minor
          Found in backend/app/office.socket.js - About 1 hr to fix

            Function Login has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function Login() {
              const [error, setError] = useState(null);
              const isDark = isDarkTheme();
            
              useEffect(() => {
            Severity: Minor
            Found in frontend/src/pages/login/login.js - About 1 hr to fix

              Function useSocket has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const useSocket = (
                toggleLoading,
                setLoggedIn,
                onSetCurrentUser,
                onSetCurrentRoom,
              Severity: Minor
              Found in frontend/src/morpheus/hooks/useSocket.js - About 1 hr to fix

                Function useEvents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                const useEvents = (
                  onSyncOffice,
                  onAddUser,
                  onRemoveUser,
                  onUserEnterMeeting,
                Severity: Minor
                Found in frontend/src/morpheus/hooks/useEvents.js - About 25 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