FarmBot/Farmbot-Web-App

View on GitHub

Showing 612 of 1,578 total issues

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

  render() {
    const { x, y, z } = this.state;

    return <Row>
      <AxisInputBox
Severity: Minor
Found in frontend/controls/axis_input_box_group.tsx - About 1 hr to fix

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

      render() {
        return <div className={`add-${this.props.type}-eq-criteria`}>
          <Row>
            <Col xs={4}>
              <input type="string"
    Severity: Minor
    Found in frontend/point_groups/criteria/add.tsx - About 1 hr to fix

      Function PinnedSequences has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const PinnedSequences = (props: PinnedSequencesProps) => {
        const pinnedSequences = props.sequences.filter(x => x.body.pinned);
        return <div className={"pinned-sequence-list"}>
          {pinnedSequences.length > 0 &&
            <Widget className={"pinned-sequences-widget"}>
      Severity: Minor
      Found in frontend/controls/pinned_sequence_list.tsx - About 1 hr to fix

        Function NumberCriteriaSelection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const NumberCriteriaSelection = (props: NumberCriteriaProps) => {
          const criteriaField = props.criteria[props.criteriaKey];
          return <div className={"number-gt-lt-criteria"}>
            <AddNumberCriteria {...props} />
            {criteriaField && Object.entries(criteriaField)
        Severity: Minor
        Found in frontend/point_groups/criteria/show.tsx - About 1 hr to fix

          Function PowerAndResetMenu has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const PowerAndResetMenu = (props: PowerAndResetMenuProps) => {
            const { botOnline } = props;
            return <div className={"power-and-reset-menu"}>
              <FbosButtonRow
                botOnline={botOnline}
          Severity: Minor
          Found in frontend/controls/move/jog_buttons.tsx - About 1 hr to fix

            Function YAxis has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const YAxis = (props: YAxisProps) => {
              const { data } = props.curve.body;
              const { normY, xMax } = props.plotTools;
              const thirds = maxValue(data) / 3;
              const yStep = floor(thirds, 1 - ("" + floor(thirds)).length);
            Severity: Minor
            Found in frontend/curves/chart.tsx - About 1 hr to fix

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

                render() {
                  return <div className="add-number-criteria">
                    <Row>
                      <Col xs={4}>
                        <input type="string"
              Severity: Minor
              Found in frontend/point_groups/criteria/add.tsx - About 1 hr to fix

                Function resourceList has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  (resources: ResourceIndex, sequenceUuid: UUID): DropDownItem[] => {
                    const deviceId = maybeGetDevice(resources)?.body.id || 0;
                    const points = selectAllPoints(resources).filter(p => !!p.body.id);
                    const mapPoints = points.filter(p => p.body.pointer_type == "GenericPointer");
                    const weeds = points.filter(p => p.body.pointer_type == "Weed");
                Severity: Minor
                Found in frontend/sequences/step_tiles/tile_mark_as/resource_selection.tsx - About 1 hr to fix

                  Function sanitizeNodes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const sanitizeNodes = (thisSequence: Sequence): SanitizationResult => {
                    // Collect all *declared* variables.
                    const declared: Dictionary<ScopeDeclarationBodyItem> = {};
                    (thisSequence.args.locals.body || []).map(variable =>
                      declared[variable.args.label] = variable);
                  Severity: Minor
                  Found in frontend/sequences/locals_list/sanitize_nodes.ts - About 1 hr to fix

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

                      render() {
                        const H_AVG = this.props.invertHue
                          ? 0
                          : ((this.props.h[1] * 2 + this.props.h[0] * 2) / 2);
                        /** 💥💥💥SURPRISING CODE AHEAD:
                    Severity: Minor
                    Found in frontend/photos/image_workspace/farmbot_picker.tsx - About 1 hr to fix

                      Function dropPlant has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const dropPlant = (props: DropPlantProps) => {
                        const {
                          gardenCoords, gridSize, dispatch, getConfigValue,
                        } = props;
                        const { companionIndex, cropSearchResults, openedSavedGarden } = props.designer;
                      Severity: Minor
                      Found in frontend/farm_designer/map/layers/plants/plant_actions.ts - About 1 hr to fix

                        Function SeedTrough has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const SeedTrough = (props: ToolGraphicProps) => {
                          const { x, y, hovered } = props;
                          return <g id={"seed-trough"}>
                            <path fillOpacity={0.5}
                              fill={hovered ? Color.darkGray : Color.mediumGray}
                        Severity: Minor
                        Found in frontend/farm_designer/map/tool_graphics/seed_trough.tsx - About 1 hr to fix

                          Function lightsFigure has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function lightsFigure(
                            props: { i: number, x: number, y: number, height: number, xySwap: boolean }) {
                            const { i, x, y, height, xySwap } = props;
                            const mapHeightMid = height / 2 + y;
                            return <g id="lights" key={`peripheral_${i}`}>
                          Severity: Minor
                          Found in frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx - About 1 hr to fix

                            Function RotaryToolImplementProfile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const RotaryToolImplementProfile = (props: SpecificToolProfileProps) => {
                              const { x, y, sideView } = props;
                              const motorR = RotaryToolDimensions.motorRadius;
                              const motorV = RotaryToolDimensions.motorHeight;
                              const spindleR = RotaryToolDimensions.spindleRadius;
                            Severity: Minor
                            Found in frontend/farm_designer/map/tool_graphics/rotary_tool.tsx - About 1 hr to fix

                              Function jogPoints has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const jogPoints = (props: JogPointsProps) => {
                                const { keyName, points, dispatch } = props;
                                if (!(points.length > 0)) { return; }
                                const { gridSize, xySwap, quadrant } = props.mapTransformProps;
                                const horizontal = xySwap ? "deltaY" : "deltaX";
                              Severity: Minor
                              Found in frontend/farm_designer/map/layers/plants/plant_actions.ts - About 1 hr to fix

                                Function ToolbaySlot has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const ToolbaySlot = (props: ToolSlotGraphicProps) => {
                                  const { id, x, y, pulloutDirection, quadrant, xySwap } = props;
                                  const angle = toolbaySlotAngle(pulloutDirection, quadrant, xySwap);
                                  const width = SlotDimensions.width;
                                  const length = SlotDimensions.topViewLength;
                                Severity: Minor
                                Found in frontend/farm_designer/map/tool_graphics/slot.tsx - About 1 hr to fix

                                  Function PointGraphic has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const PointGraphic = (props: ProfilePointProps) => {
                                    const { point } = props;
                                    const { color } = props.point.body.meta;
                                    switch (point.body.pointer_type) {
                                      case "ToolSlot":
                                  Severity: Minor
                                  Found in frontend/farm_designer/map/profile/content.tsx - About 1 hr to fix

                                    Function Weeder has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const Weeder = (props: ToolGraphicProps) => {
                                      const { x, y, hovered } = props;
                                      const width = WeederDimensions.width;
                                      const height = WeederDimensions.thickness;
                                      return <g id={"weeder"}>
                                    Severity: Minor
                                    Found in frontend/farm_designer/map/tool_graphics/weeder.tsx - About 1 hr to fix

                                      Function MarkedSlider has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function MarkedSlider<T = TaggedImage>(props: MarkedSliderProps<T>) {
                                        return <div className={`sliders ${props.vertical ? "vertical" : ""}`}>
                                          <MultiSlider
                                            className={`data-slider ${props.vertical ? "vertical" : ""}`}
                                            vertical={props.vertical}
                                      Severity: Minor
                                      Found in frontend/ui/marked_slider.tsx - About 1 hr to fix

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

                                          render() {
                                            return <Highlight settingName={DeviceSetting.importParameters}>
                                              <Row>
                                                <Col xs={12}>
                                                  <label>
                                        Severity: Minor
                                        Found in frontend/settings/hardware_settings/parameter_management.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language