Showing 646 of 1,897 total issues
Function Companions
has 33 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"}>
<div className="crop-companions">
Function SequenceItemDescription
has 33 lines of code (exceeds 25 allowed). Consider refactoring. 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 variableFormList
has 32 lines of code (exceeds 25 allowed). Consider refactoring. 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
export const mapStateToProps = (props: Everything): DesignerPhotosProps => {
const images = getImages(props.resources.index);
const env = getEnv(props.resources.index);
const versions: Record<string, string> = {};
Function TimePeriodSelection
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const TimePeriodSelection = (props: TimePeriodSelectionProps) => {
const { timePeriod, endDate, showPreviousPeriod,
setEndDate, setPeriod, togglePrevious } = props;
return <div className="sensor-history-time-selection">
<Row className="grid-3-col">
Function FarmEventForm
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FarmEventForm = (props: FarmEventFormProps) => {
const { isRegimen, fieldGet, fieldSet, timeSettings } = props;
return <div className="farm-event-form grid">
<div>
<label>
Function CurveSvgWithPopover
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CurveSvgWithPopover = (props: CurveSvgWithPopoverProps) => {
const [open, setOpen] = React.useState(false);
const warnings = getWarningLinesContent({
curve: props.curve,
sourceFbosConfig: props.sourceFbosConfig,
Function ForgotPassword
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ForgotPassword(props: ForgotPasswordProps) {
const {
onGoBack,
onSubmit,
email,
Function namedPin2DropDown
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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 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 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 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 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 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 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 SequenceListActions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SequenceListActions = (props: SequenceListActionsProps) => {
const navigate = useNavigate();
return <div className={"row"}>
<button
className={"fb-button green"}
Function VariablesPart
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const VariablesPart = (props: StepParams<Assertion>) => {
let sequenceId: number | undefined;
const { _then } = props.currentStep.args;
if (_then.kind == "execute") {
sequenceId = _then.args.sequence_id;
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" : "";