FarmBot/Farmbot-Web-App

View on GitHub

Showing 1,338 of 1,993 total issues

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

  toggleOpen = (section: keyof PointsPanelState) => () =>
    this.props.dispatch({
      type: Actions.TOGGLE_POINTS_PANEL_OPTION, payload: section,
    });
Severity: Major
Found in frontend/points/point_inventory.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/nav/index.tsx on lines 69..70
frontend/photos/photos.tsx on lines 38..39
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/sequences/panel/list.tsx on lines 46..50
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

  toggleOpen = (section: keyof WeedsPanelState) => () =>
    this.props.dispatch({
      type: Actions.TOGGLE_WEEDS_PANEL_OPTION, payload: section,
    });
Severity: Major
Found in frontend/weeds/weeds_inventory.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/nav/index.tsx on lines 69..70
frontend/photos/photos.tsx on lines 38..39
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/points/point_inventory.tsx on lines 154..157
frontend/sequences/panel/list.tsx on lines 46..50

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

  setPanelState = (key: keyof ControlsState) => () =>
    this.props.dispatch({
      type: Actions.SET_CONTROLS_PANEL_OPTION,
      payload: key,
    });
Severity: Major
Found in frontend/controls/controls.tsx and 9 other locations - About 35 mins to fix
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/nav/index.tsx on lines 69..70
frontend/photos/photos.tsx on lines 38..39
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/points/point_inventory.tsx on lines 154..157
frontend/sequences/panel/list.tsx on lines 46..50
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

  toggleSection = (key: keyof SequencesPanelState) => () =>
    this.props.dispatch({
      type: Actions.TOGGLE_SEQUENCES_PANEL_OPTION,
      payload: key,
    });
Severity: Major
Found in frontend/sequences/panel/list.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/nav/index.tsx on lines 69..70
frontend/photos/photos.tsx on lines 38..39
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/points/point_inventory.tsx on lines 154..157
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

    const {
      type, botOnline, axisTitle, mcuParams, action, arduinoBusy, locked,
    } = this.props;
Severity: Major
Found in frontend/settings/hardware_settings/calibration_row.tsx and 4 other locations - About 35 mins to fix
frontend/controls/move/direction_button.tsx on lines 114..116
frontend/farm_designer/map/active_plant/active_plant_drag_helper.tsx on lines 14..15
frontend/sequences/step_ui/step_header.tsx on lines 150..158
frontend/settings/index.tsx on lines 55..57

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

  toggleOpen = (section: keyof PlantsPanelState) => () =>
    this.props.dispatch({
      type: Actions.TOGGLE_PLANTS_PANEL_OPTION, payload: section,
    });
Severity: Major
Found in frontend/plants/plant_inventory.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/nav/index.tsx on lines 69..70
frontend/photos/photos.tsx on lines 38..39
frontend/points/point_inventory.tsx on lines 154..157
frontend/sequences/panel/list.tsx on lines 46..50
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

    const { dragging, currentPlant, zoomLvl, activeDragXY,
      mapTransformProps, plantAreaOffset, editing } = this.props;
frontend/controls/move/direction_button.tsx on lines 114..116
frontend/sequences/step_ui/step_header.tsx on lines 150..158
frontend/settings/hardware_settings/calibration_row.tsx on lines 12..14
frontend/settings/index.tsx on lines 55..57

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

    const {
      direction, axis, locked, arduinoBusy, botOnline, botPosition, movementState,
    } = this.props;
Severity: Major
Found in frontend/controls/move/direction_button.tsx and 4 other locations - About 35 mins to fix
frontend/farm_designer/map/active_plant/active_plant_drag_helper.tsx on lines 14..15
frontend/sequences/step_ui/step_header.tsx on lines 150..158
frontend/settings/hardware_settings/calibration_row.tsx on lines 12..14
frontend/settings/index.tsx on lines 55..57

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

    const { getConfigValue, dispatch, firmwareConfig,
      sourceFwConfig, sourceFbosConfig, resources, settingsPanelState,
    } = this.props;
Severity: Major
Found in frontend/settings/index.tsx and 4 other locations - About 35 mins to fix
frontend/controls/move/direction_button.tsx on lines 114..116
frontend/farm_designer/map/active_plant/active_plant_drag_helper.tsx on lines 14..15
frontend/sequences/step_ui/step_header.tsx on lines 150..158
frontend/settings/hardware_settings/calibration_row.tsx on lines 12..14

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

  setPanelState = (key: keyof JobsAndLogsState) => () =>
    this.props.dispatch({
      type: Actions.SET_JOBS_PANEL_OPTION,
      payload: key,
    });
