Showing 199 of 9,537 total issues
File Blocks.js
has 555 lines of code (exceeds 250 allowed). Consider refactoring. Confirmed
/* eslint-disable no-param-reassign */
/*
Copyright 2020-2024 Lowdefy, Inc
Function getter
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Confirmed
function getter(target, path, options) {
if (typeTest.isNone(path) || !isValidObject(target)) {
return typeof options.default !== 'undefined' ? options.default : undefined;
}
- 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 init
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
init(initState) {
this.loopBlocks((block) => {
block.idPattern = block.id;
block.blockIdPattern = block.blockId;
block.id = applyArrayIndices(this.arrayIndices, block.idPattern);
Function recEval
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
recEval(visibleParent) {
let repeat = false;
this.loopBlocks((block) => {
if (block.meta.category === 'input') {
const stateValue = get(this.context.state, block.blockId);
Function stableStringify
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Confirmed
function stableStringify(obj, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
let space = opts.space || '';
if (typeof space === 'number') space = Array(space + 1).join(' ');
- 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 createLinkComponent
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const createLinkComponent = (lowdefy, Link) => {
const { window } = lowdefy._internal.globals;
const backLink = ({ ariaLabel, children, className, id, onClick = () => {}, rel }) => (
<a
id={id}
Function RatingSlider
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const RatingSlider = ({
blockId,
components: { Icon, Link },
events,
loading,
- 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
File PageSiderMenu.js
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Confirmed
/*
Copyright 2020-2024 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Function runClass
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Confirmed
const runClass = ({ location, meta, methodName, operator, params, functions, defaultFunction }) => {
if (!methodName) {
if (meta[params]) {
methodName = params;
} else if (defaultFunction) {
- 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 useFileList
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
const useFileList = ({ properties, methods, value = {} }) => {
const checkedValue = (value) => {
let file = type.isObject(value?.file) ? value.file : null;
if (!file && type.isObject(value?.fileList?.[0])) {
file = value.fileList[0];
- 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 content
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
content: () => {
const runAfterUpdate = useRunAfterUpdate();
return (
<Input
id={`${blockId}_input`}
Function createLink
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Confirmed
function createLink({ backLink, disabledLink, lowdefy, newOriginLink, noLink, sameOriginLink }) {
function link(props) {
if (props.disabled === true) {
return disabledLink(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 getStaticProps
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function getStaticProps() {
const rootConfig = {
home: {
configured: false,
pageId: '',
Function content
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
content: () => {
return (
<Input
id={`${blockId}_input`}
addonBefore={
Function makeReviver
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const makeReviver = (customReviver) => (key, value) => {
let newValue = value;
if (type.isObject(newValue)) {
if (newValue['~r']) {
Object.defineProperty(newValue, '~r', {
- 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 createLinkComponent
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Confirmed
const createLinkComponent = (lowdefy, Link) => {
const { window } = lowdefy._internal.globals;
const backLink = ({ ariaLabel, children, className, id, onClick = () => {}, rel }) => (
<a
id={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 callAction
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
async callAction({ action, arrayIndices, block, event, index, progress, responses }) {
if (!this.actions[action.type]) {
throw {
error: new Error(`Invalid action type "${action.type}" at "${block.blockId}".`),
type: action.type,
Function triggerEvent
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
triggerEvent({ name, event, progress }) {
this.context._internal.lowdefy.eventCallback?.({ name, blockId: this.block.blockId });
const eventDescription = this.events[name];
const result = {
blockId: this.block.blockId,
Function AgGridInput
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Confirmed
const AgGridInput = ({ properties, methods, loading, events, value }) => {
const { quickFilterValue, columnDefs, defaultColDef, ...someProperties } = properties;
const [rowData, setRowData] = useState(value ?? []);
const gridRef = useRef();
- 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 runInstance
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Confirmed
const runInstance = ({ location, meta, methodName, operator, params, instanceType }) => {
if (!meta[methodName]) {
throw new Error(
`Operator Error: ${operator}.${methodName} is not supported, use one of the following: ${Object.keys(
meta
- 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"