FarmBot/Farmbot-Web-App

View on GitHub

Showing 655 of 1,993 total issues

Function GardenPoint has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const GardenPoint = (props: GardenPointProps) => {

  const iconHover = (action: "start" | "end") => () => {
    const hover = action === "start";
    props.dispatch({
Severity: Minor
Found in frontend/farm_designer/map/layers/points/garden_point.tsx - About 1 hr to fix

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

      render() {
        const panelName = "designer-regimen-editor";
        const regimen = this.props.current;
        const regimenCount = selectAllRegimens(this.props.resources).length;
        return <DesignerPanel panelName={panelName} panel={Panel.Regimens}>
    Severity: Minor
    Found in frontend/regimens/editor/editor.tsx - About 1 hr to fix

      Function Caster has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const Caster = (props: CasterProps) => {
        const {
          bedHeight, bedZOffset, legSize, legsFlush,
        } = props.config;
        const casterHeight = legSize * 1.375;
      Severity: Minor
      Found in frontend/three_d_garden/caster.tsx - About 1 hr to fix

        Function FolderNameEditor has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const FolderNameEditor = (props: FolderNodeProps) => {
          const { node } = props;
          const [settingsOpen, setSettingsOpen] = React.useState(false);
          const [hovered, setHovered] = React.useState(false);
          return <div
        Severity: Minor
        Found in frontend/folders/component.tsx - About 1 hr to fix

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

              render() {
                const {
                  className,
                  currentSequence,
                  currentStep,
            Severity: Minor
            Found in frontend/sequences/step_ui/step_header.tsx - About 1 hr to fix

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

                render() {
                  const { plant, dispatch } = this.props;
                  const plantId = (plant.body.id || "ERR_NO_PLANT_ID").toString();
              
                  const toggle = (action: "enter" | "leave") => {
              Severity: Minor
              Found in frontend/plants/plant_inventory_item.tsx - About 1 hr to fix

                Function connectivityData has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const connectivityData = (props: ConnectivityDataProps) => {
                  const fwVersion = props.bot.hardware
                    .informational_settings.firmware_version;
                
                  /** A record of all the things we know about connectivity right now. */
                Severity: Minor
                Found in frontend/devices/connectivity/generate_data.ts - About 1 hr to fix

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

                    render() {
                      const { setFilterLevel, sourceFbosConfig, getConfigValue } = this.props;
                      const LogSettingRow = (settingProps: LogSettingRecord) => {
                        const { label, setting, tooltip } = settingProps;
                        return <LogSetting
                  Severity: Minor
                  Found in frontend/logs/components/settings_menu.tsx - About 1 hr to fix

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

                      render() {
                        const {
                          email,
                          onEmailChange,
                          onSubmit,
                    Severity: Minor
                    Found in frontend/front_page/login.tsx - About 1 hr to fix

                      Function render has a Cognitive Complexity of 14 (exceeds 5 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: Minor
                      Found in frontend/photos/image_workspace/index.tsx - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function GardenPoint has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const GardenPoint = (props: GardenPointProps) => {
                      
                        const iconHover = (action: "start" | "end") => () => {
                          const hover = action === "start";
                          props.dispatch({
                      Severity: Minor
                      Found in frontend/farm_designer/map/layers/points/garden_point.tsx - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function render has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        render() {
                          const { plant, dispatch } = this.props;
                          const plantId = (plant.body.id || "ERR_NO_PLANT_ID").toString();
                      
                          const toggle = (action: "enter" | "leave") => {
                      Severity: Minor
                      Found in frontend/plants/plant_inventory_item.tsx - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function editGtLtCriteriaField has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const editGtLtCriteriaField = (
                        group: TaggedPointGroup,
                        criteriaField: "number_gt" | "number_lt",
                        criteriaKey: string,
                        pointerType?: PointerType,
                      Severity: Minor
                      Found in frontend/point_groups/criteria/edit.ts - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function Data has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const Data = (props: DataProps) => {
                        const { curve, setHovered, showHoverEffect, dragging } = props;
                        const { normX, normY, yZero, yMax } = props.plotTools;
                        const { data, type } = curve.body;
                        const fullWidth = X_MAX / maxDay(data);
                      Severity: Minor
                      Found in frontend/curves/chart.tsx - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Function prepareLocation has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const prepareLocation = (ddi: DropDownItem): {
                        locationNode: LocationNode | undefined,
                        locationSelection: LocSelection | undefined,
                      } => {
                        switch (ddi.headingId) {
                      Severity: Minor
                      Found in frontend/sequences/step_tiles/tile_computed_move/location.tsx - About 1 hr to fix

                        Function generateReducer has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function generateReducer<State>(initialState: State) {
                          /** A function that is passed the state, action and action handler.
                           * This is useful if you have custom business logic that needs to exit early
                           * or trigger alternative action handlers. Example: Not triggering
                           * INIT_RESOURCE when UI is set to "read-only" mode. */
                        Severity: Minor
                        Found in frontend/redux/generate_reducer.ts - About 1 hr to fix

                          Method if_topic_is_safe has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def if_topic_is_safe
                                if farmbot_demo?
                                  a, b, c = (routing_key_param || "").split(".")
                          
                                  if !(permission_param == "read")
                          Severity: Minor
                          Found in app/controllers/api/rmq_utils_controller.rb - About 1 hr to fix

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

                              render() {
                                const {
                                  visible, images, mapTransformProps, cameraCalibrationData,
                                  getConfigValue,
                                } = this.props;
                            Severity: Minor
                            Found in frontend/farm_designer/map/layers/images/image_layer.tsx - About 1 hr to fix

                              Function render has 43 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
                                Severity
                                Category
                                Status
                                Source
                                Language