Severity: Major
Found in frontend/devices/jobs.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/nav/index.tsx on lines 69..70
frontend/photos/photos.tsx on lines 38..39
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/points/point_inventory.tsx on lines 154..157
frontend/sequences/panel/list.tsx on lines 46..50
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

    const {
      className,
      currentSequence,
      currentStep,
      dispatch,
Severity: Major
Found in frontend/sequences/step_ui/step_header.tsx and 4 other locations - About 35 mins to fix
frontend/controls/move/direction_button.tsx on lines 114..116
frontend/farm_designer/map/active_plant/active_plant_drag_helper.tsx on lines 14..15
frontend/settings/hardware_settings/calibration_row.tsx on lines 12..14
frontend/settings/index.tsx on lines 55..57

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

  toggle = (key: keyof PhotosPanelState) => () =>
    this.props.dispatch({ type: Actions.TOGGLE_PHOTOS_PANEL_OPTION, payload: key });
Severity: Major
Found in frontend/photos/photos.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/nav/index.tsx on lines 69..70
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/points/point_inventory.tsx on lines 154..157
frontend/sequences/panel/list.tsx on lines 46..50
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

  togglePopup = (payload: keyof PopupsState) => () =>
    this.props.dispatch({ type: Actions.TOGGLE_POPUP, payload });
Severity: Major
Found in frontend/nav/index.tsx and 9 other locations - About 35 mins to fix
frontend/controls/controls.tsx on lines 62..66
frontend/curves/curves_inventory.tsx on lines 44..47
frontend/devices/connectivity/connectivity.tsx on lines 63..67
frontend/devices/jobs.tsx on lines 64..68
frontend/photos/photos.tsx on lines 38..39
frontend/plants/plant_inventory.tsx on lines 98..101
frontend/points/point_inventory.tsx on lines 154..157
frontend/sequences/panel/list.tsx on lines 46..50
frontend/weeds/weeds_inventory.tsx on lines 148..151

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

        <button className="fb-button gray"
          title={t("clear filters")}
          onClick={this.clearFilters}>
          {t("clear filters")}
        </button>
Severity: Major
Found in frontend/sensors/sensor_readings/sensor_readings.tsx and 3 other locations - About 35 mins to fix
frontend/farmware/panel/add.tsx on lines 62..67
frontend/points/create_points.tsx on lines 311..315
frontend/saved_gardens/garden_snapshot.tsx on lines 58..63

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

          <button
            className="fb-button green"
            title={t("install Farmware")}
            onClick={this.install}>
            {t("Install")}
Severity: Major
Found in frontend/farmware/panel/add.tsx and 3 other locations - About 35 mins to fix
frontend/points/create_points.tsx on lines 311..315
frontend/saved_gardens/garden_snapshot.tsx on lines 58..63
frontend/sensors/sensor_readings/sensor_readings.tsx on lines 65..69

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

      <button
        className="fb-button green wide"
        title={t("Add new garden")}
        onClick={this.new}>
        {t("Add new garden")}
Severity: Major
Found in frontend/saved_gardens/garden_snapshot.tsx and 3 other locations - About 35 mins to fix
frontend/farmware/panel/add.tsx on lines 62..67
frontend/points/create_points.tsx on lines 311..315
frontend/sensors/sensor_readings/sensor_readings.tsx on lines 65..69

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

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

        if (isSearchMatchFolder(searchTerm, [level1, level2, level3])) {
          // CASE 3
          folderSet.add(level3);
          // CASE 5
          folderSet.add(level2);
Severity: Minor
Found in frontend/folders/search_folder_tree.ts and 1 other location - About 35 mins to fix
frontend/folders/search_folder_tree.ts on lines 77..84

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

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

          if (isSearchMatchSeq(searchTerm, props.references[level3Sequence])) {
            // CASE 3
            folderSet.add(level3);
            // CASE 5
            folderSet.add(level2);
Severity: Minor
Found in frontend/folders/search_folder_tree.ts and 1 other location - About 35 mins to fix
frontend/folders/search_folder_tree.ts on lines 68..75

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

  const {
    bedWidthOuter, bedLengthOuter, bedHeight, botSizeX,
    legSize, ccSupportSize, bedZOffset
  } = props.config;
Severity: Minor
Found in frontend/three_d_garden/power_supply.tsx and 2 other locations - About 35 mins to fix
frontend/farm_designer/map/layers/sensor_readings/garden_sensor_reading.tsx on lines 37..37
frontend/three_d_garden/utilities_post.tsx on lines 19..22

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

  z: !!sourceFwConfig("movement_axis_stealth_z").value &&
    sourceFwConfig("movement_microsteps_z").value != 1
    ? t(ToolTips.MICROSTEP_WARNING)
    : undefined,
Severity: Minor
Found in frontend/settings/hardware_settings/motors.tsx and 2 other locations - About 35 mins to fix
frontend/settings/hardware_settings/motors.tsx on lines 261..264
frontend/settings/hardware_settings/motors.tsx on lines 265..268

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