Showing 655 of 1,993 total issues
Function GardenPoint
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const GardenPoint = (props: GardenPointProps) => {
const iconHover = (action: "start" | "end") => () => {
const hover = action === "start";
props.dispatch({
Function render
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const panelName = "designer-regimen-editor";
const regimen = this.props.current;
const regimenCount = selectAllRegimens(this.props.resources).length;
return <DesignerPanel panelName={panelName} panel={Panel.Regimens}>
Function Caster
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Caster = (props: CasterProps) => {
const {
bedHeight, bedZOffset, legSize, legsFlush,
} = props.config;
const casterHeight = legSize * 1.375;
Function FolderNameEditor
has 46 lines of code (exceeds 25 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
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { currentStep, currentSequence, resources,
} = this.props;
const { sequence_id } = currentStep.args;
const callee = sequence_id
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
className,
currentSequence,
currentStep,
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { plant, dispatch } = this.props;
const plantId = (plant.body.id || "ERR_NO_PLANT_ID").toString();
const toggle = (action: "enter" | "leave") => {
Function connectivityData
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const connectivityData = (props: ConnectivityDataProps) => {
const fwVersion = props.bot.hardware
.informational_settings.firmware_version;
/** A record of all the things we know about connectivity right now. */
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 {
email,
onEmailChange,
onSubmit,
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 render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { plant, dispatch } = this.props;
const plantId = (plant.body.id || "ERR_NO_PLANT_ID").toString();
const toggle = (action: "enter" | "leave") => {
- 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 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 weedGroups = pointGroupSubset(this.props.groups, "Weed");
const filteredGroups = weedGroups
.filter(p => p.body.name.toLowerCase()
.includes(this.state.searchTerm.toLowerCase()));