mashirozx/mastodon

View on GitHub

Showing 1,785 of 1,785 total issues

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

  onToggleHidden (status) {
    if (status.get('hidden')) {
      dispatch(revealStatus(status.get('id')));
    } else {
      dispatch(hideStatus(status.get('id')));
app/javascript/mastodon/containers/status_container.js on lines 216..222
app/javascript/mastodon/containers/status_container.js on lines 224..230
app/javascript/mastodon/containers/status_container.js on lines 258..264
app/javascript/mastodon/features/direct_timeline/containers/conversation_container.js on lines 56..62
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 64..70
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 152..158
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 160..166
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 168..174

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 66.

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 9 locations. Consider refactoring.
Open

  onToggleHidden (status) {
    if (status.get('hidden')) {
      dispatch(revealStatus(status.get('id')));
    } else {
      dispatch(hideStatus(status.get('id')));
app/javascript/mastodon/containers/status_container.js on lines 216..222
app/javascript/mastodon/containers/status_container.js on lines 224..230
app/javascript/mastodon/containers/status_container.js on lines 258..264
app/javascript/mastodon/features/direct_timeline/containers/conversation_container.js on lines 56..62
app/javascript/mastodon/features/direct_timeline/containers/conversation_container.js on lines 64..70
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 152..158
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 160..166
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 168..174

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 66.

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 9 locations. Consider refactoring.
Open

  onMuteConversation (status) {
    if (status.get('muted')) {
      dispatch(unmuteStatus(status.get('id')));
    } else {
      dispatch(muteStatus(status.get('id')));
Severity: Major
Found in app/javascript/mastodon/containers/status_container.js and 8 other locations - About 1 hr to fix
app/javascript/mastodon/containers/status_container.js on lines 224..230
app/javascript/mastodon/containers/status_container.js on lines 258..264
app/javascript/mastodon/features/direct_timeline/containers/conversation_container.js on lines 56..62
app/javascript/mastodon/features/direct_timeline/containers/conversation_container.js on lines 64..70
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 64..70
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 152..158
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 160..166
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 168..174

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 66.

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        <div className={classNames} ref={this.setRef} tabIndex='0' onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
          <div className='status__content__text status__content__text--visible translate' lang={lang} dangerouslySetInnerHTML={content} />

          <StatusTranslation status={status} />

Severity: Major
Found in app/javascript/mastodon/components/status_content.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/components/status_content.js on lines 258..266

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 66.

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses?id=${status.get('id')}` });
app/javascript/mastodon/components/status_action_bar.js on lines 330..330

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 66.

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        <div className={classNames} ref={this.setRef} tabIndex='0' onMouseDown={this.handleMouseDown} onMouseUp={this.handleMouseUp} key='status-content' onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave}>
          <div className='status__content__text status__content__text--visible translate' lang={lang} dangerouslySetInnerHTML={content} />

          <StatusTranslation status={status} />

Severity: Major
Found in app/javascript/mastodon/components/status_content.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/components/status_content.js on lines 276..284

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 66.

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

Function connectStream has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const connectStream = (channelName, params, callbacks) => (dispatch, getState) => {
  const streamingAPIBaseURL = getState().getIn(['meta', 'streaming_api_base_url']);
  const accessToken = getState().getIn(['meta', 'access_token']);
  const { onConnect, onReceive, onDisconnect } = callbacks(dispatch, getState);

Severity: Minor
Found in app/javascript/mastodon/stream.js - About 1 hr to fix

    Function announcementsReducer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function announcementsReducer(state = initialState, action) {
      switch(action.type) {
      case ANNOUNCEMENTS_TOGGLE_SHOW:
        return state.withMutations(map => {
          map.set('show', !map.get('show'));
    Severity: Minor
    Found in app/javascript/mastodon/reducers/announcements.js - About 1 hr to fix

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

        render () {
          const { hasUnread, columnId, multiColumn, tag, intl } = this.props;
          const { id, local } = this.props.params;
          const pinned = !!columnId;
      
      
      Severity: Minor
      Found in app/javascript/mastodon/features/hashtag_timeline/index.js - About 1 hr to fix

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

          render () {
            const { draggingOver } = this.state;
            const { children, isComposing, location, dropdownMenuIsOpen, layout } = this.props;
        
            const handlers = {
        Severity: Minor
        Found in app/javascript/mastodon/features/ui/index.js - About 1 hr to fix

          Method merge_with! has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def merge_with!(other_account)
              # Since it's the same remote resource, the remote resource likely
              # already believes we are following/blocking, so it's safe to
              # re-attribute the relationships too. However, during the presence
              # of the index bug users could have *also* followed the reference
          Severity: Minor
          Found in app/models/concerns/account_merging.rb - About 1 hr to fix

            Method set_descendants has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def set_descendants
                @max_descendant_thread_id   = params[:max_descendant_thread_id]&.to_i
                @since_descendant_thread_id = params[:since_descendant_thread_id]&.to_i
            
                descendants = cache_collection(
            Severity: Minor
            Found in app/controllers/concerns/status_controller_concern.rb - About 1 hr to fix

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

                            <tr>
                              <td><kbd>e</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.open_media' defaultMessage='to open media' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>n</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.compose' defaultMessage='to focus the compose textarea' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>p</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.profile' defaultMessage="to open author's profile" /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>f</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.favourite' defaultMessage='to favourite' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>x</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.toggle_hidden' defaultMessage='to show/hide text behind CW' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>esc</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.unfocus' defaultMessage='to un-focus compose textarea/search' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>m</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 35..38
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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 13 locations. Consider refactoring.
              Open

                            <tr>
                              <td><kbd>r</kbd></td>
                              <td><FormattedMessage id='keyboard_shortcuts.reply' defaultMessage='to reply' /></td>
                            </tr>
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 39..42
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 43..46
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 47..50
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 51..54
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 59..62
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 67..70
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 83..86
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 95..98
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 99..102
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 103..106
              app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 155..158

              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 65.

              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