FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

Function Companions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Companions = (props: CropInfoListProps) => {
  const { result, dispatch, openfarmCropFetch } = props;
  if (result.companions.length == 0) { return <div />; }
  return <InfoField title={"companions"}>
    <div className="crop-companions">
Severity: Minor
Found in frontend/plants/crop_info.tsx - About 1 hr to fix

    Function SequenceItemDescription has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const SequenceItemDescription = (props: SequenceItemDescriptionProps) => {
      const { sequence, inUse } = props;
      const deprecatedSteps = JSON.stringify(props.sequence.body.body)
        .includes("resource_update");
      const { pinned, forked, sequence_version_id, description } = props.sequence.body;
    Severity: Minor
    Found in frontend/folders/component.tsx - About 1 hr to fix

      Function variableFormList has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function variableFormList(
        resources: ResourceIndex,
        additionalItems: DropDownItem[],
        variableItems?: DropDownItem[],
        displayGroups?: boolean,
      Severity: Minor
      Found in frontend/sequences/locals_list/variable_form_list.ts - About 1 hr to fix

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

        export const mapStateToProps = (props: Everything): DesignerPhotosProps => {
          const images = getImages(props.resources.index);
          const env = getEnv(props.resources.index);
        
          const versions: Record<string, string> = {};
        Severity: Minor
        Found in frontend/photos/state_to_props.ts - About 1 hr to fix

          Function TimePeriodSelection has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const TimePeriodSelection = (props: TimePeriodSelectionProps) => {
            const { timePeriod, endDate, showPreviousPeriod,
              setEndDate, setPeriod, togglePrevious } = props;
            return <div className="sensor-history-time-selection">
              <Row className="grid-3-col">
          Severity: Minor
          Found in frontend/sensors/sensor_readings/time_period_selection.tsx - About 1 hr to fix

            Function FarmEventForm has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const FarmEventForm = (props: FarmEventFormProps) => {
              const { isRegimen, fieldGet, fieldSet, timeSettings } = props;
              return <div className="farm-event-form grid">
                <div>
                  <label>
            Severity: Minor
            Found in frontend/farm_events/edit_fe_form.tsx - About 1 hr to fix

              Function CurveSvgWithPopover has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const CurveSvgWithPopover = (props: CurveSvgWithPopoverProps) => {
                const [open, setOpen] = React.useState(false);
                const warnings = getWarningLinesContent({
                  curve: props.curve,
                  sourceFbosConfig: props.sourceFbosConfig,
              Severity: Minor
              Found in frontend/curves/chart.tsx - About 1 hr to fix

                Function ForgotPassword has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function ForgotPassword(props: ForgotPasswordProps) {
                  const {
                    onGoBack,
                    onSubmit,
                    email,
                Severity: Minor
                Found in frontend/front_page/forgot_password.tsx - About 1 hr to fix

                  Function namedPin2DropDown has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function namedPin2DropDown(ri: ResourceIndex, input: NamedPin | Nothing):
                    DropDownItem | undefined {
                    if (input.kind === "named_pin") {
                      const { pin_type } = input.args;
                      if (isPinType(pin_type)) {

                  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 ToolSlotPoint has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const ToolSlotPoint = (props: TSPProps) => {
                    const { tool, toolSlot } = props.slot;
                    const {
                      id, x, y, pullout_direction, gantry_mounted
                    } = toolSlot.body;
                  Severity: Minor
                  Found in frontend/farm_designer/map/layers/tool_slots/tool_slot_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 EncodersOrStallDetection has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function EncodersOrStallDetection(props: EncodersOrStallDetectionProps) {
                  
                    const { encoders_or_stall_detection } = props.settingsPanelState;
                    const {
                      dispatch, sourceFwConfig, firmwareHardware, arduinoBusy, showAdvanced,
                  Severity: Minor
                  Found in frontend/settings/hardware_settings/encoders_or_stall_detection.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 DataLabels has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const DataLabels = (props: DataLabelsProps) => {
                    const { curve, showHoverEffect } = props;
                    const { normX, normY } = props.plotTools;
                    const { data, type } = curve.body;
                    const label = (plus: string) =>
                  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 maybeOpenPanel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const maybeOpenPanel = (panelKey: "settings" | "photos" = "settings") =>
                    (dispatch: Function) => {
                      if (getUrlQuery("only") || getUrlQuery("search")) {
                        dispatch(bulkToggleControlPanel(true));
                        return;
                  Severity: Minor
                  Found in frontend/settings/maybe_highlight.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 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                    render() {
                      const finalBack = () => {
                        if (this.state.version != Version["v1.6"]) { return "version"; }
                        if (this.state.pi) { return "pi"; }
                        return "run";
                  Severity: Minor
                  Found in frontend/os_download/content.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 computeCoordinate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const computeCoordinate = (props: ComputeCoordinateProps): Vector3 => {
                    const { botPosition } = props;
                    const coordinate = {
                      x: botPosition.x || 0,
                      y: botPosition.y || 0,
                  Severity: Minor
                  Found in frontend/sequences/step_tiles/tile_computed_move/compute.ts - About 1 hr to fix

                    Function updateLhs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      (props: LhsUpdateProps) => {
                        const { currentStep, currentSequence, dispatch, index, resources } = props;
                        return (ddi: DropDownItem) => {
                          const stepCopy = defensiveClone(currentStep);
                          const seqCopy = defensiveClone(currentSequence).body;
                    Severity: Minor
                    Found in frontend/sequences/step_tiles/tile_if/update_lhs.ts - About 1 hr to fix

                      Function generateVariableListItems has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const generateVariableListItems = (props: GenerateVariableListProps) => {
                        const { allowedVariableNodes, resources, sequenceUuid } = props;
                        const headingId = props.headingId || "Variable";
                        const variables = sortVariables(Object.values(
                          resources.sequenceMetas[sequenceUuid] || [])).map(v => v.celeryNode);
                      Severity: Minor
                      Found in frontend/sequences/locals_list/variable_form.tsx - About 1 hr to fix

                        Function SequenceListActions has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const SequenceListActions = (props: SequenceListActionsProps) => {
                          const navigate = useNavigate();
                          return <div className={"row"}>
                            <button
                              className={"fb-button green"}
                        Severity: Minor
                        Found in frontend/sequences/panel/list.tsx - About 1 hr to fix

                          Function VariablesPart has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const VariablesPart = (props: StepParams<Assertion>) => {
                            let sequenceId: number | undefined;
                            const { _then } = props.currentStep.args;
                            if (_then.kind == "execute") {
                              sequenceId = _then.args.sequence_id;
                          Severity: Minor
                          Found in frontend/sequences/step_tiles/tile_assertion/variables_part.tsx - About 1 hr to fix

                            Function PointSortMenu has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const PointSortMenu = (props: PointSortMenuProps) => {
                              const sortTerm = props.sortOptions.sortBy;
                              const defaultSelected = sortTerm ? "" : "selected";
                              const byAgeSelected = sortTerm == "created_at" ? "selected" : "";
                              const byNameSelected = sortTerm == "name" ? "selected" : "";
                            Severity: Minor
                            Found in frontend/farm_designer/sort_options.tsx - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language