grommet/grommet

View on GitHub
src/js/components/DataTable/stories/data.js

Summary

Maintainability
F
4 days
Test Coverage

File data.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';

import { Box, Meter, Text, Tip } from 'grommet';

const amountFormatter = new Intl.NumberFormat('en-US', {
Severity: Minor
Found in src/js/components/DataTable/stories/data.js - About 2 hrs to fix

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

    export const DATA = [
      {
        name: 'Alan',
        location: '',
        date: '',
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 2 other locations - About 1 day to fix
    src/js/components/DataTable/stories/AllowSelectAll.js on lines 6..63
    src/js/components/DataTable/stories/ColumnSize.js on lines 5..62

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

    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

      {
        property: 'savings',
        header: (
          <Text color="text-strong" weight="bold">
            Savings{' '}
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 1 other location - About 4 hrs to fix
    src/js/components/DataTable/stories/MultiplePin.js on lines 239..253

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 126.

    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

    for (let i = 0; i < 40; i += 1) {
      data.push({
        name: `Name ${i + 1}`,
        location: locations[i % locations.length],
        date: `2018-07-${(i % 30) + 1}`,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 1 other location - About 4 hrs to fix
    src/js/components/List/stories/onClickItem.js on lines 15..23

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

    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

        header: (
          <Box pad={{ horizontal: 'small', vertical: 'xsmall' }}>
            <Text color="text-strong" weight="bold">
              Pinned{' '}
              <Text size="xsmall" weight="normal" color="text">
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 1 other location - About 2 hrs to fix
    src/js/components/DataTable/stories/MultiplePin.js on lines 217..226

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

    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

            <Box pad={{ vertical: 'xsmall' }}>
              <Meter
                values={[{ value: pinned / pinnable, color: 'graph-0' }]}
                max={1}
                thickness="small"
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 1 other location - About 1 hr to fix
    src/js/components/DataTable/stories/MultiplePin.js on lines 228..235

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

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

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

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

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

    Refactorings

    Further Reading

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

      {
        id: 'om2hy2z79kyz',
        poolName: 'Dev36-erray01',
        arrays: 'harm-stage-array02',
        size: 190655321234567,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 135..146
    src/js/components/DataTable/stories/data.js on lines 147..158
    src/js/components/DataTable/stories/data.js on lines 171..182
    src/js/components/DataTable/stories/data.js on lines 183..194
    src/js/components/DataTable/stories/data.js on lines 195..206
    src/js/components/DataTable/stories/data.js on lines 207..218

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

      {
        id: 'l3d8xkm0knx4',
        poolName: 'asup-array2',
        arrays: 'ds-array02',
        size: 90655321234567,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 135..146
    src/js/components/DataTable/stories/data.js on lines 147..158
    src/js/components/DataTable/stories/data.js on lines 159..170
    src/js/components/DataTable/stories/data.js on lines 171..182
    src/js/components/DataTable/stories/data.js on lines 183..194
    src/js/components/DataTable/stories/data.js on lines 207..218

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

      {
        id: '6d9u4hv95xjq',
        poolName: 'asup-array1',
        arrays: 'harm-stage-array04',
        size: 130655321234567,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 135..146
    src/js/components/DataTable/stories/data.js on lines 147..158
    src/js/components/DataTable/stories/data.js on lines 159..170
    src/js/components/DataTable/stories/data.js on lines 183..194
    src/js/components/DataTable/stories/data.js on lines 195..206
    src/js/components/DataTable/stories/data.js on lines 207..218

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

      {
        id: 'jsjas87qeqgj',
        poolName: 'Dev36-varray02',
        arrays: 'ds-array01',
        size: 101655321234567,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 135..146
    src/js/components/DataTable/stories/data.js on lines 147..158
    src/js/components/DataTable/stories/data.js on lines 159..170
    src/js/components/DataTable/stories/data.js on lines 171..182
    src/js/components/DataTable/stories/data.js on lines 183..194
    src/js/components/DataTable/stories/data.js on lines 195..206

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

      {
        id: 'mjbpiclthh8y',
        poolName: 'Asup-array01-lvs',
        arrays: 'asup-array01-lvs',
        size: 16099511627776,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 147..158
    src/js/components/DataTable/stories/data.js on lines 159..170
    src/js/components/DataTable/stories/data.js on lines 171..182
    src/js/components/DataTable/stories/data.js on lines 183..194
    src/js/components/DataTable/stories/data.js on lines 195..206
    src/js/components/DataTable/stories/data.js on lines 207..218

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

      {
        id: 'hx5f2e57phfb',
        poolName: 'Dev-K8-Sym-R5-3',
        arrays: 'harm-stage-array01',
        size: 224520271234567,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 135..146
    src/js/components/DataTable/stories/data.js on lines 159..170
    src/js/components/DataTable/stories/data.js on lines 171..182
    src/js/components/DataTable/stories/data.js on lines 183..194
    src/js/components/DataTable/stories/data.js on lines 195..206
    src/js/components/DataTable/stories/data.js on lines 207..218

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

      {
        id: 'qpsidi3ccnpr',
        poolName: 'Dev-K8-Sym-R5-3',
        arrays: 'Harm-cs-stage-R4-5',
        size: 68994941234567,
    Severity: Major
    Found in src/js/components/DataTable/stories/data.js and 6 other locations - About 1 hr to fix
    src/js/components/DataTable/stories/data.js on lines 135..146
    src/js/components/DataTable/stories/data.js on lines 147..158
    src/js/components/DataTable/stories/data.js on lines 159..170
    src/js/components/DataTable/stories/data.js on lines 171..182
    src/js/components/DataTable/stories/data.js on lines 195..206
    src/js/components/DataTable/stories/data.js on lines 207..218

    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

    There are no issues that match your filters.

    Category
    Status