Showing 254 of 321 total issues

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

        describe('quarterly', () => {
            beforeEach(() => {
                jest.spyOn(quarterly, 'generateQuarterlyPeriodsForYear')
            })

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 204..241
src/period/generators/__tests__/index.spec.js on lines 243..286

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

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

        describe('six-monthly', () => {
            beforeEach(() => {
                jest.spyOn(sixmonthly, 'generateSixMonthlyPeriodsForYear')
            })

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 243..286

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

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

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

        describe('daily', () => {
            beforeEach(() => {
                jest.spyOn(daily, 'generateDailyPeriodsForYear')
            })

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 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
src/period/generators/__tests__/index.spec.js on lines 243..286

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

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

        describe('monthly', () => {
            beforeEach(() => {
                jest.spyOn(monthly, 'generateMonthlyPeriodsForYear')
            })

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 130..165
src/period/generators/__tests__/index.spec.js on lines 167..202
src/period/generators/__tests__/index.spec.js on lines 204..241
src/period/generators/__tests__/index.spec.js on lines 243..286

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

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

        describe('bi-monthly', () => {
            beforeEach(() => {
                jest.spyOn(bimonthly, 'generateBiMonthlyPeriodsForYear')
            })

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 167..202
src/period/generators/__tests__/index.spec.js on lines 204..241
src/period/generators/__tests__/index.spec.js on lines 243..286

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

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

    describe('create()', () => {
        it('should return an instance of UserDataStoreNamespace if namespace do not exist', () => {
            const error = { httpStatusCode: 404 }
            apiMock.get.mockReturnValueOnce(Promise.reject(error))

Severity: Major
Found in src/datastore/__tests__/UserDataStore.spec.js and 1 other location - About 1 day to fix
src/datastore/__tests__/DataStore.spec.js on lines 155..173

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

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('create()', () => {
        it('should return an instance of DataStore if namespace do not exist', () => {
            const error = { httpStatusCode: 404 }
            apiMock.get.mockReturnValueOnce(Promise.reject(error))

Severity: Major
Found in src/datastore/__tests__/DataStore.spec.js and 1 other location - About 1 day to fix
src/datastore/__tests__/UserDataStore.spec.js on lines 172..190

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

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('getAll()', () => {
        it('should return an array of namespaces', () => {
            apiMock.get.mockReturnValueOnce(Promise.resolve(namespaces))

            expect.assertions(1)
Severity: Major
Found in src/datastore/__tests__/DataStore.spec.js and 1 other location - About 7 hrs to fix
src/datastore/__tests__/UserDataStore.spec.js on lines 120..140

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

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('getAll()', () => {
        it('should return an array of namespaces', () => {
            apiMock.get.mockReturnValueOnce(Promise.resolve(namespaces))

            expect.assertions(1)
Severity: Major
Found in src/datastore/__tests__/UserDataStore.spec.js and 1 other location - About 7 hrs to fix
src/datastore/__tests__/DataStore.spec.js on lines 107..127

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

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('.withEventStatus()', () => {
            it('should add the eventStatus parameter with the specified value', () => {
                request.withEventStatus('ACTIVE')

                expect(request.parameters).toEqual({ eventStatus: 'ACTIVE' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 506..528
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 530..552
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 554..572
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 574..594
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 638..660
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 662..682

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

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('.withSortOrder()', () => {
            it('should add the sortOrder parameter with the specified value', () => {
                request.withSortOrder('ASC')

                expect(request.parameters).toEqual({ sortOrder: 'ASC' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 506..528
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 530..552
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 554..572
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 574..594
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 596..616
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 638..660

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

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('.withOuMode()', () => {
            it('should add the ouMode parameter with the specified value', () => {
                request.withOuMode('DESCENDANTS')

                expect(request.parameters).toEqual({ ouMode: 'DESCENDANTS' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 506..528
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 530..552
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 574..594
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 596..616
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 638..660
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 662..682

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

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('.withProgramStatus()', () => {
            it('should add the programStatus parameter with the specified value', () => {
                request.withProgramStatus('ACTIVE')

                expect(request.parameters).toEqual({ programStatus: 'ACTIVE' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 506..528
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 530..552
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 554..572
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 574..594
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 596..616
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 662..682

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

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('.withAggregationType()', () => {
            it('should add the aggregationType parameter with the specified value', () => {
                request.withAggregationType('SUM')

                expect(request.parameters).toEqual({ aggregationType: 'SUM' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 530..552
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 554..572
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 574..594
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 596..616
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 638..660
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 662..682

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

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('.withDisplayProperty()', () => {
            it('should add the displayProperty parameter with the specified value', () => {
                request.withDisplayProperty('NAME')

                expect(request.parameters).toEqual({ displayProperty: 'NAME' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 506..528
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 554..572
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 574..594
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 596..616
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 638..660
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 662..682

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

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('.withOutputType()', () => {
            it('should add the outputType parameter with the specified value', () => {
                request.withOutputType('EVENT')

                expect(request.parameters).toEqual({ outputType: 'EVENT' })
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 6 other locations - About 6 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 506..528
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 530..552
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 554..572
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 596..616
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 638..660
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 662..682

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

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('.addPeriodDimension()', () => {
            it('should add the pe dimension', () => {
                request.addPeriodDimension('2017-01')

                expect(request.dimensions).toEqual([
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 1 other location - About 5 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 237..258

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

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('.addPeriodFilter()', () => {
            it('should add the pe dimension filter', () => {
                request.addPeriodFilter('2017-01')

                expect(request.filters).toEqual([
Severity: Major
Found in src/analytics/__tests__/AnalyticsRequest.spec.js and 1 other location - About 5 hrs to fix
src/analytics/__tests__/AnalyticsRequest.spec.js on lines 140..161

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

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

        it('should return a UserDatastoreNamespace with keys if it exists', () => {
            apiMock.get
                .mockReturnValueOnce(Promise.resolve(namespaces))
                .mockReturnValueOnce(Promise.resolve(keys))

Severity: Major
Found in src/datastore/__tests__/UserDataStore.spec.js and 1 other location - About 4 hrs to fix
src/datastore/__tests__/DataStore.spec.js on lines 31..42

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

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