streetmix/streetmix

View on GitHub

Showing 469 of 806 total issues

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

  it('renders element child without an <a> element in "offline" mode', () => {
    const { asFragment } = render(
      <ExternalLink href="https://example.com">
        <div>foo</div>
      </ExternalLink>,
Severity: Major
Found in client/src/ui/ExternalLink.test.jsx and 1 other location - About 2 hrs to fix
client/src/ui/ExternalLink.test.jsx on lines 29..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 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

  it('responds to an onClick handler', async () => {
    const handleClick = vi.fn()
    render(<StreetName onClick={handleClick} />)

    await userEvent.click(screen.getByText('Unnamed St'))
Severity: Major
Found in client/src/streets/StreetName.test.jsx and 1 other location - About 2 hrs to fix
client/src/menubar/MenuBar.test.jsx on lines 66..73

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

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('handles a menu item click', async () => {
    const handler = vi.fn()
    render(<MenuBar onMenuDropdownClick={handler} />)

    await userEvent.click(screen.getByText('Share'))
Severity: Major
Found in client/src/menubar/MenuBar.test.jsx and 1 other location - About 2 hrs to fix
client/src/streets/StreetName.test.jsx 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 82.

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

  if (segmentInfo.variants.indexOf('turn-lane-orientation') !== -1) {
    if (!right || !rightOwnerAsphalt) {
      variant['turn-lane-orientation'] = 'right'
    } else if (!left || !leftOwnerAsphalt) {
      variant['turn-lane-orientation'] = 'left'
Severity: Major
Found in client/src/segments/drag_and_drop.js and 1 other location - About 2 hrs to fix
client/src/segments/drag_and_drop.js on lines 307..313

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

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

  if (segmentInfo.variants.indexOf('parking-lane-orientation') !== -1) {
    if (!right || !rightOwnerAsphalt) {
      variant['parking-lane-orientation'] = 'right'
    } else if (!left || !leftOwnerAsphalt) {
      variant['parking-lane-orientation'] = 'left'
Severity: Major
Found in client/src/segments/drag_and_drop.js and 1 other location - About 2 hrs to fix
client/src/segments/drag_and_drop.js on lines 327..333

Duplicated Code

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

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

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

Tuning

This issue has a mass of 82.

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 when editable', () => {
    const { asFragment } = render(
      <StreetMetaWidthLabel
        street={dummyStreetObject}
        editable={true}
Severity: Major
Found in client/src/streets/StreetMeta/StreetMetaWidthLabel.test.jsx and 1 other location - About 2 hrs to fix
client/src/streets/StreetMeta/StreetMetaWidthLabel.test.jsx on lines 29..39

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

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 when not editable', () => {
    const { asFragment } = render(
      <StreetMetaWidthLabel
        street={dummyStreetObject}
        editable={false}
Severity: Major
Found in client/src/streets/StreetMeta/StreetMetaWidthLabel.test.jsx and 1 other location - About 2 hrs to fix
client/src/streets/StreetMeta/StreetMetaWidthLabel.test.jsx on lines 17..27

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

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

  it('parses a value with a space between it and the meters unit (3 m)', () => {
    const value = '3 m'

    const input1 = processWidthInput(value, SETTINGS_UNITS_METRIC)
    expect(input1).toEqual(3)
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 7 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 306..316
client/src/util/__tests__/width_units.test.js on lines 330..340
client/src/util/__tests__/width_units.test.js on lines 342..352
client/src/util/__tests__/width_units.test.js on lines 354..364
client/src/util/__tests__/width_units.test.js on lines 366..376
client/src/util/__tests__/width_units.test.js on lines 378..388
client/src/util/__tests__/width_units.test.js on lines 390..400

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

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

  it('parses a decimal value with meters unit (3.0m)', () => {
    const value = '3.0m'

    const input1 = processWidthInput(value, SETTINGS_UNITS_METRIC)
    expect(input1).toEqual(3)
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 7 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 306..316
client/src/util/__tests__/width_units.test.js on lines 318..328
client/src/util/__tests__/width_units.test.js on lines 342..352
client/src/util/__tests__/width_units.test.js on lines 354..364
client/src/util/__tests__/width_units.test.js on lines 366..376
client/src/util/__tests__/width_units.test.js on lines 378..388
client/src/util/__tests__/width_units.test.js on lines 390..400

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

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(result).toEqual({
      FOO_BAR: { source: 'initial', value: true },
      BAZ_QUX: { source: 'role:USER', value: true },
      FOO_BAZ: { source: 'initial', value: true },
      BAZ_BAR: { source: 'initial', value: false }
Severity: Major
Found in client/src/app/__tests__/flag_utils.test.js and 1 other location - About 2 hrs to fix
client/src/app/__tests__/flag_utils.test.js on lines 56..61

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

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

  it('parses `inches` unit', () => {
    const value = '6 inches'

    // Even in metric mode, the `inches` should cause the value to be
    // interpreted as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 36..46
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 80..90
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 128..138
client/src/util/__tests__/width_units.test.js on lines 140..150
client/src/util/__tests__/width_units.test.js on lines 152..162
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 260..270
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

  it('parses a value with decimeters unit (150dm)', () => {
    const value = '150dm'

    const input1 = processWidthInput(value, SETTINGS_UNITS_METRIC)
    expect(input1).toEqual(15)
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 7 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 306..316
client/src/util/__tests__/width_units.test.js on lines 318..328
client/src/util/__tests__/width_units.test.js on lines 330..340
client/src/util/__tests__/width_units.test.js on lines 342..352
client/src/util/__tests__/width_units.test.js on lines 366..376
client/src/util/__tests__/width_units.test.js on lines 378..388
client/src/util/__tests__/width_units.test.js on lines 390..400

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

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

  it("parses a value with a prime symbol (3')", () => {
    const value = "3'"

    // Even in metric mode, the prime symbol should cause the value to be
    // interpreted as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 80..90
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 128..138
client/src/util/__tests__/width_units.test.js on lines 140..150
client/src/util/__tests__/width_units.test.js on lines 152..162
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 176..186
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 260..270
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

  it('parses a decimal value with a space between it and the meters unit (3.0 m)', () => {
    const value = '3.0 m'

    const input1 = processWidthInput(value, SETTINGS_UNITS_METRIC)
    expect(input1).toEqual(3)
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 7 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 306..316
client/src/util/__tests__/width_units.test.js on lines 318..328
client/src/util/__tests__/width_units.test.js on lines 330..340
client/src/util/__tests__/width_units.test.js on lines 354..364
client/src/util/__tests__/width_units.test.js on lines 366..376
client/src/util/__tests__/width_units.test.js on lines 378..388
client/src/util/__tests__/width_units.test.js on lines 390..400

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

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

  it('parses `feet` unit (3 feet)', () => {
    const value = '3 feet'

    // Even in metric mode, the `feet` should cause the value to be interpreted
    // as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 36..46
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 80..90
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 140..150
client/src/util/__tests__/width_units.test.js on lines 152..162
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 176..186
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 260..270
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

  it('parses feet and inches with support for leading zero (0\'6")', () => {
    const value = "0'6"

    // Even in metric mode, the `ft` should cause the value to be interpreted
    // as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 36..46
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 80..90
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 128..138
client/src/util/__tests__/width_units.test.js on lines 140..150
client/src/util/__tests__/width_units.test.js on lines 152..162
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 176..186
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

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

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

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

Refactorings

Further Reading

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

  it('should handle hideDescription()', () => {
    expect(
      infoBubble(
        {
          visible: true,
Severity: Major
Found in client/src/store/slices/infoBubble.test.js and 3 other locations - About 2 hrs to fix
client/src/store/slices/infoBubble.test.js on lines 23..40
client/src/store/slices/infoBubble.test.js on lines 42..59
client/src/store/slices/infoBubble.test.js on lines 109..126

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

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

  it("parses a decimal with prime symbol (3.75')", () => {
    const value = "3.75'"

    // Even in metric mode, the prime symbol should cause the value to be
    // interpreted as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 36..46
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 128..138
client/src/util/__tests__/width_units.test.js on lines 140..150
client/src/util/__tests__/width_units.test.js on lines 152..162
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 176..186
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 260..270
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

  it('parses `in` unit', () => {
    const value = '12 in'

    // Even in metric mode, the `in` should cause the value to be interpreted
    // as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 36..46
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 80..90
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 128..138
client/src/util/__tests__/width_units.test.js on lines 152..162
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 176..186
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 260..270
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

  it('parses `in.` unit', () => {
    const value = '24 in.'

    // Even in metric mode, the `in.` should cause the value to be
    // interpreted as imperial units
Severity: Major
Found in client/src/util/__tests__/width_units.test.js and 18 other locations - About 2 hrs to fix
client/src/util/__tests__/width_units.test.js on lines 36..46
client/src/util/__tests__/width_units.test.js on lines 48..58
client/src/util/__tests__/width_units.test.js on lines 80..90
client/src/util/__tests__/width_units.test.js on lines 92..102
client/src/util/__tests__/width_units.test.js on lines 104..114
client/src/util/__tests__/width_units.test.js on lines 116..126
client/src/util/__tests__/width_units.test.js on lines 128..138
client/src/util/__tests__/width_units.test.js on lines 140..150
client/src/util/__tests__/width_units.test.js on lines 164..174
client/src/util/__tests__/width_units.test.js on lines 176..186
client/src/util/__tests__/width_units.test.js on lines 188..198
client/src/util/__tests__/width_units.test.js on lines 200..210
client/src/util/__tests__/width_units.test.js on lines 212..222
client/src/util/__tests__/width_units.test.js on lines 224..234
client/src/util/__tests__/width_units.test.js on lines 236..246
client/src/util/__tests__/width_units.test.js on lines 248..258
client/src/util/__tests__/width_units.test.js on lines 260..270
client/src/util/__tests__/width_units.test.js on lines 272..282

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

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

Severity
Category
Status
Source
Language