src/period/generators/__tests__/index.spec.js

Summary

Maintainability
F
2 wks
Test Coverage

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

import { createPeriodGeneratorsForLocale } from '..'
import * as daily from '../daily'
import * as weekly from '../weekly'
import * as monthly from '../monthly'
import * as bimonthly from '../bi-monthly'
Severity: Minor
Found in src/period/generators/__tests__/index.spec.js - About 5 hrs to fix

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

            describe('weekly', () => {
                beforeEach(() => {
                    jest.spyOn(weekly, 'generateWeeklyPeriodsForYear')
                })
    
    
    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 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('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

    There are no issues that match your filters.

    Category
    Status