Showing 646 of 1,897 total issues
Function ConnectivityRow
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ConnectivityRow(props: StatusRowProps) {
const {
connectionStatus, connectionName, hoveredConnection, syncStatus,
} = props;
const colorClass = colorLookup["" + connectionStatus];
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { dispatch, index, currentStep, currentSequence } = this.props;
return <StepWrapper {...this.props}
className={"send-message-step"}
helpText={t(ToolTips.SEND_MESSAGE)}>
Function ChangeFirmwarePath
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ChangeFirmwarePath = (props: ChangeFirmwarePathProps) => {
const OPTIONS: Record<string, DropDownItem> = {
"": { label: t("Change firmware path to..."), value: "" },
ttyACM0: { label: t("ttyACM0 (recommended for Genesis)"), value: "ttyACM0" },
ttyAMA0: {
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { setFilterLevel, sourceFbosConfig, getConfigValue } = this.props;
const LogSettingRow = (settingProps: LogSettingRecord) => {
const { label, setting, tooltip } = settingProps;
return <LogSetting
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { props } = this;
const feeds = sortedFeeds(this.props.feeds).map(x => x.body);
const flipper = new Flipper(feeds, FALLBACK_FEED, this.state.current);
const msg = this.getMessage(flipper.current.url);
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { H_LO, H_HI, S_LO, S_HI, V_LO, V_HI } = this.props;
const cameraCalibrationEnv = this.props.namespace("H_LO").includes("CAMERA");
const defaultHLow = this.getDefault(cameraCalibrationEnv ? "H_HI" : "H_LO");
const defaultHHigh = this.getDefault(cameraCalibrationEnv ? "H_LO" : "H_HI");
- 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 GardenPoint
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const GardenPoint = (props: GardenPointProps) => {
const iconHover = (action: "start" | "end") => () => {
const hover = action === "start";
props.dispatch({
- 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 GardenWeed
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const GardenWeed = (props: GardenWeedProps) => {
const [iconHovered, setIconHovered] = React.useState(false);
const iconHover = (action: "start" | "end") => () => {
const startHover = action === "start";
- 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 editGtLtCriteriaField
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const editGtLtCriteriaField = (
group: TaggedPointGroup,
criteriaField: "number_gt" | "number_lt",
criteriaKey: string,
pointerType?: PointerType,
- 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 Data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const Data = (props: DataProps) => {
const { curve, setHovered, showHoverEffect, dragging } = props;
const { normX, normY, yZero, yMax } = props.plotTools;
const { data, type } = curve.body;
const fullWidth = X_MAX / maxDay(data);
- 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 PlantInventoryItem
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const PlantInventoryItem = (props: PlantInventoryItemProps) => {
const [iconState, setIconState] = React.useState("");
const navigate = useNavigate();
const { plant, dispatch } = 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 render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
className,
currentSequence,
currentStep,
Function prepareLocation
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const prepareLocation = (ddi: DropDownItem): {
locationNode: LocationNode | undefined,
locationSelection: LocSelection | undefined,
} => {
switch (ddi.headingId) {
Function generateReducer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function generateReducer<State>(initialState: State) {
/** A function that is passed the state, action and action handler.
* This is useful if you have custom business logic that needs to exit early
* or trigger alternative action handlers. Example: Not triggering
* INIT_RESOURCE when UI is set to "read-only" mode. */
Method if_topic_is_safe
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def if_topic_is_safe
if farmbot_demo?
a, b, c = (routing_key_param || "").split(".")
if !(permission_param == "read")
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
visible, images, mapTransformProps, cameraCalibrationData,
getConfigValue,
} = this.props;
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { x, y } = this.props.chosenLocation;
const { botOnline, locked } = this.props;
return <div className={"move-to-form"}>
<Row className="move-to-grid">
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <div className={"grid-and-row-planting"}>
<h3>{t("Add Grid or Row")}</h3>
<GridInput
key={JSON.stringify(this.state.grid)}
Function SequenceShareMenu
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SequenceShareMenu = (props: SequenceShareMenuProps) => {
const { sequence } = props;
const disabled = sequence.specialStatus !== SpecialStatus.SAVED;
const ids = sortBy(sequence.body.sequence_versions);
const linkPath = Path.sequenceVersion(last(ids));
Method plants
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plants(product_line)
spinach_row_count = product_line.include?("xl") ? 28 : 13
spinach_col_count = product_line.include?("xl") ? 4 : 2
(0..(spinach_row_count - 1)).map do |i|
(0..(spinach_col_count - 1)).map do |j|