Showing 612 of 1,578 total issues
Function getMode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMode = (): Mode => {
if (store.getState().resources.consumers.farm_designer.profileOpen) {
return Mode.profile;
}
const panelSlug = Path.getSlug(Path.designer());
Function generateTransform
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generateTransform = (props: TransformProps): string => {
const {
quadrant, qCoords, size, imageOrigin, xySwap, rotate,
} = props;
const { qx, qy } = qCoords;
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { color } = this.props;
const style = {
animationPlayState: this.state.isHovered ? "paused" : "running",
};
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const farmware = this.props.farmwares[this.current || ""];
const panelName = "designer-farmware-info";
return <DesignerPanel panelName={panelName} panel={Panel.Farmware}>
<DesignerPanelHeader
Function FarmEventForm
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const FarmEventForm = (props: FarmEventFormProps) => {
const { isRegimen, fieldGet, fieldSet, timeSettings } = props;
return <div className="farm-event-form">
<label>
{t("Sequence or Regimen")}
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const panelType = this.panel == "weeds" ? Panel.Weeds : Panel.Points;
const panelDescription = this.panel == "weeds"
? Content.CREATE_WEEDS_DESCRIPTION
: Content.CREATE_POINTS_DESCRIPTION;
Function Feedback
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function AxisDisplayGroup
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const AxisDisplayGroup = (props: AxisDisplayGroupProps) => {
const { x, y, z } = props.position;
const detectionEnabled = {
x: !!props.firmwareSettings?.encoder_enabled_x,
y: !!props.firmwareSettings?.encoder_enabled_y,
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const panelName = "add-tool-slot";
return <DesignerPanel panelName={panelName} panel={Panel.Tools}>
<DesignerPanelHeader
panelName={panelName}
Function VersionChangeLines
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VersionChangeLines = (props: VersionChangeLinesProps) => {
const changes: VersionChangeRecord[] = [];
const mostRecent = last(sortBy(props.telemetry, "body.created_at"));
props.telemetry.map((d, i) => {
if (i == 0) { return; }
Function DataLabels
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DataLabels = (props: DataLabelsProps) => {
const { curve, showHoverEffect } = props;
const { normX, normY } = props.plotTools;
const { data, type } = curve.body;
const label = (plus: string) =>
Function FarmwareEnvRow
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const FarmwareEnvRow = (props: FarmwareEnvRowProps) => {
const { dispatch, farmwareEnv } = props;
const [key, setKey] = React.useState(farmwareEnv.body.key);
const [value, setValue] = React.useState("" + farmwareEnv.body.value);
return <Row>
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { zone } = this;
const zonesPath = Path.zones();
!zone && Path.startsWith(zonesPath) && push(zonesPath);
return <DesignerPanel panelName={"zone-info"} panel={Panel.Zones}>
Function ImageListItem
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ImageListItem = (props: ImageListItemProps) => {
const images = sortBy(props.images.items, "body.created_at").reverse();
const [currentImage, setCurrentImage] = React.useState(images[0]);
return <div className={"image-items"}>
<ImageFlipper id={"image-items-flipper"}
Function EncoderType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EncoderType(props: EncoderTypeProps) {
const { hardware } = props;
const handleChange = (key: McuParamName) => (d: DropDownItem) => {
const val = d.value;
if (isEncoderValue(val)) {
Function updateViaAjax
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function updateViaAjax(payl: AjaxUpdatePayload) {
const { uuid, statusBeforeError, dispatch, index } = payl;
const resource = findByUuid(index, uuid);
const { body, kind } = resource;
let verb: "post" | "put";
Function PlantCurveBulkUpdate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const PlantCurveBulkUpdate = (props: PlantCurveBulkUpdateProps) => {
const points = props.allPoints.filter(point =>
props.selected.includes(point.uuid) && point.kind === "Point" &&
point.body.pointer_type == "Plant")
.map((p: TaggedPlantPointer) => p);
Function AdditionalWeedProperties
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
{Object.entries(props.point.body.meta).map(([key, value]) => {
switch (key) {
case "color":
case "type": return <div key={key}
className={`meta-${key}-not-displayed`} />;
Function FbosMetricHistoryPlot
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const FbosMetricHistoryPlot = (props: FbosMetricHistoryPlotProps) => {
const mostRecent = last(sortBy(props.telemetry, "body.created_at"));
const hoveredSeconds = clipX(props.hoveredTime, mostRecent);
return <svg
className={"fbos-metric-history-plot-border"}
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
direction, axis, locked, arduinoBusy, botOnline, botPosition, movementState,
} = this.props;
const title = `${t("move {{axis}} axis", { axis })} (${this.distance})`;