Showing 9,449 of 9,537 total issues
Avoid too many return
statements within this function. Open
return `{${out.join(',')}${indent}}`;
Function ControlledListBlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ControlledListBlock = ({
blockId,
components: { Icon, Link },
events,
list,
- 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 applyArrayIndices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const applyArrayIndices = (arrayIndices, name) => {
if (!type.isArray(arrayIndices)) return name;
if (arrayIndices.length === 0) return name;
if (type.isNumber(name)) return name;
const copy = JSON.parse(JSON.stringify(arrayIndices));
- 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 getSheetFromDoc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function getSheetFromDoc({ doc, sheetId, sheetIndex }) {
let sheet;
if (sheetId) {
sheet = doc.sheetsById[sheetId];
if (!sheet) {
- 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 _switch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function _switch({ location, params }) {
if (!type.isArray(params.branches)) {
throw new Error(
`Operator Error: switch takes an array type as input for the branches. Received: ${JSON.stringify(
params
- 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 TextAreaBlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
const TextAreaBlock = ({
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 displayMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
displayMessage({ defaultMessage, duration, hideExplicitly, message, status }) {
let close = () => undefined;
if ((hideExplicitly && message !== false) || (!hideExplicitly && !type.isNone(message))) {
close = this.context._internal.lowdefy._internal.displayMessage({
content: type.isString(message) ? message : defaultMessage,
- 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 PageHeaderMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const PageHeaderMenu = ({
basePath,
blockId,
components: { Icon, Link },
content,
- 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 callActionLoop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
async callActionLoop({ actions, arrayIndices, block, event, progress, responses }) {
for (const [index, action] of actions.entries()) {
try {
if (action.async === true) {
this.callAsyncAction({
- 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 Selector
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Selector = ({
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
Function SkeletonInput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SkeletonInput = ({ properties, methods }) => {
let inputHeight;
switch (properties.size) {
case 'small':
inputHeight = 24;
- 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 initLowdefyContext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function initLowdefyContext({ auth, Components, config, lowdefy, router, stage, types, window }) {
if (!lowdefy._internal?.initialised) {
lowdefy._internal = {
actions: types.actions,
blockComponents: types.blocks,
- 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 checkAuthorizedHost
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function checkAuthorizedHost({ license, req }) {
const authorizedUrls = license.metadata?.domains ?? [];
if (authorizedUrls.length === 0) {
return true;
}
- 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 SkeletonAvatar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const SkeletonAvatar = ({ properties, methods }) => {
let size = properties.size ?? 32;
if (type.isString(size)) {
switch (properties.size) {
case 'small':
- 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 handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function handler({ context, req, res }) {
if (authJson.configured !== true) {
return res.status(404).json({
message: 'Auth not configured',
});
- 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 createLogUsage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function createLogUsage({ usageDataRef }) {
let lastTimestamp = 0;
let isOffline = false;
let machine = localStorage.getItem('lowdefy_machine_id');
if (!machine) {
- 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 getRefPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function getRefPath(refDefinition) {
if (type.isObject(refDefinition)) {
if (refDefinition.path) {
return refDefinition.path;
}
- 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 getServer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
async function getServer({ context, packageName, directory }) {
if (context.lowdefyVersion === 'local') {
context.print.warn(`Running local ${packageName}.`);
return;
}
- 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 sanitizeShrink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
const sanitizeShrink = (value) => {
if (value === 'unset' || value === 'inherit' || value === 'initial') {
return value;
}
if (type.isNumber(value) && value >= 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 nunjucksFunction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const nunjucksFunction = (templateString) => {
// template was already compiled
if (type.isFunction(nunjucksTemplates[templateString])) {
return nunjucksTemplates[templateString];
}
- 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"