FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

Function BotPositionRows has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const BotPositionRows = (props: BotPositionRowsProps) => {
  const { locationData, getConfigValue, arduinoBusy, locked } = props;
  const hardwareDisabled = disabledAxisMap(props.firmwareSettings);
  const commonAxisActionProps = {
    botOnline: props.botOnline,
Severity: Major
Found in frontend/controls/move/bot_position_rows.tsx - About 2 hrs to fix

    File move_to.tsx has 270 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from "react";
    import { Row, Popover } from "../ui";
    import { BotPosition } from "../devices/interfaces";
    import { move } from "../devices/actions";
    import { useNavigate } from "react-router-dom";
    Severity: Minor
    Found in frontend/farm_designer/move_to.tsx - About 2 hrs to fix

      Function LimitSwitches has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function LimitSwitches(props: LimitSwitchesProps) {
      
        const { limit_switches } = props.settingsPanelState;
        const { dispatch, sourceFwConfig, arduinoBusy, firmwareHardware } = props;
      
      
      Severity: Major
      Found in frontend/settings/hardware_settings/limit_switches.tsx - About 2 hrs to fix

        Function TroubleshootingTips has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const TroubleshootingTips = (props: TroubleshootingTipsProps) => {
          const otherSelected = props.selectedOutcome == "other";
          return <div className={"troubleshooting grid"}>
            {props.step.outcomes.map(
              // eslint-disable-next-line complexity
        Severity: Major
        Found in frontend/wizard/step.tsx - About 2 hrs to fix

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

            render() {
              const { curves } = this.props;
              const filteredCurves = curves
                .filter(p => p.body.name.toLowerCase()
                  .includes(this.state.searchTerm.toLowerCase()));
          Severity: Major
          Found in frontend/curves/curves_inventory.tsx - About 2 hrs to fix

            Function Description has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Description = (props: DescriptionProps) => {
              const sequenceDescription = props.sequence.body.description || "";
              const [description, setDescription] = React.useState(sequenceDescription);
              const [isEditing, setIsEditing] = React.useState(false);
              const [isProcessing, setIsProcessing] = React.useState(false);
            Severity: Major
            Found in frontend/sequences/sequence_editor_middle_active.tsx - About 2 hrs to fix

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

                render() {
                  const { point, getX, soilHeight, getConfigValue, designer } = this.props;
                  const { icon, spreadDiaCm } = this.state;
                  const currentPlantUuid = designer.selectedPoints?.[0];
                  const radius = point.uuid == currentPlantUuid && designer.hoveredSpread
              Severity: Major
              Found in frontend/farm_designer/map/profile/plants_and_weeds.tsx - About 2 hrs to fix

                File plant_inventory.tsx has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React from "react";
                import { connect } from "react-redux";
                import { PlantInventoryItem } from "./plant_inventory_item";
                import { Everything, PlantsPanelState } from "../interfaces";
                import { Panel } from "../farm_designer/panel_header";
                Severity: Minor
                Found in frontend/plants/plant_inventory.tsx - About 2 hrs to fix

                  File garden_map_legend.tsx has 267 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from "react";
                  import { LayerToggle } from "../legend/layer_toggle";
                  import { GardenMapLegendProps } from "../interfaces";
                  import { atMaxZoom, atMinZoom } from "../zoom";
                  import {
                  Severity: Minor
                  Found in frontend/farm_designer/map/legend/garden_map_legend.tsx - About 2 hrs to fix

                    Function BotTrail has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function BotTrail(props: BotTrailProps) {
                      const toQ = (original: Record<Xyz, number>) =>
                        props.getX
                          ? { qx: props.getX(original), qy: Math.abs(original.z) }
                          : transformXY(original.x, original.y, props.mapTransformProps);
                    Severity: Major
                    Found in frontend/farm_designer/map/layers/farmbot/bot_trail.tsx - About 2 hrs to fix

                      Function TemplatesMenu has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const TemplatesMenu = (props: ActionMenuProps) => {
                        const { type } = props.curve.body;
                        const [shapeCache, setShapeCache] = templateShape(type);
                        const [shape, setShapeState] = React.useState(shapeCache);
                        const [maxDayCache, setMaxDayCache] = templateScale(type, TemplateOption.day);
                      Severity: Major
                      Found in frontend/curves/edit_curve.tsx - About 2 hrs to fix

                        Function FolderListItem has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const FolderListItem = (props: FolderItemProps) => {
                          const { sequence, movedSequenceUuid, inUse } = props;
                          const seqName = sequence.body.name;
                          const url = Path.sequences(urlFriendly(seqName || ""));
                          const moveSource = movedSequenceUuid === sequence.uuid ? "move-source" : "";
                        Severity: Major
                        Found in frontend/folders/component.tsx - About 2 hrs to fix

                          File preview_support.tsx has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React from "react";
                          import { t } from "../../i18next_wrapper";
                          import { EmptyStateWrapper, EmptyStateGraphic, Help, Markdown } from "../../ui";
                          import { isTaggedSequence } from "../../resources/tagged_resources";
                          import { Everything } from "../../interfaces";
                          Severity: Minor
                          Found in frontend/sequences/panel/preview_support.tsx - About 2 hrs to fix

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

                              render() {
                                const { toolSlot } = this;
                                const toolsPath = Path.tools();
                                const toolSlotsPath = Path.toolSlots();
                                const panelName = "edit-tool-slot";
                            Severity: Major
                            Found in frontend/tools/edit_tool_slot.tsx - About 2 hrs to fix

                              Function ConnectivityDiagram has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function ConnectivityDiagram(props: ConnectivityDiagramProps) {
                                const { rowData, hover, hoveredConnection } = props;
                                const browserAPI = rowData[0];
                                const browserMQTT = rowData[1];
                                const botMQTT = rowData[2];
                              Severity: Major
                              Found in frontend/devices/connectivity/diagram.tsx - About 2 hrs to fix

                                File weeds_inventory.tsx has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import React from "react";
                                import { connect } from "react-redux";
                                import { Everything, WeedsPanelState } from "../interfaces";
                                import { Panel } from "../farm_designer/panel_header";
                                import {
                                Severity: Minor
                                Found in frontend/weeds/weeds_inventory.tsx - About 2 hrs to fix

                                  ComputedMove has 22 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  export class ComputedMove
                                    extends React.Component<StepParams<Move>, ComputedMoveState> {
                                    state: ComputedMoveState = {
                                      locationSelection: getLocationState(this.step).locationSelection,
                                      location: getLocationState(this.step).location,
                                  Severity: Minor
                                  Found in frontend/sequences/step_tiles/tile_computed_move/component.tsx - About 2 hrs to fix

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

                                      render() {
                                        const { wdEnvGet } = this;
                                        const { syncStatus, botToMqttStatus } = this.props;
                                        const botOnline = isBotOnline(syncStatus, botToMqttStatus);
                                        const camDisabled = cameraBtnProps(this.props.env, botOnline);
                                    Severity: Major
                                    Found in frontend/photos/camera_calibration/index.tsx - About 2 hrs to fix

                                      Function PinGuard has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function PinGuard(props: PinGuardProps) {
                                        const commonProps = {
                                          dispatch: props.dispatch,
                                          resources: props.resources,
                                          disabled: props.arduinoBusy,
                                      Severity: Major
                                      Found in frontend/settings/hardware_settings/pin_guard.tsx - About 2 hrs to fix

                                        File index.tsx has 263 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        import React from "react";
                                        import { FarmbotColorPicker } from "./farmbot_picker";
                                        import { BlurableInput, Row, Help, ExpandableHeader } from "../../ui";
                                        import { HSV } from "./interfaces";
                                        import { WeedDetectorSlider } from "./slider";
                                        Severity: Minor
                                        Found in frontend/photos/image_workspace/index.tsx - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language