Showing 254 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__/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 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 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

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 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('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 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 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

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

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

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

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

        describe('financial-october', () => {
            beforeEach(() => {
                jest.spyOn(
                    financialoctober,
                    'generateFinancialOctoberPeriodsUpToYear'
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 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('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 327..364
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('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

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

        describe('financial-april', () => {
            beforeEach(() => {
                jest.spyOn(
                    financialapril,
                    'generateFinancialAprilPeriodsUpToYear'
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 412..456

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

        describe('six-monthly-april', () => {
            beforeEach(() => {
                jest.spyOn(
                    sixmonthlyapril,
                    'generateSixMonthlyAprilPeriodsForYear'
Severity: Major
Found in src/period/generators/__tests__/index.spec.js and 6 other locations - About 1 day to fix
src/period/generators/__tests__/index.spec.js on lines 16..52
src/period/generators/__tests__/index.spec.js on lines 54..90
src/period/generators/__tests__/index.spec.js on lines 92..128
src/period/generators/__tests__/index.spec.js on lines 130..165
src/period/generators/__tests__/index.spec.js on lines 167..202
src/period/generators/__tests__/index.spec.js on lines 204..241

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

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