FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

Function ToolProfile has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ToolProfile = (props: ProfileToolProps) => {
  const { toolName, x, y, width, height, sideView } = props;
  const toolType = reduceToolName(toolName);
  const fontColor = toolType == ToolName.seeder
    ? Color.darkGray
Severity: Minor
Found in frontend/farm_designer/map/profile/tools.tsx - About 1 hr to fix

    Function BotPeripherals has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function BotPeripherals(props: BotPeripheralsProps) {
      const {
        peripheralValues, position, plantAreaOffset, mapTransformProps, getConfigValue,
      } = props;
      const { xySwap } = mapTransformProps;
    Severity: Minor
    Found in frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx - About 1 hr to fix

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

        render() {
          const { farmware, env, dispatch, botOnline } = this.props;
      
          const collapsed = (config: FarmwareConfig) =>
            farmware.name == FarmwareName.MeasureSoilHeight
      Severity: Minor
      Found in frontend/farmware/farmware_forms.tsx - About 1 hr to fix

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

          render() {
            const weedGroups = pointGroupSubset(this.props.groups, "Weed");
            const filteredGroups = weedGroups
              .filter(p => p.body.name.toLowerCase()
                .includes(this.state.searchTerm.toLowerCase()));
        Severity: Minor
        Found in frontend/weeds/weeds_inventory.tsx - About 1 hr to fix

          Function fetchSyncData has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export async function fetchSyncData(dispatch: Function) {
            const get = download(dispatch);
            /** Resources are placed into groups based on their dependencies.
             * For example, if:
             *  * a Regimen relies on a Sequence
          Severity: Minor
          Found in frontend/sync/actions.ts - About 1 hr to fix

            Function FolderNode has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const FolderNode = (props: FolderNodeProps) => {
              const { node, sequences } = props;
            
              const sequenceItems = node.content
                .filter(seqUuid => sequences[seqUuid])
            Severity: Minor
            Found in frontend/folders/component.tsx - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                if (isNumber(x) && isNumber(y) && height > 0 && width > 0 &&
                  isNumber(imageScale) && imageScale > 0 &&
                  isNumber(imageOffsetX) && isNumber(imageOffsetY) && imageOrigin) {
                  return {
                    x, y, width, height, imageScale, imageOffsetX, imageOffsetY, imageOrigin
              Severity: Critical
              Found in frontend/farm_designer/map/layers/images/map_image.tsx - About 1 hr to fix

                Function SequencePreviewContent has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const SequencePreviewContent = (props: SequencePreviewContentProps) => {
                  const { sequence, viewSequenceCeleryScript } = props;
                  return <EmptyStateWrapper
                    notEmpty={sequence && isTaggedSequence(sequence)}
                    graphic={EmptyStateGraphic.sequences}
                Severity: Minor
                Found in frontend/sequences/panel/preview_support.tsx - About 1 hr to fix

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

                    render() {
                      const { currentStep, currentSequence, resources,
                      } = this.props;
                      const { sequence_id } = currentStep.args;
                      const callee = sequence_id
                  Severity: Minor
                  Found in frontend/sequences/step_tiles/tile_execute.tsx - About 1 hr to fix

                    Function WateringNozzle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const WateringNozzle = (props: ToolGraphicProps) => {
                      const { x, y, hovered, uuid } = props;
                      const r = 2;
                      const ySpacing = 10;
                      const xSpacing = 14;
                    Severity: Minor
                    Found in frontend/farm_designer/map/tool_graphics/watering_nozzle.tsx - About 1 hr to fix

                      Function TargetCoordinate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function TargetCoordinate(props: TargetCoordinateProps) {
                        const ID = "target-coordinate";
                        if (!props.chosenLocation) { return <g id={ID} />; }
                        const { x, y } = props.chosenLocation;
                        if (isNumber(x) && isNumber(y)) {
                      Severity: Minor
                      Found in frontend/farm_designer/map/background/target_coordinate.tsx - About 1 hr to fix

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

                          render() {
                            const { figureName, position, plantAreaOffset, mapTransformProps,
                            } = this.props;
                            const { xySwap } = mapTransformProps;
                            const mapSize = getMapSize(mapTransformProps, plantAreaOffset);
                        Severity: Minor
                        Found in frontend/farm_designer/map/layers/farmbot/bot_figure.tsx - About 1 hr to fix

                          Function SoilSensorImplementProfile has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const SoilSensorImplementProfile = (props: SpecificToolProfileProps) => {
                            const { x, y, sideView } = props;
                            const width = SoilSensorDimensions.width;
                            const length = SoilSensorDimensions.length;
                            const baseLength = SoilSensorDimensions.baseLength;
                          Severity: Minor
                          Found in frontend/farm_designer/map/tool_graphics/soil_sensor.tsx - About 1 hr to fix

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

                              render() {
                                const { images, currentImage } = this.props;
                                const multipleImages = images.length > 1;
                                const dark = this.props.id === "fullscreen-flipper";
                                return <div className={`image-flipper ${this.props.id}`} id={this.props.id}
                            Severity: Minor
                            Found in frontend/photos/images/image_flipper.tsx - About 1 hr to fix

                              Function PromoInfo has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const PromoInfo = (props: PromoInfoProps) => {
                                const { isGenesis } = props;
                                return <div className="promo-info">
                                  <h2 className="title">Explore our models</h2>
                                  {isGenesis
                              Severity: Minor
                              Found in frontend/three_d_garden/config_overlays.tsx - About 1 hr to fix

                                Function XAxisWaterTube has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const XAxisWaterTube = (props: XAxisWaterTubeProps) => {
                                  const { config } = props;
                                  const groundZ = -config.bedHeight - config.bedZOffset;
                                  const barbX = threeSpace(config.bedLengthOuter / 2 + 400, config.bedLengthOuter);
                                  const barbY = threeSpace(-50, config.bedWidthOuter);
                                Severity: Minor
                                Found in frontend/three_d_garden/x_axis_water_tube.tsx - About 1 hr to fix

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

                                    render() {
                                      const { maxCount } = this.state;
                                      const { group, hovered, dispatch, iconDisplay } = this.props;
                                      const manuallyAddedIds = group.body.point_ids;
                                      const sortedPoints = this.sortedGroup;
                                  Severity: Minor
                                  Found in frontend/point_groups/criteria/component.tsx - About 1 hr to fix

                                    Function Edit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function Edit(props: WebcamPanelProps) {
                                      const rows = sortedFeeds(props.feeds).map(wcf => {
                                        return <KeyValEditRow key={wcf.uuid}
                                          onClick={() => props.destroy(wcf)}
                                          onLabelChange={(e) => props.edit(wcf, { name: e.currentTarget.value })}
                                    Severity: Minor
                                    Found in frontend/controls/webcam/edit.tsx - About 1 hr to fix

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

                                        render() {
                                          const commonProps = {
                                            key: JSON.stringify(this.state)
                                              + JSON.stringify(this.props.currentSequence.body.args.locals),
                                            resource: this.state.resource,
                                      Severity: Minor
                                      Found in frontend/sequences/step_tiles/tile_mark_as/component.tsx - About 1 hr to fix

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

                                          render() {
                                            return <div className="photos">
                                              <Overlay isOpen={this.state.fullscreen}
                                                onClose={this.toggleFullscreen}
                                                backdropProps={{ style: { background: "#000d" } }}>
                                        Severity: Minor
                                        Found in frontend/photos/images/photos.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language