glitch-soc/mastodon

View on GitHub

Showing 4,938 of 4,938 total issues

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

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

    const className = classNames('image-loader', {
Severity: Minor
Found in app/javascript/mastodon/features/ui/components/image_loader.jsx - About 1 hr to fix

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

      render () {
        const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis } = this.props;
        const title = intl.formatMessage(messages.emoji);
        const { active, loading, placement } = this.state;
    
    

      Function settings has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function onChange has 33 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') {

          Method attempt_oembed has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def attempt_oembed
              service         = FetchOEmbedService.new
              url_domain      = Addressable::URI.parse(@url).normalized_host
              cached_endpoint = Rails.cache.read("oembed_endpoint:#{url_domain}")
          
          
          Severity: Minor
          Found in app/services/fetch_link_card_service.rb - About 1 hr to fix

            Method create has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def create(username)
                  role_id  = nil
            
                  if options[:role]
                    role = UserRole.find_by(name: options[:role])
            Severity: Minor
            Found in lib/mastodon/cli/accounts.rb - About 1 hr to fix

              Method parallelize_with_progress has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def parallelize_with_progress(scope)
                    fail_with_message 'Cannot run with this concurrency setting, must be at least 1' if options[:concurrency] < 1
              
                    reset_connection_pools!
              
              
              Severity: Minor
              Found in lib/mastodon/cli/progress_helper.rb - About 1 hr to fix

                Function handleContentRef has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    (node: HTMLDivElement | null) => {
                      if (!node) {
                        return;
                      }
                
                

                  Function handleContentRef has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      (node: HTMLDivElement | null) => {
                        if (!node) {
                          return;
                        }
                  
                  

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 267..267
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 268..268
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 196..196
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 197..197
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 198..198
                    app/javascript/mastodon/features/status/components/action_bar.jsx on lines 250..250

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 268..268
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 269..269
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 196..196
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 197..197
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 198..198
                    app/javascript/mastodon/features/status/components/action_bar.jsx on lines 250..250

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 267..267
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 269..269
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 196..196
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 197..197
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 198..198
                    app/javascript/mastodon/features/status/components/action_bar.jsx on lines 250..250

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 267..267
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 268..268
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 269..269
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 196..196
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 198..198
                    app/javascript/mastodon/features/status/components/action_bar.jsx on lines 250..250

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 267..267
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 268..268
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 269..269
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 196..196
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 197..197
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 198..198

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 267..267
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 268..268
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 269..269
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 196..196
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 197..197
                    app/javascript/mastodon/features/status/components/action_bar.jsx on lines 250..250

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 7 locations. Consider refactoring.
                    Open

                            menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick, dangerous: true });
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 267..267
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 268..268
                    app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 269..269
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 197..197
                    app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 198..198
                    app/javascript/mastodon/features/status/components/action_bar.jsx on lines 250..250

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const mapStateToProps = state => ({
                      statusIds: getStatusList(state, 'bookmarks'),
                      isLoading: state.getIn(['status_lists', 'bookmarks', 'isLoading'], true),
                      hasMore: !!state.getIn(['status_lists', 'bookmarks', 'next']),
                    });
                    app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx on lines 25..29
                    app/javascript/flavours/glitch/features/explore/statuses.jsx on lines 20..24
                    app/javascript/flavours/glitch/features/favourited_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/explore/statuses.jsx on lines 20..24
                    app/javascript/mastodon/features/favourited_statuses/index.jsx on lines 25..29

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const mapStateToProps = state => ({
                      statusIds: getStatusList(state, 'bookmarks'),
                      isLoading: state.getIn(['status_lists', 'bookmarks', 'isLoading'], true),
                      hasMore: !!state.getIn(['status_lists', 'bookmarks', 'next']),
                    });
                    app/javascript/flavours/glitch/features/explore/statuses.jsx on lines 20..24
                    app/javascript/flavours/glitch/features/favourited_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/bookmarked_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/explore/statuses.jsx on lines 20..24
                    app/javascript/mastodon/features/favourited_statuses/index.jsx on lines 25..29

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const mapStateToProps = state => ({
                      statusIds: getStatusList(state, 'trending'),
                      isLoading: state.getIn(['status_lists', 'trending', 'isLoading'], true),
                      hasMore: !!state.getIn(['status_lists', 'trending', 'next']),
                    });
                    app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx on lines 25..29
                    app/javascript/flavours/glitch/features/favourited_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/bookmarked_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/explore/statuses.jsx on lines 20..24
                    app/javascript/mastodon/features/favourited_statuses/index.jsx on lines 25..29

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 6 locations. Consider refactoring.
                    Open

                    const mapStateToProps = state => ({
                      statusIds: getStatusList(state, 'favourites'),
                      isLoading: state.getIn(['status_lists', 'favourites', 'isLoading'], true),
                      hasMore: !!state.getIn(['status_lists', 'favourites', 'next']),
                    });
                    app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx on lines 25..29
                    app/javascript/flavours/glitch/features/explore/statuses.jsx on lines 20..24
                    app/javascript/flavours/glitch/features/favourited_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/bookmarked_statuses/index.jsx on lines 25..29
                    app/javascript/mastodon/features/explore/statuses.jsx on lines 20..24

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 61.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language