FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

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 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 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 TileAssertion has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const TileAssertion = (props: StepParams<Assertion>) => {
          const [monaco, setMonaco] = React.useState(!isMobile());
          const [expanded, setExpanded] = React.useState(false);
          const stateToggles = {
            [StateToggleKey.monacoEditor]:
        Severity: Minor
        Found in frontend/sequences/step_tiles/tile_assertion.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 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

                  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 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() {
                          /** Change document meta title on every route change. */
                          updatePageInfo(Path.getSlug(Path.app()), Path.getSlug(Path.designer()));
                      
                          return <ErrorBoundary>
                      Severity: Minor
                      Found in frontend/nav/index.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

                          Method typical_sequence has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def self.typical_sequence
                                {
                                  kind: "sequence",
                                  name: "move_abs(1,2,3), move_rel(4,5,6), write_pin(13, off, digital)",
                                  color: "gray",
                          Severity: Minor
                          Found in spec/mutations/flat_ir_stuff/flat_ir_helpers.rb - About 1 hr to fix

                            Function requestAutoGeneration has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const requestAutoGeneration = (props: RequestAutoGenerationProps) => {
                              fetch(API.current.aiPath, {
                                method: "post",
                                headers: {
                                  Authorization: `Bearer: ${store.getState().auth?.token.encoded}`,
                            Severity: Minor
                            Found in frontend/sequences/request_auto_generation.ts - About 1 hr to fix

                              Function OFSearchRaw has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                (dispatch: Function) => {
                                  dispatch({ type: Actions.OF_SEARCH_RESULTS_START, payload: undefined });
                                  (specific
                                    ? openFarmSearchQuerySpecific(searchTerm)
                                    : openFarmSearchQuery(searchTerm))
                              Severity: Minor
                              Found in frontend/farm_designer/util.ts - About 1 hr to fix

                                Function SpreadLayer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function SpreadLayer(props: SpreadLayerProps) {
                                  const {
                                    plants, visible, mapTransformProps, currentPlant, hoveredSpread,
                                    dragging, zoomLvl, activeDragXY, activeDragSpread, editing, animate
                                  } = props;
                                Severity: Minor
                                Found in frontend/farm_designer/map/layers/spread/spread_layer.tsx - About 1 hr to fix

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

                                    render() {
                                      const { radius, x, y, id } = this.props.plant.body;
                                      const { visible, mapTransformProps, animate } = this.props;
                                      const { qx, qy } = transformXY(round(x), round(y), mapTransformProps);
                                      const spreadDiaCm = this.state.loaded
                                  Severity: Minor
                                  Found in frontend/farm_designer/map/layers/spread/spread_layer.tsx - About 1 hr to fix

                                    Function MapBackground has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function MapBackground(props: MapBackgroundProps) {
                                      const { mapTransformProps, plantAreaOffset, templateView } = props;
                                      const gridSize = getMapSize(mapTransformProps);
                                      const boardWidth = 20;
                                      const mapSize = getMapSize(mapTransformProps, plantAreaOffset);
                                    Severity: Minor
                                    Found in frontend/farm_designer/map/background/map_background.tsx - About 1 hr to fix

                                      Function modifyConfigsFromUrlParams has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const modifyConfigsFromUrlParams = (config: Config) => {
                                        let newConfig: Config = { ...config };
                                        const urlParams = new URLSearchParams(window.location.search);
                                        const kit = urlParams.get("kit")?.toLowerCase();
                                        if (kit) {
                                      Severity: Minor
                                      Found in frontend/three_d_garden/config.ts - About 1 hr to fix

                                        Function WizardStepHeader has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const WizardStepHeader = (props: WizardStepHeaderProps) => {
                                          const stepOpen = props.stepOpen == props.step.slug;
                                          const resultDate = props.stepResult?.updated_at;
                                          const stepDone = props.stepResult?.answer;
                                          const stepFail = stepDone == false;
                                        Severity: Minor
                                        Found in frontend/wizard/step.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language