FarmBot/Farmbot-Web-App

View on GitHub

Showing 612 of 1,578 total issues

Function getMode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getMode = (): Mode => {
  if (store.getState().resources.consumers.farm_designer.profileOpen) {
    return Mode.profile;
  }
  const panelSlug = Path.getSlug(Path.designer());
Severity: Minor
Found in frontend/farm_designer/map/util.ts - About 1 hr to fix

    Function generateTransform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const generateTransform = (props: TransformProps): string => {
      const {
        quadrant, qCoords, size, imageOrigin, xySwap, rotate,
      } = props;
      const { qx, qy } = qCoords;
    Severity: Minor
    Found in frontend/farm_designer/map/layers/images/map_image.tsx - About 1 hr to fix

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

        render() {
          const { color } = this.props;
          const style = {
            animationPlayState: this.state.isHovered ? "paused" : "running",
          };
      Severity: Minor
      Found in frontend/toast/fb_toast.tsx - About 1 hr to fix

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

          render() {
            const farmware = this.props.farmwares[this.current || ""];
            const panelName = "designer-farmware-info";
            return <DesignerPanel panelName={panelName} panel={Panel.Farmware}>
              <DesignerPanelHeader
        Severity: Minor
        Found in frontend/farmware/panel/info.tsx - About 1 hr to fix

          Function FarmEventForm has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const FarmEventForm = (props: FarmEventFormProps) => {
            const { isRegimen, fieldGet, fieldSet, timeSettings } = props;
            return <div className="farm-event-form">
              <label>
                {t("Sequence or Regimen")}
          Severity: Minor
          Found in frontend/farm_events/edit_fe_form.tsx - About 1 hr to fix

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

              render() {
                const panelType = this.panel == "weeds" ? Panel.Weeds : Panel.Points;
                const panelDescription = this.panel == "weeds"
                  ? Content.CREATE_WEEDS_DESCRIPTION
                  : Content.CREATE_POINTS_DESCRIPTION;
            Severity: Minor
            Found in frontend/points/create_points.tsx - About 1 hr to fix

              Function Feedback has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const Feedback = (props: FeedbackProps) => {
                const [message, setMessage] = React.useState("");
                const [sent, setSent] = React.useState(false);
                const orderNumber =
                  maybeGetDevice(store.getState().resources.index)?.body.fb_order_number;
              Severity: Minor
              Found in frontend/help/support.tsx - About 1 hr to fix

                Function AxisDisplayGroup has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const AxisDisplayGroup = (props: AxisDisplayGroupProps) => {
                  const { x, y, z } = props.position;
                  const detectionEnabled = {
                    x: !!props.firmwareSettings?.encoder_enabled_x,
                    y: !!props.firmwareSettings?.encoder_enabled_y,
                Severity: Minor
                Found in frontend/controls/axis_display_group.tsx - About 1 hr to fix

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

                    render() {
                      const panelName = "add-tool-slot";
                      return <DesignerPanel panelName={panelName} panel={Panel.Tools}>
                        <DesignerPanelHeader
                          panelName={panelName}
                  Severity: Minor
                  Found in frontend/tools/add_tool_slot.tsx - About 1 hr to fix

                    Function VersionChangeLines has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const VersionChangeLines = (props: VersionChangeLinesProps) => {
                      const changes: VersionChangeRecord[] = [];
                      const mostRecent = last(sortBy(props.telemetry, "body.created_at"));
                      props.telemetry.map((d, i) => {
                        if (i == 0) { return; }
                    Severity: Minor
                    Found in frontend/devices/connectivity/fbos_metric_history_plot.tsx - About 1 hr to fix

                      Function DataLabels has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DataLabels = (props: DataLabelsProps) => {
                        const { curve, showHoverEffect } = props;
                        const { normX, normY } = props.plotTools;
                        const { data, type } = curve.body;
                        const label = (plus: string) =>
                      Severity: Minor
                      Found in frontend/curves/chart.tsx - About 1 hr to fix

                        Function FarmwareEnvRow has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const FarmwareEnvRow = (props: FarmwareEnvRowProps) => {
                          const { dispatch, farmwareEnv } = props;
                          const [key, setKey] = React.useState(farmwareEnv.body.key);
                          const [value, setValue] = React.useState("" + farmwareEnv.body.value);
                          return <Row>
                        Severity: Minor
                        Found in frontend/photos/data_management/env_editor.tsx - About 1 hr to fix

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

                            render() {
                              const { zone } = this;
                              const zonesPath = Path.zones();
                              !zone && Path.startsWith(zonesPath) && push(zonesPath);
                              return <DesignerPanel panelName={"zone-info"} panel={Panel.Zones}>
                          Severity: Minor
                          Found in frontend/zones/edit_zone.tsx - About 1 hr to fix

                            Function ImageListItem has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const ImageListItem = (props: ImageListItemProps) => {
                              const images = sortBy(props.images.items, "body.created_at").reverse();
                              const [currentImage, setCurrentImage] = React.useState(images[0]);
                              return <div className={"image-items"}>
                                <ImageFlipper id={"image-items-flipper"}
                            Severity: Minor
                            Found in frontend/farm_designer/location_info.tsx - About 1 hr to fix

                              Function EncoderType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function EncoderType(props: EncoderTypeProps) {
                                const { hardware } = props;
                                const handleChange = (key: McuParamName) => (d: DropDownItem) => {
                                  const val = d.value;
                                  if (isEncoderValue(val)) {
                              Severity: Minor
                              Found in frontend/settings/hardware_settings/encoder_type.tsx - About 1 hr to fix

                                Function updateViaAjax has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function updateViaAjax(payl: AjaxUpdatePayload) {
                                  const { uuid, statusBeforeError, dispatch, index } = payl;
                                  const resource = findByUuid(index, uuid);
                                  const { body, kind } = resource;
                                  let verb: "post" | "put";
                                Severity: Minor
                                Found in frontend/api/crud.ts - About 1 hr to fix

                                  Function PlantCurveBulkUpdate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const PlantCurveBulkUpdate = (props: PlantCurveBulkUpdateProps) => {
                                    const points = props.allPoints.filter(point =>
                                      props.selected.includes(point.uuid) && point.kind === "Point" &&
                                      point.body.pointer_type == "Plant")
                                      .map((p: TaggedPlantPointer) => p);
                                  Severity: Minor
                                  Found in frontend/plants/edit_plant_status.tsx - About 1 hr to fix

                                    Function AdditionalWeedProperties has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        {Object.entries(props.point.body.meta).map(([key, value]) => {
                                          switch (key) {
                                            case "color":
                                            case "type": return <div key={key}
                                              className={`meta-${key}-not-displayed`} />;
                                    Severity: Minor
                                    Found in frontend/points/point_edit_actions.tsx - About 1 hr to fix

                                      Function FbosMetricHistoryPlot has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const FbosMetricHistoryPlot = (props: FbosMetricHistoryPlotProps) => {
                                        const mostRecent = last(sortBy(props.telemetry, "body.created_at"));
                                        const hoveredSeconds = clipX(props.hoveredTime, mostRecent);
                                        return <svg
                                          className={"fbos-metric-history-plot-border"}
                                      Severity: Minor
                                      Found in frontend/devices/connectivity/fbos_metric_history_plot.tsx - About 1 hr to fix

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

                                          render() {
                                            const {
                                              direction, axis, locked, arduinoBusy, botOnline, botPosition, movementState,
                                            } = this.props;
                                            const title = `${t("move {{axis}} axis", { axis })} (${this.distance})`;
                                        Severity: Minor
                                        Found in frontend/controls/move/direction_button.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language