Showing 612 of 1,578 total issues
Function requestAutoGeneration
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const requestAutoGeneration = (props: RequestAutoGenerationProps) => {
fetch(API.current.aiPath, {
method: "post",
headers: {
Authorization: `Bearer: ${store.getState().auth?.token.encoded}`,
Method typical_sequence
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.typical_sequence
{
kind: "sequence",
name: "move_abs(1,2,3), move_rel(4,5,6), write_pin(13, off, digital)",
color: "gray",
Function MapBackground
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MapBackground(props: MapBackgroundProps) {
const { mapTransformProps, plantAreaOffset, templateView } = props;
const gridSize = getMapSize(mapTransformProps);
const boardWidth = 20;
const mapSize = getMapSize(mapTransformProps, plantAreaOffset);
Function OFSearchRaw
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
(dispatch: Function) => {
dispatch({ type: Actions.OF_SEARCH_RESULTS_START, payload: undefined });
(specific
? openFarmSearchQuerySpecific(searchTerm)
: openFarmSearchQuery(searchTerm))
Function SpreadLayer
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function SpreadLayer(props: SpreadLayerProps) {
const {
plants, visible, mapTransformProps, currentPlant, hoveredSpread,
dragging, zoomLvl, activeDragXY, activeDragSpread, editing, animate
} = props;
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { radius, x, y, id } = this.props.plant.body;
const { visible, mapTransformProps, animate } = this.props;
const { qx, qy } = transformXY(round(x), round(y), mapTransformProps);
const spreadDiaCm = this.state.loaded
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 WizardStepHeader
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const WizardStepHeader = (props: WizardStepHeaderProps) => {
const stepOpen = props.stepOpen == props.step.slug;
const resultDate = props.stepResult?.updated_at;
const stepDone = props.stepResult?.answer;
const stepFail = stepDone == false;
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 render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <Highlight settingName={DeviceSetting.farmbotOS}
hidden={!this.props.showAdvanced}
className={"advanced"}>
<Row>
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 render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { eqCriteria, criteriaKey, group, dispatch } = this.props;
return <div className={`${this.props.type}-eq-criteria`}>
<AddEqCriteria<T> group={group} dispatch={dispatch}
type={this.props.type} eqCriteria={eqCriteria}
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 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 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 { 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 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 {
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 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 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"