FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

Function VariableForm has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props: VariableFormProps) => {
    const { sequenceUuid, resources, bodyVariables, variable, variableType,
      allowedVariableNodes, hideGroups, removeVariable, onChange } = props;
    const { celeryNode, dropdown, vector, isDefault } = maybeUseStepData({
      resources, bodyVariables, variable, uuid: sequenceUuid
Severity: Major
Found in frontend/sequences/locals_list/variable_form.tsx - About 5 hrs to fix

    Function RotaryTool has 140 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      (props: JSX.IntrinsicElements["group"]) => {
        const { nodes, materials } = model;
        return <Group {...props}>
          <MeshComponent
            geometry={nodes.M25_x_6mm_Screw.geometry}
    Severity: Major
    Found in frontend/three_d_garden/parts/rotary_tool.tsx - About 5 hrs to fix

      Function WIZARD_STEPS has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      export const WIZARD_STEPS = (props: WizardStepDataProps): WizardSteps => {
        const { firmwareHardware } = props;
        const xySwap = !!props.getConfigValue?.(BooleanSetting.xy_swap);
        const positiveMovementInstruction = (swap: boolean) =>
          swap
      Severity: Minor
      Found in frontend/wizard/data.ts - About 5 hrs 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 SoilSensor has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        (props: JSX.IntrinsicElements["group"]) => {
          const { nodes, materials } = model;
          // eslint-disable-next-line no-null/no-null
          return <Group {...props} dispose={null}>
            <MeshComponent
      Severity: Major
      Found in frontend/three_d_garden/parts/soil_sensor.tsx - About 5 hrs to fix

        File edit_curve.tsx has 394 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from "react";
        import { t } from "../i18next_wrapper";
        import { connect } from "react-redux";
        import { SpecialStatus, TaggedCurve } from "farmbot";
        import { round, take } from "lodash";
        Severity: Minor
        Found in frontend/curves/edit_curve.tsx - About 5 hrs to fix

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

            render() {
              const { getConfigValue, dispatch, firmwareConfig,
                sourceFwConfig, sourceFbosConfig, resources, settingsPanelState,
              } = this.props;
              const showAdvanced = !!getConfigValue(BooleanSetting.show_advanced_settings);
          Severity: Major
          Found in frontend/settings/index.tsx - About 5 hrs to fix

            File variable_form.tsx has 389 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from "react";
            import { Row, FBSelect, Color, BlurableInput, Help } from "../../ui";
            import {
              variableFormList, NO_VALUE_SELECTED_DDI, sortVariables, heading, sequences2Ddi,
              LOCATION_PLACEHOLDER_DDI,
            Severity: Minor
            Found in frontend/sequences/locals_list/variable_form.tsx - About 5 hrs to fix

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

                render() {
                  const wDEnvGet = (key: WDENVKey) => envGet(key, this.props.wDEnv);
                  const { syncStatus, botToMqttStatus, photosPanelState } = this.props;
                  const botOnline = isBotOnline(syncStatus, botToMqttStatus);
                  const common = {
              Severity: Major
              Found in frontend/photos/photos.tsx - About 5 hrs to fix

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

                  render() {
                    const { dispatch } = this.props;
                    const gridIds = compact(uniq(this.props.genericPoints
                      .map(p => p.body.meta.gridId)));
                    const points = orderedPoints(this.props.genericPoints, this.state)
                Severity: Major
                Found in frontend/points/point_inventory.tsx - About 5 hrs to fix

                  File fbos_details.tsx has 387 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from "react";
                  import { Saucer, FBSelect, Help, Popover } from "../../ui";
                  import { updateConfig } from "../../devices/actions";
                  import { last, isNumber, isString } from "lodash";
                  import { Content, ToolTips } from "../../constants";
                  Severity: Minor
                  Found in frontend/settings/fbos_settings/fbos_details.tsx - About 5 hrs to fix

                    Function PowerSupply has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const PowerSupply = (props: PowerSupplyProps) => {
                      const {
                        bedWidthOuter, bedLengthOuter, bedHeight, botSizeX,
                        legSize, ccSupportSize, bedZOffset
                      } = props.config;
                    Severity: Major
                    Found in frontend/three_d_garden/power_supply.tsx - About 5 hrs to fix

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

                        render() {
                          const {
                            legend_menu_open,
                            show_plants,
                            show_points,
                      Severity: Major
                      Found in frontend/farm_designer/index.tsx - About 5 hrs to fix

                        Function GardenModel has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const GardenModel = (props: GardenModelProps) => {
                          const { config } = props;
                          const groundZ = config.bedZOffset + config.bedHeight;
                          const Camera = config.perspective ? PerspectiveCamera : OrthographicCamera;
                        
                        
                        Severity: Minor
                        Found in frontend/three_d_garden/garden.tsx - About 5 hrs 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

                        File reducer_support.ts has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import {
                          ResourceName, SpecialStatus, TaggedResource, TaggedSequence,
                        } from "farmbot";
                        import { combineReducers, ReducersMapObject, UnknownAction } from "redux";
                        import { helpReducer as help } from "../help/reducer";
                        Severity: Minor
                        Found in frontend/resources/reducer_support.ts - About 5 hrs to fix

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

                            render() {
                              const {
                                stepSize, arduinoBusy, locked, getConfigValue, env, highlightHome,
                                highlightAxis, highlightDirection, botPosition, botOnline, dispatch,
                              } = this.props;
                          Severity: Major
                          Found in frontend/controls/move/jog_buttons.tsx - About 4 hrs to fix

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

                              render() {
                                const { dispatch, plantsPanelState, plants } = this.props;
                                const filteredPlants = plants
                                  .filter(p => p.body.name.toLowerCase()
                                    .includes(this.state.searchTerm.toLowerCase()));
                            Severity: Major
                            Found in frontend/plants/plant_inventory.tsx - About 4 hrs to fix

                              File model.tsx has 367 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /* eslint-disable no-null/no-null */
                              import React, { useRef } from "react";
                              import * as THREE from "three";
                              import {
                                Cylinder, Html, PerspectiveCamera, useGLTF,
                              Severity: Minor
                              Found in frontend/settings/pin_bindings/model.tsx - About 4 hrs to fix

                                File gantry_wheel_plate.tsx has 357 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /* eslint-disable max-len */
                                import React from "react";
                                import * as THREE from "three";
                                import { InstancedBufferAttribute } from "three";
                                import { GLTF } from "three-stdlib";
                                Severity: Minor
                                Found in frontend/three_d_garden/parts/gantry_wheel_plate.tsx - About 4 hrs to fix

                                  File interfaces.ts has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { OpenFarm } from "../open_farm/openfarm";
                                  import { DropDownItem } from "../ui";
                                  import {
                                    TaggedFarmEvent,
                                    TaggedSequence,
                                  Severity: Minor
                                  Found in frontend/farm_designer/interfaces.ts - About 4 hrs to fix

                                    Function EncodersOrStallDetection has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function EncodersOrStallDetection(props: EncodersOrStallDetectionProps) {
                                    
                                      const { encoders_or_stall_detection } = props.settingsPanelState;
                                      const {
                                        dispatch, sourceFwConfig, firmwareHardware, arduinoBusy, showAdvanced,
                                    Severity: Major
                                    Found in frontend/settings/hardware_settings/encoders_or_stall_detection.tsx - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language