Showing 612 of 1,578 total issues
Function ToolSlotPoint
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const ToolSlotPoint = (props: TSPProps) => {
const { tool, toolSlot } = props.slot;
const {
id, x, y, pullout_direction, gantry_mounted
} = toolSlot.body;
- 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 maybeOpenPanel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const maybeOpenPanel = (panelKey: "settings" | "photos" = "settings") =>
(dispatch: Function) => {
if (getUrlQuery("only") || getUrlQuery("search")) {
dispatch(bulkToggleControlPanel(true));
return;
- 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 EncodersOrStallDetection
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function EncodersOrStallDetection(props: EncodersOrStallDetectionProps) {
const { encoders_or_stall_detection } = props.settingsPanelState;
const {
dispatch, sourceFwConfig, firmwareHardware, arduinoBusy, showAdvanced,
- 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 DataLabels
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const DataLabels = (props: DataLabelsProps) => {
const { curve, showHoverEffect } = props;
const { normX, normY } = props.plotTools;
const { data, type } = curve.body;
const label = (plus: string) =>
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const finalBack = () => {
if (this.state.version != Version["v1.6"]) { return "version"; }
if (this.state.pi) { return "pi"; }
return "run";
- 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 computeCoordinate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const computeCoordinate = (props: ComputeCoordinateProps): Vector3 => {
const { botPosition } = props;
const coordinate = {
x: botPosition.x || 0,
y: botPosition.y || 0,
Function generateVariableListItems
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const generateVariableListItems = (props: GenerateVariableListProps) => {
const { allowedVariableNodes, resources, sequenceUuid } = props;
const headingId = props.headingId || "Variable";
const variables = sortVariables(Object.values(
resources.sequenceMetas[sequenceUuid] || [])).map(v => v.celeryNode);
Function updateLhs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
(props: LhsUpdateProps) => {
const { currentStep, currentSequence, dispatch, index, resources } = props;
return (ddi: DropDownItem) => {
const stepCopy = defensiveClone(currentStep);
const seqCopy = defensiveClone(currentSequence).body;
Function PointSortMenu
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PointSortMenu = (props: PointSortMenuProps) => {
const sortTerm = props.sortOptions.sortBy;
const defaultSelected = sortTerm ? "" : "selected";
const byAgeSelected = sortTerm == "created_at" ? "selected" : "";
const byNameSelected = sortTerm == "name" ? "selected" : "";
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const panelName = "designer-regimen-list";
return <DesignerPanel panelName={panelName} panel={Panel.Regimens}>
<DesignerNavTabs />
<DesignerPanelTop
Function joinFarmEventsToExecutable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function joinFarmEventsToExecutable(
input: ResourceIndex): FarmEventWithExecutable[] {
const farmEvents: TaggedFarmEvent[] = selectAllFarmEvents(input);
const sequenceById = indexSequenceById(input);
const regimenById = indexRegimenById(input);
Function curveDataTableRow
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
([day, value]: [string, number], index: number) => {
const { dispatch, curve, hovered, setHovered } = props;
const active = inData(curve.body.data, day);
return <tr key={day} className={hovered == day ? "hovered" : ""}
onMouseEnter={() => setHovered(day)}
Function Companions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Companions = (props: CropInfoListProps) => {
const { result, dispatch, openfarmCropFetch } = props;
if (result.companions.length == 0) { return <div />; }
return <InfoField title={"companions"}>
{result.companions.map((companion, index) =>
Function LogsTable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const LogsTable = (props: LogsTableProps) => {
return <div className={"logs-table-wrapper"}>
<table className={LOG_TABLE_CLASS}>
<thead>
<tr>
Function If_
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function If_(props: StepParams<If>) {
const { currentStep, resources } = props;
const sequence = props.currentSequence;
const { op } = currentStep.args;
const lhsOptions = LHSOptions(resources, !!props.showPins);
Function SequenceSettingsMenu
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
(props: SequenceSettingsMenuProps) => {
const { dispatch, getWebAppConfigValue } = props;
const commonProps = { dispatch, getWebAppConfigValue };
return <div className="sequence-settings-menu">
<SequenceSetting {...commonProps}
Function PhotoFooter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PhotoFooter = (props: PhotoFooterProps) => {
const { image, timeSettings } = props;
const created_at = image
? formatTime(moment(image.body.created_at), timeSettings, "MMMM Do, YYYY")
: "";
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const panelName = "designer-sequence-editor";
const { sequence } = this.state;
const viewCeleryScript = this.props.getWebAppConfigValue(
BooleanSetting.view_celery_script);
Function GardenMapLegend
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function GardenMapLegend(props: GardenMapLegendProps) {
const { getConfigValue } = props;
const menuClass = props.legendMenuOpen ? "active" : "";
const [zDisplayOpen, setZDisplayOpen] = React.useState(false);
return <div className={`garden-map-legend ${menuClass} ${props.className}`}>
Function newPlantKindAndBody
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const newPlantKindAndBody = (props: NewPlantKindAndBodyProps): {
kind: TaggedPlant["kind"],
body: TaggedPlant["body"],
} => {
const savedGardenId = props.openedSavedGarden || undefined;