Showing 612 of 1,578 total issues
Function resizeBox
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const resizeBox = (props: ResizeSelectionBoxProps) => {
if (props.selectionBox) {
const current = props.gardenCoords;
if (current) {
const { x0, y0 } = props.selectionBox;
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { figureName, position, plantAreaOffset, mapTransformProps,
} = this.props;
const { xySwap } = mapTransformProps;
const mapSize = getMapSize(mapTransformProps, plantAreaOffset);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const weed = this.props.tpp.body;
const { tpp, dispatch } = this.props;
const weedId = (weed.id || "ERR_NO_POINT_ID").toString();
const scale = this.props.maxSize
- 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 triggerBinding
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
(resources: ResourceIndex, botOnline: boolean) =>
(pin: number) =>
() => {
const binding = findBinding(resources)(pin);
if (!botOnline || !binding) { 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 CIRCLES
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const CIRCLES = ({ firmwareHardware, clean }: CirclesProps) => [
...(hasExtraButtons(firmwareHardware)
? [{ cx: 20, cy: 20, r: 7, pin: 20, label: t("Button 5"), color: Color.white }]
: []),
...(hasExtraButtons(firmwareHardware)
- 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 toggleEqCriteria
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
<T extends string | number>(
eqCriteria: EqCriteria<T>,
direction?: "on" | "off",
) => (key: string, value: T) => {
const values: T[] = eqCriteria[key] || [];
- 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 Job
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const Job = (props: JobProps) => (job: JobProgressWithTitle) => {
const percent = job.unit == "percent" && job.percent;
const color = percent == 100 ? Color.green : Color.yellow;
return <tr key={job.title}>
<td className={"job-name"} title={job.title}>
- 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 FolderListItem
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const FolderListItem = (props: FolderItemProps) => {
const { sequence, movedSequenceUuid, inUse } = props;
const seqName = sequence.body.name;
const url = Path.sequences(urlFriendly(seqName || ""));
const moveSource = movedSequenceUuid === sequence.uuid ? "move-source" : "";
- 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
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
klass = Class.new(Mutations::Command)
klass.instance_variable_set("@resource", resource)
Function SequenceSelectBox
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function SequenceSelectBox(props: SequenceSelectBoxProps) {
const sequenceDropDownList = () => {
const { resources } = props;
const dropDownList: DropDownItem[] = [];
Function ThenElse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ThenElse(props: ThenElseParams) {
const {
onChange, selectedItem, calledSequenceVariableData, assignVariable
} = IfBlockDropDownHandler(props);
const { body } = props.currentStep.args[props.thenElseKey];
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
# LEGACY SHIM:
# 1. CelerySlicer inserts a `nothing` node at the start of the flat_ast
# 2. The new Fragment table expects an ENTRY node at position 0 of the
# flat_ast
Function getOverwriteState
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getOverwriteState = (step: Move, axis: Xyz): {
selection: AxisSelection | undefined,
overwrite: string | number | undefined,
} => {
const overwrite = step.body?.reverse().find(x =>
Function FeaturedSequenceListItem
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FeaturedSequenceListItem = (props: FeaturedSequenceListItemProps) => {
const { item } = props;
const [importing, setImporting] = React.useState(false);
const [descriptionOpen, setDescriptionOpen] = React.useState(false);
return <li className={"sequence-list-item"}>
Function vacuumFigure
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function vacuumFigure(
props: { i: number, cx: number, cy: number, animate: boolean }) {
const { i, cx, cy, animate } = props;
const color = "black";
const copies = animate ? 3 : 1;
Function rotaryFigure
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function rotaryFigure(
props: { i: number, cx: number, cy: number, animate: boolean }) {
const { i, cx, cy, animate } = props;
const color = "black";
const copies = animate ? 3 : 1;
Function FarmwareInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FarmwareInfo(props: FarmwareInfoProps) {
const { farmware } = props;
return farmware
? <div className="farmware-info">
<label>{t("Description")}</label>
Function CameraCheckBase
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CameraCheckBase = (props: CameraCheckBaseProps) => {
const images = selectAllImages(props.resources);
const getLastImageId = () => last(images)?.body.id;
const [prevImageId, setPrevImageId] = React.useState(getLastImageId());
const newImageUrls = images
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <Highlight settingName={DeviceSetting.firmware}>
<Row>
<Col xs={2}>
<label>
Function checkCriteria
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
(point: TaggedPoint, criteriaKey: keyof PointGroupCriteria) => {
switch (criteriaKey) {
case "string_eq":
case "number_eq":
return every(Object.entries(criteria[criteriaKey])