mashirozx/mastodon

View on GitHub

Showing 1,785 of 1,785 total issues

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

        <button
          className={selectedFilter === 'poll' ? 'active' : ''}
          onClick={this.onClick('poll')}
          title={intl.formatMessage(tooltips.polls)}
        >
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 63..69
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 70..76
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 77..83
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 91..97
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 98..104

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

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

        <button
          className={selectedFilter === 'favourite' ? 'active' : ''}
          onClick={this.onClick('favourite')}
          title={intl.formatMessage(tooltips.favourites)}
        >
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 63..69
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 77..83
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 84..90
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 91..97
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 98..104

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

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

        <button
          className={selectedFilter === 'follow' ? 'active' : ''}
          onClick={this.onClick('follow')}
          title={intl.formatMessage(tooltips.follows)}
        >
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 63..69
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 70..76
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 77..83
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 84..90
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 91..97

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

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

        <button
          className={selectedFilter === 'reblog' ? 'active' : ''}
          onClick={this.onClick('reblog')}
          title={intl.formatMessage(tooltips.boosts)}
        >
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 63..69
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 70..76
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 84..90
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 91..97
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 98..104

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

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

          <Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/@${account.get('acct')}`}>
            <div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>
            <DisplayName account={account} />
          </Permalink>
app/javascript/mastodon/components/account.js on lines 128..132

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

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

        <button
          className={selectedFilter === 'status' ? 'active' : ''}
          onClick={this.onClick('status')}
          title={intl.formatMessage(tooltips.statuses)}
        >
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 63..69
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 70..76
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 77..83
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 84..90
app/javascript/mastodon/features/notifications/components/filter_bar.js on lines 98..104

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

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

          <Permalink key={account.get('id')} className='account__display-name' title={account.get('acct')} href={account.get('url')} to={`/@${account.get('acct')}`}>
            <div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div>
            {mute_expires_at}
            <DisplayName account={account} />
          </Permalink>
Severity: Major
Found in app/javascript/mastodon/components/account.js and 1 other location - About 2 hrs to fix
app/javascript/mastodon/features/notifications/components/follow_request.js on lines 45..48

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

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

  seekBy (time) {
    const currentTime = this.video.currentTime + time;

    if (!isNaN(currentTime)) {
      this.setState({ currentTime }, () => {
Severity: Major
Found in app/javascript/mastodon/features/video/index.js and 1 other location - About 2 hrs to fix
app/javascript/mastodon/features/audio/index.js on lines 414..422

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

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

  seekBy (time) {
    const currentTime = this.audio.currentTime + time;

    if (!isNaN(currentTime)) {
      this.setState({ currentTime }, () => {
Severity: Major
Found in app/javascript/mastodon/features/audio/index.js and 1 other location - About 2 hrs to fix
app/javascript/mastodon/features/video/index.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 79.

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

        <Button secondary onClick={this.handleMuteClick}>{!account.getIn(['relationship', 'muting']) ? <FormattedMessage id='report.mute' defaultMessage='Mute' /> : <FormattedMessage id='account.muted' defaultMessage='Muted' />}</Button>
Severity: Major
Found in app/javascript/mastodon/features/report/thanks.js and 1 other location - About 2 hrs to fix
app/javascript/mastodon/features/report/thanks.js on lines 73..73

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

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

        <Button secondary onClick={this.handleBlockClick}>{!account.getIn(['relationship', 'blocking']) ? <FormattedMessage id='report.block' defaultMessage='Block' /> : <FormattedMessage id='account.blocked' defaultMessage='Blocked' />}</Button>
Severity: Major
Found in app/javascript/mastodon/features/report/thanks.js and 1 other location - About 2 hrs to fix
app/javascript/mastodon/features/report/thanks.js on lines 67..67

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

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

ActionBar has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

export default @connect(mapStateToProps)
@injectIntl
class ActionBar extends React.PureComponent {

  static contextTypes = {
Severity: Minor
Found in app/javascript/mastodon/features/status/components/action_bar.js - About 2 hrs to fix

    Class AccountsController has 21 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class AccountsController < ApplicationController
      PAGE_SIZE     = 20
      PAGE_SIZE_MAX = 200
    
      include AccountControllerConcern
    Severity: Minor
    Found in app/controllers/accounts_controller.rb - About 2 hrs to fix

      Class BaseMeasure has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Admin::Metrics::Measure::BaseMeasure
        CACHE_TTL = 5.minutes.freeze
      
        def self.with_params?
          false
      Severity: Minor
      Found in app/lib/admin/metrics/measure/base_measure.rb - About 2 hrs to fix

        Method open has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def open(host, *args)
                outer_e = nil
                port    = args.first
        
                addresses = []
        Severity: Major
        Found in app/lib/request.rb - About 2 hrs to fix

          Method deploy has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def deploy
                if options[:concurrency] < 1
                  say('Cannot run with this concurrency setting, must be at least 1', :red)
                  exit(1)
                end
          Severity: Major
          Found in lib/mastodon/search_cli.rb - About 2 hrs to fix

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

                          <tr>
                            <td><kbd>alt</kbd>+<kbd>x</kbd></td>
                            <td><FormattedMessage id='keyboard_shortcuts.spoilers' defaultMessage='to show/hide CW field' /></td>
                          </tr>
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 55..58
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 71..74
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 75..78
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 79..82
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 87..90
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 107..110
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 111..114
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 115..118
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 119..122
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 123..126
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 127..130
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 131..134
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 135..138
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 139..142
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 143..146
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 147..150
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 151..154

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

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

                          <tr>
                            <td><kbd>down</kbd>, <kbd>j</kbd></td>
                            <td><FormattedMessage id='keyboard_shortcuts.down' defaultMessage='to move down in the list' /></td>
                          </tr>
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 55..58
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 71..74
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 79..82
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 87..90
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 91..94
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 107..110
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 111..114
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 115..118
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 119..122
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 123..126
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 127..130
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 131..134
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 135..138
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 139..142
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 143..146
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 147..150
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 151..154

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

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

                          <tr>
                            <td><kbd>enter</kbd>, <kbd>o</kbd></td>
                            <td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
                          </tr>
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 71..74
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 75..78
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 79..82
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 87..90
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 91..94
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 107..110
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 111..114
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 115..118
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 119..122
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 123..126
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 127..130
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 131..134
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 135..138
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 139..142
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 143..146
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 147..150
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 151..154

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

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

                          <tr>
                            <td><kbd>g</kbd>+<kbd>t</kbd></td>
                            <td><FormattedMessage id='keyboard_shortcuts.federated' defaultMessage='to open federated timeline' /></td>
                          </tr>
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 55..58
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 71..74
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 75..78
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 79..82
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 87..90
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 91..94
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 107..110
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 111..114
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 115..118
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 123..126
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 127..130
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 131..134
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 135..138
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 139..142
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 143..146
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 147..150
            app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 151..154

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

            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