Showing 646 of 1,897 total issues
Function Packaging
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Packaging = (props: PackagingProps) => {
const { config } = props;
const isXL = config.sizePreset == "Genesis XL";
const mainCartonLength = 1060;
const mainCartonWidth = 420;
Method plants
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def plants(product_line)
spinach_row_count = product_line.include?("xl") ? 28 : 13
spinach_col_count = product_line.include?("xl") ? 4 : 2
(0..(spinach_row_count - 1)).map do |i|
(0..(spinach_col_count - 1)).map do |j|
- 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 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 WizardStepContainer
has 85 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 =>
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",
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;
File util.ts
has 305 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 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 RawEditPoint
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const RawEditPoint = (props: EditPointProps) => {
const getPoint = () => {
const stringyID = Path.getSlug(Path.points());
if (stringyID) {
return props.findPoint(parseInt(stringyID));
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 render
has 81 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 ParameterManagement
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ParameterManagement(props: ParameterManagementProps) {
const {
dispatch, onReset, botOnline, arduinoBusy, firmwareHardware,
getConfigValue, showAdvanced,
} = props;
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 ZoomBeacons
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ZoomBeacons = (props: ZoomBeaconsProps) => {
const [hoveredFocus, setHoveredFocus] = React.useState("");
const { activeFocus, setActiveFocus } = props;
const gardenBedDiv =
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
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
Function GardenLocationRow
has 77 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";