FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

API has 55 functions (exceeds 20 allowed). Consider refactoring.
Open

export class API {
  /** Guesses the most appropriate API port based on a number of environment
   *  factors such as hostname and protocol (HTTP vs. HTTPS). */
  static inferPort(location = window.location): string {

Severity: Major
Found in frontend/api/api.ts - About 7 hrs to fix

    File maybe_highlight.tsx has 481 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from "react";
    import { store } from "../redux/store";
    import { SettingsPanelState } from "../interfaces";
    import { toggleControlPanel, bulkToggleControlPanel } from "./toggle_section";
    import { getUrlQuery, urlFriendly } from "../util";
    Severity: Minor
    Found in frontend/settings/maybe_highlight.tsx - About 7 hrs to fix

      File component.tsx has 473 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from "react";
      import {
        BlurableInput,
        EmptyStateWrapper,
        EmptyStateGraphic,
      Severity: Minor
      Found in frontend/folders/component.tsx - About 7 hrs to fix

        File location_info.tsx has 470 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from "react";
        import { Everything, MovementState, TimeSettings } from "../interfaces";
        import { BotPosition, UserEnv } from "../devices/interfaces";
        import { connect } from "react-redux";
        import { getUrlQuery } from "../util";
        Severity: Minor
        Found in frontend/farm_designer/location_info.tsx - About 7 hrs to fix

          File data.tsx has 465 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from "react";
          import { t } from "../../i18next_wrapper";
          import { FirmwareHardware } from "farmbot";
          import { Actions, TourContent } from "../../constants";
          import { Tour, TourStep } from "./interfaces";
          Severity: Minor
          Found in frontend/help/tours/data.tsx - About 7 hrs to fix

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

              render() {
                const { H_LO, H_HI, S_LO, S_HI, V_LO, V_HI } = this.props;
                const cameraCalibrationEnv = this.props.namespace("H_LO").includes("CAMERA");
                const defaultHLow = this.getDefault(cameraCalibrationEnv ? "H_HI" : "H_LO");
                const defaultHHigh = this.getDefault(cameraCalibrationEnv ? "H_LO" : "H_HI");
            Severity: Major
            Found in frontend/photos/image_workspace/index.tsx - About 6 hrs to fix

              File select_plants.tsx has 447 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from "react";
              import { useNavigate } from "react-router-dom";
              import { connect } from "react-redux";
              import { Everything, TimeSettings } from "../interfaces";
              import { PlantInventoryItem } from "./plant_inventory_item";
              Severity: Minor
              Found in frontend/plants/select_plants.tsx - About 6 hrs to fix

                Function Bed has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const Bed = (props: BedProps) => {
                  const {
                    bedWidthOuter, bedLengthOuter, botSizeZ, bedHeight, bedZOffset,
                    legSize, legsFlush, extraLegsX, extraLegsY, bedBrightness, soilBrightness,
                    soilHeight, ccSupportSize, axes, xyDimensions,
                Severity: Major
                Found in frontend/three_d_garden/bed.tsx - About 6 hrs to fix

                  File actions.ts has 441 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import axios from "axios";
                  import { success, warning, info, error } from "../toast/toast";
                  import { getDevice } from "../device";
                  import { Everything } from "../interfaces";
                  import {
                  Severity: Minor
                  Found in frontend/devices/actions.ts - About 6 hrs to fix

                    File crop_info.tsx has 440 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React from "react";
                    import { svgToUrl } from "../open_farm/icons";
                    import {
                      CropInfoProps, CropLiveSearchResult, DesignerState, OpenfarmSearch,
                    } from "../farm_designer/interfaces";
                    Severity: Minor
                    Found in frontend/plants/crop_info.tsx - About 6 hrs to fix

                      File constants.ts has 435 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /* eslint-disable max-len */
                      import { sampleSize } from "lodash";
                      
                      export const LIB_DIR = "/3D/lib/";
                      
                      
                      Severity: Minor
                      Found in frontend/three_d_garden/constants.ts - About 6 hrs to fix

                        File cards.tsx has 429 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import React from "react";
                        import { t } from "../i18next_wrapper";
                        import {
                          AlertCardProps, AlertCardTemplateProps, FirmwareMissingProps,
                          SeedDataMissingProps, SeedDataMissingState, TourNotTakenProps,
                        Severity: Minor
                        Found in frontend/messages/cards.tsx - About 6 hrs to fix

                          File config.ts has 428 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          export interface Config {
                            sizePreset: string;
                            bedType: string;
                            otherPreset: string;
                            label: string;
                          Severity: Minor
                          Found in frontend/three_d_garden/config.ts - About 6 hrs to fix

                            File chart.tsx has 422 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React from "react";
                            import { t } from "../i18next_wrapper";
                            import { floor, isUndefined, range, round } from "lodash";
                            import { Curve } from "farmbot/dist/resources/api_resources";
                            import { Color, Popover } from "../ui";
                            Severity: Minor
                            Found in frontend/curves/chart.tsx - About 6 hrs to fix

                              File zoom_beacons_constants.tsx has 419 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React from "react";
                              import { findIndex } from "lodash";
                              import { Config } from "./config";
                              import { threeSpace, zDir, zZero } from "./helpers";
                              import { ExternalUrl } from "../external_urls";
                              Severity: Minor
                              Found in frontend/three_d_garden/zoom_beacons_constants.tsx - About 6 hrs to fix

                                Function UtilitiesPost has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const UtilitiesPost = (props: UtilitiesPostProps) => {
                                  const {
                                    utilitiesPost, legSize, bedLengthOuter, bedWidthOuter,
                                    bedBrightness, bedHeight, bedZOffset,
                                  } = props.config;
                                Severity: Major
                                Found in frontend/three_d_garden/utilities_post.tsx - About 5 hrs to fix

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

                                    render() {
                                      const { dispatch, sequence } = this.props;
                                      const { viewSequenceCeleryScript, view } = this.state;
                                      const variableData = this.props.resources.sequenceMetas[sequence.uuid] || {};
                                      const declarations = betterCompact(Object.values(variableData)
                                  Severity: Major
                                  Found in frontend/sequences/sequence_editor_middle_active.tsx - About 5 hrs to fix

                                    File map_image.tsx has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import React from "react";
                                    import { TaggedImage } from "farmbot";
                                    import { CameraCalibrationData, BotOriginQuadrant } from "../../../interfaces";
                                    import { MapTransformProps } from "../../interfaces";
                                    import { transformXY } from "../../util";
                                    Severity: Minor
                                    Found in frontend/farm_designer/map/layers/images/map_image.tsx - About 5 hrs to fix

                                      File content.tsx has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import React from "react";
                                      import { t } from "../i18next_wrapper";
                                      import { Content, SetupWizardContent } from "../constants";
                                      import { FilePath } from "../internal_urls";
                                      import { isMobile } from "../screen_size";
                                      Severity: Minor
                                      Found in frontend/os_download/content.tsx - About 5 hrs to fix

                                        Function AxisSettings has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function AxisSettings(props: AxisSettingsProps) {
                                        
                                          const {
                                            dispatch, bot, sourceFwConfig, firmwareConfig, botOnline,
                                            firmwareHardware, showAdvanced,
                                        Severity: Major
                                        Found in frontend/settings/hardware_settings/axis_settings.tsx - About 5 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language