HabitatMap/AirCasting

View on GitHub

Showing 667 of 667 total issues

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

  it 'when number of outliers is above the threshold the bounding box with outliers is returned' do
    bounding_boxes = {
      with_outliers: {
        a: 1
      },
Severity: Minor
Found in spec/services/outliers/select_bounding_box_spec.rb and 2 other locations - About 40 mins to fix
spec/services/outliers/select_bounding_box_spec.rb on lines 4..23
spec/services/outliers/select_bounding_box_spec.rb on lines 26..45

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

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

        {
          key: UrlParamsTypes.currentUserSettings,
          value: isMobile
            ? UserSettings.FiltersView
            : currentUserSettings === UserSettings.CrowdMapView
Severity: Major
Found in app/javascript/react/utils/mapParamsHandler.ts and 5 other locations - About 40 mins to fix
app/javascript/react/components/SessionFilters/CustomParameterFilter.tsx on lines 72..79
app/javascript/react/components/SessionFilters/CustomSensorFilter.tsx on lines 68..75
app/javascript/react/utils/mapParamsHandler.ts on lines 308..315
app/javascript/react/utils/mapParamsHandler.ts on lines 548..555
app/javascript/react/utils/mapParamsHandler.ts on lines 647..654

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

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

          {
            key: UrlParamsTypes.currentUserSettings,
            value: isMobile
              ? UserSettings.FiltersView
              : currentUserSettings === UserSettings.CrowdMapView
app/javascript/react/components/SessionFilters/CustomParameterFilter.tsx on lines 72..79
app/javascript/react/utils/mapParamsHandler.ts on lines 308..315
app/javascript/react/utils/mapParamsHandler.ts on lines 548..555
app/javascript/react/utils/mapParamsHandler.ts on lines 592..599
app/javascript/react/utils/mapParamsHandler.ts on lines 647..654

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

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

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

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

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

Refactorings

Further Reading

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

  it 'when number of outliers is below the threshold the bounding box without outliers is returned' do
    bounding_boxes = {
      with_outliers: {
        a: 1
      },
Severity: Minor
Found in spec/services/outliers/select_bounding_box_spec.rb and 2 other locations - About 40 mins to fix
spec/services/outliers/select_bounding_box_spec.rb on lines 26..45
spec/services/outliers/select_bounding_box_spec.rb on lines 48..67

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

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

        {
          key: UrlParamsTypes.currentUserSettings,
          value: isMobile
            ? UserSettings.FiltersView
            : currentUserSettings === UserSettings.CrowdMapView
Severity: Major
Found in app/javascript/react/utils/mapParamsHandler.ts and 5 other locations - About 40 mins to fix
app/javascript/react/components/SessionFilters/CustomParameterFilter.tsx on lines 72..79
app/javascript/react/components/SessionFilters/CustomSensorFilter.tsx on lines 68..75
app/javascript/react/utils/mapParamsHandler.ts on lines 308..315
app/javascript/react/utils/mapParamsHandler.ts on lines 548..555
app/javascript/react/utils/mapParamsHandler.ts on lines 592..599

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

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

        {
          key: UrlParamsTypes.currentUserSettings,
          value: isMobile
            ? UserSettings.FiltersView
            : currentUserSettings === UserSettings.CrowdMapView
Severity: Major
Found in app/javascript/react/utils/mapParamsHandler.ts and 5 other locations - About 40 mins to fix
app/javascript/react/components/SessionFilters/CustomParameterFilter.tsx on lines 72..79
app/javascript/react/components/SessionFilters/CustomSensorFilter.tsx on lines 68..75
app/javascript/react/utils/mapParamsHandler.ts on lines 308..315
app/javascript/react/utils/mapParamsHandler.ts on lines 592..599
app/javascript/react/utils/mapParamsHandler.ts on lines 647..654

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

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

          {
            key: UrlParamsTypes.currentUserSettings,
            value: isMobile
              ? UserSettings.FiltersView
              : currentUserSettings === UserSettings.CrowdMapView
app/javascript/react/components/SessionFilters/CustomSensorFilter.tsx on lines 68..75
app/javascript/react/utils/mapParamsHandler.ts on lines 308..315
app/javascript/react/utils/mapParamsHandler.ts on lines 548..555
app/javascript/react/utils/mapParamsHandler.ts on lines 592..599
app/javascript/react/utils/mapParamsHandler.ts on lines 647..654

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

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

        {
          key: UrlParamsTypes.currentUserSettings,
          value: isMobile
            ? UserSettings.FiltersView
            : currentUserSettings === UserSettings.CrowdMapView
Severity: Major
Found in app/javascript/react/utils/mapParamsHandler.ts and 5 other locations - About 40 mins to fix
app/javascript/react/components/SessionFilters/CustomParameterFilter.tsx on lines 72..79
app/javascript/react/components/SessionFilters/CustomSensorFilter.tsx on lines 68..75
app/javascript/react/utils/mapParamsHandler.ts on lines 548..555
app/javascript/react/utils/mapParamsHandler.ts on lines 592..599
app/javascript/react/utils/mapParamsHandler.ts on lines 647..654

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

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

Method build_measurements_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    amount_of_streams,
    measurements,
    sensor_package_name,
    session_id,
    stream_parameters
Severity: Minor
Found in app/services/csv/create_files.rb - About 35 mins to fix

    Method build_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        amount_of_streams,
        measurements,
        sensor_package_name,
        session_id,
        stream_parameters
    Severity: Minor
    Found in spec/services/csv/append_measurements_content_spec.rb - About 35 mins to fix

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

            it 'returns measurements that are in the range' do
              measurement = create_measurement!(time: Time.new(2_010, 1, 2))
      
              data = {
                time_from: Time.new(2_010, 1, 1).to_i,
      Severity: Major
      Found in spec/models/measurement_spec.rb and 3 other locations - About 35 mins to fix
      spec/models/measurement_spec.rb on lines 85..93
      spec/models/measurement_spec.rb on lines 96..104
      spec/models/measurement_spec.rb on lines 155..163

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

      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 'does not return measurements that are not in the range' do
              measurement = create_measurement!(time: Time.new(2_010, 1, 1))
      
              data = {
                time_from: Time.new(2_010, 1, 2).to_i,
      Severity: Major
      Found in spec/models/measurement_spec.rb and 3 other locations - About 35 mins to fix
      spec/models/measurement_spec.rb on lines 85..93
      spec/models/measurement_spec.rb on lines 120..128
      spec/models/measurement_spec.rb on lines 155..163

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

      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 'returns measurements that are in the range' do
              measurement = create_measurement!(time: Time.new(2_010, 1, 2))
      
              data = {
                time_from: Time.new(2_010, 1, 1).to_i,
      Severity: Major
      Found in spec/models/measurement_spec.rb and 3 other locations - About 35 mins to fix
      spec/models/measurement_spec.rb on lines 96..104
      spec/models/measurement_spec.rb on lines 120..128
      spec/models/measurement_spec.rb on lines 155..163

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

      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 'does not return measurements that are not in the range' do
              measurement = create_measurement!(time: Time.new(2_010, 1, 1))
      
              data = {
                time_from: Time.new(2_010, 1, 2).to_i,
      Severity: Major
      Found in spec/models/measurement_spec.rb and 3 other locations - About 35 mins to fix
      spec/models/measurement_spec.rb on lines 85..93
      spec/models/measurement_spec.rb on lines 96..104
      spec/models/measurement_spec.rb on lines 120..128

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

      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

          leftArrow.on("click", () => {
            if (leftArrow.element.style.cursor !== "not-allowed") {
              move(DIRECTION_LEFT);
            }
          });
      Severity: Minor
      Found in app/javascript/react/components/Graph/chartEvents.ts and 1 other location - About 35 mins to fix
      app/javascript/react/components/Graph/chartEvents.ts on lines 136..140

      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

              if (!overlay) {
                overlay = new CustomMarkerOverlay(
                  marker.getPosition()!,
                  color,
                  isSelected,
      Severity: Minor
      Found in app/javascript/react/components/Map/Markers/MobileMarkers.tsx and 1 other location - About 35 mins to fix
      app/javascript/react/components/Map/Markers/FixedMarkers.tsx on lines 325..339

      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

        useEffect(() => {
          document.addEventListener("click", handleOutsideClick);
          return () => {
            document.removeEventListener("click", handleOutsideClick);
          };
      app/javascript/react/components/Modals/TimelapseModal/TimelapseComponent.tsx on lines 113..118

      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

      const UniformDistributionButton = styled(Button)`
        white-space: nowrap;
        background: ${colors.gray100};
        border: none;
        color: ${colors.gray300};
      app/javascript/react/components/Map/Map.style.tsx on lines 48..93

      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

      const ThresholdContainer = styled.div`
        display: grid;
        justify-content: center;
        flex-direction: column;
        position: fixed;
      Severity: Minor
      Found in app/javascript/react/components/Map/Map.style.tsx and 1 other location - About 35 mins to fix
      app/javascript/react/components/ThresholdConfigurator/ThresholdConfigurator.style.tsx on lines 167..192

      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

              if (!existingOverlay) {
                const overlay = new CustomMarkerOverlay(
                  position!,
                  newColor,
                  isSelected,
      Severity: Minor
      Found in app/javascript/react/components/Map/Markers/FixedMarkers.tsx and 1 other location - About 35 mins to fix
      app/javascript/react/components/Map/Markers/MobileMarkers.tsx on lines 183..197

      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

      Severity
      Category
      Status
      Source
      Language