FarmBot/Farmbot-Web-App

View on GitHub

Showing 1,572 of 1,572 total issues

Function WIZARD_STEPS has 1436 lines of code (exceeds 25 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: Major
Found in frontend/wizard/data.ts - About 1 wk to fix

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

    /* eslint-disable @typescript-eslint/quotes */
    import { trim } from "./util";
    
    export namespace ToolTips {
    
    
    Severity: Major
    Found in frontend/constants.ts - About 5 days to fix

      File data.ts has 1618 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { t } from "../i18next_wrapper";
      import { round } from "lodash";
      import { SetupWizardContent, ToolTips } from "../constants";
      import {
        WizardSection, WizardStepDataProps, WizardSteps, WizardToC, WizardToCSection,
      Severity: Major
      Found in frontend/wizard/data.ts - About 4 days to fix

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

        function vacuumFigure(
          props: { i: number, cx: number, cy: number, animate: boolean }) {
          const { i, cx, cy, animate } = props;
          const color = "black";
          const copies = animate ? 3 : 1;
        Severity: Major
        Found in frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx and 1 other location - About 2 days to fix
        frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx on lines 123..154

        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 415.

        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

        function rotaryFigure(
          props: { i: number, cx: number, cy: number, animate: boolean }) {
          const { i, cx, cy, animate } = props;
          const color = "black";
          const copies = animate ? 3 : 1;
        Severity: Major
        Found in frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx and 1 other location - About 2 days to fix
        frontend/farm_designer/map/layers/farmbot/bot_peripherals.tsx on lines 90..121

        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 415.

        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 sequence_editor_middle_active.tsx has 860 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from "react";
        import { t } from "../i18next_wrapper";
        import {
          ActiveMiddleProps, SequenceHeaderProps, SequenceBtnGroupProps,
          SequenceSettingProps, SequenceSettingsMenuProps, ActiveMiddleState,
        Severity: Major
        Found in frontend/sequences/sequence_editor_middle_active.tsx - About 2 days to fix

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

          export const SensorForm = (props: SensorFormProps) =>
            <div className="sensor-form">
              {sortResourcesById(props.sensors).map(sensor =>
                <Row key={sensor.uuid}>
                  <Col xs={4}>
          Severity: Major
          Found in frontend/sensors/sensor_form.tsx and 1 other location - About 1 day to fix
          frontend/controls/peripherals/peripheral_form.tsx on lines 8..36

          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 315.

          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 PeripheralForm = (props: PeripheralFormProps) =>
            <div className="peripheral-form">
              {sortResourcesById(props.peripherals).map(peripheral =>
                <Row key={peripheral.uuid}>
                  <Col xs={4}>
          Severity: Major
          Found in frontend/controls/peripherals/peripheral_form.tsx and 1 other location - About 1 day to fix
          frontend/sensors/sensor_form.tsx on lines 8..36

          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 315.

          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 checks.tsx has 739 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from "react";
          import { TakePhotoButton } from "../controls/move/take_photo_button";
          import { mapStateToProps } from "../controls/state_to_props";
          import { store } from "../redux/store";
          import { MoveControls } from "../controls/move/move_controls";
          Severity: Major
          Found in frontend/wizard/checks.tsx - About 1 day to fix

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

                {
                  section: WizardSectionSlug.movements,
                  slug: WizardStepSlug.yAxisMovement,
                  title: t("Y-axis movements"),
                  content: SetupWizardContent.Y_AXIS_MOVEMENTS,
            Severity: Major
            Found in frontend/wizard/data.ts and 2 other locations - About 1 day to fix
            frontend/wizard/data.ts on lines 822..881
            frontend/wizard/data.ts on lines 942..1001

            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 305.

            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 3 locations. Consider refactoring.
            Open

                {
                  section: WizardSectionSlug.movements,
                  slug: WizardStepSlug.zAxisMovement,
                  title: t("Z-axis movements"),
                  content: SetupWizardContent.Z_AXIS_MOVEMENTS,
            Severity: Major
            Found in frontend/wizard/data.ts and 2 other locations - About 1 day to fix
            frontend/wizard/data.ts on lines 822..881
            frontend/wizard/data.ts on lines 882..941

            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 305.

            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 3 locations. Consider refactoring.
            Open

                {
                  section: WizardSectionSlug.movements,
                  slug: WizardStepSlug.xAxisMovement,
                  title: t("X-axis movements"),
                  content: SetupWizardContent.X_AXIS_MOVEMENTS,
            Severity: Major
            Found in frontend/wizard/data.ts and 2 other locations - About 1 day to fix
            frontend/wizard/data.ts on lines 882..941
            frontend/wizard/data.ts on lines 942..1001

            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 305.

            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 garden_map.tsx has 682 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from "react";
            import { BooleanSetting } from "../../session_keys";
            import { closePlantInfo, unselectPlant } from "./actions";
            import {
              MapTransformProps, TaggedPlant, Mode, AxisNumberProperty,
            Severity: Major
            Found in frontend/farm_designer/map/garden_map.tsx - About 1 day to fix

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

                        <Highlight settingName={this.props.sectionKey == "calibration"
                          ? DeviceSetting.calibrationValue
                          : DeviceSetting.detectionValue} pathPrefix={Path.photos}>
                          <label htmlFor="value">{t("VALUE")}</label>
                          <Help text={t(ToolTips.COLOR_VALUE_RANGE, {
              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 140..160

              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 256.

              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

                        <Highlight settingName={this.props.sectionKey == "calibration"
                          ? DeviceSetting.calibrationSaturation
                          : DeviceSetting.detectionSaturation} pathPrefix={Path.photos}>
                          <label htmlFor="saturation">{t("SATURATION")}</label>
                          <Help text={t(ToolTips.COLOR_SATURATION_RANGE, {
              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 161..181

              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 256.

              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

              Class AbstractSeeder has 74 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class AbstractSeeder
                    include Constants
                    attr_reader :device
              
                    # DO NOT ALPHABETIZE. ORDER MATTERS! - RC
              Severity: Major
              Found in app/mutations/devices/seeders/abstract_seeder.rb - About 1 day to fix

                File celery_script_settings_bag.rb has 590 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module CeleryScriptSettingsBag
                  class BoxLed
                    def self.name
                      "Raspberry Pi Box LED"
                    end
                Severity: Major
                Found in app/models/celery_script_settings_bag.rb - About 1 day to fix

                  File tz_list.ts has 588 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  export const list = ["Africa/Abidjan",
                    "Africa/Accra",
                    "Africa/Addis_Ababa",
                    "Africa/Algiers",
                    "Africa/Asmara",
                  Severity: Major
                  Found in frontend/devices/timezones/tz_list.ts - About 1 day to fix

                    Function Model has 252 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const Model = (props: BoxTopBaseProps) => {
                      const box = useGLTF(MODELS.box, LIB_DIR) as Box;
                      const btn = useGLTF(MODELS.btn, LIB_DIR) as Btn;
                      const led = useGLTF(MODELS.led, LIB_DIR) as Led;
                      const SCALE = 1000;
                    Severity: Major
                    Found in frontend/settings/pin_bindings/model.tsx - About 1 day to fix

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language