lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

Avoid too many return statements within this function.
Open

    return `{${out.join(',')}${indent}}`;
Severity: Major
Found in packages/utils/helpers/src/stableStringify.js - About 30 mins to fix

    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 _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
    Severity: Minor
    Found in packages/plugins/operators/operators-js/src/operators/shared/switch.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 TextAreaBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Confirmed

    const TextAreaBlock = ({
      blockId,
      components,
      events,
      loading,
    Severity: Minor
    Found in packages/plugins/blocks/blocks-antd/src/blocks/TextArea/TextArea.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 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 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({
    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 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 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;

    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,
    Severity: Minor
    Found in packages/client/src/initLowdefyContext.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 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;
      }
    Severity: Minor
    Found in packages/servers/server-enterprise/lib/server/checkAuthorizedHost.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 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 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',
        });
    Severity: Minor
    Found in packages/servers/server-enterprise/pages/api/auth/[...nextauth].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 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

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

    Severity
    Category
    Status
    Source
    Language