lowdefy/lowdefy

View on GitHub

Showing 198 of 9,127 total issues

Function TitleInput has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const TitleInput = ({
  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 createIcon has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Confirmed

const createIcon = (Icons) => {
  const AiOutlineLoading3Quarters = Icons['AiOutlineLoading3Quarters'];
  const AiOutlineExclamationCircle = Icons['AiOutlineExclamationCircle'];

  const IconBlock = ({ blockId, events, methods, onClick, properties, ...props }) => {
Severity: Minor
Found in packages/client/src/createIcon.js - About 1 hr 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 stringify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return (function stringify(parent, key, node, level) {
    const indent = space ? `\n${new Array(level + 1).join(space)}` : '';
    const colonSeparator = space ? ': ' : ':';

    if (node?.toJSON && typeof node.toJSON === 'function') {
Severity: Minor
Found in packages/utils/helpers/src/stableStringify.js - About 1 hr to fix

    Function callRequest has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

      async callRequest({ actions, arrayIndices, blockId, event, requestId }) {
        const requestConfig = this.requestConfig[requestId];
        if (!this.context.requests[requestId]) {
          this.context.requests[requestId] = [];
        }
    Severity: Minor
    Found in packages/engine/src/Requests.js - About 1 hr to fix

      Function before has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const before = () => {
          triggerEvent.mockReset();
          moveItemDown.mockReset();
          moveItemUp.mockReset();
          pushItem.mockReset();
      Severity: Minor
      Found in packages/utils/block-dev/src/mockBlock.js - About 1 hr to fix

        Function content has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                content: () => {
                  const runAfterUpdate = useRunAfterUpdate();
                  return (
                    <Input.Password
                      id={`${blockId}_input`}

          Function updateState has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Confirmed

            updateState() {
              const toSet = new Set();
              const toDelete = new Set();
              this.loopBlocks((block) => {
                if (block.visibleEval.output !== false) {
          Severity: Minor
          Found in packages/engine/src/Blocks.js - About 1 hr to fix

            Function set has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function set(target, path, value, options) {
              if (!type.isObject(target)) {
                return target;
              }
            
            
            Severity: Minor
            Found in packages/utils/helpers/src/set.js - About 1 hr to fix

              Function callActionLoop has 32 lines of code (exceeds 25 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 1 hr to fix

                Function reviver has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const reviver = (_, value) => {
                      if (!type.isObject(value)) return value;
                      // TODO: pass ~k in errors.
                      // const _k = value['~k'];
                      delete value['~k'];
                Severity: Minor
                Found in packages/operators/src/serverParser.js - About 1 hr to fix

                  Function buildRequest has 32 lines of code (exceeds 25 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 1 hr to fix

                    Function PhoneNumberInput has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Confirmed

                    const PhoneNumberInput = ({
                      blockId,
                      components: { Icon, Link },
                      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 disabledDate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const disabledDate = (disabledDates = {}) => {
                      const min = type.isNone(disabledDates.min)
                        ? undefined
                        : moment(disabledDates.min).utc().startOf('day');
                      const max = type.isNone(disabledDates.max)
                    Severity: Minor
                    Found in packages/plugins/blocks/blocks-antd/src/disabledDate.js - About 1 hr to fix

                      Function reviver has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          const reviver = (_, value) => {
                            if (!type.isObject(value)) return value;
                            // TODO: pass ~r in errors. Build does not have ~k.
                            if (type.isString(value['~r'])) return value;
                            if (Object.keys(value).length !== 1) return value;
                      Severity: Minor
                      Found in packages/operators/src/buildParser.js - About 1 hr to fix

                        Function apiWrapper has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function apiWrapper(handler) {
                          return async function wrappedHandler(req, res) {
                            const context = {
                              // Important to give absolute path so Next can trace build files
                              rid: crypto.randomUUID(),
                        Severity: Minor
                        Found in packages/servers/server-dev/lib/server/apiWrapper.js - About 1 hr to fix

                          Function getLabelCol has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const getLabelCol = (value, inline) => {
                            if (inline) {
                              return { flex: '0 1 auto' };
                            }
                            const defaultVal = {
                          Severity: Minor
                          Found in packages/plugins/blocks/blocks-antd/src/blocks/Label/getLabelCol.js - About 1 hr to fix

                            Function apiWrapper has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function apiWrapper(handler) {
                              return async function wrappedHandler(req, res) {
                                const context = {
                                  // Important to give absolute path so Next can trace build files
                                  rid: crypto.randomUUID(),
                            Severity: Minor
                            Found in packages/servers/server-enterprise/lib/server/apiWrapper.js - About 1 hr to fix

                              Function setBlocksCache has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Confirmed

                                setBlocksCache() {
                                  this.loopBlocks((block) => {
                                    if (block.update) {
                                      block.update = false;
                                      block.eval = {
                              Severity: Minor
                              Found in packages/engine/src/Blocks.js - About 1 hr to fix

                                Function getWrapperCol has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const getWrapperCol = (value, inline) => {
                                  if (inline) {
                                    return { flex: '1 1 auto' };
                                  }
                                  const defaultVal = {

                                  Function getHomeAndMenus has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Confirmed

                                  async function getHomeAndMenus(context) {
                                    const menus = await getMenus(context);
                                  
                                    const homePageId = get(context.config, 'homePageId');
                                    if (homePageId) {
                                  Severity: Minor
                                  Found in packages/api/src/routes/rootConfig/getHomeAndMenus.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language