Showing 646 of 1,897 total issues
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <div className={"change-password grid"}>
<div className="row grid-exp-1">
<label>
{t(DeviceSetting.changePassword)}
Function LandingPageSetting
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const LandingPageSetting = (props: LandingPageSettingProps) => {
const value = "" + props.getConfigValue(StringSetting.landing_page);
const change = (page: string) => props.dispatch(setWebAppConfigValue(
StringSetting.landing_page, page));
const [page, setPage] = React.useState(value);
Function PinNumberInputGroup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PinNumberInputGroup = (props: PinNumberInputGroupProps) => {
const { pinNumberInput, boundPins, setSelectedPin } = props;
const selectedPinNumber = isNumber(pinNumberInput)
? {
label: generatePinLabel(pinNumberInput),
Function Sun
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Sun = (props: SunProps) => {
const { config } = props;
const { sunIntensity, sunColor } = useSpring({
...seasonProperties[config.plants] || seasonProperties.Spring,
Function ConfigFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ConfigFields(props: ConfigFieldsProps): JSX.Element {
const { farmwareName, farmwareConfigs, getValue, userEnv } = props;
return <div className={"farmware-config-fields"}>
{farmwareConfigs.map(config => {
const configEnvName = getConfigEnvName(farmwareName, config.name);
Function LogsRow
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LogsRow = (props: LogsRowProps) => {
const { tlog, timeSettings, dispatch, markdown } = props;
const { uuid } = tlog;
const { x, y, z, verbosity, type, created_at, message, id } = tlog.body;
const at = moment.unix(created_at || NaN);
Function buildDirectionProps
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function buildDirectionProps(props: DirectionAxesProps) {
const { firmwareSettings, botPosition, getConfigValue } = props;
const lengths = calculateAxialLengths(props);
return {
x: {
Function AxisDisplayGroup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AxisDisplayGroup = (props: AxisDisplayGroupProps) => {
const { x, y, z } = props.position;
const detectionEnabled = {
x: !!props.firmwareSettings?.encoder_enabled_x,
y: !!props.firmwareSettings?.encoder_enabled_y,
Function Connector
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Connector(props: ConnectorProps): JSX.Element {
const {
connectionData, from, to, hover, hoveredConnection, customLineProps
} = props;
const lineProps = customLineProps ? customLineProps : getLineProps(from, to);
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { currentStep, currentSequence, resources,
} = this.props;
const { sequence_id } = currentStep.args;
const callee = sequence_id
- 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 { dispatch, sequence } = this.props;
const { viewSequenceCeleryScript, view } = this.state;
const variableData = this.props.resources.sequenceMetas[sequence.uuid] || {};
const declarations = betterCompact(Object.values(variableData)
- 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 {
sensorReading, mapTransformProps, endTime, timeSettings, sensorLookup
} = this.props;
const { id, x, y, value, mode, created_at, pin } = sensorReading.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 jogPoints
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const jogPoints = (props: JogPointsProps) => {
const { keyName, points, dispatch } = props;
if (!(points.length > 0)) { return; }
const { gridSize, xySwap, quadrant } = props.mapTransformProps;
const horizontal = xySwap ? "deltaY" : "deltaX";
- 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 goText = (axes: string) => `${t("GO")} (${axes.split("").join(", ")})`;
const current = this.props.currentBotLocation;
const target = this.props.locationCoordinate;
const { arduinoBusy, botOnline, dispatch, defaultAxes } = 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 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 reduceToolName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const reduceToolName = (raw: string | undefined) => {
const lower = (raw || "").toLowerCase();
if (raw == "Empty") { return ToolName.emptyToolSlot; }
if (includes(lower, "rotary")) { return ToolName.rotaryTool; }
if (includes(lower, "weeder")) { return ToolName.weeder; }
- 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 WeedInventoryItem
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const WeedInventoryItem = (props: WeedInventoryItemProps) => {
const navigate = useNavigate();
const weed = props.tpp.body;
const { tpp, dispatch } = props;
const weedId = (weed.id || "ERR_NO_POINT_ID").toString();
- 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"