glitch-soc/mastodon

View on GitHub

Showing 1,230 of 4,529 total issues

File notifications.js has 557 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { IntlMessageFormat } from 'intl-messageformat';
import { defineMessages } from 'react-intl';

import { List as ImmutableList } from 'immutable';

Severity: Major
Found in app/javascript/flavours/glitch/actions/notifications.js - About 1 day to fix

    Class Account has 63 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Account < ApplicationRecord
      self.ignored_columns += %w(
        subscription_expires_at
        secret
        remote_url
    Severity: Major
    Found in app/models/account.rb - About 1 day to fix

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

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

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

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

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

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

            Class Status has 61 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Status < ApplicationRecord
              include Cacheable
              include Discard::Model
              include Paginable
              include RateLimitable
            Severity: Major
            Found in app/models/status.rb - About 1 day to fix

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

                render () {
                  const { account, hidden, intl } = this.props;
                  const { signedIn, permissions } = this.context.identity;
              
                  if (!account) {
              Severity: Major
              Found in app/javascript/mastodon/features/account/components/header.jsx - About 1 day to fix

                Function loaded has 211 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function loaded() {
                  const { messages: localeData } = getLocale();
                
                  const locale = document.documentElement.lang;
                
                
                Severity: Major
                Found in app/javascript/packs/public.tsx - About 1 day to fix

                  Function loaded has 211 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function loaded() {
                    const { messages: localeData } = getLocale();
                  
                    const locale = document.documentElement.lang;
                  
                  
                  Severity: Major
                  Found in app/javascript/flavours/glitch/packs/public.tsx - About 1 day to fix

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

                      render () {
                        const { status, intl } = this.props;
                        const { signedIn, permissions } = this.context.identity;
                    
                        const publicStatus       = ['public', 'unlisted'].includes(status.get('visibility'));

                    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 209 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render () {
                        const { intl, hidden, featured, unread, showThread, scrollKey, pictureInPicture, previousId, nextInReplyToId, rootId } = this.props;
                    
                        let { status, account, ...other } = this.props;
                    
                    
                    Severity: Major
                    Found in app/javascript/mastodon/components/status.jsx - About 1 day to fix

                      Class User has 58 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class User < ApplicationRecord
                        self.ignored_columns += %w(
                          remember_created_at
                          remember_token
                          current_sign_in_ip
                      Severity: Major
                      Found in app/models/user.rb - About 1 day to fix

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

                          render () {
                            const { account, hidden, intl } = this.props;
                            const { signedIn, permissions } = this.context.identity;
                        
                            if (!account) {
                        Severity: Major
                        Found in app/javascript/flavours/glitch/features/account/components/header.jsx - About 1 day to fix

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

                          import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
                          
                          import {
                            COMPOSE_MOUNT,
                            COMPOSE_UNMOUNT,
                          Severity: Major
                          Found in app/javascript/mastodon/reducers/compose.js - About 1 day to fix

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

                            //  Package imports
                            import PropTypes from 'prop-types';
                            import { PureComponent } from 'react';
                            
                            import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
                            Severity: Minor
                            Found in app/javascript/flavours/glitch/features/local_settings/page/index.jsx - About 7 hrs to fix

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

                              import PropTypes from 'prop-types';
                              import { PureComponent } from 'react';
                              
                              import { defineMessages, injectIntl } from 'react-intl';
                              
                              
                              Severity: Minor
                              Found in app/javascript/mastodon/features/ui/index.jsx - About 7 hrs to fix

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

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

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

                                  import PropTypes from 'prop-types';
                                  
                                  import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
                                  
                                  import classNames from 'classnames';
                                  Severity: Minor
                                  Found in app/javascript/mastodon/components/status.jsx - About 7 hrs to fix

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

                                    import PropTypes from 'prop-types';
                                    import { PureComponent } from 'react';
                                    
                                    import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
                                    
                                    
                                    Severity: Minor
                                    Found in app/javascript/mastodon/features/audio/index.jsx - About 7 hrs to fix

                                      File notifications.js has 484 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import { IntlMessageFormat } from 'intl-messageformat';
                                      import { defineMessages } from 'react-intl';
                                      
                                      import { List as ImmutableList } from 'immutable';
                                      
                                      
                                      Severity: Minor
                                      Found in app/javascript/mastodon/actions/notifications.js - About 7 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language