glitch-soc/mastodon

View on GitHub

Showing 1,278 of 4,906 total issues

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

  render () {
    const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props;
    const pinned = !!columnId;

    const emptyMessage = <FormattedMessage id='empty_column.bookmarked_statuses' defaultMessage="You don't have any bookmarked posts yet. When you bookmark one, it will show up here." />;
Severity: Minor
Found in app/javascript/mastodon/features/bookmarked_statuses/index.jsx - About 1 hr to fix

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

      render () {
        const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props;
        const pinned = !!columnId;
    
        const emptyMessage = <FormattedMessage id='empty_column.favourited_statuses' defaultMessage="You don't have any favorite posts yet. When you favorite one, it will show up here." />;
    Severity: Minor
    Found in app/javascript/mastodon/features/favourited_statuses/index.jsx - About 1 hr to fix

      Function configFromEnv has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function configFromEnv(env) {
        const redisNamespace = env.REDIS_NAMESPACE;
      
        // These options apply for both REDIS_URL based connections and connections
        // using the other REDIS_* environment variables:
      Severity: Minor
      Found in streaming/redis.js - About 1 hr to fix

        Function ReplyIndicator has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const ReplyIndicator = () => {
          const inReplyToId = useSelector(state => state.getIn(['compose', 'in_reply_to']));
          const status = useSelector(state => state.getIn(['statuses', inReplyToId]));
          const account = useSelector(state => state.getIn(['accounts', status?.get('account')]));
        
        

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

            render () {
              const { notification } = this.props;
              const account          = notification.get('account');
              const displayNameHtml  = { __html: account.get('display_name_html') };
              const link             = <bdi><Link className='notification__display-name' href={`/@${account.get('acct')}`} title={account.get('acct')} data-hover-card-account={account.get('id')} to={`/@${account.get('acct')}`} dangerouslySetInnerHTML={displayNameHtml} /></bdi>;

            Function ActionBar has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const ActionBar = () => {
              const dispatch = useDispatch();
              const intl = useIntl();
            
              const handleLogoutClick = useCallback(() => {
            Severity: Minor
            Found in app/javascript/mastodon/features/compose/components/action_bar.jsx - About 1 hr to fix

              Function push_subscriptions has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function push_subscriptions(state = initialState, action) {
                switch(action.type) {
                case STORE_HYDRATE: {
                  const push_subscription = action.state.get('push_subscription');
              
              
              Severity: Minor
              Found in app/javascript/mastodon/reducers/push_notifications.js - About 1 hr to fix

                Method remotable_attachment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def remotable_attachment(attachment_name, limit, suppress_errors: true, download_on_assign: true, attribute_name: nil)
                      attribute_name ||= :"#{attachment_name}_remote_url"
                
                      define_method(:"download_#{attachment_name}!") do |url = nil|
                        url ||= self[attribute_name]
                Severity: Minor
                Found in app/models/concerns/remotable.rb - About 1 hr to fix

                  Method elastic_search_query has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def elastic_search_query
                      {
                        function_score: {
                          query: {
                            multi_match: {
                  Severity: Minor
                  Found in app/services/tag_search_service.rb - About 1 hr to fix

                    Method reset_relationships has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def reset_relationships(username)
                          fail_with_message 'Please specify either --follows or --followers, or both' unless options[:follows] || options[:followers]
                    
                          account = Account.find_local(username)
                    
                    
                    Severity: Minor
                    Found in lib/mastodon/cli/accounts.rb - About 1 hr to fix

                      Function conversations has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function conversations(state = initialState, action) {
                        switch (action.type) {
                        case CONVERSATIONS_FETCH_REQUEST:
                          return state.set('isLoading', true);
                        case CONVERSATIONS_FETCH_FAIL:
                      Severity: Minor
                      Found in app/javascript/flavours/glitch/reducers/conversations.js - About 1 hr to fix

                        Function SensitiveButton has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const SensitiveButton = () => {
                          const intl = useIntl();
                        
                          const spoilersAlwaysOn = useAppSelector((state) => state.local_settings.getIn(['always_show_spoilers_field']));
                          const spoilerText = useAppSelector((state) => state.compose.get('spoiler_text'));

                          Function scrollableContent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                statusIds.map((statusId, index) => {
                                  switch(statusId) {
                                  case TIMELINE_SUGGESTIONS:
                                    return (
                                      <InlineFollowSuggestions
                          Severity: Minor
                          Found in app/javascript/mastodon/components/status_list.jsx - About 1 hr to fix

                            Function conversations has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function conversations(state = initialState, action) {
                              switch (action.type) {
                              case CONVERSATIONS_FETCH_REQUEST:
                                return state.set('isLoading', true);
                              case CONVERSATIONS_FETCH_FAIL:
                            Severity: Minor
                            Found in app/javascript/mastodon/reducers/conversations.js - About 1 hr to fix

                              Method from_notifications has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def self.from_notifications(notifications, pagination_range: nil, grouped_types: nil)
                                  return [] if notifications.empty?
                              
                                  grouped_types = grouped_types.presence&.map(&:to_sym) || Notification::GROUPABLE_NOTIFICATION_TYPES
                              
                              
                              Severity: Minor
                              Found in app/models/notification_group.rb - About 1 hr to fix

                                Method process_attachments has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def process_attachments
                                    return [] if @object['attachment'].nil?
                                
                                    media_attachments = []
                                
                                
                                Severity: Minor
                                Found in app/lib/activitypub/activity/create.rb - About 1 hr to fix

                                  Method build_status_translation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def build_status_translation(translations)
                                      status_translation = Translation.new(
                                        detected_source_language: translations.first&.detected_source_language,
                                        language: @target_language,
                                        provider: translations.first&.provider,
                                  Severity: Minor
                                  Found in app/services/translate_status_service.rb - About 1 hr to fix

                                    Method make has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def make
                                          return File.open(@file.path) unless needs_convert?
                                    
                                          dst = TempfileFactory.new.generate([@basename, @format ? ".#{@format}" : @current_format].join)
                                    
                                    
                                    Severity: Minor
                                    Found in lib/paperclip/vips_lazy_thumbnail.rb - About 1 hr to fix

                                      Function handleKeyDown has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          (e: React.KeyboardEvent) => {
                                            const selectedOptionValue = options[selectedOption];
                                      
                                            switch (e.key) {
                                              case 'ArrowDown':
                                      Severity: Minor
                                      Found in app/javascript/flavours/glitch/features/interaction_modal/index.tsx - About 1 hr to fix

                                        Function handleKeyDown has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            (e: React.KeyboardEvent) => {
                                              const selectedOptionValue = options[selectedOption];
                                        
                                              switch (e.key) {
                                                case 'ArrowDown':
                                        Severity: Minor
                                        Found in app/javascript/mastodon/features/interaction_modal/index.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language