mashirozx/mastodon

View on GitHub

Showing 720 of 1,785 total issues

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

  render () {
    const { src, width, height, alt } = this.props;
    const { loading } = this.state;

    return (
Severity: Minor
Found in app/javascript/mastodon/components/gifv.js - About 1 hr to fix

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

    export function expandTimeline(timelineId, path, params = {}, done = noOp) {
      return (dispatch, getState) => {
        const timeline = getState().getIn(['timelines', timelineId], ImmutableMap());
        const isLoadingMore = !!params.max_id;
    
    
    Severity: Minor
    Found in app/javascript/mastodon/actions/timelines.js - About 1 hr to fix

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

        render () {
          const { value, intl } = this.props;
          const { open, placement } = this.state;
      
          const valueOption = this.options.find(item => item.value === value);

        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

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

          const expandNormalizedNotifications = (state, notifications, next, isLoadingRecent, usePendingItems) => {
            const lastReadId = state.get('lastReadId');
            let items = ImmutableList();
          
            notifications.forEach((n, i) => {
          Severity: Minor
          Found in app/javascript/mastodon/reducers/notifications.js - About 1 hr to fix

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

              render () {
                const { isPollMultiple, title, index, autoFocus, intl } = this.props;
            
                return (
                  <li>
            Severity: Minor
            Found in app/javascript/mastodon/features/compose/components/poll_form.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".to_sym
              
                    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

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

                  render () {
                    const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props;
                    const { suggestionsHidden } = this.state;
                
                    return (
                Severity: Minor
                Found in app/javascript/mastodon/components/autosuggest_input.js - About 1 hr to fix

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

                    onChange (path, checked) {
                      if (path[0] === 'push') {
                        if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
                          dispatch(requestBrowserPermission((permission) => {
                            if (permission === 'granted') {

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

                      renderVideo () {
                        const { card, intl }  = this.props;
                        const content   = { __html: this.addAutoPlay(card.get('html')) };
                        const { width } = this.state;
                        const ratio     = card.get('width') / card.get('height');
                    Severity: Minor
                    Found in app/javascript/mastodon/features/status/components/card.js - About 1 hr to fix

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

                        def update_count!(key, value)
                          raise ArgumentError, "Invalid key #{key}" unless ALLOWED_COUNTER_KEYS.include?(key)
                          raise ArgumentError, 'Do not call update_count! on dirty objects' if association(:account_stat).loaded? && account_stat&.changed? && account_stat.changed_attribute_names_to_save == %w(id)
                      
                          value = value.to_i
                      Severity: Minor
                      Found in app/models/concerns/account_counters.rb - About 1 hr to fix

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

                          def calculate_scores(preview_cards, at_time)
                            global_items = []
                            locale_items = Hash.new { |h, key| h[key] = [] }
                        
                            preview_cards.each do |preview_card|
                        Severity: Minor
                        Found in app/models/trends/links.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/mastodon/reducers/conversations.js - About 1 hr to fix

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

                                def klass
                                  case @json['type']
                                  when 'Create'
                                    ActivityPub::Activity::Create
                                  when 'Announce'
                            Severity: Minor
                            Found in app/lib/activitypub/activity.rb - About 1 hr to fix

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

                                def call(username, domain, json, options = {})
                                  return if json['inbox'].blank? || unsupported_uri_scheme?(json['id']) || domain_not_allowed?(domain)
                              
                                  @options     = options
                                  @json        = json
                              Severity: Minor
                              Found in app/services/activitypub/process_account_service.rb - About 1 hr to fix

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

                                  def process_update
                                    user.settings['notification_emails'] = merged_notification_emails if change?('notification_emails')
                                    user.settings['interactions']        = merged_interactions if change?('interactions')
                                    user.settings['default_privacy']     = default_privacy_preference if change?('setting_default_privacy')
                                    user.settings['default_sensitive']   = default_sensitive_preference if change?('setting_default_sensitive')
                                Severity: Minor
                                Found in app/lib/user_settings_decorator.rb - About 1 hr to fix

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

                                    def perform
                                      # Maintaining a materialized view speeds-up subsequent queries significantly
                                      AccountSummary.refresh
                                      FollowRecommendation.refresh
                                  
                                  
                                  Severity: Minor
                                  Found in app/workers/scheduler/follow_recommendations_scheduler.rb - About 1 hr to fix

                                    Function handleTranslationClick has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const handleTranslationClick = useCallback(async (event) => {
                                        event.preventDefault();
                                        const translationServiceEndpoint = '/translation/';
                                    
                                        if (hideTranslation && translation === undefined) {
                                    Severity: Minor
                                    Found in app/javascript/mastodon/components/status_translation.js - About 1 hr to fix

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

                                        render () {
                                          const { suggestions, isLoading } = this.props;
                                      
                                          return (
                                            <Column>
                                      Severity: Minor
                                      Found in app/javascript/mastodon/features/follow_recommendations/index.js - About 1 hr to fix

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

                                          render () {
                                            const { status, checked } = this.props;
                                        
                                            if (status.get('reblog')) {
                                              return null;
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language