Showing 612 of 1,578 total issues
Function ZDisplay
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ZDisplay = (props: ZDisplayProps) => {
const tools = props.allPoints.filter(p => p.body.pointer_type == "ToolSlot")
.map(p => p.body.z).sort()[0];
const soil = props.allPoints.filter(soilHeightPoint)
.map(p => p.body.z).sort()[0];
Function responseRejected
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function responseRejected(x: SafeError | undefined) {
if (x && isSafeError(x)) {
dispatchNetworkUp("user.api", now());
const a = ![451, 401, 422].includes(x.response.status);
const b = x.response.status > 399;
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <div className={"drop-area"} {...this.mapDropAreaProps()}>
<ErrorBoundary>
<svg id={"map-background-svg"}>
<this.MapBackground />
Function BindingTargetDropdown
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const BindingTargetDropdown = (props: BindingTargetDropdownProps) => {
const list = () => {
const { resources } = props;
const dropDownList: DropDownItem[] = [];
Function Setting
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Setting = (props: SettingProps) => {
const { title, setting, numberSetting, callback, defaultOn } = props;
const raw_value = setting ? props.getConfigValue(setting) : undefined;
const value = (defaultOn && isUndefined(raw_value)) ? true : !!raw_value;
return <Highlight settingName={title}>
Function mapStateToProps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function mapStateToProps(props: Everything): EditPlantInfoProps {
const openedSavedGarden =
props.resources.consumers.farm_designer.openedSavedGarden;
const gardenOpen = !!openedSavedGarden;
const findPlant = (id: string | undefined) => {
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
/** Change document meta title on every route change. */
updatePageInfo(Path.getSlug(Path.app()), Path.getSlug(Path.designer()));
return <ErrorBoundary>
Function deletePoints
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function deletePoints(
pointName: string,
query: Partial<Point>,
cb?: ProgressCallback): Thunk {
// TODO: Generalize and add to api/crud.ts
Function SlotLocationInputRow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const SlotLocationInputRow = (props: SlotLocationInputRowProps) => {
const x = props.gantryMounted
? props.botPosition.x ?? props.slotLocation.x
: props.slotLocation.x;
const { y, z } = props.slotLocation;
Function SequenceItemDescription
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SequenceItemDescription = (props: SequenceItemDescriptionProps) => {
const { sequence, inUse } = props;
const deprecatedSteps = JSON.stringify(props.sequence.body.body)
.includes("resource_update");
const { pinned, forked, sequence_version_id, description } = props.sequence.body;
Function Diagnosis
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function Diagnosis(props: DiagnosisProps) {
const diagnosisBoolean = diagnosisStatus(props.statusFlags);
const diagnosisColor = diagnosisBoolean ? "green" : "red";
return <div className={"diagnosis-section"}>
<div className={"connectivity-diagnosis"}>
Function variableFormList
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function variableFormList(
resources: ResourceIndex,
additionalItems: DropDownItem[],
variableItems?: DropDownItem[],
displayGroups?: boolean,
Function mapStateToProps
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const mapStateToProps = (props: Everything): DesignerPhotosProps => {
const images = getImages(props.resources.index);
const env = getEnv(props.resources.index);
const versions: Record<string, string> = {};
Function ImagingDataManagement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ImagingDataManagement = (props: ImagingDataManagementProps) => {
const [advanced, setAdvanced] = React.useState(false);
return <div className={"imaging-data-management"}>
<Highlight settingName={DeviceSetting.highlightModifiedSettings}
pathPrefix={Path.photos}>
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <Row className={"change-password zero-side-margins"}>
<label>
{t(DeviceSetting.changePassword)}
</label>
Function CurveSvgWithPopover
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const CurveSvgWithPopover = (props: CurveSvgWithPopoverProps) => {
const [open, setOpen] = React.useState(false);
const warnings = getWarningLinesContent({
curve: props.curve,
sourceFbosConfig: props.sourceFbosConfig,
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return <DesignerPanel panelName={"groups"} panel={Panel.Groups}>
<DesignerNavTabs />
<DesignerPanelTop
panel={Panel.Groups}
Function NumberLtGtInput
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const NumberLtGtInput = (props: NumberLtGtInputProps) => {
const { group, dispatch, criteriaKey } = props;
const gtCriteria = props.group.body.criteria.number_gt;
const ltCriteria = props.group.body.criteria.number_lt;
return <Row>
Function namedPin2DropDown
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
export function namedPin2DropDown(ri: ResourceIndex, input: NamedPin | Nothing):
DropDownItem | undefined {
if (input.kind === "named_pin") {
const { pin_type } = input.args;
if (isPinType(pin_type)) {
- 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
Open
render() {
const {
weed, mapTransformProps, hovered, current, selected, animate,
radiusVisible, dispatch,
} = this.props;
- 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"