TryGhost/Ghost

View on GitHub
ghost/members-api/lib/repositories/EventRepository.js

Summary

Maintainability
F
1 wk
Test Coverage

File EventRepository.js has 691 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const errors = require('@tryghost/errors');
const nql = require('@tryghost/nql');
const mingo = require('mingo');
const {replaceFilters, expandFilters, splitFilter, getUsedKeys, chainTransformers, mapKeys} = require('@tryghost/mongo-utils');

Severity: Major
Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 day to fix

    Function getEventTimeline has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        async getEventTimeline(options = {}) {
            if (!options.limit) {
                options.limit = 10;
            }
    
    
    Severity: Major
    Found in ghost/members-api/lib/repositories/EventRepository.js - About 2 hrs to fix

      exports has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      module.exports = class EventRepository {
          constructor({
              DonationPaymentEvent,
              EmailRecipient,
              MemberSubscribeEvent,
      Severity: Minor
      Found in ghost/members-api/lib/repositories/EventRepository.js - About 2 hrs to fix

        Function getSubscriptionEvents has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async getSubscriptionEvents(options = {}, filter) {
                options = {
                    ...options,
                    withRelated: [
                        'member',
        Severity: Minor
        Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

          Function getSignupEvents has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              async getSignupEvents(options = {}, filter) {
                  options = {
                      ...options,
                      withRelated: [
                          'member',
          Severity: Minor
          Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

            Function getDonationEvents has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                async getDonationEvents(options = {}, filter) {
                    options = {
                        ...options,
                        withRelated: [
                            'member',
            Severity: Minor
            Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

              Function getAggregatedClickEvents has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async getAggregatedClickEvents(options = {}, filter) {
                      // This counts all clicks for a member for the same post
                      const postClickQuery = `SELECT count(distinct A.redirect_id)
                          FROM members_click_events A
                          LEFT JOIN redirects A_r on A_r.id = A.redirect_id
              Severity: Minor
              Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

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

                    async getEmailSentEvents(options = {}, filter) {
                        const filterStr = 'failed_at:null+processed_at:-null+delivered_at:null+custom:true';
                        options = {
                            ...options,
                            withRelated: ['member', 'email'],
                Severity: Minor
                Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

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

                      async getEmailOpenedEvents(options = {}, filter) {
                          options = {
                              ...options,
                              withRelated: ['member', 'email'],
                              filter: 'opened_at:-null+custom:true',
                  Severity: Minor
                  Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

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

                        async getEmailDeliveredEvents(options = {}, filter) {
                            options = {
                                ...options,
                                withRelated: ['member', 'email'],
                                filter: 'delivered_at:-null+custom:true',
                    Severity: Minor
                    Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

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

                          async getEmailFailedEvents(options = {}, filter) {
                              options = {
                                  ...options,
                                  withRelated: ['member', 'email'],
                                  filter: 'failed_at:-null+custom:true',
                      Severity: Minor
                      Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

                        Function getNQLSubset has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            getNQLSubset(filter) {
                                if (!filter) {
                                    return [undefined, undefined];
                                }
                        
                        
                        Severity: Minor
                        Found in ghost/members-api/lib/repositories/EventRepository.js - About 1 hr to fix

                          Function getEventTimeline has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              async getEventTimeline(options = {}) {
                                  if (!options.limit) {
                                      options.limit = 10;
                                  }
                          
                          
                          Severity: Minor
                          Found in ghost/members-api/lib/repositories/EventRepository.js - About 45 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 getSubscriptionEvents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              async getSubscriptionEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: [
                                          'member',
                          Severity: Minor
                          Found in ghost/members-api/lib/repositories/EventRepository.js - About 45 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 getNQLSubset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getNQLSubset(filter) {
                                  if (!filter) {
                                      return [undefined, undefined];
                                  }
                          
                          
                          Severity: Minor
                          Found in ghost/members-api/lib/repositories/EventRepository.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

                              async getEmailDeliveredEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'email'],
                                      filter: 'delivered_at:-null+custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 1 day to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 650..690

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

                          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

                              async getEmailOpenedEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'email'],
                                      filter: 'opened_at:-null+custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 1 day to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 608..648

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

                          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

                              async getEmailSpamComplaintEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'email'],
                                      filter: 'custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 2 other locations - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 146..177
                          ghost/members-api/lib/repositories/EventRepository.js on lines 532..563

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

                          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

                              async getNewsletterSubscriptionEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'newsletter'],
                                      filter: 'custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 2 other locations - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 532..563
                          ghost/members-api/lib/repositories/EventRepository.js on lines 692..723

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

                          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

                              async getFeedbackEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'post'],
                                      filter: 'custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 2 other locations - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 146..177
                          ghost/members-api/lib/repositories/EventRepository.js on lines 692..723

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

                          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

                              async getPaymentEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member'],
                                      filter: 'custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 272..302

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

                          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

                              async getLoginEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member'],
                                      filter: 'custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 240..270

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

                          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

                              async getCommentEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'post', 'parent'],
                                      filter: 'member_id:-null+custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 444..475

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

                          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

                              async getClickEvents(options = {}, filter) {
                                  options = {
                                      ...options,
                                      withRelated: ['member', 'link', 'link.post'],
                                      filter: 'custom:true',
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 6 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 411..442

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

                          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 data = models.map((model) => {
                                      const json = model.toJSON(options);
                                      delete json.postAttribution?.mobiledoc;
                                      delete json.postAttribution?.lexical;
                                      delete json.postAttribution?.plaintext;
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 3 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 338..350

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

                          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 data = models.map((model) => {
                                      const json = model.toJSON(options);
                                      delete json.postAttribution?.mobiledoc;
                                      delete json.postAttribution?.lexical;
                                      delete json.postAttribution?.plaintext;
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 3 hrs to fix
                          ghost/members-api/lib/repositories/EventRepository.js on lines 391..403

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

                          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 pageActions = [
                                      {type: 'comment_event', action: 'getCommentEvents'},
                                      {type: 'click_event', action: 'getClickEvents'},
                                      {type: 'aggregated_click_event', action: 'getAggregatedClickEvents'},
                                      {type: 'signup_event', action: 'getSignupEvents'},
                          Severity: Major
                          Found in ghost/members-api/lib/repositories/EventRepository.js and 1 other location - About 2 hrs to fix
                          ghost/core/core/server/services/url/UrlGenerator.js on lines 7..25

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

                          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