FarmBot/Farmbot-Web-App

View on GitHub

Showing 646 of 1,897 total issues

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

  render() {
    const { color, redirect } = this.props;
    const style = {
      animationPlayState: this.state.isHovered ? "paused" : "running",
    };
Severity: Minor
Found in frontend/toast/fb_toast.tsx - About 1 hr to fix

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

      render() {
        return <div className="grid">
          <label>
            {t(this.props.title)}
          </label>
    Severity: Minor
    Found in frontend/settings/account/dangerous_delete_widget.tsx - About 1 hr to fix

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

      export const LogsTable = (props: LogsTableProps) => {
        return <div className={"logs-table-wrapper"}>
          <table className={LOG_TABLE_CLASS}>
            <thead>
              <tr>
      Severity: Minor
      Found in frontend/logs/components/logs_table.tsx - About 1 hr to fix

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

          ([day, value]: [string, number], index: number) => {
            const { dispatch, curve, hovered, setHovered } = props;
            const active = inData(curve.body.data, day);
            return <tr key={day} className={hovered == day ? "hovered" : ""}
              onMouseEnter={() => setHovered(day)}
        Severity: Minor
        Found in frontend/curves/edit_curve.tsx - About 1 hr to fix

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

          export const StartTimeForm = (props: StartTimeFormProps) => {
            const forceMidnight = props.isRegimen;
            const isNew = !parseInt("" + props.fieldGet("id"));
            const startDatetimeError = isNew && !forceMidnight &&
              !moment(props.now).isBefore(moment(offsetTime(props.fieldGet("startDate"),
          Severity: Minor
          Found in frontend/farm_events/edit_fe_form.tsx - About 1 hr to fix

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

            export const Feedback = (props: FeedbackProps) => {
              const [message, setMessage] = React.useState("");
              const [sent, setSent] = React.useState(false);
              const orderNumber =
                maybeGetDevice(store.getState().resources.index)?.body.fb_order_number;
            Severity: Minor
            Found in frontend/help/support.tsx - About 1 hr to fix

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

              export const SlotLocationInputRow = (props: SlotLocationInputRowProps) => {
                const x = props.gantryMounted
                  ? props.botPosition.x ?? props.slotLocation.x
                  : props.slotLocation.x;
                const { y, z } = props.slotLocation;
              Severity: Minor
              Found in frontend/tools/tool_slot_edit_components.tsx - About 1 hr to fix

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

                export function joinFarmEventsToExecutable(
                  input: ResourceIndex): FarmEventWithExecutable[] {
                  const farmEvents: TaggedFarmEvent[] = selectAllFarmEvents(input);
                  const sequenceById = indexSequenceById(input);
                  const regimenById = indexRegimenById(input);
                Severity: Minor
                Found in frontend/farm_events/calendar/selectors.ts - About 1 hr to fix

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

                  export function Diagnosis(props: DiagnosisProps) {
                    const diagnosisBoolean = diagnosisStatus(props.statusFlags);
                    const diagnosisColor = diagnosisBoolean ? "green" : "red";
                    const navigate = useNavigate();
                    return <Row className="diagnosis-section grid-exp-2">
                  Severity: Minor
                  Found in frontend/devices/connectivity/diagnosis.tsx - About 1 hr to fix

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

                      render() {
                        const panelName = "designer-sequence-editor";
                        const { sequence } = this.state;
                        const viewCeleryScript = this.props.getWebAppConfigValue(
                          BooleanSetting.view_celery_script);
                    Severity: Minor
                    Found in frontend/sequences/panel/preview.tsx - About 1 hr to fix

                      Function SequenceSettingsMenu has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        (props: SequenceSettingsMenuProps) => {
                          const { dispatch, getWebAppConfigValue } = props;
                          const commonProps = { dispatch, getWebAppConfigValue };
                          return <div className="sequence-settings-menu">
                            <SequenceSetting {...commonProps}
                      Severity: Minor
                      Found in frontend/sequences/sequence_editor_middle_active.tsx - About 1 hr to fix

                        Function If_ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function If_(props: StepParams<If>) {
                          const { currentStep, resources } = props;
                          const sequence = props.currentSequence;
                          const { op } = currentStep.args;
                          const lhsOptions = LHSOptions(resources, !!props.showPins);
                        Severity: Minor
                        Found in frontend/sequences/step_tiles/tile_if/if.tsx - About 1 hr to fix

                          Function PhotoFooter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const PhotoFooter = (props: PhotoFooterProps) => {
                            const { image, timeSettings } = props;
                            const created_at = image
                              ? formatTime(moment(image.body.created_at), timeSettings, "MMMM Do, YYYY")
                              : "";
                          Severity: Minor
                          Found in frontend/photos/images/photos.tsx - About 1 hr to fix

                            Function newPlantKindAndBody has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const newPlantKindAndBody = (props: NewPlantKindAndBodyProps): {
                              kind: TaggedPlant["kind"],
                              body: TaggedPlant["body"],
                            } => {
                              const savedGardenId = props.openedSavedGarden || undefined;
                            Severity: Minor
                            Found in frontend/farm_designer/map/layers/plants/plant_actions.ts - About 1 hr to fix

                              Function generateTransform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const generateTransform = (props: TransformProps): string => {
                                const {
                                  quadrant, qCoords, size, imageOrigin, xySwap, rotate,
                                } = props;
                                const { qx, qy } = qCoords;
                              Severity: Minor
                              Found in frontend/farm_designer/map/layers/images/map_image.tsx - About 1 hr to fix

                                Function getMode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const getMode = (): Mode => {
                                  if (store.getState().resources.consumers.farm_designer.profileOpen) {
                                    return Mode.profile;
                                  }
                                  const panelSlug = Path.getSlug(Path.designer());
                                Severity: Minor
                                Found in frontend/farm_designer/map/util.ts - About 1 hr to fix

                                  Function GardenMapLegend has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function GardenMapLegend(props: GardenMapLegendProps) {
                                    const { getConfigValue } = props;
                                    const menuClass = props.legendMenuOpen ? "active" : "";
                                    const [zDisplayOpen, setZDisplayOpen] = React.useState(false);
                                    return <div className={`garden-map-legend ${menuClass} ${props.className}`}>
                                  Severity: Minor
                                  Found in frontend/farm_designer/map/legend/garden_map_legend.tsx - About 1 hr to fix

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

                                      render() {
                                        const panelName = "designer-regimen-list";
                                        return <DesignerPanel panelName={panelName} panel={Panel.Regimens}>
                                          <DesignerPanelTop
                                            panel={Panel.Regimens}
                                    Severity: Minor
                                    Found in frontend/regimens/list/list.tsx - About 1 hr to fix

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

                                        render() {
                                          const farmware = this.props.farmwares[this.current || ""];
                                          const panelName = "designer-farmware-info";
                                          return <DesignerPanel panelName={panelName} panel={Panel.Farmware}>
                                            <DesignerPanelHeader
                                      Severity: Minor
                                      Found in frontend/farmware/panel/info.tsx - About 1 hr to fix

                                        Function DataLabels has 30 lines of code (exceeds 25 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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language