streetmix/streetmix

View on GitHub
app/lib/street_schema_update.js

Summary

Maintainability
F
1 wk
Test Coverage

Function incrementSchemaVersion has a Cognitive Complexity of 159 (exceeds 5 allowed). Consider refactoring.
Open

function incrementSchemaVersion (street) {
  if (street.schemaVersion === undefined) {
    // Fix a bug in 2018 where a street did not have a schema version
    // when it should've.
    if (
Severity: Minor
Found in app/lib/street_schema_update.js - About 3 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function incrementSchemaVersion has 312 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function incrementSchemaVersion (street) {
  if (street.schemaVersion === undefined) {
    // Fix a bug in 2018 where a street did not have a schema version
    // when it should've.
    if (
Severity: Major
Found in app/lib/street_schema_update.js - About 1 day to fix

File street_schema_update.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Updates street data object to newer schemas.
 *
 */
import { nanoid } from 'nanoid'
Severity: Minor
Found in app/lib/street_schema_update.js - About 4 hrs to fix

Avoid deeply nested control flow statements.
Open

              if (segment.variantString.includes('road')) {
                segment.elevation = 0
              } else {
                segment.elevation = 1
              }
Severity: Major
Found in app/lib/street_schema_update.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              if (segment.variantString.includes('light-rail')) {
                segment.elevation = 2
              } else {
                segment.elevation = 1
              }
Severity: Major
Found in app/lib/street_schema_update.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

          if (segment.variantString === 'small') {
            segment.variantString = 'big'
          }
Severity: Major
Found in app/lib/street_schema_update.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

              switch (segment.variantString) {
                case 'median':
                case 'planting-strip':
                case 'bush':
                case 'flowers':
Severity: Major
Found in app/lib/street_schema_update.js - About 45 mins to fix

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

    case 21:
      // 22: add random seed to drive lanes for pedestrians
      for (const i in street.segments) {
        const segment = street.segments[i]
        if (segment.type === 'drive-lane') {
Severity: Major
Found in app/lib/street_schema_update.js and 1 other location - About 1 hr to fix
app/lib/street_schema_update.js on lines 228..239

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

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

    case 14:
      // 15: sidewalks have rand seed
      for (const i in street.segments) {
        const segment = street.segments[i]
        if (segment.type === 'sidewalk') {
Severity: Major
Found in app/lib/street_schema_update.js and 1 other location - About 1 hr to fix
app/lib/street_schema_update.js on lines 295..306

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

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

    case 9:
      // 10: sidewalk density
      // Existing sidewlks have "normal" density
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 1 other location - About 1 hr to fix
app/lib/street_schema_update.js on lines 217..227

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

    case 13:
      // 14: wayfinding has three types
      // Existing signs are the "large" variant
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 1 other location - About 1 hr to fix
app/lib/street_schema_update.js on lines 164..174

Duplicated Code

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

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

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

Tuning

This issue has a mass of 68.

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

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

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

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

Refactorings

Further Reading

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

    case 4:
      // 5: add another lamp type (traditional)
      // Existing lamps are "modern" type
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

    case 12:
      // 13: bike rack elevation
      // Existing bike racks are "sidewalk" variant
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

    case 19:
      // 20: add sidewalk-level bike lanes
      // Existing bike lanes are "road" level variants
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

    case 7:
      // 8: colored bike lane
      // Existing bike lanes are "regular" asphalt
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

    case 20:
      // 21: add sidewalk-level bikeshare docks
      // Existing bikeshare docks are "road" level variants
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 325..334

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

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

    case 5:
      // 6: colored streetcar lanes
      // Existing streetcar lanes are "regular" asphalt
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

    case 3:
      // 4: add transit shelter elevation
      // Existing shelters are "street-level" elevation
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

    case 24:
      // 25: add bus type
      // Existing bus lanes are "typical" variant
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 154..163
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294

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

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

    case 8:
      // 9: second car type: truck
      // Existing drive lanes are "car" variant
      for (const i in street.segments) {
        const segment = street.segments[i]
Severity: Major
Found in app/lib/street_schema_update.js and 8 other locations - About 1 hr to fix
app/lib/street_schema_update.js on lines 102..111
app/lib/street_schema_update.js on lines 112..121
app/lib/street_schema_update.js on lines 122..131
app/lib/street_schema_update.js on lines 144..153
app/lib/street_schema_update.js on lines 207..216
app/lib/street_schema_update.js on lines 275..284
app/lib/street_schema_update.js on lines 285..294
app/lib/street_schema_update.js on lines 325..334

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

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

            case 'transit-shelter':
              if (segment.variantString.includes('light-rail')) {
                segment.elevation = 2
              } else {
                segment.elevation = 1
Severity: Minor
Found in app/lib/street_schema_update.js and 1 other location - About 35 mins to fix
app/lib/street_schema_update.js on lines 391..397

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

            case 'bikeshare':
              if (segment.variantString.includes('road')) {
                segment.elevation = 0
              } else {
                segment.elevation = 1
Severity: Minor
Found in app/lib/street_schema_update.js and 1 other location - About 35 mins to fix
app/lib/street_schema_update.js on lines 399..405

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status