maa123/mastodon

View on GitHub

Showing 1,813 of 1,813 total issues

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

const mapStateToProps = (state, { columnId }) => {
  const uuid = columnId;
  const columns = state.getIn(['settings', 'columns']);
  const index = columns.findIndex(c => c.get('uuid') === uuid);

app/javascript/mastodon/features/community_timeline/containers/column_settings_container.js on lines 7..15

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

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

File focal_point_modal.jsx has 356 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import PropTypes from 'prop-types';
import { PureComponent } from 'react';

import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';

Severity: Minor
Found in app/javascript/mastodon/features/ui/components/focal_point_modal.jsx - About 4 hrs to fix

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

        api(getState).get('/api/v1/follow_requests').then(response => {
          const next = getLinks(response).refs.find(link => link.rel === 'next');
          dispatch(importFetchedAccounts(response.data));
          dispatch(fetchFollowRequestsSuccess(response.data, next ? next.uri : null));
        }).catch(error => dispatch(fetchFollowRequestsFail(error)));
    Severity: Major
    Found in app/javascript/mastodon/actions/accounts.js and 1 other location - About 4 hrs to fix
    app/javascript/mastodon/actions/trends.js on lines 82..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 125.

    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

      api(getState).get('/api/v1/trends/statuses').then(response => {
        const next = getLinks(response).refs.find(link => link.rel === 'next');
        dispatch(importFetchedStatuses(response.data));
        dispatch(fetchTrendingStatusesSuccess(response.data, next ? next.uri : null));
      }).catch(err => dispatch(fetchTrendingStatusesFail(err)));
    Severity: Major
    Found in app/javascript/mastodon/actions/trends.js and 1 other location - About 4 hrs to fix
    app/javascript/mastodon/actions/accounts.js on lines 588..592

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

    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

    File status.rb has 354 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class Status < ApplicationRecord
      include Discard::Model
      include Paginable
      include Cacheable
      include StatusThreadingConcern
    Severity: Minor
    Found in app/models/status.rb - About 4 hrs to fix

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

              <div className={classNames('spoiler-button', { 'spoiler-button--hidden': revealed || editable })}>
                <button type='button' className='spoiler-button__overlay' onClick={this.toggleReveal}>
                  <span className='spoiler-button__overlay__label'>
                    {warning}
                    <span className='spoiler-button__overlay__action'><FormattedMessage id='status.media.show' defaultMessage='Click to show' /></span>
      Severity: Major
      Found in app/javascript/mastodon/features/audio/index.jsx and 1 other location - About 4 hrs to fix
      app/javascript/mastodon/features/video/index.jsx on lines 571..578

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

      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

      const messages = defineMessages({
        title: { id: 'column.about', defaultMessage: 'About' },
        rules: { id: 'about.rules', defaultMessage: 'Server rules' },
        blocks: { id: 'about.blocks', defaultMessage: 'Moderated servers' },
        silenced: { id: 'about.domain_blocks.silenced.title', defaultMessage: 'Limited' },
      Severity: Major
      Found in app/javascript/mastodon/features/about/index.jsx and 2 other locations - About 4 hrs to fix
      app/javascript/mastodon/features/direct_timeline/components/conversation.jsx on lines 21..29
      app/javascript/mastodon/features/ui/components/focal_point_modal.jsx on lines 32..40

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

      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

                <div className={classNames('spoiler-button', { 'spoiler-button--hidden': revealed || editable })}>
                  <button type='button' className='spoiler-button__overlay' onClick={this.toggleReveal}>
                    <span className='spoiler-button__overlay__label'>
                      {warning}
                      <span className='spoiler-button__overlay__action'><FormattedMessage id='status.media.show' defaultMessage='Click to show' /></span>
      Severity: Major
      Found in app/javascript/mastodon/features/video/index.jsx and 1 other location - About 4 hrs to fix
      app/javascript/mastodon/features/audio/index.jsx on lines 518..525

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

      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

      const messages = defineMessages({
        close: { id: 'lightbox.close', defaultMessage: 'Close' },
        apply: { id: 'upload_modal.apply', defaultMessage: 'Apply' },
        applying: { id: 'upload_modal.applying', defaultMessage: 'Applying…' },
        placeholder: { id: 'upload_modal.description_placeholder', defaultMessage: 'A quick brown fox jumps over the lazy dog' },
      app/javascript/mastodon/features/about/index.jsx on lines 21..29
      app/javascript/mastodon/features/direct_timeline/components/conversation.jsx on lines 21..29

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

      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

      const messages = defineMessages({
        more: { id: 'status.more', defaultMessage: 'More' },
        open: { id: 'conversation.open', defaultMessage: 'View conversation' },
        reply: { id: 'status.reply', defaultMessage: 'Reply' },
        markAsRead: { id: 'conversation.mark_as_read', defaultMessage: 'Mark as read' },
      app/javascript/mastodon/features/about/index.jsx on lines 21..29
      app/javascript/mastodon/features/ui/components/focal_point_modal.jsx on lines 32..40

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

      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 a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        render () {
          const { intl, hidden, featured, unread, showThread, scrollKey, pictureInPicture, previousId, nextInReplyToId, rootId } = this.props;
      
          let { status, account, ...other } = this.props;
      
      
      Severity: Minor
      Found in app/javascript/mastodon/components/status.jsx - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

        const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
      Severity: Major
      Found in app/javascript/mastodon/actions/importer/normalizer.js and 1 other location - About 4 hrs to fix
      app/javascript/mastodon/actions/importer/normalizer.js on lines 92..92

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

      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

          const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
      Severity: Major
      Found in app/javascript/mastodon/actions/importer/normalizer.js and 1 other location - About 4 hrs to fix
      app/javascript/mastodon/actions/importer/normalizer.js on lines 16..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 123.

      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 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render () {
          const { preview, src, aspectRatio, onOpenVideo, onCloseVideo, intl, alt, lang, detailed, sensitive, editable, blurhash, autoFocus } = this.props;
          const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, revealed } = this.state;
          const progress = Math.min((currentTime / duration) * 100, 100);
          const muted = this.state.muted || volume === 0;
      Severity: Major
      Found in app/javascript/mastodon/features/video/index.jsx - About 4 hrs to fix

        Function mapDispatchToProps has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        const mapDispatchToProps = (dispatch, { intl }) => ({
        
          onReply (status, router) {
            dispatch((_, getState) => {
              let state = getState();

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method update_column_in_batches has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            def update_column_in_batches(table_name, column, value)
              if transaction_open?
                raise 'update_column_in_batches can not be run inside a transaction, ' \
                  'you can disable transactions by calling disable_ddl_transaction! ' \
                  'in the body of your migration class'
        Severity: Minor
        Found in lib/mastodon/migration_helpers.rb - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method parallelize_with_progress has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            def parallelize_with_progress(scope)
              if options[:concurrency] < 1
                say('Cannot run with this concurrency setting, must be at least 1', :red)
                exit(1)
              end
        Severity: Minor
        Found in lib/mastodon/cli/progress_helper.rb - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            const visibilityIconInfo = {
              'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) },
              'unlisted': { icon: 'unlock', text: intl.formatMessage(messages.unlisted_short) },
              'private': { icon: 'lock', text: intl.formatMessage(messages.private_short) },
              'direct': { icon: 'at', text: intl.formatMessage(messages.direct_short) },
        app/javascript/mastodon/components/status.jsx on lines 539..544
        app/javascript/mastodon/features/report/components/status_check_box.jsx on lines 46..51
        app/javascript/mastodon/features/status/components/detailed_status.jsx on lines 228..233

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

        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 (action.status.get('poll')) {
                map.set('poll', ImmutableMap({
                  options: action.status.getIn(['poll', 'options']).map(x => x.get('title')),
                  multiple: action.status.getIn(['poll', 'multiple']),
                  expires_in: expiresInFromExpiresAt(action.status.getIn(['poll', 'expires_at'])),
        Severity: Major
        Found in app/javascript/mastodon/reducers/compose.js and 1 other location - About 4 hrs to fix
        app/javascript/mastodon/reducers/compose.js on lines 509..515

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

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

            const visibilityIconInfo = {
              'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) },
              'unlisted': { icon: 'unlock', text: intl.formatMessage(messages.unlisted_short) },
              'private': { icon: 'lock', text: intl.formatMessage(messages.private_short) },
              'direct': { icon: 'at', text: intl.formatMessage(messages.direct_short) },
        Severity: Major
        Found in app/javascript/mastodon/components/status.jsx and 3 other locations - About 4 hrs to fix
        app/javascript/mastodon/features/report/components/status_check_box.jsx on lines 46..51
        app/javascript/mastodon/features/status/components/detailed_status.jsx on lines 228..233
        app/javascript/mastodon/features/ui/components/boost_modal.jsx on lines 89..94

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

        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