mashirozx/mastodon

View on GitHub

Showing 1,065 of 1,785 total issues

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 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.js on lines 38..43
app/javascript/mastodon/components/__tests__/button-test.js on lines 62..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 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>?</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></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 103..106

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>b</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.boost' defaultMessage='to boost' /></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 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>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>h</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.toggle_sensitivity' defaultMessage='to show/hide 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 59..62
app/javascript/mastodon/features/keyboard_shortcuts/index.js on lines 63..66
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>s</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.search' defaultMessage='to focus 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 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

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>backspace</kbd></td>
                <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></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 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 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.js on lines 62..67
app/javascript/mastodon/components/__tests__/button-test.js on lines 69..74

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

          <p>
            <FormattedMessage
              id='confirmations.block.message'
              defaultMessage='Are you sure you want to block {name}?'
              values={{ name: <strong>@{account.get('acct')}</strong> }}
app/javascript/mastodon/features/ui/components/mute_modal.js on lines 92..98

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

  toggleMute = () => {
    const muted = !this.video.muted;

    this.setState({ muted }, () => {
      this.video.muted = muted;
Severity: Major
Found in app/javascript/mastodon/features/video/index.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/features/audio/index.js on lines 201..207

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

  toggleMute = () => {
    const muted = !this.state.muted;

    this.setState({ muted }, () => {
      this.audio.muted = muted;
Severity: Major
Found in app/javascript/mastodon/features/audio/index.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/features/video/index.js on lines 452..458

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

          <p>
            <FormattedMessage
              id='confirmations.mute.message'
              defaultMessage='Are you sure you want to mute {name}?'
              values={{ name: <strong>@{account.get('acct')}</strong> }}
app/javascript/mastodon/features/ui/components/block_modal.js on lines 79..85

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

          <div className={classNames('quote-status', `status-${quote_status.get('visibility')}`, { muted: this.props.muted })} data-id={quote_status.get('id')}>
            <div className='status__info'>
              <a onClick={this.handleQuoteAccountClick} target='_blank' data-id={quote_status.getIn(['account', 'id'])} href={quote_status.getIn(['account', 'url'])} title={quote_status.getIn(['account', 'acct'])} className='status__display-name'>
                <div className='status__avatar'><Avatar account={quote_status.get('account')} size={18} /></div>
                <DisplayName account={quote_status.get('account')} />
Severity: Major
Found in app/javascript/mastodon/components/status.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/components/status.js on lines 677..685

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

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('quote-status', `status-${quote_status.get('visibility')}`, { muted: this.props.muted })} data-id={quote_status.get('id')}>
            <div className={classNames('status__content unlisted-quote', { 'status__content--with-action': this.context.router })}>
              <button onClick={this.handleQuoteClick}>
                <Icon id='unlock:fad' />
                {unlistedQuoteText}
Severity: Major
Found in app/javascript/mastodon/components/status.js and 1 other location - About 1 hr to fix
app/javascript/mastodon/components/status.js on lines 689..699

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

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