glitch-soc/mastodon

View on GitHub

Showing 3,648 of 4,938 total issues

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

              <tr>
                <td><kbd>m</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td>
              </tr>
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 55..58
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 79..82
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 83..86
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 121..124
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 133..136
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 137..140
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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

              <tr>
                <td><kbd>m</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td>
              </tr>
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 79..82
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 83..86
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 121..124
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 133..136
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 137..140
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 49..52
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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 25 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/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 55..58
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 83..86
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 121..124
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 133..136
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 137..140
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 49..52
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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 25 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/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 55..58
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 79..82
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 83..86
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 121..124
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 137..140
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 49..52
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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 25 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/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 55..58
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 79..82
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 121..124
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 133..136
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 137..140
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 49..52
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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

              <tr>
                <td><kbd>backspace</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></td>
              </tr>
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 55..58
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 79..82
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 83..86
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 133..136
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 137..140
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 49..52
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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

              <tr>
                <td><kbd>?</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></td>
              </tr>
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 51..54
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 55..58
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 59..62
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 63..66
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 67..70
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 71..74
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 79..82
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 83..86
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 87..90
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 109..112
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 121..124
app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx on lines 133..136
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 45..48
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 49..52
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 53..56
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 57..60
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 61..64
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 69..72
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 73..76
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 77..80
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 93..96
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 105..108
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 113..116
app/javascript/mastodon/features/keyboard_shortcuts/index.jsx on lines 165..168

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

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

  case NOTIFICATIONS_LOAD_PENDING:
    return state.update('items', list => state.get('pendingItems').concat(list.take(40))).set('pendingItems', ImmutableList()).set('unread', 0);
Severity: Major
Found in app/javascript/mastodon/reducers/notifications.js and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/reducers/notifications.js on lines 310..311

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

  componentDidMount () {
    if (this.props.bindToDocument) {
      document.addEventListener('wheel', this.handleWheel, listenerOptions);
    } else {
      this.node.addEventListener('wheel', this.handleWheel, listenerOptions);
Severity: Major
Found in app/javascript/flavours/glitch/components/column.jsx and 3 other locations - About 1 hr to fix
app/javascript/flavours/glitch/components/column.jsx on lines 55..61
app/javascript/mastodon/components/column.jsx on lines 46..52
app/javascript/mastodon/components/column.jsx on lines 54..60

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

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

    if (showTrends) {
      navItems.push(<ColumnLink key='explore' icon='explore' iconComponent={ExploreIcon} text={intl.formatMessage(messages.explore)} to='/explore' />);
    }
app/javascript/mastodon/features/getting_started/index.jsx on lines 115..119

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

  it('renders class="button--block" if props.block given', () => {
    const component = renderer.create(<Button block />);
    const tree      = component.toJSON();

    expect(tree).toMatchSnapshot();
app/javascript/mastodon/components/__tests__/button-test.jsx on lines 39..44
app/javascript/mastodon/components/__tests__/button-test.jsx on lines 70..75

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

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

export const initReport = (account, status) => dispatch =>
  dispatch(openModal({
    modalType: 'REPORT',
    modalProps: {
      accountId: account.get('id'),
Severity: Major
Found in app/javascript/mastodon/actions/reports.js and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/actions/reports.js on lines 9..16

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

  it('adds class "button-secondary" if props.secondary given', () => {
    const component = renderer.create(<Button secondary />);
    const tree      = component.toJSON();

    expect(tree).toMatchSnapshot();
app/javascript/mastodon/components/__tests__/button-test.jsx on lines 39..44
app/javascript/mastodon/components/__tests__/button-test.jsx on lines 63..68

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

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

export const initReport = (account, status) => dispatch =>
  dispatch(openModal({
    modalType: 'REPORT',
    modalProps: {
      accountId: account.get('id'),
Severity: Major
Found in app/javascript/flavours/glitch/actions/reports.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/actions/reports.js on lines 9..16

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

  componentWillUnmount () {
    if (this.props.bindToDocument) {
      document.removeEventListener('wheel', this.handleWheel, listenerOptions);
    } else {
      this.node.removeEventListener('wheel', this.handleWheel, listenerOptions);
Severity: Major
Found in app/javascript/flavours/glitch/components/column.jsx and 3 other locations - About 1 hr to fix
app/javascript/flavours/glitch/components/column.jsx on lines 47..53
app/javascript/mastodon/components/column.jsx on lines 46..52
app/javascript/mastodon/components/column.jsx on lines 54..60

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

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

export default function statuses(state = initialState, action) {
  switch(action.type) {
  case HEIGHT_CACHE_SET:
    return setHeight(state, action.key, action.id, action.height);
  case HEIGHT_CACHE_CLEAR:
Severity: Major
Found in app/javascript/mastodon/reducers/height_cache.js and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/reducers/height_cache.js on lines 15..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 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 3 locations. Consider refactoring.
Open

  it('renders a disabled attribute if props.disabled given', () => {
    const component = renderer.create(<Button disabled />);
    const tree      = component.toJSON();

    expect(tree).toMatchSnapshot();
app/javascript/mastodon/components/__tests__/button-test.jsx on lines 63..68
app/javascript/mastodon/components/__tests__/button-test.jsx on lines 70..75

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

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

    if (showTrends) {
      navItems.push(
        <ColumnLink key='explore' icon='explore' iconComponent={ExploreIcon} text={intl.formatMessage(messages.explore)} to='/explore' />,
      );
    }
Severity: Major
Found in app/javascript/mastodon/features/getting_started/index.jsx and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/features/getting_started/index.jsx on lines 160..162

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

  componentDidMount () {
    if (this.props.bindToDocument) {
      document.addEventListener('wheel', this.handleWheel, listenerOptions);
    } else {
      this.node.addEventListener('wheel', this.handleWheel, listenerOptions);
Severity: Major
Found in app/javascript/mastodon/components/column.jsx and 3 other locations - About 1 hr to fix
app/javascript/flavours/glitch/components/column.jsx on lines 47..53
app/javascript/flavours/glitch/components/column.jsx on lines 55..61
app/javascript/mastodon/components/column.jsx on lines 54..60

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

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

export default function statuses(state = initialState, action) {
  switch(action.type) {
  case HEIGHT_CACHE_SET:
    return setHeight(state, action.key, action.id, action.height);
  case HEIGHT_CACHE_CLEAR:
Severity: Major
Found in app/javascript/flavours/glitch/reducers/height_cache.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/reducers/height_cache.js on lines 15..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 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