Showing 199 of 9,537 total issues
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"
Further reading
Function mockBlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mockBlock = ({ meta, schema }) => {
const mockMath = Object.create(global.Math);
mockMath.random = () => 0.5;
global.Math = mockMath;
const moveItemDown = jest.fn();
- 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 recursiveBuild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function recursiveBuild({ context, refDef, count, referencedFrom }) {
// TODO: Maybe it would be better to detect a cycle, since this is the real issue here?
if (count > 10000) {
throw new Error(`Maximum recursion depth of references exceeded.`);
}
- 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 sanitizeGrow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
const sanitizeGrow = (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 recursiveFormatPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function recursiveFormatPath({ data, instancePath, formattedPath = '', gap = '', root = false }) {
if (instancePath.length === 0) return formattedPath;
const key = instancePath.shift();
const newData = get(data, key);
let newPath;
- 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 buildRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function buildRequest(request, pageContext) {
const { auth, checkDuplicateRequestId, pageId, typeCounters } = pageContext;
if (type.isUndefined(request.id)) {
throw new Error(`Request id missing at page "${pageId}".`);
}
- 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 buildApp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function buildApp({ components }) {
if (type.isNone(components.app)) {
components.app = {};
}
if (!type.isObject(components.app)) {
- 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"