Showing 646 of 1,897 total issues
Function PhotoButtons
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PhotoButtons = (props: PhotoButtonsProps) => {
const { imageUrl } = props;
const { image, dispatch, flags, size } = props;
const imageShowMenuProps = { dispatch, flags, image, size };
return <div className={"photo-action-buttons"}>
Function preparePositions
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const preparePositions = (
sequenceBody: SequenceBodyItem[],
initialPosition: BotPosition,
sequenceUuid: UUID | undefined,
) => {
Function PlantSlugBulkUpdate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PlantSlugBulkUpdate = (props: PlantSlugBulkUpdateProps) => {
const plants = props.allPoints.filter(point =>
props.selected.includes(point.uuid) && point.kind === "Point" &&
point.body.pointer_type == "Plant")
.map((p: TaggedPlantPointer) => p);
Function ImportedBanner
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const ImportedBanner = (props: ImportedBannerProps) => {
const versionId = props.sequence.body.sequence_version_id;
const allIds = sortBy(props.sequence.body.sequence_versions);
const latestId = last(allIds);
const versionList = sequenceVersionList(allIds);
- 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 setPinMode
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function setPinMode(ddi: DropDownItem, stepParams: StepParams) {
const { dispatch, currentStep, index, currentSequence } = stepParams;
dispatch(editStep({
sequence: currentSequence,
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 render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
current, selected, dragging, plant, mapTransformProps,
activeDragXY, zoomLvl, animate, editing, hovered, hoveredSpread,
} = 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"
Further reading
Function TileMoveRelative
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const TileMoveRelative = (props: StepParams) => {
const { dispatch, currentStep, index, currentSequence } = props;
return <StepWrapper {...props}
className={"move-relative-step"}
helpText={ToolTips.MOVE_RELATIVE}>
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
sensorReading, mapTransformProps, endTime, timeSettings, sensorLookup
} = this.props;
const { id, x, y, value, mode, created_at, pin } = sensorReading.body;
Function Solar
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Solar = (props: SolarProps) => {
const { config } = props;
const zGround = -config.bedZOffset - config.bedHeight;
return <Group name={"solar"}
visible={config.solar || props.activeFocus == "What you need to provide"}>
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <div className="static-page">
<div className="all-content-wrapper">
<h1 className="text-center">
Function stockPeripherals
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
get stockPeripherals() {
const BASE_PERIPHERALS = [
{ pin: 7, label: t("Lighting") },
{ pin: 8, label: t("Water") },
{ pin: 9, label: t("Vacuum") },
Function GridInput
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function GridInput(props: GridInputProps) {
const { xy_swap } = props;
const vertical = "fa-arrows-v";
const horizontal = "fa-arrows-h";
return <div className="grid">
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { toolName, uuid } = this.state;
const alreadyAdded = !uuid && !this.filterExisting(toolName);
const panelName = "add-tool";
return <DesignerPanel panelName={panelName} panel={Panel.Tools}>
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { logs, botOnline, imageJobs, env } = this.props;
const { clickedAt } = this.state;
const camDisabled = cameraBtnProps(env, botOnline);
const job = imageJobs.filter(x => greaterThanTime(x.updated_at, clickedAt))[0];
Function AdditionalMenu
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AdditionalMenu = (props: AccountMenuProps) => {
return <div className="nav-additional-menu">
<div className={"account-link"}>
<Link to={Path.settings("account")}
onClick={props.close("accountMenuOpen")}>
Function searchFolderTree
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const searchFolderTree = (props: FolderSearchProps): FolderUnion[] => {
// A folder is included if:
// * CASE 3: The name is a search match
// * CASE 4: It contains a sequence that is a match.
// * CASE 5: It has a child that has a search match.
Method emit_nodes
has 38 lines of code (exceeds 25 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)
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const confirmStepDeletion =
!!this.getConfigValue(BooleanSetting.confirm_step_deletion);
const step = this.props.currentStep;
const executeSequence = step.kind == "execute" && step.args.sequence_id
Function PointLayer
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function PointLayer(props: PointLayerProps) {
const { visible, genericPoints, mapTransformProps, designer } = props;
const { cameraViewGridId, hoveredPoint, gridIds, soilHeightLabels } = designer;
const soilHeightPoints = genericPoints.filter(soilHeightPoint);
const getColor = getSoilHeightColor(soilHeightPoints);
Function SoilSensor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SoilSensor = (props: ToolGraphicProps) => {
const { x, y, hovered } = props;
const width = SoilSensorDimensions.width;
const pcbWidth = width / 3;
const height = SoilSensorDimensions.thickness;