FarmBot/Farmbot-Web-App

View on GitHub

Showing 1,573 of 1,573 total issues

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

export const TileFindHome = (props: StepParams<FindHome>) => {
  const { dispatch, index, currentStep, currentSequence } = props;
  const conflicts = settingConflicts(currentStep, props.hardwareFlags);
  return <StepWrapper {...props}
    className={"find-home-step"}
Severity: Major
Found in frontend/sequences/step_tiles/tile_find_home.tsx and 1 other location - About 7 hrs to fix
frontend/sequences/step_tiles/tile_calibrate.tsx on lines 9..25

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

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

File select_plants.tsx has 482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from "react";
import { push } from "../history";
import { connect } from "react-redux";
import { Everything, TimeSettings } from "../interfaces";
import { PlantInventoryItem } from "./plant_inventory_item";
Severity: Minor
Found in frontend/plants/select_plants.tsx - About 7 hrs to fix

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

          <Highlight settingName={DeviceSetting.accelerateForTowardHome}>
            <Row>
              <Col xs={8} className={"z-param-label"}>
                <label>
                  {t(DeviceSetting.accelerateForTowardHome)}
    Severity: Major
    Found in frontend/settings/hardware_settings/motors.tsx and 2 other locations - About 7 hrs to fix
    frontend/settings/hardware_settings/motors.tsx on lines 75..92
    frontend/settings/hardware_settings/motors.tsx on lines 112..129

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

    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

          <Highlight settingName={DeviceSetting.minimumSpeedTowardHome}>
            <Row>
              <Col xs={8} className={"z-param-label"}>
                <label>
                  {t(DeviceSetting.minimumSpeedTowardHome)}
    Severity: Major
    Found in frontend/settings/hardware_settings/motors.tsx and 2 other locations - About 7 hrs to fix
    frontend/settings/hardware_settings/motors.tsx on lines 75..92
    frontend/settings/hardware_settings/motors.tsx on lines 139..156

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

    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

          <Highlight settingName={DeviceSetting.maxSpeedTowardHome}>
            <Row>
              <Col xs={8} className={"z-param-label"}>
                <label>
                  {t(DeviceSetting.maxSpeedTowardHome)}
    Severity: Major
    Found in frontend/settings/hardware_settings/motors.tsx and 2 other locations - About 7 hrs to fix
    frontend/settings/hardware_settings/motors.tsx on lines 112..129
    frontend/settings/hardware_settings/motors.tsx on lines 139..156

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

    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

    File maybe_highlight.tsx has 480 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from "react";
    import { store } from "../redux/store";
    import { SettingsPanelState } from "../interfaces";
    import { toggleControlPanel, bulkToggleControlPanel } from "./toggle_section";
    import { getUrlQuery, urlFriendly } from "../util";
    Severity: Minor
    Found in frontend/settings/maybe_highlight.tsx - About 7 hrs to fix

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

      export const SoilHeight = (props: ZHeightInputProps) =>
        <Highlight settingName={DeviceSetting.fallbackSoilHeight}>
          <Row>
            <Col xs={8}>
              <label>
      Severity: Major
      Found in frontend/settings/fbos_settings/z_height_inputs.tsx and 1 other location - About 7 hrs to fix
      frontend/settings/fbos_settings/z_height_inputs.tsx on lines 38..54

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

      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

      export const SafeHeight = (props: ZHeightInputProps) =>
        <Highlight settingName={DeviceSetting.safeHeight}>
          <Row>
            <Col xs={8}>
              <label>
      Severity: Major
      Found in frontend/settings/fbos_settings/z_height_inputs.tsx and 1 other location - About 7 hrs to fix
      frontend/settings/fbos_settings/z_height_inputs.tsx on lines 56..72

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

      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

      File component.tsx has 467 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from "react";
      import {
        BlurableInput,
        EmptyStateWrapper,
        EmptyStateGraphic,
      Severity: Minor
      Found in frontend/folders/component.tsx - About 7 hrs to fix

        File data.tsx has 465 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from "react";
        import { t } from "../../i18next_wrapper";
        import { FirmwareHardware } from "farmbot";
        import { Actions, TourContent } from "../../constants";
        import { Tour, TourStep } from "./interfaces";
        Severity: Minor
        Found in frontend/help/tours/data.tsx - About 7 hrs to fix

          File location_info.tsx has 463 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from "react";
          import { Everything, MovementState, TimeSettings } from "../interfaces";
          import { BotPosition, UserEnv } from "../devices/interfaces";
          import { connect } from "react-redux";
          import { getUrlQuery } from "../util";
          Severity: Minor
          Found in frontend/farm_designer/location_info.tsx - About 7 hrs to fix

            Function render has 169 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const { H_LO, H_HI, S_LO, S_HI, V_LO, V_HI } = this.props;
                const cameraCalibrationEnv = this.props.namespace("H_LO").includes("CAMERA");
                const defaultHLow = this.getDefault(cameraCalibrationEnv ? "H_HI" : "H_LO");
                const defaultHHigh = this.getDefault(cameraCalibrationEnv ? "H_LO" : "H_HI");
            Severity: Major
            Found in frontend/photos/image_workspace/index.tsx - About 6 hrs to fix

              File actions.ts has 441 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import axios from "axios";
              import { success, warning, info, error } from "../toast/toast";
              import { getDevice } from "../device";
              import { Everything } from "../interfaces";
              import {
              Severity: Minor
              Found in frontend/devices/actions.ts - About 6 hrs to fix

                File crop_info.tsx has 437 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React from "react";
                import { svgToUrl } from "../open_farm/icons";
                import {
                  CropInfoProps, CropLiveSearchResult, DesignerState, OpenfarmSearch,
                } from "../farm_designer/interfaces";
                Severity: Minor
                Found in frontend/plants/crop_info.tsx - About 6 hrs to fix

                  File cards.tsx has 436 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from "react";
                  import { t } from "../i18next_wrapper";
                  import {
                    AlertCardProps, AlertCardTemplateProps, FirmwareMissingProps,
                    SeedDataMissingProps, SeedDataMissingState, TourNotTakenProps,
                  Severity: Minor
                  Found in frontend/messages/cards.tsx - About 6 hrs to fix

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

                    export const EditPlantDepth = (props: EditPlantDepthProps) =>
                      <Row>
                        <Col xs={6}>
                          <label style={{ marginTop: 0 }}>{t("depth (mm)")}</label>
                          <BlurableInput
                    Severity: Major
                    Found in frontend/plants/plant_panel.tsx and 1 other location - About 6 hrs to fix
                    frontend/plants/plant_panel.tsx on lines 109..122

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

                    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

                    export const EditPlantRadius = (props: EditPlantRadiusProps) =>
                      <Row>
                        <Col xs={6}>
                          <label style={{ marginTop: 0 }}>{t("radius (mm)")}</label>
                          <BlurableInput
                    Severity: Major
                    Found in frontend/plants/plant_panel.tsx and 1 other location - About 6 hrs to fix
                    frontend/plants/plant_panel.tsx on lines 128..141

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

                    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

                            <div className={"tabs"}>
                              <label className={realtime ? "selected" : ""}
                                onClick={this.setPanelState("realtime")}>{t("realtime")}</label>
                              <label className={network ? "selected" : ""}
                                onClick={this.setPanelState("network")}>{t("network")}</label>
                    Severity: Major
                    Found in frontend/devices/connectivity/connectivity.tsx and 1 other location - About 6 hrs to fix
                    frontend/controls/controls.tsx on lines 112..119

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

                    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

                          <div className={"tabs"}>
                            <label className={move ? "selected" : ""}
                              onClick={this.setPanelState("move")}>{t("move")}</label>
                            <label className={peripherals ? "selected" : ""}
                              onClick={this.setPanelState("peripherals")}>{t("peripherals")}</label>
                    Severity: Major
                    Found in frontend/controls/controls.tsx and 1 other location - About 6 hrs to fix
                    frontend/devices/connectivity/connectivity.tsx on lines 180..187

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

                    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

                          outcomes: [
                            {
                              slug: "nothing",
                              description: t("Nothing happened"),
                              tips: t("Return to the"),
                    Severity: Major
                    Found in frontend/wizard/data.ts and 1 other location - About 6 hrs to fix
                    frontend/wizard/data.ts on lines 623..648

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

                    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