FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

Function textAnchorPosition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const textAnchorPosition = (
  pulloutDirection: ToolPulloutDirection,
  quadrant: BotOriginQuadrant,
  xySwap: boolean,
  gantryMounted: boolean,
Severity: Minor
Found in frontend/farm_designer/map/layers/tool_slots/tool_label.tsx - About 1 hr to fix

    Function SensorReadingsLayer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function SensorReadingsLayer(props: SensorReadingsLayerProps) {
      const {
        visible, sensorReadings, mapTransformProps, timeSettings, sensors
      } = props;
      const mostRecentSensorReading = last(sensorReadings);

      Function reduceMoveAbsolute has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const reduceMoveAbsolute = (
        step: MoveAbsolute,
        sequenceUuid: UUID | undefined,
      ): Position | undefined => {
        const offset = step.args.offset.args;
      Severity: Minor
      Found in frontend/farm_designer/map/sequence_visualization.tsx - About 1 hr to fix

        Function Section has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const Section = (sectionProps: SectionProps) => {
            const { title, configKey, options } = sectionProps;
            return <div className={"setting-section"}>
              <div className="setting-title">{title}</div>
              <div className={"row"}>
        Severity: Minor
        Found in frontend/three_d_garden/config_overlays.tsx - About 1 hr to fix

          Function commitBulkEditor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function commitBulkEditor(): Thunk {
            return function (dispatch, getState) {
              const resources = getState().resources;
              const { weeks, dailyOffsetMs, selectedSequenceUUID, currentRegimen } =
                resources.consumers.regimens;
          Severity: Minor
          Found in frontend/regimens/bulk_scheduler/actions.ts - About 1 hr to fix

            Function Apology has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function Apology(_: {}) {
              return <div style={OUTER_STYLE}>
                <div style={INNER_STYLE}>
                  <h1 style={{ fontSize: "175%" }}>Page Error</h1>
                  <span>
            Severity: Minor
            Found in frontend/apology.tsx - About 1 hr to fix

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

                render() {
                  const { dispatch, bot } = this.props;
                  return <div className={"logs-tab grid"}>
                    <div className={"search-row"}>
                      <SearchField nameKey={"logs"}
              Severity: Minor
              Found in frontend/logs/index.tsx - About 1 hr to fix

                Function RawGroupListPanel has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const RawGroupListPanel = (props: GroupListPanelProps) => {
                  const [searchTerm, setSearchTerm] = React.useState("");
                
                  const navigate = useNavigate();
                  const navigateById = (id: number | undefined) => () => navigate(Path.groups(id));
                Severity: Minor
                Found in frontend/point_groups/group_list_panel.tsx - About 1 hr to fix

                  Function beforeEach has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const beforeEach = (state: RestResources,
                    action: ReduxAction<unknown>,
                    handler: ActionHandler<RestResources, unknown>) => {
                    const { byKind, references } = state.index;
                    const w = references[Object.keys(byKind.WebAppConfig)[0]];
                  Severity: Minor
                  Found in frontend/resources/reducer_support.ts - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (box &&
                          isNumber(box.x0) && isNumber(box.y0) &&
                          isNumber(box.x1) && isNumber(box.y1)) {
                          return (
                            p.body.x >= Math.min(box.x0, box.x1) &&
                    Severity: Critical
                    Found in frontend/farm_designer/map/background/selection_box_actions.ts - About 1 hr to fix

                      Function PhotoResolutionSettingChanged has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        (props: CaptureSizeSelectionProps) => {
                          const { env, dispatch, saveFarmwareEnv } = props;
                          const { width, height } = getCurrentSizeSetting(env);
                          const selectedLongEdge = Math.max(parseInt(width), parseInt(height));
                          const calibratedX = env["CAMERA_CALIBRATION_center_pixel_location_x"];
                      Severity: Minor
                      Found in frontend/photos/capture_settings/capture_size_selection.tsx - About 1 hr to fix

                        Function DesignerPanelHeader has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const DesignerPanelHeader = (props: DesignerPanelHeaderProps) => {
                          const panelColor = props.panel ? TAB_COLOR[props.panel] : props.panelColor;
                          const colorClass = props.colorClass || `${panelColor || PanelColor.gray}-panel`;
                          const navigate = useNavigate();
                          return <div className={`panel-header ${colorClass}`}
                        Severity: Minor
                        Found in frontend/farm_designer/designer_panel.tsx - About 1 hr to fix

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

                            render() {
                              return <div className={"drop-area"} {...this.mapDropAreaProps()}>
                                <ErrorBoundary>
                                  <svg id={"map-background-svg"}>
                                    <this.MapBackground />
                          Severity: Minor
                          Found in frontend/farm_designer/map/garden_map.tsx - About 1 hr to fix

                            Function LocationActions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const LocationActions = (props: LocationActionsProps) => {
                              const navigate = useNavigate();
                              return <div className={"location-actions"}>
                                <MoveToForm
                                  chosenLocation={props.chosenLocation}
                            Severity: Minor
                            Found in frontend/farm_designer/location_info.tsx - About 1 hr to fix

                              Function ZDisplay has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const ZDisplay = (props: ZDisplayProps) => {
                                const tools = props.allPoints.filter(p => p.body.pointer_type == "ToolSlot")
                                  .map(p => p.body.z).sort()[0];
                                const soil = props.allPoints.filter(soilHeightPoint)
                                  .map(p => p.body.z).sort()[0];
                              Severity: Minor
                              Found in frontend/farm_designer/map/legend/z_display.tsx - About 1 hr to fix

                                Function responseRejected has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function responseRejected(x: SafeError | undefined) {
                                  if (x && isSafeError(x)) {
                                    dispatchNetworkUp("user.api", now());
                                    const a = ![451, 401, 422].includes(x.response.status);
                                    const b = x.response.status > 399;
                                Severity: Minor
                                Found in frontend/interceptors.ts - About 1 hr to fix

                                  Function BindingTargetDropdown has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const BindingTargetDropdown = (props: BindingTargetDropdownProps) => {
                                    const list = () => {
                                      const { resources } = props;
                                      const dropDownList: DropDownItem[] = [];
                                  
                                  
                                  Severity: Minor
                                  Found in frontend/settings/pin_bindings/pin_binding_input_group.tsx - About 1 hr to fix

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

                                      render() {
                                        const farmwareNames = Object.values(this.props.farmwares)
                                          .map(fw => fw.name)
                                          .filter(farmwareName => farmwareName != FarmwareName.MeasureSoilHeight)
                                          .filter(fwName => !this.props.firstPartyFarmwareNames.includes(fwName));
                                    Severity: Minor
                                    Found in frontend/farmware/panel/list.tsx - About 1 hr to fix

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

                                      export function mapStateToProps(props: Everything): EditPlantInfoProps {
                                        const openedSavedGarden =
                                          props.resources.consumers.farm_designer.openedSavedGarden;
                                        const gardenOpen = !!openedSavedGarden;
                                        const findPlant = (id: string | undefined) => {
                                      Severity: Minor
                                      Found in frontend/plants/map_state_to_props.ts - About 1 hr to fix

                                        Function deletePoints has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function deletePoints(
                                          pointName: string,
                                          query: Partial<Point>,
                                          cb?: ProgressCallback): Thunk {
                                          // TODO: Generalize and add to api/crud.ts
                                        Severity: Minor
                                        Found in frontend/api/delete_points.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language