FarmBot/Farmbot-Web-App

View on GitHub

Showing 1,573 of 1,573 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    <Collapse isOpen={!!power_and_reset}>
      <FbosButtonRow
        botOnline={botOnline}
        label={DeviceSetting.restartFirmware}
        description={Content.RESTART_FIRMWARE}
Severity: Major
Found in frontend/settings/fbos_settings/power_and_reset.tsx and 1 other location - About 1 day to fix
frontend/controls/move/jog_buttons.tsx on lines 170..195

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 232.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File route_config.tsx has 566 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { RouteConfig } from "takeme";
import { Apology } from "./apology";
import { Path } from "./internal_urls";
import { AnyConnectedComponent, ChangeRoute } from "./routes";

Severity: Major
Found in frontend/route_config.tsx - About 1 day to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                <Col xs={4}>
                  <Highlight
                    settingName={this.props.sectionKey == "calibration"
                      ? DeviceSetting.calibrationMorph
                      : DeviceSetting.detectionMorph}
    Severity: Major
    Found in frontend/photos/image_workspace/index.tsx and 1 other location - About 1 day to fix
    frontend/photos/image_workspace/index.tsx on lines 245..262

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 225.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                <Col xs={4}>
                  <Highlight
                    settingName={this.props.sectionKey == "calibration"
                      ? DeviceSetting.calibrationIterations
                      : DeviceSetting.detectionIterations}
    Severity: Major
    Found in frontend/photos/image_workspace/index.tsx and 1 other location - About 1 day to fix
    frontend/photos/image_workspace/index.tsx on lines 227..244

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 225.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      return <div className={"point-size-bulk-update"}>
        <p>{t("Update radius to")}</p>
        <input
          value={radius}
          min={0}
    Severity: Major
    Found in frontend/plants/edit_plant_status.tsx and 1 other location - About 1 day to fix
    frontend/plants/edit_plant_status.tsx on lines 211..227

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 214.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      return <div className={"plant-depth-bulk-update"}>
        <p>{t("Update depth to")}</p>
        <input
          value={depth}
          min={0}
    Severity: Major
    Found in frontend/plants/edit_plant_status.tsx and 1 other location - About 1 day to fix
    frontend/plants/edit_plant_status.tsx on lines 184..200

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 214.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function Motors has 219 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function Motors(props: MotorsProps) {
      const {
        dispatch, settingsPanelState, sourceFwConfig, firmwareHardware, arduinoBusy,
        showAdvanced,
      } = props;
    Severity: Major
    Found in frontend/settings/hardware_settings/motors.tsx - About 1 day to fix

      Class None has 60 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class None < AbstractSeeder
            def peripherals_lighting; end
            def peripherals_peripheral_4; end
            def peripherals_peripheral_5; end
            def peripherals_vacuum; end
      Severity: Major
      Found in app/mutations/devices/seeders/none.rb - About 1 day to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        const PointSource = (props: PointSubCriteriaProps) =>
          <div className={"point-source-criteria"}>
            <p className={"category"}>{t("Source")}</p>
            <ClearCategory
              group={props.group}
        Severity: Major
        Found in frontend/point_groups/criteria/subcriteria.tsx and 1 other location - About 1 day to fix
        frontend/point_groups/criteria/subcriteria.tsx on lines 127..145

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 208.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        const RemovalMethod = (props: PointSubCriteriaProps) =>
          <div className={"removal-method-criteria"}>
            <p className={"category"}>{t("Removal Method")}</p>
            <ClearCategory
              group={props.group}
        Severity: Major
        Found in frontend/point_groups/criteria/subcriteria.tsx and 1 other location - About 1 day to fix
        frontend/point_groups/criteria/subcriteria.tsx on lines 192..210

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 208.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  <tr>
                    <td>
                      <label>{t("Newer than")}</label>
                    </td>
                    <td>
        Severity: Major
        Found in frontend/photos/photo_filter_settings/image_filter_menu.tsx and 1 other location - About 1 day to fix
        frontend/photos/photo_filter_settings/image_filter_menu.tsx on lines 231..254

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 203.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  <tr>
                    <td>
                      <label>{t("Older than")}</label>
                    </td>
                    <td>
        Severity: Major
        Found in frontend/photos/photo_filter_settings/image_filter_menu.tsx and 1 other location - About 1 day to fix
        frontend/photos/photo_filter_settings/image_filter_menu.tsx on lines 207..230

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 203.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        GardenMap has 58 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class GardenMap extends
          React.Component<GardenMapProps, Partial<GardenMapState>> {
          state: Partial<GardenMapState> = {};
          constructor(props: GardenMapProps) {
            super(props);
        Severity: Major
        Found in frontend/farm_designer/map/garden_map.tsx - About 1 day to fix

          File edit_fe_form.tsx has 507 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from "react";
          import moment from "moment";
          import { success, error, warning } from "../toast/toast";
          import {
            TaggedFarmEvent, SpecialStatus, TaggedSequence, TaggedRegimen,
          Severity: Major
          Found in frontend/farm_events/edit_fe_form.tsx - About 1 day to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  <DesignerPanelHeader
                    panelName={this.panelName}
                    panel={Panel.Points}
                    colorClass={pointColor}
                    titleElement={<ResourceTitle
            Severity: Major
            Found in frontend/points/point_info.tsx and 1 other location - About 1 day to fix
            frontend/weeds/weeds_edit.tsx on lines 65..98

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 198.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  <DesignerPanelHeader
                    panelName={this.panelName}
                    panel={Panel.Weeds}
                    colorClass={weedColor}
                    titleElement={<ResourceTitle
            Severity: Major
            Found in frontend/weeds/weeds_edit.tsx and 1 other location - About 1 day to fix
            frontend/points/point_info.tsx on lines 65..97

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 198.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  {
                    section: WizardSectionSlug.axisLength,
                    slug: WizardStepSlug.xAxisLength,
                    title: t("X-axis length"),
                    content: t(SetupWizardContent.FIND_AXIS_LENGTH, { axis: "X" }),
              Severity: Major
              Found in frontend/wizard/data.ts and 1 other location - About 7 hrs to fix
              frontend/wizard/data.ts on lines 1035..1067

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 191.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  {
                    section: WizardSectionSlug.axisLength,
                    slug: WizardStepSlug.yAxisLength,
                    title: t("Y-axis length"),
                    content: t(SetupWizardContent.FIND_AXIS_LENGTH, { axis: "Y" }),
              Severity: Major
              Found in frontend/wizard/data.ts and 1 other location - About 7 hrs to fix
              frontend/wizard/data.ts on lines 1002..1034

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 191.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export const TileCalibrate = (props: StepParams<Calibrate>) => {
                const { dispatch, currentStep, index, currentSequence } = props;
                const conflicts = settingConflicts(currentStep, props.hardwareFlags);
                return <StepWrapper {...props}
                  className={"calibrate-step"}
              Severity: Major
              Found in frontend/sequences/step_tiles/tile_calibrate.tsx and 1 other location - About 7 hrs to fix
              frontend/sequences/step_tiles/tile_find_home.tsx on lines 10..26

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 190.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language