nexxtway/react-rainbow

View on GitHub
src/components/TimePicker/__test__/timeSelect.spec.js

Summary

Maintainability
F
2 wks
Test Coverage

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

import React from 'react';
import { mount } from 'enzyme';
import TimeSelect from '../timeSelect';
import {
    LEFT_KEY,
Severity: Major
Found in src/components/TimePicker/__test__/timeSelect.spec.js - About 1 day to fix

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

        it('should set hour value to "01" when press up key after reset hour input', () => {
            const component = mount(<TimeSelect />);
            const hourInput = component.find('input').at(0);
            const container = component.find('div[role="presentation"]');
            hourInput.simulate('change', { target: { value: '7' } });
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 6 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 438..451

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

    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 reset minutes input when has a value and press delete key while it is focused', () => {
            const component = mount(<TimeSelect />);
            const minutesInput = component.find('input').at(1);
            const container = component.find('div[role="presentation"]');
            minutesInput.simulate('change', { target: { value: '20' } });
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 6 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 452..465

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

    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

        it('should set hour value to "02" when hour input is focused, click up button and then type "2"', () => {
            const component = mount(<TimeSelect />);
            const upButton = component.find(ButtonIcon).at(0);
            const hourInput = component.find('input').at(0);
            hourInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 6 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 171..184
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 329..342
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 356..369

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

    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

        it('should set minutes value to "02" when minutes input is focused and click up button and then type "2"', () => {
            const component = mount(<TimeSelect />);
            const upButton = component.find(ButtonIcon).at(0);
            const minutesInput = component.find('input').at(1);
            minutesInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 6 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 144..157
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 171..184
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 356..369

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

    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

        it('should set minutes value to "02" when minutes input is focused and click down button and then type "2"', () => {
            const component = mount(<TimeSelect />);
            const downButton = component.find(ButtonIcon).at(1);
            const minutesInput = component.find('input').at(1);
            minutesInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 6 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 144..157
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 171..184
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 329..342

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

    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

        it('should set hour value to "02" when hour input is focused, click down button and then type "2"', () => {
            const component = mount(<TimeSelect />);
            const downButton = component.find(ButtonIcon).at(1);
            const hourInput = component.find('input').at(0);
            hourInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 6 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 144..157
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 329..342
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 356..369

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

    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

            values.forEach((value, index) => {
                const hourInput = component.find('input').at(0);
                hourInput.simulate('focus');
                hourInput.simulate('change', { target: { value } });
                const focusedElementDataId = document.activeElement.getAttribute('data-id');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 302..314

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

    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

            values.forEach((value, index) => {
                const minutesInput = component.find('input').at(1);
                minutesInput.simulate('focus');
                minutesInput.simulate('change', { target: { value } });
                const focusedElementAriaLabel = document.activeElement.getAttribute('aria-label');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 117..129

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

    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

        it('should set hour value to "01" when hour input is focused and click up button', () => {
            const component = mount(<TimeSelect />);
            const upButton = component.find(ButtonIcon).at(0);
            const hourInput = component.find('input').at(0);
            hourInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 158..170
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 316..328
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 343..355

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

    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

        it('should set minutes value to "00" when minutes input is focused and click up button', () => {
            const component = mount(<TimeSelect />);
            const upButton = component.find(ButtonIcon).at(0);
            const minutesInput = component.find('input').at(1);
            minutesInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 131..143
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 158..170
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 343..355

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

    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

        it('should set minutes value to "59" when minutes input is focused and click down button', () => {
            const component = mount(<TimeSelect />);
            const downButton = component.find(ButtonIcon).at(1);
            const minutesInput = component.find('input').at(1);
            minutesInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 131..143
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 158..170
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 316..328

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

    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

        it('should set hour value to "12" when hour input is focused and click down button', () => {
            const component = mount(<TimeSelect />);
            const downButton = component.find(ButtonIcon).at(1);
            const hourInput = component.find('input').at(0);
            hourInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 131..143
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 316..328
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 343..355

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('should set minutes value to "00" when minutes input is focused and press up key', () => {
            const component = mount(<TimeSelect />);
            const minutesInput = component.find('input').at(1);
            const container = component.find('div[role="presentation"]');
            minutesInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 2 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 28..40
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 241..253

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('should set hour value to "12" when hour input is focused and press down key', () => {
            const component = mount(<TimeSelect />);
            const hourInput = component.find('input').at(0);
            const container = component.find('div[role="presentation"]');
            hourInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 2 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 228..240
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 241..253

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('should set minutes value to "59" when minutes input is focused and press down key', () => {
            const component = mount(<TimeSelect />);
            const minutesInput = component.find('input').at(1);
            const container = component.find('div[role="presentation"]');
            minutesInput.simulate('focus');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 2 other locations - About 5 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 28..40
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 228..240

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

    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 keep the ampm input focused when it is focused and press right key', () => {
            const component = mount(<TimeSelect />);
            const container = component.find('div[role="presentation"]');
            container.simulate('keyDown', { keyCode: RIGHT_KEY });
            container.simulate('keyDown', { keyCode: RIGHT_KEY });
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 4 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 377..385

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

    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 focus minutes input when ampm input is focused and press left key', () => {
            const component = mount(<TimeSelect />);
            const container = component.find('div[role="presentation"]');
            container.simulate('keyDown', { keyCode: RIGHT_KEY });
            container.simulate('keyDown', { keyCode: RIGHT_KEY });
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 4 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 397..405

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

    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

        it('should call event.preventDefault when something is dropped on minutes input', () => {
            const preventDefaultMockFn = jest.fn();
            const component = mount(<TimeSelect />);
            const minutesInput = component.find('input').at(1);
            minutesInput.simulate('drop', {
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 543..551
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 552..560
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 561..569

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

    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

        it('should call event.preventDefault when something is pasted on hour input', () => {
            const preventDefaultMockFn = jest.fn();
            const component = mount(<TimeSelect />);
            const hourInput = component.find('input').at(0);
            hourInput.simulate('paste', {
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 552..560
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 561..569
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 570..578

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

    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

        it('should call event.preventDefault when something is pasted on minutes input', () => {
            const preventDefaultMockFn = jest.fn();
            const component = mount(<TimeSelect />);
            const minutesInput = component.find('input').at(1);
            minutesInput.simulate('paste', {
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 543..551
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 552..560
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 570..578

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

    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

        it('should call event.preventDefault when something is dropped on hour input', () => {
            const preventDefaultMockFn = jest.fn();
            const component = mount(<TimeSelect />);
            const hourInput = component.find('input').at(0);
            hourInput.simulate('drop', {
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 3 other locations - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 543..551
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 561..569
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 570..578

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

    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 call onCloseModal when click the OK button', () => {
            const onCloseModalMockFn = jest.fn();
            const component = mount(<TimeSelect onCloseModal={onCloseModalMockFn} />);
            const okButton = component.find('Button').at(1);
            okButton.simulate('click');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 508..514

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

    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 call onCloseModal when click the cancel button', () => {
            const onCloseModalMockFn = jest.fn();
            const component = mount(<TimeSelect onCloseModal={onCloseModalMockFn} />);
            const cancelButton = component.find('Button').at(0);
            cancelButton.simulate('click');
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 515..521

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

    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 call onCloseModal when when press enter key', () => {
            const onCloseModalMockFn = jest.fn();
            const component = mount(<TimeSelect onCloseModal={onCloseModalMockFn} />);
            const container = component.find('div[role="presentation"]');
            container.simulate('keyDown', { keyCode: ENTER_KEY });
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 536..542

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

    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 not call onChange when press enter key while hour, minutes and ampm has not value', () => {
            const onChangeMockFn = jest.fn();
            const component = mount(<TimeSelect onChange={onChangeMockFn} />);
            const container = component.find('div[role="presentation"]');
            container.simulate('keyDown', { keyCode: ENTER_KEY });
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 501..507

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

    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 call event.preventDefault when press enter key', () => {
            const preventDefaultMockFn = jest.fn();
            const component = mount(<TimeSelect />);
            const container = component.find('div[role="presentation"]');
            container.simulate('keyDown', {
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 481..490

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

    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 call event.stopPropagation when press enter key', () => {
            const stopPropagationMockFn = jest.fn();
            const component = mount(<TimeSelect />);
            const container = component.find('div[role="presentation"]');
            container.simulate('keyDown', {
    Severity: Major
    Found in src/components/TimePicker/__test__/timeSelect.spec.js and 1 other location - About 3 hrs to fix
    src/components/TimePicker/__test__/timeSelect.spec.js on lines 491..500

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

    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