Showing 646 of 1,897 total issues
Function VariableForm
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function RotaryTool
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props: JSX.IntrinsicElements["group"]) => {
const { nodes, materials } = model;
return <Group {...props}>
<MeshComponent
geometry={nodes.M25_x_6mm_Screw.geometry}
Function WIZARD_STEPS
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
Open
export const WIZARD_STEPS = (props: WizardStepDataProps): WizardSteps => {
const { firmwareHardware } = props;
const xySwap = !!props.getConfigValue?.(BooleanSetting.xy_swap);
const positiveMovementInstruction = (swap: boolean) =>
swap
- 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 SoilSensor
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(props: JSX.IntrinsicElements["group"]) => {
const { nodes, materials } = model;
// eslint-disable-next-line no-null/no-null
return <Group {...props} dispose={null}>
<MeshComponent
File edit_curve.tsx
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from "react";
import { t } from "../i18next_wrapper";
import { connect } from "react-redux";
import { SpecialStatus, TaggedCurve } from "farmbot";
import { round, take } from "lodash";
Function render
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { getConfigValue, dispatch, firmwareConfig,
sourceFwConfig, sourceFbosConfig, resources, settingsPanelState,
} = this.props;
const showAdvanced = !!getConfigValue(BooleanSetting.show_advanced_settings);
File variable_form.tsx
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from "react";
import { Row, FBSelect, Color, BlurableInput, Help } from "../../ui";
import {
variableFormList, NO_VALUE_SELECTED_DDI, sortVariables, heading, sequences2Ddi,
LOCATION_PLACEHOLDER_DDI,
Function render
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const wDEnvGet = (key: WDENVKey) => envGet(key, this.props.wDEnv);
const { syncStatus, botToMqttStatus, photosPanelState } = this.props;
const botOnline = isBotOnline(syncStatus, botToMqttStatus);
const common = {
Function render
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { dispatch } = this.props;
const gridIds = compact(uniq(this.props.genericPoints
.map(p => p.body.meta.gridId)));
const points = orderedPoints(this.props.genericPoints, this.state)
File fbos_details.tsx
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from "react";
import { Saucer, FBSelect, Help, Popover } from "../../ui";
import { updateConfig } from "../../devices/actions";
import { last, isNumber, isString } from "lodash";
import { Content, ToolTips } from "../../constants";
Function PowerSupply
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const PowerSupply = (props: PowerSupplyProps) => {
const {
bedWidthOuter, bedLengthOuter, bedHeight, botSizeX,
legSize, ccSupportSize, bedZOffset
} = props.config;
Function render
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
legend_menu_open,
show_plants,
show_points,
Function GardenModel
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
Open
export const GardenModel = (props: GardenModelProps) => {
const { config } = props;
const groundZ = config.bedZOffset + config.bedHeight;
const Camera = config.perspective ? PerspectiveCamera : OrthographicCamera;
- 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
File reducer_support.ts
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
ResourceName, SpecialStatus, TaggedResource, TaggedSequence,
} from "farmbot";
import { combineReducers, ReducersMapObject, UnknownAction } from "redux";
import { helpReducer as help } from "../help/reducer";
Function render
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
stepSize, arduinoBusy, locked, getConfigValue, env, highlightHome,
highlightAxis, highlightDirection, botPosition, botOnline, dispatch,
} = this.props;
Function render
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { dispatch, plantsPanelState, plants } = this.props;
const filteredPlants = plants
.filter(p => p.body.name.toLowerCase()
.includes(this.state.searchTerm.toLowerCase()));
File model.tsx
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-null/no-null */
import React, { useRef } from "react";
import * as THREE from "three";
import {
Cylinder, Html, PerspectiveCamera, useGLTF,
File gantry_wheel_plate.tsx
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable max-len */
import React from "react";
import * as THREE from "three";
import { InstancedBufferAttribute } from "three";
import { GLTF } from "three-stdlib";
File interfaces.ts
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { OpenFarm } from "../open_farm/openfarm";
import { DropDownItem } from "../ui";
import {
TaggedFarmEvent,
TaggedSequence,
Function EncodersOrStallDetection
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EncodersOrStallDetection(props: EncodersOrStallDetectionProps) {
const { encoders_or_stall_detection } = props.settingsPanelState;
const {
dispatch, sourceFwConfig, firmwareHardware, arduinoBusy, showAdvanced,