lowdefy/lowdefy

View on GitHub

Showing 198 of 9,129 total issues

Function PageSiderMenu has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Confirmed

const PageSiderMenu = ({
  basePath,
  blockId,
  components: { Icon, Link },
  events,

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 AgGridInput has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Confirmed

const AgGridInput = ({ properties, methods, loading, events, value }) => {
  const { quickFilterValue, columnDefs, defaultColDef, ...someProperties } = properties;
  const [rowData, setRowData] = useState(value ?? []);

  const gridRef = useRef();
Severity: Minor
Found in packages/plugins/blocks/blocks-aggrid/src/AgGridInput.js - About 2 hrs 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 parse has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

  parse({ args, input, location, operatorPrefix = '_' }) {
    if (type.isUndefined(input)) {
      return { output: input, errors: [] };
    }
    if (args && !type.isArray(args)) {
Severity: Minor
Found in packages/operators/src/buildParser.js - About 2 hrs 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 DateTimeSelector has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const DateTimeSelector = ({
  blockId,
  components: { Icon },
  events,
  loading,

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

function kindOf(val) {
  // eslint-disable-next-line no-void
  if (val === void 0) return 'undefined';
  if (val === null) return 'null';

Severity: Minor
Found in packages/utils/helpers/src/type.js - About 2 hrs 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 enforceType has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function enforceType(typeName, value) {
  switch (typeName) {
    case 'string':
      return type.isString(value) && value !== '' ? value : null;
    case 'number':
Severity: Minor
Found in packages/utils/helpers/src/type.js - About 2 hrs 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 parse has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

  parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
    if (type.isUndefined(input)) {
      return { output: input, errors: [] };
    }
    if (event && !type.isObject(event)) {
Severity: Major
Found in packages/operators/src/webParser.js - About 2 hrs to fix

    Function buildEvents has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

    function buildEvents(block, pageContext) {
      if (block.events) {
        Object.keys(block.events).map((key) => {
          if (
            (!type.isArray(block.events[key]) && !type.isObject(block.events[key])) ||
    Severity: Major
    Found in packages/build/src/build/buildPages/buildBlock/buildEvents.js - About 2 hrs to fix

      Function AgGrid has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Confirmed

      const AgGrid = ({ properties, methods, loading, events }) => {
        const {
          quickFilterValue,
          columnDefs,
          defaultColDef,
      Severity: Minor
      Found in packages/plugins/blocks/blocks-aggrid/src/AgGrid.js - About 2 hrs 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 labelLogic has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      const labelLogic = ({
        blockId,
        content,
        methods,
        properties = {},
      Severity: Minor
      Found in packages/plugins/blocks/blocks-antd/src/blocks/Label/labelLogic.js - About 2 hrs 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 parse has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        parse({ args, input, location, operatorPrefix = '_' }) {
          if (type.isUndefined(input)) {
            return { output: input, errors: [] };
          }
          if (args && !type.isArray(args)) {
      Severity: Minor
      Found in packages/operators/src/serverParser.js - About 2 hrs 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 stubBlockProps has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      const stubBlockProps = ({ block, meta, logger = () => null, initialValue, schema }) => {
        const [value, setState] = useState(type.enforceType(meta.valueType, block.value || initialValue));
        const setValue = (val) => {
          setState(type.enforceType(meta.valueType, val));
        };
      Severity: Minor
      Found in packages/utils/block-dev/src/stubBlockProps.js - About 2 hrs 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 getter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getter(target, path, options) {
        if (typeTest.isNone(path) || !isValidObject(target)) {
          return typeof options.default !== 'undefined' ? options.default : undefined;
        }
      
      
      Severity: Major
      Found in packages/utils/helpers/src/get.js - About 2 hrs to fix

        Function stableStringify has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function stableStringify(obj, opts) {
          if (!opts) opts = {};
          if (typeof opts === 'function') opts = { cmp: opts };
          let space = opts.space || '';
          if (typeof space === 'number') space = Array(space + 1).join(' ');
        Severity: Major
        Found in packages/utils/helpers/src/stableStringify.js - About 2 hrs to fix

          Function createIcon has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Confirmed

          const createIcon = (Icons) => {
            const AiOutlineLoading3Quarters = Icons['AiOutlineLoading3Quarters'];
            const AiOutlineExclamationCircle = Icons['AiOutlineExclamationCircle'];
          
            const IconBlock = ({ blockId, events, methods, onClick, properties, ...props }) => {
          Severity: Major
          Found in packages/client/src/createIcon.js - About 2 hrs to fix

            Function getFromArray has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            function getFromArray({ params, array, key, operator, location }) {
              if (params === true) return array;
              if (type.isString(params)) {
                return array.find((item) => item[key] === params);
              }
            Severity: Minor
            Found in packages/operators/src/getFromArray.js - About 2 hrs 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 setupLink has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            function setupLink(lowdefy) {
              const { router } = lowdefy._internal;
              const { window } = lowdefy._internal.globals;
              const backLink = () => router.back();
              const disabledLink = () => {};
            Severity: Minor
            Found in packages/client/src/setupLink.js - About 2 hrs 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 makeReplacer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            const makeReplacer = (customReplacer, isoStringDates) => (key, value) => {
              let dateReplacer = (date) => ({ '~d': date.valueOf() });
              if (isoStringDates) {
                dateReplacer = (date) => ({ '~d': date.toISOString() });
              }
            Severity: Minor
            Found in packages/utils/helpers/src/serializer.js - About 2 hrs 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 parse has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Confirmed

              parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
                if (type.isUndefined(input)) {
                  return { output: input, errors: [] };
                }
                if (event && !type.isObject(event)) {
            Severity: Minor
            Found in packages/operators/src/webParser.js - About 2 hrs 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 validateAuthConfig has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            async function validateAuthConfig({ components }) {
              if (type.isNone(components.auth)) {
                components.auth = {};
              }
              if (!type.isObject(components.auth)) {
            Severity: Minor
            Found in packages/build/src/build/buildAuth/validateAuthConfig.js - About 2 hrs 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