glitch-soc/mastodon

View on GitHub

Showing 1,294 of 4,908 total issues

Function AccountHeader has a Cognitive Complexity of 160 (exceeds 5 allowed). Consider refactoring.
Open

}> = ({ accountId, hideTabs }) => {
const dispatch = useAppDispatch();
const intl = useIntl();
const { signedIn, permissions } = useIdentity();
const account = useAppSelector((state) => state.accounts.get(accountId));

Function AccountHeader has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
Open

}> = ({ accountId, hideTabs }) => {
const dispatch = useAppDispatch();
const intl = useIntl();
const { signedIn, permissions } = useIdentity();
const account = useAppSelector((state) => state.accounts.get(accountId));

File account_header.tsx has 957 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { useCallback, useMemo } from 'react';
 
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
 
import classNames from 'classnames';

    File account_header.tsx has 939 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { useCallback, useMemo } from 'react';
     
    import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
     
    import classNames from 'classnames';

      File compose.js has 721 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { defineMessages } from 'react-intl';
       
      import axios from 'axios';
      import { throttle } from 'lodash';
       
       
      Severity: Major
      Found in app/javascript/flavours/glitch/actions/compose.js - About 1 day to fix

        Function Search has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

        }> = ({ singleColumn, initialValue }) => {
        const intl = useIntl();
        const recent = useAppSelector((state) => state.search.recent);
        const { signedIn } = useIdentity();
        const dispatch = useAppDispatch();
        Severity: Minor
        Found in app/javascript/flavours/glitch/features/compose/components/search.tsx - About 1 day to fix

        Function Search has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
        Open

        }> = ({ singleColumn, initialValue }) => {
        const intl = useIntl();
        const recent = useAppSelector((state) => state.search.recent);
        const { signedIn } = useIdentity();
        const dispatch = useAppDispatch();
        Severity: Minor
        Found in app/javascript/mastodon/features/compose/components/search.tsx - About 1 day to fix

        File compose.js has 688 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { defineMessages } from 'react-intl';
         
        import axios from 'axios';
        import { throttle } from 'lodash';
         
         
        Severity: Major
        Found in app/javascript/mastodon/actions/compose.js - About 1 day to fix

          File index.jsx has 633 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import PropTypes from 'prop-types';
           
          import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
           
          import classNames from 'classnames';
          Severity: Major
          Found in app/javascript/flavours/glitch/features/status/index.jsx - About 1 day to fix

            File maintenance.rb has 626 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require_relative 'base'
             
            module Mastodon::CLI
            class Maintenance < Base
            MIN_SUPPORTED_VERSION = 2019_10_01_213028
            Severity: Major
            Found in lib/mastodon/cli/maintenance.rb - About 1 day to fix

              Function render has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
              Open

              render () {
              const { status, relationship, intl, withDismiss, withCounters, scrollKey } = this.props;
              const { signedIn, permissions } = this.props.identity;
               
              const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
              Severity: Minor
              Found in app/javascript/mastodon/components/status_action_bar.jsx - About 1 day to fix

              Method remove_orphans has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
              Open

              def remove_orphans
              progress = create_progress_bar(nil)
              reclaimed_bytes = 0
              removed = 0
              prefix = options[:prefix]
              Severity: Minor
              Found in lib/mastodon/cli/media.rb - About 1 day to fix

              Function composeReducer has 272 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const composeReducer = (state = initialState, action) => {
              if (changeUploadCompose.fulfilled.match(action)) {
              return state
              .set('is_changing_upload', false)
              .update('media_attachments', list => list.map(item => {
              Severity: Major
              Found in app/javascript/flavours/glitch/reducers/compose.js - About 1 day to fix

                File status.jsx has 608 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import PropTypes from 'prop-types';
                 
                import { injectIntl, FormattedMessage } from 'react-intl';
                 
                import classNames from 'classnames';
                Severity: Major
                Found in app/javascript/flavours/glitch/components/status.jsx - About 1 day to fix

                  File index.jsx has 608 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import PropTypes from 'prop-types';
                   
                  import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
                   
                  import classNames from 'classnames';
                  Severity: Major
                  Found in app/javascript/mastodon/features/status/index.jsx - About 1 day to fix

                    Function search has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function search(value, { emojisToShowFilter, maxResults, include, exclude, custom } = {}) {
                    if (custom !== undefined) {
                    if (customEmojisList !== custom)
                    addCustomToPool(custom, originalPool);
                    } else {

                    Function search has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function search(value, { emojisToShowFilter, maxResults, include, exclude, custom } = {}) {
                    if (custom !== undefined) {
                    if (customEmojisList !== custom)
                    addCustomToPool(custom, originalPool);
                    } else {
                    Severity: Minor
                    Found in app/javascript/mastodon/features/emoji/emoji_mart_search_light.js - About 1 day to fix

                    Function render has 261 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    render () {
                    const { intl, hidden, featured, unfocusable, unread, pictureInPicture, previousId, nextInReplyToId, rootId, skipPrepend, avatarSize = 46 } = this.props;
                     
                    const {
                    status,
                    Severity: Major
                    Found in app/javascript/flavours/glitch/components/status.jsx - About 1 day to fix

                      File compose.js has 599 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
                       
                      import { changeUploadCompose } from 'flavours/glitch/actions/compose_typed';
                      import { timelineDelete } from 'flavours/glitch/actions/timelines_typed';
                       
                       
                      Severity: Major
                      Found in app/javascript/flavours/glitch/reducers/compose.js - About 1 day to fix

                        Function render has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                        Open

                        render () {
                        const { status, relationship, intl } = this.props;
                        const { signedIn, permissions } = this.props.identity;
                         
                        const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));
                        Severity: Minor
                        Found in app/javascript/mastodon/features/status/components/action_bar.jsx - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language