FarmBot/Farmbot-Web-App

View on GitHub

Showing 612 of 1,578 total issues

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

  render() {
    const { group } = this.props;
    const groupsPath = Path.groups();
    !group && Path.startsWith(groupsPath) && history.back();
    return <DesignerPanel panelName={"group-detail"} panel={Panel.Groups}>
Severity: Minor
Found in frontend/point_groups/group_detail.tsx - About 1 hr to fix

    Function PointsSection has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const PointsSection = (props: PointsSectionProps) => {
      const { genericPoints, isOpen, dispatch, averageZ, toggleAction } = props;
      return <div className={`points-section ${isOpen ? "open" : ""}`}>
        <div className={"points-section-header"} onClick={props.toggleOpen}>
          {props.color && <Saucer color={props.color} />}
    Severity: Minor
    Found in frontend/points/point_inventory.tsx - About 1 hr to fix

      Function LogSetting has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const LogSetting = (props: LogSettingProps) => {
        const { label, setting, toolTip, setFilterLevel, sourceFbosConfig } = props;
        /** Update the current filter level to a minimum needed for log display. */
        const updateMinFilterLevel = (key: keyof Filters, level: number) => {
          const currentLevel =
      Severity: Minor
      Found in frontend/logs/components/settings_menu.tsx - About 1 hr to fix

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

        const ShownInMapDetails = (props: ImageShowProps) => {
          const { dispatch, image, flags, size } = props;
          const shownInMap = every(Object.values(flags));
          return <div className={`shown-in-map-details ${shownInMap ? "shown" : ""}`}
            onMouseEnter={() => shownInMap && dispatch(highlightMapImage(image?.body.id))}
        Severity: Minor
        Found in frontend/photos/images/image_show_menu.tsx - About 1 hr to fix

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

          function waterFigure(
            props: { i: number, cx: number, cy: number, animate: boolean }) {
            const { i, cx, cy, animate } = props;
            const color = "rgb(11, 83, 148)";
            const copies = animate ? 3 : 1;
          Severity: Minor
          Found in frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx - About 1 hr to fix

            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 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 DesignerPanelHeader has 34 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 textColor = props.blackText ? "black" : "white";
                    return <div className={`panel-header ${colorClass}`}
                  Severity: Minor
                  Found in frontend/farm_designer/designer_panel.tsx - About 1 hr to fix

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

                    export const PinNumberInputGroup = (props: PinNumberInputGroupProps) => {
                      const { pinNumberInput, boundPins, setSelectedPin } = props;
                      const selectedPinNumber = isNumber(pinNumberInput)
                        ? {
                          label: generatePinLabel(pinNumberInput),
                    Severity: Minor
                    Found in frontend/settings/pin_bindings/pin_binding_input_group.tsx - 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() {
                            return <Row className={"zero-side-margins"}>
                              <label>
                                {t(this.props.title)}
                              </label>
                        Severity: Minor
                        Found in frontend/settings/account/dangerous_delete_widget.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 render has 34 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 ForgotPassword has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function ForgotPassword(props: ForgotPasswordProps) {
                                const {
                                  onGoBack,
                                  onSubmit,
                                  email,
                              Severity: Minor
                              Found in frontend/front_page/forgot_password.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

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

                                    render() {
                                      const { dispatch, bot } = this.props;
                                      return <div className={"logs-tab"}>
                                        <div className={"search-row"}>
                                          <SearchField nameKey={"logs"}
                                  Severity: Minor
                                  Found in frontend/logs/index.tsx - 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 VariablesPart has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const VariablesPart = (props: StepParams<Assertion>) => {
                                          let sequenceId: number | undefined;
                                          const { _then } = props.currentStep.args;
                                          if (_then.kind == "execute") {
                                            sequenceId = _then.args.sequence_id;
                                        Severity: Minor
                                        Found in frontend/sequences/step_tiles/tile_assertion/variables_part.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language