lowdefy/lowdefy

View on GitHub

Showing 198 of 9,129 total issues

Function PageHeaderMenu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const PageHeaderMenu = ({
  basePath,
  blockId,
  components: { Icon, Link },
  content,

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':

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,
Severity: Minor
Found in packages/plugins/blocks/blocks-antd/src/blocks/Selector/Selector.js - About 25 mins to fix

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) {
Severity: Minor
Found in packages/servers/server-enterprise/lib/client/createLogUsage.js - About 25 mins to fix

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,
Severity: Minor
Found in packages/engine/src/Actions.js - About 25 mins to fix

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 ControlledListBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ControlledListBlock = ({
  blockId,
  components: { Icon, Link },
  events,
  list,

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));
Severity: Minor
Found in packages/utils/helpers/src/applyArrayIndices.js - About 25 mins to fix

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) {

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}".`);
  }
Severity: Minor
Found in packages/build/src/build/buildPages/buildBlock/buildRequests.js - About 25 mins to fix

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.`);
  }
Severity: Minor
Found in packages/build/src/build/buildRefs/recursiveBuild.js - About 25 mins to fix

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) {
Severity: Minor
Found in packages/layout/src/deriveLayout.js - About 25 mins to fix

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)) {
Severity: Minor
Found in packages/build/src/build/buildApp.js - About 25 mins to fix

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];
  }
Severity: Minor
Found in packages/utils/nunjucks/src/index.js - About 25 mins to fix

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;
  }
Severity: Minor
Found in packages/cli/src/utils/getServer.js - About 25 mins to fix

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) {
Severity: Minor
Found in packages/layout/src/deriveLayout.js - About 25 mins to fix

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();
Severity: Minor
Found in packages/utils/block-dev/src/mockBlock.js - About 25 mins to fix

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;
Severity: Minor
Found in packages/build/src/utils/formatErrorMessage.js - About 25 mins to fix

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;
    }
Severity: Minor
Found in packages/build/src/build/buildRefs/getRefPath.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language