grommet/grommet

View on GitHub
src/js/components/DataTable/__tests__/DataTable-test.tsx

Summary

Maintainability
F
2 wks
Test Coverage

File DataTable-test.tsx has 1782 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useState } from 'react';
import 'jest-styled-components';
import { render, fireEvent, screen } from '@testing-library/react';

import { Grommet } from '../../Grommet';
Severity: Major
Found in src/js/components/DataTable/__tests__/DataTable-test.tsx - About 4 days to fix

    Function App has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        const App = () => {
          const [groupSelected] = React.useState<{
            [key: string]: 'all' | 'some' | 'none';
          }>({ '': 'some', 'Fort Collins': 'some' });
    
    
    Severity: Major
    Found in src/js/components/DataTable/__tests__/DataTable-test.tsx - About 2 hrs to fix

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

          const { container, getByLabelText } = render(
            <Grommet>
              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1536..1553

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

      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 { container, getByLabelText } = render(
            <Grommet>
              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1502..1519

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

      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

          const { container } = render(
            <Grommet>
              {backgrounds.map((background) => (
                <DataTable
                  key={JSON.stringify(background)}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 2 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 738..755
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 968..985

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

      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

        test('themeColumnSizes', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 3 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 926..942
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 944..960
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1229..1245

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

      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

          const { container } = render(
            <Grommet>
              {fills.map((fill) => (
                <DataTable
                  key={JSON.stringify(fill)}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 2 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 707..724
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 738..755

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

      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

        test('relativeColumnSizes', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 3 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 908..924
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 926..942
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1229..1245

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

      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

        test('absoluteColumnSizes', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 3 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 908..924
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 944..960
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1229..1245

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

      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

        test('units', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 3 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 908..924
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 926..942
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 944..960

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

      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

          const { container } = render(
            <Grommet>
              {borders.map((border) => (
                <DataTable
                  key={JSON.stringify(border)}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 2 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 707..724
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 968..985

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

      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

        test('primaryKey', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 2 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1662..1679
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1681..1698

      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

        test('should base table body max height on global size', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 2 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 94..111
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1681..1698

      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

        test('should base table body max height on css value', () => {
          const { container } = render(
            <Grommet>
              <DataTable
                columns={[
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 2 other locations - About 5 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 94..111
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1662..1679

      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

                <DataTable
                  columns={[
                    { property: 'a', header: 'A' },
                    { property: 'b', header: 'B', primary: true },
                  ]}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 3 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1469..1481

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

      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

              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
                  { property: 'b', header: 'B', primary: true },
                ]}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 3 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 632..644

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

      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 { container, getByText } = render(
            <Grommet>
              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 2 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1387..1399

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

      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 { container, getAllByText } = render(
            <Grommet>
              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 2 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1342..1354

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

      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 { container, getAllByText } = render(
            <Grommet>
              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 2 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1408..1419

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

      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 { container, getByLabelText } = render(
            <Grommet>
              <DataTable
                columns={[
                  { property: 'a', header: 'A' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 2 hrs to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 1285..1296

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

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

        test('empty', () => {
          const { container } = render(
            <Grommet>
              <DataTable />
            </Grommet>,
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 12 other locations - About 1 hr to fix
      src/js/components/Box/__tests__/Box-test.tsx on lines 9..17
      src/js/components/Card/__tests__/Card-test.tsx on lines 43..51
      src/js/components/Cards/__tests__/Cards-test.tsx on lines 43..50
      src/js/components/DataSearch/__tests__/DataSearch-test.tsx on lines 31..39
      src/js/components/Footer/__tests__/Footer-test.tsx on lines 9..17
      src/js/components/Heading/__tests__/Heading-test.tsx on lines 8..16
      src/js/components/List/__tests__/List-test.tsx on lines 52..59
      src/js/components/Meter/__tests__/Meter-test.tsx on lines 11..19
      src/js/components/Paragraph/__tests__/Paragraph-test.tsx on lines 8..16
      src/js/components/Table/__tests__/Table-test.tsx on lines 15..23
      src/js/components/Tabs/__tests__/Tabs-test.tsx on lines 40..48
      src/js/components/WorldMap/__tests__/WorldMap-test.tsx on lines 10..18

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

      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

                data={[
                  { a: 'zero', b: { value: 1 } },
                  { a: 'one', b: { value: 2 } },
                  { a: 'two', b: { value: 3 } },
                ]}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 1 hr to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 374..378

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

      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

                data={[
                  { a: 'zero', b: { value: 1 } },
                  { a: 'one', b: { value: 2 } },
                  { a: 'two', b: { value: 3 } },
                ]}
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 1 hr to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 338..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 62.

      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

                columns={[
                  { property: 'a', header: 'A' },
                  {
                    property: 'b.value',
                    header: 'Value',
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 1 hr to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 366..373

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

      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

                columns={[
                  { property: 'a', header: 'A' },
                  {
                    property: 'b.value',
                    header: 'Value',
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 1 hr to fix
      src/js/components/DataTable/__tests__/DataTable-test.tsx on lines 330..337

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

      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

                columns={[
                  { property: 'a', header: 'A' },
                  { property: 'b', header: 'B' },
                  { property: 'c', header: 'C' },
                  { property: 'd', header: 'D' },
      Severity: Major
      Found in src/js/components/DataTable/__tests__/DataTable-test.tsx and 1 other location - About 1 hr to fix
      src/js/components/SelectMultiple/__tests__/SelectMultiple-test.tsx on lines 72..77

      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

      There are no issues that match your filters.

      Category
      Status