Showing 199 of 9,537 total issues
Consider simplifying this complex logical expression. Open
if (properties.autoBounds !== false && bounds && map) {
if (properties.infoWindow) {
bounds.extend(properties.infoWindow.position ?? MAP_DEFAULTS.center);
}
(properties.markers ?? []).forEach((marker) => {
Function createLicenseRedirectCallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function createLicenseRedirectCallback(context, license) {
async function licenseRedirectCallback({ url, baseUrl }) {
if (license.code !== 'VALID') {
const code = ['NO_LICENSE', 'EXPIRED'].includes(license.code) ? license.code : 'INVALID';
return `/lowdefy/license-invalid?code=${code}`;
- 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 getIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getIndex = (value, options, key = 'value') => {
// eslint-disable-next-line no-plusplus
for (let i = 0; i < options.length; i++) {
if (type.isPrimitive(options[i]) && options[i] === value) {
return `${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 triggerEvent
has a Cognitive Complexity of 7 (exceeds 5 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,
- 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 getFileFromNavigator
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getFileFromNavigator = async () => {
const items = await navigator.clipboard.read();
for (const item of items) {
for (const type of item.types) {
if (type === 'image/png' || type === 'image/jpeg') {
- 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 ParagraphBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ParagraphBlock = ({ blockId, components: { Icon }, events, methods, properties }) => (
<Paragraph
id={blockId}
className={methods.makeCssClass(properties.style)}
code={properties.code}
- 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 DownloadCsv
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function DownloadCsv({ params }) {
const { filename, data, fields: flds } = params;
if (!Array.isArray(data) || typeof data[0] !== 'object') {
throw new Error('csvMake data takes an array of objects');
}
- 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 getSaturation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getSaturation = (hsv, i, isLight) => {
let saturation;
if (isLight) {
saturation = hsv.s - saturationStep * i;
} else if (i === darkColorCount) {
- 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 disabledDate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const disabledDate = (disabledDates = {}) => {
const min = type.isNone(disabledDates.min)
? undefined
: moment(disabledDates.min).utc().startOf('day');
const max = type.isNone(disabledDates.max)
- 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 TitleBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TitleBlock = ({ blockId, components: { Icon }, events, properties, methods }) => {
return (
<Title
id={blockId}
className={methods.makeCssClass([
- 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 MenuComp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const MenuComp = ({
blockId,
components: { Icon, Link },
events,
menus,
- 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 ButtonBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ButtonBlock = ({
blockId,
components: { Icon },
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
Function CheckboxSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CheckboxSelector = ({
blockId,
components,
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
Function ButtonSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ButtonSelector = ({
blockId,
components,
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
Function RadioSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const RadioSelector = ({
blockId,
components,
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
Function TagBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TagBlock = ({
blockId,
components: { Icon },
events,
methods,
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { children, description, fallback, fullPage, message, name } = this.props;
const { hasError, error } = this.state;
if (hasError) {
if (fallback) {
- 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 Label
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
const Label = ({
blockId,
components: { Icon },
content,
methods,
- 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 layoutParamsToArea
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
const layoutParamsToArea = ({ areaKey, area = {}, layout = {} }) => {
if (areaKey !== 'content') {
return area;
}
area.align = type.isNone(area.align) ? layout.contentAlign : area.align;
- 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 formatArrayKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
function formatArrayKey({ index, object }) {
if (type.isObject(object) && (!type.isNone(object.id) || !type.isNone(object.type))) {
const objectId = type.isNone(object.id) ? '_ERROR_MISSING_ID_' : object.id;
const objectType = type.isNone(object.type) ? '_ERROR_MISSING_TYPE_' : object.type;
return `[${index}:${objectId}:${objectType}]`;
- 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"