ant-design/ant-design

View on GitHub
components/table/__tests__/Table.filter.test.tsx

Summary

Maintainability
F
1 wk
Test Coverage

File Table.filter.test.tsx has 2604 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-unsafe-optional-chaining */
/* eslint-disable react/no-multi-comp */
import React, { useEffect, useState } from 'react';

import type { ColumnGroupType, ColumnType, TableProps } from '..';
Severity: Major
Found in components/table/__tests__/Table.filter.test.tsx - About 1 wk to fix

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

        const App: React.FC = () => {
          const [ddd, setData] = React.useState<Array<DataType>>([
            {
              key: '1',
              name: 'John Brown',
    Severity: Major
    Found in components/table/__tests__/Table.filter.test.tsx - About 3 hrs to fix

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

          const App: React.FC = () => {
            const [filteredInfo, setFilteredInfo] = useState<Record<string, FilterValue | null>>({});
            const [sortedInfo, setSortedInfo] = useState<SorterResult<any> | SorterResult<any>[]>({});
            const handleChange: TableProps<any>['onChange'] = (_, filters, sorter) => {
              setFilteredInfo(filters);
      Severity: Major
      Found in components/table/__tests__/Table.filter.test.tsx - About 2 hrs to fix

        Function handleClick has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              const handleClick = () => {
                setCs([
                  {
                    title: 'name1',
                    dataIndex: 'name1',
        Severity: Minor
        Found in components/table/__tests__/Table.filter.test.tsx - About 1 hr to fix

          Function Demo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              const Demo: React.FC = () => {
                const [name, setName] = React.useState<ColumnType<any>['filteredValue']>();
                const onChange = () => {
                  setName('' as unknown as ColumnType<any>['filteredValue']);
                };
          Severity: Minor
          Found in components/table/__tests__/Table.filter.test.tsx - About 1 hr to fix

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

              function renderedNames(container: ReturnType<typeof render>['container']) {
                const namesList: (Node['textContent'] | undefined)[] = [];
                container
                  ?.querySelector('.ant-table-tbody')
                  ?.querySelectorAll('tr')
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 2 hrs to fix
            components/table/__tests__/Table.sorter.test.tsx on lines 38..47

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

                const testData = [
                  { key: 0, name: 'Jack', age: 11 },
                  { key: 1, name: 'Lucy', age: 20 },
                  { key: 2, name: 'Tom', age: 21 },
                  { key: 3, name: 'Jerry', age: 22 },
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 7 other locations - About 2 hrs to fix
            components/table/__tests__/Table.filter.test.tsx on lines 2849..2854
            components/table/__tests__/Table.sorter.test.tsx on lines 518..523
            components/table/__tests__/Table.sorter.test.tsx on lines 535..540
            components/table/__tests__/Table.sorter.test.tsx on lines 555..560
            components/table/__tests__/Table.sorter.test.tsx on lines 589..594
            components/table/__tests__/Table.sorter.test.tsx on lines 642..647
            components/table/__tests__/Table.sorter.test.tsx on lines 703..708

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

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

                const testData = [
                  { key: 0, name: 'Jack', age: 11 },
                  { key: 1, name: 'Lucy', age: 20 },
                  { key: 2, name: 'Tom', age: 21 },
                  { key: 3, name: 'Jerry', age: 22 },
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 7 other locations - About 2 hrs to fix
            components/table/__tests__/Table.filter.test.tsx on lines 879..884
            components/table/__tests__/Table.sorter.test.tsx on lines 518..523
            components/table/__tests__/Table.sorter.test.tsx on lines 535..540
            components/table/__tests__/Table.sorter.test.tsx on lines 555..560
            components/table/__tests__/Table.sorter.test.tsx on lines 589..594
            components/table/__tests__/Table.sorter.test.tsx on lines 642..647
            components/table/__tests__/Table.sorter.test.tsx on lines 703..708

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

            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

                      {
                        title: 'Address',
                        dataIndex: 'address',
                        filters: [
                          {
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1913..1927

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

            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

                  {
                    title: 'Address',
                    dataIndex: 'address',
                    filters: [
                      {
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1965..1979

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

            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

                onChange.mock.calls.forEach(([, currentFilters]) => {
                  const [, val] = Object.entries(currentFilters)[0];
                  expect(val).toEqual(['test']);
                });
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 731..734

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

            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

                onChange.mock.calls.forEach(([, currentFilters]) => {
                  const [, val] = Object.entries(currentFilters)[0];
                  expect(val).toEqual(['Jack']);
                });
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1080..1083

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

            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

                      {
                        title: 'English Score1',
                        dataIndex: 'english1',
                        filters: [{ text: '2', value: 2 }],
                        onFilter: (record: any) => String(record.english2).includes(String(2)),
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1647..1652

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

            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

                      {
                        title: 'English Score2',
                        dataIndex: 'english2',
                        filters: [{ text: '2', value: 3 }],
                        onFilter: (record: any) => String(record.english2).includes(String(3)),
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1641..1646

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

            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 data = [
                { key: 0, name: 'Jack' },
                { key: 1, name: 'Lucy' },
                { key: 2, name: 'Tom' },
                { key: 3, name: 'Jerry' },
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 4 other locations - About 1 hr to fix
            components/table/__tests__/Table.order.test.tsx on lines 29..34
            components/table/__tests__/Table.pagination.test.tsx on lines 20..25
            components/table/__tests__/Table.rowSelection.test.tsx on lines 31..36
            components/table/__tests__/Table.sorter.test.tsx on lines 20..25

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

                const Test = () => (
                  <Table
                    rowKey="name"
                    columns={[{ title: 'Name', dataIndex: 'name', filterDropdown }]}
                    dataSource={[{ name: 'Jack' }]}
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1292..1298

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

                const Test: React.FC = () => (
                  <Table
                    rowKey="name"
                    columns={[{ title: 'Name', dataIndex: 'name', filterDropdown }]}
                    dataSource={[{ name: 'Jack' }]}
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1272..1278

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

                const { container } = render(
                  createTable({
                    onChange,
                    columns: [
                      {
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1032..1044

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

                const { container } = render(
                  createTable({
                    onChange,
                    columns: [
                      {
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 1 hr to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1061..1073

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

                      {
                        text: 'Level3',
                        value: 'Level3',
                        children: [
                          { text: 'Black', value: 'Black' },
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 7 other locations - About 55 mins to fix
            components/cascader/demo/showCheckedStrategy.tsx on lines 24..41
            components/menu/demo/sider-current.tsx on lines 27..35
            components/menu/demo/sider-current.tsx on lines 36..44
            components/tree/demo/basic-controlled.tsx on lines 10..18
            components/tree/demo/basic-controlled.tsx on lines 19..27
            components/tree/demo/basic-controlled.tsx on lines 34..42
            components/tree/demo/switcher-icon.tsx on lines 11..28

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

            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('renders filter correctly', () => {
                const { asFragment } = render(createTable());
            
                expect(asFragment().firstChild).toMatchSnapshot();
              });
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 55 mins to fix
            components/table/__tests__/Table.pagination.test.tsx on lines 51..54

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

            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

                          filters: [
                            {
                              text: '123',
                              value: '456',
                            },
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 55 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 2183..2187

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

            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

                          filters: [
                            { text: '123', value: '123' },
                            { text: 123456, value: '456' },
                            { text: <span>123</span>, value: '456' },
                          ],
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 55 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 2143..2156

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

            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 dataSource = [
                  {
                    key: '1',
                    name: 'John Brown',
                    age: 32,
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 50 mins to fix
            components/descriptions/demo/text.tsx on lines 5..18
            components/modal/demo/dark.tsx on lines 223..236

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

            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

              function refreshTimer() {
                for (let i = 0; i < 3; i += 1) {
                  act(() => {
                    jest.runAllTimers();
                  });
            Severity: Major
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 50 mins to fix
            components/collapse/__tests__/index.test.tsx on lines 13..19
            components/menu/__tests__/index.test.tsx on lines 31..37

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

                expect(handleChange).toHaveBeenCalledWith(
                  {
                    current: 1,
                    pageSize: 10,
                  },
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 45 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1363..1374

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

            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

                expect(handleChange).toHaveBeenCalledWith(
                  {
                    current: 1,
                    pageSize: 10,
                  },
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 1 other location - About 45 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 1330..1341

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

            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, rerender } = render(
                  createTable({
                    columns: [
                      {
                        ...column,
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 30 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 386..395
            components/table/__tests__/Table.filter.test.tsx on lines 523..532

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

            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, rerender } = render(
                  createTable({
                    columns: [
                      {
                        ...column,
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 30 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 386..395
            components/table/__tests__/Table.filter.test.tsx on lines 452..461

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

            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

                    expect(
                      container
                        ?.querySelector('.ant-table-filter-dropdown')
                        ?.querySelectorAll<HTMLInputElement>('.ant-checkbox-input')[0].checked,
                    ).toBe(false);
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 30 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 495..499
            components/table/__tests__/Table.filter.test.tsx on lines 515..519

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

            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

                  expect(
                    container
                      ?.querySelector('.ant-table-filter-dropdown')
                      ?.querySelectorAll<HTMLInputElement>('.ant-checkbox-input')[0].checked,
                  ).toBe(true);
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 30 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 515..519
            components/table/__tests__/Table.filter.test.tsx on lines 800..804

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

            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

                expect(
                  container
                    ?.querySelector('.ant-table-filter-dropdown')
                    ?.querySelectorAll<HTMLInputElement>('.ant-checkbox-input')[0]?.checked,
                ).toBe(false);
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 30 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 495..499
            components/table/__tests__/Table.filter.test.tsx on lines 800..804

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

            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, rerender } = render(
                  createTable({
                    columns: [
                      {
                        ...column,
            Severity: Minor
            Found in components/table/__tests__/Table.filter.test.tsx and 2 other locations - About 30 mins to fix
            components/table/__tests__/Table.filter.test.tsx on lines 452..461
            components/table/__tests__/Table.filter.test.tsx on lines 523..532

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

            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