glitch-soc/mastodon

View on GitHub

Showing 1,231 of 4,614 total issues

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

  render () {
    const {
      status,
      media,
      extraMedia,
Severity: Major
Found in app/javascript/flavours/glitch/components/status_content.jsx - About 6 hrs to fix

    File notification.jsx has 419 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import PropTypes from 'prop-types';
    
    import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
    
    import classNames from 'classnames';

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

        render () {
          const { intl, multiColumn } = this.props;
      
          return (
            <Column>
      Severity: Major
      Found in app/javascript/mastodon/features/keyboard_shortcuts/index.jsx - About 6 hrs to fix

        File status_content.jsx has 414 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import PropTypes from 'prop-types';
        import { PureComponent } from 'react';
        
        import { FormattedMessage, injectIntl } from 'react-intl';
        
        
        Severity: Minor
        Found in app/javascript/flavours/glitch/components/status_content.jsx - About 5 hrs to fix

          Function Conversation has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

          export const Conversation = ({ conversation, scrollKey, onMoveUp, onMoveDown }) => {
            const id = conversation.get('id');
            const unread = conversation.get('unread');
            const lastStatusId = conversation.get('last_status');
            const accountIds = conversation.get('accounts');

          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

          Method purge has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

              def purge(*domains)
                domains            = domains.map { |domain| TagManager.instance.normalize_domain(domain) }
                account_scope      = Account.none
                domain_block_scope = DomainBlock.none
                emoji_scope        = CustomEmoji.none
          Severity: Minor
          Found in lib/mastodon/cli/domains.rb - About 5 hrs 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

          File migration_helpers.rb has 411 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Mastodon
            module MigrationHelpers
              class CorruptionError < StandardError
                attr_reader :index_name
          
          
          Severity: Minor
          Found in lib/mastodon/migration_helpers.rb - About 5 hrs to fix

            Function AutosuggestTextarea has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

            const AutosuggestTextarea = forwardRef(({
              value,
              suggestions,
              disabled,
              placeholder,
            Severity: Minor
            Found in app/javascript/flavours/glitch/components/autosuggest_textarea.jsx - About 5 hrs 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

            Function AutosuggestTextarea has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

            const AutosuggestTextarea = forwardRef(({
              value,
              suggestions,
              disabled,
              placeholder,
            Severity: Minor
            Found in app/javascript/mastodon/components/autosuggest_textarea.jsx - About 5 hrs 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

            File notification.jsx has 405 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import PropTypes from 'prop-types';
            
            import { injectIntl, FormattedMessage, defineMessages } from 'react-intl';
            
            import classNames from 'classnames';

              DoodleModal has 41 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class DoodleModal extends ImmutablePureComponent {
              
                static propTypes = {
                  options: ImmutablePropTypes.map,
                  onClose: PropTypes.func.isRequired,

                Function _updateStatusLinks has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                  _updateStatusLinks () {
                    const node = this.contentsNode;
                    const { tagLinks, rewriteMentions } = this.props;
                
                    if (!node) {
                Severity: Minor
                Found in app/javascript/flavours/glitch/components/status_content.jsx - About 5 hrs 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

                Video has 40 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Video extends PureComponent {
                
                  static propTypes = {
                    preview: PropTypes.string,
                    frameRate: PropTypes.string,
                Severity: Minor
                Found in app/javascript/flavours/glitch/features/video/index.jsx - About 5 hrs to fix

                  Video has 40 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Video extends PureComponent {
                  
                    static propTypes = {
                      preview: PropTypes.string,
                      frameRate: PropTypes.string,
                  Severity: Minor
                  Found in app/javascript/mastodon/features/video/index.jsx - About 5 hrs to fix

                    Function mapDispatchToProps has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
                    
                      onReply (status, router) {
                        dispatch((_, getState) => {
                          let state = getState();
                    Severity: Minor
                    Found in app/javascript/mastodon/containers/status_container.jsx - About 5 hrs 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

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

                      render () {
                        const { intl, notifications, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props;
                        const { notifCleaningActive } = this.props;
                        const { animatingNCD } = this.state;
                        const pinned = !!columnId;
                    Severity: Major
                    Found in app/javascript/flavours/glitch/features/notifications/index.jsx - About 5 hrs to fix

                      File public.tsx has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { createRoot } from 'react-dom/client';
                      
                      import '@/entrypoints/public-path';
                      
                      import { IntlMessageFormat } from 'intl-messageformat';
                      Severity: Minor
                      Found in app/javascript/flavours/glitch/entrypoints/public.tsx - About 5 hrs to fix

                        File public.tsx has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { createRoot } from 'react-dom/client';
                        
                        import './public-path';
                        
                        import { IntlMessageFormat } from 'intl-messageformat';
                        Severity: Minor
                        Found in app/javascript/entrypoints/public.tsx - About 5 hrs to fix

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

                            render () {
                              const { media, intl, account, onClose, isUploadingThumbnail, description, lang, focusX, focusY, dirty, is_changing_upload } = this.props;
                              const { dragging, detecting, progress, ocrStatus } = this.state;
                              const x = (focusX /  2) + .5;
                              const y = (focusY / -2) + .5;

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

                              render () {
                                const { media, intl, account, onClose, isUploadingThumbnail, description, lang, focusX, focusY, dirty, is_changing_upload } = this.props;
                                const { dragging, detecting, progress, ocrStatus } = this.state;
                                const x = (focusX /  2) + .5;
                                const y = (focusY / -2) + .5;
                            Severity: Major
                            Found in app/javascript/mastodon/features/ui/components/focal_point_modal.jsx - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language