mashirozx/mastodon

View on GitHub

Showing 1,785 of 1,785 total issues

Class NotifyService has 27 methods (exceeds 20 allowed). Consider refactoring.
Open

class NotifyService < BaseService
  include Redisable

  def call(recipient, type, activity)
    @recipient    = recipient
Severity: Minor
Found in app/services/notify_service.rb - About 3 hrs to fix

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

      onReblog (status, e) {
        if (status.get('reblogged')) {
          dispatch(unreblog(status));
        } else {
          if (e.shiftKey || !boostModal) {
    app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 44..54

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

    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

      onReblog (status, e) {
        if (status.get('reblogged')) {
          dispatch(unreblog(status));
        } else {
          if (e.shiftKey || !boostModal) {
    app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 76..86

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

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

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

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

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

    Refactorings

    Further Reading

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

      render () {
        const { selectedFilter, advancedMode, intl } = this.props;
        const renderedElement = !advancedMode ? (
          <div className='notification__filter-bar'>
            <button

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

        handleMouseLeave = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      Severity: Major
      Found in app/javascript/mastodon/components/display_name.js and 11 other locations - About 3 hrs to fix
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseEnter = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseLeave = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121

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

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

        handleMouseLeave = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      Severity: Major
      Found in app/javascript/mastodon/components/status_content.js and 11 other locations - About 3 hrs to fix
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseEnter = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseEnter = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseEnter = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      Severity: Major
      Found in app/javascript/mastodon/components/status_content.js and 11 other locations - About 3 hrs to fix
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseLeave = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseLeave = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseEnter = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseLeave = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      app/javascript/mastodon/components/display_name.js on lines 14..25
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

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

        handleMouseEnter = ({ currentTarget }) => {
          if (autoPlayGif) {
            return;
          }
      
      
      Severity: Major
      Found in app/javascript/mastodon/components/display_name.js and 11 other locations - About 3 hrs to fix
      app/javascript/mastodon/components/display_name.js on lines 27..38
      app/javascript/mastodon/components/status_content.js on lines 80..91
      app/javascript/mastodon/components/status_content.js on lines 93..104
      app/javascript/mastodon/features/account/components/header.js on lines 105..116
      app/javascript/mastodon/features/account/components/header.js on lines 118..129
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 47..58
      app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 60..71
      app/javascript/mastodon/features/directory/components/account_card.js on lines 99..110
      app/javascript/mastodon/features/directory/components/account_card.js on lines 112..123
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 110..121
      app/javascript/mastodon/features/getting_started/components/announcements.js on lines 123..134

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

      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

      export function rejectFollowRequest(id) {
        return (dispatch, getState) => {
          dispatch(rejectFollowRequestRequest(id));
      
          api(getState)
      Severity: Major
      Found in app/javascript/mastodon/actions/accounts.js and 1 other location - About 3 hrs to fix
      app/javascript/mastodon/actions/accounts.js on lines 653..662

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

      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

      function loaded() {
        const TimelineContainer = require('../mastodon/containers/timeline_container').default;
        const React             = require('react');
        const ReactDOM          = require('react-dom');
        const mountNode         = document.getElementById('mastodon-timeline');
      Severity: Major
      Found in app/javascript/packs/about.js and 1 other location - About 3 hrs to fix
      app/javascript/packs/share.js on lines 7..17

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

      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

      export function authorizeFollowRequest(id) {
        return (dispatch, getState) => {
          dispatch(authorizeFollowRequestRequest(id));
      
          api(getState)
      Severity: Major
      Found in app/javascript/mastodon/actions/accounts.js and 1 other location - About 3 hrs to fix
      app/javascript/mastodon/actions/accounts.js on lines 687..696

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

      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

      function loaded() {
        const ComposeContainer = require('../mastodon/containers/compose_container').default;
        const React = require('react');
        const ReactDOM = require('react-dom');
        const mountNode = document.getElementById('mastodon-compose');
      Severity: Major
      Found in app/javascript/packs/share.js and 1 other location - About 3 hrs to fix
      app/javascript/packs/about.js on lines 7..17

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

      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