TryGhost/Ghost

View on GitHub
apps/portal/src/components/pages/OfferPage.js

Summary

Maintainability
F
1 wk
Test Coverage

File OfferPage.js has 595 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import ActionButton from '../common/ActionButton';
import AppContext from '../../AppContext';
import {ReactComponent as CheckmarkIcon} from '../../images/icons/checkmark.svg';
import CloseButton from '../common/CloseButton';
Severity: Major
Found in apps/portal/src/components/pages/OfferPage.js - About 1 day to fix

    Function OfferPageStyles has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const OfferPageStyles = () => {
        return `
    .gh-portal-offer {
        padding-bottom: 0;
        overflow: unset;
    Severity: Major
    Found in apps/portal/src/components/pages/OfferPage.js - About 4 hrs to fix

      OfferPage has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default class OfferPage extends React.Component {
          static contextType = AppContext;
      
          constructor(props, context) {
              super(props, context);
      Severity: Minor
      Found in apps/portal/src/components/pages/OfferPage.js - About 2 hrs to fix

        Function renderOfferMessage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            renderOfferMessage({offer, product, t}) {
                const offerMessages = {
                    forever: t(`{{amount}} off forever.`, {
                        amount: this.getOffAmount({offer})
                    }),
        Severity: Minor
        Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

          Function getInputFields has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getInputFields({state, fieldNames}) {
                  const {portal_name: portalName} = this.context.site;
                  const {member, t} = this.context;
                  const errors = state.errors || {};
                  const fields = [
          Severity: Minor
          Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

            Function handleSignup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                handleSignup(e) {
                    e.preventDefault();
                    const {pageData: offer, site} = this.context;
                    if (!offer) {
                        return null;
            Severity: Minor
            Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

              Function renderSignupTerms has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  renderSignupTerms() {
                      const {site} = this.context;
                      if (site.portal_signup_terms_html === null || site.portal_signup_terms_html === '') {
                          return null;
                      }
              Severity: Minor
              Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

                Function renderProductCard has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    renderProductCard({product, offer, currencyClass, updatedPrice, price, benefits}) {
                        const {t} = this.context;
                
                        if (this.state.showNewsletterSelection) {
                            return null;
                Severity: Minor
                Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

                  Function renderSubmitButton has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      renderSubmitButton() {
                          const {action, brandColor, t} = this.context;
                          const {pageData: offer} = this.context;
                          let label = t('Continue');
                  
                  
                  Severity: Minor
                  Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

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

                        render() {
                            const {pageData: offer, site, t} = this.context;
                            if (!offer) {
                                return null;
                            }
                    Severity: Minor
                    Found in apps/portal/src/components/pages/OfferPage.js - About 1 hr to fix

                      Function renderOfferMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          renderOfferMessage({offer, product, t}) {
                              const offerMessages = {
                                  forever: t(`{{amount}} off forever.`, {
                                      amount: this.getOffAmount({offer})
                                  }),
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js - About 55 mins 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

                      Function getInputFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          getInputFields({state, fieldNames}) {
                              const {portal_name: portalName} = this.context.site;
                              const {member, t} = this.context;
                              const errors = state.errors || {};
                              const fields = [
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js - About 35 mins 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

                      Function getUpdatedPrice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          getUpdatedPrice({offer, product}) {
                              const price = offer.cadence === 'month' ? product.monthlyPrice : product.yearlyPrice;
                              const originalAmount = price.amount;
                              let updatedAmount;
                              if (offer.type === 'fixed' && isSameCurrency(offer.currency, price.currency)) {
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js - About 25 mins 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

                      Function render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          render() {
                              const {pageData: offer, site, t} = this.context;
                              if (!offer) {
                                  return null;
                              }
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js - About 25 mins 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

                          renderSignupTerms() {
                              const {site} = this.context;
                              if (site.portal_signup_terms_html === null || site.portal_signup_terms_html === '') {
                                  return null;
                              }
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 1 day to fix
                      apps/portal/src/components/pages/SignupPage.js on lines 512..553

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

                      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

                                  return (
                                      <div className="gh-portal-product-card-pricecontainer offer-type-trial">
                                          <div className="gh-portal-product-price">
                                              <span className={'currency-sign ' + currencyClass}>{getCurrencySymbol(price.currency)}</span>
                                              <span className="amount">{formatNumber(this.renderRoundedPrice(updatedPrice))}</span>
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 3 hrs to fix
                      apps/portal/src/components/pages/OfferPage.js on lines 588..595

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

                      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

                              return (
                                  <div className="gh-portal-product-card-pricecontainer">
                                      <div className="gh-portal-product-price">
                                          <span className={'currency-sign ' + currencyClass}>{getCurrencySymbol(price.currency)}</span>
                                          <span className="amount">{formatNumber(this.renderRoundedPrice(updatedPrice))}</span>
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 3 hrs to fix
                      apps/portal/src/components/pages/OfferPage.js on lines 579..586

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

                      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

                          getFormErrors(state) {
                              const checkboxRequired = this.context.site.portal_signup_checkbox_required && this.context.site.portal_signup_terms_html;
                              const checkboxError = checkboxRequired && !state.termsCheckboxChecked;
                      
                              return {
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 3 hrs to fix
                      apps/portal/src/components/pages/SignupPage.js on lines 383..391

                      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

                                  fields.unshift({
                                      type: 'text',
                                      value: member?.name || state.name,
                                      placeholder: 'Jamie Larson',
                                      label: t('Name'),
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 2 hrs to fix
                      apps/portal/src/components/pages/OfferPage.js on lines 179..189

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

                      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

                                  {
                                      type: 'email',
                                      value: member?.email || state.email,
                                      placeholder: 'jamie@example.com',
                                      label: t('Email'),
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 2 hrs to fix
                      apps/portal/src/components/pages/OfferPage.js on lines 201..211

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

                      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='gh-portal-section'>
                                          <InputForm
                                              fields={fields}
                                              onChange={(e, field) => this.handleInputChange(e, field)}
                                              onKeyDown={e => this.onKeyDown(e)}
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 1 hr to fix
                      apps/portal/src/components/pages/SignupPage.js on lines 711..717

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

                      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

                              if (this.state.showNewsletterSelection) {
                                  return (
                                      <NewsletterSelectionPage
                                          pageData={this.state.pageData}
                                          onBack={() => {
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 1 hr to fix
                      apps/portal/src/components/pages/SignupPage.js on lines 656..667

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

                      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

                          handleInputChange(e, field) {
                              const fieldName = field.name;
                              const value = e.target.value;
                              this.setState({
                                  [fieldName]: value
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 55 mins to fix
                      apps/portal/src/components/pages/SignupPage.js on lines 431..437

                      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

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

                              if (fieldNames && fieldNames.length > 0) {
                                  return fields.filter((f) => {
                                      return fieldNames.includes(f.name);
                                  });
                              }
                      Severity: Major
                      Found in apps/portal/src/components/pages/OfferPage.js and 2 other locations - About 50 mins to fix
                      apps/portal/src/components/pages/AccountProfilePage.js on lines 160..164
                      apps/portal/src/components/pages/SignupPage.js on lines 504..508

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

                                              <h4 className="gh-portal-product-name">{product.name} - {(offer.cadence === 'month' ? t('Monthly') : t('Yearly'))}</h4>
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 40 mins to fix
                      apps/portal/src/components/pages/OfferPage.js on lines 569..569

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

                      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

                                      <h4 className="gh-portal-plan-name">{product.name} - {(offer.cadence === 'month' ? t('Monthly') : t('Yearly'))}</h4>
                      Severity: Minor
                      Found in apps/portal/src/components/pages/OfferPage.js and 1 other location - About 40 mins to fix
                      apps/portal/src/components/pages/OfferPage.js on lines 617..617

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

                      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

                      There are no issues that match your filters.

                      Category
                      Status