FarmBot/Farmbot-Web-App

View on GitHub

Showing 651 of 1,980 total issues

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

                            export const FirmwareNumberSettings = (props: FirmwareNumberSettingsProps) => {
                              const sourceFwConfig = sourceFwConfigValue(
                                validFwConfig(getFirmwareConfig(props.resources)),
                                props.bot.hardware.mcu_params);
                              return <div className={"motor-settings"}>
                            Severity: Minor
                            Found in frontend/wizard/step_components.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 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 SaveBtn has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function SaveBtn(props: SaveBtnProps) {
                                    const CLASS: Record<SpecialStatus, string> = {
                                      [SpecialStatus.DIRTY]: "is-dirty",
                                      [SpecialStatus.SAVING]: "is-saving",
                                      [SpecialStatus.SAVED]: "is-saved",
                                  Severity: Minor
                                  Found in frontend/ui/save_button.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

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

                                      export const CameraOffset = (props: WizardStepComponentProps) => {
                                        const helpText = t(ToolTips.CAMERA_OFFSET, {
                                          defaultX: WD_KEY_DEFAULTS["CAMERA_CALIBRATION_camera_offset_x"],
                                          defaultY: WD_KEY_DEFAULTS["CAMERA_CALIBRATION_camera_offset_y"],
                                        });
                                      Severity: Minor
                                      Found in frontend/wizard/checks.tsx - About 1 hr to fix

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

                                        export const mapStateToProps = (props: Everything): RegimenEditorProps => {
                                          const { dispatch } = props;
                                          const { currentRegimen } = props.resources.consumers.regimens;
                                          const current = maybeGetRegimen(props.resources.index, currentRegimen);
                                          const timeSettings = maybeGetTimeSettings(props.resources.index);
                                        Severity: Minor
                                        Found in frontend/regimens/editor/state_to_props.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language