Showing 610 of 1,573 total issues
Function FarmwareInputs
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FarmwareInputs(props: FarmwareInputsProps) {
const {
farmwareName, currentStep, farmwareInstalled, defaultConfigs, updateStep
} = props;
Function render
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const wDEnvGet = (key: WDENVKey) => envGet(key, this.props.wDEnv);
const { syncStatus, botToMqttStatus } = this.props;
const botOnline = isBotOnline(syncStatus, botToMqttStatus);
const camDisabled = cameraBtnProps(this.props.env, botOnline);
Function PlantPanel
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function PlantPanel(props: PlantPanelProps) {
const {
info, updatePlant, dispatch, inSavedGarden, timeSettings
} = props;
const { slug, plantedAt, daysOld, uuid, plantStatus } = info;
Function setPinBinding
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const setPinBinding = (props: SetPinBindingProps) =>
// eslint-disable-next-line complexity
(ddi: DropDownItem): boolean => {
const { binding, dispatch, resources, pinNumber } = props;
const bindingUuid = binding?.uuid;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function render
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { beginDate, beginTime, endDate, endTime } = this.state;
return <div className={"image-filter-menu"}>
<table>
<thead>
Function UTMProfile
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const UTMProfile = (props: ProfileUtmProps) => {
const { x, y } = props.botPosition;
const inProfile = !isUndefined(x) && !isUndefined(y) &&
withinProfileRange({
axis: props.profileAxis == "x" ? "y" : "x",
Function LayerToggles
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LayerToggles = (props: GardenMapLegendProps) => {
const { toggle, getConfigValue, dispatch } = props;
const subMenuProps = { dispatch, getConfigValue };
return <div className="toggle-buttons">
<LayerToggle
Class Device
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Device < ApplicationRecord
DEFAULT_MAX_CONFIGS = 300
DEFAULT_MAX_IMAGES = 100
DEFAULT_MAX_LOGS = 1000
DEFAULT_MAX_TELEMETRY = 300
Function render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const goText = (axes: string) => `${t("GO")} (${axes.split("").join(", ")})`;
const current = this.props.currentBotLocation;
const target = this.props.locationCoordinate;
const { arduinoBusy, botOnline, dispatch, defaultAxes } = this.props;
Function ErrorHandling
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ErrorHandling(props: ErrorHandlingProps) {
const { error_handling } = props.settingsPanelState;
const {
dispatch, sourceFwConfig, arduinoBusy, firmwareHardware, showAdvanced,
Function VariableForm
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
(props: VariableFormProps) => {
const { sequenceUuid, resources, bodyVariables, variable, variableType,
allowedVariableNodes, hideGroups, removeVariable, onChange } = props;
const { celeryNode, dropdown, vector, isDefault } = maybeUseStepData({
resources, bodyVariables, variable, uuid: sequenceUuid
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function textAnchorPosition
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export const textAnchorPosition = (
pulloutDirection: ToolPulloutDirection,
quadrant: BotOriginQuadrant,
xySwap: boolean,
gantryMounted: boolean,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generateTransformStyle
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export const generateTransformStyle = (props: GenerateTransformStyleProps) => {
const { zoomLvl, mapTransformProps } = props;
const { quadrant, xySwap } = mapTransformProps;
/** Determine if an axis is displayed vertically on the page. */
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function WizardStepContainer
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const WizardStepContainer = (props: WizardStepContainerProps) => {
const { step } = props;
const setSuccess = props.setStepSuccess(step.slug);
const requirementsMet =
every(step.prerequisites?.map(prerequisite =>
File util.ts
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BotOriginQuadrant } from "../interfaces";
import { McuParams, Xyz } from "farmbot";
import { StepsPerMm } from "../../devices/interfaces";
import {
CheckedAxisLength, AxisNumberProperty, BotSize, MapTransformProps, Mode,
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <Highlight className={"section"}
settingName={DeviceSetting.changeOwnership}>
<ExpandableHeader
expanded={this.state.open}
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { curve, setHovered } = this;
const { dispatch } = this.props;
const { hovered } = this.state;
const curvesPath = Path.curves();
Function GardenLocationRow
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const GardenLocationRow = (props: GardenLocationRowProps) => {
const { dispatch, device } = props;
const latitudeKey: keyof DeviceAccountSettings = "lat";
const latitude = device.body[latitudeKey];
const longitudeKey: keyof DeviceAccountSettings = "lng";
File _helper.ts
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
*
* Web App translation file helper
* This script gathers translatable phrases from the web app and adds them
* to translation files. It also organizes and sorts existing translation
File abstract_seeder.rb
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Devices
module Seeders
class AbstractSeeder
include Constants
attr_reader :device