FarmBot/Farmbot-Web-App

View on GitHub

Showing 1,897 of 1,897 total issues

Function WIZARD_STEPS has 1446 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 1924 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 1630 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

        Function Bot has 841 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const Bot = (props: FarmbotModelProps) => {
          const config = props.config;
          const {
            x, y, z, botSizeX, botSizeY, botSizeZ, beamLength, trail, laser, soilHeight,
            bedXOffset, bedYOffset, bedLengthOuter, bedWidthOuter, tracks, zDimension,
        Severity: Major
        Found in frontend/three_d_garden/bot.tsx - About 4 days to fix

          File bot.tsx has 1014 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable complexity */
          import React, { useEffect, useState } from "react";
          import * as THREE from "three";
          import {
            Cylinder, Extrude, Line, Trail, Tube, useGLTF, useTexture,
          Severity: Major
          Found in frontend/three_d_garden/bot.tsx - About 2 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 854 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

              Function CrossSlide has 395 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                File checks.tsx has 749 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.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 834..893
                  frontend/wizard/data.ts on lines 894..953

                  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.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 834..893
                  frontend/wizard/data.ts on lines 954..1013

                  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 894..953
                  frontend/wizard/data.ts on lines 954..1013

                  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 688 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.calibrationSaturation
                                : DeviceSetting.detectionSaturation} pathPrefix={Path.photos}>
                                <div className="row grid-exp-2 half-gap">
                                  <label htmlFor="saturation">{t("SATURATION")}</label>
                    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 162..184

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

                    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.calibrationValue
                                : DeviceSetting.detectionValue} pathPrefix={Path.photos}>
                                <div className="row grid-exp-2 half-gap">
                                  <label htmlFor="value">{t("VALUE")}</label>
                    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 139..161

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

                    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

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

                        "Maximal": {
                          ...INITIAL,
                          bedWallThickness: 40,
                          bedHeight: 300,
                          x: 300,
                      Severity: Major
                      Found in frontend/three_d_garden/config.ts and 1 other location - About 1 day to fix
                      frontend/three_d_garden/config.ts on lines 229..279

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

                      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

                        "Minimal": {
                          ...INITIAL,
                          bedWallThickness: 40,
                          bedHeight: 300,
                          x: 300,
                      Severity: Major
                      Found in frontend/three_d_garden/config.ts and 1 other location - About 1 day to fix
                      frontend/three_d_garden/config.ts on lines 280..330

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

                      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.calibrationIterations
                                      : DeviceSetting.detectionIterations}
                                    pathPrefix={Path.photos}>
                      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 228..247

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

                      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