grommet/grommet

View on GitHub
src/js/components/Select/__tests__/Select-test.js

Summary

Maintainability
F
1 wk
Test Coverage

File Select-test.js has 1454 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { render, fireEvent, act, screen } from '@testing-library/react';
import { axe } from 'jest-axe';
import 'jest-axe/extend-expect';
import 'jest-styled-components';
Severity: Major
Found in src/js/components/Select/__tests__/Select-test.js - About 3 days to fix

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

      test('renders styled select options using select.options.container', () => {
        const customTheme = {
          select: {
            options: {
              container: {
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 1 day to fix
    src/js/components/Select/__tests__/Select-test.js on lines 832..862

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

    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

          documentation (select.options.box)`, () => {
        const customTheme = {
          select: {
            options: {
              box: {
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 1 day to fix
    src/js/components/Select/__tests__/Select-test.js on lines 864..894

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

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

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

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

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

    Refactorings

    Further Reading

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

        const Test = () => {
          const [value] = React.useState();
          return (
            <Select
              id="test-select"
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 3 hrs to fix
    src/js/components/Select/__tests__/Select-test.js on lines 307..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 98.

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

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

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

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

    Refactorings

    Further Reading

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

        const Test = () => {
          const [value] = React.useState();
          return (
            <Select
              id="test-select"
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 3 hrs to fix
    src/js/components/Select/__tests__/Select-test.js on lines 260..281

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

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

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

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

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

    Refactorings

    Further Reading

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

        const Test = () => {
          const [value] = React.useState();
          return (
            <FormField label="Test" name="test">
              <Select
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 3 hrs to fix
    src/js/components/Select/__tests__/Select-test.js on lines 1376..1390

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

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

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

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

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

    Refactorings

    Further Reading

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

        const Test = () => {
          const [value] = React.useState();
          return (
            <FormField label="Test" name="test">
              <Select
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 3 hrs to fix
    src/js/components/Select/__tests__/Select-test.js on lines 1402..1416

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

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

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

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

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

    Refactorings

    Further Reading

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

        const Test = () => {
          const [value] = React.useState();
          return (
            <Select
              id="test-select"
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 2 hrs to fix
    src/js/components/Select/__tests__/Select-test.js on lines 1353..1364

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

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

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

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

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

    Refactorings

    Further Reading

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

        const Test = () => {
          const [value] = React.useState();
          return (
            <Select
              id="test-select"
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 2 hrs to fix
    src/js/components/Select/__tests__/Select-test.js on lines 1323..1334

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

    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

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

        const { getAllByRole, getByPlaceholderText } = render(
          <Grommet>
            <Select
              id="test-select"
              options={['one', 'two']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 1628..1637

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

    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

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

        const { getAllByRole, getByPlaceholderText } = render(
          <Grommet>
            <Select
              id="test-select"
              options={['one', 'two']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 1595..1604

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

    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

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

        const { getByPlaceholderText, container } = render(
          <Select
            id="test-select"
            placeholder="test select"
            options={['one', 'two', 'three']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 677..684

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

    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

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

        const { getByPlaceholderText, container } = render(
          <Select
            id="test-select"
            placeholder="test select"
            options={['one', 'two', 'three']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 610..617

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

    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

        const { getByPlaceholderText, container } = render(
          <Select
            id="test-select"
            placeholder="test select"
            options={['one', 'two']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 3 other locations - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 69..76
    src/js/components/Select/__tests__/Select-test.js on lines 94..101
    src/js/components/Select/__tests__/Select-test.js on lines 552..559

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

    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

        const { getByPlaceholderText, container } = render(
          <Select
            placeholder="test select"
            id="test-select"
            options={['one', 'two']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 3 other locations - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 94..101
    src/js/components/Select/__tests__/Select-test.js on lines 552..559
    src/js/components/Select/__tests__/Select-test.js on lines 577..584

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

    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

        const { getByPlaceholderText, container } = render(
          <Select
            id="test-select"
            placeholder="test select"
            options={['one', 'two']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 3 other locations - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 69..76
    src/js/components/Select/__tests__/Select-test.js on lines 94..101
    src/js/components/Select/__tests__/Select-test.js on lines 577..584

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

    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

        const { getByPlaceholderText, container } = render(
          <Select
            placeholder="test select"
            id="test-select"
            options={['one', 'two']}
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 3 other locations - About 1 hr to fix
    src/js/components/Select/__tests__/Select-test.js on lines 69..76
    src/js/components/Select/__tests__/Select-test.js on lines 552..559
    src/js/components/Select/__tests__/Select-test.js on lines 577..584

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

    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

        const { getByPlaceholderText, getByText, container, asFragment } = render(
          <Grommet>
            <Test />
          </Grommet>,
        );
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 4 other locations - About 50 mins to fix
    src/js/components/Form/__tests__/Form-test-uncontrolled.js on lines 1564..1569
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 175..179
    src/js/components/Select/__tests__/Select-test.js on lines 282..286
    src/js/components/Select/__tests__/Select-test.js on lines 375..379

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

    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

        const { getByPlaceholderText, getByText, container, asFragment } = render(
          <Grommet>
            <Test />
          </Grommet>,
        );
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 4 other locations - About 50 mins to fix
    src/js/components/Form/__tests__/Form-test-uncontrolled.js on lines 1564..1569
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 175..179
    src/js/components/Select/__tests__/Select-test.js on lines 375..379
    src/js/components/Select/__tests__/Select-test.js on lines 423..427

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

    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

        const { getByPlaceholderText, getByText, container, asFragment } = render(
          <Grommet>
            <Test />
          </Grommet>,
        );
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 4 other locations - About 50 mins to fix
    src/js/components/Form/__tests__/Form-test-uncontrolled.js on lines 1564..1569
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 175..179
    src/js/components/Select/__tests__/Select-test.js on lines 282..286
    src/js/components/Select/__tests__/Select-test.js on lines 423..427

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

    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

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

        const customTheme = {
          global: {
            hover: {
              background: {
                color: 'lightgreen',
    Severity: Minor
    Found in src/js/components/Select/__tests__/Select-test.js and 1 other location - About 35 mins to fix
    src/js/components/MaskedInput/__tests__/MaskedInput-test.js on lines 396..408

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

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

        const { getByPlaceholderText, getByText, asFragment } = render(
          <Grommet>
            <Test />
          </Grommet>,
        );
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 15 other locations - About 35 mins to fix
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 36..40
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 214..218
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 256..260
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 299..303
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 362..366
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 486..490
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 592..596
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 731..735
    src/js/components/Form/__tests__/Form-test-uncontrolled.js on lines 1404..1408
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 246..250
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 316..320
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 387..391
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 436..440
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 476..480
    src/js/components/Select/__tests__/Select-test.js on lines 471..475

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

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

        const { getByPlaceholderText, getByText, asFragment } = render(
          <Grommet>
            <Test />
          </Grommet>,
        );
    Severity: Major
    Found in src/js/components/Select/__tests__/Select-test.js and 15 other locations - About 35 mins to fix
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 36..40
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 214..218
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 256..260
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 299..303
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 362..366
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 486..490
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 592..596
    src/js/components/Form/__tests__/Form-test-controlled.js on lines 731..735
    src/js/components/Form/__tests__/Form-test-uncontrolled.js on lines 1404..1408
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 246..250
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 316..320
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 387..391
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 436..440
    src/js/components/Select/__tests__/Select-multiple-test.js on lines 476..480
    src/js/components/Select/__tests__/Select-test.js on lines 329..333

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

    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