FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

Function RawDesignerFarmwareAdd has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const RawDesignerFarmwareAdd = (props: DesignerFarmwareAddProps) => {
  const [packageUrl, setPackageUrl] = React.useState("");
  const navigate = useNavigate();
  const clearUrl = () => navigate(Path.farmware());

Severity: Minor
Found in frontend/farmware/panel/add.tsx - About 1 hr to fix

    Function mapStateToProps has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function mapStateToProps(props: Everything): AppProps {
      const webAppConfigValue = getWebAppConfigValue(() => props);
      return {
        timeSettings: maybeGetTimeSettings(props.resources.index),
        dispatch: props.dispatch,
    Severity: Minor
    Found in frontend/app.tsx - About 1 hr to fix

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

        render() {
          const panelName = "setup";
          return <DesignerPanel panelName={panelName} panel={Panel.Controls}>
            <DesignerPanelTop panel={Panel.Controls} />
            <DesignerPanelContent panelName={panelName}>
      Severity: Minor
      Found in frontend/wizard/index.tsx - About 1 hr to fix

        Function calculatePlantPositions has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const calculatePlantPositions = (): Plant[] => {
            const positions: Plant[] = [];
            const startX = 350;
            let nextX = startX;
            let index = 0;
        Severity: Minor
        Found in frontend/three_d_garden/garden.tsx - About 1 hr to fix

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

            render() {
              const panelName = "designer-regimen-editor";
              const regimen = this.props.current;
              const regimenCount = selectAllRegimens(this.props.resources).length;
              return <DesignerPanel panelName={panelName} panel={Panel.Regimens}>
          Severity: Minor
          Found in frontend/regimens/editor/editor.tsx - About 1 hr to fix

            Function FactoryResetRows has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const FactoryResetRows = (props: FactoryResetRowsProps) => {
              const { botOnline } = props;
              return <div className={"factory-reset-options grid"}>
                <Highlight settingName={DeviceSetting.softReset}>
                  <Row className="grid-exp-1">
            Severity: Minor
            Found in frontend/settings/fbos_settings/factory_reset_row.tsx - About 1 hr to fix

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

                render() {
                  const { farmEvent } = this.props;
                  const variableCount = Object.values(this.variableData || {})
                    .filter(v => v?.celeryNode.kind == "parameter_declaration")
                    .length;
              Severity: Minor
              Found in frontend/farm_events/edit_fe_form.tsx - About 1 hr to fix

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

                  render() {
                    const farmEvent = this.props.findFarmEventByUuid(this.state.uuid);
                    const panelName = "add-farm-event";
                    return <DesignerPanel panelName={panelName} panel={Panel.FarmEvents}>
                      <DesignerPanelHeader
                Severity: Minor
                Found in frontend/farm_events/add_farm_event.tsx - About 1 hr to fix

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

                    render() {
                      return <DesignerPanel panelName={"crop-catalog"} panel={Panel.Plants}>
                        <DesignerPanelHeader
                          panelName={"crop-catalog"}
                          panel={Panel.Plants}
                  Severity: Minor
                  Found in frontend/plants/crop_catalog.tsx - About 1 hr to fix

                    Function move has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function move(props: MoveProps) {
                      const noun = t("Movement");
                      maybeNoop();
                      maybeAlertLocked();
                      const safeZ: SafeZ = { kind: "safe_z", args: {} };
                    Severity: Minor
                    Found in frontend/devices/actions.ts - About 1 hr to fix

                      Function renderCeleryNode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function renderCeleryNode(props: StepParams) {
                        const step = props.currentStep;
                        switch (step.kind) {
                          case "_if": return <TileIf {...props} currentStep={step} />;
                          case "execute_script":
                      Severity: Minor
                      Found in frontend/sequences/step_tiles/index.tsx - About 1 hr to fix

                        Function AddCommandButton has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const AddCommandButton = (props: AddCommandButtonProps) => {
                          const { index, dispatch, stepCount } = props;
                          const getPositionClass = () => {
                            switch (index) {
                              case 0: return "first";
                        Severity: Minor
                        Found in frontend/sequences/sequence_editor_middle_active.tsx - About 1 hr to fix

                          Function RawZones has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const RawZones = (props: ZonesProps) => {
                            const navigate = useNavigate();
                            const navigateById = (id: number) => navigate(Path.zones(id));
                            const [searchTerm, setSearchTerm] = React.useState("");
                            return <DesignerPanel panelName={"zones-inventory"} panel={Panel.Zones}>
                          Severity: Minor
                          Found in frontend/zones/zones_inventory.tsx - About 1 hr to fix

                            Function generateTransformStyle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const generateTransformStyle = (props: GenerateTransformStyleProps) => {
                              const { zoomLvl, mapTransformProps } = props;
                              const { quadrant, xySwap } = mapTransformProps;
                            
                              /** Determine if an axis is displayed vertically on the page. */
                            Severity: Minor
                            Found in frontend/farm_designer/map/background/grid_labels.tsx - About 1 hr to fix

                              Function PowerAndReset has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function PowerAndReset(props: PowerAndResetProps) {
                                const { dispatch, botOnline } = props;
                                const { power_and_reset } = props.settingsPanelState;
                                return <Highlight className={"section advanced"}
                                  settingName={DeviceSetting.powerAndReset}
                              Severity: Minor
                              Found in frontend/settings/fbos_settings/power_and_reset.tsx - About 1 hr to fix

                                Function semverCompare has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function semverCompare(left: string, right: string): SemverResult {
                                  const leftSemVer = left.split("-")[0];
                                  const rightSemVer = right.split("-")[0];
                                  const leftHasSuffix = left.includes("-");
                                  const rightHasSuffix = right.includes("-");
                                Severity: Minor
                                Found in frontend/util/version.ts - About 1 hr to fix

                                  Function OtaTimeSelector has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const OtaTimeSelector = (props: OtaTimeSelectorProps) => {
                                    const { device, dispatch, timeSettings } = props;
                                    const { utcOffset, hour24 } = timeSettings;
                                    const localHour = utcHourToLocalHour(device.body.ota_hour_utc, utcOffset) ??
                                      device.body.ota_hour;
                                  Severity: Minor
                                  Found in frontend/settings/fbos_settings/ota_time_selector.tsx - About 1 hr to fix

                                    Function getData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const getData = (
                                      all: TaggedTelemetry[],
                                      metricName: keyof Telemetry,
                                    ): DataSegment[] => {
                                      const data: DataRecord[] = [];
                                    Severity: Minor
                                    Found in frontend/devices/connectivity/fbos_metric_history_plot.tsx - About 1 hr to fix

                                      Function getLocationState has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const getLocationState = (step: Move): {
                                        location: LocationNode | undefined,
                                        locationSelection: LocSelection | undefined,
                                      } => {
                                        /** Last axis_overwrite where axis_operand is a point, tool, or identifier. */
                                      Severity: Minor
                                      Found in frontend/sequences/step_tiles/tile_computed_move/location.tsx - About 1 hr to fix

                                        Function BotExtents has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function BotExtents(props: BotExtentsProps) {
                                          const { stopAtHome, botSize, mapTransformProps } = props;
                                          const { xySwap } = mapTransformProps;
                                          const homeLength = transformXY(
                                            botSize.x.value, botSize.y.value, mapTransformProps);
                                        Severity: Minor
                                        Found in frontend/farm_designer/map/layers/farmbot/bot_extents.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language