Showing 646 of 1,897 total issues
Function FolderNameEditor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const FolderNameEditor = (props: FolderNodeProps) => {
const { node } = props;
const [settingsOpen, setSettingsOpen] = React.useState(false);
const [hovered, setHovered] = React.useState(false);
return <div
- 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
Consider simplifying this complex logical expression. Open
if (imagePosition) {
const { width, height, transformOrigin } = imagePosition;
const transform = this.props.disableTranslation ?
imagePosition.transform.replace(/translate\(.*?\)/g, "")
: imagePosition.transform;
Consider simplifying this complex logical expression. Open
if (i > 0 && previousCoordinate && currentCoordinate && isNumber(cur.water)) {
const p1 = toQ(currentCoordinate);
const p2 = toQ(previousCoordinate);
return <g id={"trail-record"} key={i}>
<line id={`trail-line-${i}`}
Consider simplifying this complex logical expression. Open
if (isUndefined(botPosition0.x)
|| isUndefined(botPosition0.y)
|| isUndefined(botPosition0.z)
|| isUndefined(botPosition1.x)
|| isUndefined(botPosition1.y)
Consider simplifying this complex logical expression. Open
if (activeXYZ && !isUndefined(activeXYZ.x) && !isUndefined(activeXYZ.y)
&& plantXYZ && !isUndefined(plantXYZ.x) && !isUndefined(plantXYZ.y)) {
// Plant editing (dragging) is occuring
const activeXY = { x: round(activeXYZ.x), y: round(activeXYZ.y) };
const distance = Math.sqrt(
Function variableFormList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
resources: ResourceIndex,
additionalItems: DropDownItem[],
variableItems?: DropDownItem[],
displayGroups?: boolean,
variableType?: VariableType,
Function stepPut
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function stepPut(value: Step,
ev: React.DragEvent<HTMLElement>,
intent: DataXferIntent,
draggerId: number,
resourceUuid?: UUID):
Function occurrence
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
m: moment.Moment,
fe: FarmEventWithExecutable,
timeSettings: TimeSettings,
resources: ResourceIndex,
modifiers?: { numHidden?: number, empty?: boolean }):
Method mark_as_seen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def mark_as_seen(bot = (current_user && current_user.device))
when_farmbot_os do
if bot
v = fbos_version
bot.last_saw_api = Time.now
- 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 emit_nodes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def emit_nodes()
nodes = NODES.map do |node|
tags = node.fetch("tags").sort.uniq
# Don't publish internal CeleryScript nodes:
next if tags.include?(:private)
- 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 a Cognitive Complexity of 7 (exceeds 5 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
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create
# Around June of 2020, we started getting Rails double
# render errors on this endpoint when users would try
# to log in with an unverified account (500 error).
# Still not sure what changed or why, but this is a
- 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 cameraBtnProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const cameraBtnProps = (env: UserEnv, botOnline: boolean) => {
const disabled = cameraDisabled(env) || !botOnline;
const noCameraTitle = t(Content.NO_CAMERA_SELECTED);
const offlineTitle = botOnline ? "" : t("FarmBot is offline");
const title = cameraDisabled(env) ? noCameraTitle : offlineTitle;
- 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 recurse_into_body
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def recurse_into_body(heap, canonical_list, previous_address, index = 0)
if canonical_list[index]
is_head = index == 0
# BE CAREFUL EDITING THIS LINE, YOU MIGHT BREAK `BODY` NODES:
heap # See note above!
- 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 setArgsDotPinNumber
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(x: StepParams) => (d: DropDownItem) => {
const { dispatch, currentSequence, index, resources, currentStep } = x;
dispatch(editStep({
step: currentStep,
- 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 mapImagePositionData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const mapImagePositionData = (props: MapImagePositionDataProps):
MapImagePositionData | undefined => {
const { cameraCalibrationData, alreadyRotated, noRotation } = props;
const imageRotated = alreadyRotated && !noRotation;
const parsed = parseCalibrationData(cameraCalibrationData);
- 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 createPlant
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const createPlant = (props: CreatePlantProps): void => {
const {
cropName, slug, gardenCoords, gridSize, openedSavedGarden, depth, designer,
} = props;
const { x, y } = gardenCoords;
- 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 maybeUpdateGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(props: MaybeUpdateGroupProps) => {
const { group } = props;
if (props.selectionBox && group) {
if (props.editGroupAreaInMap) {
props.dispatch(editGtLtCriteria(group, 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 TextInRoundedSvgBox
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const TextInRoundedSvgBox = (props: RoundedBoxProps) => {
const { x, y, width, height, fill, radius } = props;
const r = radius || 4;
const upperRightCorner = `a${r},${r} 0 0 1 ${r},${r}`;
const lowerRightCorner = `a${r},${r} 0 0 1 -${r},${r}`;
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { point, getX, soilHeight, getConfigValue, designer } = this.props;
const { icon, spreadDiaCm } = this.state;
const currentPlantUuid = designer.selectedPoints?.[0];
const radius = point.uuid == currentPlantUuid && designer.hoveredSpread
- 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"