Showing 646 of 1,897 total issues
Function regimenCalendarAdder
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
(f: FarmEventWithRegimen, c: Calendar, now = moment()) => {
const { regimen_items } = f.executable;
const gracePeriod = itemGracePeriod(now);
const lastRI = last(regimen_items);
const lastRITime = lastRI &&
Function SubCriteriaSection
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SubCriteriaSection = (props: SubCriteriaSectionProps) => {
const { group, dispatch, disabled } = props;
const pointTypes = props.pointerTypes.sort();
if (pointTypes.length > 1 &&
!isEqual(pointTypes, ["GenericPointer", "Weed"])) {
Function getSelectedField
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const getSelectedField = (
resource: MaybeResourceArg,
field: KnownField | undefined,
): DropDownItem => {
const DDI = UPDATE_RESOURCE_DDIS();
- 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
Method check_resource_type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.check_resource_type(node, resource_type, resource_id, owner)
raise "OPPS!" unless owner
case resource_type # <= Security critical code (for const_get'ing)
when "Device"
# When "resource_type" is "Device", resource_id always refers to
- 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
Method maybe_continue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def maybe_continue(username)
is_guest = (username == FARMBOT_DEMO_USER)
max = is_guest ? MAX_GUEST_COUNT : PER_DEVICE_MAX
key = CACHE_KEY_TPL % username
total = (cache.get(key) || "0").to_i
- 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 DefaultFarmwareStep
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const DefaultFarmwareStep = (props: StepParams<ExecuteScript>) => {
const {
dispatch, currentStep, index, currentSequence, farmwareData,
} = 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 getLocationState
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getLocationState = (step: Move): {
location: LocationNode | undefined,
locationSelection: LocSelection | undefined,
} => {
/** Last axis_overwrite where axis_operand is a point, tool, or identifier. */
- 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 getNewTrailArray
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getNewTrailArray(
update: TrailRecord, watering: boolean, readOnly: boolean,
): TrailRecord[] {
const key = VirtualTrail.records; // sessionStorage location
const trailLength: number = get(sessionStorage, VirtualTrail.length, 100);
- 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 PointGraphic
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PointGraphic = (props: ProfilePointProps) => {
const { point } = props;
const { color } = props.point.body.meta;
switch (point.body.pointer_type) {
case "ToolSlot":
- 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 downloadProgress
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function downloadProgress(job: JobProgress | undefined) {
if (job && !isJobDone(job)) {
switch (job.unit) {
case "bytes":
const kiloBytes = Math.round(job.bytes / 1024);
- 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 getCurrentPanel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getCurrentPanel = (): Tabs | undefined => {
if (Path.equals(Path.designer())) {
return Panel.Map;
} else if (Path.getSlug(Path.app()) == "sequences") {
return Panel.Sequences;
- 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 Bot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const Bot = (props: FarmbotModelProps) => {
const config = props.config;
const {
x, y, z, botSizeX, botSizeY, botSizeZ, beamLength, trail, laser, soilHeight,
bedXOffset, bedYOffset, bedLengthOuter, bedWidthOuter, tracks, zDimension,
- 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 parseColClassNames
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function parseColClassNames(props: ParseColClassNamesProps, base?: string) {
const classNames: string[] = [];
if (base) { classNames.push(base); }
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { urlTourSlug, urlTourStepSlug } = this.tourState;
this.updateStateAndUrl();
- 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 PinBindingsList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const PinBindingsList = (props: PinBindingsListProps) => {
const { pinBindings, resources, dispatch } = props;
const deleteBinding = (pin: number, uuid?: string) => {
if (!sysBtnBindings.includes(pin)) {
- 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 dropDown2CeleryArg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
(ri: ResourceIndex, item: DropDownItem): number | NamedPin => {
if (isString(item.value)) { // str means "Named Pin". num means "Raw Pin"
if (Object.values(BoxLed).map((x: string) => x).includes(item.value)) {
return {
kind: "named_pin",
- 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
Method provide_feedback
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def provide_feedback(message, slug = "Not provided")
webhook_url = ENV["FEEDBACK_WEBHOOK_URL"]
if webhook_url
email = self.users.pluck(:email).join(" ")
name = self.users.first.name
- 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 SequenceBtnGroup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const SequenceBtnGroup = ({
dispatch,
sequence,
syncStatus,
resources,
- 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
Method topic_action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def topic_action # Called during subscribe
# Example JSON:
# "name" => "amq.topic",
# "permission" => "read",
# "resource" => "topic",
- 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
Method check_arity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_arity(node)
allowed = corpus.args(node)
allowed.map do |arg|
has_key = node.args.has_key?(arg) || node.args.has_key?(arg.to_s)
unless has_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"