Showing 313 of 321 total issues

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

describe('DataStoreNamespace', () => {
    const keys = ['key1', 'a key', 'aowelfkxuw']
    let namespace
    let apiMock

Severity: Major
Found in src/datastore/__tests__/DatastoreNamespace.spec.js and 1 other location - About 1 wk to fix
src/datastore/__tests__/UserDatastoreNamespace.spec.js on lines 6..284

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

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

describe('DataStoreNamespace', () => {
    const keys = ['key1', 'a key', 'aowelfkxuw']
    let namespace
    let apiMock

Severity: Major
Found in src/datastore/__tests__/UserDatastoreNamespace.spec.js and 1 other location - About 1 wk to fix
src/datastore/__tests__/DatastoreNamespace.spec.js on lines 6..284

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

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

describe('Financial October period', () => {
    describe('generateFinancialOctoberPeriodsUpToYear()', () => {
        it('should not allow years before the year zero', () => {
            expect(() =>
                generateFinancialOctoberPeriodsUpToYear(-10)
Severity: Major
Found in src/period/generators/__tests__/financial-october.spec.js and 3 other locations - About 4 days to fix
src/period/generators/__tests__/financial-april.spec.js on lines 3..177
src/period/generators/__tests__/financial-july.spec.js on lines 3..177
src/period/generators/__tests__/yearly.spec.js on lines 3..165

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

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

describe('Financial April period', () => {
    describe('generateFinancialAprilPeriodsUpToYear()', () => {
        it('should not allow years before the year zero', () => {
            expect(() =>
                generateFinancialAprilPeriodsUpToYear(-10)
Severity: Major
Found in src/period/generators/__tests__/financial-april.spec.js and 3 other locations - About 4 days to fix
src/period/generators/__tests__/financial-july.spec.js on lines 3..177
src/period/generators/__tests__/financial-october.spec.js on lines 3..182
src/period/generators/__tests__/yearly.spec.js on lines 3..165

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

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

describe('Financial July period', () => {
    describe('generateFinancialJulyPeriodsUpToYear()', () => {
        it('should not allow years before the year zero', () => {
            expect(() =>
                generateFinancialJulyPeriodsUpToYear(-10)
Severity: Major
Found in src/period/generators/__tests__/financial-july.spec.js and 3 other locations - About 4 days to fix
src/period/generators/__tests__/financial-april.spec.js on lines 3..177
src/period/generators/__tests__/financial-october.spec.js on lines 3..182
src/period/generators/__tests__/yearly.spec.js on lines 3..165

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

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

describe('Yearly period', () => {
    describe('generateYearlyPeriodsUpToYear()', () => {
        it('should not allow years before the year zero', () => {
            expect(() => generateYearlyPeriodsUpToYear(-10)).toThrowError()
        })
Severity: Major
Found in src/period/generators/__tests__/yearly.spec.js and 3 other locations - About 4 days to fix
src/period/generators/__tests__/financial-april.spec.js on lines 3..177
src/period/generators/__tests__/financial-july.spec.js on lines 3..177
src/period/generators/__tests__/financial-october.spec.js on lines 3..182

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

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

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

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

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

Refactorings

Further Reading

File ModelDefinition.spec.js has 1378 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import fixtures from '../../__fixtures__/fixtures'
import { DIRTY_PROPERTY_LIST } from '../ModelBase'
import Model from '../Model'
import ModelDefinitions from '../ModelDefinitions'
import ModelCollectionProperty from '../ModelCollectionProperty'
Severity: Major
Found in src/model/__tests__/ModelDefinition.spec.js - About 3 days to fix

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

        describe('has', () => {
            it('should resolve with true if namespace exists', async () => {
                apiMock.get.mockReturnValueOnce(Promise.resolve(keys))
                const hasNamespace = await dataStore.has('DHIS')
                expect(hasNamespace).toBe(true)
    Severity: Major
    Found in src/datastore/__tests__/DataStore.spec.js and 1 other location - About 2 days to fix
    src/datastore/__tests__/UserDataStore.spec.js on lines 192..226

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

    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

        describe('has', () => {
            it('should resolve with true if namespace exists', async () => {
                apiMock.get.mockReturnValueOnce(Promise.resolve(keys))
                const hasNamespace = await userDataStore.has('DHIS')
                expect(hasNamespace).toBe(true)
    Severity: Major
    Found in src/datastore/__tests__/UserDataStore.spec.js and 1 other location - About 2 days to fix
    src/datastore/__tests__/DataStore.spec.js on lines 175..209

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

    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 AnalyticsRequestDimensionsMixin = (base) =>
        class extends base {
            /**
             * Adds/updates the dx dimension to use in the request.
             *
    Severity: Major
    Found in src/analytics/AnalyticsRequestDimensionsMixin.js and 1 other location - About 1 day to fix
    src/analytics/AnalyticsRequestFiltersMixin.js on lines 19..128

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

    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 AnalyticsRequestFiltersMixin = (base) =>
        class extends base {
            /**
             * Adds/updates the dx dimension filter to use in the request.
             *
    Severity: Major
    Found in src/analytics/AnalyticsRequestFiltersMixin.js and 1 other location - About 1 day to fix
    src/analytics/AnalyticsRequestDimensionsMixin.js on lines 18..128

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

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

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

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

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

    Refactorings

    Further Reading

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

    export function generateFinancialOctoberPeriodsUpToYear(
        year = getCurrentYear(),
        numberOfYears = 10,
        locale = 'en'
    ) {
    Severity: Major
    Found in src/period/generators/financial-october.js and 1 other location - About 1 day to fix
    src/period/generators/financial-july.js on lines 9..41

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

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

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

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

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

    Refactorings

    Further Reading

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

    export function generateFinancialJulyPeriodsUpToYear(
        year = getCurrentYear(),
        numberOfYears = 10,
        locale = 'en'
    ) {
    Severity: Major
    Found in src/period/generators/financial-july.js and 1 other location - About 1 day to fix
    src/period/generators/financial-october.js on lines 9..41

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

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

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

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

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

    Refactorings

    Further Reading

    File Api.spec.js has 790 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import FormData from 'form-data'
    import System from '../../system/System'
    import fixtures from '../../__fixtures__/fixtures'
    import Api from '../Api'
    
    
    Severity: Major
    Found in src/api/__tests__/Api.spec.js - About 1 day to fix

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

              describe('.addDimension()', () => {
                  it('should add the given dimension without any associated value', () => {
                      request.addDimension('Jtf34kNZhzP')
      
                      expect(request.dimensions).toEqual([
      Severity: Major
      Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 1 other location - About 1 day to fix
      src/analytics/__tests__/AnalyticsRequest.spec.js on lines 260..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 282.

      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

              describe('.addFilter()', () => {
                  it('should add the given dimensions as filter without any associated value', () => {
                      request.addFilter('Jtf34kNZhzP')
      
                      expect(request.filters).toEqual([
      Severity: Major
      Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 1 other location - About 1 day to fix
      src/analytics/__tests__/AnalyticsRequest.spec.js on lines 163..205

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

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

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

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

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

      Refactorings

      Further Reading

      File ModelBase.spec.js has 627 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import ModelValidation from '../ModelValidation'
      import ModelBase, { DIRTY_PROPERTY_LIST } from '../ModelBase'
      
      jest.mock('../ModelValidation')
      
      
      Severity: Major
      Found in src/model/__tests__/ModelBase.spec.js - About 1 day to fix

        Function AnalyticsRequestPropertiesMixin has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
        Open

        const AnalyticsRequestPropertiesMixin = (base) =>
            class extends base {
                /**
                 * Sets the query parameters of the request
                 *
        Severity: Minor
        Found in src/analytics/AnalyticsRequestPropertiesMixin.js - About 1 day 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 5 locations. Consider refactoring.
        Open

                describe('yearly', () => {
                    beforeEach(() => {
                        jest.spyOn(yearly, 'generateYearlyPeriodsUpToYear')
                    })
        
        
        Severity: Major
        Found in src/period/generators/__tests__/index.spec.js and 4 other locations - About 1 day to fix
        src/period/generators/__tests__/index.spec.js on lines 288..325
        src/period/generators/__tests__/index.spec.js on lines 366..410
        src/period/generators/__tests__/index.spec.js on lines 412..456
        src/period/generators/__tests__/index.spec.js on lines 458..502

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

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

                describe('financial-july', () => {
                    beforeEach(() => {
                        jest.spyOn(
                            financialjuly,
                            'generateFinancialJulyPeriodsUpToYear'
        Severity: Major
        Found in src/period/generators/__tests__/index.spec.js and 4 other locations - About 1 day to fix
        src/period/generators/__tests__/index.spec.js on lines 288..325
        src/period/generators/__tests__/index.spec.js on lines 327..364
        src/period/generators/__tests__/index.spec.js on lines 366..410
        src/period/generators/__tests__/index.spec.js on lines 458..502

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

        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