thepracticaldev/dev.to

View on GitHub

Showing 151 of 151 total issues

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

                  <tr>
                    <td className="ff-monospace">*italics* or _italics_</td>
                    <td>
                      <em>italics</em>
                    </td>
Severity: Major
Found in app/javascript/article-form/components/Help.jsx and 2 other locations - About 1 hr to fix
app/javascript/article-form/components/Help.jsx on lines 164..169
app/javascript/article-form/components/Help.jsx on lines 207..212

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

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

                  <tr>
                    <td className="ff-monospace">**bold**</td>
                    <td>
                      <strong>bold</strong>
                    </td>
Severity: Major
Found in app/javascript/article-form/components/Help.jsx and 2 other locations - About 1 hr to fix
app/javascript/article-form/components/Help.jsx on lines 158..163
app/javascript/article-form/components/Help.jsx on lines 207..212

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

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 adjustTag has 51 lines of code (exceeds 50 allowed). Consider refactoring.
Open

async function adjustTag(el) {
  const reasonForAdjustment = document.getElementById('tag-adjustment-reason')
    .value;
  const body = {
    tag_adjustment: {
Severity: Major
Found in app/javascript/actionsPanel/actionsPanel.js - About 1 hr to fix

    Function initReactions has 51 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    function initReactions() {
      setTimeout(function () {
        if (document.getElementById('notifications-container')) {
          var butts = document.getElementsByClassName('reaction-button');
    
    
    Severity: Major
    Found in app/assets/javascripts/initializers/initNotifications.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if (
            classList.contains('crayons-story') ||
            classList.contains('crayons-story__top') ||
            classList.contains('crayons-story__body') ||
            classList.contains('crayons-story__indention') ||
      Severity: Major
      Found in app/assets/javascripts/initializers/initScrolling.js - About 1 hr to fix

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

            if (document.getElementById('on-page-nav-butt-left')) {
              document.getElementById('on-page-nav-butt-left').onclick = (_event) => {
                swipeState = 'left';
                slideSidebar('left', 'intoView');
              };
        app/assets/javascripts/initializers/initializeDrawerSliders.js on lines 28..33
        app/assets/javascripts/initializers/initializeDrawerSliders.js on lines 34..39

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

        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

            if (document.getElementById('sidebar-bg-left')) {
              document.getElementById('sidebar-bg-left').onclick = (_event) => {
                swipeState = 'middle';
                slideSidebar('left', 'outOfView');
              };
        app/assets/javascripts/initializers/initializeDrawerSliders.js on lines 34..39
        app/assets/javascripts/initializers/initializeDrawerSliders.js on lines 41..46

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

        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

            if (document.getElementById('sidebar-bg-right')) {
              document.getElementById('sidebar-bg-right').onclick = (_event) => {
                swipeState = 'middle';
                slideSidebar('right', 'outOfView');
              };
        app/assets/javascripts/initializers/initializeDrawerSliders.js on lines 28..33
        app/assets/javascripts/initializers/initializeDrawerSliders.js on lines 41..46

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

        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

                  <button
                    type="button"
                    class="crayons-btn crayons-btn--icon crayons-btn--ghost modal-header-close-icon"
                    onClick={toggleFlagUserModal}
                  >
        Severity: Major
        Found in app/javascript/packs/flagUserModal.jsx and 2 other locations - About 55 mins to fix
        app/javascript/chat/chat.jsx on lines 1788..1805
        app/javascript/onboarding/components/Navigation.jsx on lines 77..93

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

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

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

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

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

        Refactorings

        Further Reading

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

            user: PropTypes.shape({
              username: PropTypes.string.isRequired,
              profile_image_90: PropTypes.string.isRequired,
              name: PropTypes.string.isRequired,
            }),
        Severity: Major
        Found in app/javascript/readingList/components/ItemListItem.jsx and 3 other locations - About 55 mins to fix
        app/javascript/common-prop-types/article-prop-types.js on lines 20..24
        app/javascript/listings/singleListing/listingPropTypes.js on lines 13..17
        app/javascript/modCenter/singleArticle/articlePropTypes.js on lines 8..12

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

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

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

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

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

        Refactorings

        Further Reading

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

          podcast: PropTypes.shape({
            slug: PropTypes.string.isRequired,
            title: PropTypes.string.isRequired,
            image_url: PropTypes.string.isRequired,
          }),
        Severity: Major
        Found in app/javascript/common-prop-types/article-prop-types.js and 3 other locations - About 55 mins to fix
        app/javascript/listings/singleListing/listingPropTypes.js on lines 13..17
        app/javascript/modCenter/singleArticle/articlePropTypes.js on lines 8..12
        app/javascript/readingList/components/ItemListItem.jsx on lines 63..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 53.

        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

                    <header className="onboarding-content-header">
                      <h1 className="title">What are you interested in?</h1>
                      <h2 className="subtitle">Follow tags to customize your feed</h2>
                    </header>
        Severity: Major
        Found in app/javascript/onboarding/components/FollowTags.jsx and 2 other locations - About 55 mins to fix
        app/javascript/onboarding/components/EmailPreferencesForm.jsx on lines 68..73
        app/javascript/onboarding/components/FollowUsers.jsx on lines 156..159

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

        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

                    <header className="onboarding-content-header">
                      <h1 className="title">Suggested people to follow</h1>
                      <h2 className="subtitle">Let&apos;s review a few things first</h2>
                    </header>
        Severity: Major
        Found in app/javascript/onboarding/components/FollowUsers.jsx and 2 other locations - About 55 mins to fix
        app/javascript/onboarding/components/EmailPreferencesForm.jsx on lines 68..73
        app/javascript/onboarding/components/FollowTags.jsx on lines 116..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

          author: PropTypes.shape({
            name: PropTypes.string.isRequired,
            username: PropTypes.string.isRequired,
            profile_image_90: PropTypes.string.isRequired,
          }),
        Severity: Major
        Found in app/javascript/listings/singleListing/listingPropTypes.js and 3 other locations - About 55 mins to fix
        app/javascript/common-prop-types/article-prop-types.js on lines 20..24
        app/javascript/modCenter/singleArticle/articlePropTypes.js on lines 8..12
        app/javascript/readingList/components/ItemListItem.jsx on lines 63..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 53.

        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

                      <button
                        onClick={prev}
                        data-testid="back-button"
                        class="back-button"
                        type="button"
        Severity: Major
        Found in app/javascript/onboarding/components/Navigation.jsx and 2 other locations - About 55 mins to fix
        app/javascript/packs/flagUserModal.jsx on lines 110..124
        app/javascript/chat/chat.jsx on lines 1788..1805

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

        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

                    <header className="onboarding-content-header">
                      <h1 className="title">Almost there!</h1>
                      <h2 className="subtitle">
                        Review your email preferences before we continue.
                      </h2>
        Severity: Major
        Found in app/javascript/onboarding/components/EmailPreferencesForm.jsx and 2 other locations - About 55 mins to fix
        app/javascript/onboarding/components/FollowTags.jsx on lines 116..119
        app/javascript/onboarding/components/FollowUsers.jsx on lines 156..159

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

        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

              <button
                className="crayons-btn crayons-btn--icon-rounded crayons-btn--ghost active-channel__back-btn"
                onClick={this.navigateToChannelsList}
                onKeyUp={(e) => {
                  if (e.keyCode === 13) this.navigateToChannelsList(e);
        Severity: Major
        Found in app/javascript/chat/chat.jsx and 2 other locations - About 55 mins to fix
        app/javascript/packs/flagUserModal.jsx on lines 110..124
        app/javascript/onboarding/components/Navigation.jsx on lines 77..93

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

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

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

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

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

        Refactorings

        Further Reading

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

          user: PropTypes.shape({
            name: PropTypes.string.isRequired,
            username: PropTypes.string.isRequired,
            path: PropTypes.string.isRequired,
          }),
        Severity: Major
        Found in app/javascript/modCenter/singleArticle/articlePropTypes.js and 3 other locations - About 55 mins to fix
        app/javascript/common-prop-types/article-prop-types.js on lines 20..24
        app/javascript/listings/singleListing/listingPropTypes.js on lines 13..17
        app/javascript/readingList/components/ItemListItem.jsx on lines 63..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 53.

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

        PersonalSettings.propTypes = {
          updateCurrentMembershipNotificationSettings: PropTypes.func.isRequired,
          showGlobalBadgeNotification: PropTypes.bool.isRequired,
          handlePersonChannelSetting: PropTypes.func.isRequired,
        };
        Severity: Major
        Found in app/javascript/chat/ChatChannelSettings/PersonalSetting.jsx and 6 other locations - About 50 mins to fix
        app/javascript/chat/ChatChannelSettings/ChannelDescriptionSection.jsx on lines 22..26
        app/javascript/chat/ChatChannelSettings/InviteForm.jsx on lines 38..42
        app/javascript/listings/dashboard/rowElements/actionButtons.jsx on lines 33..37
        app/javascript/article-form/components/PageTitle.jsx on lines 28..32
        app/javascript/article-form/components/TagsField.jsx on lines 28..32
        app/javascript/article-form/components/Title.jsx on lines 32..36

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

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

        PageTitle.propTypes = {
          organizations: PropTypes.string.isRequired,
          organizationId: PropTypes.string.isRequired,
          onToggle: PropTypes.string.isRequired,
        };
        Severity: Major
        Found in app/javascript/article-form/components/PageTitle.jsx and 6 other locations - About 50 mins to fix
        app/javascript/chat/ChatChannelSettings/ChannelDescriptionSection.jsx on lines 22..26
        app/javascript/chat/ChatChannelSettings/InviteForm.jsx on lines 38..42
        app/javascript/chat/ChatChannelSettings/PersonalSetting.jsx on lines 38..42
        app/javascript/listings/dashboard/rowElements/actionButtons.jsx on lines 33..37
        app/javascript/article-form/components/TagsField.jsx on lines 28..32
        app/javascript/article-form/components/Title.jsx on lines 32..36

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

        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