Showing 610 of 1,573 total issues
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;
File model.tsx
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable react/no-unknown-property */
/* eslint-disable no-null/no-null */
import React, { useRef } from "react";
import * as THREE from "three";
import {
Function render
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
legend_menu_open,
show_plants,
show_points,
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,
Function HomeButton
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
export const HomeButton = (props: HomeButtonProps) => {
const { doFindHome, homeDirection, locked, arduinoBusy, botOnline } = props;
const icon = doFindHome ? "fa-search" : "fa-arrow-right";
const style = doFindHome ? {} : { transform: `rotate(${homeDirection}deg)` };
const disabledAxes = disabledAxisMap(props.firmwareSettings);
- 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
Class AbstractGenesis
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AbstractGenesis < AbstractSeeder
def peripherals_vacuum
add_peripheral(9, ToolNames::VACUUM)
end
Class AbstractExpress
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AbstractExpress < AbstractGenesis
def settings_device_name
device.update!(name: Names::EXPRESS)
end
Function Data
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Data = (props: DataProps) => {
const { curve, setHovered, showHoverEffect, dragging } = props;
const { normX, normY, yZero, yMax } = props.plotTools;
const { data, type } = curve.body;
const fullWidth = X_MAX / maxDay(data);
Function render
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { dispatch, designer } = this.props;
const { cropSearchResults, cropSearchInProgress } = designer;
const { crop, result, basePath, backgroundURL } =
getCropHeaderProps({ cropSearchResults });
Function createOrUpdateTranslationFile
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createOrUpdateTranslationFile(
langInput: string | undefined = "en",
metricsOnly?: boolean,
): SummaryData | undefined {
const lang = langInput.slice(0, 2);
File create_points.tsx
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from "react";
import { connect } from "react-redux";
import { Everything, ResourceColor } from "../interfaces";
import { initSave } from "../api/crud";
import { Row, Col, BlurableInput, ColorPicker } from "../ui";
Function ProfileSvg
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ProfileSvg = (props: ProfileSvgProps) => {
const { expanded, mapTransformProps, tools, position, getConfigValue } = props;
const lineAxis = props.designer.profileAxis;
const selectionWidth = props.designer.profileWidth;
const profileAxis = lineAxis == "x" ? "y" : "x";
File edit_plant_status.tsx
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from "react";
import {
FBSelect, DropDownItem, ColorPicker, BlurableInput, NULL_CHOICE,
} from "../ui";
import { PlantOptions } from "../farm_designer/interfaces";
Function determineDropdown
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(node: VariableNode, resources: ResourceIndex, uuid?: UUID): DropDownItem => {
if (node.kind === "parameter_declaration") {
return {
label: t("Externally defined"),
value: "?"
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const finalBack = () => {
if (this.state.version != Version["v1.6"]) { return "version"; }
if (this.state.pi) { return "pi"; }
return "run";
Function render
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <div className={"add-sensor-reading-menu"}>
<SensorSelection
selectedSensor={this.state.sensor}
sensors={this.props.sensors}
Function ParameterManagement
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function ParameterManagement(props: ParameterManagementProps) {
const {
dispatch, onReset, botOnline, arduinoBusy, firmwareHardware,
getConfigValue, showAdvanced,
} = props;
Function mapStateToProps
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function mapStateToProps(props: Everything): FarmDesignerProps {
const plants = getPlants(props.resources);
const findPlant = plantFinder(plants);
const { selectedPoints } = props.resources.consumers.farm_designer;
File crud.ts
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
TaggedResource,
SpecialStatus,
ResourceName,
TaggedSequence,